Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please complete all parts of the question. This problem is about understanding the meaning of assembly code. Given the contents of registers and/or memory before
Please complete all parts of the question.
This problem is about understanding the meaning of assembly code. Given the contents of registers and/or memory before a sequence of instructions, you are to simulate the effect of the code on the stored values, and say what values the same registers/memory contain when the code finishes.
a. Initially: %rdi%rsi%rdx%raxcontainscontainscontainscontains57830 shlq $4,% rdi orq % rsi, % rdi sarq1,%rdx addq %rdx,%rax addq % rdi, % rax % rdi contains ? Finally: % rsi contains? %rdx contains ? %rax contains ? b. Initially: % rdi contains 1000 \%rsi contains 27 Memory location 1000 contains 500 Memory location 1008 contains 1000 movq 8(%rdi),%rcx movq (%rcx),%rsi salq 1,%rsi movq % rsi, ( % rdi) Finally: % rdi contains? % rsi contains? Memory location 1000 contains? Memory location 1008 contains? c. Initially: %rdi%rsi%rcxMemorylocation10780containscontainscontainscontains200800250789 leaq (\%rdi,\%rdi,4), \%rax salq 3,%rcx leaq (\%rcx,\%rax,8), \%rdi movq 20(% rdi,\%rsi ),%rcx Finally: \%rdi contains ? % rsi contains? %rcx contains ? Memory location 10780 containsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started