You are here: Home / Past Courses / Fall 2018 - ECPE 170 / Tutorials / MIPS Example Programs

MIPS Example Programs

The following example programs are available:

NameSummary
example1.asm Basic arithmetic with registers
example2_hello_world.asm Print a "Hello World" message to simulator output
example3_io.asm Input, output, and arithmetic
example4_loop.asm while() loop that computes the sum of N numbers
example5_function_without_stack.asm Function call without using a stack. (C code)
example5_function_with_stack.asm Function call that uses a stack to preserve registers
- recommended method! (C code)
example6_loop_with_function.asm while() loop that computes the sum of N numbers
(uses a function, but otherwise identical to example4)