Re: 18F, table read, sdcc

Alessandro Zummo <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.gnupic
Organization Tower Technologies
Message-ID <20050806195704.13ad9070@inspiron>
On Sat, 06 Aug 2005 00:15:57 +0100
Peter Onion <[email protected]> wrote:

> >   I was planning to keep using the DB directive,
> >  assemble with gpasm -c into an object file,
> >  and loading the data from C.
> 
> 
> It's easy.... No need to mess around with TBLPTRL/H/U, let the compiler
> do all that for you....
> 
> unsigned char __code myData[8] = {1,2,3,4,5,6,7,8};
> unsigned char __code *myDataPointer = myData;
> 
> Sequential access via pointer
> n = *myDataPointer++;
> 
> Random access via array
> n = myData[m];


 Hi Peter,

  thank you very much for your help: __ code worked just fine!

 I've also noticed the same result can be obtained by
 declaring myData as const .

 Both behaviours seems to be undocumented, or maybe
 I'm just missing the right doc.

 Accessing thru a pointer like tou did in your
 example is not working though...

-- 

 Best regards,

 Alessandro Zummo, 
  Tower Technologies - Turin, Italy

  http://www.towertech.it
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.