hi,
decimal 12345 is hex 0x00003039. So to get a more practical example I changed:
character=*((char *)(&adad)+2); // 0x00 is stored to:
character=*((char *)(&adad)+1); // 0x30 is stored Assuming Intel processor, the assembly should look like:
lea ebx, adad ; address points to 0x39 (little Endian)
add ebx, 1 ; address of 2nd byte, points to 0x30
mov al, [ebx] ; loads 0x30 into reg al
mov character, al ; stores 0x30 into character After execution above code:
printf ("character: %x\n", character); should output character: 30
I hope this is a little help.
Addition: Instead of add ebx,1 and mov al, [ebx] also displacement addressing: mov al, [ebx+1] is possible.
-- tesu