2

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

4

1 回答 1

3

neg是 MIPS 助记符。将其重命名neg_msg为什么的。

于 2014-01-30T20:35:01.907 回答