Question: Problem 1: translate the following java codes into ARM codes. R2 = 16; for (R1 = 0; R1 < 10; R1++) { R2 = R2
Problem 1: translate the following java codes into ARM codes.
R2 = 16;
for (R1 = 0; R1 < 10; R1++)
{ R2 = R2 + R1;
}
Problem 2: translate the following java codes into ARM codes.
if (R1 < 0) {
R2 = 18 - R1;
R1 = R1 + 1;
} else {
R2 = 18 + R1;
R1 = R1 - 1;
}
Problem 3: translate the following java codes into ARM codes.
...
R1 = 12;
R2 = SUM(R1);
int SUM(int R1) {
int R3 = 1, R2 = 0;
do {
R2 = R2 + R3;
R3 = R3 + 1;
} while (R3 <= R1)
return R2;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
