
Originally Posted by
SteveB
Shouldn't the ASM intructions include the memory access bit=1, as indicated by the bold changes, so that the command uses the bank selected by BSR rather than the access bank?
I’m responding to my own post/question. This will save Darrel the trouble and may help others.
After more careful examination of the datasheets, it looks like the default values for ‘d’ and ‘a’ are 1 for most of the 18F instructions. This is not clearly listed in “Complete PIC18 Reference Manual,” but was listed in the 18F4620 datasheet, so I missed it on first inspection. That being said, it appears that the previously listed code could be simply:
Code:
CHK?RP _V24
incfsz _V24
goto NoCarry
incfsz _V24 + 1
goto NoCarry
incfsz _V24 + 2
This would default to saving the result back to the _V24, and using BSR to select the bank. Haven't checked ALL the instructions that use these bits, nor ALL the 18Fs, so YMMV.
EDIT: I also found this note in the datasheet:
Note: If the register is specified with the full 12-bit address, the assembler will automatically force the access bit to a ’0’ (when the address is in the access RAM area) or a ’1’ (for all other addresses).
Steve
Bookmarks