Hi all,

--
System specs: Ubuntu Jaunty Jackelope 9.04 (Linux 2.6.28-13-generic), SDCC 2.9.0 #5416
Target processor: ADuC832 8051 compatible
--

Problem:
I have a pointer to an unsigned char, i put a char into the variable the pointer is pointing to, push it to some outputs and nothing happens....

Example code:

...
unsigned char * stream;
stream = (unsigned char *) malloc(1);
if(stream == NULL)
     return NULL;
*stream = (unsigned char) getchar(); // getchar returns just a char
P2 = *stream;
...

Nothing apears on the output port P2...
It has something to do with the pointer thats for sure, the assembly code is correct and if i replace the getchar function by a value it doesnt work either...
It looks like i just cant write a value to the variable the pointer is pointing to.

Now the following for example works:

unsigned char stream = 0xaa; // just an example value
P2 = stream;

Any thoughts?

Cheers

Bart