On Mon, 12 Jun 2000 20:03:46 -0700 Andrew Warren writes: > Peter Betts wrote: > > > Now the table is therefore inherently limited by the size of the > > PCL register? Yes? This is 8 bits so the table size can only be > > 256 max. > > Yes, exactly. > > > If the table is larger than 256 one has to start to modify the > PCLATH > > register as well to adapt the higher bits of the program counter. > > Correct. > > In a current project, I have a dictionary with the spelling of a word (with the MSB set on the last character) followed by a 16 bit pointer into an ISD speech chip. The dictionary is considerably larger than 256 bytes. I have a routine that just gets the next byte from the dictionary. It has a couple variables called DictionaryPointerHi and DictionaryPointerLo. In the routine that actually returns the byte, pclath is loaded from DictionaryPointerHi, then DictionaryPointerLo is added to pcl. To increment the pointer, I increment DictionaryPointerLo, watch for rollover and increment the high half if there was a rollover. This allows for a very large table in ROM. On returning back to my main code, I clear pclath since the high bits of it are used in goto and call. So, BIG tables are possible! Harold FCC Rules Online at http://hallikainen.com/FccRules Lighting control for theatre and television at http://www.dovesystems.com ________________________________________________________________ YOU'RE PAYING TOO MUCH FOR THE INTERNET! Juno now offers FREE Internet Access! Try it today - there's no risk! For your FREE software, visit: http://dl.www.juno.com/get/tagj.