movd instruction not working with Masm 8.0

movd instruction not working with Masm 8.0

I am currently using Masm 8.0 which is giving the error message "Invalid instruction operand" with
the movd [edi+eax],MM0 instruction. The code worked fine with Masm 6.14.

The comment next to the 3rd instruction explains what is happening.


packuswb MM1,MM7
packuswb MM2,MM7

movd [edi+eax],MM0 ; If this is changed to movq [edi+eax], MM0 , then
; Masm 8.0 no longer complains, but the video mode is changed
; to a lower resolution ??

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Seems like a serious bug in MASM 8.0 and 9.0. Add the following macro to your source code to workaround the problem:

movdfix MACRO op1, op2
LOCAL loc1, loc2
loc1 = $+1
movq op1, op2
loc2 = $
ORG loc1
DB 7Eh ;; create MOVD
ORG loc2

And use it like this:

movdfix [edx+eax],mm0

Sorry for digging up this ancient thread from the grave but I recently had the same issue with MASM in Visual Studio 2013.

Just write: movd dword ptr [edi+eax],mm0

Leave a Comment

Please sign in to add a comment. Not a member? Join today