Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

8. Explain the contact hypothesis.

Answered: 1 week ago

Question

2. Define the grand narrative.

Answered: 1 week ago