#-------------------------------------------
# Basics - System Calls
# Author: Noah Gergel
# Date: May 11 2020
#-------------------------------------------

.data

# String to print later. Strings that you print must be null-terminated.
cool_str:
    .asciz "The quick brown fox jumps over the lazy dog. Again, he never really tires of it."

.text

# Our example routine for executing the system calls.
foo:

    # Print the character 'a' to console.
    li      a0, 97      # Alternative to addi a0, zero, 97
    li      a7, 11
    ecall

    # Print the integer 12500.
    li      a0, 12500
    li      a7, 1
    ecall

    # Print the string in the data section.
    la      a0, cool_str  # Loads the address of a label.
    li      a7, 4
    ecall

    # Exit the program.
    li      a7, 10
    ecall

    # This instruction will never run.
    addi    t0, zero, 1