Created
May 6, 2011 18:26
-
-
Save neuro-sys/959490 to your computer and use it in GitHub Desktop.
x86stuff.asm
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 .bss | |
intvar resw 1 | |
section .text | |
global _start | |
_start: | |
push 2 | |
call myfunc | |
add esp,4 | |
add eax,48 | |
mov [intvar],eax | |
push intvar | |
call printstr | |
add esp,4 | |
call exit | |
exit: | |
mov ebx,0 | |
mov eax,1 | |
int 80h | |
myfunc: | |
mov eax,[esp+4] | |
ret | |
printstr: | |
push ebp | |
mov ebp,esp | |
mov eax,4 | |
mov ebx,1 | |
mov ecx,[esp+8] | |
mov edx,1 | |
int 80h | |
mov esp,ebp | |
pop ebp | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment