.data节中的MIPS编译器错误

时间:2014-01-30 20:26:27

标签: compiler-errors mips qtspim

当我运行我的简单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(解析器)错误。我想知道我的语法是不正确的还是编译器的错误。提前谢谢。

1 个答案:

答案 0 :(得分:3)

neg是一个MIPS助记符。将其重命名为neg_msg或其他内容。