Advertisement
kokokozhina

goto.asm

Mar 23rd, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .data
  2. fmt: db "%d", 0
  3. one: dd 1
  4. zero: dd 0
  5.  
  6. section .bss
  7. x: resd 1
  8.  
  9. section .text
  10. extern _scanf
  11. extern _printf
  12. global _lab1
  13. global _lab2
  14. global _lab3
  15. global _main
  16.  
  17. _main:
  18. push x
  19. push fmt
  20. call _scanf
  21. add esp, 8
  22. mov eax, [x]
  23. cmp eax, [zero]
  24. jg _lab1
  25. mov eax, [zero]
  26. jmp _lab2
  27.  
  28. _lab1: mov eax, [one]
  29. _lab2: mov [x], eax
  30.  
  31. push dword [x]
  32. push fmt
  33. call _printf
  34. add esp, 8
  35. xor eax, eax
  36. xor ecx, ecx
  37. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement