Advertisement
Guest User

fignya

a guest
May 15th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. database macro
  2.     mov ax, data
  3.     mov ds,ax
  4.     endm
  5.  
  6. input macro str
  7.     mov ah, 9
  8.     mov dx, offset str
  9.     int 21h
  10.     xor ax, ax
  11.     mov ah, 1h
  12.     int 21h
  13.     endm
  14. ten_out_two macro
  15.         local M1,M2
  16.         mov dl,al
  17.         sub dl,30h
  18.         cmp dl,9h
  19.         jle M1
  20.         sub dl,7h
  21.  
  22.     M1: mov cl,4h
  23.         shl dl,cl
  24.         int 21h
  25.         sub al,30h
  26.         cmp al,9h
  27.         jle M2
  28.         sub al,7h
  29.  
  30.     M2: add dl,al      
  31.         endm
  32.        
  33. vchsl macro
  34.         xor ax,ax
  35.         mov al,2
  36.         mul dl
  37.         mov bx,ax
  38.         xor dx,dx
  39.         pop dx
  40.         xor ax,ax
  41.         mov al,3
  42.         mul dl
  43.         mov dx,ax
  44.         add bx,dx
  45.         sar bx,2
  46.         endm
  47. exit macro
  48.         mov ax,4c00h
  49.         int 21h
  50.         endm
  51. data segment para public 'data'                        
  52. messageA db 10, 13, 'Enter 1 number: $'
  53. messageB db 10, 13, 'Enter 2 number: $'
  54.  
  55. data ends
  56. stk segment stack
  57.     db 256 dup ('?')                                       
  58. stk ends
  59. code segment para public 'code'
  60.     vivod proc
  61.     assume cs:code, ds:data, ss:stk
  62.         xor ax,ax
  63.         mov ah,2h
  64.         mov dl,0ah
  65.         int 21h
  66.  
  67.         mov cx,16
  68.     M:
  69.         xor dx,dx
  70.         shl bx,1
  71.         adc dl,30h     
  72.         mov ah,2h
  73.         int 21h
  74.         loop M
  75.         ret
  76.     vivod endp
  77.  
  78. main proc      
  79.     assume cs:code, ds:data, ss:stk    
  80.         database
  81.         input messageA
  82.         ten_out_two
  83.         push dx
  84.         input messageB
  85.         ten_out_two
  86.         vchsl
  87.         call vivod
  88.     main endp
  89. code ends
  90. end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement