Hi again Raphael,

You said you tested with gpsim and I attempted to try as well but gpsim (as
of 0.22.0) seems not to support the PIC 18F1220 processor. Apparently the
only 16bit PIC it supports is 18Cxx2 but even this seems to be not fully
supported yet (accordingly to gpsim/PROCESSORS in their sources).

Now I wonder if the problem could be more specific to certain types of 16bit
MCUs.

Which PIC did you use in your simulation?

Regards,
Guerra

On 1/14/07, Raphael Neider <[EMAIL PROTECTED]> wrote:

Hi Rodrigo,

> void main(void)
> {
>      unsigned char c = 0x34;
>      unsigned char *p;
>
>      p = &c;
>      *p = 0x12;
}

> Any help appreciated.

The above code snippet compiles fine with SDCC 2.6.4, r4570.
_main_c_1_1 (alias c) ends up at 0x80, p=&c makes p=(0x80, 0x00, 0x80),
the first 0x80 (MSB) being the pointer type (0x80 --> __data), and
0x0080 being the address of c in data memory.
*p=0x12 assigns 0x12 to memory location 0x80 (alias c), which seems to
be perfectly fine. Tested with gpsim. Even reading back *p (glo = *p;
with a global `char glo;' declared before main()) works nicely.

Could you give more information? How did you `test *p' after the last
line of code? What did you perceive?

--

Regards,
Raphael Neider



-------------------------------------------------------------------------
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




--
Rodrigo da Silva Guerra
PhD Student

Department of Adaptive Machine Systems
Graduate School of Engineering
Osaka University - Japan
-------------------------------------------------------------------------
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