[prev] 19 [next]

MIPS Assembly Language (cont)

General structure of MIPS programs

# Prog.s ... comment giving description of function
# Author ...

     .data     # variable declarations follow this line
               # ...

     .text     # instructions follow this line   
     .globl main
main:          # indicates start of code
               # (i.e. first user instruction to execute)
               # ...

# End of program; leave a blank line to make SPIM happy