Question: Complete an ARM assembly program that will copy a block of data from one location to another one word at a time. For this program,

Complete an ARM assembly program that will copy a block of data from one location to another one word at a time. For this program, you must:

  • Use all pointers
    • You will be reading and/or writing each of the variables these pointers point to
  • Copy each word-sized integer, except negative numbers, from the source block array (SBLK) to the destination block array (DBLK)
  • Stop the transfer when SBLKENDPTR (source block end pointer) is reached
    • Note: The placement of the SBLKPTR and SBLKENDPTR is very similar to the placement of iterators for a vector in C++
  • Count the number of negative values in the source array (the number of integers that were not copied)
    • The final count should be stored in the NUMNEG (number negative) variable
  • Count the total number of values (zero and positive values) transferred
    • The final count needs to be stored in the TOTAL variable
  • Use at least one loop using conditional branch command(s)

What the results in memory should look like after correct execution:

Note: The exact address of the variables and arrays may be different, however, they must be RAM addresses (declared in the .data section)

NUMNEGPTR

0x2000.0000

3

TOTALPTR

0x2000.0004

4

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!