Question: Consider the following LEGv8 loop: LOOP: SUBIS X1, X1, #0 B.LE DONE SUBI X1, X1, #1 ADDI X0, X0, #2 B LOOP DONE: a. For

Consider the following LEGv8 loop:

LOOP: SUBIS X1, X1, #0

B.LE DONE

SUBI X1, X1, #1

ADDI X0, X0, #2

B LOOP

DONE:

a. For the loop wirtten in LEGv8 assembly above, replace teh instruction B.LE DONE with B.MI DONE. What is the final value in register X0 assuming X0 is initially zero?

b. Show how you can reduce the number of instructions by combining the SUBIS and SUBI instructions. (Hint: Add one instruction outside the loop)

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!