📄 exp4c54_2.asm
字号:
**************************************************************
* exp4c54_2.asm - An assembly program for C5000 CCS simulator
* Coefficient quantization in Section 4.6.2
*
**************************************************************
* Section allocation
*
.def coeff_q15,yq15,init_q15
coeff_q15 .usect "vars",40 ; reserve 40 locations for coeff
yq15 .usect "vars",2 ; reserve 2 locations for y
.sect "table"
init_q15 .int -141,-429,-541,-211,322,354,-215,-551
.int 21,736,332,-841,-871,755,1651,-304
.int -2880,-1106,6139,13157,13157,6139,-1106,-2880
.int -304,1651,755,-871,-841,332,736,21
.int -551,-215,354,322,-211,-541,-429,-141
.text ; create code section
.def start ; label of the beginning of code
* Copy data to vector x using indirect addressing mode
start:
NOP
copy:
STM #coeff_q15, AR1 ; AR0 pointing to x0
RPT #39 ; repeat next instruction 8 times
MVPD init_q15,*AR1+ ; copy 8 data to x
* Add the mult-add 40 data using direct addressing mode
mult_add_q15:
.mmregs
SSBX SXM
SSBX FRCT ; operate in fractional mode
RSBX OVM
STM #coeff_q15, AR2
RPTZ A, #38
MAC *AR2+,#7FFFh,A
SSBX OVM
MAC *AR2, #7FFFh,A
STH A,*(yq15)
STL A,*(yq15+1)
end:
NOP
B end ; stop here
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -