aboutsummaryrefslogtreecommitdiff
path: root/prog2.asm
diff options
context:
space:
mode:
Diffstat (limited to 'prog2.asm')
-rw-r--r--prog2.asm32
1 files changed, 32 insertions, 0 deletions
diff --git a/prog2.asm b/prog2.asm
new file mode 100644
index 0000000..364108a
--- /dev/null
+++ b/prog2.asm
@@ -0,0 +1,32 @@
+section .text
+global _start
+
+exit:
+ mov ebx, 0
+ mov eax, 1
+ int 80h
+
+addme:
+ push ebp
+ mov ebp, esp
+ push edx
+
+ mov edx, DWORD [ebp+12]
+ add edx, DWORD [ebp+8]
+ mov eax, edx
+
+ pop edx
+ pop ebp
+ ret
+
+_start:
+ mov ebp, esp
+ sub esp, 8
+
+ mov DWORD [esp+4], 5
+ mov DWORD [esp], 5
+ call addme
+
+ mov esp, ebp
+ pop ebp
+ call exit