|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
MASM for x64 (ml64.exe)
ml64.exe is the assembler that accepts x64 assembly language. For information on ml64.exe compiler options, see.
Inline ASM is not supported for x64. Use MASM or compiler intrinsics ().
The two workarounds are separate assembly with MASM (which supports x64 fully) and compiler intrinsics. We’ve added a lot of intrinsics to allow customers to make use of special-function instructions (e.g. privileged, bit scan/test, interlocked, etc…) in as close to cross-platform a manner as possible.
MASM will emit the 0x67 address size override if a memory operand includes 32-bit registers. For example, the following examples cause the address size override to be emitted:
mov rax, QWORD PTR [ecx] mov eax, DWORD PTR [ecx*2+r10d] mov eax, DWORD PTR [ecx*2+r10d+0100h] prefetch [eax] movnti rax, QWORD PTR [r8d]
MASM assumes that if a 32-bit displacement appears alone as a memory operand, 64-bit addressing is intended. There is currently no support for 32-bit addressing with such operands.
Finally, mixing register sizes within a memory operand, as demonstrated in the following code, will generate an error.
mov eax, DWORD PTR [rcx*2+r10d] mov eax, DWORD PTR [ecx*2+r10+0100h]