You are on page 1of 2

CS231 Computer Systems and Organization

Nazarbayev University, FALL 2022

LAB #3

Write a program in MIPS assembly language that takes the user’s input of one string containing
only lowercase English letters, and then outputs the upper-cased version of that string. Remember
the operations on bytes and strings shown by the instructor in your previous Laboratory session.
1. Create a buffer for the user’s string, using .space type in the .data section, for at least 51
bytes.
2. Also, create the helper string messages in the .data section.
3. Use the Syscall documentation given in the Figure 2 to read the user’s string, for which you
allocated space in the .data section.
4. The example of reading a string is given in the book Introduction To MIPS Assembly Language
Programming, chapter 2.5, which is on page 48 of the book or page 50 of the pdf document.
The book is available in your Books, materials folder of your lectures section of the course on
Moodle.
5. The example of the instructions on conditional branches and a while loop are given in your
main book MK.Computer.Organization.and.Design.4th.Edition.Oct.2011 on pages 90 and 92,
which are from chapter 2.7.

Figure 1: Output
Notes:
• You should use the exact same string messages before the user’s input and before the upper-
cased version, as shown in Figure 1. There’s a space after a colon.
• If the user entered an empty string, the output must also be empty.
• Your lowercase letters MUST BECOME uppercase in the Data Segment as well.
• You must finish the program so that you don’t see a ”(dropped off bottom)” message in the
console, when the program is finished running.

Figure 2: Syscall documentation

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

You might also like