📄 circonv.asm
字号:
************************************************************
*Circular Convolution
*-----------------------------------------------------------
*Objective:
* Implement circular convolution by circular buffer
* and the instruction MACM.
* Y = {10,8,6,4,2} CirConv {1,2,5,10}
*ARs:
* AR2 -> U
* AR3 -> Circular buffer
* AR4 -> Z
*Memory:
* 0000h..005Fh: reserved for Memory-Mapped Register
* 1000h..14FFh: used as execute code
* 1800h..27FFh: used as Data space
*-----------------------------------------------------------
*By Jwusheng Hu, Tzung-Min Su, Wei-Han Liu, Ming-Chien Tsai
* CopyRight 2004/08/03
************************************************************
.def _c_int00
.mmregs
M .set 5
N .set 4
.data
buf .word 0,6,4,2
U .word 10,8,6,4,2
Z .word 0,0,0,0,0
H .word 10,5,2,1
.text
.c54cm_off
_c_int00
BCLR C54CM
AMOV #1800h,XDP
MOV #U,AR2 ;AR2 -> U
MOV #buf,AR3 ;AR3 -> buf
MOV #Z,AR4 ;AR4 -> Z
MOV #N,BK03 ;BK03 = 4
BSET AR3LC ;Set AR3 as circular buffer
MOV #0, BSA23 ;Set offset = 0
MOV #(M-1),BRC0 ;BRC0 = 4
RPTB end_block-1
MOV *AR2+,*AR3+
AMOV #H,XCDP
MOV #0,AC0
RPT #(N-1) ;repeat N times
MACM *AR3+,*CDP+,AC0
MOV AC0,*AR4+ ;Z[i] = AC0
end_block
END:
B END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -