Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. segment .data
  2. align 4
  3. x:
  4. dd 10
  5. segment .text
  6. align 4
  7. f:
  8. push ebp
  9. mov ebp, esp
  10. sub esp, 4
  11. ;; before body
  12. push dword 1
  13. pop eax
  14. cmp eax, byte 0
  15. je near _L3
  16. push dword 3
  17. lea eax, [ebp+-4]
  18. push eax
  19. pop ecx
  20. pop eax
  21. mov [ecx], eax
  22. lea eax, [ebp+-4]
  23. push eax
  24. pop eax
  25. push dword [eax]
  26. call printi
  27. add esp, 4
  28. _L3:
  29. _L1:
  30. ;; after body
  31. _L2:
  32. leave
  33. ret
  34. segment .text
  35. align 4
  36. global _main:function
  37. _main:
  38. push ebp
  39. mov ebp, esp
  40. sub esp, 4
  41. push dword 0
  42. lea eax, [ebp+-4]
  43. push eax
  44. pop ecx
  45. pop eax
  46. mov [ecx], eax
  47. ;; before body
  48. push dword 1
  49. pop eax
  50. cmp eax, byte 0
  51. je near _L6
  52. call f
  53. add esp, 0
  54. push dword $x
  55. pop eax
  56. push dword [eax]
  57. call printi
  58. add esp, 4
  59. _L6:
  60. _L4:
  61. ;; after body
  62. _L5:
  63. lea eax, [ebp+-4]
  64. push eax
  65. pop eax
  66. push dword [eax]
  67. pop eax
  68. leave
  69. ret
  70. extern printi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement