Mosaic
Well-Known Member
Hi guyz , need a bit of help.
I am using a full 512 bytes in a computed goto, so I do the auto update of the PCLATH based on this
which does the job of rollover.
BUT!!, the addwf PCL,f starts as the first item on a new page boundary and when my goto offset (SuboffsetL) reaches 255. The code hangs on an infinite loop at the addwf PCL,w instruction. If I skip # 255 altogether and bump SuboffsetL to 0 and increment the PCLATH it will continue but SKIP the databyte at location 255.
Can't figure how to get the byte at location #255?
I am using a full 512 bytes in a computed goto, so I do the auto update of the PCLATH based on this
Code:
movlw High(Table)
addwf SuboffsetH,W
movwf PCLATH
movlw Low(Table)
addwf SuboffsetL,W
btfsc STATUS,C ;test if rollover 256 byte page, else skip skpnc
incf PCLATH,F
......
Table addwf PCL,f
dt byte,byte,byte,byte etc........
which does the job of rollover.
BUT!!, the addwf PCL,f starts as the first item on a new page boundary and when my goto offset (SuboffsetL) reaches 255. The code hangs on an infinite loop at the addwf PCL,w instruction. If I skip # 255 altogether and bump SuboffsetL to 0 and increment the PCLATH it will continue but SKIP the databyte at location 255.
Can't figure how to get the byte at location #255?
Last edited: