Question: Complete an ARM assembly program that will copy a block of data from one location to another one word at a time. Start with the

 Complete an ARM assembly program that will copy a block ofdata from one location to another one word at a time. Start

Complete an ARM assembly program that will copy a block of data from one location to another one word at a time. Start with the main.asm file posted on Canvas. For this program, you must: Use all pointers o You will read and/or write each of the variables these pointers point to Copy each word-sized integer, except zero values, 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; this should also be equal to the number of negative values in the destination array since you should have copied these o Store the final count in the NUMNEG (number negative) variable Count the total number of values (negative and positive values) transferred Store the final count 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) o NUMNEGPTR Ox2000.0000 2 TOTALPTR Ox2000.0004 6 Copy from the source block array to the destination block array (but do not copy zero values-skip these) Source Block (SBLK): Destination Block (DBLK): SBLKPTR Ox2000.0008 1 DBLKPTR 1 126 -8 Ox2000.0020 Ox2000.0030 Ox2000.0034 Ox2000.0038 Ox2000.003C Ox2000.0040 126 -8 -115 0 Ox2000.000C Ox2000.0010 Ox2000.0014 Ox2000.0018 Ox2000.001C Ox2000.0020 Ox2000.0024 Ox2000.0028 44 28 -115 44 0 28 XX SBLKENDPTR How to write and develop this program: First, complete homework 2. Make sure your pseudocode or block diagram is correct (i.e., meets the specifications for this problem) and has enough detail so you can more easily write assembly code. o Note: The instructor will not assist you with this lab unless you have completed your pseudocode or block diagram and are actively using it to write your assembly code As you write assembly code, provide good comments to remind yourself what you are doing and how you are using your registers. This will also help the instructor help you in case you have a question with the operation of your code! o For example, if you are using register R8, then comment how you are using it. Is it a value or a pointer? What variable does it represent, or is it an intermediate value/pointer? Break this program into simpler pieces or stages and test each piece/stage incrementally. I suggest the following order for developing your code: Write your program to copy SBLK 's contents to DBLK (stopping at SBLKENDPTR ) Test that this part of your program works correctly o Modify your program to count each integer copied from SBLK to DBLK and put this value in the TOTAL variable Test that this part of your program works correctly o Modify your program to skip copying zero values from SBLK to DBLK Test that this part of your program works correctly Modify your program one last time to count each negative number that you copied from SBLK to DBLK Test that your overall program works correctly O

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!