Trouble with MIPS macros in SPIM

Viewed 147

I'm struggling to get a macro to work in my lab code. This is how I wrote it:

.macro print_char($arg)
    li $v0, 11
    add $a0, $zero, $arg
    syscall
.end_macro

I don't think it should matter where it is relative to other labels but it is after .data and before .text. SPIM gives me this syntax error:

spim: (parser) syntax error on line 11 of file /Users/charliecooper/Cabrillo/compsci/cs24/MIPS_code/name_swap.s

      .macro printchar($arg)

Is there a noticeable problem with how I wrote the macro?

1 Answers

In case anyone finds this post @Michael is right in the comments: macros are a feature in MARS not SPIM.

Related