btfss flag, 0 ;check which LED was last
goto Do_tens
movlw b'00000000' ; Turn off the previous segment, keep from ghosting
movwf SEG_PORT
movlw b'00000001'
movwf GRD_PORT
movf ones,w
;andlw 0x0F ;make sure in range of table
call LED_Table
movwf SEG_PORT
bcf flag,0
goto INTX
Do_tens
movlw b'00000000' ; Turn off the previous segment, keep from ghosting
movwf SEG_PORT
movlw b'00000010'
movwf GRD_PORT
movf tens,w
andlw 0x0F ;make sure in range of table
call LED_Table
movwf SEG_PORT
bsf flag,0