| Arithmetic expression | ||||||||||||
| simple arithmetic, assignment | ||||||||||||
| int f, g, h, i, j; | $s0 | g + h | ||||||||||
| f = (g + h) - (i + j); | $s1 | i + j | ||||||||||
| $s2 | h | |||||||||||
| $s3 | i | |||||||||||
| $s4 | j | |||||||||||
| assume variables are assigned to $s0, $s1, $s2, $s3, $s4 respectively | ||||||||||||
| add $s0, $s1, $s2 | # $s0 = g + h | |||||||||||
| add $s1, $s3, $s4 | # $s1 = i + j | |||||||||||