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

📄 exp4c55_5.asm

📁 用dsp解压mp3程序的算法
💻 ASM
字号:
**************************************************************
* exp4c55_5.asm - An assembly program for C55x CCS simulator
*                 Rounding y = rnd(x1*x2) in Section 4.6.5
*     
**************************************************************
* Section allocation
*
	.def	 x,y,init
x	.usect   "vars",2	; reserve 2 locations for x
y       .usect   "vars",1	; reserve 1 location for y
yh	.usect   "vars",1

	.sect	 "table"
init	.int	 8520, 26214; value of x

	.text		  	; create code section
	.def	 start		; label of the beginning of code

* Copy data to vector x using indirect addressing mode

start
	BCLR	C54CM		; set C55x native mode
        BCLR	AR1LC		; set AR1 in linear mode
	BCLR	AR2LC		; set AR2 in linear mode

copy	
	AMOV	#x,XAR1		; XAR1 pointing to x0
	AMOV	#init,XAR2	; XAR2 pointing to table of data
	RPT	#1     	        ; repeat next instruction 2 times
        MOV	*AR2+,*AR1+	; copy 2 data to x

scale
	AMOV	#x,XAR2		; XAR2 pointing to x0
	AMOV 	#(x+1),XAR3
	MOV     *AR3<<#16,AC0
	MPYMR 	*AR2,AC0,AC1    ; can try with MPYR and MPY ...
	
	MOV	AC1,*(#y)	; y <- AC0
	MOV     HI(AC1),*(#yh)
	
end
	NOP
	B	end		; stop here

⌨️ 快捷键说明

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