?? fircycle_init.asm
字號:
.def FIRFILTC_INIT ; Init Rouine for Circular buffer
FIRFILTC_INIT:
POPD *+ ; Store the Return Address in stack
SAR AR1,*
LAR AR2,*+,AR2 ; ARP=AR2
;-------------------------------------------; create the software stack
SBRK #2 ; ARP=AR2, AR2->FIR_MODULE_ptr
LAR AR2,* ; ARP=AR2, AR2->coeff_ptr
;--------------------------------------------
LACL * ; ARP=AR2, AR2->coeff_ptr, ACC=coeff_ptr
ADRK #2 ; ARP=AR2, AR2->order
ADDS * ; ARP=AR2, AR2->order, ACC=coeff_ptr+order
SBRK #2 ; ARP=AR2, AR2->coeff_ptr
SACL *+,0 ; ARP=AR2, AR2->brindex, coeff_ptr=coeff_ptr+order
;-------------------------------------------coeff_ptr point the H[N]
LACL #1 ; ACC=1
SACL * ; ARP=AR2, AR2->brindex, brindex=1
bri_loop: LACC *,1 ; ARP=AR2, AR2->brindex, ACC=brindex*2
SACL *+ ; ARP=AR2, AR2->order, brindex=brindex*2
SUB *- ; ARP=AR2, AR2->brindex, ACC=brindex-order
BCND bri_loop,LT
;-------------------------------------------confire the brindex
LAR AR4,*+ ; ARP=AR2, AR2->order, AR4=brindex
ADRK #1 ; ARP=AR2, AR2->dbuffer_ptr for the next instruction
LAR AR3,*+,AR4; ARP=AR4, AR4=brindex, AR3=dbuffer_ptr & AR2->input
MAR *-,AR3 ; ARP=AR3, AR3=dbuffer_ptr, AR4=brindex-1
;------------------------------------at this teime AR4=brindex-1
;-------------------------------------------------AR3=dbuffer_ptr
LACL #0 ; ACC=0
cbloop: SACL *+,0,AR4 ;
BANZ cbloop,*-,AR3
;-------------------------------------------;Clear the delay buffer(brindex ge )
MAR *,AR2 ; ARP=AR2, AR2->input
SACL *+ ; ARP=AR2, AR2->output, input=0
SACL * ; ARP=AR2, AR2->output, output=0
;-------------------------------------------
SBRK #4 ; ARP=AR2, AR2->brindex
LACL * ; ARP=AR2, AR2->brindex, ACC=brindex
SFR ; ARP=AR2, AR2->brindex, ACC=brindex/2
SACL *,0,AR1 ; ARP=AR2, AR2->dbuffer_ptr, brindex=brindex/2
;------------------------------------------;pop the software stack
SBRK #2
PSHD *
RET
;at this time
;brindex=0040h
;dbuffer_ptr=the first data
;coeff_ptr=the last coeffH[N]
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -