kokokozhina

(a/2 + b) / 4 + c - 1

May 18th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .data
  2. fmtin: db "%d%d%d", 0
  3. fmtout: db "%d", 0
  4. two: dd 2
  5. one: dd 1
  6.  
  7. section .bss
  8. a: resd 1
  9. b: resd 1
  10. c: resd 1
  11. x: resd 1
  12.  
  13. section .text
  14. extern _printf
  15. extern _scanf
  16. global _main
  17.  
  18. _main:
  19. push c
  20. push b
  21. push a
  22. push fmtin
  23. call _scanf
  24. add esp, 16
  25.  
  26. mov eax, [a]
  27. div dword [two]
  28. add eax, [b]
  29. div dword [two]
  30. div dword [two]
  31. add eax, [c]
  32. sub eax, [one]
  33. mov [x], eax
  34. push dword [x]
  35. push fmtout
  36. call _printf
  37. add esp, 8
  38. xor eax, eax
  39. ret
Add Comment
Please, Sign In to add comment