Lou Calkins wrote: > Hi Lee - > > I am not an expert on the PCLATH register, but I have had some very > unpleasant experiences because of it (rather because of my lack of knowledge > of it). I will try to respond to some of your questions the best I can. > What I do when I use a look-up table: ;=============================LOOKUP TABLE================ LOOKUP 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 VALUE,W ;ADD OFFSET TO PC LOW BTFSC STATUS,C ;TEST FOR ROLL-OVER IN PC <-- this is the significant part! INCF PCLATH ;INCREMENT PCLATH IF ROLL-OVER DETECTED <-- So's this! MOVWF PCL ;LOW BASEADD INTO PCL BASEADD RETLW B'10000100' ;0 RETLW B'10101111' ;1 RETLW B'11001000' ;2 RETLW B'10001001' ;3 RETLW B'10100011' ;4 RETLW B'10010001' ;5 RETLW B'10010000' ;6 RETLW B'10001111' ;7 RETLW B'10000000' ;8 RETLW B'10000001' ;9 See pretty easy! I didn't think this out myself though. My lecturer at Tech showed us the light.... Cheers... and good luck! -- Eric van Es | Cape Town, South Africa mailto:vanes@ilink.nis.za | http://www.nis.za/~vanes LOOKING FOR TEMPORARY / HOLIDAY ACCOMODATION? http://www.nis.za/~vanes/accom.htm