det_x86.asm

来自「open arj source」· 汇编 代码 · 共 66 行

ASM
66
字号
;*;* $Id: det_x86.asm,v 1.1.1.1 2002/03/28 00:02:20 andrew_belov Exp $;* ---------------------------------------------------------------------------;* This code uses the  classic way  of determining what Intel x86 CPU is used.;* The exact author is unknown.;*INCLUDE         ASM_INCL.INCpublic          detect_x86.CODE;*;* Returns one of the following values for corresponding CPU types:;*;*    0x0086 -> 8086/8088;*    0x0186 -> 80186/80188;*    0x0286 -> 80286;*    0x0386 -> 80386 and higher;*detect_x86      proc		pushf		xor	ax, ax		push	ax		popf		pushf		pop	ax		and	ax, 0F000h		cmp	ax, 0F000h		jnz	test_386		push	cx		mov	ax, 0FFFFh		mov	cl, 21h		shl	ax, cl		pop	cx		jnz	l186		mov	ax, 86h		popf		jmp	short donel186:		mov	ax, 186h		popf		jmp	short donetest_386:		mov	ax, 7000h		push	ax		popf		pushf		pop	ax		and	ax, 7000h		jnz	l386		mov	ax, 286h		popf		jmp	short donel386:		mov	ax, 386h		popf		jmp	short $+2done:                retdetect_x86      endp        	end

⌨️ 快捷键说明

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