Computer Systems: A Programmer's Perspective (3rd Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
Expert Solution & Answer
Book Icon
Chapter 7.7, Problem 7.4PP

A.

Explanation of Solution

Hex address of the relocated reference to “sum”:

From the given Figure 7.12(a), the function “sum” in line 5 is

4004de: e8 05 00 00 00callq 4004e8 <sum>sum()

From the given Figure 7.12(a), the value of “ADDR(s)”, “ADDR(r.symbol)” and “r.addend” is given below

ADDR(s)=ADDR(.text)=0x4004d0

r.offset=0xf

r.addend=-4

Now calculate the reference address for given line using the below formula.

refaddr=ADDR(s)+r

B.

Explanation of Solution

Hex value of the relocated reference to “sum”:

From the given Figure 7.12(a), the function “sum” in line 5 is

4004de: e8 05 00 00 00callq 4004e8 <sum>sum()

From the given Figure 7.12(a), the value of “ADDR(s)”, “ADDR(r.symbol)” and “r.addend” is given below

ADDR(s)=ADDR(.text)=0x4004d0

r.offset=0xf

r.addend=-4

Now calculate the reference address for given line using the below formula.

refaddr=ADDR(s)+r.offset

Then,

refaddr=ADDR(s)+r

Blurred answer
Students have asked these similar questions
Problem 3) One of the automatic memory deallocations is based on scope of a variable stored in a memory. Give a Java/etc code in which variable will be deallocated when scope of the variable is over. Explain in your example when the variable is stored in the memory and when it is deallocated.
Q1) Consider a simple traffic light system to regulate safe pedestrian crossing on a busy lane. Consider the following system requirement:(SysReq:)The traffic lights shall allow pedestrians to safely cross the lane by stopping cars together with the following software requirements: (SofReq1:)The light switch for pedestrians will be set to 'green' within x seconds after the pedestrian button has been pressed. (SofReq2:)The light switch for cars will be set to 'red' at least y seconds before the light switch for pedestrians is set to 'green'. Find missing environment assumptions and domain properties that are necessary to build the following satisfaction argument: {SofReq1, SofReq2, assumptions?, domain properties?} =SysReq Are the missing domain properties adequate? Are the missing assumptions realistic?
[1] ( Show your work. Show hoe you compute memory address by using the effective memory address computation. Assume the following values are stored at the indicated memory addresses and registers: Address Value 0x100 OxFF 0x104 OxAB 0x108 0x13 0x10c 0x11 Register %rax %rcx %rdx $0x108 (%rax) 4(%rax) 9(%rax, %rdx) 260(%rcx,%rdx) OxFC (,%rcx, 4) (%rax, %rdx, 4) Value 0x100 0x1 0x3 Fill in the following table showing the values for the indicated operands: Operand Value %rax 0x104
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education