piclist 2000\04\17\123343a >
Thread: Store data in rom (f877)
face BY : Don Hyde email (remove spam text)

It's not impossible to use a table or retlw's that's larger than 256
locations, just a little more trouble since you need to use and compute a
double-precision pointer.

;       GetByteFromBigTable -- fetches a byte from a table larger than 256
;       pointerlow and pointerhigh are the double-precision pointer into the
;       NOTE -- PCLATH is altered, so you will need to restore it before
;       any goto or call instructions!

       movlw   low BigTable    ;start adding pointer to address of table
       addwf   pointerlow,w
       movwf   temp                    ;low half of double-precision add
       movlw   high BigTable   ;now start the high half
       movwf   PCLATH
       incf    PCLATH,f                ;propagate the carry, if any from
low half
       movfw   pointerhigh
       addwf   PCLATH,f
       movfw   temp
       movwf   PCL                     ;jump into the table

       retlw   'a'
       retlw   'b'

Note that BigTable does not need to be in the same page with
GetByteFromBigTable, and does not need to either start or end on a page

> {Original Message removed}

See also: www.piclist.com/techref/microchip/memory.htm?key=data
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Store data in rom (f877)

month overview.

new search...