I seem to be stumped on how to convert this code to work for the pic18f series.
i guess i am not familiar with the fsr registers in the 18cf
any help or pointers would be appreciated.
BINBCD bcf STATUS,0 ; clear the carry bit
movlw .16 ;HBYTE,LOWBYTE INTO BCD R0,R1,R2 R0 = HIGH BYTE
movwf count
clrf R0
clrf R1
clrf R2
ACCBLOop16 rlf L_byte, 1
rlf H_byte, 1
rlf R2, 1 ;should be rlcf for 18f
rlf R1, 1
rlf R0, 1
decfsz count, 1
goto adjDEC
RETLW 0
adjDEC movlw R2
movwf FSR
call adjBCD
movlw R1
movwf FSR
call adjBCD
movlw R0
movwf FSR
call adjBCD
goto ACCBLOop16
adjBCD movlw 3
addwf 0,W
movwf temp
btfsc temp,3 ; test if result > 7
movwf 0
movlw 30
addwf 0,W
movwf temp
btfsc temp,7 ; test if result > 7
movwf 0 ; save as MSD
RETLW 0
i guess i am not familiar with the fsr registers in the 18cf
any help or pointers would be appreciated.
BINBCD bcf STATUS,0 ; clear the carry bit
movlw .16 ;HBYTE,LOWBYTE INTO BCD R0,R1,R2 R0 = HIGH BYTE
movwf count
clrf R0
clrf R1
clrf R2
ACCBLOop16 rlf L_byte, 1
rlf H_byte, 1
rlf R2, 1 ;should be rlcf for 18f
rlf R1, 1
rlf R0, 1
decfsz count, 1
goto adjDEC
RETLW 0
adjDEC movlw R2
movwf FSR
call adjBCD
movlw R1
movwf FSR
call adjBCD
movlw R0
movwf FSR
call adjBCD
goto ACCBLOop16
adjBCD movlw 3
addwf 0,W
movwf temp
btfsc temp,3 ; test if result > 7
movwf 0
movlw 30
addwf 0,W
movwf temp
btfsc temp,7 ; test if result > 7
movwf 0 ; save as MSD
RETLW 0