2. Assume the following values are stored at the indicated memory addresses and
ID: 3705978 • Letter: 2
Question
2. Assume the following values are stored at the indicated memory addresses and regsters (Page 194)- Total 12 points Memory AddressValue 0x104 0x108 0x10C 0x110 0x48 OxAC OxFE 0x11 Register %rax %rcx Value 0x104 0x02 0x03 Fill in the following table (Destination and value) showing the effects of the following instructions with blue color, both in terms of the register or memory location that will be updated and the resulting value: One points for each blank Instruction Destination Value Addq %rcx, (%rax) subq %rdx, 8(%rax) imulq %rcx, (%rax, %rdx, 4) incq 0x04(%rax) decq %rdxExplanation / Answer
Addq assembely operation on x86-64 register as %rcx = %rcx + %rax
So Addq %rcx , (%rca) having Destination register as %rax and value storted as (0x104 + 0x02) = (0x106)
Second row x86 assembly instruction as subq %rdx , 8(%rax) having Desitination register as %rax and
value storted inside this register as (0x103)
Third row -- imulq operation having Destination register is %rax and %rax register value is 0x309
Fourth row -- incq operation having Destination register is %rax and %rax register value is 0x30A
Fifth row -- idecq operation having Detination register is %rdx and %rdx register value is 0x02
Sixth row -- isubq operation having Detination register is %rax and %rax register value is 0x308
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.