⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lab11a.asm

📁 DSP,FIR设计
💻 ASM
字号:
;**************************************
;  Lab11a.asm
;
;  Scott F. Bland   9/22/2000
;
;**************************************
 
; stack looks like this upon entry to this asm routine:
;
;   SP --> 	RET_ADDR  <-- SP
;   		RESULTS
;   		&y
;   		--
;   		--
;
;   AL = TAPS


; allocate label definition here

		.mmregs
		.def _fir  
    	.ref _a,_x
    
; allocate initialized data sections here
; only the first 8 values are used in Labs 2a and 3a

; allocate code section here

		.sect "code"
_fir:	nop
		nop
		nop	
        STLM	A,BK            ;load BK with TAPS (16)
		LD		*SP(1),A        ;load parameter RESULTS into A
		SUB		#1,A            ;subtract 1 from the number
		STLM	A, BRC			;load BRC with RESULTS-1 (184)
		MVDK	*SP(2),*(AR1)	;load ARn with &y 
		
		RSBX	CPL             ;turn off Compiler Mode
		
		LD		#0,DP			;set SST bit (saturate on store)	
		ORM		#1,@PMST 
		
		SSBX	CPL             ;turn on Compiler Mode
		
		SSBX	FRCT			;set FRCT bit (fractional mode)
		RSBX	OVM				;clr OVM bit (overflow mode)
		SSBX	SXM				;set SXM bit (sign extension) 
		
		STM		#1,AR0
		STM		#_a,AR2  		;setup ARs for MAC
		STM		#_x,AR3
		
		RPTB	done-1   
        MPY		*AR2+0%,*AR3+,A   	;1st product
        RPT		#14 				;mult/acc 15 terms
		MAC		*AR2+0%,*AR3+,A
		MAR		*+AR3(-15)
		STH		A,*AR1+  		;store result
;;		STH		A,8,*AR1+		
done:	RSBX	FRCT
		RET						;return
			        

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -