Address | Value | -- | Register | Value |
---|---|---|---|---|
0x1000 | 0xAA | -- | %rdi | 0x1000 |
0x1004 | 0xBB | -- | %rsi | 0x1 |
0x1008 | 0xCC | -- | %rdx | 0x2 |
0x100C | 0xDD | -- | %rcx | 0x4 |
Fill in the following table showing the values for the indicated operands:
Operand | Value |
---|---|
%rdi | |
0x1004 | |
$0x1008 | |
(%rdi) | |
4(%rdi) | |
8(%rdi,%rcx) | |
0x1002(%rdx,%rcx) | |
-4(%rdi,%rsi,4) | |
(%rdi,%rdx,4) |
Instruction | Destination | Value |
---|---|---|
addq (%rdi),%rsi | ||
andq %rsi,%rdi | ||
subq %rsi,(%rdi) | ||
incq %rsi | ||
decq %rdx | ||
xorq (%rdi,%rdx,4),%rcx | ||
orq 0x1002(%rdx,%rcx),%rsi |
unknown: imulq %rdx, %rsi leaq (%rsi,%rdi), %rax ret long unknown(long x, long y, long z) { return ____________________________; }
unknown: movq %rdi, %rax salq $3, %rax addq %rdi, %rax ret long unknown(long x) { return ____________________________; }
long arith(long x, long y, long z) { long t1,t2,t3,t4; t1 = x + y; t2 = t1 - z; t3 = t1 & t2; t4 = t2 * t3; return t4; }