piclist 2000\04\17\123343a >
Thread: Store data in rom (f877)
www.piclist.com/techref/microchip/memory.htm?key=data
flavicon
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
locations
;       pointerlow and pointerhigh are the double-precision pointer into the
table.
;       NOTE -- PCLATH is altered, so you will need to restore it before
executing
;       any goto or call instructions!

GetByteFromBigTable:
       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
       skpnc
       incf    PCLATH,f                ;propagate the carry, if any from
low half
       movfw   pointerhigh
       addwf   PCLATH,f
       movfw   temp
       movwf   PCL                     ;jump into the table

BigTable:
       retlw   'a'
       retlw   'b'
       etc.

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
boundary.

> {Original Message removed}
<117EC968C6D8D211A9520020AF155EB21A6074@ISERVER>

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...