Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;with ebx instead of edx works correctly
- section .data
- fmt: db "%d", 0
- zero: dd 0
- two: dd 2
- ten: dd 10
- seven: dd 7
- three: dd 3
- section .bss
- x: resd 1
- t: resd 1
- section .text
- extern _scanf
- extern _printf
- global _lab1
- global _lab2
- global _lab3
- global _main
- _main:
- push x
- push fmt
- call _scanf
- add esp, 8
- mov eax, [x]
- cmp eax, [zero]
- jl _lab1
- mul dword [x]
- mul dword [two]
- mov [t], eax
- mov eax, [x]
- mul dword [three]
- sub [t], eax
- mov eax, [ten]
- add [t], eax
- mov eax, [t]
- jmp _lab2
- _lab1:
- mul dword [x]
- mul dword [x]
- sub eax, [seven]
- _lab2:
- mov [x], eax
- push dword [x]
- push fmt
- call _printf
- add esp, 8
- xor eax, eax
- xor ecx, ecx
- xor edx, edx
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement