Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .data
- fmtin: db "%d%d%d", 0
- fmtout: db "%d", 0
- two: dd 2
- one: dd 1
- section .bss
- a: resd 1
- b: resd 1
- c: resd 1
- x: resd 1
- section .text
- extern _printf
- extern _scanf
- global _main
- _main:
- push c
- push b
- push a
- push fmtin
- call _scanf
- add esp, 16
- mov eax, [a]
- div dword [two]
- add eax, [b]
- div dword [two]
- div dword [two]
- add eax, [c]
- sub eax, [one]
- mov [x], eax
- push dword [x]
- push fmtout
- call _printf
- add esp, 8
- xor eax, eax
- ret
Add Comment
Please, Sign In to add comment