Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

Students also viewed these Databases questions

Question

=+Identify the key components of a strategic plan

Answered: 1 week ago

Question

When there was controversy, was it clear who had the final say?

Answered: 1 week ago