snipped original problem > > eric van es wrote: > >Try this: it allows you to put your lookup tables wherever you want 'em. >You can even put them ON the edge of the first page and run over to the >second page. > >;===================LOOKUP TABLE >LOOKUP > MOVWF OFFSET ;MOVE > MOVLW HIGH BASEADD ;LOAD HIGH BYTE OF BASE ADDRESS INTO W > MOVWF PCLATH ;HIGH BASEADD INTO PC-LATCH > MOVLW LOW BASEADD ;LOAD LOW BYTE OF BASE ADDRESS INTO W > ADDWF OFFSET,W ;ADD OFFSET TO PC LOW >!!-->> BTFSC STATUS,C ;TEST FOR ROLL-OVER IN PC >!!-->> INCF PCLATH ;INCREMENT PCLATH IF ROLL-OVER DETECTED > MOVWF PCL ;LOW BASEADD INTO PCL > >BASEADD RETLW B'01111101' ;1 - DUD! DUE TO MOD8 INCREMENTING TO 1 > RETLW B'01111101' ;1 > RETLW B'10101010' ;2 > RETLW B'01101010' ;3 > RETLW B'11100100' ;4 > RETLW B'01111000' ;5 > RETLW B'10101100' ;6 > RETLW B'01101001' ;7 > >-- Nice solution Eric, why didn't I think of that? ,don't answer ;-) For a slight run time penalty this is a much neater way than some of the macro based solutions I have seen. Ray Gardiner Technical Director DSP systems Pty. Ltd. ray@dsp-systems.com private email to:- ray@netspace.net.au http://www.dsp-systems.com