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

📄 pre_process.asm

📁 基于TMS320F2812的AMR+RS编解码+OFDM调制解调源程序。是stand alone运行版本
💻 ASM
字号:
*****************************************************************************
** Description:     pre_process()      in Pre_Process.c                    **
**                                                                         **
** Inputs :                                                                **
**   *XAR2---Word16 signal     : input/output signal                       **
**    AR1 ---Word16 lg         : lenght of signal                          **
**                                                                         **
** Outputs:                                                                **
**   *XAR2---Word16 signal     : input/output signal			           **
**																		   **
** Return value :    			                                           **
**                                                                         **
** Attribute    :       Cycles:29802          Pm:48                        **
**               Modified Registers:XAR0,XAR1,XAR2,XAR3,XAR4,XAR5	       **
**                                  ACC			                           **
**                                                                         **                                                                         **
** Programmer   :       ZHOU Bei                                           **
*****************************************************************************
	
	.global	 _pre_process
	
   	.ref	_buffer1
   	.ref    y2_hi
     	
   	.ref	_copy
 
   	.ref	a
  	.ref	b
  	
  	.global _buffer1
  	
_pre_process:
		push	 xar2
		push	 xar3
		push	 xar1
		;mov	y2_hi-- x1 to buffer1--buffer1+6
		movl	xar2,#y2_hi
		movl	xar3,#_buffer1
		mov 	ar1,#6
		lcr		_copy
		;MOVW	 DP,#21CH
		pop		xar1
		pop		xar3
		pop		xar2

		DEC	AR1			;Loop time= lg
_LOOP_151:
			;x2 = st->x1
			spm	    1
			MOV  	AL, @_buffer1+5
	    	MOV		AR4,AL      ;save x2 in AR4 
		                      
    	    ;st->x1 = st->x0        
			MOV		AL,@_buffer1+4
			MOV		@_buffer1+5,AL                    
        
        	;st->x0 = signal[i]
        	MOV		AL,*XAR2
        	MOV		@_buffer1+4,AL
         
			;L_tmp = Mpy_32_16 (st->y1_hi, st->y1_lo, a[1])
			MOVL	XAR5,#a+1
			ZAPA
    	    MOV		T,*XAR5++
    	    MPYA	P,T,@_buffer1+2
    	    MPYA	P,T,@_buffer1+3
			MOVH	AR0,P
			ADD	    ACC,AR0<<1
    	    MOVL	XAR3,ACC         ;Save to xar3
		
			;L_tmp = L_add (L_tmp, Mpy_32_16 (st->y2_hi, st->y2_lo, a[2]));
    	    ZAPA
    	    MOV		T,*XAR5
    	    MPYA	P,T,@_buffer1
    	    MPYA	P,T,@_buffer1+1
			MOVH	AR0,P
			ADD	    ACC,AR0<<1
    	    ADDL	XAR3,ACC
    	    MOVL	ACC,XAR3
    	    
       		;L_tmp = L_mac (L_tmp, st->x0, b[0])
        	MOVL	XAR5,#b
        	MOV	    T,@_buffer1+4
        	MPY	    P,T,*XAR5++         
        	
        	;L_tmp = L_mac (L_tmp, st->x1, b[1])
        	MOV		T,@_buffer1+5
        	MPYA	P,T,*XAR5++
        
       	 	;L_tmp = L_mac (L_tmp, x2, b[2]);
        	MOV		T,AR4
        	MPYA	P,T,*XAR5
        	ADDL 	ACC,P<<PM 
        
        	;L_tmp = L_shl (L_tmp, 3)
        	LSL		ACC,#3
        	PUSH	ACC			;Save L_tmp
        
        	;signal[i] = round (L_tmp);    
			ADD 	ACC,#0800H<<4
			MOV		*XAR2++,AH
			
        	;st->y2_hi = st->y1_hi;                
        	;st->y2_lo = st->y1_lo;                
			MOV		AL,@_buffer1+2
			MOV		@_buffer1,AL
			MOV		AL,@_buffer1+3
			MOV		@_buffer1+1,AL
        	
        	;L_Extract (L_tmp, &st->y1_hi, &st->y1_lo);
        	POP		ACC
        	MOV		@_buffer1+2,AH
        	LSR		AL,#1
        	MOV		@_buffer1+3,AL
        
       	 	BANZ	_LOOP_151,AR1--
        
        
        push	 xar2
		push	 xar3
		push	 xar1
		;mov	y2_hi-- x1 to buffer1--buffer1+6
		movl	xar3,#y2_hi
		movl	xar2,#_buffer1
		mov 	ar1,#6
		lcr		_copy
		;MOVW	 DP,#21CH
		pop		xar1
		pop		xar3
		pop		xar2
		
		MOV		AL,#0
        
        LRETR
        
        

⌨️ 快捷键说明

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