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

📄 tab_int.s

📁 zigbee 飞思卡尔 音频传输 基于ucos的所有源码
💻 S
字号:
	
/*************************************************************
*   Program Name:     Table intial                           *
*   File Name:        tab_int.s                              *
*   File Description: This file contains the code            *
*                     to compute TONES_TAB                   *
*                     (M5249C3 version)                      *
*   Author:   UESTC Motorola Center                          *
*   Date:     16/7/05                                        *
*   Revision: 1.0                                            *
*   Latest working date: 16/7/05                             *
*************************************************************/
	
	.global _tab_int
	.extern _SIN_TAB
	.extern _TONES_TAB
	.extern _amplitude
//		.extern TONES_TAB
	.extern _offset_dial
	.extern _offset_ringback
	.extern _offset_busy_reorder
	.data
	
     
        
/********************************************************
* The following table gives -A of different power level *
********************************************************/
        
/*amplitude:
	
	.long	 0xF5895457		//-13dBm
	.long	 0xFAC17C0A		//-19dBm
	.long	 0xFD0D0C4E		//-24dBm*/

	
	
	.text
	
_tab_int:
	lea -28(a7), a7
	movem.l d0-d3/a0-a2, (a7)
	move.l #0xa0, macsr
	//move.l #0, acc0
	move.l #0, acc
	
	move.l 32(a7), d0		// d0 contains the CPT index
	ext.l d0
cmp_0:
	cmpi.l #0, d0			//judge if it is dial tone
	bne cmp_1
	lea _offset_dial, a0
	bra update_tab
cmp_1:
	cmpi.l #1, d0			//judge if it is ringback tone
	bne cmp_2
	lea _offset_ringback, a0
	bra update_tab
cmp_2:						//it is busy tone or reorder tone
	lea _offset_busy_reorder, a0

update_tab:
	lea _SIN_TAB, a1		//a1 points to _SIN_TAB
	lea _amplitude, a2
	move.w (a0)+, d0		//d0 contains the tone power
							//offset in table amplitude
	move.l (a2, d0.l), d1   //d1 contains -A
	move.w (a0)+, d0		//d0 contains the low frequency
							//offset in SIN_TAB
	move.l (a1, d0.l), d2   //d2 contains sin valve

	mac.l d1, d2, acc
	
	move.l acc, d2
	move.l #0, acc
	
	/* modified for mac
	mac.l d1, d2, acc0
	*/
	move.w (a0)+, d0		//d0 contains the high frequency
							//offset in SIN_TAB
	move.l (a1, d0.l), d3   //d3 contains sin valve
	/* modified for mac
	movclr.l acc0, d2		//d2=-A*sin(low frequncy)
	*/

	/* modified for mac
	mac.l d1, d3, acc0
	*/
	mac.l d1, d3, acc
	move.l acc, d3
	move.l #0, acc
	
	lea _TONES_TAB, a1	
	ext.l d0
	moveq.l #0, d1
	move.w (a0)+, d0			
	
	move.l d2, (a1, d0.l)	//update _TONES_TAB 	
	subi.l #4, d0
	move.l d1, (a1, d0.l)
	
	/* modified for mac
	movclr.l acc0, d3		//d3=-A*sin(low frequncy)
	*/

	move.w (a0)+, d0
	
	move.l d3, (a1, d0.l)	//update _TONES_TAB 
	subi.l #4, d0
	move.l d1, (a1, d0.l)

	movem.l (a7), d0-d3/a0-a2
	lea 28(a7), a7
	
	rts



/*
	lea -28(a7), a7
	movem.l d0-d3/a0-a2, (a7)
	move.l macsr, d0
	move.l d0, -(a7)
	move.l #0x20, macsr
	
	move.l 36(a7), d0         //d0 contains the power level of the row tones
	move.l 40(a7), d1         //d1 contains power twist forward
	lea _TONES_TAB, a0        //a0 points to TONES
	lea AMPLITUDE, a1           //a1 points to AMPLIFY
	lea _SIN_TAB, a2
	
	add.l d0, d1              //d1 contains the power level of the column tones
	neg.l d0
	neg.l d1
row:	
	move.l (a1,d0.l*4), d2    //d2 contains the row amplify value
	move.l (a2)+, d3
	mac.l d2, d3, acc0
	movclr.l acc0, d3
	move.l d3, 8(a0)          //calculate y(-2) of the first row tone
	move.l (a2)+, d3
	mac.l d2, d3, acc0
	movclr.l acc0, d3
	move.l d3, 20(a0)         //calculate y(-2) of the second row tone
	move.l (a2)+, d3 
	mac.l d2, d3, acc0
	movclr.l acc0, d3
	move.l d3, 32(a0)         //calculate y(-2) of the third row tone
	move.l (a2)+, d3
	mac.l d2, d3, acc0
	movclr.l acc0, d3
	move.l d3, 44(a0)         //calculate y(-2) of the forth row tone
column:	
	move.l (a1,d1.l*4), d2    //d2 contains the column amplify value
	move.l (a2)+, d3
	mac.l d2, d3, acc0
	movclr.l acc0, d3
	move.l d3, 56(a0)         //calculate y(-2) of the first column tone
	move.l (a2)+, d3
	mac.l d2, d3, acc0
	movclr.l acc0, d3
	move.l d3, 68(a0)         //calculate y(-2) of the second column tone
	move.l (a2)+, d3
	mac.l d2, d3, acc0
	movclr.l acc0, d3
	move.l d3, 80(a0)         //calculate y(-2) of the third column tone
	move.l (a2), d3
	mac.l d2, d3, acc0
	movclr.l acc0, d3
	move.l d3, 92(a0)         //calculate y(-2) of the forth column tone
restore:
	move.l (a7)+, d0
	move.l d0, macsr
	movem.l (a7), d0-d3/a0-a2
	lea 28(a7), a7
	
	rts
	
	

⌨️ 快捷键说明

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