exp4c54_5.asm

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

ASM
43
字号
**************************************************************
* exp4c54_5.asm - An assembly program for C5000 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:
	NOP
copy:	
	STM	#x,AR1		; AR0 pointing to x0
	RPT	#1           	; repeat next instruction 8 times
	MVPD init,*AR1+ 	; copy 8 data to x

scale:
	.mmregs
	;RSBX OVM		; if OVM is not set, overflow will occur
	SSBX OVM		; OVM Is set 
	STM #x, AR2
	STM #(x+1), AR3
	LD *AR3, T
	MPY *AR2, A		; Can try with MPYR and MPY ...
	
	STL A, *(y)
	STH A, *(yh)
end
	NOP
	B	end		; stop here

⌨️ 快捷键说明

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