?? fircycle_calc.asm
字號:
; Module definition for external referance
.def FIRFILTC_CALC
order .set 71
FIRFILTC_CALC:
POPD *+ ; Store the Return Address in stack
SAR AR0,*+ ; Store the Caller's Frame Pointer
SAR AR1,*
;create the software stack
LAR AR2,*+,AR2 ; ARP=AR2, AR2=FP, AR1=FP+1
SETC SXM
SETC OVM
SPM #0
;initialize
SBRK #3 ; ARP=AR2, AR2->#fir
LAR AR2,* ; ARP=AR2, AR2= FIRFILT_handle->*coeff_ptr
LAR AR3,*+ ;ARP=AR2, AR2->brindex & AR3=coeff_ptr->coeff[N]=H(N)
LAR AR0,*+ ; ARP=AR2, AR2->order & AR0=brindex
;at this time AR2->order,AR0=brindex,AR3=H[N]
MAR *+ ; ARP=AR2, AR2->dbuffer_ptr
LAR AR4,*,AR4 ; ARP=AR4, AR4->dbuffer_ptr, AR2->dbuffer_ptr
; AR4=dbuffer_ptr pointing to the oldest sample
LACL #0 ; Clear ACC
LT *BR0-,AR2 ; ARP=AR2, AR2->dbuffer_ptr
;at this time AR4 ->next position confine
;by bit reversion
SAR AR4,*+,AR3 ; ARP=AR3, AR2->input
;update the dbuffer_ptr for the next calcuate
;at this time AR3->H[N],AR4->X[1],TREG=X[0]
.loop order-1
MPY *-,AR4 ; ARP=AR5
LTA *BR0-,AR3 ; ARP=AR3
.endloop
MPY *-,AR2 ; ARP=AR2, AR2->output
LTA *+,AR3 ; ARP=AR3,TREG=input, AR2->output,AR3->H[0]
MPY *,AR2 ; ARP=AR2, AR2->output,PREG=H[0]*input data
APAC ; store the last PREG
;-----------------------------------;below is left shift one bit
SACH * ; 32 bit of ACC is added with itself to get Q31 result
ADDH *
SACL *
ADDS * ; ARP=AR2, AR2->output
;-----------------------------------below is store output to fir.output
ADD #1,15 ; Round the result
SACH *- ; ARP=AR2, AR2->input
;-----------------------------------below`is store the newest sample to the
;last position of buffer window
LACL *,AR4
SACL *,0,AR1
;-----------------------------------below is pop the software stack
CLRC OVM
SBRK #2
LAR AR0,*- ; Retrive Caller's frame pointer
;also conventional for test program
PSHD * ; Push the return address to TOS
RET ; Return to the caller
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -