Timothy, I have copied below the relevant paragraphs from the MPASM help. from this I see both use program memory, and for both they give examples with hex data. db - Data Byte. Reserve program memory words with 8-bit values. Multiple expressions continue to fill bytes consecutively until the end of expressions. Should there be an odd number of expressions, the last byte will be zero unless in a PIC18 code_pack section. example: tb1_dta db 0,0xff ;Places ff00 in program memory ;location. end for data it sais: Initialize one or more words of program memory with data. The data may be in the form of constants, relocatable or external labels, or expressions of any of the above. The data may also consist of ASCII character strings, text_string, enclosed in single quotes for one character or double quotes for strings. Single character items are placed into the low byte of the word, while strings are packed two to a word. If an odd number of characters are given in a string, the final byte is zero. On all families except the PIC18 device family, the first character is in the most significant byte of the word. On the PIC18 device family, the first character is in the least significant byte of the word. and an example is given as: tb1_dta data 0xffff,0xaa55 ;Places ffff and aa55 in ;two consecutive program ;memory locations. end ----- Original Message ----- From: "Timothy Weber" To: "Microcontroller discussion list - Public." Sent: Thursday, September 07, 2006 5:24 PM Subject: Re: [PIC] defining data in Program Memory > Lembit Soobik wrote: >> yes, me again :) >> >> This works: >> my_table >> data "Taste 1 " ;0 >> data "Taste 2 " ;16 >> data "Taste 3 " ;32 >> data "Taste 4 " ;48 >> >> according to MPASM help this should work: >> >> PAGA_table >> db 0x52, 0x01, 0x51, 0x00, 0x00 ;PA12, GA12, Adr of txt >> db 0x52, 0x01, 0x51, 0x01, 0x10 ;PA12, GA12 >> >> or this: >> PAGA_table >> data 0x52, 0x01, 0x52, 0x03, 0x20 ;PA12, GA12 >> data 0x52, 0x01, 0x52, 0x04, 0x30 ;PA12, GA12 >> >> but in both cases (when I use hex instead of a literal string) I get a >> runtime error: >> >> CORE-E0002: Stack under flow error occurred from instruction at 0x000136 >> >> question: is it not possible to use hex here? > > I don't have the docs here, but is it possible that the "data" directive > assumes its contents are placed in the data segment, while "db" places > it directly in the code segment unless you've included a segment > directive explicitly? > -- > Timothy J. Weber > http://timothyweber.org > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.405 / Virus Database: 268.12.1/440 - Release Date: 06.09.2006 > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist