Home
Answered Questions
Computer Science
All Assembly Language Programs Must Run Without Errors On The Simulator Write ARM Assembly Code To I

Write in ARM assembly language to solve the problems:

All assembly language programs must run without errors on the simulator Write ARM assembly code to implement the following statements, using 32-bit integer variables. You must: 1. Use branch and link instructions to call the subroutines. 2. Return from the subroutines by using the link register. 3. Put the argument to the abs subroutine in register r8 and put the return value from abs in register r8. 4. Put the return values from a_minus_b and b_minus_a in ro and ri, respectively. 5. Initialize a and b with DCD directives. 6. In addition to returning values in the registers specified in 4., a_minus_b and b_minus a must update the memory locations associated with a and b. 7. Make four different files that test the following combinations of inputs: a. a = -8, b = 9 b. a = -295, b = -45 C. a = 81, b = -243 d. a = 280, b = 8 8. Submit all four files in Canvas This program uses Euclid's algorithm to find the greatest common divisor of two numbers. Because Euclid's algorithm only works on positive numbers, first take the absolute values of both numbers. int abs (int) int b_minus_a (int, int) int a minus_b(int, int) int main() int a = 8; int b --9; a = abs (a); b - abs (b); while (a != b) if (a < b) b-b_minus_a (b, else a = a minus_b(a, b); a); int abs (int x) if (x < 0) X - -X; return x; int a_minus_b(int x, int y) X - X - Y; return x; int b_minus_a (int x, int y) y = y - x; return y;

A machine language encodesdirectionsas sequences of 0's and 1's; this binarycryptographyis what the computer's processoris madeto execute. Writing programsexploitationthiscryptograph