CSE 2312 - Assignments - Assignment 8

The assignment will be graded out of 100 points. Submit your source code for each task, in files called task1.s, task2.s, and so on. Submit your solutions to Blackboard before the deadline. You will be able to revise your answers until the deadline with no penalty.

For all tasks of this assignment you should follow these general guidelines.


Task 1 (10 points)

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

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 2 (20 points)

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 this task2.s code to produce an assembly program that: 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 (10 points)

Complete this task3.s code to produce an assembly program that: Each number should be printed in hexadecimal, on a separate line, with no leading zeros. For example, if the first integer is 0 and the second integer is 45, your output should look exactly like this:
0
45
0
7
E
15
1C
23
2A

END


Task 4 (20 points)

Complete this task4.s code to produce an assembly program that: Each number should be printed in hexadecimal, on a separate line, with no leading zeros. For example, if the first integer is 345 and the second integer is 2000, your output should look exactly like this:
345
2000
159
2B2
40B
564
6BD

END


Task 5 (40 points)

Complete this task5.s code to produce an assembly program that: For example:

Back to the list of assignments.