Question: b Consider a CPU with four general purpose registers (RO, RI, R2 and R3) and the following machine instructions: Opcode Instruction 0000 STOP 0001 LOAD

 b Consider a CPU with four general purpose registers (RO, RI,

b Consider a CPU with four general purpose registers (RO, RI, R2 and R3) and the following machine instructions: Opcode Instruction 0000 STOP 0001 LOAD Rm, Addr 0010 STORE Rm, Add?r 0011 LOAD Rm, [Rn 0100 STORE Rm, [Rn] 0101 INC Rm 0110 DEC Rm 0111 JGT Rm, Rn, Addr If Rm>Rn, PC (program count)- Addr Action Stop program execution Rm = Memory [Addr] Memory [Addr] = Rm Rn Memory [Rn] Memory [Rn] Rm Rm Rm+1 Rm Rm-1 Let a set of n variables A[0), A[I],..A[n-1] be stored at consecutive memory locations with addresses starting from 0, 1,2,... to n-1. Each memory location can store one single variable or instruction. Note that n is a positive integer, which can be even or odd. Write a pseudo-code program to re-arrange the locations of these variables such that A [0], A [1], .. ., A [n-1] are now stored at memory addresses starting from n- 1, n-2, n-3, 2, 1 to 0, respectively. Using the above machine instructions, write the corresponding assembly program to perform the task. It is assumed that the value of n is pre-stored at some memory location. Define necessary constants and temporary variables, and provide their memory locations in hexadecimals. Also specify the memory locations of your assembly instructions

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!