📄 dft.asm
字号:
/*_______________________________________________________________________
DFT.ASM ADSP-2106x matrix multiplication
This routine performs the following equation:
A=B*C
where: A,B,C is a 4*4 matrix respective.
author: 赵世荣(0502155)
date: 2006 06 19
_________________________________________________________________________*/
#include "def21060.h" /* Memory Mapped IOP register definitions */
#define N1 16 /* The number of the data of the matrix A */
.SECTION/DM dm_data; /* Declare variables in data memory */
.VAR B[N1]= "B16.dat";
.VAR C[N1]= "C16.dat";
.VAR A[N1];
.SECTION/PM pm_rsti; /* The reset vector resides in this space */
NOP;
USTAT2= 0x108421; /* 1st instr. to be executed after reset */
DM(WAIT)=USTAT2; /* Set external memory waitstates to 0 */
JUMP start;
.SECTION/PM pm_code; /* Example setup for DFT routine */
start:
B0=A;
L0=@A;
B1=B;
L1=@B;
B2=C;
L2=@C;
CALL MULIPLY;
end: IDLE;
/*___________________________A=B*C Subroutine___________________________*/
MULIPLY:
M0=1;
M1=1;
M2=4;
R2=0;
R3=1;
LCNTR=N1, DO outer UNTIL LCE;
LCNTR=4, DO inner UNTIL LCE;
F5=DM(I1,M1);
F6=DM(I2,M2);
F7=F5*F6;
inner: F8=F8+F7;
DM(I0,M0)=F8;
F8=0;
R5=DM(-1,I0);
B1=B;
B2=C;
R2=R2+1;
R1=4;
R1=R2-R1;
if LT JUMP aa1;
R2=0;
R3=R3+1;
aa1: R11=0;
LCNTR=R3, DO aa2 UNTIL LCE;
R10=4;
aa2: R11=R11+R10;
R11=R11-R10;
R13=12;
R12=R11-R13;
if GT JUMP outer+1;
M4=R11;
MODIFY(I1,M4);
M3=R2;
outer: MODIFY(I2,M3);
RTS;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -