SWEET, I'm glad that worked for you.
Let's see here, LFSR. It stands for "Load File Select Register" or Load FSR.
It takes a 12-bit constant and loads the low byte in FSRxL and the highbyte in FSRxH. It does it in 2 instruction cycles, and doesn't care what bank of memory is selected by BSR at the time.
Using the "old way" movf / movwf you first need to select the proper bank (or use the "a" option to select the access bank) then use 4 instruction cycles to accomplish the same thing.
While your program wasn't large enough to worry about bank switching, sometimes is has to be handled manually.
The 18F's have several new Opcodes that can make life easier. MOVFF is one of the best. For a complete list, see the "Instruction Set Summary" towards the end of the datasheet for the device you are using. I know..., I hate being told to RTFM too, but sometimes ya gotta do it.
regards,
Darrel
Bookmarks