Note: I think the thingy that colors the code doesn’t really understand MIPS, so the coloring might be a little weird. I appologize for the inconvience.
Reading & Writing
lw -> load word
lh -> load half-word
lb -> load byte
lw $s0, len # read from len and write to $s0li -> load immediate
li $s0, 5 # set $s0 to 5la -> load address
la $s0, arr # get the address of array and give it to $s0move -> moves values between registers
move $t0, $s0 # read from $s0 and write to $t0sw -> store word
sh -> store half-word
sb -> store byte
sw $s0, max # read from $s0 and write to maxMath
ALl basic operations work the same, but with a different first word
add, sub, mul, div, rem, abs
add $s0, $t0, 5 # $s0 = $t0 + 5Note: rem is its own command
subu, addu, etc are unsigned
Jumping (called branching)
bge $t0, $t5, labelNote: all branch commands are 3 letters, so it is bgt instead of just bg