Skip to content

Instantly share code, notes, and snippets.

@hoenirvili
Last active January 30, 2016 13:17
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 hoenirvili/4e74f232cbdd5e0ead87 to your computer and use it in GitHub Desktop.
Save hoenirvili/4e74f232cbdd5e0ead87 to your computer and use it in GitHub Desktop.
ExASM
section .text
global _start
_start: ; program entry point
mov eax, 0x04 ; system_call sys_write
mov ebx, 0x01 ; stdout
mov ecx, msg ; assign msg to ecx
mov edx, msglen ; assign edx to msglen
int 0x80 ; call kernel
mov eax, 0x01 ; sys_call sys_exit
mov ebx, 0x05 ;
int 0x80 ; call kernel
section .data
msg db "I'm going to do this!", 0xa
msglen equ $ - msg
all:
nasm -f elf64 foo.asm -o foo.o
ld -o foo foo.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment