程式語言 - JWasm - x64 - Dialog - Create Window



參考資訊:
https://www.masm32.com/

main.S

    option dotname
    option casemap:none
    option win64:3

include /opt/wadk/masm64/include/win64.inc
include /opt/wadk/masm64/include/gdi32.inc
include /opt/wadk/masm64/include/user32.inc
include /opt/wadk/masm64/include/kernel32.inc
  
    .data
szCaption   BYTE "main",0
pCmdLine    QWORD 0
hInstance   QWORD 0
  
    .code
WinMain proc hInst:QWORD, hPrevInst:QWORD, CmdLine:QWORD, CmdShow:QWORD
    local msg:MSG
  
    invoke CreateWindowEx, WS_EX_LEFT, WC_DIALOG, offset szCaption, WS_OVERLAPPEDWINDOW or WS_VISIBLE, 0, 0, 320, 240, NULL, NULL, NULL, NULL
  
@@:
    invoke GetMessage, addr msg, NULL, 0, 0
    cmp rax, 0
    je @f
    invoke DispatchMessage, addr msg
    jmp @b
@@:
    mov rax, msg.wParam
    ret
WinMain endp
  
start proc
    invoke GetModuleHandle, NULL
    mov hInstance, rax
  
    invoke GetCommandLine
    mov pCmdLine, rax
  
    invoke WinMain, hInstance, NULL, pCmdLine, SW_SHOWDEFAULT
    invoke ExitProcess, 0
start endp
end

完成