Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Read the code and figure out: given each of the following initial register contents, what is the final value of %rax for each function? Fill
Read the code and figure out: given each of the following initial register contents, what is the final value of %rax for each function? Fill in %rax in the chart as your answer.
Memory Location M[Ox100] M[0x108] Initial Value 0x10 Ox99 Func 3 Register Value %rdi Ox100 %rsi 0x108 %rdx 2 %rax func3: movq (%rdi), %rcx movq (%rsi), %rax addq $1, %rax movq %rax, (%rdi) imulq $4, %rcx addq %rdx, %rcx movq %rcx, %rax movq %rax, (%rsi) ret Func 3 Register Value %rdi Ox108 %rsi Ox100 %rdx 8 %rax # - Note: When run func3 w/ provided program, # arguments are used to set the values stored in # memory locations pointed by %rdi and %rsi. # -How do the contents of the two memory locations # change? Memory Location M[Ox100] M[0x108] Initial Value 0x10 Ox99 Func 3 Register Value %rdi Ox100 %rsi 0x108 %rdx 2 %rax func3: movq (%rdi), %rcx movq (%rsi), %rax addq $1, %rax movq %rax, (%rdi) imulq $4, %rcx addq %rdx, %rcx movq %rcx, %rax movq %rax, (%rsi) ret Func 3 Register Value %rdi Ox108 %rsi Ox100 %rdx 8 %rax # - Note: When run func3 w/ provided program, # arguments are used to set the values stored in # memory locations pointed by %rdi and %rsi. # -How do the contents of the two memory locations # changeStep 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