Question: Can you help code these two problems in Arm assembly code for cortex - M 4 . I have also provided the part 1 from

Can you help code these two problems in Arm assembly code for cortex-M4. I have also provided the part 1 from lab 3.
(25 points) Your inputs are three different word-length numbers that your program
will place in registers r6-r8. Your program will be responsible for adding three 16-bit
values that it will extract from registers as follows: low-order 16 bits (bits 0-15) from r6,
middle 16 bits (bits 8-23) from r7, and high-order 16 bits (bits 16-31) from r8. Place the
sum in register r9.(The sum may be more than 16-bits long.) For example, if you are
given the following inputs:
r6=0x31F1D1B9, r7=0x9F46452E, r8=0x0C82B182
then the sum stored in r9 should be sum of the values shown in bold above, that is, the
sum of 0 D1B9,04645, and 0C820. This sum is 000012480. that Intro: The purpose of this lab exeercise is to practice using memory instructions.
Background: You can use the AREA directive to define sections of code, data, and stack.
In this experiment, you will construct one data area. This will be a read-write area with
variables initialized to zero that will receive the output data. For the Cortex-M4, static
RAM (read-write memory) is from address 020000000 to address 0x3FFF FFFF. This
gives 0.5 GB of RAM.
You will also store read-only input data in the same section as your code.
Besides correctness, programs will also be evaluated for:
Efficient use of registers
Efficient use of instructions
Assignment:
(25 points) Convert part 1 from Lab 3 to take its inputs from memory and store its
sum to memory instead of to a register. Declare three words of input data in the same
section as your code; they will form an array of three words starting at variable silver.
You may use pre-indexed or post-indexed addressing. Store your final sum into memory
in the read-write data section into a word at variable bronze.
(25 points) Write a program that will exclusive-OR each element of array brown with a
word held at variable bitmask and store the result in array green. Assume that each array
holds five words. That is, implement the following.
for j=0to4
green [j]= brown [j]o+ bitmask
Your programs should work for test inputs that will be given by your lab TA to receive
full credit.
Can you help code these two problems in Arm

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 Programming Questions!