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

📄 cfft32.asm

📁 CCS3.3自带的TI 5400系列DSP的dsplib文件。文档说明可以在TI公司网站上下载。
💻 ASM
字号:
;***********************************************************
; Version 2.20.01                                           
;***********************************************************
;*****************************************************************************
;  Function:	 cfft32
;  Description:  complex FFT
;
;  Copyright Texas instruments Inc, 1998
;-----------------------------------------------------------------------------
; Revision History:
;
; 0.00	M. Christ. Original code
; 0.01	M. Chishtie.12/96.
;	- Improved radix-2 bfly code form 9 cycles to 8.
;	- Combined bit-reversal in to COMBO5XX macro to save cycles.
;	- Improved STAGE3 macro to 31 cycles
; 1.00Beta  R. Piedra, 8/31/98.
;	- C-callable version.
;	- Removed bit-reversing and made it a separate optional function
;	  that also support in-place bit-reversing. In this way the FFT can
;	  be computed 100% in-place (memory savings)
;	- Modifed STAGE3 macro to correct functional problem
;	- Modified order of xmem, ymem operands in butterfly code
;	  to reduce number of cycles
;
;*****************************************************************************
N	 .set	    32	  ; NUMBER OF POINTS FOR FFT

	.include "macros.asm"
	.include "sintab.q15"

        .mmregs

; Far-mode adjustment
; -------------------

	.if __far_mode
offset	.set 1			; far mode uses one extra location for ret addr  ll
	.else
offset	.set 0
	.endif

	.asg	(0), DATA
	.asg	(1), SIN45
	.asg	(4), save_ar7		; stack description
	.asg	(5), save_ar6		; stack description
	.asg	(6), save_ar1
	.asg	(7), ret_addr
	.asg	(8+offset), scale
					; x in A

;*****************************************************************************
	 .def	_cfft32
	 .text
_cfft32

; Preserve registers
; ------------------
	pshm	ar1
	pshm	ar6
	pshm	ar7
        PSHM    ST0                                 ; 1 cycle
        PSHM    ST1                                 ; 1 cycle
        RSBX    OVA                                 ; 1 cycle
        RSBX    OVB                                 ; 1 cycle

; Preserve local variables
; ------------------------
	frame	-2
	nop

; Get Arguments
; -------------
	stl	a,*sp(DATA)	; DATA = *SP(DATA)

	.if   N>4		; ??? no need
	st    #5a82h,*sp(SIN45)
        .endif

; Set modes
; ---------
	orm   #0100010101011110b,*(ST1) ; ASM=-2 , FRACT=1, sbx=1;CPL=1(compiler)

; Execute
; -------

	combo5xx		     ; FFT CODE for STAGES 1 and 2
        stage3                       ; MACRO WITH CODE FOR STAGE 3
	stdmacro 4,2,8,16,sin4,cos4  ; stage,outloopcnter,loopcnter,index
	laststag 5,sin5,cos5	     ; MACRO WITH CODE FOR STAGE 7

; Return
;--------

	frame	+2
        POPM    ST1                                 ; 1 cycle
        POPM    ST0                                 ; 1 cycle
	popm	ar7
	popm	ar6
	popm	ar1

	.if	__far_mode
	fretd
	.else
	retd
	.endif
	nop
	nop

;end of file. please do not remove. it is left here to ensure that no lines of code are removed by any editor

⌨️ 快捷键说明

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