Jeff C.

asked • 08/18/21

Memory Operations and Arrays in ARM Assembly

Open the find_min_array.s file, and open it up in a text editor of your choice. Note that word processors (e.g., Microsoft Word, Pages, Google Docs) will probably not work for this purpose, as you must save your file as plain text. You must write ARM assembly code which will find and print out the smallest element of the array, where the array is specified with the array label and the array length is specified with the array_length label. Example output of this code is shown below, based on the provided array and array length in find_min_array.s:

-5

Multiple different implementation approaches are possible. One such implementation approach is shown below, implemented in pseudocode:

min = array[0];
for each element of the array:
if element < min:
min = element;
endif
endfor

Open the add_amount_array.s file, and open it up in a text editor of your choice. Note that word processors (e.g., Microsoft Word, Pages, Google Docs) will probably not work for this purpose, as you must save your file as plain text. This program will read values from a source array, add a specified amount to each value, and put the result in another (sink) array. A number of definitions are provided in the file, summarized below:

  1. array_source: The source array to read from
  2. array_sink: The destination array to write results to
  3. array_length: The length of the arrays. It is assumed that the array_source and array_sink arrays have the same length.
  4. add_amount: The amount to add to each element

Multiple different implementation approaches are possible. One such implementation approach is shown below, implemented in pseudocode:

counter = 0;
while counter < array_length:
array_sink[counter] = array_source[counter] + add_amount;
counter++;
endwhile


1 Expert Answer

By:

Patrick B. answered • 08/19/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.