Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .686
- .model flat
- .data
- extern _ExitProcess@4 : PROC
- extern __write : PROC
- public _main
- znaki db 12 dup(?)
- .code
- wyswietl_EAX PROC
- pusha
- mov esi, 10 ; index for znaki array
- mov ebx, 10 ; dzielnik
- mov edx, 0 ; set number to convert
- convert:
- div ebx
- add dl, 30H
- mov znaki[esi], dl
- dec esi
- mov edx, 0 ; usun reszte z czesci liczby
- cmp eax, 0
- jna wypelnij
- cmp esi, 0
- jna wyswietl
- jmp convert
- wypelnij:
- mov znaki[esi], 20H
- dec esi
- cmp esi, 0
- je wyswietl
- jmp wypelnij
- wyswietl:
- mov znaki[0], 0AH
- mov znaki[11], 0AH
- push 12
- push offset znaki
- push 1
- call __write
- add esp, 12
- popa
- ret
- wyswietl_EAX ENDP
- _main PROC
- mov esi, 50
- mov ebx, 0
- mov eax, 1
- petla:
- add eax, ebx
- inc ebx
- call wyswietl_EAX
- dec esi
- cmp esi, 0
- ja petla
- push dword ptr 0
- call _ExitProcess@4
- _main ENDP
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement