Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %include "io64.inc"
- extern scanf
- extern printf
- section .rodata
- fstr db '%d', 0
- fstr1 db '%ll', 0
- section .bss
- n resd 1
- section .text
- global CMAIN
- CMAIN:
- mov ebp, esp
- and esp, -16
- sub esp, 8
- push n
- push fstr
- call scanf
- mov eax, 1
- .loop:
- cmp dword [n], 0
- je .loop_end
- mul dword [n]
- dec dword [n]
- jmp .loop
- .loop_end:
- ;mov dword [res], eax
- mov dword [esp + 8], edx
- mov dword [esp + 4], eax
- mov dword [esp], fstr1
- call printf
- mov esp, ebp
- xor eax, eax
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement