Question: LOOP: SUBIS X 1 , X 1 , # 0 B . LE DONE SUBI X 1 X 1 , # 1 ADDI X 0
LOOP: SUBIS X X #
BLE DONE
SUBI X X #
ADDI X X #
B LOOP
DONE:
a
Assume that the register X is initialized to the value What is the final value in register X assuming the X is initially zero?
b
For the loop above, write the equivalent C code. Assume that the registers X and X are integers acc and i respectively.
c
For the loop written in LEGv assembly above, assume that the register X is initialized to the value N How many LEGv instructions are executed?
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
