Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Below are the contents of some registers and some memory. (For simplicity, the contents of memory are displayed as a sequence of 64-bit words

1) Below are the contents of some registers and some memory. (For simplicity, the contents of memory are displayed as a sequence of 64-bit words and not individual bytes.) What happens if we execute the instruction at memory address 0x40047d?

40047d: e8 1a 00 00 00 callq 40049c 400482: 48 8d 04 1b lea (%rbx,%rbx,1),%rax

register value
rbx 0x7fffffffffabc8
rsp 0x7fffffffffabb8
address value
0x7fffffffffabb0 0x4d400
0x7fffffffffabb8 0x4d300
0x7fffffffffabc0 0x4d200
0x7fffffffffabc8 0x4d100

Question options:

a) The value 0x400482 is stored at 0x7fffffffffabc0, the value of %rsp is set to 0x7fffffffffabc0, and the next instruction that executes is at location 0x40049c

b) The value 0x40047d is stored at 0x7fffffffffabb0, the value of %rsp is set to 0x7fffffffffabb0, and the next instruction that executes is at location 0x40049c.

c) The value 0x400482 is stored at 0x7fffffffffabb0, the value of %rsp is set to 0x7fffffffffabb0, and the next instruction that executes is at location 0x40049c.

2) Below are the contents of some registers and some memory. (For simplicity, the contents of memory are displayed as a sequence of 64-bit words and not individual bytes.) What happens if we execute the instruction:

popq %rbx

register value
rbx 0x7fffffffffabc8
rsp 0x7fffffffffabb8
address value
0x7fffffffffabb0 0x4d400
0x7fffffffffabb8 0x4d300
0x7fffffffffabc0 0x4d200
0x7fffffffffabc8 0x4d100

Question options:

a) Stores the value 0x4d300 in %rbx and leaves %rsp alone

b) Stores the value 0x4d200 in %rbx and sets %rsp to 0x7fffffffffabc0

c) Stores the value 0x4d300 in %rbx and sets %rsp to 0x7fffffffffabc0

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

Step: 3

blur-text-image

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

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions