Google MIPS mars 就可以搜到
程序一:加法, 输出正整数
li $t1, 1
add $t0, $t1, 2
li $v0, 1
move $a0, $t0
syscall
程序二:输出字符串
.data
msg: .ascii "Hello, world!"
.text
la $a0, msg
li $v0, 4
syscall
程序三:判断语句
.data
msg_yes .ascii "YES\0"
msg_no .ascii "NO\0"
li $v0, 5
syscall
move $t0, $v0
li $v0, 5
syscall
move $t1, $v0
bgt $t0, $t1, sub1
li $v0, 4
la $a0, msg_no
syscall
li $v0, 10
syscall
sub1:
li $v0, 4
la $a0, msg_yes
syscall
程序四:循环语句
li $t0, 1
li $t1, 0
loop:
add $t1, $t1, $t0
add $t0, $t0, 1
ble $t0, 100, loop
li $v0, 1
move $a0, $t1
syscall
学习资料!B站搜正月点灯笼!