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

Union return

I have this code:

typedef union { uint i; uchar b[2];
} UINT;

UINT ByteToHex(unsigned char b);

I write a little code in assembler that convert a hex byte y two ascii byte.

when I call this routine from C

void main(void){
UINT asc;

asc=ByteToHex(0x49);
}

The value returned in asc is not 0x3439. However the value 0x3439 is returned in r6 and r7 correctly.

why?

0