汇编语言实现矩阵运算(帮忙看看)
如果我要实现3*4的矩阵与4*2的矩阵相乘最后结果为3*2的矩阵有什么更简单易懂的写法,谢谢大家
N EQU 3
M EQU 4
P EQU 2
.MODEL small
.STACK
.DATA
ARR_A DW4, -3, 5, 1, 3, -5, 0, 11, -5, 12, 4, -5
ARR_B DW-2, 3, 5, -1, 4, 3, 9, -7
ARR_C DW6, 23, 68, -63, 41, 20
CHECK DW 0
point_i DW 0
point_j DW 0
point_i1 DW 0
point_j1 DW 0
point_add_cou DW 0
ARR_RES DW 6DUP(0)
.CODE
.STARTUP
MOV CX, N
MOV DI, 0
OUTLOOP:
PUSH CX
MOV CX, P
MIDLOOP:
PUSH CX
MOV CX, M
MOV BX, 0
MOV AX, point_i1
MOV DL, M
MUL DL
MOV DI, AX
INNERLOOP:
MOV AX, point_i
MOV DL, P
MUL DL
ADD AX, point_j
MOV SI, AX
MOV AX, ARR_A
MUL ARR_B
ADD BX, AX
INC DI
INC DI
INC point_i
INC point_i
LOOP INNERLOOP
POP CX
MOV SI, point_add_cou
MOV ARR_RES, BX
INC point_add_cou
INC point_add_cou
INC point_j
INC point_j
MOV AX, 0
MOV point_i, AX
LOOP MIDLOOP
POP CX
MOV AX, 0
MOV point_j, AX
INC point_i1
INC point_i1
LOOP OUTLOOP
MOV CX, 6
MOV SI, 0
OutputResult:
MOV AX, ARR_RES
MOV CHECK, AX
INC SI
INC SI
LOOP OutputResult
.EXIT
END
你这不是intel的语法啊?
页:
[1]