PROWAREtech

articles » current » assembly » x86 » check-for-mmx-support

x86 Assembly: How to Check for MMX Support

An example of how to check if a processor supports the MMX instruction set.

This assembly code was compiled with MS Visual C++ Express Edition 2005 using the MACRO ASSEMBLER for MS Visual C++ Express Edition 2005.

This example is from the SSE/SSE2 tutorial.

TITLE 'extern "C" int __cdecl isMMX();'
.686P
.model FLAT
PUBLIC	_isMMX
_TEXT	SEGMENT
_isMMX PROC NEAR

	push ebx
	
	mov eax, 1
	cpuid
	shr edx, 23 ; bit 23 of the edx register
	and edx, 1
	mov eax, edx

	pop ebx

	ret 0
_isMMX ENDP
_TEXT	ENDS
END

This site uses cookies. Cookies are simple text files stored on the user's computer. They are used for adding features and security to this site. Read the privacy policy.
CLOSE