Skip to content

Instantly share code, notes, and snippets.

@theKidOfArcrania
Last active August 31, 2018 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theKidOfArcrania/58dfa1fbd07f02055b2a7ae409735e32 to your computer and use it in GitHub Desktop.
Save theKidOfArcrania/58dfa1fbd07f02055b2a7ae409735e32 to your computer and use it in GitHub Desktop.
; https://tinyurl.com/hello-in-asm
;
; Requires nasmx
; Linux:
; nasm -f elf64 hello.asm && gcc -o hello.o -o hello && ./hello
; Windows: (requires mingw)
; nasm -f win32 hello.asm && gcc -o hello.obj -o hello.exe && ./hello.exe
%include "nasmx.inc"
IMPORT printf
entry mainproc
section .data
msg: db "Hello, world", 0xa
section .text
PROC mainproc
LOCALS NONE
INVOKE printf, msg
ENDPROC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment