I do not think i'm running in a different mode but I may be wrong.
Let me explain what I have done. Firstly I have created an assembly file containing the following:
global TestMovntq;
export TestMovntq;
segment code public use32 class=CODE
..start:
dllstart:
mov eax, 1;
ret 12 ;
TestMovntq:
push ebp;
mov ebp, esp;
; load parameters
mov esi, [ebp+12]; second argument in call (source)
mov edi, [ebp+8];
movq mm0, [esi];
movntq [edi], mm0;
emms;
pop ebp;
ret 8;
Now this builds with nasm -fobj -l TestMovntq1.lst TestMovntq1.Asm
and links with alink -oPE -dll TestMovntq1.
THis all builds and links with no errors. I subsequently load the dll at runtime in a Borland c++ application and call the function TestMovntq(__int64 *Src, __int64 *Dest);
The Src is successfuly copied to the dest but, when I look in Borlands debugger window I see the following:
push ebp
mov ebp,esp
mov esi,[ebp+0x0c]
mov edi,[ebp+0x08]
movq mm0,[esi]
db 2
pop es
emms
pop ebp
ret 0x0008
Is there something that I have fundamentally not understood? Or is this a bug?
Here is the contents of the lst file:
1 global TestMovntq;
2 export TestMovntq;
3
4 segment code public use32 class=CODE
5
6 ..start:
7 dllstart:
8 00000000 B801000000 mov eax, 1;
9 00000005 C20C00 ret 12 ;
10
11 TestMovntq:
12 00000008 55 push ebp;
13 00000009 89E5 mov ebp, esp;
14 ; load parameters
15 0000000B 8B750C mov esi, [ebp+12]; second argument in call (source)
16 0000000E 8B7D08 mov edi, [ebp+8];
17
18 00000011 0F6F06 movq mm0, [esi];
19 00000014 0FE707 movntq [edi], mm0;
20
21 00000017 0F77 emms;
22
23 00000019 5D pop ebp;
24
25 0000001A C20800 ret 8;
Thanks for any help