Hi All,
I'm not a WIndows OS specialist nor CPU of the family 80x86.. .
I'm looking for a way to detect (with running code, not when PB is compiling) if the CPU has MMX instruction set and then use functions with MMX instructions or not from own libs.
Thanks for help.
Denis
MMX CPU detection
MMX CPU detection
A+
Denis
Denis
Check this:
The code is not mine, I found it at:
http://board.win32asmcommunity.net/show ... eadid=1010
Here's some more info about CPUID:
http://www.sandpile.org/ia32/cpuid.htm
Hope it helps, bye.
Code: Select all
Procedure IsMMXSupported() ; Returns 8388608 if supported, 0 if not supported
result = 0
XOR EDX, EDX ; Set edx to 0 just in case CPUID is disabled, not to get wrong results
MOV eax, 1 ; CPUID level 1
!CPUID ; EDX = feature flag
AND edx, $800000 ; test bit 23 of feature flag
MOV result, edx ; <>0 If MMX is supported
ProcedureReturn result
EndProcedure
http://board.win32asmcommunity.net/show ... eadid=1010
Here's some more info about CPUID:
http://www.sandpile.org/ia32/cpuid.htm
Hope it helps, bye.
El_Choni
hi el_choni!
nice codesnip! i have modified your version a little bit... i hope my version works fine too!? maybe some ppl can give their feedback..
i found it at http://www.programmersheaven.com/2/mmx
nice codesnip! i have modified your version a little bit... i hope my version works fine too!? maybe some ppl can give their feedback..
Code: Select all
Procedure TestMMX()
result = 0
MOV eax, 1
!cpuid
MOV eax, edx
SHR eax, 23
And eax, 1
MOV result, eax
ProcedureReturn result
EndProcedure
Debug TestMMX()
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,


