PROWAREtech








x86 Assembly: How to Check for SSE2 Support
An example of how to check if a processor supports the SSE2 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 isSSE2();'
.686P
.model FLAT
PUBLIC _isSSE2
_TEXT SEGMENT
_isSSE2 PROC NEAR
push ebx
mov eax, 1
cpuid
shr edx, 26 ; bit 26 of the edx register
and edx, 1
mov eax, edx
pop ebx
ret 0
_isSSE2 ENDP
_TEXT ENDS
END
Comment