bsf Flags,0 ;use bit 0 of variable flags to indicate
;we are suppressing leading zeroes.
movfw Digit3 ;get most significant digit
btfs[COLOR="Red"]s[/COLOR] STATUS,Z ;is digit three = zero
bcf Flags,0 ;no so clear the leading zero flag
call Table ;get the segment pattern
btfsc Flags,0 ;if leading zero flag is set
movlw 0xff ;then display nothing.
clrf PORTA ;turn off display
movwf PORTB
bsf PORTA,3 ;turn on digit 3
call Delay
movfw Digit2
btfs[COLOR="Red"]s[/COLOR] STATUS,Z
bcf Flags,0
call Table
btfsc Flags,0 ; if leading zero flag is set
movlw 0xff ; then display nothing.
clrf PORTA
movwf PORTB
bsf PORTA,2
call Delay
movfw Digit1
btfs[COLOR="Red"]s[/COLOR] STATUS,Z
bcf Flags,0
call Table
btfsc Flags,0 ; if leading zero flag is set
movlw 0xff ; then display nothing.
clrf PORTA
movwf PORTB
bsf PORTA,1
call Delay
movfw Digit0
call Table
clrf PORTA
movwf PORTB
bsf PORTA,0
call Delay