Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#putc - put one character to output (interrupt 11)
putc $1 addi $2,$0,11 addu $4,$0,RG1 syscall
#getc - get one character (interrupt 12)
getc $1 addi $2,$0,12 syscall add RG1, $0, $2
#puts - put a string (interrupt 4)
puts $1 addi $2,$0,4 addu $4,$0,RG1 syscall
#done - end the program (interrupt 10)
done addi $2,$0,10 syscall
#putci - put an immediate char to output (interrupt 11)
# e.g.:
# putci '\n'
putci 10000 addi $2,$0, 11 addi $2,$0, OP1 syscall
#putsl - put an immediate string to output
putsl label addi $2,$0, 4 lui $1, LH1 ori $4, $1, LL1U syscall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment