Declaring more than one SPIM array causes a syntax error

Posted by Zack on Stack Overflow See other posts from Stack Overflow or by Zack
Published on 2010-05-06T01:33:34Z Indexed on 2010/05/06 1:38 UTC
Read the original article Hit count: 346

Filed under:
|
|

Below is the beginning of a chunk of SPIM code:

    .data
a:  .space  20
b:  .space  20

    .text
set_all:
    sw $ra,0($sp)
    li $t0,0
    li $t1,10
............

Unfortunately, the second array I declare ('b') causes the SPIM interpreter to spit out:

spim: (parser) syntax error on line 3
of file spim.out      b:    .space  20
                        ^

Similar code works when I only have one array -- it seems to be the second that screws it up. I've prodded at it but can't figure out what it is about that statement that makes it break. Any thoughts? Thanks for any insight.

© Stack Overflow or respective owner

Related posts about spim

Related posts about array