compiler-errors - .data 节中的 MIPS 编译器错误

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

最佳答案

neg 是 MIPS 助记符。将其重命名为 neg_msg 或其他名称。

关于compiler-errors - .data 节中的 MIPS 编译器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21466764/

相关文章:

C++ 头文件 "symbol(s) not found"类错误

gcc - 如何编译gcc-plugin生成共享对象文件?

mips - RISC 的 SPIM 与 MARS

c++ - 如何在MIPS汇编程序中使用库?

mips - 字符串 "Hello"在内存中是如何放置的

c - 错误 : expected '=' , ','、 ';'、 'asm' 或 '__attribute__' 之前的 'stackEmpty'

android - 当人们从Google Play下载我的应用程序时,出现此错误: java.lang.RuntimeException: Unable to instantiate activity

arrays - MIPS:访问和比较字符串数组中的元素

c - _IO_puts 和动态指令计数