-----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Phil Cross Sent: Friday, November 25, 2005 10:19 AM To: piclist@mit.edu Subject: [PIC] : 18F452 table addresses I'm a beginner, trying to use an 18F452 as a controller. I have a problem, although it may be my ignorance that prevents me seeing the solution. I read around, but can't find how to do it. I am using MPASM 7.2 I want to define a number of what I call "canned" messages in flash memory, thus: message1 dw "String1",0 message2 dw "String2",0 message3 dw "String3",0 etc. (I use NULL as string terminator, and ensure even number of bytes in each message.) I want to be able to load TBLPTR with the label address of (say) message2, and then use the 18F452 TBLRD + instruction to step through and read the message bytes, until I reach NULL, while transmitting them on RS232. What I don't understand is how I get the addresses of message1, message2 etc. in order to load them into TBLPTR. I need the equivalent of 'C' '&' deferencing. Is there such a thing, please? I don't want to have to ORG every message - I want the compiler to take care of its location. Regards, Phil. CLRF TBLPTRU ; Set the Upper table pointer to 0x00. MOVLW HIGH ARG1 ; Fetch the HIGH address of the table. (message1) MOVWF TBLPTRH ; Set the High table pointer. MOVLW LOW ARG1 ; Fetch the LOW address of the table. (message1) MOVWF TBLPTRL ; Set the Low table pointer. -- * | __O Thomas C. Sefranek tcs@cmcorp.com |_-\<,_ Amateur Radio Operator: WA1RHP (*)/ (*) Bicycle mobile on 145.41MHz PL74.4 ARRL Instructor, Technical Specialist, VE Contact. http://hamradio.cmcorp.com/inventory/Inventory.html http://www.harvardrepeater.org -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist