Pregunta

When I run my simple MIPS program, I receive a compiler error on a certain line of code. This is my .data section where I initialize my variables:

.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

The problem comes on the specific line where I initialize "neg" to display a message if the integer received is negative.

neg:    .asciiz "That number is a negative number  Please enter a positive number."

It tells me simply that there is a spim (parser) error at this location. I'm wondering if my syntax is incorrect or simply something buggy with the compiler. Thanks in advance.

¿Fue útil?

Solución

neg is a MIPS mnemonic. Rename it to neg_msg or something.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top