Question: (30 pts) Given the below program of the RISC machine with a 32-bit word size answer the following questions. Assume that FIRST 0x100 is the

 (30 pts) Given the below program of the RISC machine with

(30 pts) Given the below program of the RISC machine with a 32-bit word size answer the following questions. Assume that FIRST 0x100 is the starting memory address of two consecutive words: OxDE2B06. Ox63A58. #SECOND=0x500 is the starting memory address of two consecutive words: OxF2B07, Ox6358. Note RO is dedicated to hold a constant value 0. Instruction Loadyte loads a byte from the memory into the rightmost eight bit positions of a 32-bit processor register and clears the remaining higher-order bits to zero. Assume we do not use stack for storing return address (i.e., PC) a) (1 5 pts) Show the processor stack contents and the contents of the stack pointer SP, immediately after each of the following instructions. Assume that SPI=0x1000 before the execution of the calling program. (i) The 2nd Store instruction in the subroutine. (8 pts) (ii) The last Add instruction in the subroutine. (7 pts) b) (15 pts) What are the contents of R2. R3, R5, R6, and R7 (in hexadecimal) immediately before the instruction "Load R7, (SP)" (3 pts each) ove ove Move R2 #8 RS#FIRST R4 #SECOND FUNCTION Call SP. SP#12 R5, 8(SP) R6, 4(SP) R7, (SID) R5. RO R6, (R3) R7, (R4) FUNCTION: Subtract Store Store Store Move LOOP LoadByte LoadByte Branch if IR61 R7] NEXT Add Add Add Subtract R5, R5, #1 R3, R3, #1 R4, R4, #1 R2, IQ, #1 NEXT Branch if. R2 >RO LOOP Mov R2, R5 R7, (SP) R6, 4(SP) R5, 8(SP) SP, SP,#12 oa oa oa Add Return (30 pts) Given the below program of the RISC machine with a 32-bit word size answer the following questions. Assume that FIRST 0x100 is the starting memory address of two consecutive words: OxDE2B06. Ox63A58. #SECOND=0x500 is the starting memory address of two consecutive words: OxF2B07, Ox6358. Note RO is dedicated to hold a constant value 0. Instruction Loadyte loads a byte from the memory into the rightmost eight bit positions of a 32-bit processor register and clears the remaining higher-order bits to zero. Assume we do not use stack for storing return address (i.e., PC) a) (1 5 pts) Show the processor stack contents and the contents of the stack pointer SP, immediately after each of the following instructions. Assume that SPI=0x1000 before the execution of the calling program. (i) The 2nd Store instruction in the subroutine. (8 pts) (ii) The last Add instruction in the subroutine. (7 pts) b) (15 pts) What are the contents of R2. R3, R5, R6, and R7 (in hexadecimal) immediately before the instruction "Load R7, (SP)" (3 pts each) ove ove Move R2 #8 RS#FIRST R4 #SECOND FUNCTION Call SP. SP#12 R5, 8(SP) R6, 4(SP) R7, (SID) R5. RO R6, (R3) R7, (R4) FUNCTION: Subtract Store Store Store Move LOOP LoadByte LoadByte Branch if IR61 R7] NEXT Add Add Add Subtract R5, R5, #1 R3, R3, #1 R4, R4, #1 R2, IQ, #1 NEXT Branch if. R2 >RO LOOP Mov R2, R5 R7, (SP) R6, 4(SP) R5, 8(SP) SP, SP,#12 oa oa oa Add Return

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!