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 16CRP
Program Plan Intro
Pop operation:
In this operation, the item is removed from the stack. The contents are reversed when they are getting popped.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Within the context of the programme, it is important to distinguish between the Code Segment, the Data Segment, and the Stack Segment. The next task is to determine, for each segment, the combination of registers that was used to address the data items that were contained in that segment. This will be done by figuring out which registers were utilised to address which data objects.
Explain the Memory stack organization of 16 locations of stack( 0 to 15). take the initial value of thestack pointer is SP = 0E in Hex. Explain the following push and pop instructions through the Memorystack organization diagram.(1) PUSH R5 WHERE R5 = XX in Hex(2) POP R4 WHERE R4 = (XX + 3 ) Hex for example roll no 64 is having the data in R5 = 64Hex and R4 is ( 64+3 = 67 Hex)
4. How many instructions were executed to compute the factorial of 10?
5. What is the smallest value of the stack pointer during the execution when finding the factorial of 16 (disregard the incorrect output)?
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
- write a subroutine (in assembly) for ARMcortex-A9 that 1. accepts a memory address A passed in register r0 2. Sum the words incrementing from address A, until the accumulating sum would be considered a negative number ( A is first address read). 3. Return the final value in r 0 . Should preserve state of system using the stack pointer (sp). If you are unable to write Assembly code to complete this problem, please use comments and/or pseudocode as much as possible to describe what should be done.arrow_forwardWhat do you mean by stack and subroutine? What is the purpose of stack in subroutines call? Explain the concept of subroutines call and usage along with the changes in program execution sequence with a suitable example for 8085 microprocessor.arrow_forwardFill in blank Suppose that segmentation technique is used for memory management. If the memory addresses are 7-bit binary numbers where the first two bits are used to specify segment ID, then the size of a user stack will be ---------- bytes.arrow_forward
- 1. If DS = 7FA2H and the offset is 438E,(a) Calculate the physical address(b) Calculate the lower range(c) Calculate the upper range of the data segment(d) Show the logical address2. If SS = 3500H and the SP is FFFEH,(a) Calculate the physical address of the current top of the stack,(b) Calculate the lower range.(c) Calculate the upper range of the stack segment.(d) Show the logical address of the stack.(e) What is the range of physical addresses if CS = FF59 ?3. If the current value of the stack segment register and stack pointer are C00016 and F F0016, respectively, what is the address of the current top of the stack ?4. For the base and offset addresses in previous problem, how many words of data are currently heldin the stack ?5. Show how the value EE1116 from register AX would be pushed onto the top of the stack as it existsin previous problem.6. Assume that the DS register is 578CH. To access a given byte of data at physical memory location67F66H. Does the data segment cover the…arrow_forwardWhat takes happen if a stack resource generation fails?arrow_forward(a) Which registers are used to access the stack ?(b) With each PUSH instruction, the stack pointer register SP is incremente or decremented by 2.(c) With each POP instruction, SP is incremented or decremented by 2.(d) List three possible logical addresses corresponding to physical address 143F0.(e) The ADD instruction can affect which bits of the flag register ?(f) The carry flag will be set to 1 in an 8-bit ADD if there is a carry out from bit . . .(g) CF will be set to 1 in a 16-bit ADD if there is a carry out from bit . . .arrow_forward
- Below is a program with ARM Assembly. PC = 0x2000, Stack pointer sp = 0x400 (no heap or memory = 0x2000), no x2028 can be read (when in the corresponding row) What is the SP value and what dataset is in the stack base address 0x3F8?arrow_forwardSuppose a computer using direct mapped cache has 232 byte of byte-addressable main memory, and a cache of 1024 blocks, where each cache block contains 32 bytes. a) How many blocks of main memory are there? b) What is the format of a memory address as seen by the cache, i.e., what are the sizes of the tag, block, and offset fields? c) To which cache block will the memory address 0x000063FA map?arrow_forwardSuppose you wanted a subroutine to return to an address that was 3 bytes higher in memorythan the return address currently on the stack. Write a sequence of instructions that would beinserted just before the subroutine’s RET instruction that accomplish this task.arrow_forward
- Write an Arm Assembly Program that does the following:•Stores on the stack a list of words of memory where the first element of the list is how manyremaining elements are in the list, and the rest of the elements in the list are initialized tosome random values.– Example:list: 6, -3, 4, 5, 9, 22, 99//stores a list of the 6 elements -3, 4, 5, 9, 22, 99•At the end of the program, register r0 should hold the sum of only the negative values in thearray (nonnegative elements are ignored).•Note that your program must work correctly even if the values stored in the list are changed.arrow_forwardWrite MIPS assembly for the following function. Assume N is passed to yourfunction in register $a0. Your output should be in register $v0 at the end of yourfunction. Note: You must implement this function recursively. The purpose of thisassignment is to learn how to manipulate the stack correctly in MIPS. int Myfun (int N){ if (N<3) return 1; return ( 2* Myfun(N-1)+ Myfun(N-2));}Please explain each instruction with a comment. Please submit your source codeand a screenshot that shows the registers with correct output value for N=3, i.e.,Myfun(3) returns 3 and Myfun(4) returns 7arrow_forwardThere are a variety of reasons why machine designers prefer that all instructions be the same length as one another. When using a stack machine, why is this not a good idea?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- 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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education