|
|
1.1 root 1: /*
2: * h/i386/opcode.h
3: * Opcode index definitions for the i386.
4: * Used in CODE items.
5: * These are indicies into tables in n2/i386/optab.c and n3/i386/icode.c,
6: * modifications must be made in parallel.
7: * The list must stop below 200, as this is the coder macro base.
8: * Be very careful if you change any of these.
9: * i386.
10: */
11:
12: /*
13: * Common Intel i386 instructions.
14: * Dwords, words and bytes;
15: * also flow of control and segmentation.
16: * This is by no means a complete list of i386 opcodes.
17: * Some are unused and could be deleted.
18: * n1/i386/outmch.c assumes a fixed order [dword, byte, word] for variants.
19: */
20: #define ZADC 0
21: #define ZADD 1
22: #define ZADDB 2
23: #define ZADDW 3
24: #define ZAND 4
25: #define ZANDB 5
26: #define ZANDW 6
27: #define ZCALL 7
28: #define ZCBW 8
29: #define ZCDQ 9
30: #define ZCLC 10
31: #define ZCLD 11
32: #define ZCLI 12
33: #define ZCMC 13
34: #define ZCMP 14
35: #define ZCMPB 15
36: #define ZCMPW 16
37: #define ZCMPS 17
38: #define ZCMPSB 18
39: #define ZCMPSW 19
40: #define ZCWD 20
41: #define ZCWDE 21
42: #define ZDEC 22
43: #define ZDECB 23
44: #define ZDECW 24
45: #define ZDIV 25
46: #define ZDIVB 26
47: #define ZDIVW 27
48: #define ZENTER 28
49: #define ZHLT 29
50: #define ZICALL 30
51: #define ZIDIV 31
52: #define ZIDIVB 32
53: #define ZIDIVW 33
54: #define ZIJMP 34
55: #define ZIMUL 35
56: #define ZIMULB 36
57: #define ZIMULW 37
58: #define ZIMULI 38 /* Multiply immediate */
59: #define ZINC 39
60: #define ZINCB 40
61: #define ZINCW 41
62: #define ZIRET 42
63: #define ZIXCALL 43
64: #define ZIXJMP 44
65: #define ZJA 45
66: #define ZJAE 46
67: #define ZJB 47
68: #define ZJBE 48
69: #define ZJCXZ 49
70: #define ZJE 50
71: #define ZJG 51
72: #define ZJGE 52
73: #define ZJL 53
74: #define ZJLE 54
75: #define ZJMP 55
76: #define ZJNE 56
77: #define ZJNO 57
78: #define ZJNS 58
79: #define ZJO 59
80: #define ZJPE 60
81: #define ZJPO 61
82: #define ZJS 62
83: #define ZLEA 63
84: #define ZLEAVE 64
85: #define ZLOCK 65
86: #define ZLODS 66
87: #define ZLODSB 67
88: #define ZLOOP 68
89: #define ZLOOPE 69
90: #define ZLOOPNE 70
91: #define ZMOV 71
92: #define ZMOVB 72
93: #define ZMOVW 73
94: #define ZMOVS 74
95: #define ZMOVSB 75
96: #define ZMOVSX 76
97: #define ZMOVSXB 77
98: #define ZMOVZX 78
99: #define ZMOVZXB 79
100: #define ZMUL 80
101: #define ZMULB 81
102: #define ZMULW 82
103: #define ZNEG 83
104: #define ZNEGB 84
105: #define ZNEGW 85
106: #define ZNOT 86
107: #define ZNOTB 87
108: #define ZNOTW 88
109: #define ZNRET 89
110: #define ZNXRET 90
111: #define ZOR 91
112: #define ZORB 92
113: #define ZORW 93
114: #define ZPOP 94
115: #define ZPOPF 95
116: #define ZPUSH 96
117: #define ZPUSHF 97
118: #define ZRCL 98
119: #define ZRCLB 99
120: #define ZRCR 100
121: #define ZRCRB 101
122: #define ZREPE 102
123: #define ZREPNE 103
124: #define ZRET 104
125: #define ZROL 105
126: #define ZROLB 106
127: #define ZROR 107
128: #define ZRORB 108
129: #define ZSAL 109
130: #define ZSALB 110
131: #define ZSALW 111
132: #define ZSAR 112
133: #define ZSARB 113
134: #define ZSARW 114
135: #define ZSBB 115
136: #define ZSCAS 116
137: #define ZSCASB 117
138: #define ZSHL 118
139: #define ZSHLB 119
140: #define ZSHLW 120
141: #define ZSHR 121
142: #define ZSHRB 122
143: #define ZSHRW 123
144: #define ZSTC 124
145: #define ZSTD 125
146: #define ZSTI 126
147: #define ZSTOS 127
148: #define ZSTOSB 128
149: #define ZSUB 129
150: #define ZSUBB 130
151: #define ZSUBW 131
152: #define ZTEST 132
153: #define ZTESTB 133
154: #define ZTESTW 134
155: #define ZWAIT 135
156: #define ZXCALL 136
157: #define ZXCHG 137
158: #define ZXCHGB 138
159: #define ZXJMP 139
160: #define ZXOR 140
161: #define ZXORB 141
162: #define ZXORW 142
163: #define ZXRET 143
164:
165: /*
166: * Specials.
167: */
168: #define ZBYTE 144
169: #define ZWORD 145
170: #define ZLONG 146
171: #define ZLPTR 147
172: #define ZGPTR 148
173:
174: /* Unused opcodes, retained for no good reason. */
175: #if 0
176: #define ZAAA xx
177: #define ZAAD xx
178: #define ZAAM xx
179: #define ZAAS xx
180: #define ZADCB xx
181: #define ZDAA xx
182: #define ZDAS xx
183: #define ZIN xx
184: #define ZINB xx
185: #define ZINT xx
186: #define ZINTO xx
187: #define ZLAHF xx
188: #define ZLDS xx
189: #define ZLES xx
190: #define ZOUT xx
191: #define ZOUTB xx
192: #define ZSAHF xx
193: #define ZSBBB xx
194: #define ZXLAT xx
195: #endif
196:
197: #if 1
198: /*
199: * Opcodes for the Intel 80x87 numeric data processor (NDP).
200: * Not an exhaustive list, mostly just the ones we use.
201: * n1/i386/outmch.c assumes a fixed order [double, float, dword, word] for variants.
202: */
203: #define ZFADDD 149
204: #define ZFADDF 150
205: #define ZFADDL 151
206: #define ZFADDI 152
207: #define ZFSUBD 153
208: #define ZFSUBF 154
209: #define ZFSUBL 155
210: #define ZFSUBI 156
211: #define ZFRSUBD 157
212: #define ZFRSUBF 158
213: #define ZFRSUBL 159
214: #define ZFRSUBI 160
215: #define ZFCOMPP 161
216: #define ZFCOMPD 162
217: #define ZFCOMPF 163
218: #define ZFCOMPL 164
219: #define ZFCOMPI 165
220: #define ZFMULD 166
221: #define ZFMULF 167
222: #define ZFMULL 168
223: #define ZFMULI 169
224: #define ZFDIVD 170
225: #define ZFDIVF 171
226: #define ZFDIVL 172
227: #define ZFDIVI 173
228: #define ZFRDIVD 174
229: #define ZFRDIVF 175
230: #define ZFRDIVL 176
231: #define ZFRDIVI 177
232: #define ZFCHS 178
233: #define ZFTST 179
234: #define ZFLDZ 180
235: #define ZFLD1 181
236: #define ZFSTSW 182
237: #define ZFLDD 183
238: #define ZFLDF 184
239: #define ZFLDL 185
240: #define ZFLDI 186
241: #define ZFLDT 187
242: #define ZFSTD 188
243: #define ZFSTF 189
244: #define ZFSTL 190
245: #define ZFSTI 191
246: #define ZFSTPD 192
247: #define ZFSTPF 193
248: #define ZFSTPL 194
249: #define ZFSTPI 195
250: #define ZFSTPT 196
251: #define ZFWAIT 197
252: #define ZFDROP 198
253: #define is_ndp_op(op) (ZFADDD <= (op) && (op) <= ZFDROP)
254:
255: /* Unused... */
256: #if 0
257: #define ZFADD xx
258: #define ZFSUB xx
259: #define ZFRSUB xx
260: #define ZFMUL xx
261: #define ZFDIV xx
262: #define ZFRDIV xx
263: #endif
264:
265: #endif
266:
267: /* h/i386/opcode.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.