How can I use the MMX opcodes in MASM32? Whenever I try to use one, masm tells me I can't use these with the selected processor. I'm using the .386 directive, but I've also tried .586 and even .686, but nothing worked. What is the correct directive for MMX processors? I couldn't find this in the doc. Please help me, I need this stuff to work! Many thanks in advance, Clemens Hofreither This message was edited by Hiroshimator, on 3/20/2001 2:31:59 PM
Are you placing '.mmx' at the beginning of your code? That should do it.
Ya im kinda currious about MMX as well, i know of some commands and how to use them, but i never came across how to check and see if a CPU is MMX compatable. Is this a simple proceedure?? NaN
one of the original (the second) visual assembler project had a default project which did exactly that with NASM... check to see if the processor was MMX compatible. I don't have it here at work but I have it at home... I can send you the source to do that if you need later tonight... I'll post it here unless someone else does first. _Shawn
The technical data for the original question is contained in the readme.txt file for the MASM 6.14 patch. As ChrisH pointed out, adding .MMX tells the assembler to use MMX instructions.
MMX instructions, .586 .MMX 3DNow instructions .586 .K3D SIMD instructions .686 .XMM
Shawn, Yes, i would be interested, if you could post that it would be great. Or e-mail me is you wish... NaN This message was edited by NaN, on 3/20/2001 10:38:40 PM
Okay, I have the source for checking if your CPU supports MMX or not. I forgot who the credits go to, but they are listed in the file with his email. It requires a large MMX include which has many macros for dealing with it... also, I checked Intels site today about identifying the CPU and what it supports and this source actual puts it to very good use, tho Intel didn't have sample source... MMX.ZIP Questions? Ask Thanks, _Shawn This message was edited by Shawn Bullock, on 3/20/2001 11:12:58 PM
heres how to detect if a cpu surports mmx:
If you want to know how this all works, because this method can tell you much more info about the current PC, lookup the CPUID instruction in Intels Opcode document (My version is 24319101.pdf). This message was edited by George, on 3/21/2001 12:57:41 AM
mov eax,1 ;Set eax to the index of the information we want to look up cpuid ;Execute the cpuid instruction .IF (edx & 23) ;EDX contains heaps of info. Bit 23 is MMX bit. ;MMX is surported .ELSE ;MMX not surported .ENDIF
Thank you very much, this is quite handy information to have.. :) NaN
Thanks, I also got it to work now! I've already written a very nice little benchmarking program to compare normal bytewise operations to MMX ops using RDTSC...