.MODEL SMALL
.DATA
M1 DB
01H,01H,01H,01H,01H,01H,01H,01H,01H
M2 DB
01H,01H,01H,01H,01H,01H,01h,01H,01H
m3 db 9 dup(0)
m4 db ' $'
MES1 DB "THE
multiplication OF TWO MATRIX IS $"
.CODE
.startup
MOV DX,OFFSET MES1
MOV AH,09H
INT 21H
mov cl,0
mov ch,0
p1:xor bx,bx
mov bl,ch
mov dl,m2[bx]
xor bx,bx
mov bl,cl
mov al,m1[bx]
mul dl
add m3[bx],al
xor bx,bx
mov bl,ch
mov dl,m2[bx+1]
xor bx,bx
mov bl,cl
mov al,m1[bx+1]
mul dl
add m3[bx+1],al
xor bx,bx
mov bl,ch
mov dl,m2[bx+2]
xor bx,bx
mov bl,cl
mov al,m1[bx+2]
mul dl
add m3[bx+2],al
add ch,3
cmp ch,8
jbe p1
add cl,3
cmp cl,8
jbe p1
MOV DX,0AH
MOV AH,02H
INT 21H
MOV CL,0
mov ch,0
PP:XOR BX,BX
MOV BL,CL
MOV AL,m3[BX]
MOV DL,AL
ROL DL,4
AND DL,0FH
ADD DL,30H
CMP DL,'9'
JBE F1
ADD DL,7H
F1:MOV AH,02H
INT 21H
MOV AL,m3[BX]
AND AL,0FH
MOV DL,AL
ADD DL,30H
CMP DL,'9'
JBE F2
ADD DL,7
F2:MOV AH,02H
INT 21H
MOV DX,OFFSET M4
MOV AH,09H
INT 21H
inc ch
cmp ch,3
jnz l1
MOV DX,0AH
MOV AH,02H
INT 21H
mov ch,0
l1:INC CL
CMP CL,9
JNZ PP
MOV AH,4CH
INT 21H
END
Output:
THE multiplication
OF TWO MATRIX IS
03 03 03
03 03 03
03 03 03