Excuse me for the dubble posting. Se below for my humble attempt at your problem. Stig > Hi there ... > > I have to implement several lookup tables of 256 values. > > I split the tables in parts of 128 values bit have a page select problem > ... program crashes ... > > does anyone has an example program or can explain me more in detail how > i can do this ? > > here is a part of my soft: > > LUT.ASM > ************************************************************************ > ********************* > org 0xC00 > > LUT1 > addwf PCL,f > > retlw 0x000 > > ... 128 values > > > org 0xD00 > > LUT2 > addwf PCL,f > > retlw 0x008 > > ... 128 values > > > org 0xE00 > > LUT3 > addwf PCL,f > > retlw 0x010 > > ... 128 values > > > I now access the table by doing: > > ; bsf STATUS,RP0 Why do you set RP0? PCLATH is in both bank0 and bank1. > ; movlw 0x00D > ; movwf PCLATH > ; > ; bcf STATUS,RP0 > ; movfw GOVALUE I think you want to use movf here. > ; > ; bsf STATUS,RP0 > ; call LUT2 > ; movlw 0x000 > ; movwf PCLATH Are you sure that 0x000 is the actual location of adress of pclath? Remember that your table takes up the first 256 spaces or so... Try this instead: movf high $ movwf PCLATH > ; > ; bcf STATUS,RP0 > ; movwf RETURNVALUE > > > Thanks in advance ! > > And happy PICing > > Bart >