Skip to content

Instantly share code, notes, and snippets.

@neuro-sys
Created May 6, 2011 18:26
Show Gist options
  • Save neuro-sys/959490 to your computer and use it in GitHub Desktop.
Save neuro-sys/959490 to your computer and use it in GitHub Desktop.
x86stuff.asm
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