Debian Codegraph @

test cases/windows/21 masm/hello.masm

raw
1 ; ---------------------------------------------
2 ; Hello World for Win64 Intel x64 Assembly
3 ;
4 ; by fruel (https://github.com/fruel)
5 ; 13 June 2016
6 ; ---------------------------------------------
7
8 GetStdHandle PROTO
9 ExitProcess PROTO
10 WriteConsoleA PROTO
11
12 .data
13 msg BYTE "Hello World!",0
14 bytesWritten DWORD ?
15
16 .code
17 mainCRTStartup proc
18 sub rsp, 5 * 8 ; reserve shadow space
19
20 mov rcx, -11 ; nStdHandle (STD_OUTPUT_HANDLE)
21 call GetStdHandle
22
23 mov rcx, rax ; hConsoleOutput
24 lea rdx, msg ; *lpBuffer
25 mov r8, LENGTHOF msg - 1 ; nNumberOfCharsToWrite
26 lea r9, bytesWritten ; lpNumberOfCharsWritten
27 mov QWORD PTR [rsp + 4 * SIZEOF QWORD], 0 ; lpReserved
28 call WriteConsoleA
29
30 mov rcx, 0 ; uExitCode
31 call ExitProcess
32 mainCRTStartup endp
33 END