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

📄 fir.asm

📁 基于matlab的FIR滤波器实验的源程序及实验结果图形
💻 ASM
字号:
		.title	"fir.asm"
		.mmregs
		.global	_c_int00
;PA0		.set	0			;write data port
;PA1		.set	1			;read data port
size	.set	17
x_new	.usect	"NewData",	16
x_old	.usect	"OldData",	16
input	.usect	"input",101	
output	.usect	"output",101
		.bss	y,1
		.bss    count, 1
		.copy   "e.h"				;coeffs file
		.text
_c_int00:
	 	ld	#0,	a
		stm	#x_new,	ar2
		rpt	#size-1
		stl	a,	*ar2+
		stm	#x_old,	ar2
		rpt	#size-1
		stl	a,	*ar2+   			;清零
		ld	#y,	DP
		st	#0,	*(count)
		stm #100, ar6				;compute 89+1 times
		stm #output,ar4				; save the result of lowpass filter and 
		stm #input,ar5
									; this line can be cancel
		ssbx 	frct				;小数乘法
		stm	#size,	bk
		stm	#-1,	ar0
		stm	#x_new,	ar2
		stm	#x_old+(size-1),ar3

		;portr	PA1,	*ar2
		mvdd *ar5+,*ar2
FIR:	add	*ar2+0%,  *ar3+0%,  a
		rptz	b,	#(size-1)
		firs	*ar2+0%,  *ar3+0%,  coeff
      	sth	b,	@y
		sth b,	*ar4+					;Notice:this line can cancel
		;portw	@y,	PA0
		mar	*+ar2(2)%
		mar	*ar3+%
		mvdd	*ar2,	*ar3+0%
		;addm	#1,	*(count)			
		;cmpm	*(count),90
		;bc	done,	tc
		;bd	FIR
		mar *ar6+0				;the times of computer -1
		banzd FIR,*ar6 
		;portr	PA1,	*ar2
		mvdd *ar5+,*ar2
		nop
done:	b	done
	
		.sect	"VECTORS"
reset:
		b	_c_int00
		.end

⌨️ 快捷键说明

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