.org   000h
ljmp   start

.org   100h
start:
	lcall  init
main:
	mov    a,  #0Fh		   ; Mask R3 and send it to the P1 LED's
	anl    a, R3
	mov    R3, a
	mov    P1, a
	
	mov   dptr, #0xFE01	   ; Send R3 to the seven segment display
	movx  @dptr, a
	
	mov    R0, #00h		   ; Wait a second or two
	mov    R1, #00h
	mov    R2, #0Ah
	delay:
		djnz   R0, delay
		djnz   R1, delay
		djnz   R2, delay

	inc    R3			   ; Increment R3
	sjmp   main			   ; Repeat
	
init:
	mov   dptr, #0xFE00    ; Set up PSoC UART flags for 9600 baud communication
	mov   a, #0x15
	movx  @dptr, a
	
	mov   R3, #00h         ; Set up display value to start at zero
	
	ret
