Shared Flashcard Set

Details

MIPS Assembly Instructions
MIPS instructions and their meanings (http://logos.cs.uic.edu/366/notes/MIPS%20Quick%20Tutorial.htm)
31
Computer Science
Undergraduate 2
01/26/2009

Additional Computer Science Flashcards

 


 

Cards

Term
lw register_destination, RAM_source
Definition
#copy word (4 bytes) at source RAM location to destination register.
Term
lb register_destination, RAM_source
Definition
#copy byte at source RAM location to low-order byte of destination register,
# and sign-e.g.tend to higher-order bytes
Term
sw register_source, RAM_destination
Definition
#store word in source register into RAM destination
Term
sb register_source, RAM_destination
Definition
#store byte (low-order) in source register into RAM destination
Term
li register_destination, value
Definition
#load immediate value into destination register
Term
la $t0, var1
Definition
copy RAM address of var1 (presumably a label defined in the program) into register $t0
Term
lw $t2, ($t0)
Definition
load word at RAM address contained in $t0 into $t2
Term
sw $t2, ($t0)
Definition
store word in register $t2 into RAM at address contained in $t0
Term
lw $t2, 4($t0)
Definition
* load word at RAM address ($t0+4) into register $t2
* "4" gives offset from address in register $t0
Term
sw $t2, -12($t0)
Definition
* store word in register $t2 into RAM at address ($t0 - 12)
* negative offsets are fine
Term
add $t0,$t1,$t2
Definition
# $t0 = $t1 + $t2; add as signed (2's complement) integers
Term
sub $t2,$t3,$t4
Definition
# $t2 = $t3 - $t4
Term
addi $t2,$t3, 5
Definition
# $t2 = $t3 + 5; "add immediate" (no sub immediate)
Term
addu $t1,$t6,$t7
Definition
# $t1 = $t6 + $t7; add as unsigned integers
Term
subu $t1,$t6,$t7
Definition
# $t1 = $t6 - $t7; subtract as unsigned integers
Term
mult $t3,$t4
Definition
# multiply 32-bit quantities in $t3 and $t4, and store 64-bit
# result in special registers Lo and Hi: (Hi,Lo) = $t3 * $t4
Term
div $t5,$t6
Definition
# Lo = $t5 / $t6 (integer quotient)
# Hi = $t5 mod $t6 (remainder)
Term
mfhi $t0
Definition
# move quantity in special register Hi to $t0: $t0 = Hi
Term
mflo $t1
Definition
# move quantity in special register Lo to $t1: $t1 = Lo
# used to get at result of product or quotient
Term
move $t2,$t3
Definition
# $t2 = $t3
Term
b target
Definition
# unconditional branch to program label target
Term
beq $t0,$t1,target
Definition
# branch to target if $t0 = $t1
Term
blt $t0,$t1,target
Definition
# branch to target if $t0 < $t1
Term
ble $t0,$t1,target
Definition
# branch to target if $t0 <= $t1
Term
bgt $t0,$t1,target
Definition
# branch to target if $t0 > $t1
Term
bge $t0,$t1,target
Definition
# branch to target if $t0 >= $t1
Term
bne $t0,$t1,target
Definition
# branch to target if $t0 <> $t1
Term
j target
Definition
# unconditional jump to program label target
Term
jr $t3
Definition
# jump to address contained in $t3 ("jump register")
Term
jal sub_label
Definition
# "jump and link"
* copy program counter (return address) to register $ra (return address register)
* jump to program statement at sub_label
Term
jr $ra
Definition
# "jump register"

* jump to return address in $ra (stored by jal instruction)
Supporting users have an ad free experience!