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
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