format PE console
include 'win32ax.inc'
.data
msg db 'Deliteli chisla %d:',13,10,0
fmt db '%d ',0
n dd 36
.code
start:
cinvoke printf, msg, [n]
mov ebx, 1
l1:
mov eax, [n]
xor edx, edx
div ebx
cmp edx, 0
jne next
push ebx
cinvoke printf, fmt, ebx
pop ebx
next:
inc ebx
cmp ebx, [n]
jle l1
invoke Sleep, 10000
invoke ExitProcess, 0
section '.idata' import data readable
library kernel32, 'KERNEL32.DLL',\
msvcrt, 'MSVCRT.DLL'
import kernel32,\
ExitProcess, 'ExitProcess',\
Sleep, 'Sleep'
import msvcrt,\
printf, 'printf'
.end start