--- Tony Nixon wrote: > Morgan Olsson wrote: > > > > In the thread "A-D on PIC 16C73B" , table boundary > problem was mentioned. > > > If a value in ram is specified for a 256 element > lookup table then this > may help deal with boundary issues. There are > probably better methods > around also. > > > movlw high ($ + 8) > movwf pclath > movf RAMx,w > addlw low ($ + 6) > btfsc Status,Carry > incf pclath > movf RAMx,w > addwf pcl > retlw 0h > retlw 1h > etc... > Here's a method that's better. I first saw something like this posted by mike kietz about 2 years ago. movlw high (TABLE_START) movwf pclath movf index,w addlw TABLE_START skpnc incf pclath,f movwf pcl TABLE_START retlw ... If the table is called such that W is the index: addlw TABLE_START movwf temp rlf known_zero,w addlw high(TABLE_START) movwf pclath movf temp,w movwf pcl TABLE_START .lo __________________________________________________ Do You Yahoo!? Thousands of Stores. Millions of Products. All in one place. Yahoo! Shopping: http://shopping.yahoo.com