Question: Address Memory Contents 0 x 1 0 0 4 0 1 0 0 0 x 1 0 0 3 8 0 x 1 0 0

Address Memory Contents
0x10040100
0x100380x10040
0x10030200
0x1002825
0x100200x10028
0x100180x10020
0x10010500
0x100080x10018
0x100002
Register Contents
%rdi 0x10028
%rsi 0x10
%rdx 16
%rcx -8
For each of the following assembly code sequences, say what value ends up in %rax at
the end of the sequence of instructions. Assume the starting state is what was given for the previous
problem.
a. movq $-32(%rdi),%rax
movq (%rax),%rax
movq (%rax),%rax
addq %rcx,%rax
b. subq $0x18,%rdi
shrq $2,%rdx
movq (%rdi),%rax
addq (%rdi,%rdx,8),%rax

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!