Question: 1 0 . 4 LAB: Array of squares - LDUR / STUR Given an array of four integers, write a program that populates a new

10.4 LAB: Array of squares - LDUR/STUR
Given an array of four integers, write a program that populates a new array with the square of the elements in the given array. Assume X19 stores the memory location of the first element of the given array, and X20 stores the memory location of the first element of the new array.
Hint: Each memory address is incremented by 8 due to the doubleword addresses.
Ex: If X19 and X20 are initialized in the simulator as 4000 and 5000, and the content of the given array is:
Addresses Data
40001
40082
40163
40244
then the content of the new array is:
Addresses Data
50001
50084
50169
502416
Note: Use the '+' button under the Registers and Memory display to initialize X19, X20, and the four memory locations of the given array.
The loops is not stopping. Please help me fix it:
ACTIVITY
10.4.1: LAB: Array of squares - LDUR/STUR
Load defa
Assembly
Line 1 LOOP:
Line 2 LDUR X2,[X19, #0]
Line 3 MUL X2, X2, X2
Line 4 STUR X2,[X20, #0]
Line 5 ADDI X19, X19, #8
Line 6 ADDI X20, X20, #8
Line 7 SUBI X9, X9, #1
Line 8 CBNZ X9, LOOP
Line 9 Loop:
Registers
Each has value 0
Each has value 0
+
STEP
RUN
 10.4 LAB: Array of squares - LDUR/STUR Given an array of

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!