sel_LSD
movlw b'00000000' ; K3/DP (RC2) pin 'output' |b0
movwf INDF ; trisc = '00000000' RC2 output |b0
movlw b'00100111' ; PORTC shadow | 1<<RC2 |b0 <--
movwf PORTC ; active hi DIGIT_3 (RC2) 'on' |b0 <--
; bsf DIGIT_3 ; active hi DIGIT_3 (RC2) 'on' |b0 <--
btfss INDEX,0 ;
goto fire_LSD_A ;
fire_LSD_C
movf D3,W ; digit 3, 0..9 |b0
call LEDTABLE_C ; get segments D/E/F |b0
xorlw b'00100111' ; PORTC shadow ^ segments D/E/F |b0 <--
movwf PORTC ; clr the active D/E/F segments |b0 <--
; xorwf PORTC,F ; clr active lo D/E/F segments |b0 <--
goto display_end ;
fire_LSD_A ;
movf D3,W ; digit 3, 0..9 |b0
call LEDTABLE_A ; get segments G/C/B/A |b0
xorwf PORTA,F ; clr active lo G/C/B/A segments |b0
goto display_end ;
sel_CSD
movlw b'00101011' ; PORTC shadow | 1<<RC3 |b0 <--
movwf PORTC ; active hi DIGIT_2 (RC3) 'on' |b0 <--
; bsf DIGIT_2 ; active hi DIGIT_2 (RC3) 'on' |b0 <--
btfss INDEX,0 ;
goto fire_CSD_A ;
fire_CSD_C ;
movf D2,W ; digit 2, 0..9 |b0
call LEDTABLE_C ; get segments D/E/F |b0
xorlw b'00101011' ; PORTC shadow ^ segments D/E/F |b0 <--
movwf PORTC ; clr the active D/E/F segments |b0 <--
; xorwf PORTC,F ; clr active lo D/E/F segments |b0 <--
btfsc mode ; dec pt? no, skip, else |b0
bcf INDF,2 ; trisc = '00000000' RC2 output |b0
goto display_end ; branch (finish up)
fire_CSD_A
movf D2,W ; digit 2, 0..9 |b0
call LEDTABLE_A ; get segments G/C/B/A |b0
xorwf PORTA,F ; clr active lo G/C/B/A segments |b0
goto display_end ;
;
sel_MSD
movlw b'00110011' ; PORTC shadow | 1<<RC4 |b0 <--
movwf PORTC ; active hi DIGIT_1 (RC4) 'on' |b0 <--
; bsf DIGIT_1 ; active hi DIGIT_1 (RC4) 'on' |b0 <--
btfss INDEX,0 ;
goto fire_MSD_A ;
fire_MSD_C ;
movf D1,W ; digit 1, 0..9 |b0
call LEDTABLE_C ; get segments D/E/F |b0
xorlw b'00110011' ; PORTC shadow ^ segments D/E/F |b0 <--
movwf PORTC ; clr the active D/E/F segments |b0 <--
; xorwf PORTC,F ; clr active lo D/E/F segments |b0 <--
btfss mode ; dec pt? no, skip, else |b0
bcf INDF,2 ; trisc = '00000000' RC2 output |b0
goto display_end ;
fire_MSD_A
movf D1,W ; digit 1, 0..9 |b0
call LEDTABLE_A ; get segments G/C/B/A |b0
xorwf PORTA,F ; clr active lo G/C/B/A segments |b0
display_end
incf INDEX,F ; bump index 0..5 -> 1..6
retlw 0 ;