MIPS Assembly ←→ Machine Mappings

Arithmetic Instructions

Name Format Layout Example
6 bits 5 bits 5 bits 5 bits 5 bits 6 bits
addR0 2310 32add $1, $2, $3
adduR0 2310 33addu $1, $2, $3
subR0 2310 34sub $1, $2, $3
subuR0 2310 35subu $1, $2, $3
addiI8 21100 addi $1, $2, 100
addiuI9 21100 addiu $1, $2, 100

Logical Instructions

Name Format Layout Example
6 bits 5 bits 5 bits 5 bits 5 bits 6 bits
andR0 2310 36and $1, $2, $3
orR0 2310 37or $1, $2, $3
norR0 2310 39nor $1, $2, $3
andiI12 21100 andi $1, $2, 100
oriI13 21100 ori $1, $2, 100
sllR0 02110 0sll $1, $2, 10
srlR0 02110 2srl $1, $2, 10

Memory Access Instructions

Name Format Layout Example
6 bits 5 bits 5 bits 5 bits 5 bits 6 bits
lwI35 21100 lw $1, 100($2)
swI43 21100 sw $1, 100($2)
luiI15 01100 lui $1, 100

Branch-Related Instructions

Name Format Layout Example
6 bits 5 bits 5 bits 5 bits 5 bits 6 bits
beqI4 1225 beq $1, $2, 100
bneI5 1225 bne $1, $2, 100
sltR0 2310 42slt $1, $2, $3
sltuR0 2310 43sltu $1, $2, $3
sltiI10 21100 slti $1, $2, 100
sltiuI11 21100 sltiu $1, $2, 100

Jump Instructions

Name Format Layout Example
6 bits 5 bits 5 bits 5 bits 5 bits 6 bits
jrR0 31000 8jr $31
jJ2 2500j 10000
jalJ3 2500jal 10000
View Full Register Table