Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the problem above, solve for part P(a) and P(b). This code is written in assembly( not MIPS or C,C++ ), used for cortex m4.
Given the problem above, solve for part P(a) and P(b). This code is written in assembly(not MIPS or C,C++), used for cortex m4. Use simple code instructions, such as, bpl,bmi, ldrsh,mov,add,push{lr}, pop{pc}(those are examples of the simple code instructions you would use). Read carefully and provide a clear code that can be used in ARM assembly.
P(a) An 8 byte variable called PackedHWords has been created and stored by the main program. This variable contains 4 signed half words. Write a subroutine that accepts a single argument (the pointer to PackedH Words) and returns the average of the 4 half words if the average is positive. If the average is negative it returns zero. You may not use any IT blocks in this subroutine. P(b) Rewrite the subroutine from P(a), but without using any conditional branches. You may use IT blocks and you may use a code snippet to just identify the code that changes (ie: you don't have to re-write the whole subroutine, just the part that changed). P(a) An 8 byte variable called PackedHWords has been created and stored by the main program. This variable contains 4 signed half words. Write a subroutine that accepts a single argument (the pointer to PackedH Words) and returns the average of the 4 half words if the average is positive. If the average is negative it returns zero. You may not use any IT blocks in this subroutine. P(b) Rewrite the subroutine from P(a), but without using any conditional branches. You may use IT blocks and you may use a code snippet to just identify the code that changes (ie: you don't have to re-write the whole subroutine, just the part that changed)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started