Intro to MIPS Assembly Language
 
Let's Start with Addition
| C | MIPS | 
| a = b + c; | add a, b, c | 
- 
This is general format for MIPS
addinstruction (andsubinstruction),
but what are variablesa,b, andc?
    - 
    addandsubinstructions always acts on
    registers
- 
        Let's assume variables a,b,c,d,ehave been put in$s0,$s1,$s2,$s3,$s4
- 
	add a, b, cshould beadd $s0, $s1, $s2
- 
Operands always have to be in registers?
    
    - 
	There is also an
	addiinstruction (but not asubiinstruction) that adds an
	immediately following constant.
 
| C | MIPS | 
| a = b + 4; | addi $s0, $s1, 4 | 
Alyce Brady, Kalamazoo College