Question: Consider the following assembly program written for 3 2 - bit RISC: ld r 2 0 , 1 6 0 0 0 # load immediate
Consider the following assembly program written for bit RISC:
ld r # load immediate
ld r
ld r
start:
add r r r
ld rr # load into r from memory
add r r r
ld rr
mult r r r
st r r # store r into memory
ld r
sub r r r
bnez r start # jump to start if r not equal with zero
a Write a C program that is equivalent to the given assembly program.
b Open the loop in assembly language up to iterations. Reduce the program by renaming registers as follows: Change it to minimize the number of stalls.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
