-
Notifications
You must be signed in to change notification settings - Fork 0
/
opcode.h
138 lines (131 loc) · 2.88 KB
/
opcode.h
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#ifndef _OPCODE_H_
#define _OPCODE_H_
#define INS_J 0x2
#define INS_JAL 0x3
#define INS_BEQ 0x4
#define INS_BNE 0x5
#define INS_BLEZ 0x6
#define INS_BGTZ 0x7
#define INS_ADDI 0x8
#define INS_ADDIU 0x9
#define INS_SLTI 0xa
#define INS_SLTIU 0xb
#define INS_ANDI 0xc
#define INS_ORI 0xd
#define INS_XORI 0xe
#define INS_LUI 0xf
#define INS_COP0 0x10
#define INS_COP1 0x11
#define INS_COP2 0x12
#define INS_NA1 0x13
#define INS_BEQL 0x14
#define INS_BNEL 0x15
#define INS_BLEZL 0x16
#define INS_BGTZL 0x17
#define INS_NA2 0x18
#define INS_NA3 0x19
#define INS_NA4 0x1a
#define INS_NA5 0x1b
#define INS_NA6 0x1c
#define INS_NA7 0x1d
#define INS_NA8 0x1e
#define INS_NA9 0x1f
#define INS_LB 0x20
#define INS_LH 0x21
#define INS_LWL 0x22
#define INS_LW 0x23
#define INS_LBU 0x24
#define INS_LHU 0x25
#define INS_LWR 0x26
#define INS_NA10 0x27
#define INS_SB 0x28
#define INS_SH 0x29
#define INS_SWL 0x2a
#define INS_SW 0x2b
#define INS_NA11 0x2c
#define INS_NA12 0x2d
#define INS_SWR 0x2e
#define INS_CACHE 0x2f
#define INS_LL 0x30
#define INS_LWC1 0x31
#define INS_LWC2 0x32
#define INS_PREF 0x33
#define INS_LDC1 0x35
#define INS_LDC2 0x36
#define INS_NA13 0x37
#define INS_SC 0x38
#define INS_SWC1 0x39
#define INS_SWC2 0x3a
#define INS_NA14 0x3b
#define INS_NA15 0x3c
#define INS_SDC1 0x3d
#define INS_SDC2 0x3e
#define INS_NA16 0x3f
/* SPECIAL */
#define INS_SLL 0x0
#define INS_MOVF 0x1
#define INS_SRL 0x2
#define INS_SRA 0x3
#define INS_SLLV 0x4
#define INS_NA17 0x5
#define INS_SRLV 0x6
#define INS_SRAV 0x7
#define INS_JR 0x8
#define INS_JALR 0x9
#define INS_MOVZ 0xa
#define INS_MOVN 0xb
#define INS_SYSCALL 0xc
#define INS_BREAK 0xd
#define INS_NA22 0xe
#define INS_NA23 0xf
#define INS_MFHI 0x10
#define INS_MTHI 0x11
#define INS_MFLO 0x12
#define INS_MTLO 0x13
#define INS_NA24 0x14
#define INS_NA25 0x15
#define INS_NA26 0x16
#define INS_NA27 0x17
#define INS_MULT 0x18
#define INS_MULTU 0x19
#define INS_DIV 0x1a
#define INS_DIVU 0x1b
#define INS_NA28 0x1c
#define INS_NA29 0x1d
#define INS_NA30 0x1e
#define INS_NA31 0x1f
#define INS_ADD 0x20
#define INS_ADDU 0x21
#define INS_SUB 0x22
#define INS_SUBU 0x23
#define INS_AND 0x24
#define INS_OR 0x25
#define INS_XOR 0x26
#define INS_NOR 0x27
#define INS_NA32 0x28
#define INS_NA33 0x29
#define INS_SLT 0x2a
#define INS_SLTU 0x2b
#define INS_TGE 0x30
#define INS_TGEU 0x31
#define INS_TLT 0x32
#define INS_TLTU 0x33
#define INS_TEQ 0x34
#define INS_NA34 0x35
#define INS_TNE 0x36
/* SPECIAL2 */
#define INS_MADD 0x0
#define INS_MADDU 0x1
#define INS_MUL 0x2
#define INS_MSUB 0x4
#define INS_MSUBU 0x5
#define INS_CLZ 0x20
#define INS_CLO 0x21
#define INS_SDBBP 0x3f
/* REDIMM */
#define INS_BLTZ 0x0
#define INS_BGEZ 0x1
#define INS_BLTZL 0x2
#define INS_BGEZL 0x3
#define INS_BAL 0x11
#endif /* _OPCODE_H_ */