Skip to content

Instantly share code, notes, and snippets.

@Temptationx
Last active January 3, 2016 07:59
Show Gist options
  • Save Temptationx/8432984 to your computer and use it in GitHub Desktop.
Save Temptationx/8432984 to your computer and use it in GitHub Desktop.
NASM
extern GetStdHandle
extern WriteConsoleA
extern ExitProcess
[SECTION .data]
align 32
_dummy:
dd 0
_message:
db 'Hello, world!', 0dh, 0ah
[SECTION .text]
global _MAIN__
_MAIN__:
sub rsp, 40
mov ecx, -11
call GetStdHandle
mov rcx, rax
mov rdx, _message
mov r8d, 15
mov r9, _dummy
xor eax, eax
mov [rsp-32], rax
call WriteConsoleA
xor ecx, ecx
call ExitProcess
; nasm -f win64 hello.asm
; link /subsystem:console hello.obj /defaultlib:Kernel32.lib /entry:_MAIN__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment