Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenassyntax.h
Go to the documentation of this file.
00001 00002 #ifndef __ASSYNTAX_H__ 00003 #define __ASSYNTAX_H__ 00004 00005 /* 00006 * Copyright 1992 Vrije Universiteit, The Netherlands 00007 * 00008 * Permission to use, copy, modify, and distribute this software and its 00009 * documentation for any purpose and without fee is hereby granted, provided 00010 * that the above copyright notice appear in all copies and that both that 00011 * copyright notice and this permission notice appear in supporting 00012 * documentation, and that the name of the Vrije Universiteit not be used in 00013 * advertising or publicity pertaining to distribution of the software without 00014 * specific, written prior permission. The Vrije Universiteit makes no 00015 * representations about the suitability of this software for any purpose. 00016 * It is provided "as is" without express or implied warranty. 00017 * 00018 * The Vrije Universiteit DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 00019 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, 00020 * IN NO EVENT SHALL The Vrije Universiteit BE LIABLE FOR ANY SPECIAL, 00021 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 00022 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 00023 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00024 * PERFORMANCE OF THIS SOFTWARE. 00025 */ 00026 00027 /* 00028 * assyntax.h 00029 * 00030 * Select the syntax appropriate to the 386 assembler being used 00031 * To add support for more assemblers add more columns to the CHOICE 00032 * macro. Note that register names must also have uppercase names 00033 * to avoid macro recursion. e.g., #define ah %ah recurses! 00034 * 00035 * NB 1. Some of the macros for certain assemblers imply that the code is to 00036 * run in protected mode!! Caveat emptor. 00037 * 00038 * NB 2. 486 specific instructions are not included. This is to discourage 00039 * their accidental use in code that is intended to run on 386 and 486 00040 * systems. 00041 * 00042 * Supported assemblers: 00043 * 00044 * (a) AT&T SysVr4 as(1): define ATT_ASSEMBLER 00045 * (b) GNU Assembler gas: define GNU_ASSEMBLER (default) 00046 * (c) Amsterdam Compiler kit: define ACK_ASSEMBLER 00047 * (d) The Netwide Assembler: define NASM_ASSEMBLER 00048 * (e) Microsoft Assembler: define MASM_ASSEMBLER (UNTESTED!) 00049 * 00050 * The following naming conventions have been used to identify the various 00051 * data types: 00052 * _SR = segment register version 00053 * Integer: 00054 * _Q = quadword = 64 bits 00055 * _L = long = 32 bits 00056 * _W = short = 16 bits 00057 * _B = byte = 8 bits 00058 * Floating-point: 00059 * _X = m80real = 80 bits 00060 * _D = double = 64 bits 00061 * _S = single = 32 bits 00062 * 00063 * Author: Gregory J. Sharp, Sept 1992 00064 * Vrije Universiteit, Amsterdam, The Netherlands 00065 * 00066 * [support for Intel syntax added by Josh Vanderhoof, 1999] 00067 */ 00068 00069 #if !(defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER)) 00070 00071 /* Default to ATT_ASSEMBLER when SVR4 or SYSV are defined */ 00072 #if (defined(SVR4) || defined(SYSV)) && !defined(GNU_ASSEMBLER) 00073 #define ATT_ASSEMBLER 00074 #endif 00075 00076 #if !defined(ATT_ASSEMBLER) && !defined(GNU_ASSEMBLER) && !defined(ACK_ASSEMBLER) 00077 #define GNU_ASSEMBLER 00078 #endif 00079 00080 #if (defined(__STDC__) && !defined(UNIXCPP)) || (defined (sun) && defined (i386) && defined (SVR4) && defined (__STDC__) && !defined (__GNUC__)) 00081 #define CONCAT(x, y) x ## y 00082 #define CONCAT3(x, y, z) x ## y ## z 00083 #else 00084 #define CONCAT(x, y) xy 00085 #define CONCAT3(x, y, z) xyz 00086 #endif 00087 00088 #ifdef ACK_ASSEMBLER 00089 00090 /* Assume we write code for 32-bit protected mode! */ 00091 00092 /* Redefine register names for GAS & AT&T assemblers */ 00093 #define AL al 00094 #define AH ah 00095 #define AX ax 00096 #define EAX ax 00097 #define BL bl 00098 #define BH bh 00099 #define BX bx 00100 #define EBX bx 00101 #define CL cl 00102 #define CH ch 00103 #define CX cx 00104 #define ECX cx 00105 #define DL dl 00106 #define DH dh 00107 #define DX dx 00108 #define EDX dx 00109 #define BP bp 00110 #define EBP bp 00111 #define SI si 00112 #define ESI si 00113 #define DI di 00114 #define EDI di 00115 #define SP sp 00116 #define ESP sp 00117 #define CS cs 00118 #define SS ss 00119 #define DS ds 00120 #define ES es 00121 #define FS fs 00122 #define GS gs 00123 /* Control Registers */ 00124 #define CR0 cr0 00125 #define CR1 cr1 00126 #define CR2 cr2 00127 #define CR3 cr3 00128 /* Debug Registers */ 00129 #define DR0 dr0 00130 #define DR1 dr1 00131 #define DR2 dr2 00132 #define DR3 dr3 00133 #define DR4 dr4 00134 #define DR5 dr5 00135 #define DR6 dr6 00136 #define DR7 dr7 00137 /* Floating-point Stack */ 00138 #define ST st 00139 00140 #define AS_BEGIN .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text 00141 00142 00143 #define _WTOG o16 /* word toggle for _W instructions */ 00144 #define _LTOG /* long toggle for _L instructions */ 00145 #define ADDR_TOGGLE a16 00146 #define OPSZ_TOGGLE o16 00147 #define USE16 .use16 00148 #define USE32 .use32 00149 00150 #define CHOICE(a,b,c) c 00151 00152 #else /* AT&T or GAS */ 00153 00154 /* Redefine register names for GAS & AT&T assemblers */ 00155 #define AL %al 00156 #define AH %ah 00157 #define AX %ax 00158 #define EAX %eax 00159 #define BL %bl 00160 #define BH %bh 00161 #define BX %bx 00162 #define EBX %ebx 00163 #define CL %cl 00164 #define CH %ch 00165 #define CX %cx 00166 #define ECX %ecx 00167 #define DL %dl 00168 #define DH %dh 00169 #define DX %dx 00170 #define EDX %edx 00171 #define BP %bp 00172 #define EBP %ebp 00173 #define SI %si 00174 #define ESI %esi 00175 #define DI %di 00176 #define EDI %edi 00177 #define SP %sp 00178 #define ESP %esp 00179 #define CS %cs 00180 #define SS %ss 00181 #define DS %ds 00182 #define ES %es 00183 #define FS %fs 00184 #define GS %gs 00185 /* Control Registers */ 00186 #define CR0 %cr0 00187 #define CR1 %cr1 00188 #define CR2 %cr2 00189 #define CR3 %cr3 00190 /* Debug Registers */ 00191 #define DR0 %db0 00192 #define DR1 %db1 00193 #define DR2 %db2 00194 #define DR3 %db3 00195 #define DR4 %db4 00196 #define DR5 %db5 00197 #define DR6 %db6 00198 #define DR7 %db7 00199 /* Floating-point Stack */ 00200 #define _STX0 %st(0) 00201 #define _STX1 %st(1) 00202 #define _STX2 %st(2) 00203 #define _STX3 %st(3) 00204 #define _STX4 %st(4) 00205 #define _STX5 %st(5) 00206 #define _STX6 %st(6) 00207 #define _STX7 %st(7) 00208 #define ST(x) CONCAT(_STX,x) 00209 #ifdef GNU_ASSEMBLER 00210 #define ST0 %st(0) 00211 #else 00212 #define ST0 %st 00213 #endif 00214 /* MMX Registers */ 00215 #define MM0 %mm0 00216 #define MM1 %mm1 00217 #define MM2 %mm2 00218 #define MM3 %mm3 00219 #define MM4 %mm4 00220 #define MM5 %mm5 00221 #define MM6 %mm6 00222 #define MM7 %mm7 00223 /* SSE Registers */ 00224 #define XMM0 %xmm0 00225 #define XMM1 %xmm1 00226 #define XMM2 %xmm2 00227 #define XMM3 %xmm3 00228 #define XMM4 %xmm4 00229 #define XMM5 %xmm5 00230 #define XMM6 %xmm6 00231 #define XMM7 %xmm7 00232 00233 #define AS_BEGIN 00234 #define USE16 00235 #define USE32 00236 00237 #ifdef GNU_ASSEMBLER 00238 00239 #define ADDR_TOGGLE aword 00240 #define OPSZ_TOGGLE word 00241 00242 #define CHOICE(a,b,c) b 00243 00244 #else 00245 /* 00246 * AT&T ASSEMBLER SYNTAX 00247 * ********************* 00248 */ 00249 #define CHOICE(a,b,c) a 00250 00251 #define ADDR_TOGGLE addr16 00252 #define OPSZ_TOGGLE data16 00253 00254 #endif /* GNU_ASSEMBLER */ 00255 #endif /* ACK_ASSEMBLER */ 00256 00257 00258 #if defined(__QNX__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__) || defined(__GNU__) || defined(__GNUC__) && !defined(__DJGPP__) && !defined(__MINGW32__) 00259 #define GLNAME(a) a 00260 #else 00261 #define GLNAME(a) CONCAT(_,a) 00262 #endif 00263 00264 00265 /****************************************/ 00266 /* */ 00267 /* Select the various choices */ 00268 /* */ 00269 /****************************************/ 00270 00271 00272 /* Redefine assembler directives */ 00273 /*********************************/ 00274 #define GLOBL CHOICE(.globl, .globl, .extern) 00275 #define GLOBAL GLOBL 00276 #define EXTERN GLOBL 00277 #ifndef __AOUT__ 00278 #define ALIGNTEXT32 CHOICE(.align 32, .balign 32, .align 32) 00279 #define ALIGNTEXT16 CHOICE(.align 16, .balign 16, .align 16) 00280 #define ALIGNTEXT8 CHOICE(.align 8, .balign 8, .align 8) 00281 #define ALIGNTEXT4 CHOICE(.align 4, .balign 4, .align 4) 00282 #define ALIGNTEXT2 CHOICE(.align 2, .balign 2, .align 2) 00283 /* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is 00284 * guaranteed to be filled with NOPs. Otherwise it does nothing. 00285 */ 00286 #define ALIGNTEXT32ifNOP CHOICE(.align 32, .balign ARG2(32,0x90), /*can't do it*/) 00287 #define ALIGNTEXT16ifNOP CHOICE(.align 16, .balign ARG2(16,0x90), /*can't do it*/) 00288 #define ALIGNTEXT8ifNOP CHOICE(.align 8, .balign ARG2(8,0x90), /*can't do it*/) 00289 #define ALIGNTEXT4ifNOP CHOICE(.align 4, .balign ARG2(4,0x90), /*can't do it*/) 00290 #define ALIGNDATA32 CHOICE(.align 32, .balign ARG2(32,0x0), .align 32) 00291 #define ALIGNDATA16 CHOICE(.align 16, .balign ARG2(16,0x0), .align 16) 00292 #define ALIGNDATA8 CHOICE(.align 8, .balign ARG2(8,0x0), .align 8) 00293 #define ALIGNDATA4 CHOICE(.align 4, .balign ARG2(4,0x0), .align 4) 00294 #define ALIGNDATA2 CHOICE(.align 2, .balign ARG2(2,0x0), .align 2) 00295 #else 00296 /* 'as -aout' on FreeBSD doesn't have .balign */ 00297 #define ALIGNTEXT32 CHOICE(.align 32, .align ARG2(5,0x90), .align 32) 00298 #define ALIGNTEXT16 CHOICE(.align 16, .align ARG2(4,0x90), .align 16) 00299 #define ALIGNTEXT8 CHOICE(.align 8, .align ARG2(3,0x90), .align 8) 00300 #define ALIGNTEXT4 CHOICE(.align 4, .align ARG2(2,0x90), .align 4) 00301 #define ALIGNTEXT2 CHOICE(.align 2, .align ARG2(1,0x90), .align 2) 00302 /* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is 00303 * guaranteed to be filled with NOPs. Otherwise it does nothing. 00304 */ 00305 #define ALIGNTEXT32ifNOP CHOICE(.align 32, .align ARG2(5,0x90), /*can't do it*/) 00306 #define ALIGNTEXT16ifNOP CHOICE(.align 16, .align ARG2(4,0x90), /*can't do it*/) 00307 #define ALIGNTEXT8ifNOP CHOICE(.align 8, .align ARG2(3,0x90), /*can't do it*/) 00308 #define ALIGNTEXT4ifNOP CHOICE(.align 4, .align ARG2(2,0x90), /*can't do it*/) 00309 #define ALIGNDATA32 CHOICE(.align 32, .align ARG2(5,0x0), .align 32) 00310 #define ALIGNDATA16 CHOICE(.align 16, .align ARG2(4,0x0), .align 16) 00311 #define ALIGNDATA8 CHOICE(.align 8, .align ARG2(3,0x0), .align 8) 00312 #define ALIGNDATA4 CHOICE(.align 4, .align ARG2(2,0x0), .align 4) 00313 #define ALIGNDATA2 CHOICE(.align 2, .align ARG2(1,0x0), .align 2) 00314 #endif /* __AOUT__ */ 00315 #define FILE(s) CHOICE(.file s, .file s, .file s) 00316 #define STRING(s) CHOICE(.string s, .asciz s, .asciz s) 00317 #define D_LONG CHOICE(.long, .long, .data4) 00318 #define D_WORD CHOICE(.value, .short, .data2) 00319 #define D_BYTE CHOICE(.byte, .byte, .data1) 00320 #define SPACE CHOICE(.comm, .space, .space) 00321 #define COMM CHOICE(.comm, .comm, .comm) 00322 #define SEG_DATA CHOICE(.data, .data, .sect .data) 00323 #define SEG_TEXT CHOICE(.text, .text, .sect .text) 00324 #define SEG_BSS CHOICE(.bss, .bss, .sect .bss) 00325 00326 #ifdef GNU_ASSEMBLER 00327 #define D_SPACE(n) . = . + n 00328 #else 00329 #define D_SPACE(n) .space n 00330 #endif 00331 00332 /* Addressing Modes */ 00333 /* Immediate Mode */ 00334 #define ADDR(a) CHOICE(CONCAT($,a), $a, a) 00335 #define CONST(a) CHOICE(CONCAT($,a), $a, a) 00336 00337 /* Indirect Mode */ 00338 #define CONTENT(a) CHOICE(a, a, (a)) /* take contents of variable */ 00339 #define REGIND(a) CHOICE((a), (a), (a)) /* Register a indirect */ 00340 /* Register b indirect plus displacement a */ 00341 #define REGOFF(a, b) CHOICE(a(b), a(b), a(b)) 00342 /* Reg indirect Base + Index + Displacement - this is mainly for 16-bit mode 00343 * which has no scaling 00344 */ 00345 #define REGBID(b,i,d) CHOICE(d(b,i), d(b,i), d(b)(i)) 00346 /* Reg indirect Base + (Index * Scale) */ 00347 #define REGBIS(b,i,s) CHOICE((b,i,s), (b,i,s), (b)(i*s)) 00348 /* Reg indirect Base + (Index * Scale) + Displacement */ 00349 #define REGBISD(b,i,s,d) CHOICE(d(b,i,s), d(b,i,s), d(b)(i*s)) 00350 /* Displaced Scaled Index: */ 00351 #define REGDIS(d,i,s) CHOICE(d(,i,s), d(,i,s), d(i * s)) 00352 /* Indexed Base: */ 00353 #define REGBI(b,i) CHOICE((b,i), (b,i), (b)(i)) 00354 /* Displaced Base: */ 00355 #define REGDB(d,b) CHOICE(d(b), d(b), d(b)) 00356 /* Variable indirect: */ 00357 #define VARINDIRECT(var) CHOICE(*var, *var, (var)) 00358 /* Use register contents as jump/call target: */ 00359 #define CODEPTR(reg) CHOICE(*reg, *reg, reg) 00360 00361 /* For expressions requiring bracketing 00362 * eg. (CRT0_PM | CRT_EM) 00363 */ 00364 00365 #define EXPR(a) CHOICE([a], (a), [a]) 00366 #define ENOT(a) CHOICE(0!a, ~a, ~a) 00367 #define EMUL(a,b) CHOICE(a\*b, a*b, a*b) 00368 #define EDIV(a,b) CHOICE(a\/b, a/b, a/b) 00369 00370 /* 00371 * We have to beat the problem of commas within arguments to choice. 00372 * eg. choice (add a,b, add b,a) will get argument mismatch. Luckily ANSI 00373 * and other known cpp definitions evaluate arguments before substitution 00374 * so the following works. 00375 */ 00376 #define ARG2(a, b) a,b 00377 #define ARG3(a,b,c) a,b,c 00378 00379 /* Redefine assembler commands */ 00380 #define AAA CHOICE(aaa, aaa, aaa) 00381 #define AAD CHOICE(aad, aad, aad) 00382 #define AAM CHOICE(aam, aam, aam) 00383 #define AAS CHOICE(aas, aas, aas) 00384 #define ADC_L(a, b) CHOICE(adcl ARG2(a,b), adcl ARG2(a,b), _LTOG adc ARG2(b,a)) 00385 #define ADC_W(a, b) CHOICE(adcw ARG2(a,b), adcw ARG2(a,b), _WTOG adc ARG2(b,a)) 00386 #define ADC_B(a, b) CHOICE(adcb ARG2(a,b), adcb ARG2(a,b), adcb ARG2(b,a)) 00387 #define ADD_L(a, b) CHOICE(addl ARG2(a,b), addl ARG2(a,b), _LTOG add ARG2(b,a)) 00388 #define ADD_W(a, b) CHOICE(addw ARG2(a,b), addw ARG2(a,b), _WTOG add ARG2(b,a)) 00389 #define ADD_B(a, b) CHOICE(addb ARG2(a,b), addb ARG2(a,b), addb ARG2(b,a)) 00390 #define AND_L(a, b) CHOICE(andl ARG2(a,b), andl ARG2(a,b), _LTOG and ARG2(b,a)) 00391 #define AND_W(a, b) CHOICE(andw ARG2(a,b), andw ARG2(a,b), _WTOG and ARG2(b,a)) 00392 #define AND_B(a, b) CHOICE(andb ARG2(a,b), andb ARG2(a,b), andb ARG2(b,a)) 00393 #define ARPL(a,b) CHOICE(arpl ARG2(a,b), arpl ARG2(a,b), arpl ARG2(b,a)) 00394 #define BOUND_L(a, b) CHOICE(boundl ARG2(a,b), boundl ARG2(b,a), _LTOG bound ARG2(b,a)) 00395 #define BOUND_W(a, b) CHOICE(boundw ARG2(a,b), boundw ARG2(b,a), _WTOG bound ARG2(b,a)) 00396 #define BSF_L(a, b) CHOICE(bsfl ARG2(a,b), bsfl ARG2(a,b), _LTOG bsf ARG2(b,a)) 00397 #define BSF_W(a, b) CHOICE(bsfw ARG2(a,b), bsfw ARG2(a,b), _WTOG bsf ARG2(b,a)) 00398 #define BSR_L(a, b) CHOICE(bsrl ARG2(a,b), bsrl ARG2(a,b), _LTOG bsr ARG2(b,a)) 00399 #define BSR_W(a, b) CHOICE(bsrw ARG2(a,b), bsrw ARG2(a,b), _WTOG bsr ARG2(b,a)) 00400 #define BT_L(a, b) CHOICE(btl ARG2(a,b), btl ARG2(a,b), _LTOG bt ARG2(b,a)) 00401 #define BT_W(a, b) CHOICE(btw ARG2(a,b), btw ARG2(a,b), _WTOG bt ARG2(b,a)) 00402 #define BTC_L(a, b) CHOICE(btcl ARG2(a,b), btcl ARG2(a,b), _LTOG btc ARG2(b,a)) 00403 #define BTC_W(a, b) CHOICE(btcw ARG2(a,b), btcw ARG2(a,b), _WTOG btc ARG2(b,a)) 00404 #define BTR_L(a, b) CHOICE(btrl ARG2(a,b), btrl ARG2(a,b), _LTOG btr ARG2(b,a)) 00405 #define BTR_W(a, b) CHOICE(btrw ARG2(a,b), btrw ARG2(a,b), _WTOG btr ARG2(b,a)) 00406 #define BTS_L(a, b) CHOICE(btsl ARG2(a,b), btsl ARG2(a,b), _LTOG bts ARG2(b,a)) 00407 #define BTS_W(a, b) CHOICE(btsw ARG2(a,b), btsw ARG2(a,b), _WTOG bts ARG2(b,a)) 00408 #define CALL(a) CHOICE(call a, call a, call a) 00409 #define CALLF(s,a) CHOICE(lcall ARG2(s,a), lcall ARG2(s,a), callf s:a) 00410 #define CBW CHOICE(cbtw, cbw, cbw) 00411 #define CWDE CHOICE(cwtd, cwde, cwde) 00412 #define CLC CHOICE(clc, clc, clc) 00413 #define CLD CHOICE(cld, cld, cld) 00414 #define CLI CHOICE(cli, cli, cli) 00415 #define CLTS CHOICE(clts, clts, clts) 00416 #define CMC CHOICE(cmc, cmc, cmc) 00417 #define CMP_L(a, b) CHOICE(cmpl ARG2(a,b), cmpl ARG2(a,b), _LTOG cmp ARG2(b,a)) 00418 #define CMP_W(a, b) CHOICE(cmpw ARG2(a,b), cmpw ARG2(a,b), _WTOG cmp ARG2(b,a)) 00419 #define CMP_B(a, b) CHOICE(cmpb ARG2(a,b), cmpb ARG2(a,b), cmpb ARG2(b,a)) 00420 #define CMPS_L CHOICE(cmpsl, cmpsl, _LTOG cmps) 00421 #define CMPS_W CHOICE(cmpsw, cmpsw, _WTOG cmps) 00422 #define CMPS_B CHOICE(cmpsb, cmpsb, cmpsb) 00423 #define CWD CHOICE(cwtl, cwd, cwd) 00424 #define CDQ CHOICE(cltd, cdq, cdq) 00425 #define DAA CHOICE(daa, daa, daa) 00426 #define DAS CHOICE(das, das, das) 00427 #define DEC_L(a) CHOICE(decl a, decl a, _LTOG dec a) 00428 #define DEC_W(a) CHOICE(decw a, decw a, _WTOG dec a) 00429 #define DEC_B(a) CHOICE(decb a, decb a, decb a) 00430 #define DIV_L(a) CHOICE(divl a, divl a, div a) 00431 #define DIV_W(a) CHOICE(divw a, divw a, div a) 00432 #define DIV_B(a) CHOICE(divb a, divb a, divb a) 00433 #define ENTER(a,b) CHOICE(enter ARG2(a,b), enter ARG2(a,b), enter ARG2(b,a)) 00434 #define HLT CHOICE(hlt, hlt, hlt) 00435 #define IDIV_L(a) CHOICE(idivl a, idivl a, _LTOG idiv a) 00436 #define IDIV_W(a) CHOICE(idivw a, idivw a, _WTOG idiv a) 00437 #define IDIV_B(a) CHOICE(idivb a, idivb a, idivb a) 00438 /* More forms than this for imul!! */ 00439 #define IMUL_L(a, b) CHOICE(imull ARG2(a,b), imull ARG2(a,b), _LTOG imul ARG2(b,a)) 00440 #define IMUL_W(a, b) CHOICE(imulw ARG2(a,b), imulw ARG2(a,b), _WTOG imul ARG2(b,a)) 00441 #define IMUL_B(a) CHOICE(imulb a, imulb a, imulb a) 00442 #define IN_L CHOICE(inl (DX), inl ARG2(DX,EAX), _LTOG in DX) 00443 #define IN_W CHOICE(inw (DX), inw ARG2(DX,AX), _WTOG in DX) 00444 #define IN_B CHOICE(inb (DX), inb ARG2(DX,AL), inb DX) 00445 /* Please AS code writer: use the following ONLY, if you refer to ports<256 00446 * directly, but not in IN1_W(DX), for instance, even if IN1_ looks nicer 00447 */ 00448 #if defined (sun) 00449 #define IN1_L(a) CHOICE(inl (a), inl ARG2(a,EAX), _LTOG in a) 00450 #define IN1_W(a) CHOICE(inw (a), inw ARG2(a,AX), _WTOG in a) 00451 #define IN1_B(a) CHOICE(inb (a), inb ARG2(a,AL), inb a) 00452 #else 00453 #define IN1_L(a) CHOICE(inl a, inl ARG2(a,EAX), _LTOG in a) 00454 #define IN1_W(a) CHOICE(inw a, inw ARG2(a,AX), _WTOG in a) 00455 #define IN1_B(a) CHOICE(inb a, inb ARG2(a,AL), inb a) 00456 #endif 00457 #define INC_L(a) CHOICE(incl a, incl a, _LTOG inc a) 00458 #define INC_W(a) CHOICE(incw a, incw a, _WTOG inc a) 00459 #define INC_B(a) CHOICE(incb a, incb a, incb a) 00460 #define INS_L CHOICE(insl, insl, _LTOG ins) 00461 #define INS_W CHOICE(insw, insw, _WTOG ins) 00462 #define INS_B CHOICE(insb, insb, insb) 00463 #define INT(a) CHOICE(int a, int a, int a) 00464 #define INT3 CHOICE(int CONST(3), int3, int CONST(3)) 00465 #define INTO CHOICE(into, into, into) 00466 #define IRET CHOICE(iret, iret, iret) 00467 #define IRETD CHOICE(iret, iret, iretd) 00468 #define JA(a) CHOICE(ja a, ja a, ja a) 00469 #define JAE(a) CHOICE(jae a, jae a, jae a) 00470 #define JB(a) CHOICE(jb a, jb a, jb a) 00471 #define JBE(a) CHOICE(jbe a, jbe a, jbe a) 00472 #define JC(a) CHOICE(jc a, jc a, jc a) 00473 #define JE(a) CHOICE(je a, je a, je a) 00474 #define JG(a) CHOICE(jg a, jg a, jg a) 00475 #define JGE(a) CHOICE(jge a, jge a, jge a) 00476 #define JL(a) CHOICE(jl a, jl a, jl a) 00477 #define JLE(a) CHOICE(jle a, jle a, jle a) 00478 #define JNA(a) CHOICE(jna a, jna a, jna a) 00479 #define JNAE(a) CHOICE(jnae a, jnae a, jnae a) 00480 #define JNB(a) CHOICE(jnb a, jnb a, jnb a) 00481 #define JNBE(a) CHOICE(jnbe a, jnbe a, jnbe a) 00482 #define JNC(a) CHOICE(jnc a, jnc a, jnc a) 00483 #define JNE(a) CHOICE(jne a, jne a, jne a) 00484 #define JNG(a) CHOICE(jng a, jng a, jng a) 00485 #define JNGE(a) CHOICE(jnge a, jnge a, jnge a) 00486 #define JNL(a) CHOICE(jnl a, jnl a, jnl a) 00487 #define JNLE(a) CHOICE(jnle a, jnle a, jnle a) 00488 #define JNO(a) CHOICE(jno a, jno a, jno a) 00489 #define JNP(a) CHOICE(jnp a, jnp a, jnp a) 00490 #define JNS(a) CHOICE(jns a, jns a, jns a) 00491 #define JNZ(a) CHOICE(jnz a, jnz a, jnz a) 00492 #define JO(a) CHOICE(jo a, jo a, jo a) 00493 #define JP(a) CHOICE(jp a, jp a, jp a) 00494 #define JPE(a) CHOICE(jpe a, jpe a, jpe a) 00495 #define JPO(a) CHOICE(jpo a, jpo a, jpo a) 00496 #define JS(a) CHOICE(js a, js a, js a) 00497 #define JZ(a) CHOICE(jz a, jz a, jz a) 00498 #define JMP(a) CHOICE(jmp a, jmp a, jmp a) 00499 #define JMPF(s,a) CHOICE(ljmp ARG2(s,a), ljmp ARG2(s,a), jmpf s:a) 00500 #define LAHF CHOICE(lahf, lahf, lahf) 00501 #if !defined(_REAL_MODE) && !defined(_V86_MODE) 00502 #define LAR(a, b) CHOICE(lar ARG2(a, b), lar ARG2(a, b), lar ARG2(b, a)) 00503 #endif 00504 #define LEA_L(a, b) CHOICE(leal ARG2(a,b), leal ARG2(a,b), _LTOG lea ARG2(b,a)) 00505 #define LEA_W(a, b) CHOICE(leaw ARG2(a,b), leaw ARG2(a,b), _WTOG lea ARG2(b,a)) 00506 #define LEAVE CHOICE(leave, leave, leave) 00507 #define LGDT(a) CHOICE(lgdt a, lgdt a, lgdt a) 00508 #define LIDT(a) CHOICE(lidt a, lidt a, lidt a) 00509 #define LDS(a, b) CHOICE(ldsl ARG2(a,b), lds ARG2(a,b), lds ARG2(b,a)) 00510 #define LES(a, b) CHOICE(lesl ARG2(a,b), les ARG2(a,b), les ARG2(b,a)) 00511 #define LFS(a, b) CHOICE(lfsl ARG2(a,b), lfs ARG2(a,b), lfs ARG2(b,a)) 00512 #define LGS(a, b) CHOICE(lgsl ARG2(a,b), lgs ARG2(a,b), lgs ARG2(b,a)) 00513 #define LSS(a, b) CHOICE(lssl ARG2(a,b), lss ARG2(a,b), lss ARG2(b,a)) 00514 #define LLDT(a) CHOICE(lldt a, lldt a, lldt a) 00515 #define LMSW(a) CHOICE(lmsw a, lmsw a, lmsw a) 00516 #define LOCK CHOICE(lock, lock, lock) 00517 #define LODS_L CHOICE(lodsl, lodsl, _LTOG lods) 00518 #define LODS_W CHOICE(lodsw, lodsw, _WTOG lods) 00519 #define LODS_B CHOICE(lodsb, lodsb, lodsb) 00520 #define LOOP(a) CHOICE(loop a, loop a, loop a) 00521 #define LOOPE(a) CHOICE(loope a, loope a, loope a) 00522 #define LOOPZ(a) CHOICE(loopz a, loopz a, loopz a) 00523 #define LOOPNE(a) CHOICE(loopne a, loopne a, loopne a) 00524 #define LOOPNZ(a) CHOICE(loopnz a, loopnz a, loopnz a) 00525 #if !defined(_REAL_MODE) && !defined(_V86_MODE) 00526 #define LSL(a, b) CHOICE(lsl ARG2(a,b), lsl ARG2(a,b), lsl ARG2(b,a)) 00527 #endif 00528 #define LTR(a) CHOICE(ltr a, ltr a, ltr a) 00529 #define MOV_SR(a, b) CHOICE(movw ARG2(a,b), mov ARG2(a,b), mov ARG2(b,a)) 00530 #define MOV_L(a, b) CHOICE(movl ARG2(a,b), movl ARG2(a,b), _LTOG mov ARG2(b,a)) 00531 #define MOV_W(a, b) CHOICE(movw ARG2(a,b), movw ARG2(a,b), _WTOG mov ARG2(b,a)) 00532 #define MOV_B(a, b) CHOICE(movb ARG2(a,b), movb ARG2(a,b), movb ARG2(b,a)) 00533 #define MOVS_L CHOICE(movsl, movsl, _LTOG movs) 00534 #define MOVS_W CHOICE(movsw, movsw, _WTOG movs) 00535 #define MOVS_B CHOICE(movsb, movsb, movsb) 00536 #define MOVSX_BL(a, b) CHOICE(movsbl ARG2(a,b), movsbl ARG2(a,b), movsx ARG2(b,a)) 00537 #define MOVSX_BW(a, b) CHOICE(movsbw ARG2(a,b), movsbw ARG2(a,b), movsx ARG2(b,a)) 00538 #define MOVSX_WL(a, b) CHOICE(movswl ARG2(a,b), movswl ARG2(a,b), movsx ARG2(b,a)) 00539 #define MOVZX_BL(a, b) CHOICE(movzbl ARG2(a,b), movzbl ARG2(a,b), movzx ARG2(b,a)) 00540 #define MOVZX_BW(a, b) CHOICE(movzbw ARG2(a,b), movzbw ARG2(a,b), movzx ARG2(b,a)) 00541 #define MOVZX_WL(a, b) CHOICE(movzwl ARG2(a,b), movzwl ARG2(a,b), movzx ARG2(b,a)) 00542 #define MUL_L(a) CHOICE(mull a, mull a, _LTOG mul a) 00543 #define MUL_W(a) CHOICE(mulw a, mulw a, _WTOG mul a) 00544 #define MUL_B(a) CHOICE(mulb a, mulb a, mulb a) 00545 #define NEG_L(a) CHOICE(negl a, negl a, _LTOG neg a) 00546 #define NEG_W(a) CHOICE(negw a, negw a, _WTOG neg a) 00547 #define NEG_B(a) CHOICE(negb a, negb a, negb a) 00548 #define NOP CHOICE(nop, nop, nop) 00549 #define NOT_L(a) CHOICE(notl a, notl a, _LTOG not a) 00550 #define NOT_W(a) CHOICE(notw a, notw a, _WTOG not a) 00551 #define NOT_B(a) CHOICE(notb a, notb a, notb a) 00552 #define OR_L(a,b) CHOICE(orl ARG2(a,b), orl ARG2(a,b), _LTOG or ARG2(b,a)) 00553 #define OR_W(a,b) CHOICE(orw ARG2(a,b), orw ARG2(a,b), _WTOG or ARG2(b,a)) 00554 #define OR_B(a,b) CHOICE(orb ARG2(a,b), orb ARG2(a,b), orb ARG2(b,a)) 00555 #define OUT_L CHOICE(outl (DX), outl ARG2(EAX,DX), _LTOG out DX) 00556 #define OUT_W CHOICE(outw (DX), outw ARG2(AX,DX), _WTOG out DX) 00557 #define OUT_B CHOICE(outb (DX), outb ARG2(AL,DX), outb DX) 00558 /* Please AS code writer: use the following ONLY, if you refer to ports<256 00559 * directly, but not in OUT1_W(DX), for instance, even if OUT1_ looks nicer 00560 */ 00561 #define OUT1_L(a) CHOICE(outl (a), outl ARG2(EAX,a), _LTOG out a) 00562 #define OUT1_W(a) CHOICE(outw (a), outw ARG2(AX,a), _WTOG out a) 00563 #define OUT1_B(a) CHOICE(outb (a), outb ARG2(AL,a), outb a) 00564 #define OUTS_L CHOICE(outsl, outsl, _LTOG outs) 00565 #define OUTS_W CHOICE(outsw, outsw, _WTOG outs) 00566 #define OUTS_B CHOICE(outsb, outsb, outsb) 00567 #define POP_SR(a) CHOICE(pop a, pop a, pop a) 00568 #define POP_L(a) CHOICE(popl a, popl a, _LTOG pop a) 00569 #define POP_W(a) CHOICE(popw a, popw a, _WTOG pop a) 00570 #define POPA_L CHOICE(popal, popal, _LTOG popa) 00571 #define POPA_W CHOICE(popaw, popaw, _WTOG popa) 00572 #define POPF_L CHOICE(popfl, popfl, _LTOG popf) 00573 #define POPF_W CHOICE(popfw, popfw, _WTOG popf) 00574 #define PUSH_SR(a) CHOICE(push a, push a, push a) 00575 #define PUSH_L(a) CHOICE(pushl a, pushl a, _LTOG push a) 00576 #define PUSH_W(a) CHOICE(pushw a, pushw a, _WTOG push a) 00577 #define PUSH_B(a) CHOICE(push a, pushb a, push a) 00578 #define PUSHA_L CHOICE(pushal, pushal, _LTOG pusha) 00579 #define PUSHA_W CHOICE(pushaw, pushaw, _WTOG pusha) 00580 #define PUSHF_L CHOICE(pushfl, pushfl, _LTOG pushf) 00581 #define PUSHF_W CHOICE(pushfw, pushfw, _WTOG pushf) 00582 #define RCL_L(a, b) CHOICE(rcll ARG2(a,b), rcll ARG2(a,b), _LTOG rcl ARG2(b,a)) 00583 #define RCL_W(a, b) CHOICE(rclw ARG2(a,b), rclw ARG2(a,b), _WTOG rcl ARG2(b,a)) 00584 #define RCL_B(a, b) CHOICE(rclb ARG2(a,b), rclb ARG2(a,b), rclb ARG2(b,a)) 00585 #define RCR_L(a, b) CHOICE(rcrl ARG2(a,b), rcrl ARG2(a,b), _LTOG rcr ARG2(b,a)) 00586 #define RCR_W(a, b) CHOICE(rcrw ARG2(a,b), rcrw ARG2(a,b), _WTOG rcr ARG2(b,a)) 00587 #define RCR_B(a, b) CHOICE(rcrb ARG2(a,b), rcrb ARG2(a,b), rcrb ARG2(b,a)) 00588 #define ROL_L(a, b) CHOICE(roll ARG2(a,b), roll ARG2(a,b), _LTOG rol ARG2(b,a)) 00589 #define ROL_W(a, b) CHOICE(rolw ARG2(a,b), rolw ARG2(a,b), _WTOG rol ARG2(b,a)) 00590 #define ROL_B(a, b) CHOICE(rolb ARG2(a,b), rolb ARG2(a,b), rolb ARG2(b,a)) 00591 #define ROR_L(a, b) CHOICE(rorl ARG2(a,b), rorl ARG2(a,b), _LTOG ror ARG2(b,a)) 00592 #define ROR_W(a, b) CHOICE(rorw ARG2(a,b), rorw ARG2(a,b), _WTOG ror ARG2(b,a)) 00593 #define ROR_B(a, b) CHOICE(rorb ARG2(a,b), rorb ARG2(a,b), rorb ARG2(b,a)) 00594 #define REP CHOICE(rep ;, rep ;, repe) 00595 #define REPE CHOICE(repz ;, repe ;, repe) 00596 #define REPNE CHOICE(repnz ;, repne ;, repne) 00597 #define REPNZ REPNE 00598 #define REPZ REPE 00599 #define RET CHOICE(ret, ret, ret) 00600 #define SAHF CHOICE(sahf, sahf, sahf) 00601 #define SAL_L(a, b) CHOICE(sall ARG2(a,b), sall ARG2(a,b), _LTOG sal ARG2(b,a)) 00602 #define SAL_W(a, b) CHOICE(salw ARG2(a,b), salw ARG2(a,b), _WTOG sal ARG2(b,a)) 00603 #define SAL_B(a, b) CHOICE(salb ARG2(a,b), salb ARG2(a,b), salb ARG2(b,a)) 00604 #define SAR_L(a, b) CHOICE(sarl ARG2(a,b), sarl ARG2(a,b), _LTOG sar ARG2(b,a)) 00605 #define SAR_W(a, b) CHOICE(sarw ARG2(a,b), sarw ARG2(a,b), _WTOG sar ARG2(b,a)) 00606 #define SAR_B(a, b) CHOICE(sarb ARG2(a,b), sarb ARG2(a,b), sarb ARG2(b,a)) 00607 #define SBB_L(a, b) CHOICE(sbbl ARG2(a,b), sbbl ARG2(a,b), _LTOG sbb ARG2(b,a)) 00608 #define SBB_W(a, b) CHOICE(sbbw ARG2(a,b), sbbw ARG2(a,b), _WTOG sbb ARG2(b,a)) 00609 #define SBB_B(a, b) CHOICE(sbbb ARG2(a,b), sbbb ARG2(a,b), sbbb ARG2(b,a)) 00610 #define SCAS_L CHOICE(scasl, scasl, _LTOG scas) 00611 #define SCAS_W CHOICE(scasw, scasw, _WTOG scas) 00612 #define SCAS_B CHOICE(scasb, scasb, scasb) 00613 #define SETA(a) CHOICE(seta a, seta a, seta a) 00614 #define SETAE(a) CHOICE(setae a, setae a, setae a) 00615 #define SETB(a) CHOICE(setb a, setb a, setb a) 00616 #define SETBE(a) CHOICE(setbe a, setbe a, setbe a) 00617 #define SETC(a) CHOICE(setc a, setb a, setb a) 00618 #define SETE(a) CHOICE(sete a, sete a, sete a) 00619 #define SETG(a) CHOICE(setg a, setg a, setg a) 00620 #define SETGE(a) CHOICE(setge a, setge a, setge a) 00621 #define SETL(a) CHOICE(setl a, setl a, setl a) 00622 #define SETLE(a) CHOICE(setle a, setle a, setle a) 00623 #define SETNA(a) CHOICE(setna a, setna a, setna a) 00624 #define SETNAE(a) CHOICE(setnae a, setnae a, setnae a) 00625 #define SETNB(a) CHOICE(setnb a, setnb a, setnb a) 00626 #define SETNBE(a) CHOICE(setnbe a, setnbe a, setnbe a) 00627 #define SETNC(a) CHOICE(setnc a, setnb a, setnb a) 00628 #define SETNE(a) CHOICE(setne a, setne a, setne a) 00629 #define SETNG(a) CHOICE(setng a, setng a, setng a) 00630 #define SETNGE(a) CHOICE(setnge a, setnge a, setnge a) 00631 #define SETNL(a) CHOICE(setnl a, setnl a, setnl a) 00632 #define SETNLE(a) CHOICE(setnle a, setnle a, setnle a) 00633 #define SETNO(a) CHOICE(setno a, setno a, setno a) 00634 #define SETNP(a) CHOICE(setnp a, setnp a, setnp a) 00635 #define SETNS(a) CHOICE(setns a, setns a, setna a) 00636 #define SETNZ(a) CHOICE(setnz a, setnz a, setnz a) 00637 #define SETO(a) CHOICE(seto a, seto a, seto a) 00638 #define SETP(a) CHOICE(setp a, setp a, setp a) 00639 #define SETPE(a) CHOICE(setpe a, setpe a, setpe a) 00640 #define SETPO(a) CHOICE(setpo a, setpo a, setpo a) 00641 #define SETS(a) CHOICE(sets a, sets a, seta a) 00642 #define SETZ(a) CHOICE(setz a, setz a, setz a) 00643 #define SGDT(a) CHOICE(sgdt a, sgdt a, sgdt a) 00644 #define SIDT(a) CHOICE(sidt a, sidt a, sidt a) 00645 #define SHL_L(a, b) CHOICE(shll ARG2(a,b), shll ARG2(a,b), _LTOG shl ARG2(b,a)) 00646 #define SHL_W(a, b) CHOICE(shlw ARG2(a,b), shlw ARG2(a,b), _WTOG shl ARG2(b,a)) 00647 #define SHL_B(a, b) CHOICE(shlb ARG2(a,b), shlb ARG2(a,b), shlb ARG2(b,a)) 00648 #define SHLD_L(a,b,c) CHOICE(shldl ARG3(a,b,c), shldl ARG3(a,b,c), _LTOG shld ARG3(c,b,a)) 00649 #define SHLD2_L(a,b) CHOICE(shldl ARG2(a,b), shldl ARG3(CL,a,b), _LTOG shld ARG3(b,a,CL)) 00650 #define SHLD_W(a,b,c) CHOICE(shldw ARG3(a,b,c), shldw ARG3(a,b,c), _WTOG shld ARG3(c,b,a)) 00651 #define SHLD2_W(a,b) CHOICE(shldw ARG2(a,b), shldw ARG3(CL,a,b), _WTOG shld ARG3(b,a,CL)) 00652 #define SHR_L(a, b) CHOICE(shrl ARG2(a,b), shrl ARG2(a,b), _LTOG shr ARG2(b,a)) 00653 #define SHR_W(a, b) CHOICE(shrw ARG2(a,b), shrw ARG2(a,b), _WTOG shr ARG2(b,a)) 00654 #define SHR_B(a, b) CHOICE(shrb ARG2(a,b), shrb ARG2(a,b), shrb ARG2(b,a)) 00655 #define SHRD_L(a,b,c) CHOICE(shrdl ARG3(a,b,c), shrdl ARG3(a,b,c), _LTOG shrd ARG3(c,b,a)) 00656 #define SHRD2_L(a,b) CHOICE(shrdl ARG2(a,b), shrdl ARG3(CL,a,b), _LTOG shrd ARG3(b,a,CL)) 00657 #define SHRD_W(a,b,c) CHOICE(shrdw ARG3(a,b,c), shrdw ARG3(a,b,c), _WTOG shrd ARG3(c,b,a)) 00658 #define SHRD2_W(a,b) CHOICE(shrdw ARG2(a,b), shrdw ARG3(CL,a,b), _WTOG shrd ARG3(b,a,CL)) 00659 #define SLDT(a) CHOICE(sldt a, sldt a, sldt a) 00660 #define SMSW(a) CHOICE(smsw a, smsw a, smsw a) 00661 #define STC CHOICE(stc, stc, stc) 00662 #define STD CHOICE(std, std, std) 00663 #define STI CHOICE(sti, sti, sti) 00664 #define STOS_L CHOICE(stosl, stosl, _LTOG stos) 00665 #define STOS_W CHOICE(stosw, stosw, _WTOG stos) 00666 #define STOS_B CHOICE(stosb, stosb, stosb) 00667 #define STR(a) CHOICE(str a, str a, str a) 00668 #define SUB_L(a, b) CHOICE(subl ARG2(a,b), subl ARG2(a,b), _LTOG sub ARG2(b,a)) 00669 #define SUB_W(a, b) CHOICE(subw ARG2(a,b), subw ARG2(a,b), _WTOG sub ARG2(b,a)) 00670 #define SUB_B(a, b) CHOICE(subb ARG2(a,b), subb ARG2(a,b), subb ARG2(b,a)) 00671 #define TEST_L(a, b) CHOICE(testl ARG2(a,b), testl ARG2(a,b), _LTOG test ARG2(b,a)) 00672 #define TEST_W(a, b) CHOICE(testw ARG2(a,b), testw ARG2(a,b), _WTOG test ARG2(b,a)) 00673 #define TEST_B(a, b) CHOICE(testb ARG2(a,b), testb ARG2(a,b), testb ARG2(b,a)) 00674 #define VERR(a) CHOICE(verr a, verr a, verr a) 00675 #define VERW(a) CHOICE(verw a, verw a, verw a) 00676 #define WAIT CHOICE(wait, wait, wait) 00677 #define XCHG_L(a, b) CHOICE(xchgl ARG2(a,b), xchgl ARG2(a,b), _LTOG xchg ARG2(b,a)) 00678 #define XCHG_W(a, b) CHOICE(xchgw ARG2(a,b), xchgw ARG2(a,b), _WTOG xchg ARG2(b,a)) 00679 #define XCHG_B(a, b) CHOICE(xchgb ARG2(a,b), xchgb ARG2(a,b), xchgb ARG2(b,a)) 00680 #define XLAT CHOICE(xlat, xlat, xlat) 00681 #define XOR_L(a, b) CHOICE(xorl ARG2(a,b), xorl ARG2(a,b), _LTOG xor ARG2(b,a)) 00682 #define XOR_W(a, b) CHOICE(xorw ARG2(a,b), xorw ARG2(a,b), _WTOG xor ARG2(b,a)) 00683 #define XOR_B(a, b) CHOICE(xorb ARG2(a,b), xorb ARG2(a,b), xorb ARG2(b,a)) 00684 00685 00686 /* Floating Point Instructions */ 00687 #define F2XM1 CHOICE(f2xm1, f2xm1, f2xm1) 00688 #define FABS CHOICE(fabs, fabs, fabs) 00689 #define FADD_D(a) CHOICE(faddl a, faddl a, faddd a) 00690 #define FADD_S(a) CHOICE(fadds a, fadds a, fadds a) 00691 #define FADD2(a, b) CHOICE(fadd ARG2(a,b), fadd ARG2(a,b), fadd ARG2(b,a)) 00692 #define FADDP(a, b) CHOICE(faddp ARG2(a,b), faddp ARG2(a,b), faddp ARG2(b,a)) 00693 #define FIADD_L(a) CHOICE(fiaddl a, fiaddl a, fiaddl a) 00694 #define FIADD_W(a) CHOICE(fiadd a, fiadds a, fiadds a) 00695 #define FBLD(a) CHOICE(fbld a, fbld a, fbld a) 00696 #define FBSTP(a) CHOICE(fbstp a, fbstp a, fbstp a) 00697 #define FCHS CHOICE(fchs, fchs, fchs) 00698 #define FCLEX CHOICE(fclex, wait; fnclex, wait; fclex) 00699 #define FNCLEX CHOICE(fnclex, fnclex, fclex) 00700 #define FCOM(a) CHOICE(fcom a, fcom a, fcom a) 00701 #define FCOM_D(a) CHOICE(fcoml a, fcoml a, fcomd a) 00702 #define FCOM_S(a) CHOICE(fcoms a, fcoms a, fcoms a) 00703 #define FCOMP(a) CHOICE(fcomp a, fcomp a, fcomp a) 00704 #define FCOMP_D(a) CHOICE(fcompl a, fcompl a, fcompd a) 00705 #define FCOMP_S(a) CHOICE(fcomps a, fcomps a, fcomps a) 00706 #define FCOMPP CHOICE(fcompp, fcompp, fcompp) 00707 #define FCOS CHOICE(fcos, fcos, fcos) 00708 #define FDECSTP CHOICE(fdecstp, fdecstp, fdecstp) 00709 #define FDIV_D(a) CHOICE(fdivl a, fdivl a, fdivd a) 00710 #define FDIV_S(a) CHOICE(fdivs a, fdivs a, fdivs a) 00711 #define FDIV2(a, b) CHOICE(fdiv ARG2(a,b), fdiv ARG2(a,b), fdiv ARG2(b,a)) 00712 #define FDIVP(a, b) CHOICE(fdivp ARG2(a,b), fdivp ARG2(a,b), fdivp ARG2(b,a)) 00713 #define FIDIV_L(a) CHOICE(fidivl a, fidivl a, fidivl a) 00714 #define FIDIV_W(a) CHOICE(fidiv a, fidivs a, fidivs a) 00715 #define FDIVR_D(a) CHOICE(fdivrl a, fdivrl a, fdivrd a) 00716 #define FDIVR_S(a) CHOICE(fdivrs a, fdivrs a, fdivrs a) 00717 #define FDIVR2(a, b) CHOICE(fdivr ARG2(a,b), fdivr ARG2(a,b), fdivr ARG2(b,a)) 00718 #define FDIVRP(a, b) CHOICE(fdivrp ARG2(a,b), fdivrp ARG2(a,b), fdivrp ARG2(b,a)) 00719 #define FIDIVR_L(a) CHOICE(fidivrl a, fidivrl a, fidivrl a) 00720 #define FIDIVR_W(a) CHOICE(fidivr a, fidivrs a, fidivrs a) 00721 #define FFREE(a) CHOICE(ffree a, ffree a, ffree a) 00722 #define FICOM_L(a) CHOICE(ficoml a, ficoml a, ficoml a) 00723 #define FICOM_W(a) CHOICE(ficom a, ficoms a, ficoms a) 00724 #define FICOMP_L(a) CHOICE(ficompl a, ficompl a, ficompl a) 00725 #define FICOMP_W(a) CHOICE(ficomp a, ficomps a, ficomps a) 00726 #define FILD_Q(a) CHOICE(fildll a, fildq a, fildq a) 00727 #define FILD_L(a) CHOICE(fildl a, fildl a, fildl a) 00728 #define FILD_W(a) CHOICE(fild a, filds a, filds a) 00729 #define FINCSTP CHOICE(fincstp, fincstp, fincstp) 00730 #define FINIT CHOICE(finit, wait; fninit, wait; finit) 00731 #define FNINIT CHOICE(fninit, fninit, finit) 00732 #define FIST_L(a) CHOICE(fistl a, fistl a, fistl a) 00733 #define FIST_W(a) CHOICE(fist a, fists a, fists a) 00734 #define FISTP_Q(a) CHOICE(fistpll a, fistpq a, fistpq a) 00735 #define FISTP_L(a) CHOICE(fistpl a, fistpl a, fistpl a) 00736 #define FISTP_W(a) CHOICE(fistp a, fistps a, fistps a) 00737 #define FLD_X(a) CHOICE(fldt a, fldt a, fldx a) /* 80 bit data type! */ 00738 #define FLD_D(a) CHOICE(fldl a, fldl a, fldd a) 00739 #define FLD_S(a) CHOICE(flds a, flds a, flds a) 00740 #define FLD1 CHOICE(fld1, fld1, fld1) 00741 #define FLDL2T CHOICE(fldl2t, fldl2t, fldl2t) 00742 #define FLDL2E CHOICE(fldl2e, fldl2e, fldl2e) 00743 #define FLDPI CHOICE(fldpi, fldpi, fldpi) 00744 #define FLDLG2 CHOICE(fldlg2, fldlg2, fldlg2) 00745 #define FLDLN2 CHOICE(fldln2, fldln2, fldln2) 00746 #define FLDZ CHOICE(fldz, fldz, fldz) 00747 #define FLDCW(a) CHOICE(fldcw a, fldcw a, fldcw a) 00748 #define FLDENV(a) CHOICE(fldenv a, fldenv a, fldenv a) 00749 #define FMUL_S(a) CHOICE(fmuls a, fmuls a, fmuls a) 00750 #define FMUL_D(a) CHOICE(fmull a, fmull a, fmuld a) 00751 #define FMUL2(a, b) CHOICE(fmul ARG2(a,b), fmul ARG2(a,b), fmul ARG2(b,a)) 00752 #define FMULP(a, b) CHOICE(fmulp ARG2(a,b), fmulp ARG2(a,b), fmulp ARG2(b,a)) 00753 #define FIMUL_L(a) CHOICE(fimull a, fimull a, fimull a) 00754 #define FIMUL_W(a) CHOICE(fimul a, fimuls a, fimuls a) 00755 #define FNOP CHOICE(fnop, fnop, fnop) 00756 #define FPATAN CHOICE(fpatan, fpatan, fpatan) 00757 #define FPREM CHOICE(fprem, fprem, fprem) 00758 #define FPREM1 CHOICE(fprem1, fprem1, fprem1) 00759 #define FPTAN CHOICE(fptan, fptan, fptan) 00760 #define FRNDINT CHOICE(frndint, frndint, frndint) 00761 #define FRSTOR(a) CHOICE(frstor a, frstor a, frstor a) 00762 #define FSAVE(a) CHOICE(fsave a, wait; fnsave a, wait; fsave a) 00763 #define FNSAVE(a) CHOICE(fnsave a, fnsave a, fsave a) 00764 #define FSCALE CHOICE(fscale, fscale, fscale) 00765 #define FSIN CHOICE(fsin, fsin, fsin) 00766 #define FSINCOS CHOICE(fsincos, fsincos, fsincos) 00767 #define FSQRT CHOICE(fsqrt, fsqrt, fsqrt) 00768 #define FST_D(a) CHOICE(fstl a, fstl a, fstd a) 00769 #define FST_S(a) CHOICE(fsts a, fsts a, fsts a) 00770 #define FSTP_X(a) CHOICE(fstpt a, fstpt a, fstpx a) 00771 #define FSTP_D(a) CHOICE(fstpl a, fstpl a, fstpd a) 00772 #define FSTP_S(a) CHOICE(fstps a, fstps a, fstps a) 00773 #define FSTP(a) CHOICE(fstp a, fstp a, fstp a) 00774 #define FSTCW(a) CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a) 00775 #define FNSTCW(a) CHOICE(fnstcw a, fnstcw a, fstcw a) 00776 #define FSTENV(a) CHOICE(fstenv a, wait; fnstenv a, fstenv a) 00777 #define FNSTENV(a) CHOICE(fnstenv a, fnstenv a, fstenv a) 00778 #define FSTSW(a) CHOICE(fstsw a, wait; fnstsw a, wait; fstsw a) 00779 #define FNSTSW(a) CHOICE(fnstsw a, fnstsw a, fstsw a) 00780 #define FSUB_S(a) CHOICE(fsubs a, fsubs a, fsubs a) 00781 #define FSUB_D(a) CHOICE(fsubl a, fsubl a, fsubd a) 00782 #define FSUB2(a, b) CHOICE(fsub ARG2(a,b), fsub ARG2(a,b), fsub ARG2(b,a)) 00783 #define FSUBP(a, b) CHOICE(fsubp ARG2(a,b), fsubp ARG2(a,b), fsubp ARG2(b,a)) 00784 #define FISUB_L(a) CHOICE(fisubl a, fisubl a, fisubl a) 00785 #define FISUB_W(a) CHOICE(fisub a, fisubs a, fisubs a) 00786 #define FSUBR_S(a) CHOICE(fsubrs a, fsubrs a, fsubrs a) 00787 #define FSUBR_D(a) CHOICE(fsubrl a, fsubrl a, fsubrd a) 00788 #define FSUBR2(a, b) CHOICE(fsubr ARG2(a,b), fsubr ARG2(a,b), fsubr ARG2(b,a)) 00789 #define FSUBRP(a, b) CHOICE(fsubrp ARG2(a,b), fsubrp ARG2(a,b), fsubrp ARG2(b,a)) 00790 #define FISUBR_L(a) CHOICE(fisubrl a, fisubrl a, fisubrl a) 00791 #define FISUBR_W(a) CHOICE(fisubr a, fisubrs a, fisubrs a) 00792 #define FTST CHOICE(ftst, ftst, ftst) 00793 #define FUCOM(a) CHOICE(fucom a, fucom a, fucom a) 00794 #define FUCOMP(a) CHOICE(fucomp a, fucomp a, fucomp a) 00795 #define FUCOMPP CHOICE(fucompp, fucompp, fucompp) 00796 #define FWAIT CHOICE(wait, wait, wait) 00797 #define FXAM CHOICE(fxam, fxam, fxam) 00798 #define FXCH(a) CHOICE(fxch a, fxch a, fxch a) 00799 #define FXTRACT CHOICE(fxtract, fxtract, fxtract) 00800 #define FYL2X CHOICE(fyl2x, fyl2x, fyl2x) 00801 #define FYL2XP1 CHOICE(fyl2xp1, fyl2xp1, fyl2xp1) 00802 00803 /* New instructions */ 00804 #define CPUID CHOICE(D_BYTE ARG2(15, 162), cpuid, D_BYTE ARG2(15, 162)) 00805 #define RDTSC CHOICE(D_BYTE ARG2(15, 49), rdtsc, D_BYTE ARG2(15, 49)) 00806 00807 #else /* NASM_ASSEMBLER || MASM_ASSEMBLER is defined */ 00808 00809 /****************************************/ 00810 /* */ 00811 /* Intel style assemblers. */ 00812 /* (NASM and MASM) */ 00813 /* */ 00814 /****************************************/ 00815 00816 #define P_EAX EAX 00817 #define L_EAX EAX 00818 #define W_AX AX 00819 #define B_AH AH 00820 #define B_AL AL 00821 00822 #define P_EBX EBX 00823 #define L_EBX EBX 00824 #define W_BX BX 00825 #define B_BH BH 00826 #define B_BL BL 00827 00828 #define P_ECX ECX 00829 #define L_ECX ECX 00830 #define W_CX CX 00831 #define B_CH CH 00832 #define B_CL CL 00833 00834 #define P_EDX EDX 00835 #define L_EDX EDX 00836 #define W_DX DX 00837 #define B_DH DH 00838 #define B_DL DL 00839 00840 #define P_EBP EBP 00841 #define L_EBP EBP 00842 #define W_BP BP 00843 00844 #define P_ESI ESI 00845 #define L_ESI ESI 00846 #define W_SI SI 00847 00848 #define P_EDI EDI 00849 #define L_EDI EDI 00850 #define W_DI DI 00851 00852 #define P_ESP ESP 00853 #define L_ESP ESP 00854 #define W_SP SP 00855 00856 #define W_CS CS 00857 #define W_SS SS 00858 #define W_DS DS 00859 #define W_ES ES 00860 #define W_FS FS 00861 #define W_GS GS 00862 00863 #define X_ST ST 00864 #define D_ST ST 00865 #define L_ST ST 00866 00867 #define P_MM0 mm0 00868 #define P_MM1 mm1 00869 #define P_MM2 mm2 00870 #define P_MM3 mm3 00871 #define P_MM4 mm4 00872 #define P_MM5 mm5 00873 #define P_MM6 mm6 00874 #define P_MM7 mm7 00875 00876 #define P_XMM0 xmm0 00877 #define P_XMM1 xmm1 00878 #define P_XMM2 xmm2 00879 #define P_XMM3 xmm3 00880 #define P_XMM4 xmm4 00881 #define P_XMM5 xmm5 00882 #define P_XMM6 xmm6 00883 #define P_XMM7 xmm7 00884 00885 #define CONCAT(x, y) x ## y 00886 #define CONCAT3(x, y, z) x ## y ## z 00887 00888 #if defined(NASM_ASSEMBLER) 00889 00890 #define ST(n) st ## n 00891 #define ST0 st0 00892 00893 #define TBYTE_PTR tword 00894 #define QWORD_PTR qword 00895 #define DWORD_PTR dword 00896 #define WORD_PTR word 00897 #define BYTE_PTR byte 00898 00899 #define OFFSET 00900 00901 #define GLOBL GLOBAL 00902 #define ALIGNTEXT32 ALIGN 32 00903 #define ALIGNTEXT16 ALIGN 16 00904 #define ALIGNTEXT8 ALIGN 8 00905 #define ALIGNTEXT4 ALIGN 4 00906 #define ALIGNTEXT2 ALIGN 2 00907 #define ALIGNTEXT32ifNOP ALIGN 32 00908 #define ALIGNTEXT16ifNOP ALIGN 16 00909 #define ALIGNTEXT8ifNOP ALIGN 8 00910 #define ALIGNTEXT4ifNOP ALIGN 4 00911 #define ALIGNDATA32 ALIGN 32 00912 #define ALIGNDATA16 ALIGN 16 00913 #define ALIGNDATA8 ALIGN 8 00914 #define ALIGNDATA4 ALIGN 4 00915 #define ALIGNDATA2 ALIGN 2 00916 #define FILE(s) 00917 #define STRING(s) db s 00918 #define D_LONG dd 00919 #define D_WORD dw 00920 #define D_BYTE db 00921 /* #define SPACE */ 00922 /* #define COMM */ 00923 #if defined(__WATCOMC__) 00924 SECTION _TEXT public align=16 class=CODE use32 flat 00925 SECTION _DATA public align=16 class=DATA use32 flat 00926 #define SEG_TEXT SECTION _TEXT 00927 #define SEG_DATA SECTION _DATA 00928 #define SEG_BSS SECTION .bss 00929 #else 00930 #define SEG_DATA SECTION .data 00931 #define SEG_TEXT SECTION .text 00932 #define SEG_BSS SECTION .bss 00933 #endif 00934 00935 #define D_SPACE(n) db n REP 0 00936 00937 #define AS_BEGIN 00938 00939 /* Jcc's should be handled better than this... */ 00940 #define NEAR near 00941 00942 #else /* MASM */ 00943 00944 #define TBYTE_PTR tbyte ptr 00945 #define QWORD_PTR qword ptr 00946 #define DWORD_PTR dword ptr 00947 #define WORD_PTR word ptr 00948 #define BYTE_PTR byte ptr 00949 00950 #define OFFSET offset 00951 00952 #define GLOBL GLOBAL 00953 #define ALIGNTEXT32 ALIGN 32 00954 #define ALIGNTEXT16 ALIGN 16 00955 #define ALIGNTEXT8 ALIGN 8 00956 #define ALIGNTEXT4 ALIGN 4 00957 #define ALIGNTEXT2 ALIGN 2 00958 #define ALIGNTEXT32ifNOP ALIGN 32 00959 #define ALIGNTEXT16ifNOP ALIGN 16 00960 #define ALIGNTEXT8ifNOP ALIGN 8 00961 #define ALIGNTEXT4ifNOP ALIGN 4 00962 #define ALIGNDATA32 ALIGN 32 00963 #define ALIGNDATA16 ALIGN 16 00964 #define ALIGNDATA8 ALIGN 8 00965 #define ALIGNDATA4 ALIGN 4 00966 #define ALIGNDATA2 ALIGN 2 00967 #define FILE(s) 00968 #define STRING(s) db s 00969 #define D_LONG dd 00970 #define D_WORD dw 00971 #define D_BYTE db 00972 /* #define SPACE */ 00973 /* #define COMM */ 00974 #define SEG_DATA .DATA 00975 #define SEG_TEXT .CODE 00976 #define SEG_BSS .DATA 00977 00978 #define D_SPACE(n) db n REP 0 00979 00980 #define AS_BEGIN 00981 00982 #define NEAR 00983 00984 #endif 00985 00986 #if defined(Lynx) || (defined(SYSV) || defined(SVR4)) \ 00987 || (defined(__linux__) || defined(__OS2ELF__)) && defined(__ELF__) \ 00988 || (defined(__FreeBSD__) && __FreeBSD__ >= 3) \ 00989 || (defined(__NetBSD__) && defined(__ELF__)) 00990 #define GLNAME(a) a 00991 #else 00992 #define GLNAME(a) CONCAT(_, a) 00993 #endif 00994 00995 /* 00996 * Addressing Modes 00997 */ 00998 00999 /* Immediate Mode */ 01000 #define P_ADDR(a) OFFSET a 01001 #define X_ADDR(a) OFFSET a 01002 #define D_ADDR(a) OFFSET a 01003 #define L_ADDR(a) OFFSET a 01004 #define W_ADDR(a) OFFSET a 01005 #define B_ADDR(a) OFFSET a 01006 01007 #define P_CONST(a) a 01008 #define X_CONST(a) a 01009 #define D_CONST(a) a 01010 #define L_CONST(a) a 01011 #define W_CONST(a) a 01012 #define B_CONST(a) a 01013 01014 /* Indirect Mode */ 01015 #ifdef NASM_ASSEMBLER 01016 #define P_CONTENT(a) [a] 01017 #define X_CONTENT(a) TBYTE_PTR [a] 01018 #define D_CONTENT(a) QWORD_PTR [a] 01019 #define L_CONTENT(a) DWORD_PTR [a] 01020 #define W_CONTENT(a) WORD_PTR [a] 01021 #define B_CONTENT(a) BYTE_PTR [a] 01022 #else 01023 #define P_CONTENT(a) a 01024 #define X_CONTENT(a) TBYTE_PTR a 01025 #define D_CONTENT(a) QWORD_PTR a 01026 #define L_CONTENT(a) DWORD_PTR a 01027 #define W_CONTENT(a) WORD_PTR a 01028 #define B_CONTENT(a) BYTE_PTR a 01029 #endif 01030 01031 /* Register a indirect */ 01032 #define P_REGIND(a) [a] 01033 #define X_REGIND(a) TBYTE_PTR [a] 01034 #define D_REGIND(a) QWORD_PTR [a] 01035 #define L_REGIND(a) DWORD_PTR [a] 01036 #define W_REGIND(a) WORD_PTR [a] 01037 #define B_REGIND(a) BYTE_PTR [a] 01038 01039 /* Register b indirect plus displacement a */ 01040 #define P_REGOFF(a, b) [b + a] 01041 #define X_REGOFF(a, b) TBYTE_PTR [b + a] 01042 #define D_REGOFF(a, b) QWORD_PTR [b + a] 01043 #define L_REGOFF(a, b) DWORD_PTR [b + a] 01044 #define W_REGOFF(a, b) WORD_PTR [b + a] 01045 #define B_REGOFF(a, b) BYTE_PTR [b + a] 01046 01047 /* Reg indirect Base + Index + Displacement - this is mainly for 16-bit mode 01048 * which has no scaling 01049 */ 01050 #define P_REGBID(b, i, d) [b + i + d] 01051 #define X_REGBID(b, i, d) TBYTE_PTR [b + i + d] 01052 #define D_REGBID(b, i, d) QWORD_PTR [b + i + d] 01053 #define L_REGBID(b, i, d) DWORD_PTR [b + i + d] 01054 #define W_REGBID(b, i, d) WORD_PTR [b + i + d] 01055 #define B_REGBID(b, i, d) BYTE_PTR [b + i + d] 01056 01057 /* Reg indirect Base + (Index * Scale) */ 01058 #define P_REGBIS(b, i, s) [b + i * s] 01059 #define X_REGBIS(b, i, s) TBYTE_PTR [b + i * s] 01060 #define D_REGBIS(b, i, s) QWORD_PTR [b + i * s] 01061 #define L_REGBIS(b, i, s) DWORD_PTR [b + i * s] 01062 #define W_REGBIS(b, i, s) WORD_PTR [b + i * s] 01063 #define B_REGBIS(b, i, s) BYTE_PTR [b + i * s] 01064 01065 /* Reg indirect Base + (Index * Scale) + Displacement */ 01066 #define P_REGBISD(b, i, s, d) [b + i * s + d] 01067 #define X_REGBISD(b, i, s, d) TBYTE_PTR [b + i * s + d] 01068 #define D_REGBISD(b, i, s, d) QWORD_PTR [b + i * s + d] 01069 #define L_REGBISD(b, i, s, d) DWORD_PTR [b + i * s + d] 01070 #define W_REGBISD(b, i, s, d) WORD_PTR [b + i * s + d] 01071 #define B_REGBISD(b, i, s, d) BYTE_PTR [b + i * s + d] 01072 01073 /* Displaced Scaled Index: */ 01074 #define P_REGDIS(d, i, s) [i * s + d] 01075 #define X_REGDIS(d, i, s) TBYTE_PTR [i * s + d] 01076 #define D_REGDIS(d, i, s) QWORD_PTR [i * s + d] 01077 #define L_REGDIS(d, i, s) DWORD_PTR [i * s + d] 01078 #define W_REGDIS(d, i, s) WORD_PTR [i * s + d] 01079 #define B_REGDIS(d, i, s) BYTE_PTR [i * s + d] 01080 01081 /* Indexed Base: */ 01082 #define P_REGBI(b, i) [b + i] 01083 #define X_REGBI(b, i) TBYTE_PTR [b + i] 01084 #define D_REGBI(b, i) QWORD_PTR [b + i] 01085 #define L_REGBI(b, i) DWORD_PTR [b + i] 01086 #define W_REGBI(b, i) WORD_PTR [b + i] 01087 #define B_REGBI(b, i) BYTE_PTR [b + i] 01088 01089 /* Displaced Base: */ 01090 #define P_REGDB(d, b) [b + d] 01091 #define X_REGDB(d, b) TBYTE_PTR [b + d] 01092 #define D_REGDB(d, b) QWORD_PTR [b + d] 01093 #define L_REGDB(d, b) DWORD_PTR [b + d] 01094 #define W_REGDB(d, b) WORD_PTR [b + d] 01095 #define B_REGDB(d, b) BYTE_PTR [b + d] 01096 01097 /* Variable indirect: */ 01098 #define VARINDIRECT(var) [var] 01099 01100 /* Use register contents as jump/call target: */ 01101 #define CODEPTR(reg) P_(reg) 01102 01103 /* 01104 * Redefine assembler commands 01105 */ 01106 01107 #define P_(a) P_ ## a 01108 #define X_(a) X_ ## a 01109 #define D_(a) D_ ## a 01110 #define SR_(a) W_ ## a 01111 #define S_(a) L_ ## a 01112 #define L_(a) L_ ## a 01113 #define W_(a) W_ ## a 01114 #define B_(a) B_ ## a 01115 01116 #define AAA aaa 01117 #define AAD aad 01118 #define AAM aam 01119 #define AAS aas 01120 #define ADC_L(a, b) adc L_(b), L_(a) 01121 #define ADC_W(a, b) adc W_(b), W_(a) 01122 #define ADC_B(a, b) adc B_(b), B_(a) 01123 #define ADD_L(a, b) add L_(b), L_(a) 01124 #define ADD_W(a, b) add W_(b), W_(a) 01125 #define ADD_B(a, b) add B_(b), B_(a) 01126 #define AND_L(a, b) and L_(b), L_(a) 01127 #define AND_W(a, b) and W_(b), W_(a) 01128 #define AND_B(a, b) and B_(b), B_(a) 01129 #define ARPL(a,b) arpl W_(b), a 01130 #define BOUND_L(a, b) bound L_(b), L_(a) 01131 #define BOUND_W(a, b) bound W_(b), W_(a) 01132 #define BSF_L(a, b) bsf L_(b), L_(a) 01133 #define BSF_W(a, b) bsf W_(b), W_(a) 01134 #define BSR_L(a, b) bsr L_(b), L_(a) 01135 #define BSR_W(a, b) bsr W_(b), W_(a) 01136 #define BT_L(a, b) bt L_(b), L_(a) 01137 #define BT_W(a, b) bt W_(b), W_(a) 01138 #define BTC_L(a, b) btc L_(b), L_(a) 01139 #define BTC_W(a, b) btc W_(b), W_(a) 01140 #define BTR_L(a, b) btr L_(b), L_(a) 01141 #define BTR_W(a, b) btr W_(b), W_(a) 01142 #define BTS_L(a, b) bts L_(b), L_(a) 01143 #define BTS_W(a, b) bts W_(b), W_(a) 01144 #define CALL(a) call a 01145 #define CALLF(s,a) call far s:a 01146 #define CBW cbw 01147 #define CWDE cwde 01148 #define CLC clc 01149 #define CLD cld 01150 #define CLI cli 01151 #define CLTS clts 01152 #define CMC cmc 01153 #define CMP_L(a, b) cmp L_(b), L_(a) 01154 #define CMP_W(a, b) cmp W_(b), W_(a) 01155 #define CMP_B(a, b) cmp B_(b), B_(a) 01156 #define CMPS_L cmpsd 01157 #define CMPS_W cmpsw 01158 #define CMPS_B cmpsb 01159 #define CPUID cpuid 01160 #define CWD cwd 01161 #define CDQ cdq 01162 #define DAA daa 01163 #define DAS das 01164 #define DEC_L(a) dec L_(a) 01165 #define DEC_W(a) dec W_(a) 01166 #define DEC_B(a) dec B_(a) 01167 #define DIV_L(a) div L_(a) 01168 #define DIV_W(a) div W_(a) 01169 #define DIV_B(a) div B_(a) 01170 #define ENTER(a,b) enter b, a 01171 #define HLT hlt 01172 #define IDIV_L(a) idiv L_(a) 01173 #define IDIV_W(a) idiv W_(a) 01174 #define IDIV_B(a) idiv B_(a) 01175 #define IMUL_L(a, b) imul L_(b), L_(a) 01176 #define IMUL_W(a, b) imul W_(b), W_(a) 01177 #define IMUL_B(a) imul B_(a) 01178 #define IN_L in EAX, DX 01179 #define IN_W in AX, DX 01180 #define IN_B in AL, DX 01181 #define IN1_L(a) in1 L_(a) 01182 #define IN1_W(a) in1 W_(a) 01183 #define IN1_B(a) in1 B_(a) 01184 #define INC_L(a) inc L_(a) 01185 #define INC_W(a) inc W_(a) 01186 #define INC_B(a) inc B_(a) 01187 #define INS_L ins 01188 #define INS_W ins 01189 #define INS_B ins 01190 #define INT(a) int B_(a) 01191 #define INT3 int3 01192 #define INTO into 01193 #define IRET iret 01194 #define IRETD iretd 01195 #define JA(a) ja NEAR a 01196 #define JAE(a) jae NEAR a 01197 #define JB(a) jb NEAR a 01198 #define JBE(a) jbe NEAR a 01199 #define JC(a) jc NEAR a 01200 #define JE(a) je NEAR a 01201 #define JG(a) jg NEAR a 01202 #define JGE(a) jge NEAR a 01203 #define JL(a) jl NEAR a 01204 #define JLE(a) jle NEAR a 01205 #define JNA(a) jna NEAR a 01206 #define JNAE(a) jnae NEAR a 01207 #define JNB(a) jnb NEAR a 01208 #define JNBE(a) jnbe NEAR a 01209 #define JNC(a) jnc NEAR a 01210 #define JNE(a) jne NEAR a 01211 #define JNG(a) jng NEAR a 01212 #define JNGE(a) jnge NEAR a 01213 #define JNL(a) jnl NEAR a 01214 #define JNLE(a) jnle NEAR a 01215 #define JNO(a) jno NEAR a 01216 #define JNP(a) jnp NEAR a 01217 #define JNS(a) jns NEAR a 01218 #define JNZ(a) jnz NEAR a 01219 #define JO(a) jo NEAR a 01220 #define JP(a) jp NEAR a 01221 #define JPE(a) jpe NEAR a 01222 #define JPO(a) jpo NEAR a 01223 #define JS(a) js NEAR a 01224 #define JZ(a) jz NEAR a 01225 #define JMP(a) jmp a 01226 #define JMPF(s,a) jmp far s:a 01227 #define LAHF lahf 01228 #define LAR(a, b) lar b, a 01229 #define LEA_L(a, b) lea P_(b), P_(a) 01230 #define LEA_W(a, b) lea P_(b), P_(a) 01231 #define LEAVE leave 01232 #define LGDT(a) lgdt a 01233 #define LIDT(a) lidt a 01234 #define LDS(a, b) lds b, P_(a) 01235 #define LES(a, b) les b, P_(a) 01236 #define LFS(a, b) lfs b, P_(a) 01237 #define LGS(a, b) lgs b, P_(a) 01238 #define LSS(a, b) lss b, P_(a) 01239 #define LLDT(a) lldt a 01240 #define LMSW(a) lmsw a 01241 #define LOCK lock 01242 #define LODS_L lodsd 01243 #define LODS_W lodsw 01244 #define LODS_B lodsb 01245 #define LOOP(a) loop a 01246 #define LOOPE(a) loope a 01247 #define LOOPZ(a) loopz a 01248 #define LOOPNE(a) loopne a 01249 #define LOOPNZ(a) loopnz a 01250 #define LSL(a, b) lsl b, a 01251 #define LTR(a) ltr a 01252 #define MOV_SR(a, b) mov SR_(b), SR_(a) 01253 #define MOV_L(a, b) mov L_(b), L_(a) 01254 #define MOV_W(a, b) mov W_(b), W_(a) 01255 #define MOV_B(a, b) mov B_(b), B_(a) 01256 #define MOVS_L movsd 01257 #define MOVS_W movsw 01258 #define MOVS_B movsb 01259 #define MOVSX_BL(a, b) movsx B_(b), B_(a) 01260 #define MOVSX_BW(a, b) movsx B_(b), B_(a) 01261 #define MOVSX_WL(a, b) movsx W_(b), W_(a) 01262 #define MOVZX_BL(a, b) movzx B_(b), B_(a) 01263 #define MOVZX_BW(a, b) movzx B_(b), B_(a) 01264 #define MOVZX_WL(a, b) movzx W_(b), W_(a) 01265 #define MUL_L(a) mul L_(a) 01266 #define MUL_W(a) mul W_(a) 01267 #define MUL_B(a) mul B_(a) 01268 #define NEG_L(a) neg L_(a) 01269 #define NEG_W(a) neg W_(a) 01270 #define NEG_B(a) neg B_(a) 01271 #define NOP nop 01272 #define NOT_L(a) not L_(a) 01273 #define NOT_W(a) not W_(a) 01274 #define NOT_B(a) not B_(a) 01275 #define OR_L(a,b) or L_(b), L_(a) 01276 #define OR_W(a,b) or W_(b), W_(a) 01277 #define OR_B(a,b) or B_(b), B_(a) 01278 #define OUT_L out DX, EAX 01279 #define OUT_W out DX, AX 01280 #define OUT_B out DX, AL 01281 #define OUT1_L(a) out1 L_(a) 01282 #define OUT1_W(a) out1 W_(a) 01283 #define OUT1_B(a) out1 B_(a) 01284 #define OUTS_L outsd 01285 #define OUTS_W outsw 01286 #define OUTS_B outsb 01287 #define POP_SR(a) pop SR_(a) 01288 #define POP_L(a) pop L_(a) 01289 #define POP_W(a) pop W_(a) 01290 #define POPA_L popad 01291 #define POPA_W popa 01292 #define POPF_L popfd 01293 #define POPF_W popf 01294 #define PUSH_SR(a) push SR_(a) 01295 #define PUSH_L(a) push L_(a) 01296 #define PUSH_W(a) push W_(a) 01297 #define PUSH_B(a) push B_(a) 01298 #define PUSHA_L pushad 01299 #define PUSHA_W pusha 01300 #define PUSHF_L pushfd 01301 #define PUSHF_W pushf 01302 #define RCL_L(a, b) rcl L_(b), L_(a) 01303 #define RCL_W(a, b) rcl W_(b), W_(a) 01304 #define RCL_B(a, b) rcl B_(b), B_(a) 01305 #define RCR_L(a, b) rcr L_(b), L_(a) 01306 #define RCR_W(a, b) rcr W_(b), W_(a) 01307 #define RCR_B(a, b) rcr B_(b), B_(a) 01308 #define RDTSC rdtsc 01309 #define ROL_L(a, b) rol L_(b), L_(a) 01310 #define ROL_W(a, b) rol W_(b), W_(a) 01311 #define ROL_B(a, b) rol B_(b), B_(a) 01312 #define ROR_L(a, b) ror L_(b), L_(a) 01313 #define ROR_W(a, b) ror W_(b), W_(a) 01314 #define ROR_B(a, b) ror B_(b), B_(a) 01315 #define REP rep 01316 #define REPE repe 01317 #define REPNE repne 01318 #define REPNZ REPNE 01319 #define REPZ REPE 01320 #define RET ret 01321 #define SAHF sahf 01322 #define SAL_L(a, b) sal L_(b), B_(a) 01323 #define SAL_W(a, b) sal W_(b), B_(a) 01324 #define SAL_B(a, b) sal B_(b), B_(a) 01325 #define SAR_L(a, b) sar L_(b), B_(a) 01326 #define SAR_W(a, b) sar W_(b), B_(a) 01327 #define SAR_B(a, b) sar B_(b), B_(a) 01328 #define SBB_L(a, b) sbb L_(b), L_(a) 01329 #define SBB_W(a, b) sbb W_(b), W_(a) 01330 #define SBB_B(a, b) sbb B_(b), B_(a) 01331 #define SCAS_L scas 01332 #define SCAS_W scas 01333 #define SCAS_B scas 01334 #define SETA(a) seta a 01335 #define SETAE(a) setae a 01336 #define SETB(a) setb a 01337 #define SETBE(a) setbe a 01338 #define SETC(a) setc a 01339 #define SETE(a) sete a 01340 #define SETG(a) setg a 01341 #define SETGE(a) setge a 01342 #define SETL(a) setl a 01343 #define SETLE(a) setle a 01344 #define SETNA(a) setna a 01345 #define SETNAE(a) setnae a 01346 #define SETNB(a) setnb a 01347 #define SETNBE(a) setnbe a 01348 #define SETNC(a) setnc a 01349 #define SETNE(a) setne a 01350 #define SETNG(a) setng a 01351 #define SETNGE(a) setnge a 01352 #define SETNL(a) setnl a 01353 #define SETNLE(a) setnle a 01354 #define SETNO(a) setno a 01355 #define SETNP(a) setnp a 01356 #define SETNS(a) setns a 01357 #define SETNZ(a) setnz a 01358 #define SETO(a) seto a 01359 #define SETP(a) setp a 01360 #define SETPE(a) setpe a 01361 #define SETPO(a) setpo a 01362 #define SETS(a) sets a 01363 #define SETZ(a) setz a 01364 #define SGDT(a) sgdt a 01365 #define SIDT(a) sidt a 01366 #define SHL_L(a, b) shl L_(b), B_(a) 01367 #define SHL_W(a, b) shl W_(b), B_(a) 01368 #define SHL_B(a, b) shl B_(b), B_(a) 01369 #define SHLD_L(a,b,c) shld 01370 #define SHLD2_L(a,b) shld L_(b), L_(a) 01371 #define SHLD_W(a,b,c) shld 01372 #define SHLD2_W(a,b) shld W_(b), W_(a) 01373 #define SHR_L(a, b) shr L_(b), B_(a) 01374 #define SHR_W(a, b) shr W_(b), B_(a) 01375 #define SHR_B(a, b) shr B_(b), B_(a) 01376 #define SHRD_L(a,b,c) shrd 01377 #define SHRD2_L(a,b) shrd L_(b), L_(a) 01378 #define SHRD_W(a,b,c) shrd 01379 #define SHRD2_W(a,b) shrd W_(b), W_(a) 01380 #define SLDT(a) sldt a 01381 #define SMSW(a) smsw a 01382 #define STC stc 01383 #define STD std 01384 #define STI sti 01385 #define STOS_L stosd 01386 #define STOS_W stosw 01387 #define STOS_B stosb 01388 #define STR(a) str a 01389 #define SUB_L(a, b) sub L_(b), L_(a) 01390 #define SUB_W(a, b) sub W_(b), W_(a) 01391 #define SUB_B(a, b) sub B_(b), B_(a) 01392 #define TEST_L(a, b) test L_(b), L_(a) 01393 #define TEST_W(a, b) test W_(b), W_(a) 01394 #define TEST_B(a, b) test B_(b), B_(a) 01395 #define VERR(a) verr a 01396 #define VERW(a) verw a 01397 #define WAIT wait 01398 #define XCHG_L(a, b) xchg L_(b), L_(a) 01399 #define XCHG_W(a, b) xchg W_(b), W_(a) 01400 #define XCHG_B(a, b) xchg B_(b), B_(a) 01401 #define XLAT xlat 01402 #define XOR_L(a, b) xor L_(b), L_(a) 01403 #define XOR_W(a, b) xor W_(b), W_(a) 01404 #define XOR_B(a, b) xor B_(b), B_(a) 01405 01406 01407 /* Floating Point Instructions */ 01408 #define F2XM1 f2xm1 01409 #define FABS fabs 01410 #define FADD_D(a) fadd D_(a) 01411 #define FADD_S(a) fadd S_(a) 01412 #define FADD2(a, b) fadd b, a 01413 #define FADDP(a, b) faddp b, a 01414 #define FIADD_L(a) fiadd L_(a) 01415 #define FIADD_W(a) fiadd W_(a) 01416 #define FBLD(a) fbld a 01417 #define FBSTP(a) fbstp a 01418 #define FCHS fchs 01419 #define FCLEX fclex 01420 #define FNCLEX fnclex 01421 #define FCOM(a) fcom a 01422 #define FCOM_D(a) fcom D_(a) 01423 #define FCOM_S(a) fcom S_(a) 01424 #define FCOMP(a) fcomp a 01425 #define FCOMP_D(a) fcomp D_(a) 01426 #define FCOMP_S(a) fcomp S_(a) 01427 #define FCOMPP fcompp 01428 #define FCOS fcos 01429 #define FDECSTP fdecstp 01430 #define FDIV_D(a) fdiv D_(a) 01431 #define FDIV_S(a) fdiv S_(a) 01432 #define FDIV2(a, b) fdiv b, a 01433 #define FDIVP(a, b) fdivp b, a 01434 #define FIDIV_L(a) fidiv L_(a) 01435 #define FIDIV_W(a) fidiv W_(a) 01436 #define FDIVR_D(a) fdivr D_(a) 01437 #define FDIVR_S(a) fdivr S_(a) 01438 #define FDIVR2(a, b) fdivr b, a 01439 #define FDIVRP(a, b) fdivrp b, a 01440 #define FIDIVR_L(a) fidivr L_(a) 01441 #define FIDIVR_W(a) fidivr W_(a) 01442 #define FFREE(a) ffree a 01443 #define FICOM_L(a) ficom L_(a) 01444 #define FICOM_W(a) ficom W_(a) 01445 #define FICOMP_L(a) ficomp L_(a) 01446 #define FICOMP_W(a) ficomp W_(a) 01447 #define FILD_Q(a) fild D_(a) 01448 #define FILD_L(a) fild L_(a) 01449 #define FILD_W(a) fild W_(a) 01450 #define FINCSTP fincstp 01451 #define FINIT finit 01452 #define FNINIT fninit 01453 #define FIST_L(a) fist L_(a) 01454 #define FIST_W(a) fist W_(a) 01455 #define FISTP_Q(a) fistp D_(a) 01456 #define FISTP_L(a) fistp L_(a) 01457 #define FISTP_W(a) fistp W_(a) 01458 #define FLD_X(a) fld X_(a) 01459 #define FLD_D(a) fld D_(a) 01460 #define FLD_S(a) fld S_(a) 01461 #define FLD1 fld1 01462 #define FLDL2T fldl2t 01463 #define FLDL2E fldl2e 01464 #define FLDPI fldpi 01465 #define FLDLG2 fldlg2 01466 #define FLDLN2 fldln2 01467 #define FLDZ fldz 01468 #define FLDCW(a) fldcw a 01469 #define FLDENV(a) fldenv a 01470 #define FMUL_S(a) fmul S_(a) 01471 #define FMUL_D(a) fmul D_(a) 01472 #define FMUL2(a, b) fmul b, a 01473 #define FMULP(a, b) fmulp b, a 01474 #define FIMUL_L(a) fimul L_(a) 01475 #define FIMUL_W(a) fimul W_(a) 01476 #define FNOP fnop 01477 #define FPATAN fpatan 01478 #define FPREM fprem 01479 #define FPREM1 fprem1 01480 #define FPTAN fptan 01481 #define FRNDINT frndint 01482 #define FRSTOR(a) frstor a 01483 #define FSAVE(a) fsave a 01484 #define FNSAVE(a) fnsave a 01485 #define FSCALE fscale 01486 #define FSIN fsin 01487 #define FSINCOS fsincos 01488 #define FSQRT fsqrt 01489 #define FST_D(a) fst D_(a) 01490 #define FST_S(a) fst S_(a) 01491 #define FSTP_X(a) fstp X_(a) 01492 #define FSTP_D(a) fstp D_(a) 01493 #define FSTP_S(a) fstp S_(a) 01494 #define FSTP(a) fstp a 01495 #define FSTCW(a) fstcw a 01496 #define FNSTCW(a) fnstcw a 01497 #define FSTENV(a) fstenv a 01498 #define FNSTENV(a) fnstenv a 01499 #define FSTSW(a) fstsw a 01500 #define FNSTSW(a) fnstsw a 01501 #define FSUB_S(a) fsub S_(a) 01502 #define FSUB_D(a) fsub D_(a) 01503 #define FSUB2(a, b) fsub b, a 01504 #define FSUBP(a, b) fsubp b, a 01505 #define FISUB_L(a) fisub L_(a) 01506 #define FISUB_W(a) fisub W_(a) 01507 #define FSUBR_S(a) fsubr S_(a) 01508 #define FSUBR_D(a) fsubr D_(a) 01509 #define FSUBR2(a, b) fsubr b, a 01510 #define FSUBRP(a, b) fsubrp b, a 01511 #define FISUBR_L(a) fisubr L_(a) 01512 #define FISUBR_W(a) fisubr W_(a) 01513 #define FTST ftst 01514 #define FUCOM(a) fucom a 01515 #define FUCOMP(a) fucomp a 01516 #define FUCOMPP fucompp 01517 #define FWAIT fwait 01518 #define FXAM fxam 01519 #define FXCH(a) fxch a 01520 #define FXTRACT fxtract 01521 #define FYL2X fyl2x 01522 #define FYL2XP1 fyl2xp1 01523 01524 #endif /* NASM_ASSEMBLER, MASM_ASSEMBLER */ 01525 01526 /****************************************/ 01527 /* */ 01528 /* Extensions to x86 insn set - */ 01529 /* MMX, 3DNow! */ 01530 /* */ 01531 /****************************************/ 01532 01533 #if defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER) 01534 #define P_ARG1(a) P_ ## a 01535 #define P_ARG2(a, b) P_ ## b, P_ ## a 01536 #define P_ARG3(a, b, c) P_ ## c, P_ ## b, P_ ## a 01537 #else 01538 #define P_ARG1(a) a 01539 #define P_ARG2(a, b) a, b 01540 #define P_ARG3(a, b, c) a, b, c 01541 #endif 01542 01543 /* MMX */ 01544 #define MOVD(a, b) movd P_ARG2(a, b) 01545 #define MOVQ(a, b) movq P_ARG2(a, b) 01546 01547 #define PADDB(a, b) paddb P_ARG2(a, b) 01548 #define PADDW(a, b) paddw P_ARG2(a, b) 01549 #define PADDD(a, b) paddd P_ARG2(a, b) 01550 01551 #define PADDSB(a, b) paddsb P_ARG2(a, b) 01552 #define PADDSW(a, b) paddsw P_ARG2(a, b) 01553 01554 #define PADDUSB(a, b) paddusb P_ARG2(a, b) 01555 #define PADDUSW(a, b) paddusw P_ARG2(a, b) 01556 01557 #define PSUBB(a, b) psubb P_ARG2(a, b) 01558 #define PSUBW(a, b) psubw P_ARG2(a, b) 01559 #define PSUBD(a, b) psubd P_ARG2(a, b) 01560 01561 #define PSUBSB(a, b) psubsb P_ARG2(a, b) 01562 #define PSUBSW(a, b) psubsw P_ARG2(a, b) 01563 01564 #define PSUBUSB(a, b) psubusb P_ARG2(a, b) 01565 #define PSUBUSW(a, b) psubusw P_ARG2(a, b) 01566 01567 #define PCMPEQB(a, b) pcmpeqb P_ARG2(a, b) 01568 #define PCMPEQW(a, b) pcmpeqw P_ARG2(a, b) 01569 #define PCMPEQD(a, b) pcmpeqd P_ARG2(a, b) 01570 01571 #define PCMPGTB(a, b) pcmpgtb P_ARG2(a, b) 01572 #define PCMPGTW(a, b) pcmpgtw P_ARG2(a, b) 01573 #define PCMPGTD(a, b) pcmpgtd P_ARG2(a, b) 01574 01575 #define PMULHW(a, b) pmulhw P_ARG2(a, b) 01576 #define PMULLW(a, b) pmullw P_ARG2(a, b) 01577 01578 #define PMADDWD(a, b) pmaddwd P_ARG2(a, b) 01579 01580 #define PAND(a, b) pand P_ARG2(a, b) 01581 01582 #define PANDN(a, b) pandn P_ARG2(a, b) 01583 01584 #define POR(a, b) por P_ARG2(a, b) 01585 01586 #define PXOR(a, b) pxor P_ARG2(a, b) 01587 01588 #define PSRAW(a, b) psraw P_ARG2(a, b) 01589 #define PSRAD(a, b) psrad P_ARG2(a, b) 01590 01591 #define PSRLW(a, b) psrlw P_ARG2(a, b) 01592 #define PSRLD(a, b) psrld P_ARG2(a, b) 01593 #define PSRLQ(a, b) psrlq P_ARG2(a, b) 01594 01595 #define PSLLW(a, b) psllw P_ARG2(a, b) 01596 #define PSLLD(a, b) pslld P_ARG2(a, b) 01597 #define PSLLQ(a, b) psllq P_ARG2(a, b) 01598 01599 #define PACKSSWB(a, b) packsswb P_ARG2(a, b) 01600 #define PACKSSDW(a, b) packssdw P_ARG2(a, b) 01601 #define PACKUSWB(a, b) packuswb P_ARG2(a, b) 01602 01603 #define PUNPCKHBW(a, b) punpckhbw P_ARG2(a, b) 01604 #define PUNPCKHWD(a, b) punpckhwd P_ARG2(a, b) 01605 #define PUNPCKHDQ(a, b) punpckhdq P_ARG2(a, b) 01606 #define PUNPCKLBW(a, b) punpcklbw P_ARG2(a, b) 01607 #define PUNPCKLWD(a, b) punpcklwd P_ARG2(a, b) 01608 #define PUNPCKLDQ(a, b) punpckldq P_ARG2(a, b) 01609 01610 #define EMMS emms 01611 01612 /* AMD 3DNow! */ 01613 #define PAVGUSB(a, b) pavgusb P_ARG2(a, b) 01614 #define PFADD(a, b) pfadd P_ARG2(a, b) 01615 #define PFSUB(a, b) pfsub P_ARG2(a, b) 01616 #define PFSUBR(a, b) pfsubr P_ARG2(a, b) 01617 #define PFACC(a, b) pfacc P_ARG2(a, b) 01618 #define PFCMPGE(a, b) pfcmpge P_ARG2(a, b) 01619 #define PFCMPGT(a, b) pfcmpgt P_ARG2(a, b) 01620 #define PFCMPEQ(a, b) pfcmpeq P_ARG2(a, b) 01621 #define PFMIN(a, b) pfmin P_ARG2(a, b) 01622 #define PFMAX(a, b) pfmax P_ARG2(a, b) 01623 #define PI2FD(a, b) pi2fd P_ARG2(a, b) 01624 #define PF2ID(a, b) pf2id P_ARG2(a, b) 01625 #define PFRCP(a, b) pfrcp P_ARG2(a, b) 01626 #define PFRSQRT(a, b) pfrsqrt P_ARG2(a, b) 01627 #define PFMUL(a, b) pfmul P_ARG2(a, b) 01628 #define PFRCPIT1(a, b) pfrcpit1 P_ARG2(a, b) 01629 #define PFRSQIT1(a, b) pfrsqit1 P_ARG2(a, b) 01630 #define PFRCPIT2(a, b) pfrcpit2 P_ARG2(a, b) 01631 #define PMULHRW(a, b) pmulhrw P_ARG2(a, b) 01632 01633 #define FEMMS femms 01634 #define PREFETCH(a) prefetch P_ARG1(a) 01635 #define PREFETCHW(a) prefetchw P_ARG1(a) 01636 01637 /* Intel SSE */ 01638 #define ADDPS(a, b) addps P_ARG2(a, b) 01639 #define ADDSS(a, b) addss P_ARG2(a, b) 01640 #define ANDNPS(a, b) andnps P_ARG2(a, b) 01641 #define ANDPS(a, b) andps P_ARG2(a, b) 01642 /* NASM only knows the pseudo ops for these. 01643 #define CMPPS(a, b, c) cmpps P_ARG3(a, b, c) 01644 #define CMPSS(a, b, c) cmpss P_ARG3(a, b, c) 01645 */ 01646 #define CMPEQPS(a, b) cmpeqps P_ARG2(a, b) 01647 #define CMPLTPS(a, b) cmpltps P_ARG2(a, b) 01648 #define CMPLEPS(a, b) cmpleps P_ARG2(a, b) 01649 #define CMPUNORDPS(a, b) cmpunordps P_ARG2(a, b) 01650 #define CMPNEQPS(a, b) cmpneqps P_ARG2(a, b) 01651 #define CMPNLTPS(a, b) cmpnltps P_ARG2(a, b) 01652 #define CMPNLEPS(a, b) cmpnleps P_ARG2(a, b) 01653 #define CMPORDPS(a, b) cmpordps P_ARG2(a, b) 01654 #define CMPEQSS(a, b) cmpeqss P_ARG2(a, b) 01655 #define CMPLTSS(a, b) cmpltss P_ARG2(a, b) 01656 #define CMPLESS(a, b) cmpless P_ARG2(a, b) 01657 #define CMPUNORDSS(a, b) cmpunordss P_ARG2(a, b) 01658 #define CMPNEQSS(a, b) cmpneqss P_ARG2(a, b) 01659 #define CMPNLTSS(a, b) cmpnltss P_ARG2(a, b) 01660 #define CMPNLESS(a, b) cmpnless P_ARG2(a, b) 01661 #define CMPORDSS(a, b) cmpordss P_ARG2(a, b) 01662 #define COMISS(a, b) comiss P_ARG2(a, b) 01663 #define CVTPI2PS(a, b) cvtpi2ps P_ARG2(a, b) 01664 #define CVTPS2PI(a, b) cvtps2pi P_ARG2(a, b) 01665 #define CVTSI2SS(a, b) cvtsi2ss P_ARG2(a, b) 01666 #define CVTSS2SI(a, b) cvtss2si P_ARG2(a, b) 01667 #define CVTTPS2PI(a, b) cvttps2pi P_ARG2(a, b) 01668 #define CVTTSS2SI(a, b) cvttss2si P_ARG2(a, b) 01669 #define DIVPS(a, b) divps P_ARG2(a, b) 01670 #define DIVSS(a, b) divss P_ARG2(a, b) 01671 #define FXRSTOR(a) fxrstor P_ARG1(a) 01672 #define FXSAVE(a) fxsave P_ARG1(a) 01673 #define LDMXCSR(a) ldmxcsr P_ARG1(a) 01674 #define MAXPS(a, b) maxps P_ARG2(a, b) 01675 #define MAXSS(a, b) maxss P_ARG2(a, b) 01676 #define MINPS(a, b) minps P_ARG2(a, b) 01677 #define MINSS(a, b) minss P_ARG2(a, b) 01678 #define MOVAPS(a, b) movaps P_ARG2(a, b) 01679 #define MOVHLPS(a, b) movhlps P_ARG2(a, b) 01680 #define MOVHPS(a, b) movhps P_ARG2(a, b) 01681 #define MOVLHPS(a, b) movlhps P_ARG2(a, b) 01682 #define MOVLPS(a, b) movlps P_ARG2(a, b) 01683 #define MOVMSKPS(a, b) movmskps P_ARG2(a, b) 01684 #define MOVNTPS(a, b) movntps P_ARG2(a, b) 01685 #define MOVNTQ(a, b) movntq P_ARG2(a, b) 01686 #define MOVSS(a, b) movss P_ARG2(a, b) 01687 #define MOVUPS(a, b) movups P_ARG2(a, b) 01688 #define MULPS(a, b) mulps P_ARG2(a, b) 01689 #define MULSS(a, b) mulss P_ARG2(a, b) 01690 #define ORPS(a, b) orps P_ARG2(a, b) 01691 #define RCPPS(a, b) rcpps P_ARG2(a, b) 01692 #define RCPSS(a, b) rcpss P_ARG2(a, b) 01693 #define RSQRTPS(a, b) rsqrtps P_ARG2(a, b) 01694 #define RSQRTSS(a, b) rsqrtss P_ARG2(a, b) 01695 #define SHUFPS(a, b, c) shufps P_ARG3(a, b, c) 01696 #define SQRTPS(a, b) sqrtps P_ARG2(a, b) 01697 #define SQRTSS(a, b) sqrtss P_ARG2(a, b) 01698 #define STMXCSR(a) stmxcsr P_ARG1(a) 01699 #define SUBPS(a, b) subps P_ARG2(a, b) 01700 #define UCOMISS(a, b) ucomiss P_ARG2(a, b) 01701 #define UNPCKHPS(a, b) unpckhps P_ARG2(a, b) 01702 #define UNPCKLPS(a, b) unpcklps P_ARG2(a, b) 01703 #define XORPS(a, b) xorps P_ARG2(a, b) 01704 01705 #define PREFETCHNTA(a) prefetchnta P_ARG1(a) 01706 #define PREFETCHT0(a) prefetcht0 P_ARG1(a) 01707 #define PREFETCHT1(a) prefetcht1 P_ARG1(a) 01708 #define PREFETCHT2(a) prefetcht2 P_ARG1(a) 01709 #define SFENCE sfence 01710 01711 /* Added by BrianP for FreeBSD (per David Dawes) */ 01712 #if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER) && !defined(__bsdi__) 01713 #define LLBL(a) CONCAT(.L,a) 01714 #define LLBL2(a,b) CONCAT3(.L,a,b) 01715 #else 01716 #define LLBL(a) a 01717 #define LLBL2(a,b) CONCAT(a,b) 01718 #endif 01719 01720 /* Segment overrides */ 01721 #define SEGCS D_BYTE 46 01722 #define SEGDS D_BYTE 62 01723 #define SEGES D_BYTE 38 01724 #define SEGFS D_BYTE 100 01725 #define SEGGS D_BYTE 101 01726 01727 /* Temporary labels: valid until next non-local label */ 01728 #ifdef NASM_ASSEMBLER 01729 #define TLBL(a) CONCAT(.,a) 01730 #else 01731 #define TLBL(a) CONCAT(a,$) 01732 #endif 01733 01734 /* Hidden symbol visibility support. 01735 * If we build with gcc's -fvisibility=hidden flag, we'll need to change 01736 * the symbol visibility mode to 'default'. 01737 */ 01738 #if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) 01739 # define HIDDEN(x) .hidden x 01740 #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 && !defined(__DJGPP__) && !defined(__MINGW32__) 01741 # pragma GCC visibility push(default) 01742 # define HIDDEN(x) .hidden x 01743 #else 01744 # define HIDDEN(x) 01745 #endif 01746 01747 #endif /* __ASSYNTAX_H__ */ Generated on Thu May 24 2012 04:21:03 for ReactOS by
1.7.6.1
|