
EBK COMPUTER SYSTEMS
3rd Edition
ISBN: 8220101459107
Author: O'HALLARON
Publisher: YUZU
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 3.6, Problem 3.25PP
Explanation of Solution
Given assembly code:
a in %rdi, b in %rsi
loop_while2:
testq %rsi, %rsi
jle .L8
movq %rsi, %rax
.L7:
imulq %rdi, %rax
subq %rdi, %rsi
testq %rsi, %rsi
jg .L7
rep; ret
.L8:
movq %rsi, %rax
ret
Load Effective Address:
- The load effective address instruction “leaq” is a variant of “movq” instruction.
- The instruction form reads memory to a register, but memory is not been referenced at all.
- The first operand of instruction is a memory reference; the effective address is been copied to destination.
- The pointers could be generated for later references of memory.
- The common arithmetic operations could be described compactly using this instruction.
- The operand in destination should be a register.
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:
Comparison Instruction:
- The “CMP” instruction sets condition code according to differences of their two operands.
- The working pattern is same as “SUB” instruction but it sets condition code without updating destinations.
- The zero flag is been set if two operands are equal.
- The ordering relations between operands could be determined using other flags.
- The “cmpl” instruction compares values that are double word.
Unary and Binary Operations:
- The details of unary operations includes:
- The single operand functions as both source as well as destination...
Expert Solution & Answer

