Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bits 32
- global start
- extern exit, printf, scanf
- import exit msvcrt.dll
- import printf msvcrt.dll
- import scanf msvcrt.dll
- segment data use32 class=data
- ; ...
- sir dw 12345, 20778, 4596
- lSir equ ($-sir)/2
- dest times lSir*8 db 0
- nrCifre db 0
- nrZece db 0ah
- ; segmentul de cod
- segment code use32 class=code
- start:
- ; ...
- mov eax, 0
- mov esi, sir
- mov edi, dest
- mov ecx, lSir
- repetaIaNumar:
- mov [nrCifre], byte 0
- lodsw
- mov ebx, eax
- push ecx
- repeta:
- cwd
- idiv word[nrZece]
- mov bx, ax
- mov ax, dx
- cwde
- push eax
- inc byte[nrCifre]
- mov ax, bx
- cmp ax, 0
- jnz repeta
- mov ecx, 0
- mov cl, byte [nrCifre]
- repetaPuneInDest:
- pop eax
- stosb
- loop repetaPuneInDest
- pop ecx
- loop repetaIaNumar
- ; exit(0)
- push dword 0 ; push the parameter for exit onto the stack
- call [exit] ; call exit to terminate the program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement