Sorry, to take this yet another round, but I'd like to understand this correctly... Olin Lathrop wrote : > > Well, doesn't the : > > > > "addlw 1 ;yes then increment high address" > > > > line take care of that ? > > Yeah, I was thinking that PCLATH was used for two different purposes, the > call to TABLE and the index into the table. However, the call contains 11 > bits of address, not just 8, so PCLATH can be set to a different block of > 256 addresses than TABLE when the call is made, as long as TABLE and all > entries are in the same page. With "page" above, you mean the 2K word program memory page, right ? That's how I understand it, the whole table has to be within one 2K word page, but can span over two 256 word blocks within this page. > My example doesn't have any restriction on table placement, and looks to be > about the same in cycles and code space (I didn't count exactly). It also > saves code space if the table is accessed from more than one place. Yes, it's better. I'm doing something like that, but I'm using "CODE" to place the whole table (including the code to fix PCLATH) at the start of an 256 word area, so I don't need to double check (and maybe increment PCLATH). It's in an ISR, so I'd like to save all cycles possible. Jan-Erik. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics