I have done some experiments in the meantime: In order to use literals instead of hex, I have added 0x20 to my values and = could so put them into the table as literals. of course this means I have to subtract 0x20 when I look the values up. This worked - in MPLAB SIM as well as in the target board. The drawback is, I dont have all hex values from 0x00 to 0xff available, = which I need for the system. but it showed that the code works. Next I used the (Hex values + 0x20) in the table as hex That worked too. Next I went back to the original values in hex, which gave me the error in = the simulator again. to better ilustrate it, here are the tables: ;PAGA_table ; testtable 2: Literal values are plus 0x20 ; data "r!q " ; data "r!q!0" ; data "r!r#@" ; data "r!r$P" PAGA_table ; testtable 1: Hex values are plus 0x20 db 0x72, 0x21, 0x71, 0x20, 0x20 db 0x72, 0x21, 0x71, 0x21, 0x30 db 0x72, 0x21, 0x72, 0x23, 0x40 db 0x72, 0x21, 0x72, 0x24, 0x50 ;PAGA_table ; table with correct values ; db 0x52, 0x01, 0x51, 0x00, 0x00 ; db 0x52, 0x01, 0x51, 0x01, 0x10 ; db 0x52, 0x01, 0x52, 0x03, 0x20 ; db 0x52, 0x01, 0x52, 0x04, 0x30 And here is the code which uses the table. Note that the lines where I = subtract 0x20 are comented out. The code worked with these lines, as well a= s = without. the program reads data from a serial bus (4 values) and compares them with = the first 4 values of each line in the table. If all 4 values compare true, = the 5th value is used to select a line from a different table and display i= t = on the LCD. Lembit BusPr=FCfen ;----------------- movlw UPPER my_table movwf TBLPTRU movlw HIGH my_table movwf TBLPTRH movlw LOW my_table movwf TBLPTRL movf ptr_pos,W addwf TBLPTRL,F clrf WREG addwfc TBLPTRH,F addwfc TBLPTRU,F ;----------------- movlw 0x20 movwf sub20 movlw .0 movwf ptr_pos nextAddress movlw UPPER PAGA_table movwf TBLPTRU movlw HIGH PAGA_table movwf TBLPTRH movlw LOW PAGA_table movwf TBLPTRL movf ptr_pos,W addwf TBLPTRL,F clrf WREG addwfc TBLPTRH,F addwfc TBLPTRU,F tblrd *+ movf TABLAT, W ; movf sub20, W ; subwf TABLAT, 0 cpfseq PAdr1 goto IncAddress tblrd *+ movf TABLAT, W ; movf sub20, W ; subwf TABLAT, 0 cpfseq PAdr2 goto IncAddress tblrd *+ movf TABLAT, W ; movf sub20, W ; subwf TABLAT, 0 cpfseq GAdr1 goto IncAddress tblrd *+ movf TABLAT, W ; movf sub20, W ; subwf TABLAT, 0 cpfseq GAdr2 goto IncAddress tblrd *+ movf TABLAT, W ; movf sub20, W ; subwf TABLAT, 0 movwf ptr_pos call my_char_1 return IncAddress movf dataPoint, W addwf ptr_pos, 1 movf ptr_pos, W cpfseq dataLines goto nextAddress return ;----------------------------- ----- Original Message ----- = From: "Tamas Rudnai" To: "Microcontroller discussion list - Public." Sent: Thursday, September 07, 2006 3:23 PM Subject: Re: [PIC] defining data in Program Memory Try to include that part of the program that uses the PAGA table... we do not need all the code, but if you want you can attach it to the mail or put it someware were we could take a look at, but from this snippet we do not see how do you use the table. Tamas -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist