Subversion Repositories Kolibri OS

Rev

Rev 4358 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4358 Rev 5063
1
#ifndef __ASSYNTAX_H__
1
#ifndef __ASSYNTAX_H__
2
#define __ASSYNTAX_H__
2
#define __ASSYNTAX_H__
3
 
3
 
4
/*
4
/*
5
 * Copyright 1992 Vrije Universiteit, The Netherlands
5
 * Copyright 1992 Vrije Universiteit, The Netherlands
6
 *
6
 *
7
 * Permission to use, copy, modify, and distribute this software and its
7
 * Permission to use, copy, modify, and distribute this software and its
8
 * documentation for any purpose and without fee is hereby granted, provided
8
 * documentation for any purpose and without fee is hereby granted, provided
9
 * that the above copyright notice appear in all copies and that both that
9
 * that the above copyright notice appear in all copies and that both that
10
 * copyright notice and this permission notice appear in supporting
10
 * copyright notice and this permission notice appear in supporting
11
 * documentation, and that the name of the Vrije Universiteit not be used in
11
 * documentation, and that the name of the Vrije Universiteit not be used in
12
 * advertising or publicity pertaining to distribution of the software without
12
 * advertising or publicity pertaining to distribution of the software without
13
 * specific, written prior permission.  The Vrije Universiteit makes no
13
 * specific, written prior permission.  The Vrije Universiteit makes no
14
 * representations about the suitability of this software for any purpose.
14
 * representations about the suitability of this software for any purpose.
15
 * It is provided "as is" without express or implied warranty.
15
 * It is provided "as is" without express or implied warranty.
16
 *
16
 *
17
 * The Vrije Universiteit DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
17
 * The Vrije Universiteit DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
18
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
18
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
19
 * IN NO EVENT SHALL The Vrije Universiteit BE LIABLE FOR ANY SPECIAL,
19
 * IN NO EVENT SHALL The Vrije Universiteit BE LIABLE FOR ANY SPECIAL,
20
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
20
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
21
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
22
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
 * PERFORMANCE OF THIS SOFTWARE.
23
 * PERFORMANCE OF THIS SOFTWARE.
24
 */
24
 */
25
 
25
 
26
/*
26
/*
27
 * assyntax.h
27
 * assyntax.h
28
 *
28
 *
29
 * Select the syntax appropriate to the 386 assembler being used
29
 * Select the syntax appropriate to the 386 assembler being used
30
 * To add support for more assemblers add more columns to the CHOICE
30
 * To add support for more assemblers add more columns to the CHOICE
31
 * macro.  Note that register names must also have uppercase names
31
 * macro.  Note that register names must also have uppercase names
32
 * to avoid macro recursion. e.g., #define ah %ah recurses!
32
 * to avoid macro recursion. e.g., #define ah %ah recurses!
33
 *
33
 *
34
 * NB 1.  Some of the macros for certain assemblers imply that the code is to
34
 * NB 1.  Some of the macros for certain assemblers imply that the code is to
35
 *	  run in protected mode!!  Caveat emptor.
35
 *	  run in protected mode!!  Caveat emptor.
36
 *
36
 *
37
 * NB 2.  486 specific instructions are not included.  This is to discourage
37
 * NB 2.  486 specific instructions are not included.  This is to discourage
38
 *	  their accidental use in code that is intended to run on 386 and 486
38
 *	  their accidental use in code that is intended to run on 386 and 486
39
 *	  systems.
39
 *	  systems.
40
 *
40
 *
41
 * Supported assemblers:
41
 * Supported assemblers:
42
 *
42
 *
43
 * (a) AT&T SysVr4 as(1):	define ATT_ASSEMBLER
43
 * (a) AT&T SysVr4 as(1):	define ATT_ASSEMBLER
44
 * (b) GNU Assembler gas:	define GNU_ASSEMBLER (default)
44
 * (b) GNU Assembler gas:	define GNU_ASSEMBLER (default)
45
 * (c) Amsterdam Compiler kit:	define ACK_ASSEMBLER
45
 * (c) Amsterdam Compiler kit:	define ACK_ASSEMBLER
46
 * (d) The Netwide Assembler:	define NASM_ASSEMBLER
46
 * (d) The Netwide Assembler:	define NASM_ASSEMBLER
47
 * (e) Microsoft Assembler:	define MASM_ASSEMBLER (UNTESTED!)
47
 * (e) Microsoft Assembler:	define MASM_ASSEMBLER (UNTESTED!)
48
 *
48
 *
49
 * The following naming conventions have been used to identify the various
49
 * The following naming conventions have been used to identify the various
50
 * data types:
50
 * data types:
51
 *		_SR = segment register version
51
 *		_SR = segment register version
52
 *	Integer:
52
 *	Integer:
53
 *		_Q = quadword	= 64 bits
53
 *		_Q = quadword	= 64 bits
54
 *		_L = long	= 32 bits
54
 *		_L = long	= 32 bits
55
 *		_W = short	= 16 bits
55
 *		_W = short	= 16 bits
56
 *		_B = byte	=  8 bits
56
 *		_B = byte	=  8 bits
57
 *	Floating-point:
57
 *	Floating-point:
58
 *		_X = m80real	= 80 bits
58
 *		_X = m80real	= 80 bits
59
 *		_D = double	= 64 bits
59
 *		_D = double	= 64 bits
60
 *		_S = single	= 32 bits
60
 *		_S = single	= 32 bits
61
 *
61
 *
62
 * Author: Gregory J. Sharp, Sept 1992
62
 * Author: Gregory J. Sharp, Sept 1992
63
 *         Vrije Universiteit, Amsterdam, The Netherlands
63
 *         Vrije Universiteit, Amsterdam, The Netherlands
64
 *
64
 *
65
 *         [support for Intel syntax added by Josh Vanderhoof, 1999]
65
 *         [support for Intel syntax added by Josh Vanderhoof, 1999]
66
 */
66
 */
67
 
67
 
68
#if !(defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER))
68
#if !(defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER))
69
 
69
 
70
/* Default to ATT_ASSEMBLER when SVR4 or SYSV are defined */
70
/* Default to ATT_ASSEMBLER when SVR4 or SYSV are defined */
71
#if (defined(SVR4) || defined(SYSV)) && !defined(GNU_ASSEMBLER)
71
#if (defined(SVR4) || defined(SYSV)) && !defined(GNU_ASSEMBLER)
72
#define ATT_ASSEMBLER
72
#define ATT_ASSEMBLER
73
#endif
73
#endif
74
 
74
 
75
#if !defined(ATT_ASSEMBLER) && !defined(GNU_ASSEMBLER) && !defined(ACK_ASSEMBLER)
75
#if !defined(ATT_ASSEMBLER) && !defined(GNU_ASSEMBLER) && !defined(ACK_ASSEMBLER)
76
#define GNU_ASSEMBLER
76
#define GNU_ASSEMBLER
77
#endif
77
#endif
78
 
78
 
79
#if (defined(__STDC__) && !defined(UNIXCPP)) || (defined (sun) && defined (i386) && defined (SVR4) && defined (__STDC__) && !defined (__GNUC__))
79
#if (defined(__STDC__) && !defined(UNIXCPP)) || (defined (sun) && defined (i386) && defined (SVR4) && defined (__STDC__) && !defined (__GNUC__))
80
#define CONCAT(x, y)		x ## y
80
#define CONCAT(x, y)		x ## y
81
#define CONCAT3(x, y, z)	x ## y ## z
81
#define CONCAT3(x, y, z)	x ## y ## z
82
#else
82
#else
83
#define CONCAT(x, y)		x/**/y
83
#define CONCAT(x, y)		x/**/y
84
#define CONCAT3(x, y, z)	x/**/y/**/z
84
#define CONCAT3(x, y, z)	x/**/y/**/z
85
#endif
85
#endif
86
 
86
 
87
#ifdef ACK_ASSEMBLER
87
#ifdef ACK_ASSEMBLER
88
 
88
 
89
/* Assume we write code for 32-bit protected mode! */
89
/* Assume we write code for 32-bit protected mode! */
90
 
90
 
91
/* Redefine register names for GAS & AT&T assemblers */
91
/* Redefine register names for GAS & AT&T assemblers */
92
#define AL		al
92
#define AL		al
93
#define AH		ah
93
#define AH		ah
94
#define AX		ax
94
#define AX		ax
95
#define EAX		ax
95
#define EAX		ax
96
#define BL		bl
96
#define BL		bl
97
#define BH		bh
97
#define BH		bh
98
#define BX		bx
98
#define BX		bx
99
#define EBX		bx
99
#define EBX		bx
100
#define CL		cl
100
#define CL		cl
101
#define CH		ch
101
#define CH		ch
102
#define CX		cx
102
#define CX		cx
103
#define ECX		cx
103
#define ECX		cx
104
#define DL		dl
104
#define DL		dl
105
#define DH		dh
105
#define DH		dh
106
#define DX		dx
106
#define DX		dx
107
#define EDX		dx
107
#define EDX		dx
108
#define BP		bp
108
#define BP		bp
109
#define EBP		bp
109
#define EBP		bp
110
#define SI		si
110
#define SI		si
111
#define ESI		si
111
#define ESI		si
112
#define DI		di
112
#define DI		di
113
#define EDI		di
113
#define EDI		di
114
#define SP		sp
114
#define SP		sp
115
#define ESP		sp
115
#define ESP		sp
116
#define CS		cs
116
#define CS		cs
117
#define SS		ss
117
#define SS		ss
118
#define DS		ds
118
#define DS		ds
119
#define ES		es
119
#define ES		es
120
#define FS		fs
120
#define FS		fs
121
#define GS		gs
121
#define GS		gs
122
/* Control Registers */
122
/* Control Registers */
123
#define CR0		cr0
123
#define CR0		cr0
124
#define CR1		cr1
124
#define CR1		cr1
125
#define CR2		cr2
125
#define CR2		cr2
126
#define CR3		cr3
126
#define CR3		cr3
127
/* Debug Registers */
127
/* Debug Registers */
128
#define DR0		dr0
128
#define DR0		dr0
129
#define DR1		dr1
129
#define DR1		dr1
130
#define DR2		dr2
130
#define DR2		dr2
131
#define DR3		dr3
131
#define DR3		dr3
132
#define DR4		dr4
132
#define DR4		dr4
133
#define DR5		dr5
133
#define DR5		dr5
134
#define DR6		dr6
134
#define DR6		dr6
135
#define DR7		dr7
135
#define DR7		dr7
136
/* Floating-point Stack */
136
/* Floating-point Stack */
137
#define ST		st
137
#define ST		st
138
 
138
 
139
#define AS_BEGIN	.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
139
#define AS_BEGIN	.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
140
 
140
 
141
 
141
 
142
#define _WTOG		o16	/* word toggle for _W instructions */
142
#define _WTOG		o16	/* word toggle for _W instructions */
143
#define _LTOG			/* long toggle for _L instructions */
143
#define _LTOG			/* long toggle for _L instructions */
144
#define ADDR_TOGGLE	a16
144
#define ADDR_TOGGLE	a16
145
#define OPSZ_TOGGLE	o16
145
#define OPSZ_TOGGLE	o16
146
#define USE16		.use16
146
#define USE16		.use16
147
#define USE32		.use32
147
#define USE32		.use32
148
 
148
 
149
#define CHOICE(a,b,c)	c
149
#define CHOICE(a,b,c)	c
150
 
150
 
151
#else /* AT&T or GAS */
151
#else /* AT&T or GAS */
152
 
152
 
153
/* Redefine register names for GAS & AT&T assemblers */
153
/* Redefine register names for GAS & AT&T assemblers */
154
#define AL		%al
154
#define AL		%al
155
#define AH		%ah
155
#define AH		%ah
156
#define AX		%ax
156
#define AX		%ax
157
#define EAX		%eax
157
#define EAX		%eax
158
#define BL		%bl
158
#define BL		%bl
159
#define BH		%bh
159
#define BH		%bh
160
#define BX		%bx
160
#define BX		%bx
161
#define EBX		%ebx
161
#define EBX		%ebx
162
#define CL		%cl
162
#define CL		%cl
163
#define CH		%ch
163
#define CH		%ch
164
#define CX		%cx
164
#define CX		%cx
165
#define ECX		%ecx
165
#define ECX		%ecx
166
#define DL		%dl
166
#define DL		%dl
167
#define DH		%dh
167
#define DH		%dh
168
#define DX		%dx
168
#define DX		%dx
169
#define EDX		%edx
169
#define EDX		%edx
170
#define BP		%bp
170
#define BP		%bp
171
#define EBP		%ebp
171
#define EBP		%ebp
172
#define SI		%si
172
#define SI		%si
173
#define ESI		%esi
173
#define ESI		%esi
174
#define DI		%di
174
#define DI		%di
175
#define EDI		%edi
175
#define EDI		%edi
176
#define SP		%sp
176
#define SP		%sp
177
#define ESP		%esp
177
#define ESP		%esp
178
#define CS		%cs
178
#define CS		%cs
179
#define SS		%ss
179
#define SS		%ss
180
#define DS		%ds
180
#define DS		%ds
181
#define ES		%es
181
#define ES		%es
182
#define FS		%fs
182
#define FS		%fs
183
#define GS		%gs
183
#define GS		%gs
184
/* Control Registers */
184
/* Control Registers */
185
#define CR0		%cr0
185
#define CR0		%cr0
186
#define CR1		%cr1
186
#define CR1		%cr1
187
#define CR2		%cr2
187
#define CR2		%cr2
188
#define CR3		%cr3
188
#define CR3		%cr3
189
/* Debug Registers */
189
/* Debug Registers */
190
#define DR0		%db0
190
#define DR0		%db0
191
#define DR1		%db1
191
#define DR1		%db1
192
#define DR2		%db2
192
#define DR2		%db2
193
#define DR3		%db3
193
#define DR3		%db3
194
#define DR4		%db4
194
#define DR4		%db4
195
#define DR5		%db5
195
#define DR5		%db5
196
#define DR6		%db6
196
#define DR6		%db6
197
#define DR7		%db7
197
#define DR7		%db7
198
/* Floating-point Stack */
198
/* Floating-point Stack */
199
#define _STX0		%st(0)
199
#define _STX0		%st(0)
200
#define _STX1		%st(1)
200
#define _STX1		%st(1)
201
#define _STX2		%st(2)
201
#define _STX2		%st(2)
202
#define _STX3		%st(3)
202
#define _STX3		%st(3)
203
#define _STX4		%st(4)
203
#define _STX4		%st(4)
204
#define _STX5		%st(5)
204
#define _STX5		%st(5)
205
#define _STX6		%st(6)
205
#define _STX6		%st(6)
206
#define _STX7		%st(7)
206
#define _STX7		%st(7)
207
#define ST(x)		CONCAT(_STX,x)
207
#define ST(x)		CONCAT(_STX,x)
208
#ifdef GNU_ASSEMBLER
208
#ifdef GNU_ASSEMBLER
209
#define ST0		%st(0)
209
#define ST0		%st(0)
210
#else
210
#else
211
#define ST0		%st
211
#define ST0		%st
212
#endif
212
#endif
213
/* MMX Registers */
213
/* MMX Registers */
214
#define MM0		%mm0
214
#define MM0		%mm0
215
#define MM1		%mm1
215
#define MM1		%mm1
216
#define MM2		%mm2
216
#define MM2		%mm2
217
#define MM3		%mm3
217
#define MM3		%mm3
218
#define MM4		%mm4
218
#define MM4		%mm4
219
#define MM5		%mm5
219
#define MM5		%mm5
220
#define MM6		%mm6
220
#define MM6		%mm6
221
#define MM7		%mm7
221
#define MM7		%mm7
222
/* SSE Registers */
222
/* SSE Registers */
223
#define XMM0		%xmm0
223
#define XMM0		%xmm0
224
#define XMM1		%xmm1
224
#define XMM1		%xmm1
225
#define XMM2		%xmm2
225
#define XMM2		%xmm2
226
#define XMM3		%xmm3
226
#define XMM3		%xmm3
227
#define XMM4		%xmm4
227
#define XMM4		%xmm4
228
#define XMM5		%xmm5
228
#define XMM5		%xmm5
229
#define XMM6		%xmm6
229
#define XMM6		%xmm6
230
#define XMM7		%xmm7
230
#define XMM7		%xmm7
231
 
231
 
232
#define AS_BEGIN
232
#define AS_BEGIN
233
#define USE16
233
#define USE16
234
#define USE32
234
#define USE32
235
 
235
 
236
#ifdef GNU_ASSEMBLER
236
#ifdef GNU_ASSEMBLER
237
 
237
 
238
#define ADDR_TOGGLE	aword
238
#define ADDR_TOGGLE	aword
239
#define OPSZ_TOGGLE	word
239
#define OPSZ_TOGGLE	word
240
 
240
 
241
#define CHOICE(a,b,c)	b
241
#define CHOICE(a,b,c)	b
242
 
242
 
243
#else
243
#else
244
/*
244
/*
245
 * AT&T ASSEMBLER SYNTAX
245
 * AT&T ASSEMBLER SYNTAX
246
 * *********************
246
 * *********************
247
 */
247
 */
248
#define CHOICE(a,b,c)	a
248
#define CHOICE(a,b,c)	a
249
 
249
 
250
#define ADDR_TOGGLE	addr16
250
#define ADDR_TOGGLE	addr16
251
#define OPSZ_TOGGLE	data16
251
#define OPSZ_TOGGLE	data16
252
 
252
 
253
#endif /* GNU_ASSEMBLER */
253
#endif /* GNU_ASSEMBLER */
254
#endif /* ACK_ASSEMBLER */
254
#endif /* ACK_ASSEMBLER */
255
 
255
 
256
 
-
 
257
#if defined(__QNX__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__) || defined(__GNU__) || defined(__GNUC__) && !defined(__DJGPP__) && !defined(__MINGW32__)
-
 
258
#define GLNAME(a)	a
-
 
259
#else
-
 
260
#define GLNAME(a)	CONCAT(_,a)
256
#define GLNAME(a)   CONCAT(_,a)
261
#endif
-
 
262
 
-
 
263
 
257
 
264
	/****************************************/
258
	/****************************************/
265
	/*					*/
259
	/*					*/
266
	/*	Select the various choices	*/
260
	/*	Select the various choices	*/
267
	/*					*/
261
	/*					*/
268
	/****************************************/
262
	/****************************************/
269
 
263
 
270
 
264
 
271
/* Redefine assembler directives */
265
/* Redefine assembler directives */
272
/*********************************/
266
/*********************************/
273
#define GLOBL		CHOICE(.globl, .globl, .extern)
267
#define GLOBL		CHOICE(.globl, .globl, .extern)
274
#define GLOBAL		GLOBL
268
#define GLOBAL		GLOBL
275
#define EXTERN		GLOBL
269
#define EXTERN		GLOBL
276
#ifndef __AOUT__
270
#ifndef __AOUT__
277
#define ALIGNTEXT32	CHOICE(.align 32, .balign 32, .align 32)
271
#define ALIGNTEXT32	CHOICE(.align 32, .balign 32, .align 32)
278
#define ALIGNTEXT16	CHOICE(.align 16, .balign 16, .align 16)
272
#define ALIGNTEXT16	CHOICE(.align 16, .balign 16, .align 16)
279
#define ALIGNTEXT8	CHOICE(.align 8, .balign 8, .align 8)
273
#define ALIGNTEXT8	CHOICE(.align 8, .balign 8, .align 8)
280
#define ALIGNTEXT4	CHOICE(.align 4, .balign 4, .align 4)
274
#define ALIGNTEXT4	CHOICE(.align 4, .balign 4, .align 4)
281
#define ALIGNTEXT2	CHOICE(.align 2, .balign 2, .align 2)
275
#define ALIGNTEXT2	CHOICE(.align 2, .balign 2, .align 2)
282
/* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is
276
/* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is
283
 * guaranteed to be filled with NOPs.  Otherwise it does nothing.
277
 * guaranteed to be filled with NOPs.  Otherwise it does nothing.
284
 */
278
 */
285
#define ALIGNTEXT32ifNOP	CHOICE(.align 32, .balign ARG2(32,0x90), /*can't do it*/)
279
#define ALIGNTEXT32ifNOP	CHOICE(.align 32, .balign ARG2(32,0x90), /*can't do it*/)
286
#define ALIGNTEXT16ifNOP	CHOICE(.align 16, .balign ARG2(16,0x90), /*can't do it*/)
280
#define ALIGNTEXT16ifNOP	CHOICE(.align 16, .balign ARG2(16,0x90), /*can't do it*/)
287
#define ALIGNTEXT8ifNOP	CHOICE(.align 8, .balign ARG2(8,0x90), /*can't do it*/)
281
#define ALIGNTEXT8ifNOP	CHOICE(.align 8, .balign ARG2(8,0x90), /*can't do it*/)
288
#define ALIGNTEXT4ifNOP	CHOICE(.align 4, .balign ARG2(4,0x90), /*can't do it*/)
282
#define ALIGNTEXT4ifNOP	CHOICE(.align 4, .balign ARG2(4,0x90), /*can't do it*/)
289
#define ALIGNDATA32	CHOICE(.align 32, .balign ARG2(32,0x0), .align 32)
283
#define ALIGNDATA32	CHOICE(.align 32, .balign ARG2(32,0x0), .align 32)
290
#define ALIGNDATA16	CHOICE(.align 16, .balign ARG2(16,0x0), .align 16)
284
#define ALIGNDATA16	CHOICE(.align 16, .balign ARG2(16,0x0), .align 16)
291
#define ALIGNDATA8	CHOICE(.align 8, .balign ARG2(8,0x0), .align 8)
285
#define ALIGNDATA8	CHOICE(.align 8, .balign ARG2(8,0x0), .align 8)
292
#define ALIGNDATA4	CHOICE(.align 4, .balign ARG2(4,0x0), .align 4)
286
#define ALIGNDATA4	CHOICE(.align 4, .balign ARG2(4,0x0), .align 4)
293
#define ALIGNDATA2	CHOICE(.align 2, .balign ARG2(2,0x0), .align 2)
287
#define ALIGNDATA2	CHOICE(.align 2, .balign ARG2(2,0x0), .align 2)
294
#else
288
#else
295
/* 'as -aout' on FreeBSD doesn't have .balign */
289
/* 'as -aout' on FreeBSD doesn't have .balign */
296
#define ALIGNTEXT32	CHOICE(.align 32, .align ARG2(5,0x90), .align 32)
290
#define ALIGNTEXT32	CHOICE(.align 32, .align ARG2(5,0x90), .align 32)
297
#define ALIGNTEXT16	CHOICE(.align 16, .align ARG2(4,0x90), .align 16)
291
#define ALIGNTEXT16	CHOICE(.align 16, .align ARG2(4,0x90), .align 16)
298
#define ALIGNTEXT8	CHOICE(.align 8, .align ARG2(3,0x90), .align 8)
292
#define ALIGNTEXT8	CHOICE(.align 8, .align ARG2(3,0x90), .align 8)
299
#define ALIGNTEXT4	CHOICE(.align 4, .align ARG2(2,0x90), .align 4)
293
#define ALIGNTEXT4	CHOICE(.align 4, .align ARG2(2,0x90), .align 4)
300
#define ALIGNTEXT2	CHOICE(.align 2, .align ARG2(1,0x90), .align 2)
294
#define ALIGNTEXT2	CHOICE(.align 2, .align ARG2(1,0x90), .align 2)
301
/* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is
295
/* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is
302
 * guaranteed to be filled with NOPs.  Otherwise it does nothing.
296
 * guaranteed to be filled with NOPs.  Otherwise it does nothing.
303
 */
297
 */
304
#define ALIGNTEXT32ifNOP	CHOICE(.align 32, .align ARG2(5,0x90), /*can't do it*/)
298
#define ALIGNTEXT32ifNOP	CHOICE(.align 32, .align ARG2(5,0x90), /*can't do it*/)
305
#define ALIGNTEXT16ifNOP	CHOICE(.align 16, .align ARG2(4,0x90), /*can't do it*/)
299
#define ALIGNTEXT16ifNOP	CHOICE(.align 16, .align ARG2(4,0x90), /*can't do it*/)
306
#define ALIGNTEXT8ifNOP	CHOICE(.align 8, .align ARG2(3,0x90), /*can't do it*/)
300
#define ALIGNTEXT8ifNOP	CHOICE(.align 8, .align ARG2(3,0x90), /*can't do it*/)
307
#define ALIGNTEXT4ifNOP	CHOICE(.align 4, .align ARG2(2,0x90), /*can't do it*/)
301
#define ALIGNTEXT4ifNOP	CHOICE(.align 4, .align ARG2(2,0x90), /*can't do it*/)
308
#define ALIGNDATA32	CHOICE(.align 32, .align ARG2(5,0x0), .align 32)
302
#define ALIGNDATA32	CHOICE(.align 32, .align ARG2(5,0x0), .align 32)
309
#define ALIGNDATA16	CHOICE(.align 16, .align ARG2(4,0x0), .align 16)
303
#define ALIGNDATA16	CHOICE(.align 16, .align ARG2(4,0x0), .align 16)
310
#define ALIGNDATA8	CHOICE(.align 8, .align ARG2(3,0x0), .align 8)
304
#define ALIGNDATA8	CHOICE(.align 8, .align ARG2(3,0x0), .align 8)
311
#define ALIGNDATA4	CHOICE(.align 4, .align ARG2(2,0x0), .align 4)
305
#define ALIGNDATA4	CHOICE(.align 4, .align ARG2(2,0x0), .align 4)
312
#define ALIGNDATA2	CHOICE(.align 2, .align ARG2(1,0x0), .align 2)
306
#define ALIGNDATA2	CHOICE(.align 2, .align ARG2(1,0x0), .align 2)
313
#endif /* __AOUT__ */
307
#endif /* __AOUT__ */
314
#define FILE(s)		CHOICE(.file s, .file s, .file s)
308
#define FILE(s)		CHOICE(.file s, .file s, .file s)
315
#define STRING(s)	CHOICE(.string s, .asciz s, .asciz s)
309
#define STRING(s)	CHOICE(.string s, .asciz s, .asciz s)
316
#define D_LONG		CHOICE(.long, .long, .data4)
310
#define D_LONG		CHOICE(.long, .long, .data4)
317
#define D_WORD		CHOICE(.value, .short, .data2)
311
#define D_WORD		CHOICE(.value, .short, .data2)
318
#define D_BYTE		CHOICE(.byte, .byte, .data1)
312
#define D_BYTE		CHOICE(.byte, .byte, .data1)
319
#define SPACE		CHOICE(.comm, .space, .space)
313
#define SPACE		CHOICE(.comm, .space, .space)
320
#define COMM		CHOICE(.comm, .comm, .comm)
314
#define COMM		CHOICE(.comm, .comm, .comm)
321
#define SEG_DATA	CHOICE(.data, .data, .sect .data)
315
#define SEG_DATA	CHOICE(.data, .data, .sect .data)
322
#define SEG_TEXT	CHOICE(.text, .text, .sect .text)
316
#define SEG_TEXT	CHOICE(.text, .text, .sect .text)
323
#define SEG_BSS		CHOICE(.bss, .bss, .sect .bss)
317
#define SEG_BSS		CHOICE(.bss, .bss, .sect .bss)
324
 
318
 
325
#ifdef GNU_ASSEMBLER
319
#ifdef GNU_ASSEMBLER
326
#define D_SPACE(n)	. = . + n
320
#define D_SPACE(n)	. = . + n
327
#else
321
#else
328
#define D_SPACE(n)	.space n
322
#define D_SPACE(n)	.space n
329
#endif
323
#endif
330
 
324
 
331
/* Addressing Modes */
325
/* Addressing Modes */
332
/* Immediate Mode */
326
/* Immediate Mode */
333
#define ADDR(a)		CHOICE(CONCAT($,a), $a, a)
327
#define ADDR(a)		CHOICE(CONCAT($,a), $a, a)
334
#define CONST(a)	CHOICE(CONCAT($,a), $a, a)
328
#define CONST(a)	CHOICE(CONCAT($,a), $a, a)
335
 
329
 
336
/* Indirect Mode */
330
/* Indirect Mode */
337
#define CONTENT(a)	CHOICE(a, a, (a))	 /* take contents of variable */
331
#define CONTENT(a)	CHOICE(a, a, (a))	 /* take contents of variable */
338
#define REGIND(a)	CHOICE((a), (a), (a))	 /* Register a indirect */
332
#define REGIND(a)	CHOICE((a), (a), (a))	 /* Register a indirect */
339
/* Register b indirect plus displacement a */
333
/* Register b indirect plus displacement a */
340
#define REGOFF(a, b)	CHOICE(a(b), a(b), a(b))
334
#define REGOFF(a, b)	CHOICE(a(b), a(b), a(b))
341
/* Reg indirect Base + Index + Displacement  - this is mainly for 16-bit mode
335
/* Reg indirect Base + Index + Displacement  - this is mainly for 16-bit mode
342
 * which has no scaling
336
 * which has no scaling
343
 */
337
 */
344
#define REGBID(b,i,d)	CHOICE(d(b,i), d(b,i), d(b)(i))
338
#define REGBID(b,i,d)	CHOICE(d(b,i), d(b,i), d(b)(i))
345
/* Reg indirect Base + (Index * Scale) */
339
/* Reg indirect Base + (Index * Scale) */
346
#define REGBIS(b,i,s)	CHOICE((b,i,s), (b,i,s), (b)(i*s))
340
#define REGBIS(b,i,s)	CHOICE((b,i,s), (b,i,s), (b)(i*s))
347
/* Reg indirect Base + (Index * Scale) + Displacement */
341
/* Reg indirect Base + (Index * Scale) + Displacement */
348
#define REGBISD(b,i,s,d) CHOICE(d(b,i,s), d(b,i,s), d(b)(i*s))
342
#define REGBISD(b,i,s,d) CHOICE(d(b,i,s), d(b,i,s), d(b)(i*s))
349
/* Displaced Scaled Index: */
343
/* Displaced Scaled Index: */
350
#define REGDIS(d,i,s)	CHOICE(d(,i,s), d(,i,s), d(i * s))
344
#define REGDIS(d,i,s)	CHOICE(d(,i,s), d(,i,s), d(i * s))
351
/* Indexed Base: */
345
/* Indexed Base: */
352
#define REGBI(b,i)	CHOICE((b,i), (b,i), (b)(i))
346
#define REGBI(b,i)	CHOICE((b,i), (b,i), (b)(i))
353
/* Displaced Base: */
347
/* Displaced Base: */
354
#define REGDB(d,b)	CHOICE(d(b), d(b), d(b))
348
#define REGDB(d,b)	CHOICE(d(b), d(b), d(b))
355
/* Variable indirect: */
349
/* Variable indirect: */
356
#define VARINDIRECT(var) CHOICE(*var, *var, (var))
350
#define VARINDIRECT(var) CHOICE(*var, *var, (var))
357
/* Use register contents as jump/call target: */
351
/* Use register contents as jump/call target: */
358
#define CODEPTR(reg)	CHOICE(*reg, *reg, reg)
352
#define CODEPTR(reg)	CHOICE(*reg, *reg, reg)
359
 
353
 
360
/* For expressions requiring bracketing
354
/* For expressions requiring bracketing
361
 * eg. (CRT0_PM | CRT_EM)
355
 * eg. (CRT0_PM | CRT_EM)
362
 */
356
 */
363
 
357
 
364
#define EXPR(a)		CHOICE([a], (a), [a])
358
#define EXPR(a)		CHOICE([a], (a), [a])
365
#define ENOT(a)		CHOICE(0!a, ~a, ~a)
359
#define ENOT(a)		CHOICE(0!a, ~a, ~a)
366
#define EMUL(a,b)	CHOICE(a\*b, a*b, a*b)
360
#define EMUL(a,b)	CHOICE(a\*b, a*b, a*b)
367
#define EDIV(a,b)	CHOICE(a\/b, a/b, a/b)
361
#define EDIV(a,b)	CHOICE(a\/b, a/b, a/b)
368
 
362
 
369
/*
363
/*
370
 * We have to beat the problem of commas within arguments to choice.
364
 * We have to beat the problem of commas within arguments to choice.
371
 * eg. choice (add a,b, add b,a) will get argument mismatch.  Luckily ANSI
365
 * eg. choice (add a,b, add b,a) will get argument mismatch.  Luckily ANSI
372
 * and other known cpp definitions evaluate arguments before substitution
366
 * and other known cpp definitions evaluate arguments before substitution
373
 * so the following works.
367
 * so the following works.
374
 */
368
 */
375
#define ARG2(a, b)	a,b
369
#define ARG2(a, b)	a,b
376
#define ARG3(a,b,c)	a,b,c
370
#define ARG3(a,b,c)	a,b,c
377
 
371
 
378
/* Redefine assembler commands */
372
/* Redefine assembler commands */
379
#define AAA		CHOICE(aaa, aaa, aaa)
373
#define AAA		CHOICE(aaa, aaa, aaa)
380
#define AAD		CHOICE(aad, aad, aad)
374
#define AAD		CHOICE(aad, aad, aad)
381
#define AAM		CHOICE(aam, aam, aam)
375
#define AAM		CHOICE(aam, aam, aam)
382
#define AAS		CHOICE(aas, aas, aas)
376
#define AAS		CHOICE(aas, aas, aas)
383
#define ADC_L(a, b)	CHOICE(adcl ARG2(a,b), adcl ARG2(a,b), _LTOG adc ARG2(b,a))
377
#define ADC_L(a, b)	CHOICE(adcl ARG2(a,b), adcl ARG2(a,b), _LTOG adc ARG2(b,a))
384
#define ADC_W(a, b)	CHOICE(adcw ARG2(a,b), adcw ARG2(a,b), _WTOG adc ARG2(b,a))
378
#define ADC_W(a, b)	CHOICE(adcw ARG2(a,b), adcw ARG2(a,b), _WTOG adc ARG2(b,a))
385
#define ADC_B(a, b)	CHOICE(adcb ARG2(a,b), adcb ARG2(a,b), adcb ARG2(b,a))
379
#define ADC_B(a, b)	CHOICE(adcb ARG2(a,b), adcb ARG2(a,b), adcb ARG2(b,a))
386
#define ADD_L(a, b)	CHOICE(addl ARG2(a,b), addl ARG2(a,b), _LTOG add ARG2(b,a))
380
#define ADD_L(a, b)	CHOICE(addl ARG2(a,b), addl ARG2(a,b), _LTOG add ARG2(b,a))
387
#define ADD_W(a, b)	CHOICE(addw ARG2(a,b), addw ARG2(a,b), _WTOG add ARG2(b,a))
381
#define ADD_W(a, b)	CHOICE(addw ARG2(a,b), addw ARG2(a,b), _WTOG add ARG2(b,a))
388
#define ADD_B(a, b)	CHOICE(addb ARG2(a,b), addb ARG2(a,b), addb ARG2(b,a))
382
#define ADD_B(a, b)	CHOICE(addb ARG2(a,b), addb ARG2(a,b), addb ARG2(b,a))
389
#define AND_L(a, b)	CHOICE(andl ARG2(a,b), andl ARG2(a,b), _LTOG and ARG2(b,a))
383
#define AND_L(a, b)	CHOICE(andl ARG2(a,b), andl ARG2(a,b), _LTOG and ARG2(b,a))
390
#define AND_W(a, b)	CHOICE(andw ARG2(a,b), andw ARG2(a,b), _WTOG and ARG2(b,a))
384
#define AND_W(a, b)	CHOICE(andw ARG2(a,b), andw ARG2(a,b), _WTOG and ARG2(b,a))
391
#define AND_B(a, b)	CHOICE(andb ARG2(a,b), andb ARG2(a,b), andb ARG2(b,a))
385
#define AND_B(a, b)	CHOICE(andb ARG2(a,b), andb ARG2(a,b), andb ARG2(b,a))
392
#define ARPL(a,b)	CHOICE(arpl ARG2(a,b), arpl ARG2(a,b), arpl ARG2(b,a))
386
#define ARPL(a,b)	CHOICE(arpl ARG2(a,b), arpl ARG2(a,b), arpl ARG2(b,a))
393
#define BOUND_L(a, b)	CHOICE(boundl ARG2(a,b), boundl ARG2(b,a), _LTOG bound ARG2(b,a))
387
#define BOUND_L(a, b)	CHOICE(boundl ARG2(a,b), boundl ARG2(b,a), _LTOG bound ARG2(b,a))
394
#define BOUND_W(a, b)	CHOICE(boundw ARG2(a,b), boundw ARG2(b,a), _WTOG bound ARG2(b,a))
388
#define BOUND_W(a, b)	CHOICE(boundw ARG2(a,b), boundw ARG2(b,a), _WTOG bound ARG2(b,a))
395
#define BSF_L(a, b)	CHOICE(bsfl ARG2(a,b), bsfl ARG2(a,b), _LTOG bsf ARG2(b,a))
389
#define BSF_L(a, b)	CHOICE(bsfl ARG2(a,b), bsfl ARG2(a,b), _LTOG bsf ARG2(b,a))
396
#define BSF_W(a, b)	CHOICE(bsfw ARG2(a,b), bsfw ARG2(a,b), _WTOG bsf ARG2(b,a))
390
#define BSF_W(a, b)	CHOICE(bsfw ARG2(a,b), bsfw ARG2(a,b), _WTOG bsf ARG2(b,a))
397
#define BSR_L(a, b)	CHOICE(bsrl ARG2(a,b), bsrl ARG2(a,b), _LTOG bsr ARG2(b,a))
391
#define BSR_L(a, b)	CHOICE(bsrl ARG2(a,b), bsrl ARG2(a,b), _LTOG bsr ARG2(b,a))
398
#define BSR_W(a, b)	CHOICE(bsrw ARG2(a,b), bsrw ARG2(a,b), _WTOG bsr ARG2(b,a))
392
#define BSR_W(a, b)	CHOICE(bsrw ARG2(a,b), bsrw ARG2(a,b), _WTOG bsr ARG2(b,a))
399
#define BT_L(a, b)	CHOICE(btl ARG2(a,b), btl ARG2(a,b), _LTOG bt ARG2(b,a))
393
#define BT_L(a, b)	CHOICE(btl ARG2(a,b), btl ARG2(a,b), _LTOG bt ARG2(b,a))
400
#define BT_W(a, b)	CHOICE(btw ARG2(a,b), btw ARG2(a,b), _WTOG bt ARG2(b,a))
394
#define BT_W(a, b)	CHOICE(btw ARG2(a,b), btw ARG2(a,b), _WTOG bt ARG2(b,a))
401
#define BTC_L(a, b)	CHOICE(btcl ARG2(a,b), btcl ARG2(a,b), _LTOG btc ARG2(b,a))
395
#define BTC_L(a, b)	CHOICE(btcl ARG2(a,b), btcl ARG2(a,b), _LTOG btc ARG2(b,a))
402
#define BTC_W(a, b)	CHOICE(btcw ARG2(a,b), btcw ARG2(a,b), _WTOG btc ARG2(b,a))
396
#define BTC_W(a, b)	CHOICE(btcw ARG2(a,b), btcw ARG2(a,b), _WTOG btc ARG2(b,a))
403
#define BTR_L(a, b)	CHOICE(btrl ARG2(a,b), btrl ARG2(a,b), _LTOG btr ARG2(b,a))
397
#define BTR_L(a, b)	CHOICE(btrl ARG2(a,b), btrl ARG2(a,b), _LTOG btr ARG2(b,a))
404
#define BTR_W(a, b)	CHOICE(btrw ARG2(a,b), btrw ARG2(a,b), _WTOG btr ARG2(b,a))
398
#define BTR_W(a, b)	CHOICE(btrw ARG2(a,b), btrw ARG2(a,b), _WTOG btr ARG2(b,a))
405
#define BTS_L(a, b)	CHOICE(btsl ARG2(a,b), btsl ARG2(a,b), _LTOG bts ARG2(b,a))
399
#define BTS_L(a, b)	CHOICE(btsl ARG2(a,b), btsl ARG2(a,b), _LTOG bts ARG2(b,a))
406
#define BTS_W(a, b)	CHOICE(btsw ARG2(a,b), btsw ARG2(a,b), _WTOG bts ARG2(b,a))
400
#define BTS_W(a, b)	CHOICE(btsw ARG2(a,b), btsw ARG2(a,b), _WTOG bts ARG2(b,a))
407
#define CALL(a)		CHOICE(call a, call a, call a)
401
#define CALL(a)		CHOICE(call a, call a, call a)
408
#define CALLF(s,a)	CHOICE(lcall ARG2(s,a), lcall ARG2(s,a), callf s:a)
402
#define CALLF(s,a)	CHOICE(lcall ARG2(s,a), lcall ARG2(s,a), callf s:a)
409
#define CBW		CHOICE(cbtw, cbw, cbw)
403
#define CBW		CHOICE(cbtw, cbw, cbw)
410
#define CWDE		CHOICE(cwtd, cwde, cwde)
404
#define CWDE		CHOICE(cwtd, cwde, cwde)
411
#define CLC		CHOICE(clc, clc, clc)
405
#define CLC		CHOICE(clc, clc, clc)
412
#define CLD		CHOICE(cld, cld, cld)
406
#define CLD		CHOICE(cld, cld, cld)
413
#define CLI		CHOICE(cli, cli, cli)
407
#define CLI		CHOICE(cli, cli, cli)
414
#define CLTS		CHOICE(clts, clts, clts)
408
#define CLTS		CHOICE(clts, clts, clts)
415
#define CMC		CHOICE(cmc, cmc, cmc)
409
#define CMC		CHOICE(cmc, cmc, cmc)
416
#define CMP_L(a, b)	CHOICE(cmpl ARG2(a,b), cmpl ARG2(a,b), _LTOG cmp ARG2(b,a))
410
#define CMP_L(a, b)	CHOICE(cmpl ARG2(a,b), cmpl ARG2(a,b), _LTOG cmp ARG2(b,a))
417
#define CMP_W(a, b)	CHOICE(cmpw ARG2(a,b), cmpw ARG2(a,b), _WTOG cmp ARG2(b,a))
411
#define CMP_W(a, b)	CHOICE(cmpw ARG2(a,b), cmpw ARG2(a,b), _WTOG cmp ARG2(b,a))
418
#define CMP_B(a, b)	CHOICE(cmpb ARG2(a,b), cmpb ARG2(a,b), cmpb ARG2(b,a))
412
#define CMP_B(a, b)	CHOICE(cmpb ARG2(a,b), cmpb ARG2(a,b), cmpb ARG2(b,a))
419
#define CMPS_L		CHOICE(cmpsl, cmpsl, _LTOG cmps)
413
#define CMPS_L		CHOICE(cmpsl, cmpsl, _LTOG cmps)
420
#define CMPS_W		CHOICE(cmpsw, cmpsw, _WTOG cmps)
414
#define CMPS_W		CHOICE(cmpsw, cmpsw, _WTOG cmps)
421
#define CMPS_B		CHOICE(cmpsb, cmpsb, cmpsb)
415
#define CMPS_B		CHOICE(cmpsb, cmpsb, cmpsb)
422
#define CWD		CHOICE(cwtl, cwd, cwd)
416
#define CWD		CHOICE(cwtl, cwd, cwd)
423
#define CDQ		CHOICE(cltd, cdq, cdq)
417
#define CDQ		CHOICE(cltd, cdq, cdq)
424
#define DAA		CHOICE(daa, daa, daa)
418
#define DAA		CHOICE(daa, daa, daa)
425
#define DAS		CHOICE(das, das, das)
419
#define DAS		CHOICE(das, das, das)
426
#define DEC_L(a)	CHOICE(decl a, decl a, _LTOG dec a)
420
#define DEC_L(a)	CHOICE(decl a, decl a, _LTOG dec a)
427
#define DEC_W(a)	CHOICE(decw a, decw a, _WTOG dec a)
421
#define DEC_W(a)	CHOICE(decw a, decw a, _WTOG dec a)
428
#define DEC_B(a)	CHOICE(decb a, decb a, decb a)
422
#define DEC_B(a)	CHOICE(decb a, decb a, decb a)
429
#define DIV_L(a)	CHOICE(divl a, divl a, div a)
423
#define DIV_L(a)	CHOICE(divl a, divl a, div a)
430
#define DIV_W(a)	CHOICE(divw a, divw a, div a)
424
#define DIV_W(a)	CHOICE(divw a, divw a, div a)
431
#define DIV_B(a)	CHOICE(divb a, divb a, divb a)
425
#define DIV_B(a)	CHOICE(divb a, divb a, divb a)
432
#define ENTER(a,b)	CHOICE(enter ARG2(a,b), enter ARG2(a,b), enter ARG2(b,a))
426
#define ENTER(a,b)	CHOICE(enter ARG2(a,b), enter ARG2(a,b), enter ARG2(b,a))
433
#define HLT		CHOICE(hlt, hlt, hlt)
427
#define HLT		CHOICE(hlt, hlt, hlt)
434
#define IDIV_L(a)	CHOICE(idivl a, idivl a, _LTOG idiv a)
428
#define IDIV_L(a)	CHOICE(idivl a, idivl a, _LTOG idiv a)
435
#define IDIV_W(a)	CHOICE(idivw a, idivw a, _WTOG idiv a)
429
#define IDIV_W(a)	CHOICE(idivw a, idivw a, _WTOG idiv a)
436
#define IDIV_B(a)	CHOICE(idivb a, idivb a, idivb a)
430
#define IDIV_B(a)	CHOICE(idivb a, idivb a, idivb a)
437
/* More forms than this for imul!! */
431
/* More forms than this for imul!! */
438
#define IMUL_L(a, b)	CHOICE(imull ARG2(a,b), imull ARG2(a,b), _LTOG imul ARG2(b,a))
432
#define IMUL_L(a, b)	CHOICE(imull ARG2(a,b), imull ARG2(a,b), _LTOG imul ARG2(b,a))
439
#define IMUL_W(a, b)	CHOICE(imulw ARG2(a,b), imulw ARG2(a,b), _WTOG imul ARG2(b,a))
433
#define IMUL_W(a, b)	CHOICE(imulw ARG2(a,b), imulw ARG2(a,b), _WTOG imul ARG2(b,a))
440
#define IMUL_B(a)	CHOICE(imulb a, imulb a, imulb a)
434
#define IMUL_B(a)	CHOICE(imulb a, imulb a, imulb a)
441
#define IN_L		CHOICE(inl (DX), inl ARG2(DX,EAX), _LTOG in DX)
435
#define IN_L		CHOICE(inl (DX), inl ARG2(DX,EAX), _LTOG in DX)
442
#define IN_W		CHOICE(inw (DX), inw ARG2(DX,AX), _WTOG in DX)
436
#define IN_W		CHOICE(inw (DX), inw ARG2(DX,AX), _WTOG in DX)
443
#define IN_B		CHOICE(inb (DX), inb ARG2(DX,AL), inb DX)
437
#define IN_B		CHOICE(inb (DX), inb ARG2(DX,AL), inb DX)
444
/* Please AS code writer: use the following ONLY, if you refer to ports<256
438
/* Please AS code writer: use the following ONLY, if you refer to ports<256
445
 * directly, but not in IN1_W(DX), for instance, even if IN1_ looks nicer
439
 * directly, but not in IN1_W(DX), for instance, even if IN1_ looks nicer
446
 */
440
 */
447
#if defined (sun)
441
#if defined (sun)
448
#define IN1_L(a)	CHOICE(inl (a), inl ARG2(a,EAX), _LTOG in a)
442
#define IN1_L(a)	CHOICE(inl (a), inl ARG2(a,EAX), _LTOG in a)
449
#define IN1_W(a)	CHOICE(inw (a), inw ARG2(a,AX), _WTOG in a)
443
#define IN1_W(a)	CHOICE(inw (a), inw ARG2(a,AX), _WTOG in a)
450
#define IN1_B(a)	CHOICE(inb (a), inb ARG2(a,AL), inb a)
444
#define IN1_B(a)	CHOICE(inb (a), inb ARG2(a,AL), inb a)
451
#else
445
#else
452
#define IN1_L(a)	CHOICE(inl a, inl ARG2(a,EAX), _LTOG in a)
446
#define IN1_L(a)	CHOICE(inl a, inl ARG2(a,EAX), _LTOG in a)
453
#define IN1_W(a)	CHOICE(inw a, inw ARG2(a,AX), _WTOG in a)
447
#define IN1_W(a)	CHOICE(inw a, inw ARG2(a,AX), _WTOG in a)
454
#define IN1_B(a)	CHOICE(inb a, inb ARG2(a,AL), inb a)
448
#define IN1_B(a)	CHOICE(inb a, inb ARG2(a,AL), inb a)
455
#endif
449
#endif
456
#define INC_L(a)	CHOICE(incl a, incl a, _LTOG inc a)
450
#define INC_L(a)	CHOICE(incl a, incl a, _LTOG inc a)
457
#define INC_W(a)	CHOICE(incw a, incw a, _WTOG inc a)
451
#define INC_W(a)	CHOICE(incw a, incw a, _WTOG inc a)
458
#define INC_B(a)	CHOICE(incb a, incb a, incb a)
452
#define INC_B(a)	CHOICE(incb a, incb a, incb a)
459
#define INS_L		CHOICE(insl, insl, _LTOG ins)
453
#define INS_L		CHOICE(insl, insl, _LTOG ins)
460
#define INS_W		CHOICE(insw, insw, _WTOG ins)
454
#define INS_W		CHOICE(insw, insw, _WTOG ins)
461
#define INS_B		CHOICE(insb, insb, insb)
455
#define INS_B		CHOICE(insb, insb, insb)
462
#define INT(a)		CHOICE(int a, int a, int a)
456
#define INT(a)		CHOICE(int a, int a, int a)
463
#define INT3		CHOICE(int CONST(3), int3, int CONST(3))
457
#define INT3		CHOICE(int CONST(3), int3, int CONST(3))
464
#define INTO		CHOICE(into, into, into)
458
#define INTO		CHOICE(into, into, into)
465
#define IRET		CHOICE(iret, iret, iret)
459
#define IRET		CHOICE(iret, iret, iret)
466
#define IRETD		CHOICE(iret, iret, iretd)
460
#define IRETD		CHOICE(iret, iret, iretd)
467
#define JA(a)		CHOICE(ja a, ja a, ja a)
461
#define JA(a)		CHOICE(ja a, ja a, ja a)
468
#define JAE(a)		CHOICE(jae a, jae a, jae a)
462
#define JAE(a)		CHOICE(jae a, jae a, jae a)
469
#define JB(a)		CHOICE(jb a, jb a, jb a)
463
#define JB(a)		CHOICE(jb a, jb a, jb a)
470
#define JBE(a)		CHOICE(jbe a, jbe a, jbe a)
464
#define JBE(a)		CHOICE(jbe a, jbe a, jbe a)
471
#define JC(a)		CHOICE(jc a, jc a, jc a)
465
#define JC(a)		CHOICE(jc a, jc a, jc a)
472
#define JE(a)		CHOICE(je a, je a, je a)
466
#define JE(a)		CHOICE(je a, je a, je a)
473
#define JG(a)		CHOICE(jg a, jg a, jg a)
467
#define JG(a)		CHOICE(jg a, jg a, jg a)
474
#define JGE(a)		CHOICE(jge a, jge a, jge a)
468
#define JGE(a)		CHOICE(jge a, jge a, jge a)
475
#define JL(a)		CHOICE(jl a, jl a, jl a)
469
#define JL(a)		CHOICE(jl a, jl a, jl a)
476
#define JLE(a)		CHOICE(jle a, jle a, jle a)
470
#define JLE(a)		CHOICE(jle a, jle a, jle a)
477
#define JNA(a)		CHOICE(jna a, jna a, jna a)
471
#define JNA(a)		CHOICE(jna a, jna a, jna a)
478
#define JNAE(a)		CHOICE(jnae a, jnae a, jnae a)
472
#define JNAE(a)		CHOICE(jnae a, jnae a, jnae a)
479
#define JNB(a)		CHOICE(jnb a, jnb a, jnb a)
473
#define JNB(a)		CHOICE(jnb a, jnb a, jnb a)
480
#define JNBE(a)		CHOICE(jnbe a, jnbe a, jnbe a)
474
#define JNBE(a)		CHOICE(jnbe a, jnbe a, jnbe a)
481
#define JNC(a)		CHOICE(jnc a, jnc a, jnc a)
475
#define JNC(a)		CHOICE(jnc a, jnc a, jnc a)
482
#define JNE(a)		CHOICE(jne a, jne a, jne a)
476
#define JNE(a)		CHOICE(jne a, jne a, jne a)
483
#define JNG(a)		CHOICE(jng a, jng a, jng a)
477
#define JNG(a)		CHOICE(jng a, jng a, jng a)
484
#define JNGE(a)		CHOICE(jnge a, jnge a, jnge a)
478
#define JNGE(a)		CHOICE(jnge a, jnge a, jnge a)
485
#define JNL(a)		CHOICE(jnl a, jnl a, jnl a)
479
#define JNL(a)		CHOICE(jnl a, jnl a, jnl a)
486
#define JNLE(a)		CHOICE(jnle a, jnle a, jnle a)
480
#define JNLE(a)		CHOICE(jnle a, jnle a, jnle a)
487
#define JNO(a)		CHOICE(jno a, jno a, jno a)
481
#define JNO(a)		CHOICE(jno a, jno a, jno a)
488
#define JNP(a)		CHOICE(jnp a, jnp a, jnp a)
482
#define JNP(a)		CHOICE(jnp a, jnp a, jnp a)
489
#define JNS(a)		CHOICE(jns a, jns a, jns a)
483
#define JNS(a)		CHOICE(jns a, jns a, jns a)
490
#define JNZ(a)		CHOICE(jnz a, jnz a, jnz a)
484
#define JNZ(a)		CHOICE(jnz a, jnz a, jnz a)
491
#define JO(a)		CHOICE(jo a, jo a, jo a)
485
#define JO(a)		CHOICE(jo a, jo a, jo a)
492
#define JP(a)		CHOICE(jp a, jp a, jp a)
486
#define JP(a)		CHOICE(jp a, jp a, jp a)
493
#define JPE(a)		CHOICE(jpe a, jpe a, jpe a)
487
#define JPE(a)		CHOICE(jpe a, jpe a, jpe a)
494
#define JPO(a)		CHOICE(jpo a, jpo a, jpo a)
488
#define JPO(a)		CHOICE(jpo a, jpo a, jpo a)
495
#define JS(a)		CHOICE(js a, js a, js a)
489
#define JS(a)		CHOICE(js a, js a, js a)
496
#define JZ(a)		CHOICE(jz a, jz a, jz a)
490
#define JZ(a)		CHOICE(jz a, jz a, jz a)
497
#define JMP(a)		CHOICE(jmp a, jmp a, jmp a)
491
#define JMP(a)		CHOICE(jmp a, jmp a, jmp a)
498
#define JMPF(s,a)	CHOICE(ljmp ARG2(s,a), ljmp ARG2(s,a), jmpf s:a)
492
#define JMPF(s,a)	CHOICE(ljmp ARG2(s,a), ljmp ARG2(s,a), jmpf s:a)
499
#define LAHF		CHOICE(lahf, lahf, lahf)
493
#define LAHF		CHOICE(lahf, lahf, lahf)
500
#if !defined(_REAL_MODE) && !defined(_V86_MODE)
494
#if !defined(_REAL_MODE) && !defined(_V86_MODE)
501
#define LAR(a, b)	CHOICE(lar ARG2(a, b), lar ARG2(a, b), lar ARG2(b, a))
495
#define LAR(a, b)	CHOICE(lar ARG2(a, b), lar ARG2(a, b), lar ARG2(b, a))
502
#endif
496
#endif
503
#define LEA_L(a, b)	CHOICE(leal ARG2(a,b), leal ARG2(a,b), _LTOG lea ARG2(b,a))
497
#define LEA_L(a, b)	CHOICE(leal ARG2(a,b), leal ARG2(a,b), _LTOG lea ARG2(b,a))
504
#define LEA_W(a, b)	CHOICE(leaw ARG2(a,b), leaw ARG2(a,b), _WTOG lea ARG2(b,a))
498
#define LEA_W(a, b)	CHOICE(leaw ARG2(a,b), leaw ARG2(a,b), _WTOG lea ARG2(b,a))
505
#define LEAVE		CHOICE(leave, leave, leave)
499
#define LEAVE		CHOICE(leave, leave, leave)
506
#define LGDT(a)		CHOICE(lgdt a, lgdt a, lgdt a)
500
#define LGDT(a)		CHOICE(lgdt a, lgdt a, lgdt a)
507
#define LIDT(a)		CHOICE(lidt a, lidt a, lidt a)
501
#define LIDT(a)		CHOICE(lidt a, lidt a, lidt a)
508
#define LDS(a, b)	CHOICE(ldsl ARG2(a,b), lds ARG2(a,b), lds ARG2(b,a))
502
#define LDS(a, b)	CHOICE(ldsl ARG2(a,b), lds ARG2(a,b), lds ARG2(b,a))
509
#define LES(a, b)	CHOICE(lesl ARG2(a,b), les ARG2(a,b), les ARG2(b,a))
503
#define LES(a, b)	CHOICE(lesl ARG2(a,b), les ARG2(a,b), les ARG2(b,a))
510
#define LFS(a, b)	CHOICE(lfsl ARG2(a,b), lfs ARG2(a,b), lfs ARG2(b,a))
504
#define LFS(a, b)	CHOICE(lfsl ARG2(a,b), lfs ARG2(a,b), lfs ARG2(b,a))
511
#define LGS(a, b)	CHOICE(lgsl ARG2(a,b), lgs ARG2(a,b), lgs ARG2(b,a))
505
#define LGS(a, b)	CHOICE(lgsl ARG2(a,b), lgs ARG2(a,b), lgs ARG2(b,a))
512
#define LSS(a, b)	CHOICE(lssl ARG2(a,b), lss ARG2(a,b), lss ARG2(b,a))
506
#define LSS(a, b)	CHOICE(lssl ARG2(a,b), lss ARG2(a,b), lss ARG2(b,a))
513
#define LLDT(a)		CHOICE(lldt a, lldt a, lldt a)
507
#define LLDT(a)		CHOICE(lldt a, lldt a, lldt a)
514
#define LMSW(a)		CHOICE(lmsw a, lmsw a, lmsw a)
508
#define LMSW(a)		CHOICE(lmsw a, lmsw a, lmsw a)
515
#define LOCK		CHOICE(lock, lock, lock)
509
#define LOCK		CHOICE(lock, lock, lock)
516
#define LODS_L		CHOICE(lodsl, lodsl, _LTOG lods)
510
#define LODS_L		CHOICE(lodsl, lodsl, _LTOG lods)
517
#define LODS_W		CHOICE(lodsw, lodsw, _WTOG lods)
511
#define LODS_W		CHOICE(lodsw, lodsw, _WTOG lods)
518
#define LODS_B		CHOICE(lodsb, lodsb, lodsb)
512
#define LODS_B		CHOICE(lodsb, lodsb, lodsb)
519
#define LOOP(a)		CHOICE(loop a, loop a, loop a)
513
#define LOOP(a)		CHOICE(loop a, loop a, loop a)
520
#define LOOPE(a)	CHOICE(loope a, loope a, loope a)
514
#define LOOPE(a)	CHOICE(loope a, loope a, loope a)
521
#define LOOPZ(a)	CHOICE(loopz a, loopz a, loopz a)
515
#define LOOPZ(a)	CHOICE(loopz a, loopz a, loopz a)
522
#define LOOPNE(a)	CHOICE(loopne a, loopne a, loopne a)
516
#define LOOPNE(a)	CHOICE(loopne a, loopne a, loopne a)
523
#define LOOPNZ(a)	CHOICE(loopnz a, loopnz a, loopnz a)
517
#define LOOPNZ(a)	CHOICE(loopnz a, loopnz a, loopnz a)
524
#if !defined(_REAL_MODE) && !defined(_V86_MODE)
518
#if !defined(_REAL_MODE) && !defined(_V86_MODE)
525
#define LSL(a, b)	CHOICE(lsl ARG2(a,b), lsl ARG2(a,b), lsl ARG2(b,a))
519
#define LSL(a, b)	CHOICE(lsl ARG2(a,b), lsl ARG2(a,b), lsl ARG2(b,a))
526
#endif
520
#endif
527
#define LTR(a)		CHOICE(ltr a, ltr a, ltr a)
521
#define LTR(a)		CHOICE(ltr a, ltr a, ltr a)
528
#define MOV_SR(a, b)	CHOICE(movw ARG2(a,b), mov ARG2(a,b), mov ARG2(b,a))
522
#define MOV_SR(a, b)	CHOICE(movw ARG2(a,b), mov ARG2(a,b), mov ARG2(b,a))
529
#define MOV_L(a, b)	CHOICE(movl ARG2(a,b), movl ARG2(a,b), _LTOG mov ARG2(b,a))
523
#define MOV_L(a, b)	CHOICE(movl ARG2(a,b), movl ARG2(a,b), _LTOG mov ARG2(b,a))
530
#define MOV_W(a, b)	CHOICE(movw ARG2(a,b), movw ARG2(a,b), _WTOG mov ARG2(b,a))
524
#define MOV_W(a, b)	CHOICE(movw ARG2(a,b), movw ARG2(a,b), _WTOG mov ARG2(b,a))
531
#define MOV_B(a, b)	CHOICE(movb ARG2(a,b), movb ARG2(a,b), movb ARG2(b,a))
525
#define MOV_B(a, b)	CHOICE(movb ARG2(a,b), movb ARG2(a,b), movb ARG2(b,a))
532
#define MOVS_L		CHOICE(movsl, movsl, _LTOG movs)
526
#define MOVS_L		CHOICE(movsl, movsl, _LTOG movs)
533
#define MOVS_W		CHOICE(movsw, movsw, _WTOG movs)
527
#define MOVS_W		CHOICE(movsw, movsw, _WTOG movs)
534
#define MOVS_B		CHOICE(movsb, movsb, movsb)
528
#define MOVS_B		CHOICE(movsb, movsb, movsb)
535
#define MOVSX_BL(a, b)	CHOICE(movsbl ARG2(a,b), movsbl ARG2(a,b), movsx ARG2(b,a))
529
#define MOVSX_BL(a, b)	CHOICE(movsbl ARG2(a,b), movsbl ARG2(a,b), movsx ARG2(b,a))
536
#define MOVSX_BW(a, b)	CHOICE(movsbw ARG2(a,b), movsbw ARG2(a,b), movsx ARG2(b,a))
530
#define MOVSX_BW(a, b)	CHOICE(movsbw ARG2(a,b), movsbw ARG2(a,b), movsx ARG2(b,a))
537
#define MOVSX_WL(a, b)	CHOICE(movswl ARG2(a,b), movswl ARG2(a,b), movsx ARG2(b,a))
531
#define MOVSX_WL(a, b)	CHOICE(movswl ARG2(a,b), movswl ARG2(a,b), movsx ARG2(b,a))
538
#define MOVZX_BL(a, b)	CHOICE(movzbl ARG2(a,b), movzbl ARG2(a,b), movzx ARG2(b,a))
532
#define MOVZX_BL(a, b)	CHOICE(movzbl ARG2(a,b), movzbl ARG2(a,b), movzx ARG2(b,a))
539
#define MOVZX_BW(a, b)	CHOICE(movzbw ARG2(a,b), movzbw ARG2(a,b), movzx ARG2(b,a))
533
#define MOVZX_BW(a, b)	CHOICE(movzbw ARG2(a,b), movzbw ARG2(a,b), movzx ARG2(b,a))
540
#define MOVZX_WL(a, b)	CHOICE(movzwl ARG2(a,b), movzwl ARG2(a,b), movzx ARG2(b,a))
534
#define MOVZX_WL(a, b)	CHOICE(movzwl ARG2(a,b), movzwl ARG2(a,b), movzx ARG2(b,a))
541
#define MUL_L(a)	CHOICE(mull a, mull a, _LTOG mul a)
535
#define MUL_L(a)	CHOICE(mull a, mull a, _LTOG mul a)
542
#define MUL_W(a)	CHOICE(mulw a, mulw a, _WTOG mul a)
536
#define MUL_W(a)	CHOICE(mulw a, mulw a, _WTOG mul a)
543
#define MUL_B(a)	CHOICE(mulb a, mulb a, mulb a)
537
#define MUL_B(a)	CHOICE(mulb a, mulb a, mulb a)
544
#define NEG_L(a)	CHOICE(negl a, negl a, _LTOG neg a)
538
#define NEG_L(a)	CHOICE(negl a, negl a, _LTOG neg a)
545
#define NEG_W(a)	CHOICE(negw a, negw a, _WTOG neg a)
539
#define NEG_W(a)	CHOICE(negw a, negw a, _WTOG neg a)
546
#define NEG_B(a)	CHOICE(negb a, negb a, negb a)
540
#define NEG_B(a)	CHOICE(negb a, negb a, negb a)
547
#define NOP		CHOICE(nop, nop, nop)
541
#define NOP		CHOICE(nop, nop, nop)
548
#define NOT_L(a)	CHOICE(notl a, notl a, _LTOG not a)
542
#define NOT_L(a)	CHOICE(notl a, notl a, _LTOG not a)
549
#define NOT_W(a)	CHOICE(notw a, notw a, _WTOG not a)
543
#define NOT_W(a)	CHOICE(notw a, notw a, _WTOG not a)
550
#define NOT_B(a)	CHOICE(notb a, notb a, notb a)
544
#define NOT_B(a)	CHOICE(notb a, notb a, notb a)
551
#define OR_L(a,b)	CHOICE(orl ARG2(a,b), orl ARG2(a,b), _LTOG or ARG2(b,a))
545
#define OR_L(a,b)	CHOICE(orl ARG2(a,b), orl ARG2(a,b), _LTOG or ARG2(b,a))
552
#define OR_W(a,b)	CHOICE(orw ARG2(a,b), orw ARG2(a,b), _WTOG or ARG2(b,a))
546
#define OR_W(a,b)	CHOICE(orw ARG2(a,b), orw ARG2(a,b), _WTOG or ARG2(b,a))
553
#define OR_B(a,b)	CHOICE(orb ARG2(a,b), orb ARG2(a,b), orb ARG2(b,a))
547
#define OR_B(a,b)	CHOICE(orb ARG2(a,b), orb ARG2(a,b), orb ARG2(b,a))
554
#define OUT_L		CHOICE(outl (DX), outl ARG2(EAX,DX), _LTOG out DX)
548
#define OUT_L		CHOICE(outl (DX), outl ARG2(EAX,DX), _LTOG out DX)
555
#define OUT_W		CHOICE(outw (DX), outw ARG2(AX,DX), _WTOG out DX)
549
#define OUT_W		CHOICE(outw (DX), outw ARG2(AX,DX), _WTOG out DX)
556
#define OUT_B		CHOICE(outb (DX), outb ARG2(AL,DX), outb DX)
550
#define OUT_B		CHOICE(outb (DX), outb ARG2(AL,DX), outb DX)
557
/* Please AS code writer: use the following ONLY, if you refer to ports<256
551
/* Please AS code writer: use the following ONLY, if you refer to ports<256
558
 * directly, but not in OUT1_W(DX), for instance, even if OUT1_ looks nicer
552
 * directly, but not in OUT1_W(DX), for instance, even if OUT1_ looks nicer
559
 */
553
 */
560
#define OUT1_L(a)	CHOICE(outl (a), outl ARG2(EAX,a), _LTOG out a)
554
#define OUT1_L(a)	CHOICE(outl (a), outl ARG2(EAX,a), _LTOG out a)
561
#define OUT1_W(a)	CHOICE(outw (a), outw ARG2(AX,a), _WTOG out a)
555
#define OUT1_W(a)	CHOICE(outw (a), outw ARG2(AX,a), _WTOG out a)
562
#define OUT1_B(a)	CHOICE(outb (a), outb ARG2(AL,a), outb a)
556
#define OUT1_B(a)	CHOICE(outb (a), outb ARG2(AL,a), outb a)
563
#define OUTS_L		CHOICE(outsl, outsl, _LTOG outs)
557
#define OUTS_L		CHOICE(outsl, outsl, _LTOG outs)
564
#define OUTS_W		CHOICE(outsw, outsw, _WTOG outs)
558
#define OUTS_W		CHOICE(outsw, outsw, _WTOG outs)
565
#define OUTS_B		CHOICE(outsb, outsb, outsb)
559
#define OUTS_B		CHOICE(outsb, outsb, outsb)
566
#define POP_SR(a)	CHOICE(pop a, pop a, pop a)
560
#define POP_SR(a)	CHOICE(pop a, pop a, pop a)
567
#define POP_L(a)	CHOICE(popl a, popl a, _LTOG pop a)
561
#define POP_L(a)	CHOICE(popl a, popl a, _LTOG pop a)
568
#define POP_W(a)	CHOICE(popw a, popw a, _WTOG pop a)
562
#define POP_W(a)	CHOICE(popw a, popw a, _WTOG pop a)
569
#define POPA_L		CHOICE(popal, popal, _LTOG popa)
563
#define POPA_L		CHOICE(popal, popal, _LTOG popa)
570
#define POPA_W		CHOICE(popaw, popaw, _WTOG popa)
564
#define POPA_W		CHOICE(popaw, popaw, _WTOG popa)
571
#define POPF_L		CHOICE(popfl, popfl, _LTOG popf)
565
#define POPF_L		CHOICE(popfl, popfl, _LTOG popf)
572
#define POPF_W		CHOICE(popfw, popfw, _WTOG popf)
566
#define POPF_W		CHOICE(popfw, popfw, _WTOG popf)
573
#define PUSH_SR(a)	CHOICE(push a, push a, push a)
567
#define PUSH_SR(a)	CHOICE(push a, push a, push a)
574
#define PUSH_L(a)	CHOICE(pushl a, pushl a, _LTOG push a)
568
#define PUSH_L(a)	CHOICE(pushl a, pushl a, _LTOG push a)
575
#define PUSH_W(a)	CHOICE(pushw a, pushw a, _WTOG push a)
569
#define PUSH_W(a)	CHOICE(pushw a, pushw a, _WTOG push a)
576
#define PUSH_B(a)	CHOICE(push a, pushb a, push a)
570
#define PUSH_B(a)	CHOICE(push a, pushb a, push a)
577
#define PUSHA_L		CHOICE(pushal, pushal, _LTOG pusha)
571
#define PUSHA_L		CHOICE(pushal, pushal, _LTOG pusha)
578
#define PUSHA_W		CHOICE(pushaw, pushaw, _WTOG pusha)
572
#define PUSHA_W		CHOICE(pushaw, pushaw, _WTOG pusha)
579
#define PUSHF_L		CHOICE(pushfl, pushfl, _LTOG pushf)
573
#define PUSHF_L		CHOICE(pushfl, pushfl, _LTOG pushf)
580
#define PUSHF_W		CHOICE(pushfw, pushfw, _WTOG pushf)
574
#define PUSHF_W		CHOICE(pushfw, pushfw, _WTOG pushf)
581
#define RCL_L(a, b)	CHOICE(rcll ARG2(a,b), rcll ARG2(a,b), _LTOG rcl ARG2(b,a))
575
#define RCL_L(a, b)	CHOICE(rcll ARG2(a,b), rcll ARG2(a,b), _LTOG rcl ARG2(b,a))
582
#define RCL_W(a, b)	CHOICE(rclw ARG2(a,b), rclw ARG2(a,b), _WTOG rcl ARG2(b,a))
576
#define RCL_W(a, b)	CHOICE(rclw ARG2(a,b), rclw ARG2(a,b), _WTOG rcl ARG2(b,a))
583
#define RCL_B(a, b)	CHOICE(rclb ARG2(a,b), rclb ARG2(a,b), rclb ARG2(b,a))
577
#define RCL_B(a, b)	CHOICE(rclb ARG2(a,b), rclb ARG2(a,b), rclb ARG2(b,a))
584
#define RCR_L(a, b)	CHOICE(rcrl ARG2(a,b), rcrl ARG2(a,b), _LTOG rcr ARG2(b,a))
578
#define RCR_L(a, b)	CHOICE(rcrl ARG2(a,b), rcrl ARG2(a,b), _LTOG rcr ARG2(b,a))
585
#define RCR_W(a, b)	CHOICE(rcrw ARG2(a,b), rcrw ARG2(a,b), _WTOG rcr ARG2(b,a))
579
#define RCR_W(a, b)	CHOICE(rcrw ARG2(a,b), rcrw ARG2(a,b), _WTOG rcr ARG2(b,a))
586
#define RCR_B(a, b)	CHOICE(rcrb ARG2(a,b), rcrb ARG2(a,b), rcrb ARG2(b,a))
580
#define RCR_B(a, b)	CHOICE(rcrb ARG2(a,b), rcrb ARG2(a,b), rcrb ARG2(b,a))
587
#define ROL_L(a, b)	CHOICE(roll ARG2(a,b), roll ARG2(a,b), _LTOG rol ARG2(b,a))
581
#define ROL_L(a, b)	CHOICE(roll ARG2(a,b), roll ARG2(a,b), _LTOG rol ARG2(b,a))
588
#define ROL_W(a, b)	CHOICE(rolw ARG2(a,b), rolw ARG2(a,b), _WTOG rol ARG2(b,a))
582
#define ROL_W(a, b)	CHOICE(rolw ARG2(a,b), rolw ARG2(a,b), _WTOG rol ARG2(b,a))
589
#define ROL_B(a, b)	CHOICE(rolb ARG2(a,b), rolb ARG2(a,b), rolb ARG2(b,a))
583
#define ROL_B(a, b)	CHOICE(rolb ARG2(a,b), rolb ARG2(a,b), rolb ARG2(b,a))
590
#define ROR_L(a, b)	CHOICE(rorl ARG2(a,b), rorl ARG2(a,b), _LTOG ror ARG2(b,a))
584
#define ROR_L(a, b)	CHOICE(rorl ARG2(a,b), rorl ARG2(a,b), _LTOG ror ARG2(b,a))
591
#define ROR_W(a, b)	CHOICE(rorw ARG2(a,b), rorw ARG2(a,b), _WTOG ror ARG2(b,a))
585
#define ROR_W(a, b)	CHOICE(rorw ARG2(a,b), rorw ARG2(a,b), _WTOG ror ARG2(b,a))
592
#define ROR_B(a, b)	CHOICE(rorb ARG2(a,b), rorb ARG2(a,b), rorb ARG2(b,a))
586
#define ROR_B(a, b)	CHOICE(rorb ARG2(a,b), rorb ARG2(a,b), rorb ARG2(b,a))
593
#define REP		CHOICE(rep ;, rep ;, repe)
587
#define REP		CHOICE(rep ;, rep ;, repe)
594
#define REPE		CHOICE(repz ;, repe ;, repe)
588
#define REPE		CHOICE(repz ;, repe ;, repe)
595
#define REPNE		CHOICE(repnz ;, repne ;, repne)
589
#define REPNE		CHOICE(repnz ;, repne ;, repne)
596
#define REPNZ		REPNE
590
#define REPNZ		REPNE
597
#define REPZ		REPE
591
#define REPZ		REPE
598
#define RET		CHOICE(ret, ret, ret)
592
#define RET		CHOICE(ret, ret, ret)
599
#define SAHF		CHOICE(sahf, sahf, sahf)
593
#define SAHF		CHOICE(sahf, sahf, sahf)
600
#define SAL_L(a, b)	CHOICE(sall ARG2(a,b), sall ARG2(a,b), _LTOG sal ARG2(b,a))
594
#define SAL_L(a, b)	CHOICE(sall ARG2(a,b), sall ARG2(a,b), _LTOG sal ARG2(b,a))
601
#define SAL_W(a, b)	CHOICE(salw ARG2(a,b), salw ARG2(a,b), _WTOG sal ARG2(b,a))
595
#define SAL_W(a, b)	CHOICE(salw ARG2(a,b), salw ARG2(a,b), _WTOG sal ARG2(b,a))
602
#define SAL_B(a, b)	CHOICE(salb ARG2(a,b), salb ARG2(a,b), salb ARG2(b,a))
596
#define SAL_B(a, b)	CHOICE(salb ARG2(a,b), salb ARG2(a,b), salb ARG2(b,a))
603
#define SAR_L(a, b)	CHOICE(sarl ARG2(a,b), sarl ARG2(a,b), _LTOG sar ARG2(b,a))
597
#define SAR_L(a, b)	CHOICE(sarl ARG2(a,b), sarl ARG2(a,b), _LTOG sar ARG2(b,a))
604
#define SAR_W(a, b)	CHOICE(sarw ARG2(a,b), sarw ARG2(a,b), _WTOG sar ARG2(b,a))
598
#define SAR_W(a, b)	CHOICE(sarw ARG2(a,b), sarw ARG2(a,b), _WTOG sar ARG2(b,a))
605
#define SAR_B(a, b)	CHOICE(sarb ARG2(a,b), sarb ARG2(a,b), sarb ARG2(b,a))
599
#define SAR_B(a, b)	CHOICE(sarb ARG2(a,b), sarb ARG2(a,b), sarb ARG2(b,a))
606
#define SBB_L(a, b)	CHOICE(sbbl ARG2(a,b), sbbl ARG2(a,b), _LTOG sbb ARG2(b,a))
600
#define SBB_L(a, b)	CHOICE(sbbl ARG2(a,b), sbbl ARG2(a,b), _LTOG sbb ARG2(b,a))
607
#define SBB_W(a, b)	CHOICE(sbbw ARG2(a,b), sbbw ARG2(a,b), _WTOG sbb ARG2(b,a))
601
#define SBB_W(a, b)	CHOICE(sbbw ARG2(a,b), sbbw ARG2(a,b), _WTOG sbb ARG2(b,a))
608
#define SBB_B(a, b)	CHOICE(sbbb ARG2(a,b), sbbb ARG2(a,b), sbbb ARG2(b,a))
602
#define SBB_B(a, b)	CHOICE(sbbb ARG2(a,b), sbbb ARG2(a,b), sbbb ARG2(b,a))
609
#define SCAS_L		CHOICE(scasl, scasl, _LTOG scas)
603
#define SCAS_L		CHOICE(scasl, scasl, _LTOG scas)
610
#define SCAS_W		CHOICE(scasw, scasw, _WTOG scas)
604
#define SCAS_W		CHOICE(scasw, scasw, _WTOG scas)
611
#define SCAS_B		CHOICE(scasb, scasb, scasb)
605
#define SCAS_B		CHOICE(scasb, scasb, scasb)
612
#define SETA(a)		CHOICE(seta a, seta a, seta a)
606
#define SETA(a)		CHOICE(seta a, seta a, seta a)
613
#define SETAE(a)	CHOICE(setae a, setae a, setae a)
607
#define SETAE(a)	CHOICE(setae a, setae a, setae a)
614
#define SETB(a)		CHOICE(setb a, setb a, setb a)
608
#define SETB(a)		CHOICE(setb a, setb a, setb a)
615
#define SETBE(a)	CHOICE(setbe a, setbe a, setbe a)
609
#define SETBE(a)	CHOICE(setbe a, setbe a, setbe a)
616
#define SETC(a)		CHOICE(setc a, setb a, setb a)
610
#define SETC(a)		CHOICE(setc a, setb a, setb a)
617
#define SETE(a)		CHOICE(sete a, sete a, sete a)
611
#define SETE(a)		CHOICE(sete a, sete a, sete a)
618
#define SETG(a)		CHOICE(setg a, setg a, setg a)
612
#define SETG(a)		CHOICE(setg a, setg a, setg a)
619
#define SETGE(a)	CHOICE(setge a, setge a, setge a)
613
#define SETGE(a)	CHOICE(setge a, setge a, setge a)
620
#define SETL(a)		CHOICE(setl a, setl a, setl a)
614
#define SETL(a)		CHOICE(setl a, setl a, setl a)
621
#define SETLE(a)	CHOICE(setle a, setle a, setle a)
615
#define SETLE(a)	CHOICE(setle a, setle a, setle a)
622
#define SETNA(a)	CHOICE(setna a, setna a, setna a)
616
#define SETNA(a)	CHOICE(setna a, setna a, setna a)
623
#define SETNAE(a)	CHOICE(setnae a, setnae a, setnae a)
617
#define SETNAE(a)	CHOICE(setnae a, setnae a, setnae a)
624
#define SETNB(a)	CHOICE(setnb a, setnb a, setnb a)
618
#define SETNB(a)	CHOICE(setnb a, setnb a, setnb a)
625
#define SETNBE(a)	CHOICE(setnbe a, setnbe a, setnbe a)
619
#define SETNBE(a)	CHOICE(setnbe a, setnbe a, setnbe a)
626
#define SETNC(a)	CHOICE(setnc a, setnb a, setnb a)
620
#define SETNC(a)	CHOICE(setnc a, setnb a, setnb a)
627
#define SETNE(a)	CHOICE(setne a, setne a, setne a)
621
#define SETNE(a)	CHOICE(setne a, setne a, setne a)
628
#define SETNG(a)	CHOICE(setng a, setng a, setng a)
622
#define SETNG(a)	CHOICE(setng a, setng a, setng a)
629
#define SETNGE(a)	CHOICE(setnge a, setnge a, setnge a)
623
#define SETNGE(a)	CHOICE(setnge a, setnge a, setnge a)
630
#define SETNL(a)	CHOICE(setnl a, setnl a, setnl a)
624
#define SETNL(a)	CHOICE(setnl a, setnl a, setnl a)
631
#define SETNLE(a)	CHOICE(setnle a, setnle a, setnle a)
625
#define SETNLE(a)	CHOICE(setnle a, setnle a, setnle a)
632
#define SETNO(a)	CHOICE(setno a, setno a, setno a)
626
#define SETNO(a)	CHOICE(setno a, setno a, setno a)
633
#define SETNP(a)	CHOICE(setnp a, setnp a, setnp a)
627
#define SETNP(a)	CHOICE(setnp a, setnp a, setnp a)
634
#define SETNS(a)	CHOICE(setns a, setns a, setna a)
628
#define SETNS(a)	CHOICE(setns a, setns a, setna a)
635
#define SETNZ(a)	CHOICE(setnz a, setnz a, setnz a)
629
#define SETNZ(a)	CHOICE(setnz a, setnz a, setnz a)
636
#define SETO(a)		CHOICE(seto a, seto a, seto a)
630
#define SETO(a)		CHOICE(seto a, seto a, seto a)
637
#define SETP(a)		CHOICE(setp a, setp a, setp a)
631
#define SETP(a)		CHOICE(setp a, setp a, setp a)
638
#define SETPE(a)	CHOICE(setpe a, setpe a, setpe a)
632
#define SETPE(a)	CHOICE(setpe a, setpe a, setpe a)
639
#define SETPO(a)	CHOICE(setpo a, setpo a, setpo a)
633
#define SETPO(a)	CHOICE(setpo a, setpo a, setpo a)
640
#define SETS(a)		CHOICE(sets a, sets a, seta a)
634
#define SETS(a)		CHOICE(sets a, sets a, seta a)
641
#define SETZ(a)		CHOICE(setz a, setz a, setz a)
635
#define SETZ(a)		CHOICE(setz a, setz a, setz a)
642
#define SGDT(a)		CHOICE(sgdt a, sgdt a, sgdt a)
636
#define SGDT(a)		CHOICE(sgdt a, sgdt a, sgdt a)
643
#define SIDT(a)		CHOICE(sidt a, sidt a, sidt a)
637
#define SIDT(a)		CHOICE(sidt a, sidt a, sidt a)
644
#define SHL_L(a, b)	CHOICE(shll ARG2(a,b), shll ARG2(a,b), _LTOG shl ARG2(b,a))
638
#define SHL_L(a, b)	CHOICE(shll ARG2(a,b), shll ARG2(a,b), _LTOG shl ARG2(b,a))
645
#define SHL_W(a, b)	CHOICE(shlw ARG2(a,b), shlw ARG2(a,b), _WTOG shl ARG2(b,a))
639
#define SHL_W(a, b)	CHOICE(shlw ARG2(a,b), shlw ARG2(a,b), _WTOG shl ARG2(b,a))
646
#define SHL_B(a, b)	CHOICE(shlb ARG2(a,b), shlb ARG2(a,b), shlb ARG2(b,a))
640
#define SHL_B(a, b)	CHOICE(shlb ARG2(a,b), shlb ARG2(a,b), shlb ARG2(b,a))
647
#define SHLD_L(a,b,c)	CHOICE(shldl ARG3(a,b,c), shldl ARG3(a,b,c), _LTOG shld ARG3(c,b,a))
641
#define SHLD_L(a,b,c)	CHOICE(shldl ARG3(a,b,c), shldl ARG3(a,b,c), _LTOG shld ARG3(c,b,a))
648
#define SHLD2_L(a,b)	CHOICE(shldl ARG2(a,b), shldl ARG3(CL,a,b), _LTOG shld ARG3(b,a,CL))
642
#define SHLD2_L(a,b)	CHOICE(shldl ARG2(a,b), shldl ARG3(CL,a,b), _LTOG shld ARG3(b,a,CL))
649
#define SHLD_W(a,b,c)	CHOICE(shldw ARG3(a,b,c), shldw ARG3(a,b,c), _WTOG shld ARG3(c,b,a))
643
#define SHLD_W(a,b,c)	CHOICE(shldw ARG3(a,b,c), shldw ARG3(a,b,c), _WTOG shld ARG3(c,b,a))
650
#define SHLD2_W(a,b)	CHOICE(shldw ARG2(a,b), shldw ARG3(CL,a,b), _WTOG shld ARG3(b,a,CL))
644
#define SHLD2_W(a,b)	CHOICE(shldw ARG2(a,b), shldw ARG3(CL,a,b), _WTOG shld ARG3(b,a,CL))
651
#define SHR_L(a, b)	CHOICE(shrl ARG2(a,b), shrl ARG2(a,b), _LTOG shr ARG2(b,a))
645
#define SHR_L(a, b)	CHOICE(shrl ARG2(a,b), shrl ARG2(a,b), _LTOG shr ARG2(b,a))
652
#define SHR_W(a, b)	CHOICE(shrw ARG2(a,b), shrw ARG2(a,b), _WTOG shr ARG2(b,a))
646
#define SHR_W(a, b)	CHOICE(shrw ARG2(a,b), shrw ARG2(a,b), _WTOG shr ARG2(b,a))
653
#define SHR_B(a, b)	CHOICE(shrb ARG2(a,b), shrb ARG2(a,b), shrb ARG2(b,a))
647
#define SHR_B(a, b)	CHOICE(shrb ARG2(a,b), shrb ARG2(a,b), shrb ARG2(b,a))
654
#define SHRD_L(a,b,c)	CHOICE(shrdl ARG3(a,b,c), shrdl ARG3(a,b,c), _LTOG shrd ARG3(c,b,a))
648
#define SHRD_L(a,b,c)	CHOICE(shrdl ARG3(a,b,c), shrdl ARG3(a,b,c), _LTOG shrd ARG3(c,b,a))
655
#define SHRD2_L(a,b)	CHOICE(shrdl ARG2(a,b), shrdl ARG3(CL,a,b), _LTOG shrd ARG3(b,a,CL))
649
#define SHRD2_L(a,b)	CHOICE(shrdl ARG2(a,b), shrdl ARG3(CL,a,b), _LTOG shrd ARG3(b,a,CL))
656
#define SHRD_W(a,b,c)	CHOICE(shrdw ARG3(a,b,c), shrdw ARG3(a,b,c), _WTOG shrd ARG3(c,b,a))
650
#define SHRD_W(a,b,c)	CHOICE(shrdw ARG3(a,b,c), shrdw ARG3(a,b,c), _WTOG shrd ARG3(c,b,a))
657
#define SHRD2_W(a,b)	CHOICE(shrdw ARG2(a,b), shrdw ARG3(CL,a,b), _WTOG shrd ARG3(b,a,CL))
651
#define SHRD2_W(a,b)	CHOICE(shrdw ARG2(a,b), shrdw ARG3(CL,a,b), _WTOG shrd ARG3(b,a,CL))
658
#define SLDT(a)		CHOICE(sldt a, sldt a, sldt a)
652
#define SLDT(a)		CHOICE(sldt a, sldt a, sldt a)
659
#define SMSW(a)		CHOICE(smsw a, smsw a, smsw a)
653
#define SMSW(a)		CHOICE(smsw a, smsw a, smsw a)
660
#define STC		CHOICE(stc, stc, stc)
654
#define STC		CHOICE(stc, stc, stc)
661
#define STD		CHOICE(std, std, std)
655
#define STD		CHOICE(std, std, std)
662
#define STI		CHOICE(sti, sti, sti)
656
#define STI		CHOICE(sti, sti, sti)
663
#define STOS_L		CHOICE(stosl, stosl, _LTOG stos)
657
#define STOS_L		CHOICE(stosl, stosl, _LTOG stos)
664
#define STOS_W		CHOICE(stosw, stosw, _WTOG stos)
658
#define STOS_W		CHOICE(stosw, stosw, _WTOG stos)
665
#define STOS_B		CHOICE(stosb, stosb, stosb)
659
#define STOS_B		CHOICE(stosb, stosb, stosb)
666
#define STR(a)		CHOICE(str a, str a, str a)
660
#define STR(a)		CHOICE(str a, str a, str a)
667
#define SUB_L(a, b)	CHOICE(subl ARG2(a,b), subl ARG2(a,b), _LTOG sub ARG2(b,a))
661
#define SUB_L(a, b)	CHOICE(subl ARG2(a,b), subl ARG2(a,b), _LTOG sub ARG2(b,a))
668
#define SUB_W(a, b)	CHOICE(subw ARG2(a,b), subw ARG2(a,b), _WTOG sub ARG2(b,a))
662
#define SUB_W(a, b)	CHOICE(subw ARG2(a,b), subw ARG2(a,b), _WTOG sub ARG2(b,a))
669
#define SUB_B(a, b)	CHOICE(subb ARG2(a,b), subb ARG2(a,b), subb ARG2(b,a))
663
#define SUB_B(a, b)	CHOICE(subb ARG2(a,b), subb ARG2(a,b), subb ARG2(b,a))
670
#define TEST_L(a, b)	CHOICE(testl ARG2(a,b), testl ARG2(a,b), _LTOG test ARG2(b,a))
664
#define TEST_L(a, b)	CHOICE(testl ARG2(a,b), testl ARG2(a,b), _LTOG test ARG2(b,a))
671
#define TEST_W(a, b)	CHOICE(testw ARG2(a,b), testw ARG2(a,b), _WTOG test ARG2(b,a))
665
#define TEST_W(a, b)	CHOICE(testw ARG2(a,b), testw ARG2(a,b), _WTOG test ARG2(b,a))
672
#define TEST_B(a, b)	CHOICE(testb ARG2(a,b), testb ARG2(a,b), testb ARG2(b,a))
666
#define TEST_B(a, b)	CHOICE(testb ARG2(a,b), testb ARG2(a,b), testb ARG2(b,a))
673
#define VERR(a)		CHOICE(verr a, verr a, verr a)
667
#define VERR(a)		CHOICE(verr a, verr a, verr a)
674
#define VERW(a)		CHOICE(verw a, verw a, verw a)
668
#define VERW(a)		CHOICE(verw a, verw a, verw a)
675
#define WAIT		CHOICE(wait, wait, wait)
669
#define WAIT		CHOICE(wait, wait, wait)
676
#define XCHG_L(a, b)	CHOICE(xchgl ARG2(a,b), xchgl ARG2(a,b), _LTOG xchg ARG2(b,a))
670
#define XCHG_L(a, b)	CHOICE(xchgl ARG2(a,b), xchgl ARG2(a,b), _LTOG xchg ARG2(b,a))
677
#define XCHG_W(a, b)	CHOICE(xchgw ARG2(a,b), xchgw ARG2(a,b), _WTOG xchg ARG2(b,a))
671
#define XCHG_W(a, b)	CHOICE(xchgw ARG2(a,b), xchgw ARG2(a,b), _WTOG xchg ARG2(b,a))
678
#define XCHG_B(a, b)	CHOICE(xchgb ARG2(a,b), xchgb ARG2(a,b), xchgb ARG2(b,a))
672
#define XCHG_B(a, b)	CHOICE(xchgb ARG2(a,b), xchgb ARG2(a,b), xchgb ARG2(b,a))
679
#define XLAT		CHOICE(xlat, xlat, xlat)
673
#define XLAT		CHOICE(xlat, xlat, xlat)
680
#define XOR_L(a, b)	CHOICE(xorl ARG2(a,b), xorl ARG2(a,b), _LTOG xor ARG2(b,a))
674
#define XOR_L(a, b)	CHOICE(xorl ARG2(a,b), xorl ARG2(a,b), _LTOG xor ARG2(b,a))
681
#define XOR_W(a, b)	CHOICE(xorw ARG2(a,b), xorw ARG2(a,b), _WTOG xor ARG2(b,a))
675
#define XOR_W(a, b)	CHOICE(xorw ARG2(a,b), xorw ARG2(a,b), _WTOG xor ARG2(b,a))
682
#define XOR_B(a, b)	CHOICE(xorb ARG2(a,b), xorb ARG2(a,b), xorb ARG2(b,a))
676
#define XOR_B(a, b)	CHOICE(xorb ARG2(a,b), xorb ARG2(a,b), xorb ARG2(b,a))
683
 
677
 
684
 
678
 
685
/* Floating Point Instructions */
679
/* Floating Point Instructions */
686
#define F2XM1		CHOICE(f2xm1, f2xm1, f2xm1)
680
#define F2XM1		CHOICE(f2xm1, f2xm1, f2xm1)
687
#define FABS		CHOICE(fabs, fabs, fabs)
681
#define FABS		CHOICE(fabs, fabs, fabs)
688
#define FADD_D(a)	CHOICE(faddl a, faddl a, faddd a)
682
#define FADD_D(a)	CHOICE(faddl a, faddl a, faddd a)
689
#define FADD_S(a)	CHOICE(fadds a, fadds a, fadds a)
683
#define FADD_S(a)	CHOICE(fadds a, fadds a, fadds a)
690
#define FADD2(a, b)	CHOICE(fadd ARG2(a,b), fadd ARG2(a,b), fadd ARG2(b,a))
684
#define FADD2(a, b)	CHOICE(fadd ARG2(a,b), fadd ARG2(a,b), fadd ARG2(b,a))
691
#define FADDP(a, b)	CHOICE(faddp ARG2(a,b), faddp ARG2(a,b), faddp ARG2(b,a))
685
#define FADDP(a, b)	CHOICE(faddp ARG2(a,b), faddp ARG2(a,b), faddp ARG2(b,a))
692
#define FIADD_L(a)	CHOICE(fiaddl a, fiaddl a, fiaddl a)
686
#define FIADD_L(a)	CHOICE(fiaddl a, fiaddl a, fiaddl a)
693
#define FIADD_W(a)	CHOICE(fiadd a, fiadds a, fiadds a)
687
#define FIADD_W(a)	CHOICE(fiadd a, fiadds a, fiadds a)
694
#define FBLD(a)		CHOICE(fbld a, fbld a, fbld a)
688
#define FBLD(a)		CHOICE(fbld a, fbld a, fbld a)
695
#define FBSTP(a)	CHOICE(fbstp a, fbstp a, fbstp a)
689
#define FBSTP(a)	CHOICE(fbstp a, fbstp a, fbstp a)
696
#define FCHS		CHOICE(fchs, fchs, fchs)
690
#define FCHS		CHOICE(fchs, fchs, fchs)
697
#define FCLEX		CHOICE(fclex, wait; fnclex, wait; fclex)
691
#define FCLEX		CHOICE(fclex, wait; fnclex, wait; fclex)
698
#define FNCLEX		CHOICE(fnclex, fnclex, fclex)
692
#define FNCLEX		CHOICE(fnclex, fnclex, fclex)
699
#define FCOM(a)		CHOICE(fcom a, fcom a, fcom a)
693
#define FCOM(a)		CHOICE(fcom a, fcom a, fcom a)
700
#define FCOM_D(a)	CHOICE(fcoml a, fcoml a, fcomd a)
694
#define FCOM_D(a)	CHOICE(fcoml a, fcoml a, fcomd a)
701
#define FCOM_S(a)	CHOICE(fcoms a, fcoms a, fcoms a)
695
#define FCOM_S(a)	CHOICE(fcoms a, fcoms a, fcoms a)
702
#define FCOMP(a)	CHOICE(fcomp a, fcomp a, fcomp a)
696
#define FCOMP(a)	CHOICE(fcomp a, fcomp a, fcomp a)
703
#define FCOMP_D(a)	CHOICE(fcompl a, fcompl a, fcompd a)
697
#define FCOMP_D(a)	CHOICE(fcompl a, fcompl a, fcompd a)
704
#define FCOMP_S(a)	CHOICE(fcomps a, fcomps a, fcomps a)
698
#define FCOMP_S(a)	CHOICE(fcomps a, fcomps a, fcomps a)
705
#define FCOMPP		CHOICE(fcompp, fcompp, fcompp)
699
#define FCOMPP		CHOICE(fcompp, fcompp, fcompp)
706
#define FCOS		CHOICE(fcos, fcos, fcos)
700
#define FCOS		CHOICE(fcos, fcos, fcos)
707
#define FDECSTP		CHOICE(fdecstp, fdecstp, fdecstp)
701
#define FDECSTP		CHOICE(fdecstp, fdecstp, fdecstp)
708
#define FDIV_D(a)	CHOICE(fdivl a, fdivl a, fdivd a)
702
#define FDIV_D(a)	CHOICE(fdivl a, fdivl a, fdivd a)
709
#define FDIV_S(a)	CHOICE(fdivs a, fdivs a, fdivs a)
703
#define FDIV_S(a)	CHOICE(fdivs a, fdivs a, fdivs a)
710
#define FDIV2(a, b)	CHOICE(fdiv ARG2(a,b), fdiv ARG2(a,b), fdiv ARG2(b,a))
704
#define FDIV2(a, b)	CHOICE(fdiv ARG2(a,b), fdiv ARG2(a,b), fdiv ARG2(b,a))
711
#define FDIVP(a, b)	CHOICE(fdivp ARG2(a,b), fdivp ARG2(a,b), fdivp ARG2(b,a))
705
#define FDIVP(a, b)	CHOICE(fdivp ARG2(a,b), fdivp ARG2(a,b), fdivp ARG2(b,a))
712
#define FIDIV_L(a)	CHOICE(fidivl a, fidivl a, fidivl a)
706
#define FIDIV_L(a)	CHOICE(fidivl a, fidivl a, fidivl a)
713
#define FIDIV_W(a)	CHOICE(fidiv a, fidivs a, fidivs a)
707
#define FIDIV_W(a)	CHOICE(fidiv a, fidivs a, fidivs a)
714
#define FDIVR_D(a)	CHOICE(fdivrl a, fdivrl a, fdivrd a)
708
#define FDIVR_D(a)	CHOICE(fdivrl a, fdivrl a, fdivrd a)
715
#define FDIVR_S(a)	CHOICE(fdivrs a, fdivrs a, fdivrs a)
709
#define FDIVR_S(a)	CHOICE(fdivrs a, fdivrs a, fdivrs a)
716
#define FDIVR2(a, b)	CHOICE(fdivr ARG2(a,b), fdivr ARG2(a,b), fdivr ARG2(b,a))
710
#define FDIVR2(a, b)	CHOICE(fdivr ARG2(a,b), fdivr ARG2(a,b), fdivr ARG2(b,a))
717
#define FDIVRP(a, b)	CHOICE(fdivrp ARG2(a,b), fdivrp ARG2(a,b), fdivrp ARG2(b,a))
711
#define FDIVRP(a, b)	CHOICE(fdivrp ARG2(a,b), fdivrp ARG2(a,b), fdivrp ARG2(b,a))
718
#define FIDIVR_L(a)	CHOICE(fidivrl a, fidivrl a, fidivrl a)
712
#define FIDIVR_L(a)	CHOICE(fidivrl a, fidivrl a, fidivrl a)
719
#define FIDIVR_W(a)	CHOICE(fidivr a, fidivrs a, fidivrs a)
713
#define FIDIVR_W(a)	CHOICE(fidivr a, fidivrs a, fidivrs a)
720
#define FFREE(a)	CHOICE(ffree a, ffree a, ffree a)
714
#define FFREE(a)	CHOICE(ffree a, ffree a, ffree a)
721
#define FICOM_L(a)	CHOICE(ficoml a, ficoml a, ficoml a)
715
#define FICOM_L(a)	CHOICE(ficoml a, ficoml a, ficoml a)
722
#define FICOM_W(a)	CHOICE(ficom a, ficoms a, ficoms a)
716
#define FICOM_W(a)	CHOICE(ficom a, ficoms a, ficoms a)
723
#define FICOMP_L(a)	CHOICE(ficompl a, ficompl a, ficompl a)
717
#define FICOMP_L(a)	CHOICE(ficompl a, ficompl a, ficompl a)
724
#define FICOMP_W(a)	CHOICE(ficomp a, ficomps a, ficomps a)
718
#define FICOMP_W(a)	CHOICE(ficomp a, ficomps a, ficomps a)
725
#define FILD_Q(a)	CHOICE(fildll a, fildq a, fildq a)
719
#define FILD_Q(a)	CHOICE(fildll a, fildq a, fildq a)
726
#define FILD_L(a)	CHOICE(fildl a, fildl a, fildl a)
720
#define FILD_L(a)	CHOICE(fildl a, fildl a, fildl a)
727
#define FILD_W(a)	CHOICE(fild a, filds a, filds a)
721
#define FILD_W(a)	CHOICE(fild a, filds a, filds a)
728
#define FINCSTP		CHOICE(fincstp, fincstp, fincstp)
722
#define FINCSTP		CHOICE(fincstp, fincstp, fincstp)
729
#define FINIT		CHOICE(finit, wait; fninit, wait; finit)
723
#define FINIT		CHOICE(finit, wait; fninit, wait; finit)
730
#define FNINIT		CHOICE(fninit, fninit, finit)
724
#define FNINIT		CHOICE(fninit, fninit, finit)
731
#define FIST_L(a)	CHOICE(fistl a, fistl a, fistl a)
725
#define FIST_L(a)	CHOICE(fistl a, fistl a, fistl a)
732
#define FIST_W(a)	CHOICE(fist a, fists a, fists a)
726
#define FIST_W(a)	CHOICE(fist a, fists a, fists a)
733
#define FISTP_Q(a)	CHOICE(fistpll a, fistpq a, fistpq a)
727
#define FISTP_Q(a)	CHOICE(fistpll a, fistpq a, fistpq a)
734
#define FISTP_L(a)	CHOICE(fistpl a, fistpl a, fistpl a)
728
#define FISTP_L(a)	CHOICE(fistpl a, fistpl a, fistpl a)
735
#define FISTP_W(a)	CHOICE(fistp a, fistps a, fistps a)
729
#define FISTP_W(a)	CHOICE(fistp a, fistps a, fistps a)
736
#define FLD_X(a)	CHOICE(fldt a, fldt a, fldx a) /* 80 bit data type! */
730
#define FLD_X(a)	CHOICE(fldt a, fldt a, fldx a) /* 80 bit data type! */
737
#define FLD_D(a)	CHOICE(fldl a, fldl a, fldd a)
731
#define FLD_D(a)	CHOICE(fldl a, fldl a, fldd a)
738
#define FLD_S(a)	CHOICE(flds a, flds a, flds a)
732
#define FLD_S(a)	CHOICE(flds a, flds a, flds a)
739
#define FLD1		CHOICE(fld1, fld1, fld1)
733
#define FLD1		CHOICE(fld1, fld1, fld1)
740
#define FLDL2T		CHOICE(fldl2t, fldl2t, fldl2t)
734
#define FLDL2T		CHOICE(fldl2t, fldl2t, fldl2t)
741
#define FLDL2E		CHOICE(fldl2e, fldl2e, fldl2e)
735
#define FLDL2E		CHOICE(fldl2e, fldl2e, fldl2e)
742
#define FLDPI		CHOICE(fldpi, fldpi, fldpi)
736
#define FLDPI		CHOICE(fldpi, fldpi, fldpi)
743
#define FLDLG2		CHOICE(fldlg2, fldlg2, fldlg2)
737
#define FLDLG2		CHOICE(fldlg2, fldlg2, fldlg2)
744
#define FLDLN2		CHOICE(fldln2, fldln2, fldln2)
738
#define FLDLN2		CHOICE(fldln2, fldln2, fldln2)
745
#define FLDZ		CHOICE(fldz, fldz, fldz)
739
#define FLDZ		CHOICE(fldz, fldz, fldz)
746
#define FLDCW(a)	CHOICE(fldcw a, fldcw a, fldcw a)
740
#define FLDCW(a)	CHOICE(fldcw a, fldcw a, fldcw a)
747
#define FLDENV(a)	CHOICE(fldenv a, fldenv a, fldenv a)
741
#define FLDENV(a)	CHOICE(fldenv a, fldenv a, fldenv a)
748
#define FMUL_S(a)	CHOICE(fmuls a, fmuls a, fmuls a)
742
#define FMUL_S(a)	CHOICE(fmuls a, fmuls a, fmuls a)
749
#define FMUL_D(a)	CHOICE(fmull a, fmull a, fmuld a)
743
#define FMUL_D(a)	CHOICE(fmull a, fmull a, fmuld a)
750
#define FMUL2(a, b)	CHOICE(fmul ARG2(a,b), fmul ARG2(a,b), fmul ARG2(b,a))
744
#define FMUL2(a, b)	CHOICE(fmul ARG2(a,b), fmul ARG2(a,b), fmul ARG2(b,a))
751
#define FMULP(a, b)	CHOICE(fmulp ARG2(a,b), fmulp ARG2(a,b), fmulp ARG2(b,a))
745
#define FMULP(a, b)	CHOICE(fmulp ARG2(a,b), fmulp ARG2(a,b), fmulp ARG2(b,a))
752
#define FIMUL_L(a)	CHOICE(fimull a, fimull a, fimull a)
746
#define FIMUL_L(a)	CHOICE(fimull a, fimull a, fimull a)
753
#define FIMUL_W(a)	CHOICE(fimul a, fimuls a, fimuls a)
747
#define FIMUL_W(a)	CHOICE(fimul a, fimuls a, fimuls a)
754
#define FNOP		CHOICE(fnop, fnop, fnop)
748
#define FNOP		CHOICE(fnop, fnop, fnop)
755
#define FPATAN		CHOICE(fpatan, fpatan, fpatan)
749
#define FPATAN		CHOICE(fpatan, fpatan, fpatan)
756
#define FPREM		CHOICE(fprem, fprem, fprem)
750
#define FPREM		CHOICE(fprem, fprem, fprem)
757
#define FPREM1		CHOICE(fprem1, fprem1, fprem1)
751
#define FPREM1		CHOICE(fprem1, fprem1, fprem1)
758
#define FPTAN		CHOICE(fptan, fptan, fptan)
752
#define FPTAN		CHOICE(fptan, fptan, fptan)
759
#define FRNDINT		CHOICE(frndint, frndint, frndint)
753
#define FRNDINT		CHOICE(frndint, frndint, frndint)
760
#define FRSTOR(a)	CHOICE(frstor a, frstor a, frstor a)
754
#define FRSTOR(a)	CHOICE(frstor a, frstor a, frstor a)
761
#define FSAVE(a)	CHOICE(fsave a, wait; fnsave a, wait; fsave a)
755
#define FSAVE(a)	CHOICE(fsave a, wait; fnsave a, wait; fsave a)
762
#define FNSAVE(a)	CHOICE(fnsave a, fnsave a, fsave a)
756
#define FNSAVE(a)	CHOICE(fnsave a, fnsave a, fsave a)
763
#define FSCALE		CHOICE(fscale, fscale, fscale)
757
#define FSCALE		CHOICE(fscale, fscale, fscale)
764
#define FSIN		CHOICE(fsin, fsin, fsin)
758
#define FSIN		CHOICE(fsin, fsin, fsin)
765
#define FSINCOS		CHOICE(fsincos, fsincos, fsincos)
759
#define FSINCOS		CHOICE(fsincos, fsincos, fsincos)
766
#define FSQRT		CHOICE(fsqrt, fsqrt, fsqrt)
760
#define FSQRT		CHOICE(fsqrt, fsqrt, fsqrt)
767
#define FST_D(a)	CHOICE(fstl a, fstl a, fstd a)
761
#define FST_D(a)	CHOICE(fstl a, fstl a, fstd a)
768
#define FST_S(a)	CHOICE(fsts a, fsts a, fsts a)
762
#define FST_S(a)	CHOICE(fsts a, fsts a, fsts a)
769
#define FSTP_X(a)	CHOICE(fstpt a, fstpt a, fstpx a)
763
#define FSTP_X(a)	CHOICE(fstpt a, fstpt a, fstpx a)
770
#define FSTP_D(a)	CHOICE(fstpl a, fstpl a, fstpd a)
764
#define FSTP_D(a)	CHOICE(fstpl a, fstpl a, fstpd a)
771
#define FSTP_S(a)	CHOICE(fstps a, fstps a, fstps a)
765
#define FSTP_S(a)	CHOICE(fstps a, fstps a, fstps a)
772
#define FSTP(a)		CHOICE(fstp a, fstp a, fstp a)
766
#define FSTP(a)		CHOICE(fstp a, fstp a, fstp a)
773
#define FSTCW(a)	CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a)
767
#define FSTCW(a)	CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a)
774
#define FNSTCW(a)	CHOICE(fnstcw a, fnstcw a, fstcw a)
768
#define FNSTCW(a)	CHOICE(fnstcw a, fnstcw a, fstcw a)
775
#define FSTENV(a)	CHOICE(fstenv a, wait; fnstenv a, fstenv a)
769
#define FSTENV(a)	CHOICE(fstenv a, wait; fnstenv a, fstenv a)
776
#define FNSTENV(a)	CHOICE(fnstenv a, fnstenv a, fstenv a)
770
#define FNSTENV(a)	CHOICE(fnstenv a, fnstenv a, fstenv a)
777
#define FSTSW(a)	CHOICE(fstsw a, wait; fnstsw a, wait; fstsw a)
771
#define FSTSW(a)	CHOICE(fstsw a, wait; fnstsw a, wait; fstsw a)
778
#define FNSTSW(a)	CHOICE(fnstsw a, fnstsw a, fstsw a)
772
#define FNSTSW(a)	CHOICE(fnstsw a, fnstsw a, fstsw a)
779
#define FSUB_S(a)	CHOICE(fsubs a, fsubs a, fsubs a)
773
#define FSUB_S(a)	CHOICE(fsubs a, fsubs a, fsubs a)
780
#define FSUB_D(a)	CHOICE(fsubl a, fsubl a, fsubd a)
774
#define FSUB_D(a)	CHOICE(fsubl a, fsubl a, fsubd a)
781
#define FSUB2(a, b)	CHOICE(fsub ARG2(a,b), fsub ARG2(a,b), fsub ARG2(b,a))
775
#define FSUB2(a, b)	CHOICE(fsub ARG2(a,b), fsub ARG2(a,b), fsub ARG2(b,a))
782
#define FSUBP(a, b)	CHOICE(fsubp ARG2(a,b), fsubp ARG2(a,b), fsubp ARG2(b,a))
776
#define FSUBP(a, b)	CHOICE(fsubp ARG2(a,b), fsubp ARG2(a,b), fsubp ARG2(b,a))
783
#define FISUB_L(a)	CHOICE(fisubl a, fisubl a, fisubl a)
777
#define FISUB_L(a)	CHOICE(fisubl a, fisubl a, fisubl a)
784
#define FISUB_W(a)	CHOICE(fisub a, fisubs a, fisubs a)
778
#define FISUB_W(a)	CHOICE(fisub a, fisubs a, fisubs a)
785
#define FSUBR_S(a)	CHOICE(fsubrs a, fsubrs a, fsubrs a)
779
#define FSUBR_S(a)	CHOICE(fsubrs a, fsubrs a, fsubrs a)
786
#define FSUBR_D(a)	CHOICE(fsubrl a, fsubrl a, fsubrd a)
780
#define FSUBR_D(a)	CHOICE(fsubrl a, fsubrl a, fsubrd a)
787
#define FSUBR2(a, b)	CHOICE(fsubr ARG2(a,b), fsubr ARG2(a,b), fsubr ARG2(b,a))
781
#define FSUBR2(a, b)	CHOICE(fsubr ARG2(a,b), fsubr ARG2(a,b), fsubr ARG2(b,a))
788
#define FSUBRP(a, b)	CHOICE(fsubrp ARG2(a,b), fsubrp ARG2(a,b), fsubrp ARG2(b,a))
782
#define FSUBRP(a, b)	CHOICE(fsubrp ARG2(a,b), fsubrp ARG2(a,b), fsubrp ARG2(b,a))
789
#define FISUBR_L(a)	CHOICE(fisubrl a, fisubrl a, fisubrl a)
783
#define FISUBR_L(a)	CHOICE(fisubrl a, fisubrl a, fisubrl a)
790
#define FISUBR_W(a)	CHOICE(fisubr a, fisubrs a, fisubrs a)
784
#define FISUBR_W(a)	CHOICE(fisubr a, fisubrs a, fisubrs a)
791
#define FTST		CHOICE(ftst, ftst, ftst)
785
#define FTST		CHOICE(ftst, ftst, ftst)
792
#define FUCOM(a)	CHOICE(fucom a, fucom a, fucom a)
786
#define FUCOM(a)	CHOICE(fucom a, fucom a, fucom a)
793
#define FUCOMP(a)	CHOICE(fucomp a, fucomp a, fucomp a)
787
#define FUCOMP(a)	CHOICE(fucomp a, fucomp a, fucomp a)
794
#define FUCOMPP		CHOICE(fucompp, fucompp, fucompp)
788
#define FUCOMPP		CHOICE(fucompp, fucompp, fucompp)
795
#define FWAIT		CHOICE(wait, wait, wait)
789
#define FWAIT		CHOICE(wait, wait, wait)
796
#define FXAM		CHOICE(fxam, fxam, fxam)
790
#define FXAM		CHOICE(fxam, fxam, fxam)
797
#define FXCH(a)		CHOICE(fxch a, fxch a, fxch a)
791
#define FXCH(a)		CHOICE(fxch a, fxch a, fxch a)
798
#define FXTRACT		CHOICE(fxtract, fxtract, fxtract)
792
#define FXTRACT		CHOICE(fxtract, fxtract, fxtract)
799
#define FYL2X		CHOICE(fyl2x, fyl2x, fyl2x)
793
#define FYL2X		CHOICE(fyl2x, fyl2x, fyl2x)
800
#define FYL2XP1		CHOICE(fyl2xp1, fyl2xp1, fyl2xp1)
794
#define FYL2XP1		CHOICE(fyl2xp1, fyl2xp1, fyl2xp1)
801
 
795
 
802
/* New instructions */
796
/* New instructions */
803
#define CPUID		CHOICE(D_BYTE ARG2(15, 162), cpuid, D_BYTE ARG2(15, 162))
797
#define CPUID		CHOICE(D_BYTE ARG2(15, 162), cpuid, D_BYTE ARG2(15, 162))
804
#define RDTSC		CHOICE(D_BYTE ARG2(15, 49), rdtsc, D_BYTE ARG2(15, 49))
798
#define RDTSC		CHOICE(D_BYTE ARG2(15, 49), rdtsc, D_BYTE ARG2(15, 49))
805
 
799
 
806
#else /* NASM_ASSEMBLER || MASM_ASSEMBLER is defined */
800
#else /* NASM_ASSEMBLER || MASM_ASSEMBLER is defined */
807
 
801
 
808
	/****************************************/
802
	/****************************************/
809
	/*					*/
803
	/*					*/
810
	/*	Intel style assemblers.		*/
804
	/*	Intel style assemblers.		*/
811
	/*	(NASM and MASM)			*/
805
	/*	(NASM and MASM)			*/
812
	/*					*/
806
	/*					*/
813
	/****************************************/
807
	/****************************************/
814
 
808
 
815
#define P_EAX		EAX
809
#define P_EAX		EAX
816
#define L_EAX		EAX
810
#define L_EAX		EAX
817
#define W_AX		AX
811
#define W_AX		AX
818
#define B_AH		AH
812
#define B_AH		AH
819
#define B_AL		AL
813
#define B_AL		AL
820
 
814
 
821
#define P_EBX		EBX
815
#define P_EBX		EBX
822
#define L_EBX		EBX
816
#define L_EBX		EBX
823
#define W_BX		BX
817
#define W_BX		BX
824
#define B_BH		BH
818
#define B_BH		BH
825
#define B_BL		BL
819
#define B_BL		BL
826
 
820
 
827
#define P_ECX		ECX
821
#define P_ECX		ECX
828
#define L_ECX		ECX
822
#define L_ECX		ECX
829
#define W_CX		CX
823
#define W_CX		CX
830
#define B_CH		CH
824
#define B_CH		CH
831
#define B_CL		CL
825
#define B_CL		CL
832
 
826
 
833
#define P_EDX		EDX
827
#define P_EDX		EDX
834
#define L_EDX		EDX
828
#define L_EDX		EDX
835
#define W_DX		DX
829
#define W_DX		DX
836
#define B_DH		DH
830
#define B_DH		DH
837
#define B_DL		DL
831
#define B_DL		DL
838
 
832
 
839
#define P_EBP		EBP
833
#define P_EBP		EBP
840
#define L_EBP		EBP
834
#define L_EBP		EBP
841
#define W_BP		BP
835
#define W_BP		BP
842
 
836
 
843
#define P_ESI		ESI
837
#define P_ESI		ESI
844
#define L_ESI		ESI
838
#define L_ESI		ESI
845
#define W_SI		SI
839
#define W_SI		SI
846
 
840
 
847
#define P_EDI		EDI
841
#define P_EDI		EDI
848
#define L_EDI		EDI
842
#define L_EDI		EDI
849
#define W_DI		DI
843
#define W_DI		DI
850
 
844
 
851
#define P_ESP		ESP
845
#define P_ESP		ESP
852
#define L_ESP		ESP
846
#define L_ESP		ESP
853
#define W_SP		SP
847
#define W_SP		SP
854
 
848
 
855
#define W_CS		CS
849
#define W_CS		CS
856
#define W_SS		SS
850
#define W_SS		SS
857
#define W_DS		DS
851
#define W_DS		DS
858
#define W_ES		ES
852
#define W_ES		ES
859
#define W_FS		FS
853
#define W_FS		FS
860
#define W_GS		GS
854
#define W_GS		GS
861
 
855
 
862
#define X_ST		ST
856
#define X_ST		ST
863
#define D_ST		ST
857
#define D_ST		ST
864
#define L_ST		ST
858
#define L_ST		ST
865
 
859
 
866
#define P_MM0		mm0
860
#define P_MM0		mm0
867
#define P_MM1		mm1
861
#define P_MM1		mm1
868
#define P_MM2		mm2
862
#define P_MM2		mm2
869
#define P_MM3		mm3
863
#define P_MM3		mm3
870
#define P_MM4		mm4
864
#define P_MM4		mm4
871
#define P_MM5		mm5
865
#define P_MM5		mm5
872
#define P_MM6		mm6
866
#define P_MM6		mm6
873
#define P_MM7		mm7
867
#define P_MM7		mm7
874
 
868
 
875
#define P_XMM0		xmm0
869
#define P_XMM0		xmm0
876
#define P_XMM1		xmm1
870
#define P_XMM1		xmm1
877
#define P_XMM2		xmm2
871
#define P_XMM2		xmm2
878
#define P_XMM3		xmm3
872
#define P_XMM3		xmm3
879
#define P_XMM4		xmm4
873
#define P_XMM4		xmm4
880
#define P_XMM5		xmm5
874
#define P_XMM5		xmm5
881
#define P_XMM6		xmm6
875
#define P_XMM6		xmm6
882
#define P_XMM7		xmm7
876
#define P_XMM7		xmm7
883
 
877
 
884
#define CONCAT(x, y)		x ## y
878
#define CONCAT(x, y)		x ## y
885
#define CONCAT3(x, y, z)	x ## y ## z
879
#define CONCAT3(x, y, z)	x ## y ## z
886
 
880
 
887
#if defined(NASM_ASSEMBLER)
881
#if defined(NASM_ASSEMBLER)
888
 
882
 
889
#define ST(n)		st ## n
883
#define ST(n)		st ## n
890
#define ST0		st0
884
#define ST0		st0
891
 
885
 
892
#define TBYTE_PTR	tword
886
#define TBYTE_PTR	tword
893
#define QWORD_PTR	qword
887
#define QWORD_PTR	qword
894
#define DWORD_PTR	dword
888
#define DWORD_PTR	dword
895
#define WORD_PTR	word
889
#define WORD_PTR	word
896
#define BYTE_PTR	byte
890
#define BYTE_PTR	byte
897
 
891
 
898
#define OFFSET
892
#define OFFSET
899
 
893
 
900
#define GLOBL			GLOBAL
894
#define GLOBL			GLOBAL
901
#define ALIGNTEXT32		ALIGN 32
895
#define ALIGNTEXT32		ALIGN 32
902
#define ALIGNTEXT16		ALIGN 16
896
#define ALIGNTEXT16		ALIGN 16
903
#define ALIGNTEXT8		ALIGN 8
897
#define ALIGNTEXT8		ALIGN 8
904
#define ALIGNTEXT4		ALIGN 4
898
#define ALIGNTEXT4		ALIGN 4
905
#define ALIGNTEXT2		ALIGN 2
899
#define ALIGNTEXT2		ALIGN 2
906
#define ALIGNTEXT32ifNOP	ALIGN 32
900
#define ALIGNTEXT32ifNOP	ALIGN 32
907
#define ALIGNTEXT16ifNOP	ALIGN 16
901
#define ALIGNTEXT16ifNOP	ALIGN 16
908
#define ALIGNTEXT8ifNOP		ALIGN 8
902
#define ALIGNTEXT8ifNOP		ALIGN 8
909
#define ALIGNTEXT4ifNOP		ALIGN 4
903
#define ALIGNTEXT4ifNOP		ALIGN 4
910
#define ALIGNDATA32		ALIGN 32
904
#define ALIGNDATA32		ALIGN 32
911
#define ALIGNDATA16		ALIGN 16
905
#define ALIGNDATA16		ALIGN 16
912
#define ALIGNDATA8		ALIGN 8
906
#define ALIGNDATA8		ALIGN 8
913
#define ALIGNDATA4		ALIGN 4
907
#define ALIGNDATA4		ALIGN 4
914
#define ALIGNDATA2		ALIGN 2
908
#define ALIGNDATA2		ALIGN 2
915
#define FILE(s)
909
#define FILE(s)
916
#define STRING(s)	db s
910
#define STRING(s)	db s
917
#define D_LONG		dd
911
#define D_LONG		dd
918
#define D_WORD		dw
912
#define D_WORD		dw
919
#define D_BYTE		db
913
#define D_BYTE		db
920
/* #define SPACE */
914
/* #define SPACE */
921
/* #define COMM */
915
/* #define COMM */
922
#if defined(__WATCOMC__)
916
#if defined(__WATCOMC__)
923
SECTION _TEXT public align=16 class=CODE use32 flat
917
SECTION _TEXT public align=16 class=CODE use32 flat
924
SECTION _DATA public align=16 class=DATA use32 flat
918
SECTION _DATA public align=16 class=DATA use32 flat
925
#define SEG_TEXT	SECTION _TEXT
919
#define SEG_TEXT	SECTION _TEXT
926
#define SEG_DATA	SECTION _DATA
920
#define SEG_DATA	SECTION _DATA
927
#define SEG_BSS		SECTION .bss
921
#define SEG_BSS		SECTION .bss
928
#else
922
#else
929
#define SEG_DATA	SECTION .data
923
#define SEG_DATA	SECTION .data
930
#define SEG_TEXT	SECTION .text
924
#define SEG_TEXT	SECTION .text
931
#define SEG_BSS		SECTION .bss
925
#define SEG_BSS		SECTION .bss
932
#endif
926
#endif
933
 
927
 
934
#define D_SPACE(n)	db n REP 0
928
#define D_SPACE(n)	db n REP 0
935
 
929
 
936
#define AS_BEGIN
930
#define AS_BEGIN
937
 
931
 
938
/* Jcc's should be handled better than this... */
932
/* Jcc's should be handled better than this... */
939
#define NEAR		near
933
#define NEAR		near
940
 
934
 
941
#else /* MASM */
935
#else /* MASM */
942
 
936
 
943
#define TBYTE_PTR	tbyte ptr
937
#define TBYTE_PTR	tbyte ptr
944
#define QWORD_PTR	qword ptr
938
#define QWORD_PTR	qword ptr
945
#define DWORD_PTR	dword ptr
939
#define DWORD_PTR	dword ptr
946
#define WORD_PTR	word ptr
940
#define WORD_PTR	word ptr
947
#define BYTE_PTR	byte ptr
941
#define BYTE_PTR	byte ptr
948
 
942
 
949
#define OFFSET		offset
943
#define OFFSET		offset
950
 
944
 
951
#define GLOBL			GLOBAL
945
#define GLOBL			GLOBAL
952
#define ALIGNTEXT32		ALIGN 32
946
#define ALIGNTEXT32		ALIGN 32
953
#define ALIGNTEXT16		ALIGN 16
947
#define ALIGNTEXT16		ALIGN 16
954
#define ALIGNTEXT8		ALIGN 8
948
#define ALIGNTEXT8		ALIGN 8
955
#define ALIGNTEXT4		ALIGN 4
949
#define ALIGNTEXT4		ALIGN 4
956
#define ALIGNTEXT2		ALIGN 2
950
#define ALIGNTEXT2		ALIGN 2
957
#define ALIGNTEXT32ifNOP	ALIGN 32
951
#define ALIGNTEXT32ifNOP	ALIGN 32
958
#define ALIGNTEXT16ifNOP	ALIGN 16
952
#define ALIGNTEXT16ifNOP	ALIGN 16
959
#define ALIGNTEXT8ifNOP		ALIGN 8
953
#define ALIGNTEXT8ifNOP		ALIGN 8
960
#define ALIGNTEXT4ifNOP		ALIGN 4
954
#define ALIGNTEXT4ifNOP		ALIGN 4
961
#define ALIGNDATA32		ALIGN 32
955
#define ALIGNDATA32		ALIGN 32
962
#define ALIGNDATA16		ALIGN 16
956
#define ALIGNDATA16		ALIGN 16
963
#define ALIGNDATA8		ALIGN 8
957
#define ALIGNDATA8		ALIGN 8
964
#define ALIGNDATA4		ALIGN 4
958
#define ALIGNDATA4		ALIGN 4
965
#define ALIGNDATA2		ALIGN 2
959
#define ALIGNDATA2		ALIGN 2
966
#define FILE(s)
960
#define FILE(s)
967
#define STRING(s)	db s
961
#define STRING(s)	db s
968
#define D_LONG		dd
962
#define D_LONG		dd
969
#define D_WORD		dw
963
#define D_WORD		dw
970
#define D_BYTE		db
964
#define D_BYTE		db
971
/* #define SPACE */
965
/* #define SPACE */
972
/* #define COMM */
966
/* #define COMM */
973
#define SEG_DATA	.DATA
967
#define SEG_DATA	.DATA
974
#define SEG_TEXT	.CODE
968
#define SEG_TEXT	.CODE
975
#define SEG_BSS		.DATA
969
#define SEG_BSS		.DATA
976
 
970
 
977
#define D_SPACE(n)	db n REP 0
971
#define D_SPACE(n)	db n REP 0
978
 
972
 
979
#define AS_BEGIN
973
#define AS_BEGIN
980
 
974
 
981
#define NEAR
975
#define NEAR
982
 
976
 
983
#endif
977
#endif
984
 
978
 
985
#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) \
-
 
986
 || (defined(__linux__) || defined(__OS2ELF__)) && defined(__ELF__) \
-
 
987
 || (defined(__FreeBSD__) && __FreeBSD__ >= 3) \
-
 
988
 || (defined(__NetBSD__) && defined(__ELF__))
-
 
989
#define GLNAME(a)	a
-
 
990
#else
-
 
991
#define GLNAME(a)	CONCAT(_, a)
979
#define GLNAME(a)	CONCAT(_, a)
992
#endif
-
 
993
 
980
 
994
/*
981
/*
995
 *	Addressing Modes
982
 *	Addressing Modes
996
 */
983
 */
997
 
984
 
998
/* Immediate Mode */
985
/* Immediate Mode */
999
#define P_ADDR(a)		OFFSET a
986
#define P_ADDR(a)		OFFSET a
1000
#define X_ADDR(a)		OFFSET a
987
#define X_ADDR(a)		OFFSET a
1001
#define D_ADDR(a)		OFFSET a
988
#define D_ADDR(a)		OFFSET a
1002
#define L_ADDR(a)		OFFSET a
989
#define L_ADDR(a)		OFFSET a
1003
#define W_ADDR(a)		OFFSET a
990
#define W_ADDR(a)		OFFSET a
1004
#define B_ADDR(a)		OFFSET a
991
#define B_ADDR(a)		OFFSET a
1005
 
992
 
1006
#define P_CONST(a)		a
993
#define P_CONST(a)		a
1007
#define X_CONST(a)		a
994
#define X_CONST(a)		a
1008
#define D_CONST(a)		a
995
#define D_CONST(a)		a
1009
#define L_CONST(a)		a
996
#define L_CONST(a)		a
1010
#define W_CONST(a)		a
997
#define W_CONST(a)		a
1011
#define B_CONST(a)		a
998
#define B_CONST(a)		a
1012
 
999
 
1013
/* Indirect Mode */
1000
/* Indirect Mode */
1014
#ifdef NASM_ASSEMBLER
1001
#ifdef NASM_ASSEMBLER
1015
#define P_CONTENT(a)		[a]
1002
#define P_CONTENT(a)		[a]
1016
#define X_CONTENT(a)		TBYTE_PTR [a]
1003
#define X_CONTENT(a)		TBYTE_PTR [a]
1017
#define D_CONTENT(a)		QWORD_PTR [a]
1004
#define D_CONTENT(a)		QWORD_PTR [a]
1018
#define L_CONTENT(a)		DWORD_PTR [a]
1005
#define L_CONTENT(a)		DWORD_PTR [a]
1019
#define W_CONTENT(a)		WORD_PTR [a]
1006
#define W_CONTENT(a)		WORD_PTR [a]
1020
#define B_CONTENT(a)		BYTE_PTR [a]
1007
#define B_CONTENT(a)		BYTE_PTR [a]
1021
#else
1008
#else
1022
#define P_CONTENT(a)		a
1009
#define P_CONTENT(a)		a
1023
#define X_CONTENT(a)		TBYTE_PTR a
1010
#define X_CONTENT(a)		TBYTE_PTR a
1024
#define D_CONTENT(a)		QWORD_PTR a
1011
#define D_CONTENT(a)		QWORD_PTR a
1025
#define L_CONTENT(a)		DWORD_PTR a
1012
#define L_CONTENT(a)		DWORD_PTR a
1026
#define W_CONTENT(a)		WORD_PTR a
1013
#define W_CONTENT(a)		WORD_PTR a
1027
#define B_CONTENT(a)		BYTE_PTR a
1014
#define B_CONTENT(a)		BYTE_PTR a
1028
#endif
1015
#endif
1029
 
1016
 
1030
/* Register a indirect */
1017
/* Register a indirect */
1031
#define P_REGIND(a)		[a]
1018
#define P_REGIND(a)		[a]
1032
#define X_REGIND(a)		TBYTE_PTR [a]
1019
#define X_REGIND(a)		TBYTE_PTR [a]
1033
#define D_REGIND(a)		QWORD_PTR [a]
1020
#define D_REGIND(a)		QWORD_PTR [a]
1034
#define L_REGIND(a)		DWORD_PTR [a]
1021
#define L_REGIND(a)		DWORD_PTR [a]
1035
#define W_REGIND(a)		WORD_PTR [a]
1022
#define W_REGIND(a)		WORD_PTR [a]
1036
#define B_REGIND(a)		BYTE_PTR [a]
1023
#define B_REGIND(a)		BYTE_PTR [a]
1037
 
1024
 
1038
/* Register b indirect plus displacement a */
1025
/* Register b indirect plus displacement a */
1039
#define P_REGOFF(a, b)		[b + a]
1026
#define P_REGOFF(a, b)		[b + a]
1040
#define X_REGOFF(a, b)		TBYTE_PTR [b + a]
1027
#define X_REGOFF(a, b)		TBYTE_PTR [b + a]
1041
#define D_REGOFF(a, b)		QWORD_PTR [b + a]
1028
#define D_REGOFF(a, b)		QWORD_PTR [b + a]
1042
#define L_REGOFF(a, b)		DWORD_PTR [b + a]
1029
#define L_REGOFF(a, b)		DWORD_PTR [b + a]
1043
#define W_REGOFF(a, b)		WORD_PTR [b + a]
1030
#define W_REGOFF(a, b)		WORD_PTR [b + a]
1044
#define B_REGOFF(a, b)		BYTE_PTR [b + a]
1031
#define B_REGOFF(a, b)		BYTE_PTR [b + a]
1045
 
1032
 
1046
/* Reg indirect Base + Index + Displacement  - this is mainly for 16-bit mode
1033
/* Reg indirect Base + Index + Displacement  - this is mainly for 16-bit mode
1047
 * which has no scaling
1034
 * which has no scaling
1048
 */
1035
 */
1049
#define P_REGBID(b, i, d)	[b + i + d]
1036
#define P_REGBID(b, i, d)	[b + i + d]
1050
#define X_REGBID(b, i, d)	TBYTE_PTR [b + i + d]
1037
#define X_REGBID(b, i, d)	TBYTE_PTR [b + i + d]
1051
#define D_REGBID(b, i, d)	QWORD_PTR [b + i + d]
1038
#define D_REGBID(b, i, d)	QWORD_PTR [b + i + d]
1052
#define L_REGBID(b, i, d)	DWORD_PTR [b + i + d]
1039
#define L_REGBID(b, i, d)	DWORD_PTR [b + i + d]
1053
#define W_REGBID(b, i, d)	WORD_PTR [b + i + d]
1040
#define W_REGBID(b, i, d)	WORD_PTR [b + i + d]
1054
#define B_REGBID(b, i, d)	BYTE_PTR [b + i + d]
1041
#define B_REGBID(b, i, d)	BYTE_PTR [b + i + d]
1055
 
1042
 
1056
/* Reg indirect Base + (Index * Scale) */
1043
/* Reg indirect Base + (Index * Scale) */
1057
#define P_REGBIS(b, i, s)	[b + i * s]
1044
#define P_REGBIS(b, i, s)	[b + i * s]
1058
#define X_REGBIS(b, i, s)	TBYTE_PTR [b + i * s]
1045
#define X_REGBIS(b, i, s)	TBYTE_PTR [b + i * s]
1059
#define D_REGBIS(b, i, s)	QWORD_PTR [b + i * s]
1046
#define D_REGBIS(b, i, s)	QWORD_PTR [b + i * s]
1060
#define L_REGBIS(b, i, s)	DWORD_PTR [b + i * s]
1047
#define L_REGBIS(b, i, s)	DWORD_PTR [b + i * s]
1061
#define W_REGBIS(b, i, s)	WORD_PTR [b + i * s]
1048
#define W_REGBIS(b, i, s)	WORD_PTR [b + i * s]
1062
#define B_REGBIS(b, i, s)	BYTE_PTR [b + i * s]
1049
#define B_REGBIS(b, i, s)	BYTE_PTR [b + i * s]
1063
 
1050
 
1064
/* Reg indirect Base + (Index * Scale) + Displacement */
1051
/* Reg indirect Base + (Index * Scale) + Displacement */
1065
#define P_REGBISD(b, i, s, d)	[b + i * s + d]
1052
#define P_REGBISD(b, i, s, d)	[b + i * s + d]
1066
#define X_REGBISD(b, i, s, d)	TBYTE_PTR [b + i * s + d]
1053
#define X_REGBISD(b, i, s, d)	TBYTE_PTR [b + i * s + d]
1067
#define D_REGBISD(b, i, s, d)	QWORD_PTR [b + i * s + d]
1054
#define D_REGBISD(b, i, s, d)	QWORD_PTR [b + i * s + d]
1068
#define L_REGBISD(b, i, s, d)	DWORD_PTR [b + i * s + d]
1055
#define L_REGBISD(b, i, s, d)	DWORD_PTR [b + i * s + d]
1069
#define W_REGBISD(b, i, s, d)	WORD_PTR [b + i * s + d]
1056
#define W_REGBISD(b, i, s, d)	WORD_PTR [b + i * s + d]
1070
#define B_REGBISD(b, i, s, d)	BYTE_PTR [b + i * s + d]
1057
#define B_REGBISD(b, i, s, d)	BYTE_PTR [b + i * s + d]
1071
 
1058
 
1072
/* Displaced Scaled Index: */
1059
/* Displaced Scaled Index: */
1073
#define P_REGDIS(d, i, s)	[i * s + d]
1060
#define P_REGDIS(d, i, s)	[i * s + d]
1074
#define X_REGDIS(d, i, s)	TBYTE_PTR [i * s + d]
1061
#define X_REGDIS(d, i, s)	TBYTE_PTR [i * s + d]
1075
#define D_REGDIS(d, i, s)	QWORD_PTR [i * s + d]
1062
#define D_REGDIS(d, i, s)	QWORD_PTR [i * s + d]
1076
#define L_REGDIS(d, i, s)	DWORD_PTR [i * s + d]
1063
#define L_REGDIS(d, i, s)	DWORD_PTR [i * s + d]
1077
#define W_REGDIS(d, i, s)	WORD_PTR [i * s + d]
1064
#define W_REGDIS(d, i, s)	WORD_PTR [i * s + d]
1078
#define B_REGDIS(d, i, s)	BYTE_PTR [i * s + d]
1065
#define B_REGDIS(d, i, s)	BYTE_PTR [i * s + d]
1079
 
1066
 
1080
/* Indexed Base: */
1067
/* Indexed Base: */
1081
#define P_REGBI(b, i)		[b + i]
1068
#define P_REGBI(b, i)		[b + i]
1082
#define X_REGBI(b, i)		TBYTE_PTR [b + i]
1069
#define X_REGBI(b, i)		TBYTE_PTR [b + i]
1083
#define D_REGBI(b, i)		QWORD_PTR [b + i]
1070
#define D_REGBI(b, i)		QWORD_PTR [b + i]
1084
#define L_REGBI(b, i)		DWORD_PTR [b + i]
1071
#define L_REGBI(b, i)		DWORD_PTR [b + i]
1085
#define W_REGBI(b, i)		WORD_PTR [b + i]
1072
#define W_REGBI(b, i)		WORD_PTR [b + i]
1086
#define B_REGBI(b, i)		BYTE_PTR [b + i]
1073
#define B_REGBI(b, i)		BYTE_PTR [b + i]
1087
 
1074
 
1088
/* Displaced Base: */
1075
/* Displaced Base: */
1089
#define P_REGDB(d, b)		[b + d]
1076
#define P_REGDB(d, b)		[b + d]
1090
#define X_REGDB(d, b)		TBYTE_PTR [b + d]
1077
#define X_REGDB(d, b)		TBYTE_PTR [b + d]
1091
#define D_REGDB(d, b)		QWORD_PTR [b + d]
1078
#define D_REGDB(d, b)		QWORD_PTR [b + d]
1092
#define L_REGDB(d, b)		DWORD_PTR [b + d]
1079
#define L_REGDB(d, b)		DWORD_PTR [b + d]
1093
#define W_REGDB(d, b)		WORD_PTR [b + d]
1080
#define W_REGDB(d, b)		WORD_PTR [b + d]
1094
#define B_REGDB(d, b)		BYTE_PTR [b + d]
1081
#define B_REGDB(d, b)		BYTE_PTR [b + d]
1095
 
1082
 
1096
/* Variable indirect: */
1083
/* Variable indirect: */
1097
#define VARINDIRECT(var)	[var]
1084
#define VARINDIRECT(var)	[var]
1098
 
1085
 
1099
/* Use register contents as jump/call target: */
1086
/* Use register contents as jump/call target: */
1100
#define CODEPTR(reg)		P_(reg)
1087
#define CODEPTR(reg)		P_(reg)
1101
 
1088
 
1102
/*
1089
/*
1103
 * Redefine assembler commands
1090
 * Redefine assembler commands
1104
 */
1091
 */
1105
 
1092
 
1106
#define P_(a)			P_ ## a
1093
#define P_(a)			P_ ## a
1107
#define X_(a)			X_ ## a
1094
#define X_(a)			X_ ## a
1108
#define D_(a)			D_ ## a
1095
#define D_(a)			D_ ## a
1109
#define SR_(a)			W_ ## a
1096
#define SR_(a)			W_ ## a
1110
#define S_(a)			L_ ## a
1097
#define S_(a)			L_ ## a
1111
#define L_(a)			L_ ## a
1098
#define L_(a)			L_ ## a
1112
#define W_(a)			W_ ## a
1099
#define W_(a)			W_ ## a
1113
#define B_(a)			B_ ## a
1100
#define B_(a)			B_ ## a
1114
 
1101
 
1115
#define AAA			aaa
1102
#define AAA			aaa
1116
#define AAD			aad
1103
#define AAD			aad
1117
#define AAM			aam
1104
#define AAM			aam
1118
#define AAS			aas
1105
#define AAS			aas
1119
#define ADC_L(a, b)		adc L_(b), L_(a)
1106
#define ADC_L(a, b)		adc L_(b), L_(a)
1120
#define ADC_W(a, b)		adc W_(b), W_(a)
1107
#define ADC_W(a, b)		adc W_(b), W_(a)
1121
#define ADC_B(a, b)		adc B_(b), B_(a)
1108
#define ADC_B(a, b)		adc B_(b), B_(a)
1122
#define ADD_L(a, b)		add L_(b), L_(a)
1109
#define ADD_L(a, b)		add L_(b), L_(a)
1123
#define ADD_W(a, b)		add W_(b), W_(a)
1110
#define ADD_W(a, b)		add W_(b), W_(a)
1124
#define ADD_B(a, b)		add B_(b), B_(a)
1111
#define ADD_B(a, b)		add B_(b), B_(a)
1125
#define AND_L(a, b)		and L_(b), L_(a)
1112
#define AND_L(a, b)		and L_(b), L_(a)
1126
#define AND_W(a, b)		and W_(b), W_(a)
1113
#define AND_W(a, b)		and W_(b), W_(a)
1127
#define AND_B(a, b)		and B_(b), B_(a)
1114
#define AND_B(a, b)		and B_(b), B_(a)
1128
#define ARPL(a,b)		arpl W_(b), a
1115
#define ARPL(a,b)		arpl W_(b), a
1129
#define BOUND_L(a, b)		bound L_(b), L_(a)
1116
#define BOUND_L(a, b)		bound L_(b), L_(a)
1130
#define BOUND_W(a, b)		bound W_(b), W_(a)
1117
#define BOUND_W(a, b)		bound W_(b), W_(a)
1131
#define BSF_L(a, b)		bsf L_(b), L_(a)
1118
#define BSF_L(a, b)		bsf L_(b), L_(a)
1132
#define BSF_W(a, b)		bsf W_(b), W_(a)
1119
#define BSF_W(a, b)		bsf W_(b), W_(a)
1133
#define BSR_L(a, b)		bsr L_(b), L_(a)
1120
#define BSR_L(a, b)		bsr L_(b), L_(a)
1134
#define BSR_W(a, b)		bsr W_(b), W_(a)
1121
#define BSR_W(a, b)		bsr W_(b), W_(a)
1135
#define BT_L(a, b)		bt L_(b), L_(a)
1122
#define BT_L(a, b)		bt L_(b), L_(a)
1136
#define BT_W(a, b)		bt W_(b), W_(a)
1123
#define BT_W(a, b)		bt W_(b), W_(a)
1137
#define BTC_L(a, b)		btc L_(b), L_(a)
1124
#define BTC_L(a, b)		btc L_(b), L_(a)
1138
#define BTC_W(a, b)		btc W_(b), W_(a)
1125
#define BTC_W(a, b)		btc W_(b), W_(a)
1139
#define BTR_L(a, b)		btr L_(b), L_(a)
1126
#define BTR_L(a, b)		btr L_(b), L_(a)
1140
#define BTR_W(a, b)		btr W_(b), W_(a)
1127
#define BTR_W(a, b)		btr W_(b), W_(a)
1141
#define BTS_L(a, b)		bts L_(b), L_(a)
1128
#define BTS_L(a, b)		bts L_(b), L_(a)
1142
#define BTS_W(a, b)		bts W_(b), W_(a)
1129
#define BTS_W(a, b)		bts W_(b), W_(a)
1143
#define CALL(a)			call a
1130
#define CALL(a)			call a
1144
#define CALLF(s,a)		call far s:a
1131
#define CALLF(s,a)		call far s:a
1145
#define CBW			cbw
1132
#define CBW			cbw
1146
#define CWDE			cwde
1133
#define CWDE			cwde
1147
#define CLC			clc
1134
#define CLC			clc
1148
#define CLD			cld
1135
#define CLD			cld
1149
#define CLI			cli
1136
#define CLI			cli
1150
#define CLTS			clts
1137
#define CLTS			clts
1151
#define CMC			cmc
1138
#define CMC			cmc
1152
#define CMP_L(a, b)		cmp L_(b), L_(a)
1139
#define CMP_L(a, b)		cmp L_(b), L_(a)
1153
#define CMP_W(a, b)		cmp W_(b), W_(a)
1140
#define CMP_W(a, b)		cmp W_(b), W_(a)
1154
#define CMP_B(a, b)		cmp B_(b), B_(a)
1141
#define CMP_B(a, b)		cmp B_(b), B_(a)
1155
#define CMPS_L			cmpsd
1142
#define CMPS_L			cmpsd
1156
#define CMPS_W			cmpsw
1143
#define CMPS_W			cmpsw
1157
#define CMPS_B			cmpsb
1144
#define CMPS_B			cmpsb
1158
#define CPUID			cpuid
1145
#define CPUID			cpuid
1159
#define CWD			cwd
1146
#define CWD			cwd
1160
#define CDQ			cdq
1147
#define CDQ			cdq
1161
#define DAA			daa
1148
#define DAA			daa
1162
#define DAS			das
1149
#define DAS			das
1163
#define DEC_L(a)		dec L_(a)
1150
#define DEC_L(a)		dec L_(a)
1164
#define DEC_W(a)		dec W_(a)
1151
#define DEC_W(a)		dec W_(a)
1165
#define DEC_B(a)		dec B_(a)
1152
#define DEC_B(a)		dec B_(a)
1166
#define DIV_L(a)		div L_(a)
1153
#define DIV_L(a)		div L_(a)
1167
#define DIV_W(a)		div W_(a)
1154
#define DIV_W(a)		div W_(a)
1168
#define DIV_B(a)		div B_(a)
1155
#define DIV_B(a)		div B_(a)
1169
#define ENTER(a,b)		enter b, a
1156
#define ENTER(a,b)		enter b, a
1170
#define HLT			hlt
1157
#define HLT			hlt
1171
#define IDIV_L(a)		idiv L_(a)
1158
#define IDIV_L(a)		idiv L_(a)
1172
#define IDIV_W(a)		idiv W_(a)
1159
#define IDIV_W(a)		idiv W_(a)
1173
#define IDIV_B(a)		idiv B_(a)
1160
#define IDIV_B(a)		idiv B_(a)
1174
#define IMUL_L(a, b)		imul L_(b), L_(a)
1161
#define IMUL_L(a, b)		imul L_(b), L_(a)
1175
#define IMUL_W(a, b)		imul W_(b), W_(a)
1162
#define IMUL_W(a, b)		imul W_(b), W_(a)
1176
#define IMUL_B(a)		imul B_(a)
1163
#define IMUL_B(a)		imul B_(a)
1177
#define IN_L			in EAX, DX
1164
#define IN_L			in EAX, DX
1178
#define IN_W			in AX, DX
1165
#define IN_W			in AX, DX
1179
#define IN_B			in AL, DX
1166
#define IN_B			in AL, DX
1180
#define IN1_L(a)		in1 L_(a)
1167
#define IN1_L(a)		in1 L_(a)
1181
#define IN1_W(a)		in1 W_(a)
1168
#define IN1_W(a)		in1 W_(a)
1182
#define IN1_B(a)		in1 B_(a)
1169
#define IN1_B(a)		in1 B_(a)
1183
#define INC_L(a)		inc L_(a)
1170
#define INC_L(a)		inc L_(a)
1184
#define INC_W(a)		inc W_(a)
1171
#define INC_W(a)		inc W_(a)
1185
#define INC_B(a)		inc B_(a)
1172
#define INC_B(a)		inc B_(a)
1186
#define INS_L			ins
1173
#define INS_L			ins
1187
#define INS_W			ins
1174
#define INS_W			ins
1188
#define INS_B			ins
1175
#define INS_B			ins
1189
#define INT(a)			int B_(a)
1176
#define INT(a)			int B_(a)
1190
#define INT3			int3
1177
#define INT3			int3
1191
#define INTO			into
1178
#define INTO			into
1192
#define IRET			iret
1179
#define IRET			iret
1193
#define IRETD			iretd
1180
#define IRETD			iretd
1194
#define JA(a)			ja NEAR a
1181
#define JA(a)			ja NEAR a
1195
#define JAE(a)			jae NEAR a
1182
#define JAE(a)			jae NEAR a
1196
#define JB(a)			jb NEAR a
1183
#define JB(a)			jb NEAR a
1197
#define JBE(a)			jbe NEAR a
1184
#define JBE(a)			jbe NEAR a
1198
#define JC(a)			jc NEAR a
1185
#define JC(a)			jc NEAR a
1199
#define JE(a)			je NEAR a
1186
#define JE(a)			je NEAR a
1200
#define JG(a)			jg NEAR a
1187
#define JG(a)			jg NEAR a
1201
#define JGE(a)			jge NEAR a
1188
#define JGE(a)			jge NEAR a
1202
#define JL(a)			jl NEAR a
1189
#define JL(a)			jl NEAR a
1203
#define JLE(a)			jle NEAR a
1190
#define JLE(a)			jle NEAR a
1204
#define JNA(a)			jna NEAR a
1191
#define JNA(a)			jna NEAR a
1205
#define JNAE(a)			jnae NEAR a
1192
#define JNAE(a)			jnae NEAR a
1206
#define JNB(a)			jnb NEAR a
1193
#define JNB(a)			jnb NEAR a
1207
#define JNBE(a)			jnbe NEAR a
1194
#define JNBE(a)			jnbe NEAR a
1208
#define JNC(a)			jnc NEAR a
1195
#define JNC(a)			jnc NEAR a
1209
#define JNE(a)			jne NEAR a
1196
#define JNE(a)			jne NEAR a
1210
#define JNG(a)			jng NEAR a
1197
#define JNG(a)			jng NEAR a
1211
#define JNGE(a)			jnge NEAR a
1198
#define JNGE(a)			jnge NEAR a
1212
#define JNL(a)			jnl NEAR a
1199
#define JNL(a)			jnl NEAR a
1213
#define JNLE(a)			jnle NEAR a
1200
#define JNLE(a)			jnle NEAR a
1214
#define JNO(a)			jno NEAR a
1201
#define JNO(a)			jno NEAR a
1215
#define JNP(a)			jnp NEAR a
1202
#define JNP(a)			jnp NEAR a
1216
#define JNS(a)			jns NEAR a
1203
#define JNS(a)			jns NEAR a
1217
#define JNZ(a)			jnz NEAR a
1204
#define JNZ(a)			jnz NEAR a
1218
#define JO(a)			jo NEAR a
1205
#define JO(a)			jo NEAR a
1219
#define JP(a)			jp NEAR a
1206
#define JP(a)			jp NEAR a
1220
#define JPE(a)			jpe NEAR a
1207
#define JPE(a)			jpe NEAR a
1221
#define JPO(a)			jpo NEAR a
1208
#define JPO(a)			jpo NEAR a
1222
#define JS(a)			js NEAR a
1209
#define JS(a)			js NEAR a
1223
#define JZ(a)			jz NEAR a
1210
#define JZ(a)			jz NEAR a
1224
#define JMP(a)			jmp a
1211
#define JMP(a)			jmp a
1225
#define JMPF(s,a)		jmp far s:a
1212
#define JMPF(s,a)		jmp far s:a
1226
#define LAHF			lahf
1213
#define LAHF			lahf
1227
#define LAR(a, b)		lar b, a
1214
#define LAR(a, b)		lar b, a
1228
#define LEA_L(a, b)		lea P_(b), P_(a)
1215
#define LEA_L(a, b)		lea P_(b), P_(a)
1229
#define LEA_W(a, b)		lea P_(b), P_(a)
1216
#define LEA_W(a, b)		lea P_(b), P_(a)
1230
#define LEAVE			leave
1217
#define LEAVE			leave
1231
#define LGDT(a)			lgdt a
1218
#define LGDT(a)			lgdt a
1232
#define LIDT(a)			lidt a
1219
#define LIDT(a)			lidt a
1233
#define LDS(a, b)		lds b, P_(a)
1220
#define LDS(a, b)		lds b, P_(a)
1234
#define LES(a, b)		les b, P_(a)
1221
#define LES(a, b)		les b, P_(a)
1235
#define LFS(a, b)		lfs b, P_(a)
1222
#define LFS(a, b)		lfs b, P_(a)
1236
#define LGS(a, b)		lgs b, P_(a)
1223
#define LGS(a, b)		lgs b, P_(a)
1237
#define LSS(a, b)		lss b, P_(a)
1224
#define LSS(a, b)		lss b, P_(a)
1238
#define LLDT(a)			lldt a
1225
#define LLDT(a)			lldt a
1239
#define LMSW(a)			lmsw a
1226
#define LMSW(a)			lmsw a
1240
#define LOCK			lock
1227
#define LOCK			lock
1241
#define LODS_L			lodsd
1228
#define LODS_L			lodsd
1242
#define LODS_W			lodsw
1229
#define LODS_W			lodsw
1243
#define LODS_B			lodsb
1230
#define LODS_B			lodsb
1244
#define LOOP(a)			loop a
1231
#define LOOP(a)			loop a
1245
#define LOOPE(a)		loope a
1232
#define LOOPE(a)		loope a
1246
#define LOOPZ(a)		loopz a
1233
#define LOOPZ(a)		loopz a
1247
#define LOOPNE(a)		loopne a
1234
#define LOOPNE(a)		loopne a
1248
#define LOOPNZ(a)		loopnz a
1235
#define LOOPNZ(a)		loopnz a
1249
#define LSL(a, b)		lsl b, a
1236
#define LSL(a, b)		lsl b, a
1250
#define LTR(a)			ltr a
1237
#define LTR(a)			ltr a
1251
#define MOV_SR(a, b)		mov SR_(b), SR_(a)
1238
#define MOV_SR(a, b)		mov SR_(b), SR_(a)
1252
#define MOV_L(a, b)		mov L_(b), L_(a)
1239
#define MOV_L(a, b)		mov L_(b), L_(a)
1253
#define MOV_W(a, b)		mov W_(b), W_(a)
1240
#define MOV_W(a, b)		mov W_(b), W_(a)
1254
#define MOV_B(a, b)		mov B_(b), B_(a)
1241
#define MOV_B(a, b)		mov B_(b), B_(a)
1255
#define MOVS_L			movsd
1242
#define MOVS_L			movsd
1256
#define MOVS_W			movsw
1243
#define MOVS_W			movsw
1257
#define MOVS_B			movsb
1244
#define MOVS_B			movsb
1258
#define MOVSX_BL(a, b)		movsx B_(b), B_(a)
1245
#define MOVSX_BL(a, b)		movsx B_(b), B_(a)
1259
#define MOVSX_BW(a, b)		movsx B_(b), B_(a)
1246
#define MOVSX_BW(a, b)		movsx B_(b), B_(a)
1260
#define MOVSX_WL(a, b)		movsx W_(b), W_(a)
1247
#define MOVSX_WL(a, b)		movsx W_(b), W_(a)
1261
#define MOVZX_BL(a, b)		movzx B_(b), B_(a)
1248
#define MOVZX_BL(a, b)		movzx B_(b), B_(a)
1262
#define MOVZX_BW(a, b)		movzx B_(b), B_(a)
1249
#define MOVZX_BW(a, b)		movzx B_(b), B_(a)
1263
#define MOVZX_WL(a, b)		movzx W_(b), W_(a)
1250
#define MOVZX_WL(a, b)		movzx W_(b), W_(a)
1264
#define MUL_L(a)		mul L_(a)
1251
#define MUL_L(a)		mul L_(a)
1265
#define MUL_W(a)		mul W_(a)
1252
#define MUL_W(a)		mul W_(a)
1266
#define MUL_B(a)		mul B_(a)
1253
#define MUL_B(a)		mul B_(a)
1267
#define NEG_L(a)		neg L_(a)
1254
#define NEG_L(a)		neg L_(a)
1268
#define NEG_W(a)		neg W_(a)
1255
#define NEG_W(a)		neg W_(a)
1269
#define NEG_B(a)		neg B_(a)
1256
#define NEG_B(a)		neg B_(a)
1270
#define NOP			nop
1257
#define NOP			nop
1271
#define NOT_L(a)		not L_(a)
1258
#define NOT_L(a)		not L_(a)
1272
#define NOT_W(a)		not W_(a)
1259
#define NOT_W(a)		not W_(a)
1273
#define NOT_B(a)		not B_(a)
1260
#define NOT_B(a)		not B_(a)
1274
#define OR_L(a,b)		or L_(b), L_(a)
1261
#define OR_L(a,b)		or L_(b), L_(a)
1275
#define OR_W(a,b)		or W_(b), W_(a)
1262
#define OR_W(a,b)		or W_(b), W_(a)
1276
#define OR_B(a,b)		or B_(b), B_(a)
1263
#define OR_B(a,b)		or B_(b), B_(a)
1277
#define OUT_L			out DX, EAX
1264
#define OUT_L			out DX, EAX
1278
#define OUT_W			out DX, AX
1265
#define OUT_W			out DX, AX
1279
#define OUT_B			out DX, AL
1266
#define OUT_B			out DX, AL
1280
#define OUT1_L(a)		out1 L_(a)
1267
#define OUT1_L(a)		out1 L_(a)
1281
#define OUT1_W(a)		out1 W_(a)
1268
#define OUT1_W(a)		out1 W_(a)
1282
#define OUT1_B(a)		out1 B_(a)
1269
#define OUT1_B(a)		out1 B_(a)
1283
#define OUTS_L			outsd
1270
#define OUTS_L			outsd
1284
#define OUTS_W			outsw
1271
#define OUTS_W			outsw
1285
#define OUTS_B			outsb
1272
#define OUTS_B			outsb
1286
#define POP_SR(a)		pop SR_(a)
1273
#define POP_SR(a)		pop SR_(a)
1287
#define POP_L(a)		pop L_(a)
1274
#define POP_L(a)		pop L_(a)
1288
#define POP_W(a)		pop W_(a)
1275
#define POP_W(a)		pop W_(a)
1289
#define POPA_L			popad
1276
#define POPA_L			popad
1290
#define POPA_W			popa
1277
#define POPA_W			popa
1291
#define POPF_L			popfd
1278
#define POPF_L			popfd
1292
#define POPF_W			popf
1279
#define POPF_W			popf
1293
#define PUSH_SR(a)		push SR_(a)
1280
#define PUSH_SR(a)		push SR_(a)
1294
#define PUSH_L(a)		push L_(a)
1281
#define PUSH_L(a)		push L_(a)
1295
#define PUSH_W(a)		push W_(a)
1282
#define PUSH_W(a)		push W_(a)
1296
#define PUSH_B(a)		push B_(a)
1283
#define PUSH_B(a)		push B_(a)
1297
#define PUSHA_L			pushad
1284
#define PUSHA_L			pushad
1298
#define PUSHA_W			pusha
1285
#define PUSHA_W			pusha
1299
#define PUSHF_L			pushfd
1286
#define PUSHF_L			pushfd
1300
#define PUSHF_W			pushf
1287
#define PUSHF_W			pushf
1301
#define RCL_L(a, b)		rcl L_(b), L_(a)
1288
#define RCL_L(a, b)		rcl L_(b), L_(a)
1302
#define RCL_W(a, b)		rcl W_(b), W_(a)
1289
#define RCL_W(a, b)		rcl W_(b), W_(a)
1303
#define RCL_B(a, b)		rcl B_(b), B_(a)
1290
#define RCL_B(a, b)		rcl B_(b), B_(a)
1304
#define RCR_L(a, b)		rcr L_(b), L_(a)
1291
#define RCR_L(a, b)		rcr L_(b), L_(a)
1305
#define RCR_W(a, b)		rcr W_(b), W_(a)
1292
#define RCR_W(a, b)		rcr W_(b), W_(a)
1306
#define RCR_B(a, b)		rcr B_(b), B_(a)
1293
#define RCR_B(a, b)		rcr B_(b), B_(a)
1307
#define RDTSC			rdtsc
1294
#define RDTSC			rdtsc
1308
#define ROL_L(a, b)		rol L_(b), L_(a)
1295
#define ROL_L(a, b)		rol L_(b), L_(a)
1309
#define ROL_W(a, b)		rol W_(b), W_(a)
1296
#define ROL_W(a, b)		rol W_(b), W_(a)
1310
#define ROL_B(a, b)		rol B_(b), B_(a)
1297
#define ROL_B(a, b)		rol B_(b), B_(a)
1311
#define ROR_L(a, b)		ror L_(b), L_(a)
1298
#define ROR_L(a, b)		ror L_(b), L_(a)
1312
#define ROR_W(a, b)		ror W_(b), W_(a)
1299
#define ROR_W(a, b)		ror W_(b), W_(a)
1313
#define ROR_B(a, b)		ror B_(b), B_(a)
1300
#define ROR_B(a, b)		ror B_(b), B_(a)
1314
#define REP			rep
1301
#define REP			rep
1315
#define REPE			repe
1302
#define REPE			repe
1316
#define REPNE			repne
1303
#define REPNE			repne
1317
#define REPNZ			REPNE
1304
#define REPNZ			REPNE
1318
#define REPZ			REPE
1305
#define REPZ			REPE
1319
#define RET			ret
1306
#define RET			ret
1320
#define SAHF			sahf
1307
#define SAHF			sahf
1321
#define SAL_L(a, b)		sal L_(b), B_(a)
1308
#define SAL_L(a, b)		sal L_(b), B_(a)
1322
#define SAL_W(a, b)		sal W_(b), B_(a)
1309
#define SAL_W(a, b)		sal W_(b), B_(a)
1323
#define SAL_B(a, b)		sal B_(b), B_(a)
1310
#define SAL_B(a, b)		sal B_(b), B_(a)
1324
#define SAR_L(a, b)		sar L_(b), B_(a)
1311
#define SAR_L(a, b)		sar L_(b), B_(a)
1325
#define SAR_W(a, b)		sar W_(b), B_(a)
1312
#define SAR_W(a, b)		sar W_(b), B_(a)
1326
#define SAR_B(a, b)		sar B_(b), B_(a)
1313
#define SAR_B(a, b)		sar B_(b), B_(a)
1327
#define SBB_L(a, b)		sbb L_(b), L_(a)
1314
#define SBB_L(a, b)		sbb L_(b), L_(a)
1328
#define SBB_W(a, b)		sbb W_(b), W_(a)
1315
#define SBB_W(a, b)		sbb W_(b), W_(a)
1329
#define SBB_B(a, b)		sbb B_(b), B_(a)
1316
#define SBB_B(a, b)		sbb B_(b), B_(a)
1330
#define SCAS_L			scas
1317
#define SCAS_L			scas
1331
#define SCAS_W			scas
1318
#define SCAS_W			scas
1332
#define SCAS_B			scas
1319
#define SCAS_B			scas
1333
#define SETA(a)			seta a
1320
#define SETA(a)			seta a
1334
#define SETAE(a)		setae a
1321
#define SETAE(a)		setae a
1335
#define SETB(a)			setb a
1322
#define SETB(a)			setb a
1336
#define SETBE(a)		setbe a
1323
#define SETBE(a)		setbe a
1337
#define SETC(a)			setc a
1324
#define SETC(a)			setc a
1338
#define SETE(a)			sete a
1325
#define SETE(a)			sete a
1339
#define SETG(a)			setg a
1326
#define SETG(a)			setg a
1340
#define SETGE(a)		setge a
1327
#define SETGE(a)		setge a
1341
#define SETL(a)			setl a
1328
#define SETL(a)			setl a
1342
#define SETLE(a)		setle a
1329
#define SETLE(a)		setle a
1343
#define SETNA(a)		setna a
1330
#define SETNA(a)		setna a
1344
#define SETNAE(a)		setnae a
1331
#define SETNAE(a)		setnae a
1345
#define SETNB(a)		setnb a
1332
#define SETNB(a)		setnb a
1346
#define SETNBE(a)		setnbe a
1333
#define SETNBE(a)		setnbe a
1347
#define SETNC(a)		setnc a
1334
#define SETNC(a)		setnc a
1348
#define SETNE(a)		setne a
1335
#define SETNE(a)		setne a
1349
#define SETNG(a)		setng a
1336
#define SETNG(a)		setng a
1350
#define SETNGE(a)		setnge a
1337
#define SETNGE(a)		setnge a
1351
#define SETNL(a)		setnl a
1338
#define SETNL(a)		setnl a
1352
#define SETNLE(a)		setnle a
1339
#define SETNLE(a)		setnle a
1353
#define SETNO(a)		setno a
1340
#define SETNO(a)		setno a
1354
#define SETNP(a)		setnp a
1341
#define SETNP(a)		setnp a
1355
#define SETNS(a)		setns a
1342
#define SETNS(a)		setns a
1356
#define SETNZ(a)		setnz a
1343
#define SETNZ(a)		setnz a
1357
#define SETO(a)			seto a
1344
#define SETO(a)			seto a
1358
#define SETP(a)			setp a
1345
#define SETP(a)			setp a
1359
#define SETPE(a)		setpe a
1346
#define SETPE(a)		setpe a
1360
#define SETPO(a)		setpo a
1347
#define SETPO(a)		setpo a
1361
#define SETS(a)			sets a
1348
#define SETS(a)			sets a
1362
#define SETZ(a)			setz a
1349
#define SETZ(a)			setz a
1363
#define SGDT(a)			sgdt a
1350
#define SGDT(a)			sgdt a
1364
#define SIDT(a)			sidt a
1351
#define SIDT(a)			sidt a
1365
#define SHL_L(a, b)		shl L_(b), B_(a)
1352
#define SHL_L(a, b)		shl L_(b), B_(a)
1366
#define SHL_W(a, b)		shl W_(b), B_(a)
1353
#define SHL_W(a, b)		shl W_(b), B_(a)
1367
#define SHL_B(a, b)		shl B_(b), B_(a)
1354
#define SHL_B(a, b)		shl B_(b), B_(a)
1368
#define SHLD_L(a,b,c)		shld
1355
#define SHLD_L(a,b,c)		shld
1369
#define SHLD2_L(a,b)		shld L_(b), L_(a)
1356
#define SHLD2_L(a,b)		shld L_(b), L_(a)
1370
#define SHLD_W(a,b,c)		shld
1357
#define SHLD_W(a,b,c)		shld
1371
#define SHLD2_W(a,b)		shld W_(b), W_(a)
1358
#define SHLD2_W(a,b)		shld W_(b), W_(a)
1372
#define SHR_L(a, b)		shr L_(b), B_(a)
1359
#define SHR_L(a, b)		shr L_(b), B_(a)
1373
#define SHR_W(a, b)		shr W_(b), B_(a)
1360
#define SHR_W(a, b)		shr W_(b), B_(a)
1374
#define SHR_B(a, b)		shr B_(b), B_(a)
1361
#define SHR_B(a, b)		shr B_(b), B_(a)
1375
#define SHRD_L(a,b,c)		shrd
1362
#define SHRD_L(a,b,c)		shrd
1376
#define SHRD2_L(a,b)		shrd L_(b), L_(a)
1363
#define SHRD2_L(a,b)		shrd L_(b), L_(a)
1377
#define SHRD_W(a,b,c)		shrd
1364
#define SHRD_W(a,b,c)		shrd
1378
#define SHRD2_W(a,b)		shrd W_(b), W_(a)
1365
#define SHRD2_W(a,b)		shrd W_(b), W_(a)
1379
#define SLDT(a)			sldt a
1366
#define SLDT(a)			sldt a
1380
#define SMSW(a)			smsw a
1367
#define SMSW(a)			smsw a
1381
#define STC			stc
1368
#define STC			stc
1382
#define STD			std
1369
#define STD			std
1383
#define STI			sti
1370
#define STI			sti
1384
#define STOS_L			stosd
1371
#define STOS_L			stosd
1385
#define STOS_W			stosw
1372
#define STOS_W			stosw
1386
#define STOS_B			stosb
1373
#define STOS_B			stosb
1387
#define STR(a)			str a
1374
#define STR(a)			str a
1388
#define SUB_L(a, b)		sub L_(b), L_(a)
1375
#define SUB_L(a, b)		sub L_(b), L_(a)
1389
#define SUB_W(a, b)		sub W_(b), W_(a)
1376
#define SUB_W(a, b)		sub W_(b), W_(a)
1390
#define SUB_B(a, b)		sub B_(b), B_(a)
1377
#define SUB_B(a, b)		sub B_(b), B_(a)
1391
#define TEST_L(a, b)		test L_(b), L_(a)
1378
#define TEST_L(a, b)		test L_(b), L_(a)
1392
#define TEST_W(a, b)		test W_(b), W_(a)
1379
#define TEST_W(a, b)		test W_(b), W_(a)
1393
#define TEST_B(a, b)		test B_(b), B_(a)
1380
#define TEST_B(a, b)		test B_(b), B_(a)
1394
#define VERR(a)			verr a
1381
#define VERR(a)			verr a
1395
#define VERW(a)			verw a
1382
#define VERW(a)			verw a
1396
#define WAIT			wait
1383
#define WAIT			wait
1397
#define XCHG_L(a, b)		xchg L_(b), L_(a)
1384
#define XCHG_L(a, b)		xchg L_(b), L_(a)
1398
#define XCHG_W(a, b)		xchg W_(b), W_(a)
1385
#define XCHG_W(a, b)		xchg W_(b), W_(a)
1399
#define XCHG_B(a, b)		xchg B_(b), B_(a)
1386
#define XCHG_B(a, b)		xchg B_(b), B_(a)
1400
#define XLAT			xlat
1387
#define XLAT			xlat
1401
#define XOR_L(a, b)		xor L_(b), L_(a)
1388
#define XOR_L(a, b)		xor L_(b), L_(a)
1402
#define XOR_W(a, b)		xor W_(b), W_(a)
1389
#define XOR_W(a, b)		xor W_(b), W_(a)
1403
#define XOR_B(a, b)		xor B_(b), B_(a)
1390
#define XOR_B(a, b)		xor B_(b), B_(a)
1404
 
1391
 
1405
 
1392
 
1406
/* Floating Point Instructions */
1393
/* Floating Point Instructions */
1407
#define F2XM1			f2xm1
1394
#define F2XM1			f2xm1
1408
#define FABS			fabs
1395
#define FABS			fabs
1409
#define FADD_D(a)		fadd D_(a)
1396
#define FADD_D(a)		fadd D_(a)
1410
#define FADD_S(a)		fadd S_(a)
1397
#define FADD_S(a)		fadd S_(a)
1411
#define FADD2(a, b)		fadd b, a
1398
#define FADD2(a, b)		fadd b, a
1412
#define FADDP(a, b)		faddp b, a
1399
#define FADDP(a, b)		faddp b, a
1413
#define FIADD_L(a)		fiadd L_(a)
1400
#define FIADD_L(a)		fiadd L_(a)
1414
#define FIADD_W(a)		fiadd W_(a)
1401
#define FIADD_W(a)		fiadd W_(a)
1415
#define FBLD(a)			fbld a
1402
#define FBLD(a)			fbld a
1416
#define FBSTP(a)		fbstp a
1403
#define FBSTP(a)		fbstp a
1417
#define FCHS			fchs
1404
#define FCHS			fchs
1418
#define FCLEX			fclex
1405
#define FCLEX			fclex
1419
#define FNCLEX			fnclex
1406
#define FNCLEX			fnclex
1420
#define FCOM(a)			fcom a
1407
#define FCOM(a)			fcom a
1421
#define FCOM_D(a)		fcom D_(a)
1408
#define FCOM_D(a)		fcom D_(a)
1422
#define FCOM_S(a)		fcom S_(a)
1409
#define FCOM_S(a)		fcom S_(a)
1423
#define FCOMP(a)		fcomp a
1410
#define FCOMP(a)		fcomp a
1424
#define FCOMP_D(a)		fcomp D_(a)
1411
#define FCOMP_D(a)		fcomp D_(a)
1425
#define FCOMP_S(a)		fcomp S_(a)
1412
#define FCOMP_S(a)		fcomp S_(a)
1426
#define FCOMPP			fcompp
1413
#define FCOMPP			fcompp
1427
#define FCOS			fcos
1414
#define FCOS			fcos
1428
#define FDECSTP			fdecstp
1415
#define FDECSTP			fdecstp
1429
#define FDIV_D(a)		fdiv D_(a)
1416
#define FDIV_D(a)		fdiv D_(a)
1430
#define FDIV_S(a)		fdiv S_(a)
1417
#define FDIV_S(a)		fdiv S_(a)
1431
#define FDIV2(a, b)		fdiv b, a
1418
#define FDIV2(a, b)		fdiv b, a
1432
#define FDIVP(a, b)		fdivp b, a
1419
#define FDIVP(a, b)		fdivp b, a
1433
#define FIDIV_L(a)		fidiv L_(a)
1420
#define FIDIV_L(a)		fidiv L_(a)
1434
#define FIDIV_W(a)		fidiv W_(a)
1421
#define FIDIV_W(a)		fidiv W_(a)
1435
#define FDIVR_D(a)		fdivr D_(a)
1422
#define FDIVR_D(a)		fdivr D_(a)
1436
#define FDIVR_S(a)		fdivr S_(a)
1423
#define FDIVR_S(a)		fdivr S_(a)
1437
#define FDIVR2(a, b)		fdivr b, a
1424
#define FDIVR2(a, b)		fdivr b, a
1438
#define FDIVRP(a, b)		fdivrp b, a
1425
#define FDIVRP(a, b)		fdivrp b, a
1439
#define FIDIVR_L(a)		fidivr L_(a)
1426
#define FIDIVR_L(a)		fidivr L_(a)
1440
#define FIDIVR_W(a)		fidivr W_(a)
1427
#define FIDIVR_W(a)		fidivr W_(a)
1441
#define FFREE(a)		ffree a
1428
#define FFREE(a)		ffree a
1442
#define FICOM_L(a)		ficom L_(a)
1429
#define FICOM_L(a)		ficom L_(a)
1443
#define FICOM_W(a)		ficom W_(a)
1430
#define FICOM_W(a)		ficom W_(a)
1444
#define FICOMP_L(a)		ficomp L_(a)
1431
#define FICOMP_L(a)		ficomp L_(a)
1445
#define FICOMP_W(a)		ficomp W_(a)
1432
#define FICOMP_W(a)		ficomp W_(a)
1446
#define FILD_Q(a)		fild D_(a)
1433
#define FILD_Q(a)		fild D_(a)
1447
#define FILD_L(a)		fild L_(a)
1434
#define FILD_L(a)		fild L_(a)
1448
#define FILD_W(a)		fild W_(a)
1435
#define FILD_W(a)		fild W_(a)
1449
#define FINCSTP			fincstp
1436
#define FINCSTP			fincstp
1450
#define FINIT			finit
1437
#define FINIT			finit
1451
#define FNINIT			fninit
1438
#define FNINIT			fninit
1452
#define FIST_L(a)		fist L_(a)
1439
#define FIST_L(a)		fist L_(a)
1453
#define FIST_W(a)		fist W_(a)
1440
#define FIST_W(a)		fist W_(a)
1454
#define FISTP_Q(a)		fistp D_(a)
1441
#define FISTP_Q(a)		fistp D_(a)
1455
#define FISTP_L(a)		fistp L_(a)
1442
#define FISTP_L(a)		fistp L_(a)
1456
#define FISTP_W(a)		fistp W_(a)
1443
#define FISTP_W(a)		fistp W_(a)
1457
#define FLD_X(a)		fld X_(a)
1444
#define FLD_X(a)		fld X_(a)
1458
#define FLD_D(a)		fld D_(a)
1445
#define FLD_D(a)		fld D_(a)
1459
#define FLD_S(a)		fld S_(a)
1446
#define FLD_S(a)		fld S_(a)
1460
#define FLD1			fld1
1447
#define FLD1			fld1
1461
#define FLDL2T			fldl2t
1448
#define FLDL2T			fldl2t
1462
#define FLDL2E			fldl2e
1449
#define FLDL2E			fldl2e
1463
#define FLDPI			fldpi
1450
#define FLDPI			fldpi
1464
#define FLDLG2			fldlg2
1451
#define FLDLG2			fldlg2
1465
#define FLDLN2			fldln2
1452
#define FLDLN2			fldln2
1466
#define FLDZ			fldz
1453
#define FLDZ			fldz
1467
#define FLDCW(a)		fldcw a
1454
#define FLDCW(a)		fldcw a
1468
#define FLDENV(a)		fldenv a
1455
#define FLDENV(a)		fldenv a
1469
#define FMUL_S(a)		fmul S_(a)
1456
#define FMUL_S(a)		fmul S_(a)
1470
#define FMUL_D(a)		fmul D_(a)
1457
#define FMUL_D(a)		fmul D_(a)
1471
#define FMUL2(a, b)		fmul b, a
1458
#define FMUL2(a, b)		fmul b, a
1472
#define FMULP(a, b)		fmulp b, a
1459
#define FMULP(a, b)		fmulp b, a
1473
#define FIMUL_L(a)		fimul L_(a)
1460
#define FIMUL_L(a)		fimul L_(a)
1474
#define FIMUL_W(a)		fimul W_(a)
1461
#define FIMUL_W(a)		fimul W_(a)
1475
#define FNOP			fnop
1462
#define FNOP			fnop
1476
#define FPATAN			fpatan
1463
#define FPATAN			fpatan
1477
#define FPREM			fprem
1464
#define FPREM			fprem
1478
#define FPREM1			fprem1
1465
#define FPREM1			fprem1
1479
#define FPTAN			fptan
1466
#define FPTAN			fptan
1480
#define FRNDINT			frndint
1467
#define FRNDINT			frndint
1481
#define FRSTOR(a)		frstor a
1468
#define FRSTOR(a)		frstor a
1482
#define FSAVE(a)		fsave a
1469
#define FSAVE(a)		fsave a
1483
#define FNSAVE(a)		fnsave a
1470
#define FNSAVE(a)		fnsave a
1484
#define FSCALE			fscale
1471
#define FSCALE			fscale
1485
#define FSIN			fsin
1472
#define FSIN			fsin
1486
#define FSINCOS			fsincos
1473
#define FSINCOS			fsincos
1487
#define FSQRT			fsqrt
1474
#define FSQRT			fsqrt
1488
#define FST_D(a)		fst D_(a)
1475
#define FST_D(a)		fst D_(a)
1489
#define FST_S(a)		fst S_(a)
1476
#define FST_S(a)		fst S_(a)
1490
#define FSTP_X(a)		fstp X_(a)
1477
#define FSTP_X(a)		fstp X_(a)
1491
#define FSTP_D(a)		fstp D_(a)
1478
#define FSTP_D(a)		fstp D_(a)
1492
#define FSTP_S(a)		fstp S_(a)
1479
#define FSTP_S(a)		fstp S_(a)
1493
#define FSTP(a)			fstp a
1480
#define FSTP(a)			fstp a
1494
#define FSTCW(a)		fstcw a
1481
#define FSTCW(a)		fstcw a
1495
#define FNSTCW(a)		fnstcw a
1482
#define FNSTCW(a)		fnstcw a
1496
#define FSTENV(a)		fstenv a
1483
#define FSTENV(a)		fstenv a
1497
#define FNSTENV(a)		fnstenv a
1484
#define FNSTENV(a)		fnstenv a
1498
#define FSTSW(a)		fstsw a
1485
#define FSTSW(a)		fstsw a
1499
#define FNSTSW(a)		fnstsw a
1486
#define FNSTSW(a)		fnstsw a
1500
#define FSUB_S(a)		fsub S_(a)
1487
#define FSUB_S(a)		fsub S_(a)
1501
#define FSUB_D(a)		fsub D_(a)
1488
#define FSUB_D(a)		fsub D_(a)
1502
#define FSUB2(a, b)		fsub b, a
1489
#define FSUB2(a, b)		fsub b, a
1503
#define FSUBP(a, b)		fsubp b, a
1490
#define FSUBP(a, b)		fsubp b, a
1504
#define FISUB_L(a)		fisub L_(a)
1491
#define FISUB_L(a)		fisub L_(a)
1505
#define FISUB_W(a)		fisub W_(a)
1492
#define FISUB_W(a)		fisub W_(a)
1506
#define FSUBR_S(a)		fsubr S_(a)
1493
#define FSUBR_S(a)		fsubr S_(a)
1507
#define FSUBR_D(a)		fsubr D_(a)
1494
#define FSUBR_D(a)		fsubr D_(a)
1508
#define FSUBR2(a, b)		fsubr b, a
1495
#define FSUBR2(a, b)		fsubr b, a
1509
#define FSUBRP(a, b)		fsubrp b, a
1496
#define FSUBRP(a, b)		fsubrp b, a
1510
#define FISUBR_L(a)		fisubr L_(a)
1497
#define FISUBR_L(a)		fisubr L_(a)
1511
#define FISUBR_W(a)		fisubr W_(a)
1498
#define FISUBR_W(a)		fisubr W_(a)
1512
#define FTST			ftst
1499
#define FTST			ftst
1513
#define FUCOM(a)		fucom a
1500
#define FUCOM(a)		fucom a
1514
#define FUCOMP(a)		fucomp a
1501
#define FUCOMP(a)		fucomp a
1515
#define FUCOMPP			fucompp
1502
#define FUCOMPP			fucompp
1516
#define FWAIT			fwait
1503
#define FWAIT			fwait
1517
#define FXAM			fxam
1504
#define FXAM			fxam
1518
#define FXCH(a)			fxch a
1505
#define FXCH(a)			fxch a
1519
#define FXTRACT			fxtract
1506
#define FXTRACT			fxtract
1520
#define FYL2X			fyl2x
1507
#define FYL2X			fyl2x
1521
#define FYL2XP1			fyl2xp1
1508
#define FYL2XP1			fyl2xp1
1522
 
1509
 
1523
#endif /* NASM_ASSEMBLER, MASM_ASSEMBLER */
1510
#endif /* NASM_ASSEMBLER, MASM_ASSEMBLER */
1524
 
1511
 
1525
	/****************************************/
1512
	/****************************************/
1526
	/*					*/
1513
	/*					*/
1527
	/*	Extensions to x86 insn set -	*/
1514
	/*	Extensions to x86 insn set -	*/
1528
	/*	MMX, 3DNow!			*/
1515
	/*	MMX, 3DNow!			*/
1529
	/*					*/
1516
	/*					*/
1530
	/****************************************/
1517
	/****************************************/
1531
 
1518
 
1532
#if defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER)
1519
#if defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER)
1533
#define P_ARG1(a)		P_ ## a
1520
#define P_ARG1(a)		P_ ## a
1534
#define P_ARG2(a, b)		P_ ## b, P_ ## a
1521
#define P_ARG2(a, b)		P_ ## b, P_ ## a
1535
#define P_ARG3(a, b, c)		P_ ## c, P_ ## b, P_ ## a
1522
#define P_ARG3(a, b, c)		P_ ## c, P_ ## b, P_ ## a
1536
#else
1523
#else
1537
#define P_ARG1(a)		a
1524
#define P_ARG1(a)		a
1538
#define P_ARG2(a, b)		a, b
1525
#define P_ARG2(a, b)		a, b
1539
#define P_ARG3(a, b, c)		a, b, c
1526
#define P_ARG3(a, b, c)		a, b, c
1540
#endif
1527
#endif
1541
 
1528
 
1542
/* MMX */
1529
/* MMX */
1543
#define MOVD(a, b)		movd P_ARG2(a, b)
1530
#define MOVD(a, b)		movd P_ARG2(a, b)
1544
#define MOVQ(a, b)		movq P_ARG2(a, b)
1531
#define MOVQ(a, b)		movq P_ARG2(a, b)
1545
 
1532
 
1546
#define PADDB(a, b)		paddb P_ARG2(a, b)
1533
#define PADDB(a, b)		paddb P_ARG2(a, b)
1547
#define PADDW(a, b)		paddw P_ARG2(a, b)
1534
#define PADDW(a, b)		paddw P_ARG2(a, b)
1548
#define PADDD(a, b)		paddd P_ARG2(a, b)
1535
#define PADDD(a, b)		paddd P_ARG2(a, b)
1549
 
1536
 
1550
#define PADDSB(a, b)		paddsb P_ARG2(a, b)
1537
#define PADDSB(a, b)		paddsb P_ARG2(a, b)
1551
#define PADDSW(a, b)		paddsw P_ARG2(a, b)
1538
#define PADDSW(a, b)		paddsw P_ARG2(a, b)
1552
 
1539
 
1553
#define PADDUSB(a, b)		paddusb P_ARG2(a, b)
1540
#define PADDUSB(a, b)		paddusb P_ARG2(a, b)
1554
#define PADDUSW(a, b)		paddusw P_ARG2(a, b)
1541
#define PADDUSW(a, b)		paddusw P_ARG2(a, b)
1555
 
1542
 
1556
#define PSUBB(a, b)		psubb P_ARG2(a, b)
1543
#define PSUBB(a, b)		psubb P_ARG2(a, b)
1557
#define PSUBW(a, b)		psubw P_ARG2(a, b)
1544
#define PSUBW(a, b)		psubw P_ARG2(a, b)
1558
#define PSUBD(a, b)		psubd P_ARG2(a, b)
1545
#define PSUBD(a, b)		psubd P_ARG2(a, b)
1559
 
1546
 
1560
#define PSUBSB(a, b)		psubsb P_ARG2(a, b)
1547
#define PSUBSB(a, b)		psubsb P_ARG2(a, b)
1561
#define PSUBSW(a, b)		psubsw P_ARG2(a, b)
1548
#define PSUBSW(a, b)		psubsw P_ARG2(a, b)
1562
 
1549
 
1563
#define PSUBUSB(a, b)		psubusb P_ARG2(a, b)
1550
#define PSUBUSB(a, b)		psubusb P_ARG2(a, b)
1564
#define PSUBUSW(a, b)		psubusw P_ARG2(a, b)
1551
#define PSUBUSW(a, b)		psubusw P_ARG2(a, b)
1565
 
1552
 
1566
#define PCMPEQB(a, b)		pcmpeqb P_ARG2(a, b)
1553
#define PCMPEQB(a, b)		pcmpeqb P_ARG2(a, b)
1567
#define PCMPEQW(a, b)		pcmpeqw P_ARG2(a, b)
1554
#define PCMPEQW(a, b)		pcmpeqw P_ARG2(a, b)
1568
#define PCMPEQD(a, b)		pcmpeqd P_ARG2(a, b)
1555
#define PCMPEQD(a, b)		pcmpeqd P_ARG2(a, b)
1569
 
1556
 
1570
#define PCMPGTB(a, b)		pcmpgtb P_ARG2(a, b)
1557
#define PCMPGTB(a, b)		pcmpgtb P_ARG2(a, b)
1571
#define PCMPGTW(a, b)		pcmpgtw P_ARG2(a, b)
1558
#define PCMPGTW(a, b)		pcmpgtw P_ARG2(a, b)
1572
#define PCMPGTD(a, b)		pcmpgtd P_ARG2(a, b)
1559
#define PCMPGTD(a, b)		pcmpgtd P_ARG2(a, b)
1573
 
1560
 
1574
#define PMULHW(a, b)		pmulhw P_ARG2(a, b)
1561
#define PMULHW(a, b)		pmulhw P_ARG2(a, b)
1575
#define PMULLW(a, b)		pmullw P_ARG2(a, b)
1562
#define PMULLW(a, b)		pmullw P_ARG2(a, b)
1576
 
1563
 
1577
#define PMADDWD(a, b)		pmaddwd P_ARG2(a, b)
1564
#define PMADDWD(a, b)		pmaddwd P_ARG2(a, b)
1578
 
1565
 
1579
#define PAND(a, b)		pand P_ARG2(a, b)
1566
#define PAND(a, b)		pand P_ARG2(a, b)
1580
 
1567
 
1581
#define PANDN(a, b)		pandn P_ARG2(a, b)
1568
#define PANDN(a, b)		pandn P_ARG2(a, b)
1582
 
1569
 
1583
#define POR(a, b)		por P_ARG2(a, b)
1570
#define POR(a, b)		por P_ARG2(a, b)
1584
 
1571
 
1585
#define PXOR(a, b)		pxor P_ARG2(a, b)
1572
#define PXOR(a, b)		pxor P_ARG2(a, b)
1586
 
1573
 
1587
#define PSRAW(a, b)		psraw P_ARG2(a, b)
1574
#define PSRAW(a, b)		psraw P_ARG2(a, b)
1588
#define PSRAD(a, b)		psrad P_ARG2(a, b)
1575
#define PSRAD(a, b)		psrad P_ARG2(a, b)
1589
 
1576
 
1590
#define PSRLW(a, b)		psrlw P_ARG2(a, b)
1577
#define PSRLW(a, b)		psrlw P_ARG2(a, b)
1591
#define PSRLD(a, b)		psrld P_ARG2(a, b)
1578
#define PSRLD(a, b)		psrld P_ARG2(a, b)
1592
#define PSRLQ(a, b)		psrlq P_ARG2(a, b)
1579
#define PSRLQ(a, b)		psrlq P_ARG2(a, b)
1593
 
1580
 
1594
#define PSLLW(a, b)		psllw P_ARG2(a, b)
1581
#define PSLLW(a, b)		psllw P_ARG2(a, b)
1595
#define PSLLD(a, b)		pslld P_ARG2(a, b)
1582
#define PSLLD(a, b)		pslld P_ARG2(a, b)
1596
#define PSLLQ(a, b)		psllq P_ARG2(a, b)
1583
#define PSLLQ(a, b)		psllq P_ARG2(a, b)
1597
 
1584
 
1598
#define PACKSSWB(a, b)		packsswb P_ARG2(a, b)
1585
#define PACKSSWB(a, b)		packsswb P_ARG2(a, b)
1599
#define PACKSSDW(a, b)		packssdw P_ARG2(a, b)
1586
#define PACKSSDW(a, b)		packssdw P_ARG2(a, b)
1600
#define PACKUSWB(a, b)		packuswb P_ARG2(a, b)
1587
#define PACKUSWB(a, b)		packuswb P_ARG2(a, b)
1601
 
1588
 
1602
#define PUNPCKHBW(a, b)		punpckhbw P_ARG2(a, b)
1589
#define PUNPCKHBW(a, b)		punpckhbw P_ARG2(a, b)
1603
#define PUNPCKHWD(a, b)		punpckhwd P_ARG2(a, b)
1590
#define PUNPCKHWD(a, b)		punpckhwd P_ARG2(a, b)
1604
#define PUNPCKHDQ(a, b)		punpckhdq P_ARG2(a, b)
1591
#define PUNPCKHDQ(a, b)		punpckhdq P_ARG2(a, b)
1605
#define PUNPCKLBW(a, b)		punpcklbw P_ARG2(a, b)
1592
#define PUNPCKLBW(a, b)		punpcklbw P_ARG2(a, b)
1606
#define PUNPCKLWD(a, b)		punpcklwd P_ARG2(a, b)
1593
#define PUNPCKLWD(a, b)		punpcklwd P_ARG2(a, b)
1607
#define PUNPCKLDQ(a, b)		punpckldq P_ARG2(a, b)
1594
#define PUNPCKLDQ(a, b)		punpckldq P_ARG2(a, b)
1608
 
1595
 
1609
#define EMMS			emms
1596
#define EMMS			emms
1610
 
1597
 
1611
/* AMD 3DNow! */
1598
/* AMD 3DNow! */
1612
#define PAVGUSB(a, b)		pavgusb P_ARG2(a, b)
1599
#define PAVGUSB(a, b)		pavgusb P_ARG2(a, b)
1613
#define PFADD(a, b)		pfadd P_ARG2(a, b)
1600
#define PFADD(a, b)		pfadd P_ARG2(a, b)
1614
#define PFSUB(a, b)		pfsub P_ARG2(a, b)
1601
#define PFSUB(a, b)		pfsub P_ARG2(a, b)
1615
#define PFSUBR(a, b)		pfsubr P_ARG2(a, b)
1602
#define PFSUBR(a, b)		pfsubr P_ARG2(a, b)
1616
#define PFACC(a, b)		pfacc P_ARG2(a, b)
1603
#define PFACC(a, b)		pfacc P_ARG2(a, b)
1617
#define PFCMPGE(a, b)		pfcmpge P_ARG2(a, b)
1604
#define PFCMPGE(a, b)		pfcmpge P_ARG2(a, b)
1618
#define PFCMPGT(a, b)		pfcmpgt P_ARG2(a, b)
1605
#define PFCMPGT(a, b)		pfcmpgt P_ARG2(a, b)
1619
#define PFCMPEQ(a, b)		pfcmpeq P_ARG2(a, b)
1606
#define PFCMPEQ(a, b)		pfcmpeq P_ARG2(a, b)
1620
#define PFMIN(a, b)		pfmin P_ARG2(a, b)
1607
#define PFMIN(a, b)		pfmin P_ARG2(a, b)
1621
#define PFMAX(a, b)		pfmax P_ARG2(a, b)
1608
#define PFMAX(a, b)		pfmax P_ARG2(a, b)
1622
#define PI2FD(a, b)		pi2fd P_ARG2(a, b)
1609
#define PI2FD(a, b)		pi2fd P_ARG2(a, b)
1623
#define PF2ID(a, b)		pf2id P_ARG2(a, b)
1610
#define PF2ID(a, b)		pf2id P_ARG2(a, b)
1624
#define PFRCP(a, b)		pfrcp P_ARG2(a, b)
1611
#define PFRCP(a, b)		pfrcp P_ARG2(a, b)
1625
#define PFRSQRT(a, b)		pfrsqrt P_ARG2(a, b)
1612
#define PFRSQRT(a, b)		pfrsqrt P_ARG2(a, b)
1626
#define PFMUL(a, b)		pfmul P_ARG2(a, b)
1613
#define PFMUL(a, b)		pfmul P_ARG2(a, b)
1627
#define PFRCPIT1(a, b)		pfrcpit1 P_ARG2(a, b)
1614
#define PFRCPIT1(a, b)		pfrcpit1 P_ARG2(a, b)
1628
#define PFRSQIT1(a, b)		pfrsqit1 P_ARG2(a, b)
1615
#define PFRSQIT1(a, b)		pfrsqit1 P_ARG2(a, b)
1629
#define PFRCPIT2(a, b)		pfrcpit2 P_ARG2(a, b)
1616
#define PFRCPIT2(a, b)		pfrcpit2 P_ARG2(a, b)
1630
#define PMULHRW(a, b)		pmulhrw P_ARG2(a, b)
1617
#define PMULHRW(a, b)		pmulhrw P_ARG2(a, b)
1631
 
1618
 
1632
#define FEMMS			femms
1619
#define FEMMS			femms
1633
#define PREFETCH(a)		prefetch P_ARG1(a)
1620
#define PREFETCH(a)		prefetch P_ARG1(a)
1634
#define PREFETCHW(a)		prefetchw P_ARG1(a)
1621
#define PREFETCHW(a)		prefetchw P_ARG1(a)
1635
 
1622
 
1636
/* Intel SSE */
1623
/* Intel SSE */
1637
#define ADDPS(a, b)		addps P_ARG2(a, b)
1624
#define ADDPS(a, b)		addps P_ARG2(a, b)
1638
#define ADDSS(a, b)		addss P_ARG2(a, b)
1625
#define ADDSS(a, b)		addss P_ARG2(a, b)
1639
#define ANDNPS(a, b)		andnps P_ARG2(a, b)
1626
#define ANDNPS(a, b)		andnps P_ARG2(a, b)
1640
#define ANDPS(a, b)		andps P_ARG2(a, b)
1627
#define ANDPS(a, b)		andps P_ARG2(a, b)
1641
/* NASM only knows the pseudo ops for these.
1628
/* NASM only knows the pseudo ops for these.
1642
#define CMPPS(a, b, c)		cmpps P_ARG3(a, b, c)
1629
#define CMPPS(a, b, c)		cmpps P_ARG3(a, b, c)
1643
#define CMPSS(a, b, c)		cmpss P_ARG3(a, b, c)
1630
#define CMPSS(a, b, c)		cmpss P_ARG3(a, b, c)
1644
*/
1631
*/
1645
#define CMPEQPS(a, b)		cmpeqps P_ARG2(a, b)
1632
#define CMPEQPS(a, b)		cmpeqps P_ARG2(a, b)
1646
#define CMPLTPS(a, b)		cmpltps P_ARG2(a, b)
1633
#define CMPLTPS(a, b)		cmpltps P_ARG2(a, b)
1647
#define CMPLEPS(a, b)		cmpleps P_ARG2(a, b)
1634
#define CMPLEPS(a, b)		cmpleps P_ARG2(a, b)
1648
#define CMPUNORDPS(a, b)	cmpunordps P_ARG2(a, b)
1635
#define CMPUNORDPS(a, b)	cmpunordps P_ARG2(a, b)
1649
#define CMPNEQPS(a, b)		cmpneqps P_ARG2(a, b)
1636
#define CMPNEQPS(a, b)		cmpneqps P_ARG2(a, b)
1650
#define CMPNLTPS(a, b)		cmpnltps P_ARG2(a, b)
1637
#define CMPNLTPS(a, b)		cmpnltps P_ARG2(a, b)
1651
#define CMPNLEPS(a, b)		cmpnleps P_ARG2(a, b)
1638
#define CMPNLEPS(a, b)		cmpnleps P_ARG2(a, b)
1652
#define CMPORDPS(a, b)		cmpordps P_ARG2(a, b)
1639
#define CMPORDPS(a, b)		cmpordps P_ARG2(a, b)
1653
#define CMPEQSS(a, b)		cmpeqss P_ARG2(a, b)
1640
#define CMPEQSS(a, b)		cmpeqss P_ARG2(a, b)
1654
#define CMPLTSS(a, b)		cmpltss P_ARG2(a, b)
1641
#define CMPLTSS(a, b)		cmpltss P_ARG2(a, b)
1655
#define CMPLESS(a, b)		cmpless P_ARG2(a, b)
1642
#define CMPLESS(a, b)		cmpless P_ARG2(a, b)
1656
#define CMPUNORDSS(a, b)	cmpunordss P_ARG2(a, b)
1643
#define CMPUNORDSS(a, b)	cmpunordss P_ARG2(a, b)
1657
#define CMPNEQSS(a, b)		cmpneqss P_ARG2(a, b)
1644
#define CMPNEQSS(a, b)		cmpneqss P_ARG2(a, b)
1658
#define CMPNLTSS(a, b)		cmpnltss P_ARG2(a, b)
1645
#define CMPNLTSS(a, b)		cmpnltss P_ARG2(a, b)
1659
#define CMPNLESS(a, b)		cmpnless P_ARG2(a, b)
1646
#define CMPNLESS(a, b)		cmpnless P_ARG2(a, b)
1660
#define CMPORDSS(a, b)		cmpordss P_ARG2(a, b)
1647
#define CMPORDSS(a, b)		cmpordss P_ARG2(a, b)
1661
#define COMISS(a, b)		comiss P_ARG2(a, b)
1648
#define COMISS(a, b)		comiss P_ARG2(a, b)
1662
#define CVTPI2PS(a, b)		cvtpi2ps P_ARG2(a, b)
1649
#define CVTPI2PS(a, b)		cvtpi2ps P_ARG2(a, b)
1663
#define CVTPS2PI(a, b)		cvtps2pi P_ARG2(a, b)
1650
#define CVTPS2PI(a, b)		cvtps2pi P_ARG2(a, b)
1664
#define CVTSI2SS(a, b)		cvtsi2ss P_ARG2(a, b)
1651
#define CVTSI2SS(a, b)		cvtsi2ss P_ARG2(a, b)
1665
#define CVTSS2SI(a, b)		cvtss2si P_ARG2(a, b)
1652
#define CVTSS2SI(a, b)		cvtss2si P_ARG2(a, b)
1666
#define CVTTPS2PI(a, b)		cvttps2pi P_ARG2(a, b)
1653
#define CVTTPS2PI(a, b)		cvttps2pi P_ARG2(a, b)
1667
#define CVTTSS2SI(a, b)		cvttss2si P_ARG2(a, b)
1654
#define CVTTSS2SI(a, b)		cvttss2si P_ARG2(a, b)
1668
#define DIVPS(a, b)		divps P_ARG2(a, b)
1655
#define DIVPS(a, b)		divps P_ARG2(a, b)
1669
#define DIVSS(a, b)		divss P_ARG2(a, b)
1656
#define DIVSS(a, b)		divss P_ARG2(a, b)
1670
#define FXRSTOR(a)		fxrstor P_ARG1(a)
1657
#define FXRSTOR(a)		fxrstor P_ARG1(a)
1671
#define FXSAVE(a)		fxsave P_ARG1(a)
1658
#define FXSAVE(a)		fxsave P_ARG1(a)
1672
#define LDMXCSR(a)		ldmxcsr P_ARG1(a)
1659
#define LDMXCSR(a)		ldmxcsr P_ARG1(a)
1673
#define MAXPS(a, b)		maxps P_ARG2(a, b)
1660
#define MAXPS(a, b)		maxps P_ARG2(a, b)
1674
#define MAXSS(a, b)		maxss P_ARG2(a, b)
1661
#define MAXSS(a, b)		maxss P_ARG2(a, b)
1675
#define MINPS(a, b)		minps P_ARG2(a, b)
1662
#define MINPS(a, b)		minps P_ARG2(a, b)
1676
#define MINSS(a, b)		minss P_ARG2(a, b)
1663
#define MINSS(a, b)		minss P_ARG2(a, b)
1677
#define MOVAPS(a, b)		movaps P_ARG2(a, b)
1664
#define MOVAPS(a, b)		movaps P_ARG2(a, b)
1678
#define MOVHLPS(a, b)		movhlps P_ARG2(a, b)
1665
#define MOVHLPS(a, b)		movhlps P_ARG2(a, b)
1679
#define MOVHPS(a, b)		movhps P_ARG2(a, b)
1666
#define MOVHPS(a, b)		movhps P_ARG2(a, b)
1680
#define MOVLHPS(a, b)		movlhps P_ARG2(a, b)
1667
#define MOVLHPS(a, b)		movlhps P_ARG2(a, b)
1681
#define MOVLPS(a, b)		movlps P_ARG2(a, b)
1668
#define MOVLPS(a, b)		movlps P_ARG2(a, b)
1682
#define MOVMSKPS(a, b)		movmskps P_ARG2(a, b)
1669
#define MOVMSKPS(a, b)		movmskps P_ARG2(a, b)
1683
#define MOVNTPS(a, b)		movntps P_ARG2(a, b)
1670
#define MOVNTPS(a, b)		movntps P_ARG2(a, b)
1684
#define MOVNTQ(a, b)		movntq P_ARG2(a, b)
1671
#define MOVNTQ(a, b)		movntq P_ARG2(a, b)
1685
#define MOVSS(a, b)		movss P_ARG2(a, b)
1672
#define MOVSS(a, b)		movss P_ARG2(a, b)
1686
#define MOVUPS(a, b)		movups P_ARG2(a, b)
1673
#define MOVUPS(a, b)		movups P_ARG2(a, b)
1687
#define MULPS(a, b)		mulps P_ARG2(a, b)
1674
#define MULPS(a, b)		mulps P_ARG2(a, b)
1688
#define MULSS(a, b)		mulss P_ARG2(a, b)
1675
#define MULSS(a, b)		mulss P_ARG2(a, b)
1689
#define ORPS(a, b)		orps P_ARG2(a, b)
1676
#define ORPS(a, b)		orps P_ARG2(a, b)
1690
#define RCPPS(a, b)		rcpps P_ARG2(a, b)
1677
#define RCPPS(a, b)		rcpps P_ARG2(a, b)
1691
#define RCPSS(a, b)		rcpss P_ARG2(a, b)
1678
#define RCPSS(a, b)		rcpss P_ARG2(a, b)
1692
#define RSQRTPS(a, b)		rsqrtps P_ARG2(a, b)
1679
#define RSQRTPS(a, b)		rsqrtps P_ARG2(a, b)
1693
#define RSQRTSS(a, b)		rsqrtss P_ARG2(a, b)
1680
#define RSQRTSS(a, b)		rsqrtss P_ARG2(a, b)
1694
#define SHUFPS(a, b, c)		shufps P_ARG3(a, b, c)
1681
#define SHUFPS(a, b, c)		shufps P_ARG3(a, b, c)
1695
#define SQRTPS(a, b)		sqrtps P_ARG2(a, b)
1682
#define SQRTPS(a, b)		sqrtps P_ARG2(a, b)
1696
#define SQRTSS(a, b)		sqrtss P_ARG2(a, b)
1683
#define SQRTSS(a, b)		sqrtss P_ARG2(a, b)
1697
#define STMXCSR(a)		stmxcsr P_ARG1(a)
1684
#define STMXCSR(a)		stmxcsr P_ARG1(a)
1698
#define SUBPS(a, b)		subps P_ARG2(a, b)
1685
#define SUBPS(a, b)		subps P_ARG2(a, b)
1699
#define UCOMISS(a, b)		ucomiss P_ARG2(a, b)
1686
#define UCOMISS(a, b)		ucomiss P_ARG2(a, b)
1700
#define UNPCKHPS(a, b)		unpckhps P_ARG2(a, b)
1687
#define UNPCKHPS(a, b)		unpckhps P_ARG2(a, b)
1701
#define UNPCKLPS(a, b)		unpcklps P_ARG2(a, b)
1688
#define UNPCKLPS(a, b)		unpcklps P_ARG2(a, b)
1702
#define XORPS(a, b)		xorps P_ARG2(a, b)
1689
#define XORPS(a, b)		xorps P_ARG2(a, b)
1703
 
1690
 
1704
#define PREFETCHNTA(a)		prefetchnta P_ARG1(a)
1691
#define PREFETCHNTA(a)		prefetchnta P_ARG1(a)
1705
#define PREFETCHT0(a)		prefetcht0 P_ARG1(a)
1692
#define PREFETCHT0(a)		prefetcht0 P_ARG1(a)
1706
#define PREFETCHT1(a)		prefetcht1 P_ARG1(a)
1693
#define PREFETCHT1(a)		prefetcht1 P_ARG1(a)
1707
#define PREFETCHT2(a)		prefetcht2 P_ARG1(a)
1694
#define PREFETCHT2(a)		prefetcht2 P_ARG1(a)
1708
#define SFENCE			sfence
1695
#define SFENCE			sfence
1709
 
1696
 
1710
/* Added by BrianP for FreeBSD (per David Dawes) */
1697
/* Added by BrianP for FreeBSD (per David Dawes) */
1711
#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER) && !defined(__bsdi__)
1698
#if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER) && !defined(__bsdi__)
1712
#define LLBL(a)		CONCAT(.L,a)
1699
#define LLBL(a)		CONCAT(.L,a)
1713
#define LLBL2(a,b)	CONCAT3(.L,a,b)
1700
#define LLBL2(a,b)	CONCAT3(.L,a,b)
1714
#else
1701
#else
1715
#define LLBL(a)		a
1702
#define LLBL(a)		a
1716
#define LLBL2(a,b)	CONCAT(a,b)
1703
#define LLBL2(a,b)	CONCAT(a,b)
1717
#endif
1704
#endif
1718
 
1705
 
1719
/* Segment overrides */
1706
/* Segment overrides */
1720
#define SEGCS		D_BYTE	46
1707
#define SEGCS		D_BYTE	46
1721
#define SEGDS		D_BYTE	62
1708
#define SEGDS		D_BYTE	62
1722
#define SEGES		D_BYTE	38
1709
#define SEGES		D_BYTE	38
1723
#define SEGFS		D_BYTE	100
1710
#define SEGFS		D_BYTE	100
1724
#define SEGGS		D_BYTE	101
1711
#define SEGGS		D_BYTE	101
1725
 
1712
 
1726
/* Temporary labels: valid until next non-local label */
1713
/* Temporary labels: valid until next non-local label */
1727
#ifdef NASM_ASSEMBLER
1714
#ifdef NASM_ASSEMBLER
1728
#define TLBL(a)		CONCAT(.,a)
1715
#define TLBL(a)		CONCAT(.,a)
1729
#else
1716
#else
1730
#define TLBL(a)		CONCAT(a,$)
1717
#define TLBL(a)		CONCAT(a,$)
1731
#endif
1718
#endif
1732
 
1719
 
1733
/* Hidden symbol visibility support.
1720
/* Hidden symbol visibility support.
1734
 * If we build with gcc's -fvisibility=hidden flag, we'll need to change
1721
 * If we build with gcc's -fvisibility=hidden flag, we'll need to change
1735
 * the symbol visibility mode to 'default'.
1722
 * the symbol visibility mode to 'default'.
1736
#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__)
1723
 */
1737
#  define HIDDEN(x) .hidden x
-
 
1738
#elif defined(__GNUC__) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__)
-
 
1739
#  pragma GCC visibility push(default)
-
 
1740
#  define HIDDEN(x) .hidden x
-
 
1741
#else
-
 
1742
#  define HIDDEN(x)
-
 
1743
#endif
-
 
1744
 */
-
 
1745
 
1724
 
1746
#  define HIDDEN(x)
1725
#define HIDDEN(x)
1747
 
1726
 
1748
#endif /* __ASSYNTAX_H__ */
1727
#endif /* __ASSYNTAX_H__ */
1749
>
1728
>
1750
>
1729
>