Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you help me write the ARM Assembly equivalent to these two pseudocode programs: For programs 1 - 2 , you are provided with some

Can you help me write the ARM Assembly equivalent to these two pseudocode programs:
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.
Hints:
1. In programs 1 and 2, use push {lr} and pop {lr}
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems X Special Issue On Database And Expert Systems Applications Lncs 8220

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2013th Edition

3642412203, 978-3642412202

More Books

Students also viewed these Databases questions