Question: Use the following assembly code to answer the questions below, assuming that: X19 = f, X20 = g, X21 = i, X22 = &a LDUR

Use the following assembly code to answer the questions below, assuming that:

X19 = f, X20 = g, X21 = i, X22 = &a

LDUR X19, [X22, #0]

LDUR X20, [X22, #8]

ADDI X21, XZR, #0

LOOP: SUB X9, X19, X20

CBZ ENDLOOP

ADDI X19, X19, #1

ADDI X21, X21, #1

B LOOP

ENDLOOP: STUR X21, [X22, #16]

a.What value would the assembler insert for ENDLOOP in the CBZ instruction?

b. What value would the assembler insert for LOOP in the B instruction?

c.If a[0] = 5 and a[1] = 8, what value will be stored in a[2]?

d. How many R, D, I, B, and CBZ instructions are executed if a[0] = 5 and a[1] = 8?

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!