Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .data
- format db "%u", 0
- section .bss
- x resd 1
- k resd 1
- section .text
- extern _printf
- extern _scanf
- global _main
- _main:
- mov ebp, esp
- and esp, 0xfffffff0
- sub esp, 8
- push x
- push format
- call _scanf
- add esp, 16
- sub esp, 8
- push k
- push format
- call _scanf
- add esp, 16
- mov ebx, dword[k]
- mov eax, dword[x]
- xor esi, esi
- .cycle1:
- xor edx, edx
- div ebx
- push edx
- inc esi
- test eax, eax
- jnz .cycle1
- .print:
- pop eax
- push ebp
- mov ebp, esp
- and esp, 0xfffffff0
- sub esp, 8
- push eax
- push format
- call _printf
- add esp, 16
- mov esp, ebp
- pop ebp
- dec esi
- test esi, esi
- jnz .print
- add esp, 12
- xor eax, eax
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement