Arm assembly programming- complete the task1s code to


Programming Assignment: Basic ARM Assembly Programming

Task 1

Complete the task1.s code to produce an assembly program that:

• Waits for the user to enter an integer (this part is already coded).
• Stores the integer in r5 (this part is already coded). This integer will correspond to an ASCII code.
• (This is what you need to code) Prints the character for each ASCII code from n -5 to n+5 where n is the integer entered by the user.
• Assume the integer entered by the user will be no less than 70 and no more than 85.

For example, if the user enters 76 your output should look exactly like this:

76
G
H
I
J
K
L
M
N
O
P
Q
END

Task 2

Consider the following code in C:
int i;
for (i = r5; i <= r6; i++)
{
if (i == 24) printf("24\n");
else if (i == 27) printf("27\n"); else printf("z\n");
}

Complete the task2.s code to produce an assembly program that:

• Waits for the user to enter two integers (this part is already coded in).
• Places the first integer at r5, and the second integer at r6 (this part is already coded in).
• (This is what you need to code in) Produces the exact same output as the C code would produce, assuming that:

o The integer at r5 is not smaller than 15 and not larger than 32.
o The integer at r6 is not smaller than the integer at r5, and not larger than 32.
o Variables r5 and r6 in the C code have the same values as the registers r5 and r6 have received.

For example, if the first integer is 20 and the second integer is 30, your output should look exactly like this:

20
30
z
z
z
z
24
z
z
27
z
z
z
END

Task 3

Complete the task3.s code to produce an assembly program that:

• Waits for the user to enter two integers (this part is already coded in).

• Places the first integer at r5, and the second integer at r6 (this part is already coded in).

• (This is what you need to code in) Prints out the character for each ASCII code from the first integer up to (and including) the second integer, assuming that:

o The integer at r5 is not smaller than 32 and not larger than 127.

o The integer at r6 is not smaller than the integer at r5, and not larger than 127.

Each character should be on its own line.

For example, if the first integer is 80 and the second integer is 86, your output should look exactly like this:

80
86
P
Q
R
S
T
U
V
END

Task 4

Complete the task4.s code to produce an assembly program that:

• Waits for the user to enter two integers (this part is already coded in).

• Places the first integer at r5, and the second integer at r6 (this part is already coded in).

• (This is what you need to code in) Adds the two integers together. If the result is between 0 and 9 (including 0 and 9) the program should print the result. If not, is should print a question mark (?).

• Assume both integers entered will be no less than 0 and no greater than 50

For example, if the first integer is 4 and the second integer is 5, your output should look exactly like this:

4
5
9
END

If the first integer is 10 and the second is 3, your output should look exactly like this:

10
3
?
END

Request for Solution File

Ask an Expert for Answer!!
Assembly Language: Arm assembly programming- complete the task1s code to
Reference No:- TGS02734017

Expected delivery within 24 Hours