Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .text
  2. .align  16
  3. .global process, end_process, scanp, printp, main
  4.  
  5. main:
  6.   pushl %ebp
  7.   movl %esp, %ebp
  8.  
  9.   jmp process
  10.  
  11. process:
  12.   call l1
  13.  
  14. l1:
  15.   popl %eax
  16.   addl $str - l1, %eax
  17.   pushl %eax
  18.   call l2
  19.  
  20. l2:
  21.   popl %eax
  22.   addl $A - l2, %eax
  23.   pushl %eax
  24.   call l3
  25. l3:
  26.   popl %eax
  27.   addl $B - l3, %eax
  28.   pushl %eax
  29.  
  30. scanp:
  31.   call    scanf
  32.   addl $12, %esp
  33.   mov A, %ecx
  34.   add B, %ecx
  35.  
  36.   pushl %esi
  37.   call l4
  38.  
  39. l4:
  40.   popl %eax
  41.   addl $str2 - l2, %eax
  42.   pushl %eax
  43.   pushl %ecx
  44.  
  45. printp:
  46.   call    printf
  47.   addl $8, %esp
  48.   pop %esi
  49.   pop %ebp
  50.  
  51. ret
  52.  
  53. str:    .asciz  "%d%d"
  54. str2:   .asciz  "%d\n"
  55.  
  56. .align  4
  57. A:      .int    0
  58. B:      .int    0
  59.  
  60. end_process:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement