progs/example1a.s
changeset 396 2f4296a0ab21
parent 395 60f64793266f
--- a/progs/example1a.s	Mon Oct 05 20:42:11 2015 +0100
+++ b/progs/example1a.s	Tue Oct 06 09:42:58 2015 +0100
@@ -1,10 +1,11 @@
 _main:    
-  push    %ebp
-  mov     %esp,%ebp
-  sub     %0xc,%esp
-  movl    $0x3,0x8(%esp)
-  movl    $0x2,0x4(%esp)
-  movl    $0x1,(%esp)
-  call    0x8048394 <foo>
-  leave
-  ret
\ No newline at end of file
+  push    %ebp              
+  mov     %esp,%ebp         ; current sp into esp
+  sub     %0xc,%esp         ; subtract 12 from esp
+  movl    $0x3,0x8(%esp)    ; store 3 at esp + 8
+  movl    $0x2,0x4(%esp)    ; store 2 at esp + 4
+  movl    $0x1,(%esp)       ; store 1 at esp
+  call    0x8048394 <foo>   ; push return address to stack
+                            ; and call foo-function 
+  leave                     ; clean up stack
+  ret                       ; exit program
\ No newline at end of file