简介
http://students.cs.tamu.edu/tanzir/csce350/reference/syscalls.html
示例程序无法运行,提示main出错。。。
于是把程序改成了参考1的磨样,错误进化成了下图这私。。
于是最后在Stackoverflow后得到结果,加上退出部分
.data
str: .asciiz "The number is "
.text
.globl main
main:
li $v0, 4 # $system call code for print_str
la $a0, str # $address of string to print
syscall # print the string
li $v0, 1 # $system call code for print_int
li $a0, 5 # $integer to print
syscall # print it
exit:
li $v0, 10 # syscall 10 terminates program
syscall # 就是少了exit才报上面的错误。。
参考
- https://blog.csdn.net/missasd1/article/details/74625447 (示例程序)
- http://students.cs.tamu.edu/tanzir/csce350/reference/syscalls.html (示例程序)
- http://students.cs.tamu.edu/tanzir/csce350/reference/syscalls.html (解决方案)
- https://shawnzhong.github.io/JsSpim/ (在线spim)