Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model tiny
- .data
- message1 db 10,13, 'Enter your 3X4 matrix: $'
- message2 db 10,13, 'Matrix: $'
- matrix dw 16 dup(?)
- .code
- mov ax, @data
- mov ds, ax
- mov dx, offset message1
- mov ah, 9
- int 21h
- mov cx, 12
- xor si, si
- mov bh,0
- mov dh,3
- mov dl,7
- mov di,3
- input_matrix:
- mov ah,02h ;установить позицию курсора
- int 10h ;bh - видео страница, dh,dl - строка и колонка
- mov ah, 01h
- int 21h
- mov byte ptr [matrix+si],al
- inc si
- inc dl
- dec di
- jnz nextl
- inc dh
- mov di,3
- mov dl,7
- nextl:
- loop input_matrix
- mov dx, offset message2
- mov ah, 9
- int 21h
- mov cx,12
- xor si,si
- mov bh,0
- mov dh,12
- mov bl,7
- mov di,3
- output_matrix:
- mov ah,02h
- mov dl,bl
- int 10h
- mov ah,02h
- mov dl, byte ptr[matrix+si]
- int 21h
- inc si
- inc bl
- dec di
- jnz nextl2
- inc dh
- mov di,3
- mov bl,7
- nextl2:
- loop output_matrix
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement