I think you can avoid the use of TEMP: indexlsb equ 0x80 indexmsb equ 0x81 ;table index is here temp equ 0x82 lookup: movfw indexmsb addlw high (table) ;don't need if table starts in first segment movwf PCLATH movlw low (table) addwf indexlsb,w skpnc incf PCLATH,F movwf PCL table retlw 1 retlw 2 ... 2 cycles shorter / faster. dwayne At 03:46 PM 12/21/01 -0600, Don Hyde wrote: >indexlsb equ 0x80 >indexmsb equ 0x81 ;table index is here >temp equ 0x82 > >lookup: > movlw low table > addwf indexlsb,w > movwf temp > movfw indexmsb > skpnc > incf indexmsb,w > addlw high table > movwf PCLATH > movfw temp > movwf FSR > >table retlw 1 > retlw 2 > ... > > > > -----Original Message----- > > From: Fabio Pereira [mailto:fabio@PP.ADV.BR] > > Sent: Friday, December 21, 2001 2:44 PM > > To: PICLIST@MITVMA.MIT.EDU > > Subject: Re: [PIC]: help with large table > > > > > > > I need some code for a neat large table reader, > > > which just gets one data byte and incs the 16bit > > > pointer. The table is formatted in a continuous > > > string of retlw instructions, and the first byte > > > of the table can be anywhere in memory. > > > * 16bit address of table first byte > > > * 16bit address of table last byte > > > (table can be any length up to 8k) Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 17 years of Engineering Innovation (1984 - 2001) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu