Question: Consider the following assembly program. Assume i and j are initially stored in $1 and $2 registers. and $1, $0, $0 and $2, $0, $0
Consider the following assembly program. Assume i and j are initially stored in $1 and $2 registers.
and $1, $0, $0
and $2, $0, $0
addi $5, $0, 10
loop: slt $6, $1, $5
beq $6, $0,
addi $2, $2, 5
addi $1, $1, 1
j loop
end: add $1, $2, $0
a) What are the final values of i and j after the execution of the above program?
b) Write a simple C fragment or pseudo-code for the above assembly program to show what it does.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
