Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- database macro
- mov ax, data
- mov ds,ax
- endm
- input macro str
- mov ah, 9
- mov dx, offset str
- int 21h
- xor ax, ax
- mov ah, 1h
- int 21h
- endm
- ten_out_two macro
- local M1,M2
- mov dl,al
- sub dl,30h
- cmp dl,9h
- jle M1
- sub dl,7h
- M1: mov cl,4h
- shl dl,cl
- int 21h
- sub al,30h
- cmp al,9h
- jle M2
- sub al,7h
- M2: add dl,al
- endm
- vchsl macro
- xor ax,ax
- mov al,2
- mul dl
- mov bx,ax
- xor dx,dx
- pop dx
- xor ax,ax
- mov al,3
- mul dl
- mov dx,ax
- add bx,dx
- sar bx,2
- endm
- exit macro
- mov ax,4c00h
- int 21h
- endm
- data segment para public 'data'
- messageA db 10, 13, 'Enter 1 number: $'
- messageB db 10, 13, 'Enter 2 number: $'
- data ends
- stk segment stack
- db 256 dup ('?')
- stk ends
- code segment para public 'code'
- vivod proc
- assume cs:code, ds:data, ss:stk
- xor ax,ax
- mov ah,2h
- mov dl,0ah
- int 21h
- mov cx,16
- M:
- xor dx,dx
- shl bx,1
- adc dl,30h
- mov ah,2h
- int 21h
- loop M
- ret
- vivod endp
- main proc
- assume cs:code, ds:data, ss:stk
- database
- input messageA
- ten_out_two
- push dx
- input messageB
- ten_out_two
- vchsl
- call vivod
- main endp
- code ends
- end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement