Register assignments

113 views 8:35 am 0 Comments March 23, 2023

Write a program in ARM assembly language to perform the following task. You have to find certain values in a given 16-bit integer array and once you find them you have to perform a certain operation on those values only and ignore the rest of the values.
Fully read the question before starting …
You are given a pointer to an array of 16-bit integer numbers, arrayptr.YOU are not told the size of the array. But you are told that the array ends when you read a 16-bit integer number with all bits set to l’s (OxFFFF) from the array.
array ptr EQU Ox20003FC0 ; 16-bit integer array location
Register assignments-.
RO should hold the pointer, arrayptr R1 should hold the value read from the array. R3 can hold the OxFFFF for comparing with end-of-array marker (You should not need any other registers for this program)
When your program reads a value from the array these are the possible actions:
1. If the value you read from array is OxFFFF, your program is done. 2. If the value you read from array is less than or equal to 0x24, you will add OxA to the number and store it back to same place in the array. Assume array is in SRAM read/writeable memory. 3. If neither of above is true, ignore the number and read the next number from the array. 4. Continue this till condition in 1. is satisfied.