Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Any help would be great To represent R3 just use [R3] as the question states to do if you do not know contents of register.

image text in transcribed

Any help would be great

To represent R3 just use "[R3]" as the question states to do if you do not know contents of register.

4. (30 pts) Considering the below program of the RISC machine with a 32-bit word size, What are 1) the stack contents and the contents of the stack pointer (SP) and 2) the contents of R3. R6, and R7, in hexadecimal, immediately after each of the following instruction of the program is executed? Note that if you don't know the content of a register, say, R7, you may use (R7] to represent its content in the stack. a) The first Store instruction in the subroutine (StoreByte does not count). b) The last Store instruction in the subroutine (StoreByte does not count). c) Immediately before the first Load instruction in the subroutine (LoadByte does not count) d) The last Add instruction in the subroutine Assume that [SP]=0x1000 before the execution of the calling program begins. Assume the contents of R5, R6, and R7 are initially Ox55, 0x66, and Ox 77, respectively. Memory word location N contains the number of OxC. TO=0x600. FROM=0x500 is the starting memory address of three consecutive 32-bit data words: Ox1234, 0x5678, and Ox9ABC. Note for the stack contents, also show those contents (if any) that have been previously popped out of the stack. Assume we do not use stack for storing return address (i.e., PC). (Each subproblem is 7.5 pts: 1.5 pts for the contents of the stack, SP, R3, R6, R7, respectively) Move R2, #N Move R3, #FROM Move R4, #TO Call FUNCTION next instruction FUNCTION: DOWN: Subtract SP, SP, #12 Store R5, 8(SP) Store R6, 4(SP) Store R7, (SP) Add R5, R3, R2 Subtract R5, R5, #1 Branch_if_[R4] [R5] UP Branch_if_[R4]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases 28th British National Conference On Databases Bncod 28 Manchester Uk July 2011 Revised Selected Papers Lncs 7051

Authors: Alvaro A.A. Fernandes ,Alasdair J.G. Gray ,Khalid Belhajjame

2011th Edition

3642245765, 978-3642245763

More Books

Students also viewed these Databases questions

Question

gpt 5 3 9 .

Answered: 1 week ago

Question

e. What difficulties did they encounter?

Answered: 1 week ago