On Sunday 14 January 2007 10:48, Rodrigo Guerra wrote:
> > On 1/14/07, Borut Razem < [EMAIL PROTECTED]> wrote:
> > > Rodrigo Guerra wrote:
> > > > <snip>
> > > > void main(void)
> > > > {
> > > >      unsigned char c = 0x34;
> > > >      unsigned char *p;
> > > >
> > > >      p = &c;
> > > >      p = 0x12;
> > > >
> > > > (...)
> > > > <snip>

Could you try with:
void main(void)
{
     unsigned char c = 0x34;
     data unsigned char *p;
//   ^^^^^
     p = &c;
     *p = 0x12;
}

"data" here tells the compiler your pointer will always be used to point into 
RAM, never Flash/EEPROM/xmem/whatever, so it can optimize the gptrput call 
away and directly work with the pointer.

It's always good practice to declare your pointers like that, unless you 
really need a generic pointer.

Still, this doesn't fix the original problem, but if the result is still wrong 
with a "data" pointer, the problem most likely lies elsewhere.

/Ernst 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to