Martin Peach wrote: > > > I need some code for a neat large table reader, > > > which just gets one data byte and incs the 16bit > > > pointer. The table is formatted in a continuous > > > string of retlw instructions, and the first byte > > > of the table can be anywhere in memory. > > > * 16bit address of table first byte > > > * 16bit address of table last byte > > > (table can be any length up to 8k) > > > > > > Can anyone help with code to do this? Especially > > > code that will suit 12 core and 14 core PICs, > > > so min stack use. > > I don't think the PIC12 series (well, at least the 12 bit core ones) will > > support the RETLW instruction .... > > They do have RETLW but the problem is with the CALL instruction that only > uses address bits 10-9 and 7-0, so half the memory is inaccessible to a > CALL. Thanks Martin, you're correct. The table probably won't be worth doing on a 12 core PIC, so I will just code it for the 14 core parts. I got the table read code working ok, I found you don't have to call the table if you prime the stack with your return address, so I can place the sound data table starting anywhere and finishing anywhere in program memory, which suited the app perfectly. It will play the sound from start to finish at any length up to 8kbyte (64kbits), or the table can contain a number of sounds and as long as start and end pointers are known for each sound the PIC can play each sound separately. Perfect for talking PIC products, or sound on buttonpress. I was hoping someone would have some input re what things they want added to my PIC sound encoder software, *free sound software* here: http://centauri.ezy.net.au/~fastvid/picsound.htm -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu