Two code snippets are being presented to you.
1. mov rax, 0x1234567812345678
xor ax, 0x11
mov rdi, ax
call printf
xor rax, 0x11
mov rdi, rax
call printf
2. int x=-2;
unsigned int y = -33;
int z;
z = x + y;
printf(‘‘%u %u %u’’, x,y,z);
printf(‘‘%d %d %d’’, x,y,z);
In both the parts (1) and (2), explain what the two printf function calls
result in. Explain the reasons for any differences in the two cases.
Comments
Leave a comment