.include	"8535def.inc"
.include	"map.asm"
;****** Display buffer in DATA segment ***
disp_buf:	.byte 4
;****** Digit position in DATA segment ***
dig_pos:	.byte 1
;*****************************************
.equ	mosi=5
.equ	miso=6
.equ	sck=7
.equ	ss=4
.cseg
.org	0
reset:
	rjmp	init
init:
.include	"init.asm"
;********** Init. SPI for display *******
	rcall	init_spi
;****************************************
	sei
main_loop:
	rcall	get_adc
;******** Call display routine *****
	rcall	display
;***********************************
	rcall	get_cmd
	brcc	main_loop
	rcall	exec_cmd	
	rjmp	main_loop
.include	"uart.asm"
.include	"lib.asm"
.include	"adc.asm"
;****** Include SPI (display) module ******
.INCLUDE	"SPI.ASM"
;************************************