Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model small
- .stack 100h
- .data
- mes db '',0ah,0dh, '$'
- buff db 10, ?, 10 dup (?)
- a dw ?
- b dw ?
- c dw ?
- d dw ?
- e dw ?
- .code
- out_str macro str
- push ax
- mov ah,09h
- mov dx, offset e
- int 21h
- pop ax
- endm
- entstr macro
- lea dx, buff
- mov ah, 0ah
- int 21h
- endm
- newstr macro
- lea dx, mes
- mov ah,09h
- int 21h
- endm
- start:
- mov ax,@data
- mov ds,ax
- entstr
- call myproc
- mov a,ax
- newstr
- entstr
- call myproc
- mov b,ax
- newstr
- entstr
- call myproc
- mov c,ax
- newstr
- entstr
- call myproc
- mov d,ax
- newstr
- mov ax, a
- mov bx, b
- je v3
- jb v1
- xchg ax,bx
- v1:
- mov cx,ax
- v2:
- add ax, cx
- push ax
- xor dx,dx
- div bx
- pop ax
- or dx, dx
- jnz v2
- v3:
- mov e, ax
- lea dx, e
- mov ah, 09h
- int 21h
- mov ax, 4c00h
- int 21h
- myproc proc
- xor cx, cx
- mov cl, buff[1]
- xor di,di
- mov si, 2 ; 16
- cycl:
- mov al, buff[si] ; 18
- sub al,48
- push cx ; 20
- dec cl
- jz m2
- mov bl,10
- m1:
- imul bl
- loop m1
- m2:
- pop cx ; 27
- add di,ax
- inc si
- loop cycl
- ret
- myproc endp
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement