progs/example1a.s
changeset 396 2f4296a0ab21
parent 395 60f64793266f
equal deleted inserted replaced
395:60f64793266f 396:2f4296a0ab21
     1 _main:    
     1 _main:    
     2   push    %ebp
     2   push    %ebp              
     3   mov     %esp,%ebp
     3   mov     %esp,%ebp         ; current sp into esp
     4   sub     %0xc,%esp
     4   sub     %0xc,%esp         ; subtract 12 from esp
     5   movl    $0x3,0x8(%esp)
     5   movl    $0x3,0x8(%esp)    ; store 3 at esp + 8
     6   movl    $0x2,0x4(%esp)
     6   movl    $0x2,0x4(%esp)    ; store 2 at esp + 4
     7   movl    $0x1,(%esp)
     7   movl    $0x1,(%esp)       ; store 1 at esp
     8   call    0x8048394 <foo>
     8   call    0x8048394 <foo>   ; push return address to stack
     9   leave
     9                             ; and call foo-function 
    10   ret
    10   leave                     ; clean up stack
       
    11   ret                       ; exit program