Question: Can you help me write the ARM Assembly equivalent to these two pseudocode programs using push { lr } and pop { lr } and

Can you help me write the ARM Assembly equivalent to these two pseudocode programs using push{lr} and pop{lr} and also .balign 4:
For programs 1-2,you are provided with some pseudo code in a high level language, using variables r1, r2, num1, num2, and num3. Your task is to write the ARM assembly equivalent of each.
1. In programs 1 and 2, use push {lr} and pop {lr} or else things will break when you call printf();
2. Use .balign 4 before declaring each variable in the .data section
Program 1:
int r1=18; // use registers r1 and r2
int r2=18;
if(r1<= r2){
r2*= r1;
r2=30;
print("Are you tired of the humdrum, ordinary life?"); // use puts()
print("Looking for a life of high adventure??");
}
Program 2:
int num1=20; // create 3 variables in num2our .data section, num1, num2 and num3
int num2=30;
int num3=36;
if(num1+ num2== num3){
num1=200;
num2=300;
num3=360;
print("num1, num2 and num3 have increased");
} else {
print("num1 and num3 are unchanged");
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!