progs/example1a.s
author Christian Urban <urbanc@in.tum.de>
Tue, 26 Sep 2017 12:47:25 +0100
changeset 538 456d1d6676f9
parent 396 2f4296a0ab21
permissions -rw-r--r--
update

_main:    
  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