Hi All, I am studying the PIC, and plan to write some code for ham radio. :) Here I am confused when I wrote code for table looking up. The PIC I will use is 16C73. The code as following: (A) org 0 START: bsf pclath,3 movlw 0 movwf INDEX call GET_TAB_ITEM ... org 0xE00 TAB_LOOKUP: movwf pcl /*********************/ GET_TAB_ITEM: movlw 0x0F movwf pclath movf INDEX,w call TAB_LOOKUP return org 0xF00 dt 0,1,2,3,........ (B) org 0 START: bsf pclath,3 movlw 0 movwf INDEX call GET_TAB_ITEM ... org 0xE00 TAB_LOOKUP: addwf pcl,f /*********************/ GET_TAB_ITEM: movlw 0x0F movwf pclath movf INDEX,w call TAB_LOOKUP return org 0xF00 dt 0,1,2,3,........ You can see the code (A) and (B), the only difference betweeb them is the line marked with /***/, personally I think in code and [addwf pcl,f] will get the same result to [movwf pcl], but when I use the MPLAB to simulate the result, it is different, returns 0, but returns 1. Why? Merry XMAS and Happy BOXING DAY! Jerry Meng, BA1FB mailto:ba1fb@amsat.org http://www.srsnet.com/~ba1fb