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
Now calculate the reference address for given line using the below formula.
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
Now calculate the reference address for given line using the below formula.
Then,
Want to see the full answer?
Check out a sample textbook solutionChapter 7 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
- Problem 1(d) The floating point numbers include many integers, but not all of them. What is the smallest postive integer n that is not exactly represented as a Float64 ? Hint: First consider p = 1, 2, ..., and try to see the pattern.arrow_forward(TCOs 7, 9) Address each of the following:(a) Define cloud computing.(b) List and discuss the advantages and disadvantages of cloud computing.(c) Differentiate among three different types of cloud services and give an example of each.arrow_forward(a) Assume that five generation units with third order cost function (F: (P) = A: P²³ + B; P; ² + C; P; +D;) are in the circuit. Write a computer program using any arbitrary programming language (MATLAB, C++, C#, Python,...) to calculate economic. load dispatch (ELD) using first order gradient method. Note that all parameters and variables should be defined inside the program (at first lines) such that units' characteristics and demand can be changed easily. Neglect grid losses.arrow_forward
- (4) [8]Write code for a function multBy3divBy4, that for argument int x, computes 3*x/4, but follows the bit-level integer coding rules (text p.128) like in problem 3 of the assignment 1. (you may assume ints are 32 bits). (Note: The operation in your code 3*x is allowed to cause overflow.)arrow_forward(x-) hkt 2 1 m y = e 1+ 4m q 1 + 4m²q+ Write a Python code to plot a graph of y against x for the given range oft values from 0 to 150. Let h = 6.2, m = 5.2, q = 8.6, k = 3.9. Each plot for different t values should be on the same page.arrow_forward(a) Assume that five generation units with third order cost function (F, (R) = A; P+ B;P+C; P; + D;) are in the circuit. Write a computer program using any abitrary programming longuage (MATLAB, C++, C#, Python,.) to calculate economic load dipatch (ELD) using first order gradient method. Note that all parameters and variables should be defined inside the program (at tirst lines) such that units' characteristics and demand can be changed easily. Neglect grid losses. jusing dynamic programming (DP) methed.arrow_forward
- Problem 5. (C65. (5. s) Sort 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5 using quicksort with median-of-three partitioning and a cutoff of 3.arrow_forwardProblem 3. (Encryption Program) Write a program called encrypt.py that accepts the public-key n (int) and e (int) as command-line arguments and a message to encrypt from standard input, encrypts each character in the message, and writes its fixed-width binary representation to standard output. 'A tuple is like a list, but is immutable. You create a tuple by enclosing comma-separated values within matched parentheses, eg, a = (1, 2, 3). If a is a tuple, a[i] is the ith element in it. 5 / 7 Project 4 (RSA Cryptosystem) >- "/workspace/project4 $ python3 encrypt.py 3599 1759 Cs110 000110000000010011010100001010100011001010100011001110000110010111100100 Directions: • Accept public-key n (int) and e (int) as command-line arguments. • Get the number of bits per character (call it width) needed for encryption, ie, number of bits needed to encode n. • Accept message to encrypt from standard input. • For each character c in message: - Use the built-in function ord() to turn c into an integer x.…arrow_forward(a) A ssume that five generation unıts with third order cost function (F, (P) = A; P+ B;P+C; P; + D;) are in the circuit. Write a computer program using any arbitrary programming language (MATLAB, C++, C#, Python,.) to calculate economic load dispatch (ELD) using first order gradient method. Note that all parameters and variables should be defined inside the program (at tirst limes) such that units' charactenistics and demand can be changed easily. Neglect grid losses. O using lambda - iteration method.arrow_forward
- (C PROGRAMMING ONLY) 1. Point Me Thereby CodeChum Admin I was supposed to be your tour guide but I don’t know where our destination is. I have a list here that contains all the destinations where we are going to go. Each destination is basically represented with an integer. But it seems that I'm confused. Please help me by pointing me to the correct address. Instructions: In the code editor, you are provided with a main() code that asks for an integer input from the user and stores this to the variable n.Your task is to set the value of the destination_ptr found at line 9 to the address of the variable n.Aside from this, do not edit anything else.Input 1. An integer value Output Enter the destination number: 2Found it!arrow_forward[Peter Sorger’s] bioengineering lab produces a terabyte of data in a typical month. (a) At what rate in bytes per minute is the lab producing data? Write your answer with the appropriate metric prefix and the appropriate level of precision. (b) If the lab has been producing data from the time the article appeared to the present, how much has accumulated now? (c) When will a petabyte of data have accumulated? Do you believe your prediction? (d) When will an exabyte of data have accumulated?arrow_forwardc. (3 Pts) In a certain computer architecture, the content of some registers and memory content currently is as follows. Memory Address Data R1 | 00000004 0000FFFE FO00128A R2 0000FFFE FO00128A 0000FFF0 Next, this computer execute the following instruction. ADDI (0000FFFE), R1 Note: The I in ADDI refers to Indirect. Indirect here deals with the destination address: (0000FFFE). The parentheses are standard for indirect addressing. ADDI means add content of source to content of destination and place result in destination. Given that it is immediately after the instruction above is executed, fill out the contents of registers and memory addresses below. Memory Address Data R1 0000FFFE R2 FO00128Aarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education