Created
April 23, 2010 03:44
-
-
Save Xodarap/376152 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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