exp4c55_4.asm

来自「用dsp解压mp3程序的算法」· 汇编 代码 · 共 49 行

ASM
49
字号
**************************************************************
* exp4c55_4.asm - An assembly program for C55x CCS simulator
*                 Scaling and saturation in Section 4.6.4
*
**************************************************************
* Section allocation
*
	.def	 x,init
x	.usect   "vars",8	; reserve 8 locations for x

	.sect	 "table"
init	.int	 0,5792,8191,5792,0,-5792,-8191,-5792; 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
	BSET 	SXMD
	BSET	SATD     	; change to BSET and see the changes
	
copy	
	AMOV	#x,XAR1		; XAR1 pointing to x0
	AMOV	#init,XAR2	; XAR2 pointing to table of data
	RPT	#7              ; repeat next instruction 8 times
        MOV	*AR2+,*AR1+	; copy 8 data to x
		
* Shift all the integers by 3 bits

scale
	
	MOV 	#7,BRC0
	AMOV 	#x,XAR2
	
	rptblocal done-1	; block repeat is used to execute 
	MOV	*AR2<<#16,AC0 	; the following 3 instructions 8 times
	SFTS 	AC0,#3
	MOV	HI(AC0),*AR2+
done:	
	
end
	NOP
	B	end		; stop here

⌨️ 快捷键说明

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