> Put a bit of time into this tonight, and partially answering my own
> question, I found that I can do it this way (simplified)...
>
> // Define data...
> unsigned char rom LookupTable[10] = { 1,2,3,5,7,9,11,13,17,19 };
> // Access/retrieve data...
> a = LookupTable[5];
>
> But still wondering, is there a more space-efficient way to do this if
> I directly manipulate TBLPTRU/H/L etc ?
>
> Cheers,
> -Neil.
>
>
>
>
> Quoting PICdude <
EraseMEpicdude3spam_OUT
TakeThisOuTnarwani.org>:
>
> > I should also point out that this is for an 18F PIC.
> >
> >
> >
> > Quoting PICdude <
picdude3
spam_OUTnarwani.org>:
> >
> >> On the subject of tables in C18, as I've been tinkering with C
> >> (instead of asm) for PICs, I'm going to get into tables soon.
> >>
> >> Off the top of my head right now, I can see how I'd use TBLPTRU/H/L to
> >> point to the correct data, but not sure yet how data is declared and
> >> held in memory efficiently, and how these will be 256-byte boundary
> >> aligned (though I would think that that's not necessary here). These
> >> will be pre-determined values.
> >>
> >> Anyone care to share an example of how this is done with C18? AFAIK,
> >> the mchip app notes all show this in assembly.
> >>
> >> Cheers,
> >> -Neil.
> >>
> >>
> >> --