Skip to content

Instantly share code, notes, and snippets.

@clauswitt
Created March 26, 2014 13:08
Show Gist options
  • Save clauswitt/9782730 to your computer and use it in GitHub Desktop.
Save clauswitt/9782730 to your computer and use it in GitHub Desktop.
quick assembly program
section .text
global mystart
mystart:
push dword mymsg
push dword 1
mov eax, 0x4
sub esp, 4
int 0x80
add esp, 16
push dword 0
mov eax, 0x1
sub esp, 4
int 0x80
section .data
mymsg db "hello, world", 0xa
mylen equ $-mymsg
@clauswitt
Copy link
Author

nasm test.asm -o test

hexdump test

0000000 66 68 38 00 00 00 66 68 01 00 00 00 66 b8 04 00
0000010 00 00 66 81 ec 04 00 00 00 cd 80 66 81 c4 10 00
0000020 00 00 66 68 00 00 00 00 66 b8 01 00 00 00 66 81
0000030 ec 04 00 00 00 cd 80 00 68 65 6c 6c 6f 2c 20 77
0000040 6f 72 6c 64 0a
0000045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment