Question: Write an ARM assembly program that asks for an integer, inserts it at the front of an array of integers, outputs the extended array, and

Write an ARM assembly program that asks for an integer, inserts it at the front of an array of integers, outputs the extended array, and loops back asking for a new input. The array should be allocated in RAM (but not in stack) and be initially empty. The program should be terminated by entering the number O(hence,O is not allowed to be an array element). The current array should be output to the screen after entering a new number.
For example, if the entered numbers are 34,-67,26, they should be allocated in the array as follows:
\table[[Array index,0,1,2],[Array elem.,26,-67,34]]
The program output in this case should be as follows:
Input a number: 34
Array: 34
Input a number: -67
Array: -67,34
Input a number: 26
Array: 26,-67,34
Your program should work for any array of size at most 20 and have a function insert(x, array, n) that inserts a number x into an array of length n. Pass all the parameters to this function in stack. The numbers x and n should be passed by value and the array itself by reference.
Write an ARM assembly program that asks for an

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 Programming Questions!