Question: All assembly language programs must run without errors on the simulator Write ARM assembly code to implement the following C statements, assuming all variables are

All assembly language programs must run without errors on the simulator 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: b. num1--8, num2- 9 d. 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 numl-8; int num2-9; int result; int a, b aabs (numl); b-abs (num2); result -0 for (i -0; i
Step by Step Solution
There are 3 Steps involved in it
To implement the C code in ARM assembly youll create a program that takes the absolute values of two integers multiplies them by repeated addition and ... View full answer
Get step-by-step solutions from verified subject matter experts
