title: passing values in MIPS macros
body: <p>I've been studying MIPS as an introduction to assembly, and recently started playing with macros.  What I want to be able to do is pass a value generated by another macro, or just any value in any particular register, into another macro. ie,</p>
  
  <pre><code>.data
  
  .macro print_int(%x) #this macro prints a given integer %x
  li      $v0, 1
  li      $a0, %x
  syscall
  .end_macro
  
  .macro terminate     #this macro terminates a program
  li      $v0, 10
  syscall
  .end_macro
  
  .text
  main:
  
  li      $t0, 7       #first, load the value 7 into register t0
  print_int($t0)       #then, attempt to pass the value in $t0 through print_int
  
  terminate            #end program
  </code></pre>
  
  <p>this program (specifically the <code>print_int($t0)</code> line) does not pass the assembler and turns up as an error.  Is there a proper syntactic way to do this, or is my approach fundamentally incorrect?</p>