ARM

ARM code: Assembly code to add numbers from array

ARM processor is used in all the Embedded systems that are being built now. Here I explain ARM assembly program to add numbers declared in an array.

ALGORITHM:

  1. Start
  2. Create an array of numbers
  3. Initialize a counter register to the number of elements in an array
  4. Load base address of an array to a register.
  5. Load value to a temporary register
  6. Add and store number in destination register
  7. Decrement counter value
  8. Repeat steps 5-7 till counter value becomes zero
  9. Stop.

Here is a example code to add numbers in array with 5 elements.

CODE: