In a simple program written for Microsoft's x64 assembler, I want to move a 64-bit value between an SSE register (say xmm0) and a general-purpose register (say rcx), as in <Intel syntax in MASM>:
mov xmm0, rcx
...
mov rcx, xmm0
These two lines generate the following error messages, respectively, from ml64.exe:
- error A2152: coprocessor register cannot be first operand
- error A2070: invalid instruction operands
However, it is clearly possible to accomplish this simple task in x64. For example, the following is a functioning x64 program that I can assemble and run in GAS <AT&T syntax using GCC 4.8.2>:
.text
.globl main
main:
movl $1, %ecx
movq %rcx, %xmm0
movq %xmm0, %rax
ret
As expected, the return value of this program is 1 and the objdump output for main() is:
1004010d0: b9 01 00 00 00 mov $0x1,%ecx
1004010d5: 66 48 0f 6e c1 movq %rcx,%xmm0
1004010da: 66 48 0f 7e c0 movq %xmm0,%rax
1004010df: c3 retq
So my question is, how can I accomplish this in MASM given that ml64.exe is producing the above errors?