当我运行简单的 MIPS 程序时,我在某行代码上收到编译器错误。这是我初始化变量的 .data 部分:
.data
prompt1: .asciiz "Please enter the rain fall for month "
prompt2: .asciiz ": "
array_size: .word 12
array: .word 0,0,0,0,0,0,0,0,0,0,0,0
avg: .asciiz "The average rainfall is "
inches: .asciiz " inches."
max: .asciiz "The month with the most rainfall was month "
min: .asciiz "The month with the least rainfall was month "
neg: .asciiz "That number is a negative number Please enter a positive number."
max_num: .word 0
min_num: .word 0
avg_num: .word 0
month_num: .word 1
问题出现在我初始化“neg”的特定行上,如果收到的整数为负数,则显示一条消息。
neg: .asciiz "That number is a negative number Please enter a positive number."
它简单地告诉我此位置存在 spim(解析器)错误。我想知道我的语法是否不正确或者只是编译器有问题。提前致谢。
最佳答案
neg
是 MIPS 助记符。将其重命名为 neg_msg
或其他名称。
关于compiler-errors - .data 节中的 MIPS 编译器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21466764/