Question: Write ARM assembly code to implement the following C statements, assuming all variables are 32-bit integers. You must: 1. 2. 3. 4. 5. 6. 7.

Write ARM assembly code to implement the following C statements, assuming all variables are 32-bit integers. You must: 1. 2. 3. 4. 5. 6. 7. 8. Use a branch and link instruction to call the subroutine Return from the subroutine by using the link register Put the argument to the subroutine (num1 or num2) in register r8 Put the return value from the subroutine (x) in register r9 Initialize num1 and num2 with DCD directives. Make space for result with a SPACE directive and then write the result to that location You may use registers for a and b. Make four different files that test the following combinations of inputs: a. num1- 8, num2 9 b. num1--8, num2 9 c. num1- 8, num2 9 9. Submit all four files in Canvas This program multiplies two numbers by repeated addition First, take absolute values of both numbers, do multiplication, then adjust result as necessary. Taking the absolute value is done as a subroutine int abs (int) int main) int num2 -9; int result int a, b; a-abs (num1) b abs ( num2 ) ; result -0; for i -0 i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
