GitHub_collection_hello-world/a/Assembler MASM Win64.asm

34 lines
627 B
NASM
Raw Normal View History

2016-06-13 21:59:48 +02:00
; ---------------------------------------------
; Hello World for Win64 Intel x64 Assembly
;
; by fruel (https://github.com/fruel)
; 13 June 2016
; ---------------------------------------------
GetStdHandle PROTO
ExitProcess PROTO
WriteConsoleA PROTO
.data
2021-05-07 20:33:04 -05:00
msg BYTE "Hello World",0
2016-06-13 21:59:48 +02:00
bytesWritten DWORD ?
.code
main PROC
2021-05-08 09:57:36 -05:00
sub rsp, 5 * 8
2016-06-13 21:59:48 +02:00
2021-05-08 09:57:36 -05:00
mov rcx, -11
2016-06-13 21:59:48 +02:00
call GetStdHandle
2021-05-08 09:57:36 -05:00
mov rcx, rax
lea rdx, msg
mov r8, LENGTHOF msg - 1
lea r9, bytesWritten
mov QWORD PTR [rsp + 4 * SIZEOF QWORD], 0
2016-06-13 21:59:48 +02:00
call WriteConsoleA
2021-05-08 09:57:36 -05:00
mov rcx, 0
2016-06-13 21:59:48 +02:00
call ExitProcess
main ENDP
END