You are on page 1of 2

CS231 Computer Systems and Organization

Nazarbayev University, FALL 2022

LAB #4

Write a program in MIPS assembly language that reverses the array of integers.

1. Download the code snippet from Moodle. The arrays and their lengths are given to you in
the code.
2. Your goal is to reverse both arrays in the Data segment. The first row in the Data Segment
represents the first array, which starts with 1 and ends with 5. The second row represents
the second array, which starts with 25 and ends with 75.
3. No output needed in the console, check Figure 3 below.
4. The numbers 5 and 6 on the 4th row of the Data Segment are the length of the arrays.

Figure 1: Before the run

Figure 2: After the run


Notes:
• You must save the numbers in the exact memory blocks of the Data Segment, as shown in
Figure 2. The autograder will be checking the values from those exact memory blocks.
• You are not allowed to change the .data section.
• If the numbers will be stored not as integers but as characters, you will lose a lot of points.
• You must use loops. For hard-coding you will lose a lot of points!

Figure 3: Console output

Figure 4: Code snippet

Deadline: Friday, September 9, at 21:55 PM.

You might also like