Lab2 Assembly
Lab2 Assembly
February 5, 2025
1. Look at the HelloWorld.asm program. Understand how the string constant is stored in
memory.
2. See the code simple.asm and understand how various data types are represented.
4. Load and execute the inpout.asm program. Look up the documentation of the various
system calls used in the program.
5. Write a program to add the numbers in an array and store the sum in a memory location.
Use the .word directive. See page A-49. See also sw instruction.
6. Write a program to find the minimum number in an array and store it in a memory
location. You can use bnez, bge.
7. Write a program that uses a procedure call to compute xy , where x and y are input
integers. Create a procedure that accepts x and y as arguments and returns the result.
Within the procedure, you can use a loop. See the skeleton code proc_skel.asm, and
also the example in the lecture slides on Moodle.