mips汇编语言实现斐波那契数列的存储和十进制+十六进制输出,
测试环境为mars;
上自己的代码,不足之处欢迎大佬们指出。
代码:
.data
start: .asciiz "\n Input N = "
last: .asciiz "\n The result is "
out1: .asciiz "\n N is not legal\n"
out2: .asciiz "\n overflow\n"
empty: .asciiz " "
Hex: .asciiz " 0Xxxxxxxxx\n"
buf: .word 1,1
.space 4096 #设定数组大小
.text
main: la $a0,start
li $v0,4
syscall #输出start
la $a0,buf
move $a1,$a0 #$a1是地址 ==$s2
li $v0,5
syscall #输入N
addi $v0,$v0,-1
move $a0,$v0 #$a0是计数器N ==$s3
bltz $a0,