Last active
January 30, 2016 13:17
-
-
Save hoenirvili/4e74f232cbdd5e0ead87 to your computer and use it in GitHub Desktop.
ExASM
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
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 |
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
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