Computer Science: An Overview (13th Edition) (What's New in Computer Science)
13th Edition
ISBN: 9780134875460
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 8, Problem 55CRP
Program Plan Intro
Machine instruction:
The machine instruction is a sequence of
Stack pop operation:
A stack pop is a last in and first out data structure which supports the two operations named as push and pop where push operation add the element at the top of the stack and pop operation removes the element from the top of the stack.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
A fragment of code is given to compare text in the field alpha with a text in the field beta:
.data
alpha db 12 dup(?)
beta db ’abrakadabra’, 0
; :::
.code
; :::
mov esi, 0
mov ecx, 12
ns: mov dl, alpha[esi]
cmp dl, beta[esi]
jne wrong
;=====MISSING====
loop ns
; :::
wrong:
Choose missing instruction to insert in the code line marked by the comment “MISSING”.
Please answer the following with the reference;
1a. What is the purpose of the movq 0x10 (%rdi), rbp instruction here (at the C level or higher)? How does this relate to the earlier call to pushq rbp?
1b. Alice just remembered that the original C code had the following structure! Using what you now know about mystery, fill in the blanks with C code.
long mystery ( TreeNode* t){
If ( ) {
return ;
}
return
}
Write and simulate a MIPS assembly-language routine that: 1. Prints your group number, for example “Group 1”, 2. Computes the dot product of two vectors, A_vec and B_vec, as described in Lab 4 of the Lab Manual, 3. Stores the result at memory word DOTPROD, and 4. Prints the result preceded by the phrase: “The result of the dot product is: “. Your data segment should look like the following: .data group: .asciiz “\nGroup x” msg: .asciiz "\nThe result of the dot product is: " A_vec: .word x, 4, 20, 13, 3, 10, 5 B_vec: .word 4, 2, 1, 2, 5, 2, 4 n: .word 7 DOTPROD: .word 0 Replace each “x” with your group number.
Chapter 8 Solutions
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Ch. 8.1 - Give examples (outside of computer science) of...Ch. 8.1 - Prob. 2QECh. 8.1 - Prob. 3QECh. 8.1 - Prob. 4QECh. 8.1 - Prob. 5QECh. 8.2 - In what sense are data structures such as arrays,...Ch. 8.2 - Prob. 2QECh. 8.2 - Prob. 3QECh. 8.3 - Prob. 1QECh. 8.3 - Prob. 2QE
Ch. 8.3 - Prob. 3QECh. 8.3 - Prob. 4QECh. 8.3 - Modify the function in Figure 8.19 so that it...Ch. 8.3 - Prob. 7QECh. 8.3 - Prob. 8QECh. 8.3 - Draw a diagram representing how the tree below...Ch. 8.4 - Prob. 1QECh. 8.4 - Prob. 2QECh. 8.4 - Prob. 3QECh. 8.4 - Prob. 4QECh. 8.5 - Prob. 1QECh. 8.5 - Prob. 3QECh. 8.5 - Prob. 4QECh. 8.6 - In what ways are abstract data types and classes...Ch. 8.6 - What is the difference between a class and an...Ch. 8.6 - Prob. 3QECh. 8.7 - Suppose the Vole machine language (Appendix C) has...Ch. 8.7 - Prob. 2QECh. 8.7 - Using the extensions described at the end of this...Ch. 8.7 - In the chapter, we introduced a machine...Ch. 8 - Prob. 1CRPCh. 8 - Prob. 2CRPCh. 8 - (Asterisked problems are associated with optional...Ch. 8 - Prob. 4CRPCh. 8 - (Asterisked problems are associated with optional...Ch. 8 - Prob. 6CRPCh. 8 - Prob. 7CRPCh. 8 - Prob. 8CRPCh. 8 - Prob. 9CRPCh. 8 - Prob. 10CRPCh. 8 - Prob. 11CRPCh. 8 - Prob. 12CRPCh. 8 - Prob. 13CRPCh. 8 - Prob. 14CRPCh. 8 - Prob. 15CRPCh. 8 - Prob. 16CRPCh. 8 - Prob. 17CRPCh. 8 - Prob. 18CRPCh. 8 - Design a function to compare the contents of two...Ch. 8 - (Asterisked problems are associated with optional...Ch. 8 - (Asterisked problems are associated with optional...Ch. 8 - Prob. 22CRPCh. 8 - Prob. 23CRPCh. 8 - Prob. 24CRPCh. 8 - (Asterisked problems are associated with optional...Ch. 8 - Prob. 26CRPCh. 8 - Prob. 27CRPCh. 8 - Prob. 28CRPCh. 8 - Prob. 29CRPCh. 8 - Prob. 30CRPCh. 8 - Design a nonrecursive algorithm to replace the...Ch. 8 - Prob. 32CRPCh. 8 - Prob. 33CRPCh. 8 - Prob. 34CRPCh. 8 - Draw a diagram showing how the binary tree below...Ch. 8 - Prob. 36CRPCh. 8 - Prob. 37CRPCh. 8 - Prob. 38CRPCh. 8 - Prob. 39CRPCh. 8 - Prob. 40CRPCh. 8 - Modify the function in Figure 8.24 print the list...Ch. 8 - Prob. 42CRPCh. 8 - Prob. 43CRPCh. 8 - Prob. 44CRPCh. 8 - Prob. 45CRPCh. 8 - Prob. 46CRPCh. 8 - Using pseudocode similar to the Java class syntax...Ch. 8 - Prob. 48CRPCh. 8 - Identify the data structures and procedures that...Ch. 8 - Prob. 51CRPCh. 8 - In what way is a class more general than a...Ch. 8 - Prob. 53CRPCh. 8 - Prob. 54CRPCh. 8 - Prob. 55CRPCh. 8 - Prob. 1SICh. 8 - Prob. 2SICh. 8 - In many application programs, the size to which a...Ch. 8 - Prob. 4SICh. 8 - Prob. 5SICh. 8 - Prob. 6SICh. 8 - Prob. 7SICh. 8 - Prob. 8SI
Knowledge Booster
Similar questions
- Do all programming problems lend themselves to parallel execution?arrow_forwardWrite an assembly program for the processor family x86-32 that reads three real numbers from the keyboard and shows on the console the average value of them. In your implementation include the function averageOfThree and define for that function the interface below. ; ******************************************************************************************************************* averageOfThree: ; Input: Three memory addresses on the stack of three 64-bit floating point numbers in main memory. ; Output: The average value of the three input numbers on the stack as a 64-bit floating point number.arrow_forwardWhat are three applications of the.EQUATE instruction in Pep/9 assembly language? (explain briefly - each phrase should be one sentence) The.EQUATE command generates code for which of these three purposes?arrow_forward
- Write a code in sim8085 for the following problem: The pressure of two boilers is monitored and controlled by a microcomputer works based on microprocessor programming. A set of 6 readings of first boiler, recorded by six pressure sensors, which are stored in the memory location starting from 2050H. A corresponding set of 6 reading from the second boiler is stored at the memory location starting from 2060H. Each reading from the first set is expected to be higher than the corresponding position in the second set of readings. Write an 8085 sequence to check whether the first set of reading is higher than the second one or not. If all the readings of first set is higher than the second set, store 00 in the ‘D’ register. If any one of the readings is lower than the corresponding reading of second set, stop the process and store FF in the register ‘D’. Data (H): First set: 78, 89, 6A, 80, 90, 85 Second Set:71, 78, 65, 89, 56, 75arrow_forwardFor a scenario of four floor lift write an assembly language code such that when user press any key from [1 till 4] lift should move to the corresponding floor. Code in assembly language microprocessorarrow_forwardWrite an armv7 assembly program that uses SUBROUTINE CALLING to compute the n-th term of the fibonacci sequence. The program must use recursive function calls. Here is the code in C associated to the function required to be implemented in armv7: int fibbonacci(int n) { if(n == 0){ return 0; } else if(n == 1) { return 1; } else { return (fibbonacci(n-1) + fibbonacci(n-2)); } } Pls comment your code as possible explaining exactly what happens. Thanks!arrow_forward
- Consider a computer running a program that requires 250 seconds, where 70 seconds is spent executing FP instructions, 55 seconds for INT operations, 85 seconds for load/save operations, and 40 seconds for branch instructions. By how much is the time for INT operations reduced if the total time is reduced by 20%?arrow_forwardDescribe how register windowing makes procedure calls more efficient.arrow_forwardWrite a single instruction that converts an uppercase character in AL to lowercase but doesnot modify AL if it already contains a lowercase letter.arrow_forward
- turn this c code into assembly language in optimized and unoptimized mode. /* Project 2 */ /* GCC *//* gcc -Wa,-adhln -g -masm=intel -m32 "Project 2.c" > "Project 2-g.asm" *//* gcc -Wa,-adhln -O -masm=intel -m32 "Project 2.c" > "Project 2-o.asm" */ #include <stdio.h> #define NOINLINE __attribute__ ((noinline)) static NOINLINE int function1(int x, int y){ int i; int sum; int values[10]; sum = 0; for (i = 0; i < 10; i++) { values[i] = 10 * i + x * y; sum += values[i]; } return (sum); } static int NOINLINE function2(int *values, int valuesLen){ int i; int sum; sum = 0; for (i = 0; i < valuesLen; i++) { sum += values[i]; } return (sum); } static NOINLINE int function3(int x){ int y; y = x / 10; return (y); } static NOINLINE int function4(int a, int b, int c, int d){ int r; if (a > b) r = a; else if (a > c) r = 2 * a; else if (a > d)…arrow_forwardGenerate a listing file for the AddTwoSum program and write a description of the machine codebytes generated for each instruction. You might have to guess at some of the meanings of thebyte values.arrow_forward_____ is a CPU design technique in which instruction execution is divided into multiple stages and different instructions can execute in different stages simultaneously.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 PtrMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
- COMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L