-
Notifications
You must be signed in to change notification settings - Fork 0
/
intructions.asm
70 lines (42 loc) · 1.48 KB
/
intructions.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
add $d $s $t # $d = $s + $t
000000 sssss ttttt ddddd 00000 100000
addu $d $s $t # $d = $s + $t
000000 sssss ttttt ddddd 00000 100001
sub $d $s $t # $d = $s - $t
000000 sssss ttttt ddddd 00000 100010
subu $d $s $t # $d = $s - $t
000000 sssss ttttt ddddd 00000 100011
addi $t $s imm # $t = $s + imm
001000 sssss ttttt iiiiiiiiiiiiiiii
addiu $t $s imm # $t = $s + imm
001001 sssss ttttt iiiiiiiiiiiiiiii
# Lógica
and $d $s $t # $d = $s & $t
000000 sssss ttttt ddddd 00000 100100
nor $d $s $t # $d = ¬($s | $t)
000000 sssss ttttt ddddd 00000 100111
or $d $s $t # $d = $s | $t
000000 sssss ttttt ddddd 00000 100101
ori $t $s imm # $t = $s | imm
001101 sssss ttttt iiiiiiiiiiiiiiii
andi $t $s imm # $t = $s & imm
001100 sssss ttttt iiiiiiiiiiiiiiii
lui $t imm # $t = imm*(2^16)
001111 ----- ttttt iiiiiiiiiiiiiiii
lbu $t imm($s) # $t = mem[$s + imm]
100100 sssss ttttt iiiiiiiiiiiiiiii
lhu $t imm($s) # $t = mem[$s + imm]
100101 sssss ttttt iiiiiiiiiiiiiiii
lw $t imm($s) # $t = mem[$s + imm]
100011 sssss ttttt iiiiiiiiiiiiiiii
sb $t imm($s) # mem[$s + imm] = $t
101000 sssss ttttt iiiiiiiiiiiiiiii
sh $t imm($s) # mem[$s + imm] = $t
101001 sssss ttttt iiiiiiiiiiiiiiii
sw $t imm($s) # mem[$s + imm] = $t
101011 sssss ttttt iiiiiiiiiiiiiiii
# Desvio condicional
beq $s $t imm # IF $s==$t THEN goto PC+4+(imm*4)
000100 sssss ttttt iiiiiiiiiiiiiiii
bne $s $t imm # IF $d!=$s THEN goto PC+4+(imm*4)
000101 sssss ttttt iiiiiiiiiiiiiiii