aboutsummaryrefslogtreecommitdiff
path: root/prog2.asm
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-09-23 00:22:44 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-09-23 00:22:44 -0400
commit94fcde92ba95b81d1955f8cd31507aed1063dd1b (patch)
tree789287835d4cd90a435dcd0e4706bc73c0074e2e /prog2.asm
parent9d03e10557ec184ec575ca6f73378eb2fd2eaa3b (diff)
downloadasmfun-94fcde92ba95b81d1955f8cd31507aed1063dd1b.tar.gz
Add a few numbers
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