Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model small
- .stack 100h
- .data
- a dw 42
- b dw 24
- r dw ?
- .code
- start:
- mov ax,@data
- mov ds,ax
- afla:
- ; cmp b,0
- ;je afisare
- mov bx,b
- mov r,bx
- mov ax,a
- div bx
- mov b,dx
- cmp dx,0
- je afisare
- xor dx,dx
- mov ax,r
- mov a,ax
- jmp afla
- afisare:
- mov ax,bx
- mov bx,25
- push bx
- divide:
- mov dx,0
- mov cx,10
- div cx
- push dx
- cmp ax,0
- je egal_zero
- jmp divide
- egal_zero:
- mov ah,2
- pop dx
- cmp dx,25
- je stop
- add dx,30h
- int 21h
- loop egal_zero
- stop:
- mov ax,4c00h
- int 21h
- end start
Add Comment
Please, Sign In to add comment