
start:	
back:	
	call	display
	call	pip_pip
	call	delay1ms
	inc 	digit1
	inc 	digit2
	inc 	digit3
	inc 	digit4
; Code inserted here....(note the added 0's in the look up table
        mov     a,digit1              ; Check if last digit is shifted out
        cjne    a,#0, start           ; if not then move on
        mov digit1,#0           ; if last digit is shifted, then re-init numbers
        mov digit2,#1 
        mov digit3,#2 
        mov digit4,#3
	jmp 	start           ; ....and move on
; Code inserted till here....

....
....
....	
lookup:
        db      3fh,06h,5bh,4fh,66h,6dh,7dh,07h     ;0,1,2,3,4,5,6,7,8
        db      7fh,6fh,48h,43h,0c6h,61h,44h,4eh   ;9,a,b,c,d,e,f
        db      0,0,0,0,0,0,0

