Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model tiny
  2. .data
  3.       message1   db  10,13,  'Enter your 3X4 matrix: $'  
  4.       message2   db  10,13,  'Matrix: $'
  5.       matrix     dw  16 dup(?)
  6.      
  7.  
  8. .code
  9.     mov ax, @data
  10.     mov ds, ax
  11.      
  12.     mov dx, offset message1
  13.     mov ah, 9
  14.     int 21h  
  15.                                                
  16.     mov cx, 12
  17.     xor si, si
  18.    
  19.     mov bh,0
  20.     mov dh,3
  21.     mov dl,7
  22.     mov di,3
  23.    
  24. input_matrix:
  25.     mov ah,02h          ;установить позицию курсора
  26.     int 10h             ;bh - видео страница, dh,dl - строка и колонка                                  
  27.    
  28.     mov ah, 01h
  29.     int 21h
  30.     mov byte ptr [matrix+si],al
  31.    
  32.     inc si
  33.     inc dl
  34.     dec di
  35.     jnz nextl
  36.     inc dh
  37.     mov di,3
  38.     mov dl,7
  39. nextl:
  40.     loop input_matrix              
  41.    
  42.    
  43.     mov dx, offset message2
  44.     mov ah, 9
  45.     int 21h
  46.    
  47.    
  48.     mov cx,12
  49.     xor si,si
  50.    
  51.     mov bh,0
  52.     mov dh,12
  53.     mov bl,7
  54.     mov di,3  
  55.    
  56. output_matrix:  
  57.     mov ah,02h
  58.     mov dl,bl
  59.     int 10h
  60.    
  61.     mov ah,02h
  62.     mov dl, byte ptr[matrix+si]
  63.     int 21h
  64.     inc si
  65.     inc bl
  66.     dec di
  67.     jnz nextl2
  68.     inc dh
  69.     mov di,3
  70.     mov bl,7
  71. nextl2:
  72.     loop output_matrix
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement