--- a/progs/example1b.s Mon Oct 05 20:42:11 2015 +0100
+++ b/progs/example1b.s Tue Oct 06 09:42:58 2015 +0100
@@ -1,11 +1,12 @@
_foo:
- push %ebp
- mov %esp,%ebp
- sub $0x10,%esp
- movl $0x64636261,-0x6(%ebp)
- movw $0x65,-0x2(%ebp)
- movl $0x34333231,-0x10(%ebp)
- movl $0x38373635,-0xc(%ebp)
- movw $0x39,-0x8(%ebp)
- leave
- ret
\ No newline at end of file
+ push %ebp ; push current sp onto stack
+ mov %esp,%ebp ; current sp into esp
+ sub $0x10,%esp ; subtract 16 from esp
+ movl $0x64636261,-0x6(%ebp) ; store abcd in ebp - 6
+ movw $0x65,-0x2(%ebp) ; store e in ebp - 2
+ movl $0x34333231,-0x10(%ebp) ; store 1234 in ebp - 16
+ movl $0x38373635,-0xc(%ebp) ; store 5678 in ebp - 12
+ movw $0x39,-0x8(%ebp) ; store 9 in ebp - 8
+ leave ; pop last sp into ebp
+ ret ; pop return address and
+ ; go back to main
\ No newline at end of file