Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

Students also viewed these Databases questions

Question

why we face Listening Challenges?

Answered: 1 week ago