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

📄 newmac.inc

📁 This is a program that I wrote many years ago. It is a floppy disk , disk copy,disk info,and format
💻 INC
📖 第 1 页 / 共 2 页
字号:

		ENDM

cs_repe_cmpsw	MACRO

		byte	2eh      ;cs:
		repe	cmpsw

		ENDM

cs_repe_cmpsb	MACRO

		byte	2eh      ;cs:
		repe	cmpsb

		ENDM


es_repne_cmpsw	MACRO

		byte	26h      ;es:
		repne	cmpsw

		ENDM

es_repne_cmpsb	MACRO

		byte	26h      ;es:
		repne	cmpsb

		ENDM

ss_repne_cmpsw	MACRO

		byte	36h      ;ss:
		repne	cmpsw

		ENDM

ss_repne_cmpsb	MACRO

		byte	36h      ;ss:
		repne	cmpsb

		ENDM

cs_repne_cmpsw	MACRO

		byte	2eh      ;cs:
		repne	cmpsw

		ENDM

cs_repne_cmpsb	MACRO

		byte	2eh      ;cs:
		repne	cmpsb

		ENDM

es_cmpsw	MACRO

		byte	26h      ;es:	es:cmpsw
		cmpsw

		ENDM

es_cmpsb	MACRO

		byte	26h      ;es:	es:cmpsb
		cmpsb

		ENDM

ss_cmpsw	MACRO

		byte	36h      ;ss:	ss:cmpsw
		cmpsw

		ENDM

ss_cmpsb	MACRO

		byte	36h      ;ss:	ss:cmpsb
		cmpsb

		ENDM

cs_cmpsw	MACRO

		byte	2eh      ;cs:	cs:cmpsw
		cmpsw

		ENDM

cs_cmpsb	MACRO

		byte	2eh     ;cs:	cs:cmpsb
		cmpsb

		ENDM

es_outsb	MACRO

		byte	26h
		outsb

		ENDM

ss_outsb	MACRO

		byte	36h
		outsb

		ENDM

cs_outsb	MACRO

		byte	2eh
		outsb

		ENDM

fs_outsb	MACRO

		byte	64h
		outsb

		ENDM

gs_outsb	MACRO

		byte	65h
		outsb

		ENDM

es_outsw	MACRO

		byte	26h
		outsw

		ENDM

ss_outsw	MACRO

		byte	36h
		outsw

		ENDM

cs_outsw	MACRO

		byte	2eh
		outsw

		ENDM

fs_outsw	MACRO

		byte	64h
		outsw

		ENDM

gs_outsw	MACRO

		byte	65h
		outsw

		ENDM

es_outsd	MACRO

		byte	26h
		outsd

		ENDM

ss_outsd	MACRO

		byte	36h
		outsd

		ENDM

cs_outsd	MACRO

		byte	2eh
		outsd

		ENDM

fs_outsd	MACRO

		byte	64h
		outsd

		ENDM

gs_outsd	MACRO

		byte	65h
		outsd

		ENDM

es_rep_outsb	MACRO

		byte	26h
		byte	0f3h
		outsb

		ENDM

ss_rep_outsb	MACRO

		byte	36h
		byte	0f3h
		outsb

		ENDM

cs_rep_outsb	MACRO

		byte	2eh
		byte	0f3h
		outsb

		ENDM

fs_rep_outsb	MACRO

		byte	64h
		byte	0f3h
		outsb

		ENDM

gs_rep_outsb	MACRO

		byte	65h
		byte	0f3h
		outsb

		ENDM

es_rep_outsw	MACRO

		byte	26h
		byte	0f3h
		outsw

		ENDM

ss_rep_outsw	MACRO

		byte	36h
		byte	0f3h
		outsw

		ENDM

cs_rep_outsw	MACRO

		byte	2eh
		byte	0f3h
		outsw

		ENDM

fs_rep_outsw	MACRO

		byte	64h
		byte	0f3h
		outsw

		ENDM

gs_rep_outsw	MACRO

		byte	65h
		byte	0f3h
		outsw

		ENDM

es_rep_outsd	MACRO

		byte	26h
		byte	0f3h
		outsd

		ENDM

ss_rep_outsd	MACRO

		byte	36h
		byte	0f3h
		outsd

		ENDM

cs_rep_outsd	MACRO

		byte	2eh
		byte	0f3h
		outsd

		ENDM

fs_rep_outsd	MACRO

		byte	64h
		byte	0f3h
		outsd

		ENDM

gs_rep_outsd	MACRO

		byte	65h
		byte	0f3h
		outsd

		ENDM

gs_xlat		MACRO

		byte	65h
		xlat

		ENDM

fs_xlat		MACRO

		byte	64h
		xlat

		ENDM

es_xlat		MACRO

		byte	26h
		xlat

		ENDM

ss_xlat		MACRO

		byte	36h
		xlat

		ENDM

cs_xlat		MACRO

		byte	2eh
		xlat

		ENDM

es_rep_movsd	MACRO

		byte	26h      ;es:
		rep	movsd

		ENDM

ss_rep_movsd	MACRO

		byte	36h      ;ss:
		rep	movsd

		ENDM

cs_rep_movsd	MACRO

		byte	2eh      ;cs:
		rep	movsd

		ENDM

gs_rep_movsd	MACRO

		byte	65h      ;es:
		rep	movsd

		ENDM

fs_rep_movsd	MACRO

		byte	64h      ;es:
		rep	movsd

		ENDM

es_rep_movsd	MACRO

		byte	26h      ;es:
		rep	movsd

		ENDM

es_movsd	MACRO

		byte	26h      ;es:
		movsd

		ENDM

ss_movsd	MACRO

		byte	36h      ;ss:
		movsd

		ENDM

cs_movsd	MACRO

		byte	2eh      ;cs:
		movsd

		ENDM
             
es_lodsd	MACRO

		byte	26h      ;es:
		lodsd

		ENDM

ss_lodsd	MACRO

		byte	36h      ;ss:
		lodsd

		ENDM

fs_lodsd	MACRO

		byte	64h      ;fs:
		lodsd

		ENDM

cs_lodsd	MACRO

		byte	2eh      ;cs:
		lodsd

		ENDM

es_repe_cmpsd	MACRO

		byte	26h      ;es:
		repe	cmpsd

		ENDM

ss_repe_cmpsd	MACRO

		byte	36h      ;ss:
		repe	cmpsd

		ENDM

cs_repe_cmpsd	MACRO

		byte	2eh      ;cs:
		repe	cmpsd

		ENDM

es_repne_cmpsd	MACRO

		byte	26h      ;es:
		repne	cmpsd

		ENDM

ss_repne_cmpsd	MACRO

		byte	36h      ;ss:
		repne	cmpsd

		ENDM

cs_repne_cmpsd	MACRO

		byte	2eh      ;cs:
		repne	cmpsd

		ENDM

es_cmpsd	MACRO

		byte	26h      ;es:
		cmpsd

		ENDM

ss_cmpsd	MACRO

		byte	36h      ;ss:
		cmpsd

		ENDM

cs_cmpsd	MACRO

		byte	2eh      ;cs:
		cmpsd

		ENDM

;MASM 6.0 seems to produce incorrect code for the BSWAP instruction
;The following macros correct these errors

bswap_eax	MACRO

IF (@Cpu AND 0000000000010000b)

IF (@WordSize - 2)
		byte	0fh,0c8h	;for i486
ELSE
		byte	66h,0fh,0c8h
ENDIF

ELSE
   		xchg	ah,al		;for i386
		rol	eax,16
		xchg	ah,al

ENDIF
		ENDM

bswap_ecx	MACRO

IF (@Cpu AND 0000000000010000b)

IF (@WordSize - 2)
		byte	0fh,0c9h
ELSE
		byte	66h,0fh,0c9h
ENDIF

ELSE
   		xchg	ch,cl
		rol	ecx,16
		xchg	ch,cl

ENDIF

		ENDM

bswap_edx	MACRO

IF (@Cpu AND 0000000000010000b)

IF (@WordSize - 2)
		byte	0fh,0cah
ELSE
		byte	66h,0fh,0cah
ENDIF

ELSE
   		xchg	dh,dl
		rol	edx,16
		xchg	dh,dl

ENDIF
		ENDM

bswap_ebx	MACRO

IF (@Cpu AND 0000000000010000b)

IF (@WordSize - 2)
		byte	0fh,0cbh
ELSE
		byte	66h,0fh,0cbh
ENDIF

ELSE
   		xchg	bh,bl
		rol	ebx,16
		xchg	bh,bl

ENDIF
		ENDM

bswap_esp	MACRO

IF (@Cpu AND 0000000000010000b)

IF (@WordSize - 2)
		byte	0fh,0cch
ELSE
		byte	66h,0fh,0cch
ENDIF

ELSE
		push	eax
		mov	eax,esp
   		xchg	ah,al
		rol	eax,16
		xchg	ah,al
		mov	esp,eax
		pop	eax

ENDIF
		ENDM

bswap_ebp	MACRO

IF (@Cpu AND 0000000000010000b)

IF (@WordSize - 2)
		byte	0fh,0cdh
ELSE
		byte	66h,0fh,0cdh
ENDIF

ELSE
		push	eax
		mov	eax,ebp
   		xchg	ah,al
		rol	eax,16
		xchg	ah,al
		mov	ebp,eax
		pop	eax

ENDIF
		ENDM

bswap_esi	MACRO

IF (@Cpu AND 0000000000010000b)

IF (@WordSize - 2)
		byte	0fh,0ceh
ELSE
		byte	66h,0fh,0ceh
ENDIF

ELSE
		push	eax
		mov	eax,esi
   		xchg	ah,al
		rol	eax,16
		xchg	ah,al
		mov	esi,eax
		pop	eax

ENDIF
		ENDM

bswap_edi	MACRO

IF (@Cpu AND 0000000000010000b)

IF (@WordSize - 2)
		byte	0fh,0cfh
ELSE
		byte	66h,0fh,0cfh
ENDIF
ELSE
		push	eax
		mov	eax,edi
   		xchg	ah,al
		rol	eax,16
		xchg	ah,al
		mov	edi,eax
		pop	eax

ENDIF
		ENDM

COMMENT|	uncomment if < masm 6.1

rdtsc		MACRO

		byte	0fh,31h

		ENDM

cpuid		MACRO

		byte	0fh,0a2h

		ENDM

rdmsr		MACRO

		byte	0fh,32h

		ENDM

rsm		MACRO

		0fh,0aah

		ENDM

wrmsr		MACRO

		byte	0fh,30h

		ENDM


mov_cr4_edx	MACRO

		byte	0fh,22h,0e2h

		ENDM

mov_edx_cr4	MACRO

		byte	0fh,20h,0e2h

		ENDM

emms		MACRO
	
		byte	0fh,77h

		ENDM
		
mov_M0_esi	MACRO

		byte	0fh,6fh,6

	  	ENDM

mov_edi_M0	MACRO

		byte	0fh,7fh,7

		ENDM

fcomip_st	MACRO	fpreg

		byte	0dfh,fpreg + 0f0h

		ENDM
|
.LIST

⌨️ 快捷键说明

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