I was trying to do this arithmetic operation in assembly but i was getting the wrong answer every time, not sure how exactly I'm suppose to do it
These questions are from a textbook, and i do have the answers but trying to understand how to get that answer
The link contains the image which has question and my work as shown below
Address | value || register value
0x100 0xFF || %rax 0x100
0x108 0xAB || %rcx 0x1
0xll0 0x13 || %rdx 0x3
0x118 0xll ||
|| lines are just to separate the two sides
Questions are
Instruction Destination Value
addq %rcx, (%rax) :
subq %rdx,8(%rax) :
imulq $16, (%ra,x,%rd.x,8) :
incq 16 (%rax) :
decq %rcx :
subq %rdx, %rax :
Instruction Destination Value
addq %rcx, (%rax) : 0x100 ?
subq %rdx,8(%rax) : 0x108 ?
imulq $16, (%ra,x,%rd.x,8) : 0x118 ?
incq 16 (%rax) : ? ?
decq %rcx : %rcx 0x0
subq %rdx, %rax : %rax ?