CSUN Memory Operations and Arrays in ARM Assembly Program
complete step 1 and step 2 in the link provided, the link has all the information. code should be in ARMsim,
https://kyledewey.github.io/comp122-fall17/labs/la…
Provided files:
Step 1: Edit find_min_array.s
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; endifendfor
You should test your code with different values for the elements of the array, and different array lengths. On my end, I will test your code by subbing out different values for array and array_length. Code that simply prints out the minimum value for the given array will receive no credit.
Step 2: Edit add_amount_array.s
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:
- array_source: The source array to read from
- array_sink: The destination array to write results to
- array_length: The length of the arrays. It is assumed that the array_source and array_sink arrays have the same length.
- 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
The bottom portion of the code will iterate over each element of the array_sink and print out its value. Do not modify this portion of the code in any way. Any modifications will result in a 0.
You should test your code with different values for the elements of the array, and different array lengths. On my end, I will test your code by subbing out different values for array and array_length. Code that simply prints out the minimum value for the given array will receive no credit.example of how the code should look like
ldr r0, =filename
mov r1, #5
swi SWI_Open_File
mov r1, r0
swi SWI_Read_Int
Top-quality papers guaranteed
100% original papers
We sell only unique pieces of writing completed according to your demands.
Confidential service
We use security encryption to keep your personal data protected.
Money-back guarantee
We can give your money back if something goes wrong with your order.
Enjoy the free features we offer to everyone
-
Title page
Get a free title page formatted according to the specifics of your particular style.
-
Custom formatting
Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.
-
Bibliography page
Don’t pay extra for a list of references that perfectly fits your academic needs.
-
24/7 support assistance
Ask us a question anytime you need to—we don’t charge extra for supporting you!
Calculate how much your essay costs
What we are popular for
- English 101
- History
- Business Studies
- Management
- Literature
- Composition
- Psychology
- Philosophy
- Marketing
- Economics