Question: Write an ARM assembly language program in KEIL: 1)In this program write a main program and a subroutine to sum entries of an array. The

Write an ARM assembly language program in KEIL:

1)In this program write a main program and a subroutine to sum entries of an array.

The main program ans subroutine should work as followed:

The main program will call the subroutine, SumArray to compute the sum of the entries in the array. The main program will provide two arguments to the subroutine: a pointer and a value. The source array pointer, DArray, will be in R1. The array size, ArraySz, will be in R0. The result from the subroutine will be expected in R0.

Write a subroutine, SumArray, to sum all the entries in DArray. The main program will provide the pointer to the input array in R1 and the size of the array in R0. Subroutine should treat all the numbers in the array as 16-bit signed integers. The resultant sum of the array will be returned in R0. The subroutine must preserve all registers, except R0 and R1.

ArraySz EQU 5

DArray DCW 0xEE2B, 0x56C2, 0xF6AA, 0x247E, 0x7B32

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