COMPUTER SYSTEMS&MOD MSGT/ET SA AC PKG
COMPUTER SYSTEMS&MOD MSGT/ET SA AC PKG
3rd Edition
ISBN: 9780134671123
Author: Bryant
Publisher: PEARSON
Expert Solution & Answer
Book Icon
Chapter 7.7, Problem 7.5PP

Explanation of Solution

Computing the value of the relocated reference to swap in the “callq” instruction:

From the given question, the function “swap” in object file “m.o” is

9: e8 00 00 00 00callqe<main+oxe>

Based on the relocates PC-relative references,

  • ADDR(s)=ADDR(.text)=0x4004d0
    • Here “ADDR” means run-time addresses for each section.
  • ADDR(r.symbol)=ADDR(swap)=0x4004e8

Compute the run time address of the references using the formula of “refaddr = ADDR(s) + r.offset”

refaddr=ADDR(s)+r.offset=0x4004d0+0xa=0x4004da

Then updates the reference by using the below formula

*refptr=(usnsigned)(ADDR(

Blurred answer
Students have asked these similar questions
9.23 The starting address of the trap routine is stored at the address specified in the TRAP instruction. Why isn't the first instruction of the trap routine stored at that address instead? Assume each trap service routine requires at most 16 instructions. Modify the semantics of the LC-3 TRAP instruction so that the trap vector provides the starting address of the service routine.
Partial Question 18 Select true statements from the following. extern' directive asks assembler to reserve specified amount of space in memory without a need to initialize the space. MIPS provides native PUSH and POP operations for STACK access. By convention, stack in MIPS grows downwards (i.e. from higher address to lower address). Stack pointer ($sp) starts 4 bytes below the memory boundary for application program data space. PUSH in MIPS always needs to store data first and then move Ssp to next free address.
2. Design a Read Only Memory (ROM) to implement the following, A097803, polynomial A = 3(2x? + 1), with input (x) : 0< (x) <7 (a) What is the size of the initial (unsimplified) ROM ? (b) What is the size of the final (simplified) ROM ? (c) Show in detail the final ROM layout, using LogiSim.
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