SCM Repository
Annotation of /sml/trunk/src/runtime/mach-dep/assyntax.h
Parent Directory
|
Revision Log
Revision 437 - (view) (download) (as text)
1 : | monnier | 437 | |
2 : | /* Here it is. Define INTEL_ASSEMBLER to output Intel syntax. Please | ||
3 : | send me any improvements you make, and let me know how it works out. | ||
4 : | |||
5 : | Josh | ||
6 : | */ | ||
7 : | |||
8 : | /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/assyntax.h,v 3.7.2.2 1997/05/11 02:56:22 dawes Exp $ */ | ||
9 : | #ifndef __ASSYNTAX_H__ | ||
10 : | #define __ASSYNTAX_H__ | ||
11 : | #endif | ||
12 : | /* | ||
13 : | * Copyright 1992 Vrije Universiteit, The Netherlands | ||
14 : | * | ||
15 : | * Permission to use, copy, modify, and distribute this software and its | ||
16 : | * documentation for any purpose and without fee is hereby granted, provided | ||
17 : | * that the above copyright notice appear in all copies and that both that | ||
18 : | * copyright notice and this permission notice appear in supporting | ||
19 : | * documentation, and that the name of the Vrije Universiteit not be used in | ||
20 : | * advertising or publicity pertaining to distribution of the software without | ||
21 : | * specific, written prior permission. The Vrije Universiteit makes no | ||
22 : | * representations about the suitability of this software for any purpose. | ||
23 : | * It is provided "as is" without express or implied warranty. | ||
24 : | * | ||
25 : | * The Vrije Universiteit DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
26 : | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO | ||
27 : | * EVENT SHALL The Vrije Universiteit BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
28 : | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, | ||
29 : | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER | ||
30 : | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
31 : | * PERFORMANCE OF THIS SOFTWARE. | ||
32 : | */ | ||
33 : | /* $XConsortium: assyntax.h /main/5 1996/02/21 17:50:49 kaleb $ */ | ||
34 : | |||
35 : | /* | ||
36 : | * assyntax.h | ||
37 : | * | ||
38 : | * Select the syntax appropriate to the 386 assembler being used | ||
39 : | * To add support for more assemblers add more columns to the CHOICE | ||
40 : | * macro. Note that register names must also have uppercase names | ||
41 : | * to avoid macro recursion. e.g., #define ah %ah recurses! | ||
42 : | * | ||
43 : | * NB 1. Some of the macros for certain assemblers imply that the code is to | ||
44 : | * run in protected mode!! Caveat emptor. | ||
45 : | * | ||
46 : | * NB 2. 486 specific instructions are not included. This is to discourage | ||
47 : | * their accidental use in code that is intended to run on 386 and 486 | ||
48 : | * systems. | ||
49 : | * | ||
50 : | * Supported assemblers: | ||
51 : | * | ||
52 : | * (a) AT&T SysVr4 as(1): default | ||
53 : | * (b) GNU Assembler gas: define USE_GAS or GNU_ASSEMBLER | ||
54 : | * (c) Amsterdam Compiler kit: define ACK_ASSEMBLER | ||
55 : | * | ||
56 : | * The following naming conventions have been used to identify the various | ||
57 : | * data types: | ||
58 : | * _SR = segment register version | ||
59 : | * Integer: | ||
60 : | * _Q = quadword = 64 bits | ||
61 : | * _L = long = 32 bits | ||
62 : | * _W = short = 16 bits | ||
63 : | * _B = byte = 8 bits | ||
64 : | * Floating-point: | ||
65 : | * _X = m80real = 80 bits | ||
66 : | * _D = double = 64 bits | ||
67 : | * _S = single = 32 bits | ||
68 : | * | ||
69 : | * Author: Gregory J. Sharp, Sept 1992 | ||
70 : | * Vrije Universiteit, Amsterdam, The Netherlands | ||
71 : | */ | ||
72 : | |||
73 : | #if !defined(INTEL_ASSEMBLER) | ||
74 : | |||
75 : | #if defined(USE_GAS) && !defined(GNU_ASSEMBLER) | ||
76 : | #define GNU_ASSEMBLER | ||
77 : | #endif | ||
78 : | |||
79 : | #if (defined(__STDC__) && !defined(UNIXCPP)) || (defined (sun) && defined (i386) && defined (SVR4) && defined (__STDC__) && !defined (__GNUC__)) | ||
80 : | #define CONCAT(x, y) x ## y | ||
81 : | #else | ||
82 : | #define CONCAT(x, y) x/**/y | ||
83 : | #endif | ||
84 : | |||
85 : | #ifdef ACK_ASSEMBLER | ||
86 : | |||
87 : | /* Assume we write code for 32-bit protected mode! */ | ||
88 : | |||
89 : | /* Redefine register names for GAS & AT&T assemblers */ | ||
90 : | #define AL al | ||
91 : | #define AH ah | ||
92 : | #define AX ax | ||
93 : | #define EAX ax | ||
94 : | #define BL bl | ||
95 : | #define BH bh | ||
96 : | #define BX bx | ||
97 : | #define EBX bx | ||
98 : | #define CL cl | ||
99 : | #define CH ch | ||
100 : | #define CX cx | ||
101 : | #define ECX cx | ||
102 : | #define DL dl | ||
103 : | #define DH dh | ||
104 : | #define DX dx | ||
105 : | #define EDX dx | ||
106 : | #define BP bp | ||
107 : | #define EBP bp | ||
108 : | #define SI si | ||
109 : | #define ESI si | ||
110 : | #define DI di | ||
111 : | #define EDI di | ||
112 : | #define SP sp | ||
113 : | #define ESP sp | ||
114 : | #define CS cs | ||
115 : | #define SS ss | ||
116 : | #define DS ds | ||
117 : | #define ES es | ||
118 : | #define FS fs | ||
119 : | #define GS gs | ||
120 : | /* Control Registers */ | ||
121 : | #define CR0 cr0 | ||
122 : | #define CR1 cr1 | ||
123 : | #define CR2 cr2 | ||
124 : | #define CR3 cr3 | ||
125 : | /* Debug Registers */ | ||
126 : | #define DR0 dr0 | ||
127 : | #define DR1 dr1 | ||
128 : | #define DR2 dr2 | ||
129 : | #define DR3 dr3 | ||
130 : | #define DR4 dr4 | ||
131 : | #define DR5 dr5 | ||
132 : | #define DR6 dr6 | ||
133 : | #define DR7 dr7 | ||
134 : | /* Floating-point Stack */ | ||
135 : | #define ST st | ||
136 : | |||
137 : | #define AS_BEGIN .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text | ||
138 : | |||
139 : | |||
140 : | #define _WTOG o16 /* word toggle for _W instructions */ | ||
141 : | #define _LTOG /* long toggle for _L instructions */ | ||
142 : | #define ADDR_TOGGLE a16 | ||
143 : | #define OPSZ_TOGGLE o16 | ||
144 : | #define USE16 .use16 | ||
145 : | #define USE32 .use32 | ||
146 : | |||
147 : | #define CHOICE(a,b,c) c | ||
148 : | |||
149 : | #else /* AT&T or GAS */ | ||
150 : | |||
151 : | /* Redefine register names for GAS & AT&T assemblers */ | ||
152 : | #define AL %al | ||
153 : | #define AH %ah | ||
154 : | #define AX %ax | ||
155 : | #define EAX %eax | ||
156 : | #define BL %bl | ||
157 : | #define BH %bh | ||
158 : | #define BX %bx | ||
159 : | #define EBX %ebx | ||
160 : | #define CL %cl | ||
161 : | #define CH %ch | ||
162 : | #define CX %cx | ||
163 : | #define ECX %ecx | ||
164 : | #define DL %dl | ||
165 : | #define DH %dh | ||
166 : | #define DX %dx | ||
167 : | #define EDX %edx | ||
168 : | #define BP %bp | ||
169 : | #define EBP %ebp | ||
170 : | #define SI %si | ||
171 : | #define ESI %esi | ||
172 : | #define DI %di | ||
173 : | #define EDI %edi | ||
174 : | #define SP %sp | ||
175 : | #define ESP %esp | ||
176 : | #define CS %cs | ||
177 : | #define SS %ss | ||
178 : | #define DS %ds | ||
179 : | #define ES %es | ||
180 : | #define FS %fs | ||
181 : | #define GS %gs | ||
182 : | /* Control Registers */ | ||
183 : | #define CR0 %cr0 | ||
184 : | #define CR1 %cr1 | ||
185 : | #define CR2 %cr2 | ||
186 : | #define CR3 %cr3 | ||
187 : | /* Debug Registers */ | ||
188 : | #define DR0 %db0 | ||
189 : | #define DR1 %db1 | ||
190 : | #define DR2 %db2 | ||
191 : | #define DR3 %db3 | ||
192 : | #define DR4 %db4 | ||
193 : | #define DR5 %db5 | ||
194 : | #define DR6 %db6 | ||
195 : | #define DR7 %db7 | ||
196 : | /* Floating-point Stack */ | ||
197 : | #define ST %st | ||
198 : | |||
199 : | #define AS_BEGIN | ||
200 : | #define USE16 | ||
201 : | #define USE32 | ||
202 : | |||
203 : | #ifdef GNU_ASSEMBLER | ||
204 : | |||
205 : | #define ADDR_TOGGLE aword | ||
206 : | #define OPSZ_TOGGLE word | ||
207 : | |||
208 : | #define CHOICE(a,b,c) b | ||
209 : | |||
210 : | #else | ||
211 : | /* | ||
212 : | * AT&T ASSEMBLER SYNTAX | ||
213 : | * ********************* | ||
214 : | */ | ||
215 : | #define CHOICE(a,b,c) a | ||
216 : | |||
217 : | #define ADDR_TOGGLE addr16 | ||
218 : | #define OPSZ_TOGGLE data16 | ||
219 : | |||
220 : | #endif /* GNU_ASSEMBLER */ | ||
221 : | #endif /* ACK_ASSEMBLER */ | ||
222 : | |||
223 : | |||
224 : | #if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined(__OS2ELF__)) && defined(__ELF__) | ||
225 : | #define GLNAME(a) a | ||
226 : | #else | ||
227 : | #define GLNAME(a) CONCAT(_,a) | ||
228 : | #endif | ||
229 : | |||
230 : | |||
231 : | /****************************************/ | ||
232 : | /* */ | ||
233 : | /* Select the various choices */ | ||
234 : | /* */ | ||
235 : | /****************************************/ | ||
236 : | |||
237 : | |||
238 : | /* Redefine assembler directives */ | ||
239 : | /*********************************/ | ||
240 : | #define GLOBL CHOICE(.globl, .globl, .extern) | ||
241 : | #define ALIGNTEXT4 CHOICE(.align 4, .align ARG2(2,0x90), .align 4) | ||
242 : | #define ALIGNTEXT2 CHOICE(.align 2, .align ARG2(1,0x90), .align 2) | ||
243 : | /* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is | ||
244 : | * guaranteed to be filled with NOPs. Otherwise it does nothing. | ||
245 : | */ | ||
246 : | #define ALIGNTEXT4ifNOP CHOICE(.align 4, .align ARG2(2,0x90), /*can't do it*/) | ||
247 : | #define ALIGNDATA4 CHOICE(.align 4, .align ARG2(2,0x0), .align 4) | ||
248 : | #define ALIGNDATA2 CHOICE(.align 2, .align ARG2(1,0x0), .align 2) | ||
249 : | #define FILE(s) CHOICE(.file s, .file s, .file s) | ||
250 : | #define STRING(s) CHOICE(.string s, .asciz s, .asciz s) | ||
251 : | #define D_LONG CHOICE(.long, .long, .data4) | ||
252 : | #define D_WORD CHOICE(.value, .short, .data2) | ||
253 : | #define D_BYTE CHOICE(.byte, .byte, .data1) | ||
254 : | #define SPACE CHOICE(.comm, .space, .space) | ||
255 : | #define COMM CHOICE(.comm, .comm, .comm) | ||
256 : | #define SEG_DATA CHOICE(.data, .data, .sect .data) | ||
257 : | #define SEG_TEXT CHOICE(.text, .text, .sect .text) | ||
258 : | #define SEG_BSS CHOICE(.bss, .bss, .sect .bss) | ||
259 : | |||
260 : | #ifdef GNU_ASSEMBLER | ||
261 : | #define D_SPACE(n) . = . + n | ||
262 : | #else | ||
263 : | #define D_SPACE(n) .space n | ||
264 : | #endif | ||
265 : | |||
266 : | /* Addressing Modes */ | ||
267 : | /* Immediate Mode */ | ||
268 : | #define ADDR(a) CHOICE(CONCAT($,a), CONCAT($,a), a) | ||
269 : | #define CONST(a) CHOICE(CONCAT($,a), CONCAT($,a), a) | ||
270 : | |||
271 : | /* Indirect Mode */ | ||
272 : | #define CONTENT(a) CHOICE(a, a, (a)) /* take contents of variable */ | ||
273 : | #define REGIND(a) CHOICE((a), (a), (a)) /* Register a indirect */ | ||
274 : | /* Register b indirect plus displacement a */ | ||
275 : | #define REGOFF(a, b) CHOICE(a(b), a(b), a(b)) | ||
276 : | /* Reg indirect Base + Index + Displacement - this is mainly for 16-bit mode | ||
277 : | * which has no scaling | ||
278 : | */ | ||
279 : | #define REGBID(b,i,d) CHOICE(d(b,i), d(b,i), d(b)(i)) | ||
280 : | /* Reg indirect Base + (Index * Scale) + Displacement */ | ||
281 : | #define REGBISD(b,i,s,d) CHOICE(d(b,i,s), d(b,i,s), d(b)(i*s)) | ||
282 : | /* Displaced Scaled Index: */ | ||
283 : | #define REGDIS(d,i,s) CHOICE(d(,i,s), d(,i,s), d(i * s)) | ||
284 : | /* Indexed Base: */ | ||
285 : | #define REGBI(b,i) CHOICE((b,i), (b,i), (b)(i)) | ||
286 : | /* Displaced Base: */ | ||
287 : | #define REGDB(d,b) CHOICE(d(b), d(b), d(b)) | ||
288 : | /* Variable indirect: */ | ||
289 : | #define VARINDIRECT(var) CHOICE(*var, *var, (var)) | ||
290 : | /* Use register contents as jump/call target: */ | ||
291 : | #define CODEPTR(reg) CHOICE(*reg, *reg, reg) | ||
292 : | |||
293 : | /* For expressions requiring bracketing | ||
294 : | * eg. (CRT0_PM | CRT_EM) | ||
295 : | */ | ||
296 : | |||
297 : | #define EXPR(a) CHOICE([a], (a), [a]) | ||
298 : | #define ENOT(a) CHOICE(0!a, ~a, ~a) | ||
299 : | #define EMUL(a,b) CHOICE(a\*b, a*b, a*b) | ||
300 : | #define EDIV(a,b) CHOICE(a\/b, a/b, a/b) | ||
301 : | |||
302 : | /* | ||
303 : | * We have to beat the problem of commas within arguments to choice. | ||
304 : | * eg. choice (add a,b, add b,a) will get argument mismatch. Luckily ANSI | ||
305 : | * and other known cpp definitions evaluate arguments before substitution | ||
306 : | * so the following works. | ||
307 : | */ | ||
308 : | #define ARG2(a, b) a,b | ||
309 : | #define ARG3(a,b,c) a,b,c | ||
310 : | |||
311 : | /* Redefine assembler commands */ | ||
312 : | #define AAA CHOICE(aaa, aaa, aaa) | ||
313 : | #define AAD CHOICE(aad, aad, aad) | ||
314 : | #define AAM CHOICE(aam, aam, aam) | ||
315 : | #define AAS CHOICE(aas, aas, aas) | ||
316 : | #define ADC_L(a, b) CHOICE(adcl ARG2(a,b), adcl ARG2(a,b), _LTOG adc ARG2(b,a)) | ||
317 : | #define ADC_W(a, b) CHOICE(adcw ARG2(a,b), adcw ARG2(a,b), _WTOG adc ARG2(b,a)) | ||
318 : | #define ADC_B(a, b) CHOICE(adcb ARG2(a,b), adcb ARG2(a,b), adcb ARG2(b,a)) | ||
319 : | #define ADD_L(a, b) CHOICE(addl ARG2(a,b), addl ARG2(a,b), _LTOG add ARG2(b,a)) | ||
320 : | #define ADD_W(a, b) CHOICE(addw ARG2(a,b), addw ARG2(a,b), _WTOG add ARG2(b,a)) | ||
321 : | #define ADD_B(a, b) CHOICE(addb ARG2(a,b), addb ARG2(a,b), addb ARG2(b,a)) | ||
322 : | #define AND_L(a, b) CHOICE(andl ARG2(a,b), andl ARG2(a,b), _LTOG and ARG2(b,a)) | ||
323 : | #define AND_W(a, b) CHOICE(andw ARG2(a,b), andw ARG2(a,b), _WTOG and ARG2(b,a)) | ||
324 : | #define AND_B(a, b) CHOICE(andb ARG2(a,b), andb ARG2(a,b), andb ARG2(b,a)) | ||
325 : | #define ARPL(a,b) CHOICE(arpl ARG2(a,b), arpl ARG2(a,b), arpl ARG2(b,a)) | ||
326 : | #define BOUND_L(a, b) CHOICE(boundl ARG2(a,b), boundl ARG2(b,a), _LTOG bound ARG2(b,a)) | ||
327 : | #define BOUND_W(a, b) CHOICE(boundw ARG2(a,b), boundw ARG2(b,a), _WTOG bound ARG2(b,a)) | ||
328 : | #define BSF_L(a, b) CHOICE(bsfl ARG2(a,b), bsfl ARG2(a,b), _LTOG bsf ARG2(b,a)) | ||
329 : | #define BSF_W(a, b) CHOICE(bsfw ARG2(a,b), bsfw ARG2(a,b), _WTOG bsf ARG2(b,a)) | ||
330 : | #define BSR_L(a, b) CHOICE(bsrl ARG2(a,b), bsrl ARG2(a,b), _LTOG bsr ARG2(b,a)) | ||
331 : | #define BSR_W(a, b) CHOICE(bsrw ARG2(a,b), bsrw ARG2(a,b), _WTOG bsr ARG2(b,a)) | ||
332 : | #define BT_L(a, b) CHOICE(btl ARG2(a,b), btl ARG2(a,b), _LTOG bt ARG2(b,a)) | ||
333 : | #define BT_W(a, b) CHOICE(btw ARG2(a,b), btw ARG2(a,b), _WTOG bt ARG2(b,a)) | ||
334 : | #define BTC_L(a, b) CHOICE(btcl ARG2(a,b), btcl ARG2(a,b), _LTOG btc ARG2(b,a)) | ||
335 : | #define BTC_W(a, b) CHOICE(btcw ARG2(a,b), btcw ARG2(a,b), _WTOG btc ARG2(b,a)) | ||
336 : | #define BTR_L(a, b) CHOICE(btrl ARG2(a,b), btrl ARG2(a,b), _LTOG btr ARG2(b,a)) | ||
337 : | #define BTR_W(a, b) CHOICE(btrw ARG2(a,b), btrw ARG2(a,b), _WTOG btr ARG2(b,a)) | ||
338 : | #define BTS_L(a, b) CHOICE(btsl ARG2(a,b), btsl ARG2(a,b), _LTOG bts ARG2(b,a)) | ||
339 : | #define BTS_W(a, b) CHOICE(btsw ARG2(a,b), btsw ARG2(a,b), _WTOG bts ARG2(b,a)) | ||
340 : | #define CALL(a) CHOICE(call a, call a, call a) | ||
341 : | #define CALLF(s,a) CHOICE(lcall ARG2(s,a), lcall ARG2(s,a), callf s:a) | ||
342 : | #define CBW CHOICE(cbtw, cbw, cbw) | ||
343 : | #define CWDE CHOICE(cwtd, cwde, cwde) | ||
344 : | #define CLC CHOICE(clc, clc, clc) | ||
345 : | #define CLD CHOICE(cld, cld, cld) | ||
346 : | #define CLI CHOICE(cli, cli, cli) | ||
347 : | #define CLTS CHOICE(clts, clts, clts) | ||
348 : | #define CMC CHOICE(cmc, cmc, cmc) | ||
349 : | #define CMP_L(a, b) CHOICE(cmpl ARG2(a,b), cmpl ARG2(a,b), _LTOG cmp ARG2(b,a)) | ||
350 : | #define CMP_W(a, b) CHOICE(cmpw ARG2(a,b), cmpw ARG2(a,b), _WTOG cmp ARG2(b,a)) | ||
351 : | #define CMP_B(a, b) CHOICE(cmpb ARG2(a,b), cmpb ARG2(a,b), cmpb ARG2(b,a)) | ||
352 : | #define CMPS_L CHOICE(cmpsl, cmpsl, _LTOG cmps) | ||
353 : | #define CMPS_W CHOICE(cmpsw, cmpsw, _WTOG cmps) | ||
354 : | #define CMPS_B CHOICE(cmpsb, cmpsb, cmpsb) | ||
355 : | #define CWD CHOICE(cwtl, cwd, cwd) | ||
356 : | #define CDQ CHOICE(cltd, cdq, cdq) | ||
357 : | #define DAA CHOICE(daa, daa, daa) | ||
358 : | #define DAS CHOICE(das, das, das) | ||
359 : | #define DEC_L(a) CHOICE(decl a, decl a, _LTOG dec a) | ||
360 : | #define DEC_W(a) CHOICE(decw a, decw a, _WTOG dec a) | ||
361 : | #define DEC_B(a) CHOICE(decb a, decb a, decb a) | ||
362 : | #define DIV_L(a) CHOICE(divl a, divl a, div a) | ||
363 : | #define DIV_W(a) CHOICE(divw a, divw a, div a) | ||
364 : | #define DIV_B(a) CHOICE(divb a, divb a, divb a) | ||
365 : | #define ENTER(a,b) CHOICE(enter ARG2(a,b), enter ARG2(a,b), enter ARG2(b,a)) | ||
366 : | #define HLT CHOICE(hlt, hlt, hlt) | ||
367 : | #define IDIV_L(a) CHOICE(idivl a, idivl a, _LTOG idiv a) | ||
368 : | #define IDIV_W(a) CHOICE(idivw a, idivw a, _WTOG idiv a) | ||
369 : | #define IDIV_B(a) CHOICE(idivb a, idivb a, idivb a) | ||
370 : | /* More forms than this for imul!! */ | ||
371 : | #define IMUL_L(a, b) CHOICE(imull ARG2(a,b), imull ARG2(a,b), _LTOG imul ARG2(b,a)) | ||
372 : | #define IMUL_W(a, b) CHOICE(imulw ARG2(a,b), imulw ARG2(a,b), _WTOG imul ARG2(b,a)) | ||
373 : | #define IMUL_B(a) CHOICE(imulb a, imulb a, imulb a) | ||
374 : | #define IN_L CHOICE(inl (DX), inl ARG2(DX,EAX), _LTOG in DX) | ||
375 : | #define IN_W CHOICE(inw (DX), inw ARG2(DX,AX), _WTOG in DX) | ||
376 : | #define IN_B CHOICE(inb (DX), inb ARG2(DX,AL), inb DX) | ||
377 : | /* Please AS code writer: use the following ONLY, if you refer to ports<256 | ||
378 : | * directly, but not in IN1_W(DX), for instance, even if IN1_ looks nicer | ||
379 : | */ | ||
380 : | #if defined (sun) | ||
381 : | #define IN1_L(a) CHOICE(inl (a), inl ARG2(a,EAX), _LTOG in a) | ||
382 : | #define IN1_W(a) CHOICE(inw (a), inw ARG2(a,AX), _WTOG in a) | ||
383 : | #define IN1_B(a) CHOICE(inb (a), inb ARG2(a,AL), inb a) | ||
384 : | #else | ||
385 : | #define IN1_L(a) CHOICE(inl a, inl ARG2(a,EAX), _LTOG in a) | ||
386 : | #define IN1_W(a) CHOICE(inw a, inw ARG2(a,AX), _WTOG in a) | ||
387 : | #define IN1_B(a) CHOICE(inb a, inb ARG2(a,AL), inb a) | ||
388 : | #endif | ||
389 : | #define INC_L(a) CHOICE(incl a, incl a, _LTOG inc a) | ||
390 : | #define INC_W(a) CHOICE(incw a, incw a, _WTOG inc a) | ||
391 : | #define INC_B(a) CHOICE(incb a, incb a, incb a) | ||
392 : | #define INS_L CHOICE(insl, insl, _LTOG ins) | ||
393 : | #define INS_W CHOICE(insw, insw, _WTOG ins) | ||
394 : | #define INS_B CHOICE(insb, insb, insb) | ||
395 : | #define INT(a) CHOICE(int a, int a, int a) | ||
396 : | #define INT3 CHOICE(int CONST(3), int3, int CONST(3)) | ||
397 : | #define INTO CHOICE(into, into, into) | ||
398 : | #define IRET CHOICE(iret, iret, iret) | ||
399 : | #define IRETD CHOICE(iret, iret, iretd) | ||
400 : | #define JA(a) CHOICE(ja a, ja a, ja a) | ||
401 : | #define JAE(a) CHOICE(jae a, jae a, jae a) | ||
402 : | #define JB(a) CHOICE(jb a, jb a, jb a) | ||
403 : | #define JBE(a) CHOICE(jbe a, jbe a, jbe a) | ||
404 : | #define JC(a) CHOICE(jc a, jc a, jc a) | ||
405 : | #define JE(a) CHOICE(je a, je a, je a) | ||
406 : | #define JG(a) CHOICE(jg a, jg a, jg a) | ||
407 : | #define JGE(a) CHOICE(jge a, jge a, jge a) | ||
408 : | #define JL(a) CHOICE(jl a, jl a, jl a) | ||
409 : | #define JLE(a) CHOICE(jle a, jle a, jle a) | ||
410 : | #define JNA(a) CHOICE(jna a, jna a, jna a) | ||
411 : | #define JNAE(a) CHOICE(jnae a, jnae a, jnae a) | ||
412 : | #define JNB(a) CHOICE(jnb a, jnb a, jnb a) | ||
413 : | #define JNBE(a) CHOICE(jnbe a, jnbe a, jnbe a) | ||
414 : | #define JNC(a) CHOICE(jnc a, jnc a, jnc a) | ||
415 : | #define JNE(a) CHOICE(jne a, jne a, jne a) | ||
416 : | #define JNG(a) CHOICE(jng a, jng a, jng a) | ||
417 : | #define JNGE(a) CHOICE(jnge a, jnge a, jnge a) | ||
418 : | #define JNL(a) CHOICE(jnl a, jnl a, jnl a) | ||
419 : | #define JNLE(a) CHOICE(jnle a, jnle a, jnle a) | ||
420 : | #define JNO(a) CHOICE(jno a, jno a, jno a) | ||
421 : | #define JNP(a) CHOICE(jnp a, jnp a, jnp a) | ||
422 : | #define JNS(a) CHOICE(jns a, jns a, jns a) | ||
423 : | #define JNZ(a) CHOICE(jnz a, jnz a, jnz a) | ||
424 : | #define JO(a) CHOICE(jo a, jo a, jo a) | ||
425 : | #define JP(a) CHOICE(jp a, jp a, jp a) | ||
426 : | #define JPE(a) CHOICE(jpe a, jpe a, jpe a) | ||
427 : | #define JPO(a) CHOICE(jpo a, jpo a, jpo a) | ||
428 : | #define JS(a) CHOICE(js a, js a, js a) | ||
429 : | #define JZ(a) CHOICE(jz a, jz a, jz a) | ||
430 : | #define JMP(a) CHOICE(jmp a, jmp a, jmp a) | ||
431 : | #define JMPF(s,a) CHOICE(ljmp ARG2(s,a), ljmp ARG2(s,a), jmpf s:a) | ||
432 : | #define LAHF CHOICE(lahf, lahf, lahf) | ||
433 : | #if !defined(_REAL_MODE) && !defined(_V86_MODE) | ||
434 : | #define LAR(a, b) CHOICE(lar ARG2(a, b), lar ARG2(a, b), lar ARG2(b, a)) | ||
435 : | #endif | ||
436 : | #define LEA_L(a, b) CHOICE(leal ARG2(a,b), leal ARG2(a,b), _LTOG lea ARG2(b,a)) | ||
437 : | #define LEA_W(a, b) CHOICE(leaw ARG2(a,b), leaw ARG2(a,b), _WTOG lea ARG2(b,a)) | ||
438 : | #define LEAVE CHOICE(leave, leave, leave) | ||
439 : | #define LGDT(a) CHOICE(lgdt a, lgdt a, lgdt a) | ||
440 : | #define LIDT(a) CHOICE(lidt a, lidt a, lidt a) | ||
441 : | #define LDS(a, b) CHOICE(ldsl ARG2(a,b), lds ARG2(a,b), lds ARG2(b,a)) | ||
442 : | #define LES(a, b) CHOICE(lesl ARG2(a,b), les ARG2(a,b), les ARG2(b,a)) | ||
443 : | #define LFS(a, b) CHOICE(lfsl ARG2(a,b), lfs ARG2(a,b), lfs ARG2(b,a)) | ||
444 : | #define LGS(a, b) CHOICE(lgsl ARG2(a,b), lgs ARG2(a,b), lgs ARG2(b,a)) | ||
445 : | #define LSS(a, b) CHOICE(lssl ARG2(a,b), lss ARG2(a,b), lss ARG2(b,a)) | ||
446 : | #define LLDT(a) CHOICE(lldt a, lldt a, lldt a) | ||
447 : | #define LMSW(a) CHOICE(lmsw a, lmsw a, lmsw a) | ||
448 : | #define LOCK CHOICE(lock, lock, lock) | ||
449 : | #define LODS_L CHOICE(lodsl, lodsl, _LTOG lods) | ||
450 : | #define LODS_W CHOICE(lodsw, lodsw, _WTOG lods) | ||
451 : | #define LODS_B CHOICE(lodsb, lodsb, lodsb) | ||
452 : | #define LOOP(a) CHOICE(loop a, loop a, loop a) | ||
453 : | #define LOOPE(a) CHOICE(loope a, loope a, loope a) | ||
454 : | #define LOOPZ(a) CHOICE(loopz a, loopz a, loopz a) | ||
455 : | #define LOOPNE(a) CHOICE(loopne a, loopne a, loopne a) | ||
456 : | #define LOOPNZ(a) CHOICE(loopnz a, loopnz a, loopnz a) | ||
457 : | #if !defined(_REAL_MODE) && !defined(_V86_MODE) | ||
458 : | #define LSL(a, b) CHOICE(lsl ARG2(a,b), lsl ARG2(a,b), lsl ARG2(b,a)) | ||
459 : | #endif | ||
460 : | #define LTR(a) CHOICE(ltr a, ltr a, ltr a) | ||
461 : | #define MOV_SR(a, b) CHOICE(movw ARG2(a,b), mov ARG2(a,b), mov ARG2(b,a)) | ||
462 : | #define MOV_L(a, b) CHOICE(movl ARG2(a,b), movl ARG2(a,b), _LTOG mov ARG2(b,a)) | ||
463 : | #define MOV_W(a, b) CHOICE(movw ARG2(a,b), movw ARG2(a,b), _WTOG mov ARG2(b,a)) | ||
464 : | #define MOV_B(a, b) CHOICE(movb ARG2(a,b), movb ARG2(a,b), movb ARG2(b,a)) | ||
465 : | #define MOVS_L CHOICE(movsl, movsl, _LTOG movs) | ||
466 : | #define MOVS_W CHOICE(movsw, movsw, _WTOG movs) | ||
467 : | #define MOVS_B CHOICE(movsb, movsb, movsb) | ||
468 : | #define MOVSX_BL(a, b) CHOICE(movsbl ARG2(a,b), movsbl ARG2(a,b), movsx ARG2(b,a)) | ||
469 : | #define MOVSX_BW(a, b) CHOICE(movsbw ARG2(a,b), movsbw ARG2(a,b), movsx ARG2(b,a)) | ||
470 : | #define MOVSX_WL(a, b) CHOICE(movswl ARG2(a,b), movswl ARG2(a,b), movsx ARG2(b,a)) | ||
471 : | #define MOVZX_BL(a, b) CHOICE(movzbl ARG2(a,b), movzbl ARG2(a,b), movzx ARG2(b,a)) | ||
472 : | #define MOVZX_BW(a, b) CHOICE(movzbw ARG2(a,b), movzbw ARG2(a,b), movzx ARG2(b,a)) | ||
473 : | #define MOVZX_WL(a, b) CHOICE(movzwl ARG2(a,b), movzwl ARG2(a,b), movzx ARG2(b,a)) | ||
474 : | #define MUL_L(a) CHOICE(mull a, mull a, _LTOG mul a) | ||
475 : | #define MUL_W(a) CHOICE(mulw a, mulw a, _WTOG mul a) | ||
476 : | #define MUL_B(a) CHOICE(mulb a, mulb a, mulb a) | ||
477 : | #define NEG_L(a) CHOICE(negl a, negl a, _LTOG neg a) | ||
478 : | #define NEG_W(a) CHOICE(negw a, negw a, _WTOG neg a) | ||
479 : | #define NEG_B(a) CHOICE(negb a, negb a, negb a) | ||
480 : | #define NOP CHOICE(nop, nop, nop) | ||
481 : | #define NOT_L(a) CHOICE(notl a, notl a, _LTOG not a) | ||
482 : | #define NOT_W(a) CHOICE(notw a, notw a, _WTOG not a) | ||
483 : | #define NOT_B(a) CHOICE(notb a, notb a, notb a) | ||
484 : | #define OR_L(a,b) CHOICE(orl ARG2(a,b), orl ARG2(a,b), _LTOG or ARG2(b,a)) | ||
485 : | #define OR_W(a,b) CHOICE(orw ARG2(a,b), orw ARG2(a,b), _WTOG or ARG2(b,a)) | ||
486 : | #define OR_B(a,b) CHOICE(orb ARG2(a,b), orb ARG2(a,b), orb ARG2(b,a)) | ||
487 : | #define OUT_L CHOICE(outl (DX), outl ARG2(EAX,DX), _LTOG out DX) | ||
488 : | #define OUT_W CHOICE(outw (DX), outw ARG2(AX,DX), _WTOG out DX) | ||
489 : | #define OUT_B CHOICE(outb (DX), outb ARG2(AL,DX), outb DX) | ||
490 : | /* Please AS code writer: use the following ONLY, if you refer to ports<256 | ||
491 : | * directly, but not in OUT1_W(DX), for instance, even if OUT1_ looks nicer | ||
492 : | */ | ||
493 : | #define OUT1_L(a) CHOICE(outl (a), outl ARG2(EAX,a), _LTOG out a) | ||
494 : | #define OUT1_W(a) CHOICE(outw (a), outw ARG2(AX,a), _WTOG out a) | ||
495 : | #define OUT1_B(a) CHOICE(outb (a), outb ARG2(AL,a), outb a) | ||
496 : | #define OUTS_L CHOICE(outsl, outsl, _LTOG outs) | ||
497 : | #define OUTS_W CHOICE(outsw, outsw, _WTOG outs) | ||
498 : | #define OUTS_B CHOICE(outsb, outsb, outsb) | ||
499 : | #define POP_SR(a) CHOICE(pop a, pop a, pop a) | ||
500 : | #define POP_L(a) CHOICE(popl a, popl a, _LTOG pop a) | ||
501 : | #define POP_W(a) CHOICE(popw a, popw a, _WTOG pop a) | ||
502 : | #define POPA_L CHOICE(popal, popal, _LTOG popa) | ||
503 : | #define POPA_W CHOICE(popaw, popaw, _WTOG popa) | ||
504 : | #define POPF_L CHOICE(popfl, popfl, _LTOG popf) | ||
505 : | #define POPF_W CHOICE(popfw, popfw, _WTOG popf) | ||
506 : | #define PUSH_SR(a) CHOICE(push a, push a, push a) | ||
507 : | #define PUSH_L(a) CHOICE(pushl a, pushl a, _LTOG push a) | ||
508 : | #define PUSH_W(a) CHOICE(pushw a, pushw a, _WTOG push a) | ||
509 : | #define PUSH_B(a) CHOICE(push a, pushb a, push a) | ||
510 : | #define PUSHA_L CHOICE(pushal, pushal, _LTOG pusha) | ||
511 : | #define PUSHA_W CHOICE(pushaw, pushaw, _WTOG pusha) | ||
512 : | #define PUSHF_L CHOICE(pushfl, pushfl, _LTOG pushf) | ||
513 : | #define PUSHF_W CHOICE(pushfw, pushfw, _WTOG pushf) | ||
514 : | #define RCL_L(a, b) CHOICE(rcll ARG2(a,b), rcll ARG2(a,b), _LTOG rcl ARG2(b,a)) | ||
515 : | #define RCL_W(a, b) CHOICE(rclw ARG2(a,b), rclw ARG2(a,b), _WTOG rcl ARG2(b,a)) | ||
516 : | #define RCL_B(a, b) CHOICE(rclb ARG2(a,b), rclb ARG2(a,b), rclb ARG2(b,a)) | ||
517 : | #define RCR_L(a, b) CHOICE(rcrl ARG2(a,b), rcrl ARG2(a,b), _LTOG rcr ARG2(b,a)) | ||
518 : | #define RCR_W(a, b) CHOICE(rcrw ARG2(a,b), rcrw ARG2(a,b), _WTOG rcr ARG2(b,a)) | ||
519 : | #define RCR_B(a, b) CHOICE(rcrb ARG2(a,b), rcrb ARG2(a,b), rcrb ARG2(b,a)) | ||
520 : | #define ROL_L(a, b) CHOICE(roll ARG2(a,b), roll ARG2(a,b), _LTOG rol ARG2(b,a)) | ||
521 : | #define ROL_W(a, b) CHOICE(rolw ARG2(a,b), rolw ARG2(a,b), _WTOG rol ARG2(b,a)) | ||
522 : | #define ROL_B(a, b) CHOICE(rolb ARG2(a,b), rolb ARG2(a,b), rolb ARG2(b,a)) | ||
523 : | #define ROR_L(a, b) CHOICE(rorl ARG2(a,b), rorl ARG2(a,b), _LTOG ror ARG2(b,a)) | ||
524 : | #define ROR_W(a, b) CHOICE(rorw ARG2(a,b), rorw ARG2(a,b), _WTOG ror ARG2(b,a)) | ||
525 : | #define ROR_B(a, b) CHOICE(rorb ARG2(a,b), rorb ARG2(a,b), rorb ARG2(b,a)) | ||
526 : | #define REP CHOICE(rep ;, rep ;, repe) | ||
527 : | #define REPE CHOICE(repz ;, repe ;, repe) | ||
528 : | #define REPNE CHOICE(repnz ;, repne ;, repne) | ||
529 : | #define REPNZ REPNE | ||
530 : | #define REPZ REPE | ||
531 : | #define RET CHOICE(ret, ret, ret) | ||
532 : | #define SAHF CHOICE(sahf, sahf, sahf) | ||
533 : | #define SAL_L(a, b) CHOICE(sall ARG2(a,b), sall ARG2(a,b), _LTOG sal ARG2(b,a)) | ||
534 : | #define SAL_W(a, b) CHOICE(salw ARG2(a,b), salw ARG2(a,b), _WTOG sal ARG2(b,a)) | ||
535 : | #define SAL_B(a, b) CHOICE(salb ARG2(a,b), salb ARG2(a,b), salb ARG2(b,a)) | ||
536 : | #define SAR_L(a, b) CHOICE(sarl ARG2(a,b), sarl ARG2(a,b), _LTOG sar ARG2(b,a)) | ||
537 : | #define SAR_W(a, b) CHOICE(sarw ARG2(a,b), sarw ARG2(a,b), _WTOG sar ARG2(b,a)) | ||
538 : | #define SAR_B(a, b) CHOICE(sarb ARG2(a,b), sarb ARG2(a,b), sarb ARG2(b,a)) | ||
539 : | #define SBB_L(a, b) CHOICE(sbbl ARG2(a,b), sbbl ARG2(a,b), _LTOG sbb ARG2(b,a)) | ||
540 : | #define SBB_W(a, b) CHOICE(sbbw ARG2(a,b), sbbw ARG2(a,b), _WTOG sbb ARG2(b,a)) | ||
541 : | #define SBB_B(a, b) CHOICE(sbbb ARG2(a,b), sbbb ARG2(a,b), sbbb ARG2(b,a)) | ||
542 : | #define SCAS_L CHOICE(scasl, scasl, _LTOG scas) | ||
543 : | #define SCAS_W CHOICE(scasw, scasw, _WTOG scas) | ||
544 : | #define SCAS_B CHOICE(scasb, scasb, scasb) | ||
545 : | #define SETA(a) CHOICE(seta a, seta a, seta a) | ||
546 : | #define SETAE(a) CHOICE(setae a, setae a, setae a) | ||
547 : | #define SETB(a) CHOICE(setb a, setb a, setb a) | ||
548 : | #define SETBE(a) CHOICE(setbe a, setbe a, setbe a) | ||
549 : | #define SETC(a) CHOICE(setc a, setb a, setb a) | ||
550 : | #define SETE(a) CHOICE(sete a, sete a, sete a) | ||
551 : | #define SETG(a) CHOICE(setg a, setg a, setg a) | ||
552 : | #define SETGE(a) CHOICE(setge a, setge a, setge a) | ||
553 : | #define SETL(a) CHOICE(setl a, setl a, setl a) | ||
554 : | #define SETLE(a) CHOICE(setle a, setle a, setle a) | ||
555 : | #define SETNA(a) CHOICE(setna a, setna a, setna a) | ||
556 : | #define SETNAE(a) CHOICE(setnae a, setnae a, setnae a) | ||
557 : | #define SETNB(a) CHOICE(setnb a, setnb a, setnb a) | ||
558 : | #define SETNBE(a) CHOICE(setnbe a, setnbe a, setnbe a) | ||
559 : | #define SETNC(a) CHOICE(setnc a, setnb a, setnb a) | ||
560 : | #define SETNE(a) CHOICE(setne a, setne a, setne a) | ||
561 : | #define SETNG(a) CHOICE(setng a, setng a, setng a) | ||
562 : | #define SETNGE(a) CHOICE(setnge a, setnge a, setnge a) | ||
563 : | #define SETNL(a) CHOICE(setnl a, setnl a, setnl a) | ||
564 : | #define SETNLE(a) CHOICE(setnle a, setnle a, setnle a) | ||
565 : | #define SETNO(a) CHOICE(setno a, setno a, setno a) | ||
566 : | #define SETNP(a) CHOICE(setnp a, setnp a, setnp a) | ||
567 : | #define SETNS(a) CHOICE(setns a, setns a, setna a) | ||
568 : | #define SETNZ(a) CHOICE(setnz a, setnz a, setnz a) | ||
569 : | #define SETO(a) CHOICE(seto a, seto a, seto a) | ||
570 : | #define SETP(a) CHOICE(setp a, setp a, setp a) | ||
571 : | #define SETPE(a) CHOICE(setpe a, setpe a, setpe a) | ||
572 : | #define SETPO(a) CHOICE(setpo a, setpo a, setpo a) | ||
573 : | #define SETS(a) CHOICE(sets a, sets a, seta a) | ||
574 : | #define SETZ(a) CHOICE(setz a, setz a, setz a) | ||
575 : | #define SGDT(a) CHOICE(sgdt a, sgdt a, sgdt a) | ||
576 : | #define SIDT(a) CHOICE(sidt a, sidt a, sidt a) | ||
577 : | #define SHL_L(a, b) CHOICE(shll ARG2(a,b), shll ARG2(a,b), _LTOG shl ARG2(b,a)) | ||
578 : | #define SHL_W(a, b) CHOICE(shlw ARG2(a,b), shlw ARG2(a,b), _WTOG shl ARG2(b,a)) | ||
579 : | #define SHL_B(a, b) CHOICE(shlb ARG2(a,b), shlb ARG2(a,b), shlb ARG2(b,a)) | ||
580 : | #define SHLD_L(a,b,c) CHOICE(shldl ARG3(a,b,c), shldl ARG3(a,b,c), _LTOG shld ARG3(c,b,a)) | ||
581 : | #define SHLD2_L(a,b) CHOICE(shldl ARG2(a,b), shldl ARG3(CL,a,b), _LTOG shld ARG3(b,a,CL)) | ||
582 : | #define SHLD_W(a,b,c) CHOICE(shldw ARG3(a,b,c), shldw ARG3(a,b,c), _WTOG shld ARG3(c,b,a)) | ||
583 : | #define SHLD2_W(a,b) CHOICE(shldw ARG2(a,b), shldw ARG3(CL,a,b), _WTOG shld ARG3(b,a,CL)) | ||
584 : | #define SHR_L(a, b) CHOICE(shrl ARG2(a,b), shrl ARG2(a,b), _LTOG shr ARG2(b,a)) | ||
585 : | #define SHR_W(a, b) CHOICE(shrw ARG2(a,b), shrw ARG2(a,b), _WTOG shr ARG2(b,a)) | ||
586 : | #define SHR_B(a, b) CHOICE(shrb ARG2(a,b), shrb ARG2(a,b), shrb ARG2(b,a)) | ||
587 : | #define SHRD_L(a,b,c) CHOICE(shrdl ARG3(a,b,c), shrdl ARG3(a,b,c), _LTOG shrd ARG3(c,b,a)) | ||
588 : | #define SHRD2_L(a,b) CHOICE(shrdl ARG2(a,b), shrdl ARG3(CL,a,b), _LTOG shrd ARG3(b,a,CL)) | ||
589 : | #define SHRD_W(a,b,c) CHOICE(shrdw ARG3(a,b,c), shrdw ARG3(a,b,c), _WTOG shrd ARG3(c,b,a)) | ||
590 : | #define SHRD2_W(a,b) CHOICE(shrdw ARG2(a,b), shrdw ARG3(CL,a,b), _WTOG shrd ARG3(b,a,CL)) | ||
591 : | #define SLDT(a) CHOICE(sldt a, sldt a, sldt a) | ||
592 : | #define SMSW(a) CHOICE(smsw a, smsw a, smsw a) | ||
593 : | #define STC CHOICE(stc, stc, stc) | ||
594 : | #define STD CHOICE(std, std, std) | ||
595 : | #define STI CHOICE(sti, sti, sti) | ||
596 : | #define STOS_L CHOICE(stosl, stosl, _LTOG stos) | ||
597 : | #define STOS_W CHOICE(stosw, stosw, _WTOG stos) | ||
598 : | #define STOS_B CHOICE(stosb, stosb, stosb) | ||
599 : | #define STR(a) CHOICE(str a, str a, str a) | ||
600 : | #define SUB_L(a, b) CHOICE(subl ARG2(a,b), subl ARG2(a,b), _LTOG sub ARG2(b,a)) | ||
601 : | #define SUB_W(a, b) CHOICE(subw ARG2(a,b), subw ARG2(a,b), _WTOG sub ARG2(b,a)) | ||
602 : | #define SUB_B(a, b) CHOICE(subb ARG2(a,b), subb ARG2(a,b), subb ARG2(b,a)) | ||
603 : | #define TEST_L(a, b) CHOICE(testl ARG2(a,b), testl ARG2(a,b), _LTOG test ARG2(b,a)) | ||
604 : | #define TEST_W(a, b) CHOICE(testw ARG2(a,b), testw ARG2(a,b), _WTOG test ARG2(b,a)) | ||
605 : | #define TEST_B(a, b) CHOICE(testb ARG2(a,b), testb ARG2(a,b), testb ARG2(b,a)) | ||
606 : | #define VERR(a) CHOICE(verr a, verr a, verr a) | ||
607 : | #define VERW(a) CHOICE(verw a, verw a, verw a) | ||
608 : | #define WAIT CHOICE(wait, wait, wait) | ||
609 : | #define XCHG_L(a, b) CHOICE(xchgl ARG2(a,b), xchgl ARG2(a,b), _LTOG xchg ARG2(b,a)) | ||
610 : | #define XCHG_W(a, b) CHOICE(xchgw ARG2(a,b), xchgw ARG2(a,b), _WTOG xchg ARG2(b,a)) | ||
611 : | #define XCHG_B(a, b) CHOICE(xchgb ARG2(a,b), xchgb ARG2(a,b), xchgb ARG2(b,a)) | ||
612 : | #define XLAT CHOICE(xlat, xlat, xlat) | ||
613 : | #define XOR_L(a, b) CHOICE(xorl ARG2(a,b), xorl ARG2(a,b), _LTOG xor ARG2(b,a)) | ||
614 : | #define XOR_W(a, b) CHOICE(xorw ARG2(a,b), xorw ARG2(a,b), _WTOG xor ARG2(b,a)) | ||
615 : | #define XOR_B(a, b) CHOICE(xorb ARG2(a,b), xorb ARG2(a,b), xorb ARG2(b,a)) | ||
616 : | |||
617 : | |||
618 : | /* Floating Point Instructions */ | ||
619 : | #define F2XM1 CHOICE(f2xm1, f2xm1, f2xm1) | ||
620 : | #define FABS CHOICE(fabs, fabs, fabs) | ||
621 : | #define FADD_D(a) CHOICE(faddl a, faddl a, faddd a) | ||
622 : | #define FADD_S(a) CHOICE(fadds a, fadds a, fadds a) | ||
623 : | #define FADD2(a, b) CHOICE(fadd ARG2(a,b), fadd ARG2(a,b), fadd ARG2(b,a)) | ||
624 : | #define FADDP(a, b) CHOICE(faddp ARG2(a,b), faddp ARG2(a,b), faddp ARG2(b,a)) | ||
625 : | #define FIADD_L(a) CHOICE(fiaddl a, fiaddl a, fiaddl a) | ||
626 : | #define FIADD_W(a) CHOICE(fiadd a, fiadds a, fiadds a) | ||
627 : | #define FBLD(a) CHOICE(fbld a, fbld a, fbld a) | ||
628 : | #define FBSTP(a) CHOICE(fbstp a, fbstp a, fbstp a) | ||
629 : | #define FCHS CHOICE(fchs, fchs, fchs) | ||
630 : | #define FCLEX CHOICE(fclex, wait; fnclex, wait; fclex) | ||
631 : | #define FNCLEX CHOICE(fnclex, fnclex, fclex) | ||
632 : | #define FCOM(a) CHOICE(fcom a, fcom a, fcom a) | ||
633 : | #define FCOM_D(a) CHOICE(fcoml a, fcoml a, fcomd a) | ||
634 : | #define FCOM_S(a) CHOICE(fcoms a, fcoms a, fcoms a) | ||
635 : | #define FCOMP(a) CHOICE(fcomp a, fcomp a, fcomp a) | ||
636 : | #define FCOMP_D(a) CHOICE(fcompl a, fcompl a, fcompd a) | ||
637 : | #define FCOMP_S(a) CHOICE(fcomps a, fcomps a, fcomps a) | ||
638 : | #define FCOMPP CHOICE(fcompp, fcompp, fcompp) | ||
639 : | #define FCOS CHOICE(fcos, fcos, fcos) | ||
640 : | #define FDECSTP CHOICE(fdecstp, fdecstp, fdecstp) | ||
641 : | #define FDIV_D(a) CHOICE(fdivl a, fdivl a, fdivd a) | ||
642 : | #define FDIV_S(a) CHOICE(fdivs a, fdivs a, fdivs a) | ||
643 : | #define FDIV2(a, b) CHOICE(fdiv ARG2(a,b), fdiv ARG2(a,b), fdiv ARG2(b,a)) | ||
644 : | #define FDIVP(a, b) CHOICE(fdivp ARG2(a,b), fdivp ARG2(a,b), fdivp ARG2(b,a)) | ||
645 : | #define FIDIV_L(a) CHOICE(fidivl a, fidivl a, fidivl a) | ||
646 : | #define FIDIV_W(a) CHOICE(fidiv a, fidivs a, fidivs a) | ||
647 : | #define FDIVR_D(a) CHOICE(fdivrl a, fdivrl a, fdivrd a) | ||
648 : | #define FDIVR_S(a) CHOICE(fdivrs a, fdivrs a, fdivrs a) | ||
649 : | #define FDIVR2(a, b) CHOICE(fdivr ARG2(a,b), fdivr ARG2(a,b), fdivr ARG2(b,a)) | ||
650 : | #define FDIVRP(a, b) CHOICE(fdivrp ARG2(a,b), fdivrp ARG2(a,b), fdivrp ARG2(b,a)) | ||
651 : | #define FIDIVR_L(a) CHOICE(fidivrl a, fidivrl a, fidivrl a) | ||
652 : | #define FIDIVR_W(a) CHOICE(fidivr a, fidivrs a, fidivrs a) | ||
653 : | #define FFREE(a) CHOICE(ffree a, ffree a, ffree a) | ||
654 : | #define FICOM_L(a) CHOICE(ficoml a, ficoml a, ficoml a) | ||
655 : | #define FICOM_W(a) CHOICE(ficom a, ficoms a, ficoms a) | ||
656 : | #define FICOMP_L(a) CHOICE(ficompl a, ficompl a, ficompl a) | ||
657 : | #define FICOMP_W(a) CHOICE(ficomp a, ficomps a, ficomps a) | ||
658 : | #define FILD_Q(a) CHOICE(fildll a, fildq a, fildq a) | ||
659 : | #define FILD_L(a) CHOICE(fildl a, fildl a, fildl a) | ||
660 : | #define FILD_W(a) CHOICE(fild a, filds a, filds a) | ||
661 : | #define FINCSTP CHOICE(fincstp, fincstp, fincstp) | ||
662 : | #define FINIT CHOICE(finit, wait; fninit, wait; finit) | ||
663 : | #define FNINIT CHOICE(fninit, fninit, finit) | ||
664 : | #define FIST_L(a) CHOICE(fistl a, fistl a, fistl a) | ||
665 : | #define FIST_W(a) CHOICE(fist a, fists a, fists a) | ||
666 : | #define FISTP_Q(a) CHOICE(fistpll a, fistpq a, fistpq a) | ||
667 : | #define FISTP_L(a) CHOICE(fistpl a, fistpl a, fistpl a) | ||
668 : | #define FISTP_W(a) CHOICE(fistp a, fistps a, fistps a) | ||
669 : | #define FLD_X(a) CHOICE(fldt a, fldt a, fldx a) /* 80 bit data type! */ | ||
670 : | #define FLD_D(a) CHOICE(fldl a, fldl a, fldd a) | ||
671 : | #define FLD_S(a) CHOICE(flds a, flds a, flds a) | ||
672 : | #define FLD1 CHOICE(fld1, fld1, fld1) | ||
673 : | #define FLDL2T CHOICE(fldl2t, fldl2t, fldl2t) | ||
674 : | #define FLDL2E CHOICE(fldl2e, fldl2e, fldl2e) | ||
675 : | #define FLDPI CHOICE(fldpi, fldpi, fldpi) | ||
676 : | #define FLDLG2 CHOICE(fldlg2, fldlg2, fldlg2) | ||
677 : | #define FLDLN2 CHOICE(fldln2, fldln2, fldln2) | ||
678 : | #define FLDZ CHOICE(fldz, fldz, fldz) | ||
679 : | #define FLDCW(a) CHOICE(fldcw a, fldcw a, fldcw a) | ||
680 : | #define FLDENV(a) CHOICE(fldenv a, fldenv a, fldenv a) | ||
681 : | #define FMUL_S(a) CHOICE(fmuls a, fmuls a, fmuls a) | ||
682 : | #define FMUL_D(a) CHOICE(fmull a, fmull a, fmuld a) | ||
683 : | #define FMUL2(a, b) CHOICE(fmul ARG2(a,b), fmul ARG2(a,b), fmul ARG2(b,a)) | ||
684 : | #define FMULP(a, b) CHOICE(fmulp ARG2(a,b), fmulp ARG2(a,b), fmulp ARG2(b,a)) | ||
685 : | #define FIMUL_L(a) CHOICE(fimull a, fimull a, fimull a) | ||
686 : | #define FIMUL_W(a) CHOICE(fimul a, fimuls a, fimuls a) | ||
687 : | #define FNOP CHOICE(fnop, fnop, fnop) | ||
688 : | #define FPATAN CHOICE(fpatan, fpatan, fpatan) | ||
689 : | #define FPREM CHOICE(fprem, fprem, fprem) | ||
690 : | #define FPREM1 CHOICE(fprem1, fprem1, fprem1) | ||
691 : | #define FPTAN CHOICE(fptan, fptan, fptan) | ||
692 : | #define FRNDINT CHOICE(frndint, frndint, frndint) | ||
693 : | #define FRSTOR(a) CHOICE(frstor a, frstor a, frstor a) | ||
694 : | #define FSAVE(a) CHOICE(fsave a, fwait; fnsave a, fwait; fsave a) | ||
695 : | #define FNSAVE(a) CHOICE(fnsave a, fnsave a, fsave a) | ||
696 : | #define FSCALE CHOICE(fscale, fscale, fscale) | ||
697 : | #define FSIN CHOICE(fsin, fsin, fsin) | ||
698 : | #define FSINCOS CHOICE(fsincos, fsincos, fsincos) | ||
699 : | #define FSQRT CHOICE(fsqrt, fsqrt, fsqrt) | ||
700 : | #define FST_D(a) CHOICE(fstl a, fstl a, fstd a) | ||
701 : | #define FST_S(a) CHOICE(fsts a, fsts a, fsts a) | ||
702 : | #define FSTP_X(a) CHOICE(fstpt a, fstpt a, fstpx a) | ||
703 : | #define FSTP_D(a) CHOICE(fstpl a, fstpl a, fstpd a) | ||
704 : | #define FSTP_S(a) CHOICE(fstps a, fstps a, fstps a) | ||
705 : | #define FSTCW(a) CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a) | ||
706 : | #define FNSTCW(a) CHOICE(fnstcw a, fnstcw a, fstcw a) | ||
707 : | #define FSTENV(a) CHOICE(fstenv a, wait; fnstenv a, fstenv a) | ||
708 : | #define FNSTENV(a) CHOICE(fnstenv a, fnstenv a, fstenv a) | ||
709 : | #define FSTSW(a) CHOICE(fstsw a, wait; fnstsw a, wait; fstsw a) | ||
710 : | #define FNSTSW(a) CHOICE(fnstsw a, fnstsw a, fstsw a) | ||
711 : | #define FSUB_S(a) CHOICE(fsubs a, fsubs a, fsubs a) | ||
712 : | #define FSUB_D(a) CHOICE(fsubl a, fsubl a, fsubd a) | ||
713 : | #define FSUB2(a, b) CHOICE(fsub ARG2(a,b), fsub ARG2(a,b), fsub ARG2(b,a)) | ||
714 : | #define FSUBP(a, b) CHOICE(fsubp ARG2(a,b), fsubp ARG2(a,b), fsubp ARG2(b,a)) | ||
715 : | #define FISUB_L(a) CHOICE(fisubl a, fisubl a, fisubl a) | ||
716 : | #define FISUB_W(a) CHOICE(fisub a, fisubs a, fisubs a) | ||
717 : | #define FSUBR_S(a) CHOICE(fsubrs a, fsubrs a, fsubrs a) | ||
718 : | #define FSUBR_D(a) CHOICE(fsubrl a, fsubrl a, fsubrd a) | ||
719 : | #define FSUBR2(a, b) CHOICE(fsubr ARG2(a,b), fsubr ARG2(a,b), fsubr ARG2(b,a)) | ||
720 : | #define FSUBRP(a, b) CHOICE(fsubrp ARG2(a,b), fsubrp ARG2(a,b), fsubrp ARG2(b,a)) | ||
721 : | #define FISUBR_L(a) CHOICE(fisubrl a, fisubrl a, fisubrl a) | ||
722 : | #define FISUBR_W(a) CHOICE(fisubr a, fisubrs a, fisubrs a) | ||
723 : | #define FTST CHOICE(ftst, ftst, ftst) | ||
724 : | #define FUCOM(a) CHOICE(fucom a, fucom a, fucom a) | ||
725 : | #define FUCOMP(a) CHOICE(fucomp a, fucomp a, fucomp a) | ||
726 : | #define FUCOMPP CHOICE(fucompp, fucompp, fucompp) | ||
727 : | #define FWAIT CHOICE(wait, wait, wait) | ||
728 : | #define FXAM CHOICE(fxam, fxam, fxam) | ||
729 : | #define FXCH(a) CHOICE(fxch a, fxch a, fxch a) | ||
730 : | #define FXTRACT CHOICE(fxtract, fxtract, fxtract) | ||
731 : | #define FYL2X CHOICE(fyl2x, fyl2x, fyl2x) | ||
732 : | #define FYL2XP1 CHOICE(fyl2xp1, fyl2xp1, fyl2xp1) | ||
733 : | |||
734 : | |||
735 : | #else /* INTEL_ASSEMBLER */ | ||
736 : | |||
737 : | |||
738 : | #define L_EAX EAX | ||
739 : | #define W_AX AX | ||
740 : | #define B_AH AH | ||
741 : | #define B_AL AL | ||
742 : | |||
743 : | #define L_EBX EBX | ||
744 : | #define W_BX BX | ||
745 : | #define B_BH BH | ||
746 : | #define B_BL BL | ||
747 : | |||
748 : | #define L_ECX ECX | ||
749 : | #define W_CX CX | ||
750 : | #define B_CH CH | ||
751 : | #define B_CL CL | ||
752 : | |||
753 : | #define L_EDX EDX | ||
754 : | #define W_DX DX | ||
755 : | #define B_DH DH | ||
756 : | #define B_DL DL | ||
757 : | |||
758 : | #define L_EBP EBP | ||
759 : | #define W_BP BP | ||
760 : | |||
761 : | #define L_ESI ESI | ||
762 : | #define W_SI SI | ||
763 : | |||
764 : | #define L_EDI EDI | ||
765 : | #define W_DI DI | ||
766 : | |||
767 : | #define L_ESP ESP | ||
768 : | #define W_SP SP | ||
769 : | |||
770 : | #define W_CS CS | ||
771 : | #define W_SS SS | ||
772 : | #define W_DS DS | ||
773 : | #define W_ES ES | ||
774 : | #define W_FS FS | ||
775 : | #define W_GS GS | ||
776 : | |||
777 : | #define X_ST ST | ||
778 : | #define D_ST ST | ||
779 : | #define L_ST ST | ||
780 : | |||
781 : | #define GLNAME(a) _ ## a | ||
782 : | #define GLOBL GLOBAL | ||
783 : | #define ALIGNTEXT4 ALIGN 4 | ||
784 : | #define ALIGNTEXT2 ALIGN 2 | ||
785 : | #define ALIGNTEXT4ifNOP ALIGN 4 | ||
786 : | #define ALIGNDATA4 ALIGN 4 | ||
787 : | #define ALIGNDATA2 ALIGN 2 | ||
788 : | #define FILE(s) | ||
789 : | #define STRING(s) db s | ||
790 : | #define D_LONG dd | ||
791 : | #define D_WORD dw | ||
792 : | #define D_BYTE db | ||
793 : | /* #define SPACE */ | ||
794 : | /* #define COMM */ | ||
795 : | #define SEG_DATA .DATA | ||
796 : | #define SEG_TEXT .CODE | ||
797 : | #define SEG_BSS .DATA | ||
798 : | |||
799 : | #define D_SPACE(n) db n REP 0 | ||
800 : | |||
801 : | #define AS_BEGIN | ||
802 : | |||
803 : | /* | ||
804 : | * Addressing Modes | ||
805 : | */ | ||
806 : | |||
807 : | /* Immediate Mode */ | ||
808 : | #define X_ADDR(a) offset a | ||
809 : | #define D_ADDR(a) offset a | ||
810 : | #define L_ADDR(a) offset a | ||
811 : | #define W_ADDR(a) offset a | ||
812 : | #define B_ADDR(a) offset a | ||
813 : | |||
814 : | #define X_CONST(a) a | ||
815 : | #define D_CONST(a) a | ||
816 : | #define L_CONST(a) a | ||
817 : | #define W_CONST(a) a | ||
818 : | #define B_CONST(a) a | ||
819 : | |||
820 : | /* Indirect Mode */ | ||
821 : | #define X_CONTENT(a) tbyte ptr a | ||
822 : | #define D_CONTENT(a) qword ptr a | ||
823 : | #define L_CONTENT(a) dword ptr a | ||
824 : | #define W_CONTENT(a) word ptr a | ||
825 : | #define B_CONTENT(a) byte ptr a | ||
826 : | |||
827 : | /* Register a indirect */ | ||
828 : | #define X_REGIND(a) tbyte ptr [a] | ||
829 : | #define D_REGIND(a) qword ptr [a] | ||
830 : | #define L_REGIND(a) dword ptr [a] | ||
831 : | #define W_REGIND(a) word ptr [a] | ||
832 : | #define B_REGIND(a) byte ptr [a] | ||
833 : | |||
834 : | /* Register b indirect plus displacement a */ | ||
835 : | #define X_REGOFF(a, b) tbyte ptr [a + b] | ||
836 : | #define D_REGOFF(a, b) qword ptr [a + b] | ||
837 : | #define L_REGOFF(a, b) dword ptr [a + b] | ||
838 : | #define W_REGOFF(a, b) word ptr [a + b] | ||
839 : | #define B_REGOFF(a, b) byte ptr [a + b] | ||
840 : | |||
841 : | /* Reg indirect Base + Index + Displacement - this is mainly for 16-bit mode | ||
842 : | * which has no scaling | ||
843 : | */ | ||
844 : | #define X_REGBID(b, i, d) tbyte ptr [b + i + d] | ||
845 : | #define D_REGBID(b, i, d) qword ptr [b + i + d] | ||
846 : | #define L_REGBID(b, i, d) dword ptr [b + i + d] | ||
847 : | #define W_REGBID(b, i, d) word ptr [b + i + d] | ||
848 : | #define B_REGBID(b, i, d) byte ptr [b + i + d] | ||
849 : | |||
850 : | /* Reg indirect Base + (Index * Scale) + Displacement */ | ||
851 : | #define X_REGBISD(b, i, s, d) tbyte ptr [b + i * s + d] | ||
852 : | #define D_REGBISD(b, i, s, d) qword ptr [b + i * s + d] | ||
853 : | #define L_REGBISD(b, i, s, d) dword ptr [b + i * s + d] | ||
854 : | #define W_REGBISD(b, i, s, d) word ptr [b + i * s + d] | ||
855 : | #define B_REGBISD(b, i, s, d) byte ptr [b + i * s + d] | ||
856 : | |||
857 : | /* Displaced Scaled Index: */ | ||
858 : | #define X_REGDIS(d, i, s) tbyte ptr [i * s + d] | ||
859 : | #define D_REGDIS(d, i, s) qword ptr [i * s + d] | ||
860 : | #define L_REGDIS(d, i, s) dword ptr [i * s + d] | ||
861 : | #define W_REGDIS(d, i, s) word ptr [i * s + d] | ||
862 : | #define B_REGDIS(d, i, s) byte ptr [i * s + d] | ||
863 : | |||
864 : | /* Indexed Base: */ | ||
865 : | #define X_REGBI(b, i) tbyte ptr [b + i] | ||
866 : | #define D_REGBI(b, i) qword ptr [b + i] | ||
867 : | #define L_REGBI(b, i) dword ptr [b + i] | ||
868 : | #define W_REGBI(b, i) word ptr [b + i] | ||
869 : | #define B_REGBI(b, i) byte ptr [b + i] | ||
870 : | |||
871 : | /* Displaced Base: */ | ||
872 : | #define X_REGDB(d, b) tbyte ptr [b + d] | ||
873 : | #define D_REGDB(d, b) qword ptr [b + d] | ||
874 : | #define L_REGDB(d, b) dword ptr [b + d] | ||
875 : | #define W_REGDB(d, b) word ptr [b + d] | ||
876 : | #define B_REGDB(d, b) byte ptr [b + d] | ||
877 : | |||
878 : | /* Variable indirect: */ | ||
879 : | #define VARINDIRECT(var) [var] | ||
880 : | |||
881 : | /* Use register contents as jump/call target: */ | ||
882 : | #define CODEPTR(reg) [reg] | ||
883 : | |||
884 : | /* | ||
885 : | * Redefine assembler commands | ||
886 : | */ | ||
887 : | |||
888 : | #define X_(a) X_ ## a | ||
889 : | #define D_(a) D_ ## a | ||
890 : | #define S_(a) L_ ## a | ||
891 : | #define L_(a) L_ ## a | ||
892 : | #define W_(a) W_ ## a | ||
893 : | #define B_(a) B_ ## a | ||
894 : | |||
895 : | #define AAA aaa | ||
896 : | #define AAD aad | ||
897 : | #define AAM aam | ||
898 : | #define AAS aas | ||
899 : | #define ADC_L(a, b) adc L_(b), L_(a) | ||
900 : | #define ADC_W(a, b) adc W_(b), W_(a) | ||
901 : | #define ADC_B(a, b) adc B_(b), B_(a) | ||
902 : | #define ADD_L(a, b) add L_(b), L_(a) | ||
903 : | #define ADD_W(a, b) add W_(b), W_(a) | ||
904 : | #define ADD_B(a, b) add B_(b), B_(a) | ||
905 : | #define AND_L(a, b) and L_(b), L_(a) | ||
906 : | #define AND_W(a, b) and W_(b), W_(a) | ||
907 : | #define AND_B(a, b) and B_(b), B_(a) | ||
908 : | #define ARPL(a,b) arpl W_(b), a | ||
909 : | #define BOUND_L(a, b) bound L_(b), L_(a) | ||
910 : | #define BOUND_W(a, b) bound W_(b), W_(a) | ||
911 : | #define BSF_L(a, b) bsf L_(b), L_(a) | ||
912 : | #define BSF_W(a, b) bsf W_(b), W_(a) | ||
913 : | #define BSR_L(a, b) bsr L_(b), L_(a) | ||
914 : | #define BSR_W(a, b) bsr W_(b), W_(a) | ||
915 : | #define BT_L(a, b) bt L_(b), L_(a) | ||
916 : | #define BT_W(a, b) bt W_(b), W_(a) | ||
917 : | #define BTC_L(a, b) btc L_(b), L_(a) | ||
918 : | #define BTC_W(a, b) btc W_(b), W_(a) | ||
919 : | #define BTR_L(a, b) btr L_(b), L_(a) | ||
920 : | #define BTR_W(a, b) btr W_(b), W_(a) | ||
921 : | #define BTS_L(a, b) bts L_(b), L_(a) | ||
922 : | #define BTS_W(a, b) bts W_(b), W_(a) | ||
923 : | #define CALL(a) call a | ||
924 : | #define CALLF(s,a) call far s:a | ||
925 : | #define CBW cbw | ||
926 : | #define CWDE cwde | ||
927 : | #define CLC clc | ||
928 : | #define CLD cld | ||
929 : | #define CLI cli | ||
930 : | #define CLTS clts | ||
931 : | #define CMC cmc | ||
932 : | #define CMP_L(a, b) cmp L_(b), L_(a) | ||
933 : | #define CMP_W(a, b) cmp W_(b), W_(a) | ||
934 : | #define CMP_B(a, b) cmp B_(b), B_(a) | ||
935 : | #define CMPS_L cmpsd | ||
936 : | #define CMPS_W cmpsw | ||
937 : | #define CMPS_B cmpsb | ||
938 : | #define CWD cwd | ||
939 : | #define CDQ cdq | ||
940 : | #define DAA daa | ||
941 : | #define DAS das | ||
942 : | #define DEC_L(a) dec L_(a) | ||
943 : | #define DEC_W(a) dec W_(a) | ||
944 : | #define DEC_B(a) dec B_(a) | ||
945 : | #define DIV_L(a) div L_(a) | ||
946 : | #define DIV_W(a) div W_(a) | ||
947 : | #define DIV_B(a) div B_(a) | ||
948 : | #define ENTER(a,b) enter b, a | ||
949 : | #define HLT hlt | ||
950 : | #define IDIV_L(a) idiv L_(a) | ||
951 : | #define IDIV_W(a) idiv W_(a) | ||
952 : | #define IDIV_B(a) idiv B_(a) | ||
953 : | #define IMUL_L(a, b) imul L_(b), L_(a) | ||
954 : | #define IMUL_W(a, b) imul W_(b), W_(a) | ||
955 : | #define IMUL_B(a) imul B_(a) | ||
956 : | #define IN_L in EAX, DX | ||
957 : | #define IN_W in AX, DX | ||
958 : | #define IN_B in AL, DX | ||
959 : | #define IN1_L(a) in1 L_(a) | ||
960 : | #define IN1_W(a) in1 W_(a) | ||
961 : | #define IN1_B(a) in1 B_(a) | ||
962 : | #define INC_L(a) inc L_(a) | ||
963 : | #define INC_W(a) inc W_(a) | ||
964 : | #define INC_B(a) inc B_(a) | ||
965 : | #define INS_L ins | ||
966 : | #define INS_W ins | ||
967 : | #define INS_B ins | ||
968 : | #define INT(a) int B_(a) | ||
969 : | #define INT3 int3 | ||
970 : | #define INTO into | ||
971 : | #define IRET iret | ||
972 : | #define IRETD iretd | ||
973 : | #define JA(a) ja a | ||
974 : | #define JAE(a) jae a | ||
975 : | #define JB(a) jb a | ||
976 : | #define JBE(a) jbe a | ||
977 : | #define JC(a) jc a | ||
978 : | #define JE(a) je a | ||
979 : | #define JG(a) jg a | ||
980 : | #define JGE(a) jge a | ||
981 : | #define JL(a) jl a | ||
982 : | #define JLE(a) jle a | ||
983 : | #define JNA(a) jna a | ||
984 : | #define JNAE(a) jnae a | ||
985 : | #define JNB(a) jnb a | ||
986 : | #define JNBE(a) jnbe a | ||
987 : | #define JNC(a) jnc a | ||
988 : | #define JNE(a) jne a | ||
989 : | #define JNG(a) jng a | ||
990 : | #define JNGE(a) jnge a | ||
991 : | #define JNL(a) jnl a | ||
992 : | #define JNLE(a) jnle a | ||
993 : | #define JNO(a) jno a | ||
994 : | #define JNP(a) jnp a | ||
995 : | #define JNS(a) jns a | ||
996 : | #define JNZ(a) jnz a | ||
997 : | #define JO(a) jo a | ||
998 : | #define JP(a) jp a | ||
999 : | #define JPE(a) jpe a | ||
1000 : | #define JPO(a) jpo a | ||
1001 : | #define JS(a) js a | ||
1002 : | #define JZ(a) jz a | ||
1003 : | #define JMP(a) jmp a | ||
1004 : | #define JMPF(s,a) jmpf | ||
1005 : | #define LAHF lahf | ||
1006 : | #define LAR(a, b) lar b, a | ||
1007 : | #define LEA_L(a, b) lea L_(b), L_(a) | ||
1008 : | #define LEA_W(a, b) lea W_(b), W_(a) | ||
1009 : | #define LEAVE leave | ||
1010 : | #define LGDT(a) lgdt a | ||
1011 : | #define LIDT(a) lidt a | ||
1012 : | #define LDS(a, b) lds b, a | ||
1013 : | #define LES(a, b) les b, a | ||
1014 : | #define LFS(a, b) lfs b, a | ||
1015 : | #define LGS(a, b) lgs b, a | ||
1016 : | #define LSS(a, b) lss b, a | ||
1017 : | #define LLDT(a) lldt a | ||
1018 : | #define LMSW(a) lmsw a | ||
1019 : | #define LOCK lock | ||
1020 : | #define LODS_L lodsd | ||
1021 : | #define LODS_W lodsw | ||
1022 : | #define LODS_B lodsb | ||
1023 : | #define LOOP(a) loop a | ||
1024 : | #define LOOPE(a) loope a | ||
1025 : | #define LOOPZ(a) loopz a | ||
1026 : | #define LOOPNE(a) loopne a | ||
1027 : | #define LOOPNZ(a) loopnz a | ||
1028 : | #define LSL(a, b) lsl b, a | ||
1029 : | #define LTR(a) ltr a | ||
1030 : | #define MOV_SR(a, b) mov S_(b), S_(a) | ||
1031 : | #define MOV_L(a, b) mov L_(b), L_(a) | ||
1032 : | #define MOV_W(a, b) mov W_(b), W_(a) | ||
1033 : | #define MOV_B(a, b) mov B_(b), B_(a) | ||
1034 : | #define MOVS_L movsd | ||
1035 : | #define MOVS_W movsw | ||
1036 : | #define MOVS_B movsb | ||
1037 : | #define MOVSX_BL(a, b) movsx B_(b), B_(a) | ||
1038 : | #define MOVSX_BW(a, b) movsx B_(b), B_(a) | ||
1039 : | #define MOVSX_WL(a, b) movsx W_(b), W_(a) | ||
1040 : | #define MOVZX_BL(a, b) movzx B_(b), B_(a) | ||
1041 : | #define MOVZX_BW(a, b) movzx B_(b), B_(a) | ||
1042 : | #define MOVZX_WL(a, b) movzx W_(b), W_(a) | ||
1043 : | #define MUL_L(a) mul L_(a) | ||
1044 : | #define MUL_W(a) mul W_(a) | ||
1045 : | #define MUL_B(a) mul B_(a) | ||
1046 : | #define NEG_L(a) neg L_(a) | ||
1047 : | #define NEG_W(a) neg W_(a) | ||
1048 : | #define NEG_B(a) neg B_(a) | ||
1049 : | #define NOP nop | ||
1050 : | #define NOT_L(a) not L_(a) | ||
1051 : | #define NOT_W(a) not W_(a) | ||
1052 : | #define NOT_B(a) not B_(a) | ||
1053 : | #define OR_L(a,b) or L_(b), L_(a) | ||
1054 : | #define OR_W(a,b) or W_(b), W_(a) | ||
1055 : | #define OR_B(a,b) or B_(b), B_(a) | ||
1056 : | #define OUT_L out DX, EAX | ||
1057 : | #define OUT_W out DX, AX | ||
1058 : | #define OUT_B out DX, AL | ||
1059 : | #define OUT1_L(a) out1 L_(a) | ||
1060 : | #define OUT1_W(a) out1 W_(a) | ||
1061 : | #define OUT1_B(a) out1 B_(a) | ||
1062 : | #define OUTS_L outsd | ||
1063 : | #define OUTS_W outsw | ||
1064 : | #define OUTS_B outsb | ||
1065 : | #define POP_SR(a) pop S_(a) | ||
1066 : | #define POP_L(a) pop L_(a) | ||
1067 : | #define POP_W(a) pop W_(a) | ||
1068 : | #define POPA_L popad | ||
1069 : | #define POPA_W popa | ||
1070 : | #define POPF_L popfd | ||
1071 : | #define POPF_W popf | ||
1072 : | #define PUSH_SR(a) push S_(a) | ||
1073 : | #define PUSH_L(a) push L_(a) | ||
1074 : | #define PUSH_W(a) push W_(a) | ||
1075 : | #define PUSH_B(a) push B_(a) | ||
1076 : | #define PUSHA_L pushad | ||
1077 : | #define PUSHA_W pusha | ||
1078 : | #define PUSHF_L pushfd | ||
1079 : | #define PUSHF_W pushf | ||
1080 : | #define RCL_L(a, b) rcl L_(b), L_(a) | ||
1081 : | #define RCL_W(a, b) rcl W_(b), W_(a) | ||
1082 : | #define RCL_B(a, b) rcl B_(b), B_(a) | ||
1083 : | #define RCR_L(a, b) rcr L_(b), L_(a) | ||
1084 : | #define RCR_W(a, b) rcr W_(b), W_(a) | ||
1085 : | #define RCR_B(a, b) rcr B_(b), B_(a) | ||
1086 : | #define ROL_L(a, b) rol L_(b), L_(a) | ||
1087 : | #define ROL_W(a, b) rol W_(b), W_(a) | ||
1088 : | #define ROL_B(a, b) rol B_(b), B_(a) | ||
1089 : | #define ROR_L(a, b) ror L_(b), L_(a) | ||
1090 : | #define ROR_W(a, b) ror W_(b), W_(a) | ||
1091 : | #define ROR_B(a, b) ror B_(b), B_(a) | ||
1092 : | #define REP rep | ||
1093 : | #define REPE repe | ||
1094 : | #define REPNE repne | ||
1095 : | #define REPNZ REPNE | ||
1096 : | #define REPZ REPE | ||
1097 : | #define RET ret | ||
1098 : | #define SAHF sahf | ||
1099 : | #define SAL_L(a, b) sal L_(b), L_(a) | ||
1100 : | #define SAL_W(a, b) sal W_(b), W_(a) | ||
1101 : | #define SAL_B(a, b) sal B_(b), B_(a) | ||
1102 : | #define SAR_L(a, b) sar L_(b), L_(a) | ||
1103 : | #define SAR_W(a, b) sar W_(b), W_(a) | ||
1104 : | #define SAR_B(a, b) sar B_(b), B_(a) | ||
1105 : | #define SBB_L(a, b) sbb L_(b), L_(a) | ||
1106 : | #define SBB_W(a, b) sbb W_(b), W_(a) | ||
1107 : | #define SBB_B(a, b) sbb B_(b), B_(a) | ||
1108 : | #define SCAS_L scas | ||
1109 : | #define SCAS_W scas | ||
1110 : | #define SCAS_B scas | ||
1111 : | #define SETA(a) seta a | ||
1112 : | #define SETAE(a) setae a | ||
1113 : | #define SETB(a) setb a | ||
1114 : | #define SETBE(a) setbe a | ||
1115 : | #define SETC(a) setc a | ||
1116 : | #define SETE(a) sete a | ||
1117 : | #define SETG(a) setg a | ||
1118 : | #define SETGE(a) setge a | ||
1119 : | #define SETL(a) setl a | ||
1120 : | #define SETLE(a) setle a | ||
1121 : | #define SETNA(a) setna a | ||
1122 : | #define SETNAE(a) setnae a | ||
1123 : | #define SETNB(a) setnb a | ||
1124 : | #define SETNBE(a) setnbe a | ||
1125 : | #define SETNC(a) setnc a | ||
1126 : | #define SETNE(a) setne a | ||
1127 : | #define SETNG(a) setng a | ||
1128 : | #define SETNGE(a) setnge a | ||
1129 : | #define SETNL(a) setnl a | ||
1130 : | #define SETNLE(a) setnle a | ||
1131 : | #define SETNO(a) setno a | ||
1132 : | #define SETNP(a) setnp a | ||
1133 : | #define SETNS(a) setns a | ||
1134 : | #define SETNZ(a) setnz a | ||
1135 : | #define SETO(a) seto a | ||
1136 : | #define SETP(a) setp a | ||
1137 : | #define SETPE(a) setpe a | ||
1138 : | #define SETPO(a) setpo a | ||
1139 : | #define SETS(a) sets a | ||
1140 : | #define SETZ(a) setz a | ||
1141 : | #define SGDT(a) sgdt a | ||
1142 : | #define SIDT(a) sidt a | ||
1143 : | #define SHL_L(a, b) shl L_(b), L_(a) | ||
1144 : | #define SHL_W(a, b) shl W_(b), W_(a) | ||
1145 : | #define SHL_B(a, b) shl B_(b), B_(a) | ||
1146 : | #define SHLD_L(a,b,c) shld | ||
1147 : | #define SHLD2_L(a,b) shld2 L_(b), L_(a) | ||
1148 : | #define SHLD_W(a,b,c) shld | ||
1149 : | #define SHLD2_W(a,b) shld2 W_(b), W_(a) | ||
1150 : | #define SHR_L(a, b) shr L_(b), L_(a) | ||
1151 : | #define SHR_W(a, b) shr W_(b), W_(a) | ||
1152 : | #define SHR_B(a, b) shr B_(b), B_(a) | ||
1153 : | #define SHRD_L(a,b,c) shrd | ||
1154 : | #define SHRD2_L(a,b) shrd2 L_(b), L_(a) | ||
1155 : | #define SHRD_W(a,b,c) shrd | ||
1156 : | #define SHRD2_W(a,b) shrd2 W_(b), W_(a) | ||
1157 : | #define SLDT(a) sldt a | ||
1158 : | #define SMSW(a) smsw a | ||
1159 : | #define STC stc | ||
1160 : | #define STD std | ||
1161 : | #define STI sti | ||
1162 : | #define STOS_L stos | ||
1163 : | #define STOS_W stos | ||
1164 : | #define STOS_B stos | ||
1165 : | #define STR(a) str a | ||
1166 : | #define SUB_L(a, b) sub L_(b), L_(a) | ||
1167 : | #define SUB_W(a, b) sub W_(b), W_(a) | ||
1168 : | #define SUB_B(a, b) sub B_(b), B_(a) | ||
1169 : | #define TEST_L(a, b) test L_(b), L_(a) | ||
1170 : | #define TEST_W(a, b) test W_(b), W_(a) | ||
1171 : | #define TEST_B(a, b) test B_(b), B_(a) | ||
1172 : | #define VERR(a) verr a | ||
1173 : | #define VERW(a) verw a | ||
1174 : | #define WAIT wait | ||
1175 : | #define XCHG_L(a, b) xchg L_(b), L_(a) | ||
1176 : | #define XCHG_W(a, b) xchg W_(b), W_(a) | ||
1177 : | #define XCHG_B(a, b) xchg B_(b), B_(a) | ||
1178 : | #define XLAT xlat | ||
1179 : | #define XOR_L(a, b) xor L_(b), L_(a) | ||
1180 : | #define XOR_W(a, b) xor W_(b), W_(a) | ||
1181 : | #define XOR_B(a, b) xor B_(b), B_(a) | ||
1182 : | #define F2XM1 f2xm1 | ||
1183 : | #define FABS fabs | ||
1184 : | #define FADD_D(a) fadd D_(a) | ||
1185 : | #define FADD_S(a) fadd S_(a) | ||
1186 : | #define FADD2(a, b) fadd2 b, a | ||
1187 : | #define FADDP(a, b) faddp b, a | ||
1188 : | #define FIADD_L(a) fiadd L_(a) | ||
1189 : | #define FIADD_W(a) fiadd W_(a) | ||
1190 : | #define FBLD(a) fbld a | ||
1191 : | #define FBSTP(a) fbstp a | ||
1192 : | #define FCHS fchs | ||
1193 : | #define FCLEX fclex | ||
1194 : | #define FNCLEX fnclex | ||
1195 : | #define FCOM(a) fcom a | ||
1196 : | #define FCOM_D(a) fcom D_(a) | ||
1197 : | #define FCOM_S(a) fcom S_(a) | ||
1198 : | #define FCOMP(a) fcomp a | ||
1199 : | #define FCOMP_D(a) fcomp D_(a) | ||
1200 : | #define FCOMP_S(a) fcomp S_(a) | ||
1201 : | #define FCOMPP fcompp | ||
1202 : | #define FCOS fcos | ||
1203 : | #define FDECSTP fdecstp | ||
1204 : | #define FDIV_D(a) fdiv D_(a) | ||
1205 : | #define FDIV_S(a) fdiv S_(a) | ||
1206 : | #define FDIV2(a, b) fdiv2 b, a | ||
1207 : | #define FDIVP(a, b) fdivp b, a | ||
1208 : | #define FIDIV_L(a) fidiv L_(a) | ||
1209 : | #define FIDIV_W(a) fidiv W_(a) | ||
1210 : | #define FDIVR_D(a) fdivr D_(a) | ||
1211 : | #define FDIVR_S(a) fdivr S_(a) | ||
1212 : | #define FDIVR2(a, b) fdivr2 b, a | ||
1213 : | #define FDIVRP(a, b) fdivrp b, a | ||
1214 : | #define FIDIVR_L(a) fidivr L_(a) | ||
1215 : | #define FIDIVR_W(a) fidivr W_(a) | ||
1216 : | #define FFREE(a) ffree a | ||
1217 : | #define FICOM_L(a) ficom L_(a) | ||
1218 : | #define FICOM_W(a) ficom W_(a) | ||
1219 : | #define FICOMP_L(a) ficomp L_(a) | ||
1220 : | #define FICOMP_W(a) ficomp W_(a) | ||
1221 : | #define FILD_Q(a) fild D_(a) | ||
1222 : | #define FILD_L(a) fild L_(a) | ||
1223 : | #define FILD_W(a) fild W_(a) | ||
1224 : | #define FINCSTP fincstp | ||
1225 : | #define FINIT finit | ||
1226 : | #define FNINIT fninit | ||
1227 : | #define FIST_L(a) fist L_(a) | ||
1228 : | #define FIST_W(a) fist W_(a) | ||
1229 : | #define FISTP_Q(a) fistp D_(a) | ||
1230 : | #define FISTP_L(a) fistp L_(a) | ||
1231 : | #define FISTP_W(a) fistp W_(a) | ||
1232 : | #define FLD_X(a) fld X_(a) | ||
1233 : | #define FLD_D(a) fld D_(a) | ||
1234 : | #define FLD_S(a) fld S_(a) | ||
1235 : | #define FLD1 fld1 | ||
1236 : | #define FLDL2T fldl2t | ||
1237 : | #define FLDL2E fldl2e | ||
1238 : | #define FLDPI fldpi | ||
1239 : | #define FLDLG2 fldlg2 | ||
1240 : | #define FLDLN2 fldln2 | ||
1241 : | #define FLDZ fldz | ||
1242 : | #define FLDCW(a) fldcw a | ||
1243 : | #define FLDENV(a) fldenv a | ||
1244 : | #define FMUL_S(a) fmul S_(a) | ||
1245 : | #define FMUL_D(a) fmul D_(a) | ||
1246 : | #define FMUL2(a, b) fmul2 b, a | ||
1247 : | #define FMULP(a, b) fmulp b, a | ||
1248 : | #define FIMUL_L(a) fimul L_(a) | ||
1249 : | #define FIMUL_W(a) fimul W_(a) | ||
1250 : | #define FNOP fnop | ||
1251 : | #define FPATAN fpatan | ||
1252 : | #define FPREM fprem | ||
1253 : | #define FPREM1 fprem1 | ||
1254 : | #define FPTAN fptan | ||
1255 : | #define FRNDINT frndint | ||
1256 : | #define FRSTOR(a) frstor a | ||
1257 : | #define FSAVE(a) fsave a | ||
1258 : | #define FNSAVE(a) fnsave a | ||
1259 : | #define FSCALE fscale | ||
1260 : | #define FSIN fsin | ||
1261 : | #define FSINCOS fsincos | ||
1262 : | #define FSQRT fsqrt | ||
1263 : | #define FST_D(a) fst D_(a) | ||
1264 : | #define FST_S(a) fst S_(a) | ||
1265 : | #define FSTP_X(a) fstp X_(a) | ||
1266 : | #define FSTP_D(a) fstp D_(a) | ||
1267 : | #define FSTP_S(a) fstp S_(a) | ||
1268 : | #define FSTCW(a) fstcw a | ||
1269 : | #define FNSTCW(a) fnstcw a | ||
1270 : | #define FSTENV(a) fstenv a | ||
1271 : | #define FNSTENV(a) fnstenv a | ||
1272 : | #define FSTSW(a) fstsw a | ||
1273 : | #define FNSTSW(a) fnstsw a | ||
1274 : | #define FSUB_S(a) fsub S_(a) | ||
1275 : | #define FSUB_D(a) fsub D_(a) | ||
1276 : | #define FSUB2(a, b) fsub2 b, a | ||
1277 : | #define FSUBP(a, b) fsubp b, a | ||
1278 : | #define FISUB_L(a) fisub L_(a) | ||
1279 : | #define FISUB_W(a) fisub W_(a) | ||
1280 : | #define FSUBR_S(a) fsubr S_(a) | ||
1281 : | #define FSUBR_D(a) fsubr D_(a) | ||
1282 : | #define FSUBR2(a, b) fsubr2 b, a | ||
1283 : | #define FSUBRP(a, b) fsubrp b, a | ||
1284 : | #define FISUBR_L(a) fisubr L_(a) | ||
1285 : | #define FISUBR_W(a) fisubr W_(a) | ||
1286 : | #define FTST ftst | ||
1287 : | #define FUCOM(a) fucom a | ||
1288 : | #define FUCOMP(a) fucomp a | ||
1289 : | #define FUCOMPP fucompp | ||
1290 : | #define FWAIT fwait | ||
1291 : | #define FXAM fxam | ||
1292 : | #define FXCH(a) fxch a | ||
1293 : | #define FXTRACT fxtract | ||
1294 : | #define FYL2X fyl2x | ||
1295 : | #define FYL2XP1 fyl2xp1 | ||
1296 : | |||
1297 : | #endif /* __ASSYNTAX_H__ */ | ||
1298 : |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |