Phil Cross wrote: > I'm a beginner, trying to use an 18F452 as a controller. Go away. Can't you see we're all busy arguing about top posting, bottom posting, context posting and trimming. (That was a joke, James) > 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. Sounds reasonable. > What I don't understand is how I get the addresses of message1, message2 > etc. in order to load them into TBLPTR. Read up on the LOW, HIGH, and UPPER assembler functions. They let you pick off a particular byte of a multi-byte value. For example: movlw low message1 will get the low byte of the address of your first string into W. From there it can be moved to TBLPTR. Use HIGH and UPPER to get the other bytes and do similar things with them. ****************************************************************** Embed Inc, Littleton Massachusetts, (978) 742-9014. #1 PIC consultant in 2004 program year. http://www.embedinc.com/products -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist