⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 assyntax.h

📁 winNT技术操作系统,国外开放的原代码和LIUX一样
💻 H
📖 第 1 页 / 共 5 页
字号:
#define FCOM_D(a)	CHOICE(fcoml a, fcoml a, fcomd a)
#define FCOM_S(a)	CHOICE(fcoms a, fcoms a, fcoms a)
#define FCOMP(a)	CHOICE(fcomp a, fcomp a, fcomp a)
#define FCOMP_D(a)	CHOICE(fcompl a, fcompl a, fcompd a)
#define FCOMP_S(a)	CHOICE(fcomps a, fcomps a, fcomps a)
#define FCOMPP		CHOICE(fcompp, fcompp, fcompp)
#define FCOS		CHOICE(fcos, fcos, fcos)
#define FDECSTP		CHOICE(fdecstp, fdecstp, fdecstp)
#define FDIV_D(a)	CHOICE(fdivl a, fdivl a, fdivd a)
#define FDIV_S(a)	CHOICE(fdivs a, fdivs a, fdivs a)
#define FDIV2(a, b)	CHOICE(fdiv ARG2(a,b), fdiv ARG2(a,b), fdiv ARG2(b,a))
#define FDIVP(a, b)	CHOICE(fdivp ARG2(a,b), fdivp ARG2(a,b), fdivp ARG2(b,a))
#define FIDIV_L(a)	CHOICE(fidivl a, fidivl a, fidivl a)
#define FIDIV_W(a)	CHOICE(fidiv a, fidivs a, fidivs a)
#define FDIVR_D(a)	CHOICE(fdivrl a, fdivrl a, fdivrd a)
#define FDIVR_S(a)	CHOICE(fdivrs a, fdivrs a, fdivrs a)
#define FDIVR2(a, b)	CHOICE(fdivr ARG2(a,b), fdivr ARG2(a,b), fdivr ARG2(b,a))
#define FDIVRP(a, b)	CHOICE(fdivrp ARG2(a,b), fdivrp ARG2(a,b), fdivrp ARG2(b,a))
#define FIDIVR_L(a)	CHOICE(fidivrl a, fidivrl a, fidivrl a)
#define FIDIVR_W(a)	CHOICE(fidivr a, fidivrs a, fidivrs a)
#define FFREE(a)	CHOICE(ffree a, ffree a, ffree a)
#define FICOM_L(a)	CHOICE(ficoml a, ficoml a, ficoml a)
#define FICOM_W(a)	CHOICE(ficom a, ficoms a, ficoms a)
#define FICOMP_L(a)	CHOICE(ficompl a, ficompl a, ficompl a)
#define FICOMP_W(a)	CHOICE(ficomp a, ficomps a, ficomps a)
#define FILD_Q(a)	CHOICE(fildll a, fildq a, fildq a)
#define FILD_L(a)	CHOICE(fildl a, fildl a, fildl a)
#define FILD_W(a)	CHOICE(fild a, filds a, filds a)
#define FINCSTP		CHOICE(fincstp, fincstp, fincstp)
#define FINIT		CHOICE(finit, wait; fninit, wait; finit)
#define FNINIT		CHOICE(fninit, fninit, finit)
#define FIST_L(a)	CHOICE(fistl a, fistl a, fistl a)
#define FIST_W(a)	CHOICE(fist a, fists a, fists a)
#define FISTP_Q(a)	CHOICE(fistpll a, fistpq a, fistpq a)
#define FISTP_L(a)	CHOICE(fistpl a, fistpl a, fistpl a)
#define FISTP_W(a)	CHOICE(fistp a, fistps a, fistps a)
#define FLD_X(a)	CHOICE(fldt a, fldt a, fldx a) /* 80 bit data type! */
#define FLD_D(a)	CHOICE(fldl a, fldl a, fldd a)
#define FLD_S(a)	CHOICE(flds a, flds a, flds a)
#define FLD1		CHOICE(fld1, fld1, fld1)
#define FLDL2T		CHOICE(fldl2t, fldl2t, fldl2t)
#define FLDL2E		CHOICE(fldl2e, fldl2e, fldl2e)
#define FLDPI		CHOICE(fldpi, fldpi, fldpi)
#define FLDLG2		CHOICE(fldlg2, fldlg2, fldlg2)
#define FLDLN2		CHOICE(fldln2, fldln2, fldln2)
#define FLDZ		CHOICE(fldz, fldz, fldz)
#define FLDCW(a)	CHOICE(fldcw a, fldcw a, fldcw a)
#define FLDENV(a)	CHOICE(fldenv a, fldenv a, fldenv a)
#define FMUL_S(a)	CHOICE(fmuls a, fmuls a, fmuls a)
#define FMUL_D(a)	CHOICE(fmull a, fmull a, fmuld a)
#define FMUL2(a, b)	CHOICE(fmul ARG2(a,b), fmul ARG2(a,b), fmul ARG2(b,a))
#define FMULP(a, b)	CHOICE(fmulp ARG2(a,b), fmulp ARG2(a,b), fmulp ARG2(b,a))
#define FIMUL_L(a)	CHOICE(fimull a, fimull a, fimull a)
#define FIMUL_W(a)	CHOICE(fimul a, fimuls a, fimuls a)
#define FNOP		CHOICE(fnop, fnop, fnop)
#define FPATAN		CHOICE(fpatan, fpatan, fpatan)
#define FPREM		CHOICE(fprem, fprem, fprem)
#define FPREM1		CHOICE(fprem1, fprem1, fprem1)
#define FPTAN		CHOICE(fptan, fptan, fptan)
#define FRNDINT		CHOICE(frndint, frndint, frndint)
#define FRSTOR(a)	CHOICE(frstor a, frstor a, frstor a)
#define FSAVE(a)	CHOICE(fsave a, wait; fnsave a, wait; fsave a)
#define FNSAVE(a)	CHOICE(fnsave a, fnsave a, fsave a)
#define FSCALE		CHOICE(fscale, fscale, fscale)
#define FSIN		CHOICE(fsin, fsin, fsin)
#define FSINCOS		CHOICE(fsincos, fsincos, fsincos)
#define FSQRT		CHOICE(fsqrt, fsqrt, fsqrt)
#define FST_D(a)	CHOICE(fstl a, fstl a, fstd a)
#define FST_S(a)	CHOICE(fsts a, fsts a, fsts a)
#define FSTP_X(a)	CHOICE(fstpt a, fstpt a, fstpx a)
#define FSTP_D(a)	CHOICE(fstpl a, fstpl a, fstpd a)
#define FSTP_S(a)	CHOICE(fstps a, fstps a, fstps a)
#define FSTP(a)		CHOICE(fstp a, fstp a, fstp a)
#define FSTCW(a)	CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a)
#define FNSTCW(a)	CHOICE(fnstcw a, fnstcw a, fstcw a)
#define FSTENV(a)	CHOICE(fstenv a, wait; fnstenv a, fstenv a)
#define FNSTENV(a)	CHOICE(fnstenv a, fnstenv a, fstenv a)
#define FSTSW(a)	CHOICE(fstsw a, wait; fnstsw a, wait; fstsw a)
#define FNSTSW(a)	CHOICE(fnstsw a, fnstsw a, fstsw a)
#define FSUB_S(a)	CHOICE(fsubs a, fsubs a, fsubs a)
#define FSUB_D(a)	CHOICE(fsubl a, fsubl a, fsubd a)
#define FSUB2(a, b)	CHOICE(fsub ARG2(a,b), fsub ARG2(a,b), fsub ARG2(b,a))
#define FSUBP(a, b)	CHOICE(fsubp ARG2(a,b), fsubp ARG2(a,b), fsubp ARG2(b,a))
#define FISUB_L(a)	CHOICE(fisubl a, fisubl a, fisubl a)
#define FISUB_W(a)	CHOICE(fisub a, fisubs a, fisubs a)
#define FSUBR_S(a)	CHOICE(fsubrs a, fsubrs a, fsubrs a)
#define FSUBR_D(a)	CHOICE(fsubrl a, fsubrl a, fsubrd a)
#define FSUBR2(a, b)	CHOICE(fsubr ARG2(a,b), fsubr ARG2(a,b), fsubr ARG2(b,a))
#define FSUBRP(a, b)	CHOICE(fsubrp ARG2(a,b), fsubrp ARG2(a,b), fsubrp ARG2(b,a))
#define FISUBR_L(a)	CHOICE(fisubrl a, fisubrl a, fisubrl a)
#define FISUBR_W(a)	CHOICE(fisubr a, fisubrs a, fisubrs a)
#define FTST		CHOICE(ftst, ftst, ftst)
#define FUCOM(a)	CHOICE(fucom a, fucom a, fucom a)
#define FUCOMP(a)	CHOICE(fucomp a, fucomp a, fucomp a)
#define FUCOMPP		CHOICE(fucompp, fucompp, fucompp)
#define FWAIT		CHOICE(wait, wait, wait)
#define FXAM		CHOICE(fxam, fxam, fxam)
#define FXCH(a)		CHOICE(fxch a, fxch a, fxch a)
#define FXTRACT		CHOICE(fxtract, fxtract, fxtract)
#define FYL2X		CHOICE(fyl2x, fyl2x, fyl2x)
#define FYL2XP1		CHOICE(fyl2xp1, fyl2xp1, fyl2xp1)

/* New instructions */
#define CPUID		CHOICE(D_BYTE ARG2(15, 162), cpuid, D_BYTE ARG2(15, 162))
#define RDTSC		CHOICE(D_BYTE ARG2(15, 49), rdtsc, D_BYTE ARG2(15, 49))

#else /* NASM_ASSEMBLER || MASM_ASSEMBLER is defined */

	/****************************************/
	/*					*/
	/*	Intel style assemblers.		*/
	/*	(NASM and MASM)			*/
	/*					*/
	/****************************************/

#define P_EAX		EAX
#define L_EAX		EAX
#define W_AX		AX
#define B_AH		AH
#define B_AL		AL

#define P_EBX		EBX
#define L_EBX		EBX
#define W_BX		BX
#define B_BH		BH
#define B_BL		BL

#define P_ECX		ECX
#define L_ECX		ECX
#define W_CX		CX
#define B_CH		CH
#define B_CL		CL

#define P_EDX		EDX
#define L_EDX		EDX
#define W_DX		DX
#define B_DH		DH
#define B_DL		DL

#define P_EBP		EBP
#define L_EBP		EBP
#define W_BP		BP

#define P_ESI		ESI
#define L_ESI		ESI
#define W_SI		SI

#define P_EDI		EDI
#define L_EDI		EDI
#define W_DI		DI

#define P_ESP		ESP
#define L_ESP		ESP
#define W_SP		SP

#define W_CS		CS
#define W_SS		SS
#define W_DS		DS
#define W_ES		ES
#define W_FS		FS
#define W_GS		GS

#define X_ST		ST
#define D_ST		ST
#define L_ST		ST

#define P_MM0		mm0
#define P_MM1		mm1
#define P_MM2		mm2
#define P_MM3		mm3
#define P_MM4		mm4
#define P_MM5		mm5
#define P_MM6		mm6
#define P_MM7		mm7

#define P_XMM0		xmm0
#define P_XMM1		xmm1
#define P_XMM2		xmm2
#define P_XMM3		xmm3
#define P_XMM4		xmm4
#define P_XMM5		xmm5
#define P_XMM6		xmm6
#define P_XMM7		xmm7

#define CONCAT(x, y)		x ## y
#define CONCAT3(x, y, z)	x ## y ## z

#if defined(NASM_ASSEMBLER)

#define ST(n)		st ## n
#define ST0		st0

#define TBYTE_PTR	tword
#define QWORD_PTR	qword
#define DWORD_PTR	dword
#define WORD_PTR	word
#define BYTE_PTR	byte

#define OFFSET

#define GLOBL			GLOBAL
#define ALIGNTEXT32		ALIGN 32
#define ALIGNTEXT16		ALIGN 16
#define ALIGNTEXT8		ALIGN 8
#define ALIGNTEXT4		ALIGN 4
#define ALIGNTEXT2		ALIGN 2
#define ALIGNTEXT32ifNOP	ALIGN 32
#define ALIGNTEXT16ifNOP	ALIGN 16
#define ALIGNTEXT8ifNOP		ALIGN 8
#define ALIGNTEXT4ifNOP		ALIGN 4
#define ALIGNDATA32		ALIGN 32
#define ALIGNDATA16		ALIGN 16
#define ALIGNDATA8		ALIGN 8
#define ALIGNDATA4		ALIGN 4
#define ALIGNDATA2		ALIGN 2
#define FILE(s)
#define STRING(s)	db s
#define D_LONG		dd
#define D_WORD		dw
#define D_BYTE		db
/* #define SPACE */
/* #define COMM */
#if defined(__WATCOMC__)
SECTION _TEXT public align=16 class=CODE use32 flat
SECTION _DATA public align=16 class=DATA use32 flat
#define SEG_TEXT	SECTION _TEXT
#define SEG_DATA	SECTION _DATA
#define SEG_BSS		SECTION .bss
#else
#define SEG_DATA	SECTION .data
#define SEG_TEXT	SECTION .text
#define SEG_BSS		SECTION .bss
#endif

#define D_SPACE(n)	db n REP 0

#define AS_BEGIN

/* Jcc's should be handled better than this... */
#define NEAR		near

#else /* MASM */

#define TBYTE_PTR	tbyte ptr
#define QWORD_PTR	qword ptr
#define DWORD_PTR	dword ptr
#define WORD_PTR	word ptr
#define BYTE_PTR	byte ptr

#define OFFSET		offset

#define GLOBL			GLOBAL
#define ALIGNTEXT32		ALIGN 32
#define ALIGNTEXT16		ALIGN 16
#define ALIGNTEXT8		ALIGN 8
#define ALIGNTEXT4		ALIGN 4
#define ALIGNTEXT2		ALIGN 2
#define ALIGNTEXT32ifNOP	ALIGN 32
#define ALIGNTEXT16ifNOP	ALIGN 16
#define ALIGNTEXT8ifNOP		ALIGN 8
#define ALIGNTEXT4ifNOP		ALIGN 4
#define ALIGNDATA32		ALIGN 32
#define ALIGNDATA16		ALIGN 16
#define ALIGNDATA8		ALIGN 8
#define ALIGNDATA4		ALIGN 4
#define ALIGNDATA2		ALIGN 2
#define FILE(s)
#define STRING(s)	db s
#define D_LONG		dd
#define D_WORD		dw
#define D_BYTE		db
/* #define SPACE */
/* #define COMM */
#define SEG_DATA	.DATA
#define SEG_TEXT	.CODE
#define SEG_BSS		.DATA

#define D_SPACE(n)	db n REP 0

#define AS_BEGIN

#define NEAR

#endif

#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) \
 || (defined(__linux__) || defined(__OS2ELF__)) && defined(__ELF__) \
 || defined(__FreeBSD__) && __FreeBSD__ >= 3
#define GLNAME(a)	a
#else
#define GLNAME(a)	CONCAT(_, a)
#endif

/*
 *	Addressing Modes
 */

/* Immediate Mode */
#define P_ADDR(a)		OFFSET a
#define X_ADDR(a)		OFFSET a
#define D_ADDR(a)		OFFSET a
#define L_ADDR(a)		OFFSET a
#define W_ADDR(a)		OFFSET a
#define B_ADDR(a)		OFFSET a

#define P_CONST(a)		a
#define X_CONST(a)		a
#define D_CONST(a)		a
#define L_CONST(a)		a
#define W_CONST(a)		a
#define B_CONST(a)		a

/* Indirect Mode */
#ifdef NASM_ASSEMBLER
#define P_CONTENT(a)		[a]
#define X_CONTENT(a)		TBYTE_PTR [a]
#define D_CONTENT(a)		QWORD_PTR [a]
#define L_CONTENT(a)		DWORD_PTR [a]
#define W_CONTENT(a)		WORD_PTR [a]
#define B_CONTENT(a)		BYTE_PTR [a]
#else
#define P_CONTENT(a)		a
#define X_CONTENT(a)		TBYTE_PTR a
#define D_CONTENT(a)		QWORD_PTR a
#define L_CONTENT(a)		DWORD_PTR a
#define W_CONTENT(a)		WORD_PTR a
#define B_CONTENT(a)		BYTE_PTR a
#endif

/* Register a indirect */
#define P_REGIND(a)		[a]
#define X_REGIND(a)		TBYTE_PTR [a]
#define D_REGIND(a)		QWORD_PTR [a]
#define L_REGIND(a)		DWORD_PTR [a]
#define W_REGIND(a)		WORD_PTR [a]
#define B_REGIND(a)		BYTE_PTR [a]

/* Register b indirect plus displacement a */
#define P_REGOFF(a, b)		[b + a]
#define X_REGOFF(a, b)		TBYTE_PTR [b + a]
#define D_REGOFF(a, b)		QWORD_PTR [b + a]
#define L_REGOFF(a, b)		DWORD_PTR [b + a]
#define W_REGOFF(a, b)		WORD_PTR [b + a]
#define B_REGOFF(a, b)		BYTE_PTR [b + a]

/* Reg indirect Base + Index + Displacement  - this is mainly for 16-bit mode
 * which has no scaling
 */
#define P_REGBID(b, i, d)	[b + i + d]
#define X_REGBID(b, i, d)	TBYTE_PTR [b + i + d]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -