📄 example3_5.asm
字号:
;
; Project: Example3.5 - Chapter 3
; File name: example3_5.asm
; Function(s): example3_5()
;
; Description: This is the assembly routine for example 3.5
;
; For the book "Real Time Digital Signal Processing:
; Implementation and Application, 2nd Ed"
; By Sen M. Kuo, Bob H. Lee, and Wenshun Tian
; Publisher: John Wiley and Sons, Ltd
;
;
; Tools used: CCS v.2.12.07
; TMS320VC5510 DSK Rev-C
;
.def _example3_5
L .set 8 ; Order of filter
xbuffer .usect "indata",L ; Length of buffer
xin .usect "indata",1
y .usect "outdata",2,1,1 ; long-word format
;=========================================================
; Default handler
;=========================================================
.sect ".text:example"
_example3_5
mov #L-1,BRC0
amov #xbuffer, XAR3
mov #0x100,AR2
rptb initLoop-1
mov AR2,*AR3+
amar *+AR2(#0x100)
initLoop
mov #0,AC1
mov AC1,dbl(*(y))
mov #0x800,*(xin)
mov #L-1,BRC0
rptb testLoop-1
amov #xbuffer+L-1,XAR3 ; AR3 points to end of x buffer
amov #xbuffer+L-2,XAR2 ; AR2 points to next sample
mov dbl(*(y)),AC1 ; AC1 = y(n-1) in long format
mov *(xin),AC0 ; AC0 = x(n)
sub *AR3,AC0 ; AC0 = x(n) - x(n-L)
add AC0,#-3,AC1 ; AC0 = y(n-1)+1/L[x(n)-x(n-L)]
mov AC1,dbl(*(y)) ; AC1 = y(n)
rpt #(L-2) ; Update the tapped-delay-line
mov *AR2-,*AR3- ; x(n-1) = x(n)
mov *(xin),AC0 ; Update the newest sample x(n)
mov AC0,*AR3 ; x(n) = input xin
testLoop
ret
.end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -