I want to save/restore the PIC's carry bit. I'm using the 16F628A.
SAVE_CARRY
btfss STATUS, 0
goto CARRY_OFF
CARRY_ON
bsf carry, 0
return
CARRY_OFF
bcf carry, 0
return
RESTORE_CARRY
btfss carry, 0
goto RESTORE_CARRY_OFF
RESTORE_CARRY_ON
bsf STATUS, 0
return
RESTORE_CARRY_OFF
bcf STATUS, 0
return
There must be a better way. Is there?
Best Answer
One way that you can do:
If you need to save the registers "W" and "Status", before execute an interrupt code, there is another way: