Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global _start
- extern ExitProcess, GetStdHandle, WriteConsoleA
- section .data
- msg db "Hello World!", 10
- len equ $ - msg
- section .bss
- dummy resd 1
- section .text
- _start:
- push -11 ; STD_OUTPUT_HANDLE: -11 - standard output, -10: standard input, -12: standard error
- call GetStdHandle ; GetStdHandle - Retrieves a handle to the specified standard device
- push 0 ; lpReserved: reserved - must be NULL
- push dummy ; A pointer to a variable that receives the number of characters actually written.
- push len ; the length of the message
- push msg ; the message to write
- push eax ; handle to the console screen buffer
- call WriteConsoleA
- push 0
- call ExitProcess
- ; nasm -f win32 hello_world.asm -o hello_world.obj
- ; GoLink.exe /console /entry _start hello_world.obj kernel32.dll
Advertisement
Add Comment
Please, Sign In to add comment