This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

call by value does not work

Hello,

I'm trying to pass a variable to a function, but the value stored in the variable never arrives. When I pass a constant, however, the value is handed over. An example follows:

main.c
extern void TransmitHex( unsigned char hexval );

main{
unsigned char var;
var = 0x41;
TransmitHex( 0x41 ); // produces an "A" in ASCII
TransmitHex( var ); // nothing shows up, possibly 0x00 is transmitted
}
---
serial.c

void TransmitHex ( unsigned char hexval){
/* transmit hexval via serial port */
}

I've tried to locate var with NEAR and FAR, but the problem persists. I'm using the HLARGE memory model. I have an external RAM connected to the ST10, address window is configured properly.

any ideas?

regards,
Soenke

0