Question: 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.

Read the code and figure out: given each of the following initial

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 # change

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!