Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 3. This problem is about understanding the meaning of assembly code. Given the contents of registers and/or memory before a sequence of instructions, you
Problem 3. 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 contains 5 % rsi contains 7 %rdx contains 8 %rax contains 30 shlq $4,% rdi orq %rsi,%rdi sarq 1,%rdx addq %rdx,%rax addq %rdi,%rax % rdi contains ? Finally: \%rsi contains? %rdx contains? \%rax contains ? b. movqmovqsalqmovq8(%rdi),%rcx(%rcx),%rsi1,%rsi%rsi,(%rdi) leaqsalqleaqmovq(%rdi,%rdi,4),%rax4,%rcx(%rcx,%rax,8),%rdi20(%rdi,%rsi),%rcx Finally: %rdi%rsi%rcxMemorylocation10780containscontainscontainscontains
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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