Hello everyone, I "borrowed" this codes from someone on the piclist.com. I would like to modify this code so that I can call different tables at different time (right now it works with only one table). A simple way is to cut and paste the whole thing and change the appropriate labels, but I think it will be long and stupid! How do I change the code below to a general call routine so that any table name from any page can be called? If it's not possible, is there a way to make it a macro so it saves some typing? Please help! Regards, Thomas Start call test_table goto start ;------------------------------------------------ Test_Table clrf OffsetH clrf OffsetL Loop movlw High(Table) movwf PCLATH call Table movwf TableChar movlw High(here) movwf PCLATH ; reset PCLATH here incf OffsetL ; add 1 to data pointer btfsc STATUS,C incf OffsetH movlw 0x00 ; check the end of string subwf TableChar, w btfsc status, z goto end_of_char call lcd_display goto Loop ;------------------------------------------------ end_of_char nop goto end_of_char ;------------------------------------------------ lcd_display nop ; the code to send the char to be displayed on the LCD goes here. return ;------------------------------------------------ ;------------------------------------------------ org 0x1900 Table movlw High(TStart) movwf PCLATH movf OffsetH,W addwf PCLATH movlw Low(TStart) addwf OffsetL,W btfsc STATUS,C incf PCLATH movf OffsetL,W addwf PCL TStart DT "Hello"0 end -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads