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
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 3.5, Problem 3.10PP
Explanation of Solution
Given program:
x in %rdi, y in %rsi, z in %rdx
arith2:
orq %rsi, %rdi
sarq $3, %rdi
notq %rdi
movq %rdx, %rax
subq %rdi, %rax
ret
Data movement instructions:
- The different instructions are been grouped as “instruction classes”.
- The instructions in a class performs same operation but with different sizes of operand.
- The “Mov” class denotes data movement instructions that copy data from a source location to a destination.
- The class has 4 instructions that includes:
- movb:
- It copies data from a source location to a destination.
- It denotes an instruction that operates on 1 byte data size.
- movw:
- It copies data from a source location to a destination.
- It denotes an instruction that operates on 2 bytes data size.
- movl:
- It copies data from a source location to a destination.
- It denotes an instruction that operates on 4 bytes data size.
- movq:
- It copies data from a source location to a destination.
- It denotes an instruction that operates on 8 bytes data size.
- movb:
- The “subq” instruction decrements the second operand by value in first operand.
Shift Operations:
- In these instructions, the shift amount is given as first operand and shift value as second operand.
- The instruction “sar” denotes shift right instruction.
- The instruction “sarq” would shift right by 63.
- The instruction “sal” denotes shift left instruction.
- The instruction “salq” would shift left by 63.
Logical Instructions:
- The instructions provided by processor includes:
- AND
- It performs bitwise “AND” operation.
- It returns 1, if matching bits from both operands are 1.
- OR
- It performs bitwise “OR” operation.
- It returns 1, if matching bits from either or both operands are 1.
- XOR
- It performs bitwise “XOR” operation...
- AND
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
4 We consider the following initial value problem for two functions y(x),z(x):
0=y′′+(y′+6y)cos(z),
5z′=x^2+y^2+z^2,
where 0≤x≤2 and y(0)=1.7, y′(0)=−2.7, z(0)=0.5.
Approximate the solution of this initial value problem using Euler's method with 100 steps. (use Maple)
What approximation value do you obtain for y(2) and z(1)?
4.1.1
Complete solution and answer only no need explanation
Given three data points (1,6), (3,28), and (10, 231), What is the value of y at x = 2 if the function y = 2x2 + 3x + 1 passes through the three data points.
Problem 3 (#2.1.32).Explain why (A×B)×(C×D)and A×(B×C)×D are not the same
Chapter 3 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 3.4 - Prob. 3.1PPCh. 3.4 - Prob. 3.2PPCh. 3.4 - Prob. 3.3PPCh. 3.4 - Prob. 3.4PPCh. 3.4 - Prob. 3.5PPCh. 3.5 - Prob. 3.6PPCh. 3.5 - Prob. 3.7PPCh. 3.5 - Prob. 3.8PPCh. 3.5 - Prob. 3.9PPCh. 3.5 - Prob. 3.10PP
Ch. 3.5 - Prob. 3.11PPCh. 3.5 - Prob. 3.12PPCh. 3.6 - Prob. 3.13PPCh. 3.6 - Prob. 3.14PPCh. 3.6 - Prob. 3.15PPCh. 3.6 - Prob. 3.16PPCh. 3.6 - Practice Problem 3.17 (solution page 331) An...Ch. 3.6 - Practice Problem 3.18 (solution page 332) Starting...Ch. 3.6 - Prob. 3.19PPCh. 3.6 - Prob. 3.20PPCh. 3.6 - Prob. 3.21PPCh. 3.6 - Prob. 3.22PPCh. 3.6 - Prob. 3.23PPCh. 3.6 - Practice Problem 3.24 (solution page 335) For C...Ch. 3.6 - Prob. 3.25PPCh. 3.6 - Prob. 3.26PPCh. 3.6 - Practice Problem 3.27 (solution page 336) Write...Ch. 3.6 - Prob. 3.28PPCh. 3.6 - Prob. 3.29PPCh. 3.6 - Practice Problem 3.30 (solution page 338) In the C...Ch. 3.6 - Prob. 3.31PPCh. 3.7 - Prob. 3.32PPCh. 3.7 - Prob. 3.33PPCh. 3.7 - Prob. 3.34PPCh. 3.7 - Prob. 3.35PPCh. 3.8 - Prob. 3.36PPCh. 3.8 - Prob. 3.37PPCh. 3.8 - Prob. 3.38PPCh. 3.8 - Prob. 3.39PPCh. 3.8 - Prob. 3.40PPCh. 3.9 - Prob. 3.41PPCh. 3.9 - Prob. 3.42PPCh. 3.9 - Practice Problem 3.43 (solution page 344) Suppose...Ch. 3.9 - Prob. 3.44PPCh. 3.9 - Prob. 3.45PPCh. 3.10 - Prob. 3.46PPCh. 3.10 - Prob. 3.47PPCh. 3.10 - Prob. 3.48PPCh. 3.10 - Prob. 3.49PPCh. 3.11 - Practice Problem 3.50 (solution page 347) For the...Ch. 3.11 - Prob. 3.51PPCh. 3.11 - Prob. 3.52PPCh. 3.11 - Practice Problem 3.52 (solution page 348) For the...Ch. 3.11 - Practice Problem 3.54 (solution page 349) Function...Ch. 3.11 - Prob. 3.55PPCh. 3.11 - Prob. 3.56PPCh. 3.11 - Practice Problem 3.57 (solution page 350) Function...Ch. 3 - For a function with prototype long decoda2(long x,...Ch. 3 - The following code computes the 128-bit product of...Ch. 3 - Prob. 3.60HWCh. 3 - In Section 3.6.6, we examined the following code...Ch. 3 - The code that follows shows an example of...Ch. 3 - This problem will give you a chance to reverb...Ch. 3 - Consider the following source code, where R, S,...Ch. 3 - The following code transposes the elements of an M...Ch. 3 - Prob. 3.66HWCh. 3 - For this exercise, we will examine the code...Ch. 3 - Prob. 3.68HWCh. 3 - Prob. 3.69HWCh. 3 - Consider the following union declaration: This...Ch. 3 - Prob. 3.71HWCh. 3 - Prob. 3.72HWCh. 3 - Prob. 3.73HWCh. 3 - Prob. 3.74HWCh. 3 - Prob. 3.75HW
Knowledge Booster
Similar questions
- 3. The diagram below shows the main land routes for vehicular traffic between points A and G in a city. The figures in the arcs represent the cost of traveling between each pair of nodes. a) Manually apply Dijkstra's algorithm to find the cheapest route between A and G (visited nodes and total distance). b) Formulate a linear programming problem in extended form, to determine the shortest route to travel from A to G. Do not use subscripts, name 14 variables, for example XFE would be the variable that indicates that the arc from F to E is used. c) If there is a fixed cost for visiting each node, modify the formulation of the problem to include said fixed cost in the objective function, and the variables and restrictions that are required. NODE A B C D E F G FIXED COST 25 18 32 20 28 18 34arrow_forwardThe system should ask for a minimum value, maximum value and interval mode. Such values will be used as the minimum and maximum values of x to solve the given equation: f(x) = x3 – 4x2 + 10x - 4arrow_forwardPROBLEM 12. [TIME ALLOWED = 5 MINUTES] Give the contrapositive and converse of the following proposition: “If it is sunny, then I will go swimming.”arrow_forward
- So I need help solving this particular HW problem.arrow_forwardProblem 4 Discrete Mathematics.Combinations and Permutations. (5,10,10): Soccer A local high school soccer team has 20 players. However, only 11 players play at any given time during a game. In how many ways can the coach choose 11 players To be more realistic, the 11 players playing a game normally consist of 4 midfielders, 3 defend ers, 3 attackers and 1 goalkeeper. Assume that there are 7 midfielders, 6 defenders, 5 attackers and 2 goalkeepers on the team 2. In how many ways can the coach choose a group of 4 midfielders, 3 defenders, 3 attackers and 1 goalkeeper? 3. Assume that one of the defenders can also play attacker. Now in how many ways can the coach choose a group of 4 midfielders, 3 defenders, 3 attackers and 1 goalkeeper?arrow_forward(b) A 10 pole, 125 HP, 575 V, 60 Hz, 3-ph induction motor operating at rated conditions draws a line current of 125 A and has an overall efficiency of 93%. The core loss, stator conductor loss and rotor conductor loss are 1053 W, 2527 W, and 1755 W respectively. Sketch the power flow diagram, substitute values and determine: (i) shaft speed; (ii) developed torque; (iii) shaft torque; (iv) power factor; (v) combined windage, friction, and stray power loss.arrow_forward
- 4. Describe the requirements that need to be satisfied to solve the critical section problem. Give a solution to the critical section problem where there are 2 processes.arrow_forwardDevelop a solution to calculate a student’s grade average for one semester for five courses. The lettergrades should be entered and the grade average printed out. An A is equivalent to 4 grade points, a Bis 3 grade points; a C is 2 grade points, a D is 1 grade point, and an F is zero grade points write solution in c with if elsearrow_forward1. Develop a system of linear equations for the network by writing an equation for each router (A, B, C, D, and E). Make sure to write your final answer as Ax=b where A is the 5x5 coefficient matrix, x is the 5x1 vector of unknowns, and b is a 5x1 vector of constants. 2. construct the augmented matrix [A b] and then perform row reduction using the rref() function. Write out your reduced matrix and identify the free and basic variables of the system. 3. Use MATLAB to compute the LU decomposition of A, i.e., find A = LU. For this decomposition, find the transformed set of equations Ly = b, where y = Ux. Solve the system of equations Ly = b for the unknown vector y. 4. Compute the inverse of U using the inv() function. 5. Compute the solution to the original system of equations by transforming y into x, i.e., compute x = inv(U)y 6. Check your answer for x1 using Cramer’s Rule. Use MATLAB to compute the required determinants using the det() function.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrOperations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks Cole
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole