Im trying to compile an assembly file that with nasm and to link it with golink. The file is very simple and contains only one call to an SSE command.
When I'm compile and link the file without the SSE command the executable runs properly, but when the file contains the SSE command the program is crashed, so I'm assuming that the problem is somewhere in the use of that command.
Here is the code - hello.asm:
extern malloc
global main
section .text
main:
push rbp ; Save the stack
mov rbp, rsp
push rax ; Save the registers
push 1024;
call malloc
and rax,0xFFFFFFFFFFFFF000
movntdq [rax], xmm5;
pop rax
mov rsp,rbp
pop rbp
mov rax,0
ret
That code compiled with: (yasm - same problem)
nasm -f win64 hello.asm -o hello.obj
and linked with:
golink.exe /console /entry main hello.obj MSVCRT.dll kernel32.dll
The output is hello.exe, that crash each time it runs.
What's wrong here?
Thanks in advance !