Want to see the full answer?
Check out a sample textbook solution
Students have asked these similar questions
Please answer the JAVA OOP Programming Assignment scenario below:
Patriot Ships is a new cruise line company which has a fleet of 10 cruise ships, each with a capacity of 300 passengers. To manage its operations efficiently, the company is looking for a program that can help track its fleet, manage bookings, and calculate revenue for each cruise.
Each cruise is tracked by a Cruise Identifier (must be 5 characters long), cruise route (e.g. Miami to Nassau), and ticket price. The program should also track how many tickets have been sold for each cruise.
Create an object-oriented solution with a menu that allows a user to select one of the following options:
1. Create Cruise – This option allows a user to create a new cruise by entering all necessary details (Cruise ID, route, ticket price). If the maximum number of cruises has already been created, display an error message.
2. Search Cruise – This option allows to search a cruise by the user provided cruise ID.
3. Remove Cruise – This op…
23 }
24
ain.cpp
// Tasks:
C tot
Shore
Run
Task 1: Create a class "Student" with attributes name, age, and grade. Add
methods to set and get these values.
Task 2: Implement a class "BankAccount" with deposit and withdraw methods,
ensuring balance does not go negative.
Task 3: Develop a class "Circle" that calculates its area and circumference
given the radius.
Task 4: Implement a class "Book" that stores title, author, and price, and
allows updating and displaying book details
42
व
2 = 16
25
32-5
Subnetting
=
27
Problem 8
Number of needed subnets 5
Network Address 172.50.0.0/27
Address class
B
Default subnet mask
255.255.0.
.
Custom subnet mask 255.255.255.229
Total number of subnets
Total number of host addresses
Number of usable addresses
Number of bits borrowed
3
8122
8120
What is the 4th
subnet range?
What is the subnet number
for the 5th subnet?
What is the subnet
broadcast address for
the 6th subnet?
What are the assignable
addresses for the 3rd
subnet?
Chapter 3 Solutions
EBK COMPUTER SYSTEMS
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
- Problem 4 Number of needed subnets 750 Network Address 190.35.0.0 joy worl Subnetting Show your work for Problem Address class B Default subnet mask 255.255.0.0 Custom subnet mask 255.255.255.122 Total number of subnets 1024 Total number of host addresses Number of usable addresses Number of bits borrowed What is the 15th subnet range? What is the subnet number for the 13th subnet? What is the subnet broadcast address for the 10th subnet? What are the assignable addresses for the 6th subnet? 64 65,536 62 32,768 8 10 16,384 512 1,024 2,048 4,096 8,192 16,384 32,768 65,536 256 128 64 32 16 8,192 4,096 2048 1024 512 128 256. 32 16 8 4 2 1 0 0 o O O O O 4 91 8 32 64 +9 821 32 16 8 4 Number of Hosts Number of Subnets Binary values 190. 35 Solve with the right pictures 00 99999arrow_forward5. Task 5: Write a function that takes an array and its size as parameters and returns the sum of its elements(Homework)arrow_forward4.13 Extract a 3×3 array from the upper left-hand corner of the magic square you created in 4.11. Is this also a magic square?arrow_forward
- a If an M/M/1 queue in a server has task arrivals at a rate of 30 per second and serves at a rate of 50 per second, how many tasks are in the system (waiting and being served) on average? b In part (a), how many tasks are being served, on average? c What is the utilization of an M/M/1 queue in a server that has four tasks waiting on average?arrow_forwardEvaluate the average gate capacitance of, and power dissipated by, a processor with the following properties: • Gate oxide thickness = 1.4 nm• Gate length = 65 nm• Gate area = (65 nm)x(65 nm)• Permittivity of free space = 8.85 x 10e−12 Farads/m • Relative permittivity of SiO2 = 3.9 • Rail-to-rail voltage = 1.1 V• Clock frequency = 3.6 GHz• Switching probability = 1.0• Number of transistors per die = 1.3 x 10e9arrow_forwardCan you conver the following C code into ARM Assembly. Assume a is X0 and b is X1if ((a !=0) && (b == 0)) {a++} else {b++}arrow_forward
- Please help. Matlab for engineers 6th edition question.arrow_forwardA certain proram takes 26.67 seconds to run on 3 processors and 16 s to run on 7 processors. Find the execution time on one processor, the fraction of the program that can be parallelized, the theoretical execution time on an infinite number of processors, and P1/2arrow_forwardCan you write the following C code into ARM Assembly. Assume x is X0 and y is X1:switch ( x ) {case 0 : y++; break ;case 1 : y−−; break ;default : break ;}arrow_forward
- Can you write the following C code into ARM Assembly? Assume a is in X0 and b is in X1:while ( a < 10){b=b +10;a++;}arrow_forward# Instructions a. 1.00E+09 b. 1.00E+09 Compiler A Compiler B Execution time #Instructions Execution time 1s 1.20E+09 1.4 s 0.8 s 1.20E+09 0.7 s 1.6.1 [5] For the same program, two different compilers are used. The table above shows the execution time of the two different compiled programs. Find the average CPI for each program given that the processor has a clock cycle time of 1 nS. 1.6.2 15] Assume the average CPIs found in 1.6.1, but that the compiled programs run on two difference processors. If the execution times on the two processors are the same, how much faster is the clock of the processor running compiler A's coce versus the clock of the processor running compiler B's code? 1.6.3 [5] A new compiler is developed that uses only 600 million instruc- tions and has an average CPI of 1.1. What is the speed-up of using this new compiler versus using Compiler A or B on the original processor of 1.6.1? Consider two different implementations, P1 and P2, of the same instruction set.…arrow_forwardExercise 1.4 Consider two different implementations of the same instruction set architecture. There are four classes of instructions, A, B, C, and D. The clock rate and CPI of each implementation are given in the following table. CPI Class B CPI Class C CPI Class D Clock rate CPI Class A P1 1.5 GHz 1 2 3 P2 2 GHz 2 2 2 4 2 1.4.1 [10] Given a program with 10" instructions divided into classes as follows: 10% class A, 20% class B, 50% class C and 20% class D, which implemen- tation is faster? 1.4.2 [5] What is the global CPI for each implementation? 1.4.3 [5] Find the clock cycles required in both cases. The following table shows the number of instructions for a program. Arith 500 Store 50 Load 100 Branch 50 Total 700 1.4.4 [5] Assuming that arith instructions take I cycle, load and store 5 cycles and branch 2 cycles, what is the execution time of the program in a 2 GHz processor? 1.4.5 [5] Find the CPI for the program. 1.4.6 [10] If the number of load instructions can be reduced…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY