Question
For each of the following C++-like pseudo code segments, write equivalent ARM assembly language instructions. a. if (r5 < 0) { r3 = r3+r5; }
For each of the following C++-like pseudo code segments, write equivalent ARM assembly language instructions.
a. if (r5 < 0) { r3 = r3+r5; } r3 = r3+r4;
b. if (r5 < 0) r2 = r2+100; else r2 = r2+r3;
c. if (r5 < r6) r5 = r5+1; else if (r5 == r6) r5 = r5-1; else if (r5 >= r7) r5 = r5+2; else r5 = r5-2;
d. switch (r5) {
case 0: r1 = r1 + r0; break
case 1: r1 = r1 + r1; // Note that there is no break here
case 2: r1 = r1 + r2; break;
default: r1 = r1 * r3 + r0; }
e. for (r0=50; r0>0; r0--) { r1 = r1 + r0; r2 = r2 + 1; }
f. while (r1 > r2) { r0 = r0 + 2; r3 = r3 3; r1 = r1 - 1; }
g. do { r0 = r0 + 2; r3 = r3 3; r1 = r1 - 1; } while (r1 > r2)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started