1 | /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/assyntax.h,v 3.13 2003/08/24 17:37:03 dawes Exp $ */
|
---|
2 |
|
---|
3 | #ifndef __ASSYNTAX_H__
|
---|
4 | #define __ASSYNTAX_H__
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright 1992 Vrije Universiteit, The Netherlands
|
---|
8 | *
|
---|
9 | * Permission to use, copy, modify, and distribute this software and its
|
---|
10 | * documentation for any purpose and without fee is hereby granted, provided
|
---|
11 | * that the above copyright notice appear in all copies and that both that
|
---|
12 | * copyright notice and this permission notice appear in supporting
|
---|
13 | * documentation, and that the name of the Vrije Universiteit not be used in
|
---|
14 | * advertising or publicity pertaining to distribution of the software without
|
---|
15 | * specific, written prior permission. The Vrije Universiteit makes no
|
---|
16 | * representations about the suitability of this software for any purpose.
|
---|
17 | * It is provided "as is" without express or implied warranty.
|
---|
18 | *
|
---|
19 | * The Vrije Universiteit DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
20 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
---|
21 | * EVENT SHALL The Vrije Universiteit BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
---|
22 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
---|
23 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
---|
24 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
---|
25 | * PERFORMANCE OF THIS SOFTWARE.
|
---|
26 | */
|
---|
27 | /*
|
---|
28 | * Copyright (c) 1993-1999 by The XFree86 Project, Inc.
|
---|
29 | *
|
---|
30 | * Permission is hereby granted, free of charge, to any person obtaining a
|
---|
31 | * copy of this software and associated documentation files (the "Software"),
|
---|
32 | * to deal in the Software without restriction, including without limitation
|
---|
33 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
34 | * and/or sell copies of the Software, and to permit persons to whom the
|
---|
35 | * Software is furnished to do so, subject to the following conditions:
|
---|
36 | *
|
---|
37 | * The above copyright notice and this permission notice shall be included in
|
---|
38 | * all copies or substantial portions of the Software.
|
---|
39 | *
|
---|
40 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
41 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
42 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
---|
43 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
---|
44 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
---|
45 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
46 | * OTHER DEALINGS IN THE SOFTWARE.
|
---|
47 | *
|
---|
48 | * Except as contained in this notice, the name of the copyright holder(s)
|
---|
49 | * and author(s) shall not be used in advertising or otherwise to promote
|
---|
50 | * the sale, use or other dealings in this Software without prior written
|
---|
51 | * authorization from the copyright holder(s) and author(s).
|
---|
52 | */
|
---|
53 |
|
---|
54 | /* $XConsortium: assyntax.h /main/5 1996/02/21 17:50:49 kaleb $ */
|
---|
55 |
|
---|
56 | /*
|
---|
57 | * assyntax.h
|
---|
58 | *
|
---|
59 | * Select the syntax appropriate to the 386 assembler being used
|
---|
60 | * To add support for more assemblers add more columns to the CHOICE
|
---|
61 | * macro. Note that register names must also have uppercase names
|
---|
62 | * to avoid macro recursion. e.g., #define ah %ah recurses!
|
---|
63 | *
|
---|
64 | * NB 1. Some of the macros for certain assemblers imply that the code is to
|
---|
65 | * run in protected mode!! Caveat emptor.
|
---|
66 | *
|
---|
67 | * NB 2. 486 specific instructions are not included. This is to discourage
|
---|
68 | * their accidental use in code that is intended to run on 386 and 486
|
---|
69 | * systems.
|
---|
70 | *
|
---|
71 | * Supported assemblers:
|
---|
72 | *
|
---|
73 | * (a) AT&T SysVr4 as(1): default
|
---|
74 | * (b) GNU Assembler gas: define USE_GAS or GNU_ASSEMBLER
|
---|
75 | * (c) Amsterdam Compiler kit: define ACK_ASSEMBLER
|
---|
76 | *
|
---|
77 | * The following naming conventions have been used to identify the various
|
---|
78 | * data types:
|
---|
79 | * _SR = segment register version
|
---|
80 | * Integer:
|
---|
81 | * _Q = quadword = 64 bits
|
---|
82 | * _L = long = 32 bits
|
---|
83 | * _W = short = 16 bits
|
---|
84 | * _B = byte = 8 bits
|
---|
85 | * Floating-point:
|
---|
86 | * _X = m80real = 80 bits
|
---|
87 | * _D = double = 64 bits
|
---|
88 | * _S = single = 32 bits
|
---|
89 | *
|
---|
90 | * Author: Gregory J. Sharp, Sept 1992
|
---|
91 | * Vrije Universiteit, Amsterdam, The Netherlands
|
---|
92 | */
|
---|
93 |
|
---|
94 | #if defined(USE_GAS) && !defined(GNU_ASSEMBLER)
|
---|
95 | #define GNU_ASSEMBLER
|
---|
96 | #endif
|
---|
97 |
|
---|
98 | #if (defined(__STDC__) && !defined(UNIXCPP)) || (defined (sun) && defined (i386) && defined (SVR4) && defined (__STDC__) && !defined (__GNUC__))
|
---|
99 | #define CONCAT(x, y) x ## y
|
---|
100 | #else
|
---|
101 | #define CONCAT(x, y) x/**/y
|
---|
102 | #endif
|
---|
103 |
|
---|
104 | #ifdef ACK_ASSEMBLER
|
---|
105 |
|
---|
106 | /* Assume we write code for 32-bit protected mode! */
|
---|
107 |
|
---|
108 | /* Redefine register names for GAS & AT&T assemblers */
|
---|
109 | #define AL al
|
---|
110 | #define AH ah
|
---|
111 | #define AX ax
|
---|
112 | #define EAX ax
|
---|
113 | #define BL bl
|
---|
114 | #define BH bh
|
---|
115 | #define BX bx
|
---|
116 | #define EBX bx
|
---|
117 | #define CL cl
|
---|
118 | #define CH ch
|
---|
119 | #define CX cx
|
---|
120 | #define ECX cx
|
---|
121 | #define DL dl
|
---|
122 | #define DH dh
|
---|
123 | #define DX dx
|
---|
124 | #define EDX dx
|
---|
125 | #define BP bp
|
---|
126 | #define EBP bp
|
---|
127 | #define SI si
|
---|
128 | #define ESI si
|
---|
129 | #define DI di
|
---|
130 | #define EDI di
|
---|
131 | #define SP sp
|
---|
132 | #define ESP sp
|
---|
133 | #define CS cs
|
---|
134 | #define SS ss
|
---|
135 | #define DS ds
|
---|
136 | #define ES es
|
---|
137 | #define FS fs
|
---|
138 | #define GS gs
|
---|
139 | /* Control Registers */
|
---|
140 | #define CR0 cr0
|
---|
141 | #define CR1 cr1
|
---|
142 | #define CR2 cr2
|
---|
143 | #define CR3 cr3
|
---|
144 | /* Debug Registers */
|
---|
145 | #define DR0 dr0
|
---|
146 | #define DR1 dr1
|
---|
147 | #define DR2 dr2
|
---|
148 | #define DR3 dr3
|
---|
149 | #define DR4 dr4
|
---|
150 | #define DR5 dr5
|
---|
151 | #define DR6 dr6
|
---|
152 | #define DR7 dr7
|
---|
153 | /* Floating-point Stack */
|
---|
154 | #define ST st
|
---|
155 |
|
---|
156 | #define AS_BEGIN .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
---|
157 |
|
---|
158 |
|
---|
159 | #define _WTOG o16 /* word toggle for _W instructions */
|
---|
160 | #define _LTOG /* long toggle for _L instructions */
|
---|
161 | #define ADDR_TOGGLE a16
|
---|
162 | #define OPSZ_TOGGLE o16
|
---|
163 | #define USE16 .use16
|
---|
164 | #define USE32 .use32
|
---|
165 |
|
---|
166 | #define CHOICE(a,b,c) c
|
---|
167 |
|
---|
168 | #else /* AT&T or GAS */
|
---|
169 |
|
---|
170 | /* Redefine register names for GAS & AT&T assemblers */
|
---|
171 | #define AL %al
|
---|
172 | #define AH %ah
|
---|
173 | #define AX %ax
|
---|
174 | #define EAX %eax
|
---|
175 | #define BL %bl
|
---|
176 | #define BH %bh
|
---|
177 | #define BX %bx
|
---|
178 | #define EBX %ebx
|
---|
179 | #define CL %cl
|
---|
180 | #define CH %ch
|
---|
181 | #define CX %cx
|
---|
182 | #define ECX %ecx
|
---|
183 | #define DL %dl
|
---|
184 | #define DH %dh
|
---|
185 | #define DX %dx
|
---|
186 | #define EDX %edx
|
---|
187 | #define BP %bp
|
---|
188 | #define EBP %ebp
|
---|
189 | #define SI %si
|
---|
190 | #define ESI %esi
|
---|
191 | #define DI %di
|
---|
192 | #define EDI %edi
|
---|
193 | #define SP %sp
|
---|
194 | #define ESP %esp
|
---|
195 | #define CS %cs
|
---|
196 | #define SS %ss
|
---|
197 | #define DS %ds
|
---|
198 | #define ES %es
|
---|
199 | #define FS %fs
|
---|
200 | #define GS %gs
|
---|
201 | /* Control Registers */
|
---|
202 | #define CR0 %cr0
|
---|
203 | #define CR1 %cr1
|
---|
204 | #define CR2 %cr2
|
---|
205 | #define CR3 %cr3
|
---|
206 | /* Debug Registers */
|
---|
207 | #define DR0 %db0
|
---|
208 | #define DR1 %db1
|
---|
209 | #define DR2 %db2
|
---|
210 | #define DR3 %db3
|
---|
211 | #define DR4 %db4
|
---|
212 | #define DR5 %db5
|
---|
213 | #define DR6 %db6
|
---|
214 | #define DR7 %db7
|
---|
215 | /* Floating-point Stack */
|
---|
216 | #define ST %st
|
---|
217 |
|
---|
218 | #define AS_BEGIN
|
---|
219 | #define USE16
|
---|
220 | #define USE32
|
---|
221 |
|
---|
222 | #ifdef GNU_ASSEMBLER
|
---|
223 |
|
---|
224 | #define ADDR_TOGGLE aword
|
---|
225 | #define OPSZ_TOGGLE word
|
---|
226 |
|
---|
227 | #define CHOICE(a,b,c) b
|
---|
228 |
|
---|
229 | #else
|
---|
230 | /*
|
---|
231 | * AT&T ASSEMBLER SYNTAX
|
---|
232 | * *********************
|
---|
233 | */
|
---|
234 | #define CHOICE(a,b,c) a
|
---|
235 |
|
---|
236 | #define ADDR_TOGGLE addr16
|
---|
237 | #define OPSZ_TOGGLE data16
|
---|
238 |
|
---|
239 | #endif /* GNU_ASSEMBLER */
|
---|
240 | #endif /* ACK_ASSEMBLER */
|
---|
241 |
|
---|
242 |
|
---|
243 | #if defined(__QNX__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__) || defined(__GNU__)
|
---|
244 | #define GLNAME(a) a
|
---|
245 | #else
|
---|
246 | #define GLNAME(a) CONCAT(_,a)
|
---|
247 | #endif
|
---|
248 |
|
---|
249 |
|
---|
250 | /****************************************/
|
---|
251 | /* */
|
---|
252 | /* Select the various choices */
|
---|
253 | /* */
|
---|
254 | /****************************************/
|
---|
255 |
|
---|
256 |
|
---|
257 | /* Redefine assembler directives */
|
---|
258 | /*********************************/
|
---|
259 | #define GLOBL CHOICE(.globl, .globl, .extern)
|
---|
260 | #define ALIGNTEXT4 CHOICE(.align 4, .align ARG2(2,0x90), .align 4)
|
---|
261 | #define ALIGNTEXT2 CHOICE(.align 2, .align ARG2(1,0x90), .align 2)
|
---|
262 | /* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is
|
---|
263 | * guaranteed to be filled with NOPs. Otherwise it does nothing.
|
---|
264 | */
|
---|
265 | #define ALIGNTEXT4ifNOP CHOICE(.align 4, .align ARG2(2,0x90), /*can't do it*/)
|
---|
266 | #define ALIGNDATA4 CHOICE(.align 4, .align ARG2(2,0x0), .align 4)
|
---|
267 | #define ALIGNDATA2 CHOICE(.align 2, .align ARG2(1,0x0), .align 2)
|
---|
268 | #define FILE(s) CHOICE(.file s, .file s, .file s)
|
---|
269 | #define STRING(s) CHOICE(.string s, .asciz s, .asciz s)
|
---|
270 | #define D_LONG CHOICE(.long, .long, .data4)
|
---|
271 | #define D_WORD CHOICE(.value, .short, .data2)
|
---|
272 | #define D_BYTE CHOICE(.byte, .byte, .data1)
|
---|
273 | #define SPACE CHOICE(.comm, .space, .space)
|
---|
274 | #define COMM CHOICE(.comm, .comm, .comm)
|
---|
275 | #define SEG_DATA CHOICE(.data, .data, .sect .data)
|
---|
276 | #define SEG_TEXT CHOICE(.text, .text, .sect .text)
|
---|
277 | #define SEG_BSS CHOICE(.bss, .bss, .sect .bss)
|
---|
278 |
|
---|
279 | #ifdef GNU_ASSEMBLER
|
---|
280 | #define D_SPACE(n) . = . + n
|
---|
281 | #else
|
---|
282 | #define D_SPACE(n) .space n
|
---|
283 | #endif
|
---|
284 |
|
---|
285 | /* Addressing Modes */
|
---|
286 | /* Immediate Mode */
|
---|
287 | #define ADDR(a) CHOICE(CONCAT($,a), CONCAT($,a), a)
|
---|
288 | #define CONST(a) CHOICE(CONCAT($,a), CONCAT($,a), a)
|
---|
289 |
|
---|
290 | /* Indirect Mode */
|
---|
291 | #define CONTENT(a) CHOICE(a, a, (a)) /* take contents of variable */
|
---|
292 | #define REGIND(a) CHOICE((a), (a), (a)) /* Register a indirect */
|
---|
293 | /* Register b indirect plus displacement a */
|
---|
294 | #define REGOFF(a, b) CHOICE(a(b), a(b), a(b))
|
---|
295 | /* Reg indirect Base + Index + Displacement - this is mainly for 16-bit mode
|
---|
296 | * which has no scaling
|
---|
297 | */
|
---|
298 | #define REGBID(b,i,d) CHOICE(d(b,i), d(b,i), d(b)(i))
|
---|
299 | /* Reg indirect Base + (Index * Scale) + Displacement */
|
---|
300 | #define REGBISD(b,i,s,d) CHOICE(d(b,i,s), d(b,i,s), d(b)(i*s))
|
---|
301 | /* Displaced Scaled Index: */
|
---|
302 | #define REGDIS(d,i,s) CHOICE(d(,i,s), d(,i,s), d(i * s))
|
---|
303 | /* Indexed Base: */
|
---|
304 | #define REGBI(b,i) CHOICE((b,i), (b,i), (b)(i))
|
---|
305 | /* Displaced Base: */
|
---|
306 | #define REGDB(d,b) CHOICE(d(b), d(b), d(b))
|
---|
307 | /* Variable indirect: */
|
---|
308 | #define VARINDIRECT(var) CHOICE(*var, *var, (var))
|
---|
309 | /* Use register contents as jump/call target: */
|
---|
310 | #define CODEPTR(reg) CHOICE(*reg, *reg, reg)
|
---|
311 |
|
---|
312 | /* For expressions requiring bracketing
|
---|
313 | * eg. (CRT0_PM | CRT_EM)
|
---|
314 | */
|
---|
315 |
|
---|
316 | #define EXPR(a) CHOICE([a], (a), [a])
|
---|
317 | #define ENOT(a) CHOICE(0!a, ~a, ~a)
|
---|
318 | #define EMUL(a,b) CHOICE(a\*b, a*b, a*b)
|
---|
319 | #define EDIV(a,b) CHOICE(a\/b, a/b, a/b)
|
---|
320 |
|
---|
321 | /*
|
---|
322 | * We have to beat the problem of commas within arguments to choice.
|
---|
323 | * eg. choice (add a,b, add b,a) will get argument mismatch. Luckily ANSI
|
---|
324 | * and other known cpp definitions evaluate arguments before substitution
|
---|
325 | * so the following works.
|
---|
326 | */
|
---|
327 | #define ARG2(a, b) a,b
|
---|
328 | #define ARG3(a,b,c) a,b,c
|
---|
329 |
|
---|
330 | /* Redefine assembler commands */
|
---|
331 | #define AAA CHOICE(aaa, aaa, aaa)
|
---|
332 | #define AAD CHOICE(aad, aad, aad)
|
---|
333 | #define AAM CHOICE(aam, aam, aam)
|
---|
334 | #define AAS CHOICE(aas, aas, aas)
|
---|
335 | #define ADC_L(a, b) CHOICE(adcl ARG2(a,b), adcl ARG2(a,b), _LTOG adc ARG2(b,a))
|
---|
336 | #define ADC_W(a, b) CHOICE(adcw ARG2(a,b), adcw ARG2(a,b), _WTOG adc ARG2(b,a))
|
---|
337 | #define ADC_B(a, b) CHOICE(adcb ARG2(a,b), adcb ARG2(a,b), adcb ARG2(b,a))
|
---|
338 | #define ADD_L(a, b) CHOICE(addl ARG2(a,b), addl ARG2(a,b), _LTOG add ARG2(b,a))
|
---|
339 | #define ADD_W(a, b) CHOICE(addw ARG2(a,b), addw ARG2(a,b), _WTOG add ARG2(b,a))
|
---|
340 | #define ADD_B(a, b) CHOICE(addb ARG2(a,b), addb ARG2(a,b), addb ARG2(b,a))
|
---|
341 | #define AND_L(a, b) CHOICE(andl ARG2(a,b), andl ARG2(a,b), _LTOG and ARG2(b,a))
|
---|
342 | #define AND_W(a, b) CHOICE(andw ARG2(a,b), andw ARG2(a,b), _WTOG and ARG2(b,a))
|
---|
343 | #define AND_B(a, b) CHOICE(andb ARG2(a,b), andb ARG2(a,b), andb ARG2(b,a))
|
---|
344 | #define ARPL(a,b) CHOICE(arpl ARG2(a,b), arpl ARG2(a,b), arpl ARG2(b,a))
|
---|
345 | #define BOUND_L(a, b) CHOICE(boundl ARG2(a,b), boundl ARG2(b,a), _LTOG bound ARG2(b,a))
|
---|
346 | #define BOUND_W(a, b) CHOICE(boundw ARG2(a,b), boundw ARG2(b,a), _WTOG bound ARG2(b,a))
|
---|
347 | #define BSF_L(a, b) CHOICE(bsfl ARG2(a,b), bsfl ARG2(a,b), _LTOG bsf ARG2(b,a))
|
---|
348 | #define BSF_W(a, b) CHOICE(bsfw ARG2(a,b), bsfw ARG2(a,b), _WTOG bsf ARG2(b,a))
|
---|
349 | #define BSR_L(a, b) CHOICE(bsrl ARG2(a,b), bsrl ARG2(a,b), _LTOG bsr ARG2(b,a))
|
---|
350 | #define BSR_W(a, b) CHOICE(bsrw ARG2(a,b), bsrw ARG2(a,b), _WTOG bsr ARG2(b,a))
|
---|
351 | #define BT_L(a, b) CHOICE(btl ARG2(a,b), btl ARG2(a,b), _LTOG bt ARG2(b,a))
|
---|
352 | #define BT_W(a, b) CHOICE(btw ARG2(a,b), btw ARG2(a,b), _WTOG bt ARG2(b,a))
|
---|
353 | #define BTC_L(a, b) CHOICE(btcl ARG2(a,b), btcl ARG2(a,b), _LTOG btc ARG2(b,a))
|
---|
354 | #define BTC_W(a, b) CHOICE(btcw ARG2(a,b), btcw ARG2(a,b), _WTOG btc ARG2(b,a))
|
---|
355 | #define BTR_L(a, b) CHOICE(btrl ARG2(a,b), btrl ARG2(a,b), _LTOG btr ARG2(b,a))
|
---|
356 | #define BTR_W(a, b) CHOICE(btrw ARG2(a,b), btrw ARG2(a,b), _WTOG btr ARG2(b,a))
|
---|
357 | #define BTS_L(a, b) CHOICE(btsl ARG2(a,b), btsl ARG2(a,b), _LTOG bts ARG2(b,a))
|
---|
358 | #define BTS_W(a, b) CHOICE(btsw ARG2(a,b), btsw ARG2(a,b), _WTOG bts ARG2(b,a))
|
---|
359 | #define CALL(a) CHOICE(call a, call a, call a)
|
---|
360 | #define CALLF(s,a) CHOICE(lcall ARG2(s,a), lcall ARG2(s,a), callf s:a)
|
---|
361 | #define CBW CHOICE(cbtw, cbw, cbw)
|
---|
362 | #define CWDE CHOICE(cwtd, cwde, cwde)
|
---|
363 | #define CLC CHOICE(clc, clc, clc)
|
---|
364 | #define CLD CHOICE(cld, cld, cld)
|
---|
365 | #define CLI CHOICE(cli, cli, cli)
|
---|
366 | #define CLTS CHOICE(clts, clts, clts)
|
---|
367 | #define CMC CHOICE(cmc, cmc, cmc)
|
---|
368 | #define CMP_L(a, b) CHOICE(cmpl ARG2(a,b), cmpl ARG2(a,b), _LTOG cmp ARG2(b,a))
|
---|
369 | #define CMP_W(a, b) CHOICE(cmpw ARG2(a,b), cmpw ARG2(a,b), _WTOG cmp ARG2(b,a))
|
---|
370 | #define CMP_B(a, b) CHOICE(cmpb ARG2(a,b), cmpb ARG2(a,b), cmpb ARG2(b,a))
|
---|
371 | #define CMPS_L CHOICE(cmpsl, cmpsl, _LTOG cmps)
|
---|
372 | #define CMPS_W CHOICE(cmpsw, cmpsw, _WTOG cmps)
|
---|
373 | #define CMPS_B CHOICE(cmpsb, cmpsb, cmpsb)
|
---|
374 | #define CWD CHOICE(cwtl, cwd, cwd)
|
---|
375 | #define CDQ CHOICE(cltd, cdq, cdq)
|
---|
376 | #define DAA CHOICE(daa, daa, daa)
|
---|
377 | #define DAS CHOICE(das, das, das)
|
---|
378 | #define DEC_L(a) CHOICE(decl a, decl a, _LTOG dec a)
|
---|
379 | #define DEC_W(a) CHOICE(decw a, decw a, _WTOG dec a)
|
---|
380 | #define DEC_B(a) CHOICE(decb a, decb a, decb a)
|
---|
381 | #define DIV_L(a) CHOICE(divl a, divl a, div a)
|
---|
382 | #define DIV_W(a) CHOICE(divw a, divw a, div a)
|
---|
383 | #define DIV_B(a) CHOICE(divb a, divb a, divb a)
|
---|
384 | #define ENTER(a,b) CHOICE(enter ARG2(a,b), enter ARG2(a,b), enter ARG2(b,a))
|
---|
385 | #define HLT CHOICE(hlt, hlt, hlt)
|
---|
386 | #define IDIV_L(a) CHOICE(idivl a, idivl a, _LTOG idiv a)
|
---|
387 | #define IDIV_W(a) CHOICE(idivw a, idivw a, _WTOG idiv a)
|
---|
388 | #define IDIV_B(a) CHOICE(idivb a, idivb a, idivb a)
|
---|
389 | /* More forms than this for imul!! */
|
---|
390 | #define IMUL_L(a, b) CHOICE(imull ARG2(a,b), imull ARG2(a,b), _LTOG imul ARG2(b,a))
|
---|
391 | #define IMUL_W(a, b) CHOICE(imulw ARG2(a,b), imulw ARG2(a,b), _WTOG imul ARG2(b,a))
|
---|
392 | #define IMUL_B(a) CHOICE(imulb a, imulb a, imulb a)
|
---|
393 | #define IN_L CHOICE(inl (DX), inl ARG2(DX,EAX), _LTOG in DX)
|
---|
394 | #define IN_W CHOICE(inw (DX), inw ARG2(DX,AX), _WTOG in DX)
|
---|
395 | #define IN_B CHOICE(inb (DX), inb ARG2(DX,AL), inb DX)
|
---|
396 | /* Please AS code writer: use the following ONLY, if you refer to ports<256
|
---|
397 | * directly, but not in IN1_W(DX), for instance, even if IN1_ looks nicer
|
---|
398 | */
|
---|
399 | #if defined (sun)
|
---|
400 | #define IN1_L(a) CHOICE(inl (a), inl ARG2(a,EAX), _LTOG in a)
|
---|
401 | #define IN1_W(a) CHOICE(inw (a), inw ARG2(a,AX), _WTOG in a)
|
---|
402 | #define IN1_B(a) CHOICE(inb (a), inb ARG2(a,AL), inb a)
|
---|
403 | #else
|
---|
404 | #define IN1_L(a) CHOICE(inl a, inl ARG2(a,EAX), _LTOG in a)
|
---|
405 | #define IN1_W(a) CHOICE(inw a, inw ARG2(a,AX), _WTOG in a)
|
---|
406 | #define IN1_B(a) CHOICE(inb a, inb ARG2(a,AL), inb a)
|
---|
407 | #endif
|
---|
408 | #define INC_L(a) CHOICE(incl a, incl a, _LTOG inc a)
|
---|
409 | #define INC_W(a) CHOICE(incw a, incw a, _WTOG inc a)
|
---|
410 | #define INC_B(a) CHOICE(incb a, incb a, incb a)
|
---|
411 | #define INS_L CHOICE(insl, insl, _LTOG ins)
|
---|
412 | #define INS_W CHOICE(insw, insw, _WTOG ins)
|
---|
413 | #define INS_B CHOICE(insb, insb, insb)
|
---|
414 | #define INT(a) CHOICE(int a, int a, int a)
|
---|
415 | #define INT3 CHOICE(int CONST(3), int3, int CONST(3))
|
---|
416 | #define INTO CHOICE(into, into, into)
|
---|
417 | #define IRET CHOICE(iret, iret, iret)
|
---|
418 | #define IRETD CHOICE(iret, iret, iretd)
|
---|
419 | #define JA(a) CHOICE(ja a, ja a, ja a)
|
---|
420 | #define JAE(a) CHOICE(jae a, jae a, jae a)
|
---|
421 | #define JB(a) CHOICE(jb a, jb a, jb a)
|
---|
422 | #define JBE(a) CHOICE(jbe a, jbe a, jbe a)
|
---|
423 | #define JC(a) CHOICE(jc a, jc a, jc a)
|
---|
424 | #define JE(a) CHOICE(je a, je a, je a)
|
---|
425 | #define JG(a) CHOICE(jg a, jg a, jg a)
|
---|
426 | #define JGE(a) CHOICE(jge a, jge a, jge a)
|
---|
427 | #define JL(a) CHOICE(jl a, jl a, jl a)
|
---|
428 | #define JLE(a) CHOICE(jle a, jle a, jle a)
|
---|
429 | #define JNA(a) CHOICE(jna a, jna a, jna a)
|
---|
430 | #define JNAE(a) CHOICE(jnae a, jnae a, jnae a)
|
---|
431 | #define JNB(a) CHOICE(jnb a, jnb a, jnb a)
|
---|
432 | #define JNBE(a) CHOICE(jnbe a, jnbe a, jnbe a)
|
---|
433 | #define JNC(a) CHOICE(jnc a, jnc a, jnc a)
|
---|
434 | #define JNE(a) CHOICE(jne a, jne a, jne a)
|
---|
435 | #define JNG(a) CHOICE(jng a, jng a, jng a)
|
---|
436 | #define JNGE(a) CHOICE(jnge a, jnge a, jnge a)
|
---|
437 | #define JNL(a) CHOICE(jnl a, jnl a, jnl a)
|
---|
438 | #define JNLE(a) CHOICE(jnle a, jnle a, jnle a)
|
---|
439 | #define JNO(a) CHOICE(jno a, jno a, jno a)
|
---|
440 | #define JNP(a) CHOICE(jnp a, jnp a, jnp a)
|
---|
441 | #define JNS(a) CHOICE(jns a, jns a, jns a)
|
---|
442 | #define JNZ(a) CHOICE(jnz a, jnz a, jnz a)
|
---|
443 | #define JO(a) CHOICE(jo a, jo a, jo a)
|
---|
444 | #define JP(a) CHOICE(jp a, jp a, jp a)
|
---|
445 | #define JPE(a) CHOICE(jpe a, jpe a, jpe a)
|
---|
446 | #define JPO(a) CHOICE(jpo a, jpo a, jpo a)
|
---|
447 | #define JS(a) CHOICE(js a, js a, js a)
|
---|
448 | #define JZ(a) CHOICE(jz a, jz a, jz a)
|
---|
449 | #define JMP(a) CHOICE(jmp a, jmp a, jmp a)
|
---|
450 | #define JMPF(s,a) CHOICE(ljmp ARG2(s,a), ljmp ARG2(s,a), jmpf s:a)
|
---|
451 | #define LAHF CHOICE(lahf, lahf, lahf)
|
---|
452 | #if !defined(_REAL_MODE) && !defined(_V86_MODE)
|
---|
453 | #define LAR(a, b) CHOICE(lar ARG2(a, b), lar ARG2(a, b), lar ARG2(b, a))
|
---|
454 | #endif
|
---|
455 | #define LEA_L(a, b) CHOICE(leal ARG2(a,b), leal ARG2(a,b), _LTOG lea ARG2(b,a))
|
---|
456 | #define LEA_W(a, b) CHOICE(leaw ARG2(a,b), leaw ARG2(a,b), _WTOG lea ARG2(b,a))
|
---|
457 | #define LEAVE CHOICE(leave, leave, leave)
|
---|
458 | #define LGDT(a) CHOICE(lgdt a, lgdt a, lgdt a)
|
---|
459 | #define LIDT(a) CHOICE(lidt a, lidt a, lidt a)
|
---|
460 | #define LDS(a, b) CHOICE(ldsl ARG2(a,b), lds ARG2(a,b), lds ARG2(b,a))
|
---|
461 | #define LES(a, b) CHOICE(lesl ARG2(a,b), les ARG2(a,b), les ARG2(b,a))
|
---|
462 | #define LFS(a, b) CHOICE(lfsl ARG2(a,b), lfs ARG2(a,b), lfs ARG2(b,a))
|
---|
463 | #define LGS(a, b) CHOICE(lgsl ARG2(a,b), lgs ARG2(a,b), lgs ARG2(b,a))
|
---|
464 | #define LSS(a, b) CHOICE(lssl ARG2(a,b), lss ARG2(a,b), lss ARG2(b,a))
|
---|
465 | #define LLDT(a) CHOICE(lldt a, lldt a, lldt a)
|
---|
466 | #define LMSW(a) CHOICE(lmsw a, lmsw a, lmsw a)
|
---|
467 | #define LOCK CHOICE(lock, lock, lock)
|
---|
468 | #define LODS_L CHOICE(lodsl, lodsl, _LTOG lods)
|
---|
469 | #define LODS_W CHOICE(lodsw, lodsw, _WTOG lods)
|
---|
470 | #define LODS_B CHOICE(lodsb, lodsb, lodsb)
|
---|
471 | #define LOOP(a) CHOICE(loop a, loop a, loop a)
|
---|
472 | #define LOOPE(a) CHOICE(loope a, loope a, loope a)
|
---|
473 | #define LOOPZ(a) CHOICE(loopz a, loopz a, loopz a)
|
---|
474 | #define LOOPNE(a) CHOICE(loopne a, loopne a, loopne a)
|
---|
475 | #define LOOPNZ(a) CHOICE(loopnz a, loopnz a, loopnz a)
|
---|
476 | #if !defined(_REAL_MODE) && !defined(_V86_MODE)
|
---|
477 | #define LSL(a, b) CHOICE(lsl ARG2(a,b), lsl ARG2(a,b), lsl ARG2(b,a))
|
---|
478 | #endif
|
---|
479 | #define LTR(a) CHOICE(ltr a, ltr a, ltr a)
|
---|
480 | #define MOV_SR(a, b) CHOICE(movw ARG2(a,b), mov ARG2(a,b), mov ARG2(b,a))
|
---|
481 | #define MOV_L(a, b) CHOICE(movl ARG2(a,b), movl ARG2(a,b), _LTOG mov ARG2(b,a))
|
---|
482 | #define MOV_W(a, b) CHOICE(movw ARG2(a,b), movw ARG2(a,b), _WTOG mov ARG2(b,a))
|
---|
483 | #define MOV_B(a, b) CHOICE(movb ARG2(a,b), movb ARG2(a,b), movb ARG2(b,a))
|
---|
484 | #define MOVS_L CHOICE(movsl, movsl, _LTOG movs)
|
---|
485 | #define MOVS_W CHOICE(movsw, movsw, _WTOG movs)
|
---|
486 | #define MOVS_B CHOICE(movsb, movsb, movsb)
|
---|
487 | #define MOVSX_BL(a, b) CHOICE(movsbl ARG2(a,b), movsbl ARG2(a,b), movsx ARG2(b,a))
|
---|
488 | #define MOVSX_BW(a, b) CHOICE(movsbw ARG2(a,b), movsbw ARG2(a,b), movsx ARG2(b,a))
|
---|
489 | #define MOVSX_WL(a, b) CHOICE(movswl ARG2(a,b), movswl ARG2(a,b), movsx ARG2(b,a))
|
---|
490 | #define MOVZX_BL(a, b) CHOICE(movzbl ARG2(a,b), movzbl ARG2(a,b), movzx ARG2(b,a))
|
---|
491 | #define MOVZX_BW(a, b) CHOICE(movzbw ARG2(a,b), movzbw ARG2(a,b), movzx ARG2(b,a))
|
---|
492 | #define MOVZX_WL(a, b) CHOICE(movzwl ARG2(a,b), movzwl ARG2(a,b), movzx ARG2(b,a))
|
---|
493 | #define MUL_L(a) CHOICE(mull a, mull a, _LTOG mul a)
|
---|
494 | #define MUL_W(a) CHOICE(mulw a, mulw a, _WTOG mul a)
|
---|
495 | #define MUL_B(a) CHOICE(mulb a, mulb a, mulb a)
|
---|
496 | #define NEG_L(a) CHOICE(negl a, negl a, _LTOG neg a)
|
---|
497 | #define NEG_W(a) CHOICE(negw a, negw a, _WTOG neg a)
|
---|
498 | #define NEG_B(a) CHOICE(negb a, negb a, negb a)
|
---|
499 | #define NOP CHOICE(nop, nop, nop)
|
---|
500 | #define NOT_L(a) CHOICE(notl a, notl a, _LTOG not a)
|
---|
501 | #define NOT_W(a) CHOICE(notw a, notw a, _WTOG not a)
|
---|
502 | #define NOT_B(a) CHOICE(notb a, notb a, notb a)
|
---|
503 | #define OR_L(a,b) CHOICE(orl ARG2(a,b), orl ARG2(a,b), _LTOG or ARG2(b,a))
|
---|
504 | #define OR_W(a,b) CHOICE(orw ARG2(a,b), orw ARG2(a,b), _WTOG or ARG2(b,a))
|
---|
505 | #define OR_B(a,b) CHOICE(orb ARG2(a,b), orb ARG2(a,b), orb ARG2(b,a))
|
---|
506 | #define OUT_L CHOICE(outl (DX), outl ARG2(EAX,DX), _LTOG out DX)
|
---|
507 | #define OUT_W CHOICE(outw (DX), outw ARG2(AX,DX), _WTOG out DX)
|
---|
508 | #define OUT_B CHOICE(outb (DX), outb ARG2(AL,DX), outb DX)
|
---|
509 | /* Please AS code writer: use the following ONLY, if you refer to ports<256
|
---|
510 | * directly, but not in OUT1_W(DX), for instance, even if OUT1_ looks nicer
|
---|
511 | */
|
---|
512 | #define OUT1_L(a) CHOICE(outl (a), outl ARG2(EAX,a), _LTOG out a)
|
---|
513 | #define OUT1_W(a) CHOICE(outw (a), outw ARG2(AX,a), _WTOG out a)
|
---|
514 | #define OUT1_B(a) CHOICE(outb (a), outb ARG2(AL,a), outb a)
|
---|
515 | #define OUTS_L CHOICE(outsl, outsl, _LTOG outs)
|
---|
516 | #define OUTS_W CHOICE(outsw, outsw, _WTOG outs)
|
---|
517 | #define OUTS_B CHOICE(outsb, outsb, outsb)
|
---|
518 | #define POP_SR(a) CHOICE(pop a, pop a, pop a)
|
---|
519 | #define POP_L(a) CHOICE(popl a, popl a, _LTOG pop a)
|
---|
520 | #define POP_W(a) CHOICE(popw a, popw a, _WTOG pop a)
|
---|
521 | #define POPA_L CHOICE(popal, popal, _LTOG popa)
|
---|
522 | #define POPA_W CHOICE(popaw, popaw, _WTOG popa)
|
---|
523 | #define POPF_L CHOICE(popfl, popfl, _LTOG popf)
|
---|
524 | #define POPF_W CHOICE(popfw, popfw, _WTOG popf)
|
---|
525 | #define PUSH_SR(a) CHOICE(push a, push a, push a)
|
---|
526 | #define PUSH_L(a) CHOICE(pushl a, pushl a, _LTOG push a)
|
---|
527 | #define PUSH_W(a) CHOICE(pushw a, pushw a, _WTOG push a)
|
---|
528 | #define PUSH_B(a) CHOICE(push a, pushb a, push a)
|
---|
529 | #define PUSHA_L CHOICE(pushal, pushal, _LTOG pusha)
|
---|
530 | #define PUSHA_W CHOICE(pushaw, pushaw, _WTOG pusha)
|
---|
531 | #define PUSHF_L CHOICE(pushfl, pushfl, _LTOG pushf)
|
---|
532 | #define PUSHF_W CHOICE(pushfw, pushfw, _WTOG pushf)
|
---|
533 | #define RCL_L(a, b) CHOICE(rcll ARG2(a,b), rcll ARG2(a,b), _LTOG rcl ARG2(b,a))
|
---|
534 | #define RCL_W(a, b) CHOICE(rclw ARG2(a,b), rclw ARG2(a,b), _WTOG rcl ARG2(b,a))
|
---|
535 | #define RCL_B(a, b) CHOICE(rclb ARG2(a,b), rclb ARG2(a,b), rclb ARG2(b,a))
|
---|
536 | #define RCR_L(a, b) CHOICE(rcrl ARG2(a,b), rcrl ARG2(a,b), _LTOG rcr ARG2(b,a))
|
---|
537 | #define RCR_W(a, b) CHOICE(rcrw ARG2(a,b), rcrw ARG2(a,b), _WTOG rcr ARG2(b,a))
|
---|
538 | #define RCR_B(a, b) CHOICE(rcrb ARG2(a,b), rcrb ARG2(a,b), rcrb ARG2(b,a))
|
---|
539 | #define ROL_L(a, b) CHOICE(roll ARG2(a,b), roll ARG2(a,b), _LTOG rol ARG2(b,a))
|
---|
540 | #define ROL_W(a, b) CHOICE(rolw ARG2(a,b), rolw ARG2(a,b), _WTOG rol ARG2(b,a))
|
---|
541 | #define ROL_B(a, b) CHOICE(rolb ARG2(a,b), rolb ARG2(a,b), rolb ARG2(b,a))
|
---|
542 | #define ROR_L(a, b) CHOICE(rorl ARG2(a,b), rorl ARG2(a,b), _LTOG ror ARG2(b,a))
|
---|
543 | #define ROR_W(a, b) CHOICE(rorw ARG2(a,b), rorw ARG2(a,b), _WTOG ror ARG2(b,a))
|
---|
544 | #define ROR_B(a, b) CHOICE(rorb ARG2(a,b), rorb ARG2(a,b), rorb ARG2(b,a))
|
---|
545 | #define REP CHOICE(rep ;, rep ;, repe)
|
---|
546 | #define REPE CHOICE(repz ;, repe ;, repe)
|
---|
547 | #define REPNE CHOICE(repnz ;, repne ;, repne)
|
---|
548 | #define REPNZ REPNE
|
---|
549 | #define REPZ REPE
|
---|
550 | #define RET CHOICE(ret, ret, ret)
|
---|
551 | #define SAHF CHOICE(sahf, sahf, sahf)
|
---|
552 | #define SAL_L(a, b) CHOICE(sall ARG2(a,b), sall ARG2(a,b), _LTOG sal ARG2(b,a))
|
---|
553 | #define SAL_W(a, b) CHOICE(salw ARG2(a,b), salw ARG2(a,b), _WTOG sal ARG2(b,a))
|
---|
554 | #define SAL_B(a, b) CHOICE(salb ARG2(a,b), salb ARG2(a,b), salb ARG2(b,a))
|
---|
555 | #define SAR_L(a, b) CHOICE(sarl ARG2(a,b), sarl ARG2(a,b), _LTOG sar ARG2(b,a))
|
---|
556 | #define SAR_W(a, b) CHOICE(sarw ARG2(a,b), sarw ARG2(a,b), _WTOG sar ARG2(b,a))
|
---|
557 | #define SAR_B(a, b) CHOICE(sarb ARG2(a,b), sarb ARG2(a,b), sarb ARG2(b,a))
|
---|
558 | #define SBB_L(a, b) CHOICE(sbbl ARG2(a,b), sbbl ARG2(a,b), _LTOG sbb ARG2(b,a))
|
---|
559 | #define SBB_W(a, b) CHOICE(sbbw ARG2(a,b), sbbw ARG2(a,b), _WTOG sbb ARG2(b,a))
|
---|
560 | #define SBB_B(a, b) CHOICE(sbbb ARG2(a,b), sbbb ARG2(a,b), sbbb ARG2(b,a))
|
---|
561 | #define SCAS_L CHOICE(scasl, scasl, _LTOG scas)
|
---|
562 | #define SCAS_W CHOICE(scasw, scasw, _WTOG scas)
|
---|
563 | #define SCAS_B CHOICE(scasb, scasb, scasb)
|
---|
564 | #define SETA(a) CHOICE(seta a, seta a, seta a)
|
---|
565 | #define SETAE(a) CHOICE(setae a, setae a, setae a)
|
---|
566 | #define SETB(a) CHOICE(setb a, setb a, setb a)
|
---|
567 | #define SETBE(a) CHOICE(setbe a, setbe a, setbe a)
|
---|
568 | #define SETC(a) CHOICE(setc a, setb a, setb a)
|
---|
569 | #define SETE(a) CHOICE(sete a, sete a, sete a)
|
---|
570 | #define SETG(a) CHOICE(setg a, setg a, setg a)
|
---|
571 | #define SETGE(a) CHOICE(setge a, setge a, setge a)
|
---|
572 | #define SETL(a) CHOICE(setl a, setl a, setl a)
|
---|
573 | #define SETLE(a) CHOICE(setle a, setle a, setle a)
|
---|
574 | #define SETNA(a) CHOICE(setna a, setna a, setna a)
|
---|
575 | #define SETNAE(a) CHOICE(setnae a, setnae a, setnae a)
|
---|
576 | #define SETNB(a) CHOICE(setnb a, setnb a, setnb a)
|
---|
577 | #define SETNBE(a) CHOICE(setnbe a, setnbe a, setnbe a)
|
---|
578 | #define SETNC(a) CHOICE(setnc a, setnb a, setnb a)
|
---|
579 | #define SETNE(a) CHOICE(setne a, setne a, setne a)
|
---|
580 | #define SETNG(a) CHOICE(setng a, setng a, setng a)
|
---|
581 | #define SETNGE(a) CHOICE(setnge a, setnge a, setnge a)
|
---|
582 | #define SETNL(a) CHOICE(setnl a, setnl a, setnl a)
|
---|
583 | #define SETNLE(a) CHOICE(setnle a, setnle a, setnle a)
|
---|
584 | #define SETNO(a) CHOICE(setno a, setno a, setno a)
|
---|
585 | #define SETNP(a) CHOICE(setnp a, setnp a, setnp a)
|
---|
586 | #define SETNS(a) CHOICE(setns a, setns a, setna a)
|
---|
587 | #define SETNZ(a) CHOICE(setnz a, setnz a, setnz a)
|
---|
588 | #define SETO(a) CHOICE(seto a, seto a, seto a)
|
---|
589 | #define SETP(a) CHOICE(setp a, setp a, setp a)
|
---|
590 | #define SETPE(a) CHOICE(setpe a, setpe a, setpe a)
|
---|
591 | #define SETPO(a) CHOICE(setpo a, setpo a, setpo a)
|
---|
592 | #define SETS(a) CHOICE(sets a, sets a, seta a)
|
---|
593 | #define SETZ(a) CHOICE(setz a, setz a, setz a)
|
---|
594 | #define SGDT(a) CHOICE(sgdt a, sgdt a, sgdt a)
|
---|
595 | #define SIDT(a) CHOICE(sidt a, sidt a, sidt a)
|
---|
596 | #define SHL_L(a, b) CHOICE(shll ARG2(a,b), shll ARG2(a,b), _LTOG shl ARG2(b,a))
|
---|
597 | #define SHL_W(a, b) CHOICE(shlw ARG2(a,b), shlw ARG2(a,b), _WTOG shl ARG2(b,a))
|
---|
598 | #define SHL_B(a, b) CHOICE(shlb ARG2(a,b), shlb ARG2(a,b), shlb ARG2(b,a))
|
---|
599 | #define SHLD_L(a,b,c) CHOICE(shldl ARG3(a,b,c), shldl ARG3(a,b,c), _LTOG shld ARG3(c,b,a))
|
---|
600 | #define SHLD2_L(a,b) CHOICE(shldl ARG2(a,b), shldl ARG3(CL,a,b), _LTOG shld ARG3(b,a,CL))
|
---|
601 | #define SHLD_W(a,b,c) CHOICE(shldw ARG3(a,b,c), shldw ARG3(a,b,c), _WTOG shld ARG3(c,b,a))
|
---|
602 | #define SHLD2_W(a,b) CHOICE(shldw ARG2(a,b), shldw ARG3(CL,a,b), _WTOG shld ARG3(b,a,CL))
|
---|
603 | #define SHR_L(a, b) CHOICE(shrl ARG2(a,b), shrl ARG2(a,b), _LTOG shr ARG2(b,a))
|
---|
604 | #define SHR_W(a, b) CHOICE(shrw ARG2(a,b), shrw ARG2(a,b), _WTOG shr ARG2(b,a))
|
---|
605 | #define SHR_B(a, b) CHOICE(shrb ARG2(a,b), shrb ARG2(a,b), shrb ARG2(b,a))
|
---|
606 | #define SHRD_L(a,b,c) CHOICE(shrdl ARG3(a,b,c), shrdl ARG3(a,b,c), _LTOG shrd ARG3(c,b,a))
|
---|
607 | #define SHRD2_L(a,b) CHOICE(shrdl ARG2(a,b), shrdl ARG3(CL,a,b), _LTOG shrd ARG3(b,a,CL))
|
---|
608 | #define SHRD_W(a,b,c) CHOICE(shrdw ARG3(a,b,c), shrdw ARG3(a,b,c), _WTOG shrd ARG3(c,b,a))
|
---|
609 | #define SHRD2_W(a,b) CHOICE(shrdw ARG2(a,b), shrdw ARG3(CL,a,b), _WTOG shrd ARG3(b,a,CL))
|
---|
610 | #define SLDT(a) CHOICE(sldt a, sldt a, sldt a)
|
---|
611 | #define SMSW(a) CHOICE(smsw a, smsw a, smsw a)
|
---|
612 | #define STC CHOICE(stc, stc, stc)
|
---|
613 | #define STD CHOICE(std, std, std)
|
---|
614 | #define STI CHOICE(sti, sti, sti)
|
---|
615 | #define STOS_L CHOICE(stosl, stosl, _LTOG stos)
|
---|
616 | #define STOS_W CHOICE(stosw, stosw, _WTOG stos)
|
---|
617 | #define STOS_B CHOICE(stosb, stosb, stosb)
|
---|
618 | #define STR(a) CHOICE(str a, str a, str a)
|
---|
619 | #define SUB_L(a, b) CHOICE(subl ARG2(a,b), subl ARG2(a,b), _LTOG sub ARG2(b,a))
|
---|
620 | #define SUB_W(a, b) CHOICE(subw ARG2(a,b), subw ARG2(a,b), _WTOG sub ARG2(b,a))
|
---|
621 | #define SUB_B(a, b) CHOICE(subb ARG2(a,b), subb ARG2(a,b), subb ARG2(b,a))
|
---|
622 | #define TEST_L(a, b) CHOICE(testl ARG2(a,b), testl ARG2(a,b), _LTOG test ARG2(b,a))
|
---|
623 | #define TEST_W(a, b) CHOICE(testw ARG2(a,b), testw ARG2(a,b), _WTOG test ARG2(b,a))
|
---|
624 | #define TEST_B(a, b) CHOICE(testb ARG2(a,b), testb ARG2(a,b), testb ARG2(b,a))
|
---|
625 | #define VERR(a) CHOICE(verr a, verr a, verr a)
|
---|
626 | #define VERW(a) CHOICE(verw a, verw a, verw a)
|
---|
627 | #define WAIT CHOICE(wait, wait, wait)
|
---|
628 | #define XCHG_L(a, b) CHOICE(xchgl ARG2(a,b), xchgl ARG2(a,b), _LTOG xchg ARG2(b,a))
|
---|
629 | #define XCHG_W(a, b) CHOICE(xchgw ARG2(a,b), xchgw ARG2(a,b), _WTOG xchg ARG2(b,a))
|
---|
630 | #define XCHG_B(a, b) CHOICE(xchgb ARG2(a,b), xchgb ARG2(a,b), xchgb ARG2(b,a))
|
---|
631 | #define XLAT CHOICE(xlat, xlat, xlat)
|
---|
632 | #define XOR_L(a, b) CHOICE(xorl ARG2(a,b), xorl ARG2(a,b), _LTOG xor ARG2(b,a))
|
---|
633 | #define XOR_W(a, b) CHOICE(xorw ARG2(a,b), xorw ARG2(a,b), _WTOG xor ARG2(b,a))
|
---|
634 | #define XOR_B(a, b) CHOICE(xorb ARG2(a,b), xorb ARG2(a,b), xorb ARG2(b,a))
|
---|
635 |
|
---|
636 |
|
---|
637 | /* Floating Point Instructions */
|
---|
638 | #define F2XM1 CHOICE(f2xm1, f2xm1, f2xm1)
|
---|
639 | #define FABS CHOICE(fabs, fabs, fabs)
|
---|
640 | #define FADD_D(a) CHOICE(faddl a, faddl a, faddd a)
|
---|
641 | #define FADD_S(a) CHOICE(fadds a, fadds a, fadds a)
|
---|
642 | #define FADD2(a, b) CHOICE(fadd ARG2(a,b), fadd ARG2(a,b), fadd ARG2(b,a))
|
---|
643 | #define FADDP(a, b) CHOICE(faddp ARG2(a,b), faddp ARG2(a,b), faddp ARG2(b,a))
|
---|
644 | #define FIADD_L(a) CHOICE(fiaddl a, fiaddl a, fiaddl a)
|
---|
645 | #define FIADD_W(a) CHOICE(fiadd a, fiadds a, fiadds a)
|
---|
646 | #define FBLD(a) CHOICE(fbld a, fbld a, fbld a)
|
---|
647 | #define FBSTP(a) CHOICE(fbstp a, fbstp a, fbstp a)
|
---|
648 | #define FCHS CHOICE(fchs, fchs, fchs)
|
---|
649 | #define FCLEX CHOICE(fclex, wait; fnclex, wait; fclex)
|
---|
650 | #define FNCLEX CHOICE(fnclex, fnclex, fclex)
|
---|
651 | #define FCOM(a) CHOICE(fcom a, fcom a, fcom a)
|
---|
652 | #define FCOM_D(a) CHOICE(fcoml a, fcoml a, fcomd a)
|
---|
653 | #define FCOM_S(a) CHOICE(fcoms a, fcoms a, fcoms a)
|
---|
654 | #define FCOMP(a) CHOICE(fcomp a, fcomp a, fcomp a)
|
---|
655 | #define FCOMP_D(a) CHOICE(fcompl a, fcompl a, fcompd a)
|
---|
656 | #define FCOMP_S(a) CHOICE(fcomps a, fcomps a, fcomps a)
|
---|
657 | #define FCOMPP CHOICE(fcompp, fcompp, fcompp)
|
---|
658 | #define FCOS CHOICE(fcos, fcos, fcos)
|
---|
659 | #define FDECSTP CHOICE(fdecstp, fdecstp, fdecstp)
|
---|
660 | #define FDIV_D(a) CHOICE(fdivl a, fdivl a, fdivd a)
|
---|
661 | #define FDIV_S(a) CHOICE(fdivs a, fdivs a, fdivs a)
|
---|
662 | #define FDIV2(a, b) CHOICE(fdiv ARG2(a,b), fdiv ARG2(a,b), fdiv ARG2(b,a))
|
---|
663 | #define FDIVP(a, b) CHOICE(fdivp ARG2(a,b), fdivp ARG2(a,b), fdivp ARG2(b,a))
|
---|
664 | #define FIDIV_L(a) CHOICE(fidivl a, fidivl a, fidivl a)
|
---|
665 | #define FIDIV_W(a) CHOICE(fidiv a, fidivs a, fidivs a)
|
---|
666 | #define FDIVR_D(a) CHOICE(fdivrl a, fdivrl a, fdivrd a)
|
---|
667 | #define FDIVR_S(a) CHOICE(fdivrs a, fdivrs a, fdivrs a)
|
---|
668 | #define FDIVR2(a, b) CHOICE(fdivr ARG2(a,b), fdivr ARG2(a,b), fdivr ARG2(b,a))
|
---|
669 | #define FDIVRP(a, b) CHOICE(fdivrp ARG2(a,b), fdivrp ARG2(a,b), fdivrp ARG2(b,a))
|
---|
670 | #define FIDIVR_L(a) CHOICE(fidivrl a, fidivrl a, fidivrl a)
|
---|
671 | #define FIDIVR_W(a) CHOICE(fidivr a, fidivrs a, fidivrs a)
|
---|
672 | #define FFREE(a) CHOICE(ffree a, ffree a, ffree a)
|
---|
673 | #define FICOM_L(a) CHOICE(ficoml a, ficoml a, ficoml a)
|
---|
674 | #define FICOM_W(a) CHOICE(ficom a, ficoms a, ficoms a)
|
---|
675 | #define FICOMP_L(a) CHOICE(ficompl a, ficompl a, ficompl a)
|
---|
676 | #define FICOMP_W(a) CHOICE(ficomp a, ficomps a, ficomps a)
|
---|
677 | #define FILD_Q(a) CHOICE(fildll a, fildq a, fildq a)
|
---|
678 | #define FILD_L(a) CHOICE(fildl a, fildl a, fildl a)
|
---|
679 | #define FILD_W(a) CHOICE(fild a, filds a, filds a)
|
---|
680 | #define FINCSTP CHOICE(fincstp, fincstp, fincstp)
|
---|
681 | #define FINIT CHOICE(finit, wait; fninit, wait; finit)
|
---|
682 | #define FNINIT CHOICE(fninit, fninit, finit)
|
---|
683 | #define FIST_L(a) CHOICE(fistl a, fistl a, fistl a)
|
---|
684 | #define FIST_W(a) CHOICE(fist a, fists a, fists a)
|
---|
685 | #define FISTP_Q(a) CHOICE(fistpll a, fistpq a, fistpq a)
|
---|
686 | #define FISTP_L(a) CHOICE(fistpl a, fistpl a, fistpl a)
|
---|
687 | #define FISTP_W(a) CHOICE(fistp a, fistps a, fistps a)
|
---|
688 | #define FLD_X(a) CHOICE(fldt a, fldt a, fldx a) /* 80 bit data type! */
|
---|
689 | #define FLD_D(a) CHOICE(fldl a, fldl a, fldd a)
|
---|
690 | #define FLD_S(a) CHOICE(flds a, flds a, flds a)
|
---|
691 | #define FLD1 CHOICE(fld1, fld1, fld1)
|
---|
692 | #define FLDL2T CHOICE(fldl2t, fldl2t, fldl2t)
|
---|
693 | #define FLDL2E CHOICE(fldl2e, fldl2e, fldl2e)
|
---|
694 | #define FLDPI CHOICE(fldpi, fldpi, fldpi)
|
---|
695 | #define FLDLG2 CHOICE(fldlg2, fldlg2, fldlg2)
|
---|
696 | #define FLDLN2 CHOICE(fldln2, fldln2, fldln2)
|
---|
697 | #define FLDZ CHOICE(fldz, fldz, fldz)
|
---|
698 | #define FLDCW(a) CHOICE(fldcw a, fldcw a, fldcw a)
|
---|
699 | #define FLDENV(a) CHOICE(fldenv a, fldenv a, fldenv a)
|
---|
700 | #define FMUL_S(a) CHOICE(fmuls a, fmuls a, fmuls a)
|
---|
701 | #define FMUL_D(a) CHOICE(fmull a, fmull a, fmuld a)
|
---|
702 | #define FMUL2(a, b) CHOICE(fmul ARG2(a,b), fmul ARG2(a,b), fmul ARG2(b,a))
|
---|
703 | #define FMULP(a, b) CHOICE(fmulp ARG2(a,b), fmulp ARG2(a,b), fmulp ARG2(b,a))
|
---|
704 | #define FIMUL_L(a) CHOICE(fimull a, fimull a, fimull a)
|
---|
705 | #define FIMUL_W(a) CHOICE(fimul a, fimuls a, fimuls a)
|
---|
706 | #define FNOP CHOICE(fnop, fnop, fnop)
|
---|
707 | #define FPATAN CHOICE(fpatan, fpatan, fpatan)
|
---|
708 | #define FPREM CHOICE(fprem, fprem, fprem)
|
---|
709 | #define FPREM1 CHOICE(fprem1, fprem1, fprem1)
|
---|
710 | #define FPTAN CHOICE(fptan, fptan, fptan)
|
---|
711 | #define FRNDINT CHOICE(frndint, frndint, frndint)
|
---|
712 | #define FRSTOR(a) CHOICE(frstor a, frstor a, frstor a)
|
---|
713 | #define FSAVE(a) CHOICE(fsave a, wait; fnsave a, wait; fsave a)
|
---|
714 | #define FNSAVE(a) CHOICE(fnsave a, fnsave a, fsave a)
|
---|
715 | #define FSCALE CHOICE(fscale, fscale, fscale)
|
---|
716 | #define FSIN CHOICE(fsin, fsin, fsin)
|
---|
717 | #define FSINCOS CHOICE(fsincos, fsincos, fsincos)
|
---|
718 | #define FSQRT CHOICE(fsqrt, fsqrt, fsqrt)
|
---|
719 | #define FST_D(a) CHOICE(fstl a, fstl a, fstd a)
|
---|
720 | #define FST_S(a) CHOICE(fsts a, fsts a, fsts a)
|
---|
721 | #define FSTP_X(a) CHOICE(fstpt a, fstpt a, fstpx a)
|
---|
722 | #define FSTP_D(a) CHOICE(fstpl a, fstpl a, fstpd a)
|
---|
723 | #define FSTP_S(a) CHOICE(fstps a, fstps a, fstps a)
|
---|
724 | #define FSTCW(a) CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a)
|
---|
725 | #define FNSTCW(a) CHOICE(fnstcw a, fnstcw a, fstcw a)
|
---|
726 | #define FSTENV(a) CHOICE(fstenv a, wait; fnstenv a, fstenv a)
|
---|
727 | #define FNSTENV(a) CHOICE(fnstenv a, fnstenv a, fstenv a)
|
---|
728 | #define FSTSW(a) CHOICE(fstsw a, wait; fnstsw a, wait; fstsw a)
|
---|
729 | #define FNSTSW(a) CHOICE(fnstsw a, fnstsw a, fstsw a)
|
---|
730 | #define FSUB_S(a) CHOICE(fsubs a, fsubs a, fsubs a)
|
---|
731 | #define FSUB_D(a) CHOICE(fsubl a, fsubl a, fsubd a)
|
---|
732 | #define FSUB2(a, b) CHOICE(fsub ARG2(a,b), fsub ARG2(a,b), fsub ARG2(b,a))
|
---|
733 | #define FSUBP(a, b) CHOICE(fsubp ARG2(a,b), fsubp ARG2(a,b), fsubp ARG2(b,a))
|
---|
734 | #define FISUB_L(a) CHOICE(fisubl a, fisubl a, fisubl a)
|
---|
735 | #define FISUB_W(a) CHOICE(fisub a, fisubs a, fisubs a)
|
---|
736 | #define FSUBR_S(a) CHOICE(fsubrs a, fsubrs a, fsubrs a)
|
---|
737 | #define FSUBR_D(a) CHOICE(fsubrl a, fsubrl a, fsubrd a)
|
---|
738 | #define FSUBR2(a, b) CHOICE(fsubr ARG2(a,b), fsubr ARG2(a,b), fsubr ARG2(b,a))
|
---|
739 | #define FSUBRP(a, b) CHOICE(fsubrp ARG2(a,b), fsubrp ARG2(a,b), fsubrp ARG2(b,a))
|
---|
740 | #define FISUBR_L(a) CHOICE(fisubrl a, fisubrl a, fisubrl a)
|
---|
741 | #define FISUBR_W(a) CHOICE(fisubr a, fisubrs a, fisubrs a)
|
---|
742 | #define FTST CHOICE(ftst, ftst, ftst)
|
---|
743 | #define FUCOM(a) CHOICE(fucom a, fucom a, fucom a)
|
---|
744 | #define FUCOMP(a) CHOICE(fucomp a, fucomp a, fucomp a)
|
---|
745 | #define FUCOMPP CHOICE(fucompp, fucompp, fucompp)
|
---|
746 | #define FWAIT CHOICE(wait, wait, wait)
|
---|
747 | #define FXAM CHOICE(fxam, fxam, fxam)
|
---|
748 | #define FXCH(a) CHOICE(fxch a, fxch a, fxch a)
|
---|
749 | #define FXTRACT CHOICE(fxtract, fxtract, fxtract)
|
---|
750 | #define FYL2X CHOICE(fyl2x, fyl2x, fyl2x)
|
---|
751 | #define FYL2XP1 CHOICE(fyl2xp1, fyl2xp1, fyl2xp1)
|
---|
752 |
|
---|
753 | #endif /* __ASSYNTAX_H__ */
|
---|