You will find tut02,tut03,tut04,tut05,tut31 in 64 bits in the zip
The tut03 show the minimal rules to follow with 64 bits.
The tut31 is a listview control and the more complete on the subject
Take care that use of rdi register,even preserved in stack is not allowed.
See wndproc and use rdi instead r9 after preserved it and see what happen
Le tut21 is a pipe (run \masm32\bin\ml.exe)
VERBOTEN with JWASM,extract from Jwasm doc on "OPTION WIN64":
-------------------------------------------------------------------------------------------------------------------------
Warning: You should have understood exactly what this option does BEFORE you're using it. Using PUSH/POP instruction pairs to "save" values across an INVOKE is VERBOTEN if this option is on.
-------------------------------------------------------------------------------------------------------------------------
a complete comparison on the subject between ml64 and jwasm is here
http://masm32.com/board/index.php?topic=4536.msg48597#msg48597Here a real trap,use of push:
start:
;fastcall need stack space before call
;one qword for return adress of call
;
add rsp,-(8 + 10 * 8) ; - (align + shadow space)
mov Saverdi,rdi ;save rdi en data
push rdi
mov rdi,200
invoke InitInstance,1
pop rdi
.if rdi != Saverdi ;wrong if an API function had been call by the proc
mov rdi,Saverdi
invoke MessageBox,NULL,addr errorrdi,addr Titre,MB_OK
.endif
invoke ExitProcess,0
InitInstance PROC FRAME init:DWORD
Local retour:QWORD
mov retour,1
.if init == 1
invoke GetModuleHandle,NULL
mov hInstance,rax
;--------------------------------------------------------------
invoke GetModuleFileName,hInstance,addr RelativePath,sizeof RelativePath
.endif
FindeInitInstance:
mov rax,retour
ret
InitInstance endp