menu

Lab1

  • Hello world

    Using MIPS simulator execute hello program

    1. Download hello.s file
    2. Load the file with QtSpim
    3. Run the program (F5)
    4. Notice the console output

    Note: If the first line in `User Text Segment` is not the first line in the program set the PC regster with the address of the first line of the program

  • Addition

    Create a program that: reads two integers from standard input,adds them and prints the result

    1. Copy hello.s and name it addition.s
    2. Ask user for the first integer
    3. Read the number into a register
    4. Ask user for the second integer
    5. Read the number into a different register
    6. Add the numbers
    7. Print a string followed by the result
    8. Run the program
    9. Submit the program and the output of the console via email

    Hint: See sytem calls table to identify how to read input from standard console and how to print integers