Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objective: The objective of this lab is to have the students use the ARM Auto - Indexing to access array elements and to do nested
Objective: The objective of this lab is to have the students use the ARM AutoIndexing to access array elements and to do nested subroutine calls. Reference text book sections and Students will also demonstrate they know how to use the GNU debugger by providing addresses for specific parts of the code.
Write an ARM assembly program that performs the following:
Declare three arrays that will contain integers. Array one will be initialized in the code. The values of array one will be determined by the student.
Array two will be populated with user inputs via the scanf C library function. The reading of these user input values must be performed using a for loop construct and autoindexing.
Array three will be calculated to be equal to the Array onei Array twoi and must be performed using a for loop construct and autoindexing.
The program is to print a welcome message with instructions to the user. The user is to be instructed to enter positive integers.
The array print must be performed by a subroutine and accessed by using the ARM Assembly instruction BL The starting address of the array to be printed will be provided to the subroutine. The address may be passed via a register or the stack via the PUSH and POP commands. Since this print subroutine is not a leaf routine code must be in place to properly save and restore the link register r
The array size has to be elements.
Integer values should be selected to ensure positive, negative and zero results.
Assume all inputs are valid and no overflow conditions will occur.
Your code will be reviewed to ensure you are using the required AutoIndexing modes and printing of arrays is performed using a subroutine.
The general outline for your code should look like:
main:
Print welcome message and instructions to start entering numbers
For i to use scanf to read user input;
For i to mularrayi arrayi arrayi;
Printarrayarray
Printarrayarray
Printarraymularray
End main
Function Printarrayinarray
For i to print inarrayi
End function Printarray
To demonstrate students know how to use the GNU debugger the following information will be obtained about their running code and provided either in screen shots or routing the output to a text file.
Provide the starting address for each of the three arrays.
Provide the address for the array print routine.
Provide the address for the last instruction in the array print routine. This should be the instruction used to return to the calling routine.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started