Last active
January 3, 2016 07:59
-
-
Save Temptationx/8432984 to your computer and use it in GitHub Desktop.
NASM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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