Question: 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.
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 arguments to the Euclid subroutine in registers RO, R1, and R2. 4. Initialize the x and y values using DCD directives. 5. Use SPACE directives to declare storage for the e values. 6. Submit assembly file 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. void euclid (int*, int*, int*) int main() int x0 = -8; int yo - 9; int xl = -295; int yi = -45; int x2 = 280; int y2 = 8; int x3 = 81; int y 3 -243; int ei, ei, e2, e3; euclid (x0, yo, &e); euclid(xi, yl, &el); euclid(x2, y2, &e2); euclid(x3, y3, &e 3); void euclid (int x, int y, int *result) { if x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
