www.pudn.com > g729Decoder.rar > P_PARITY.asm


;========================================================================== 
;  File Name 
;  ---------- 
;  P_PARITY.ASM 
; 
;  Brief Description of the Code: 
;  ------------------------------ 
;  Parity_pitch - compute parity bit for first 6 MSBs 
; 
;  Ref 
;  ------ 
;  P_PARITY.C 
;========================================================================== 
 
        .mmregs 
 
        .include  ..\include\const.h 
        .include  ..\include\tab_ld8a.h 
        .include  ..\include\ld8amem.h 
 
 
;--------------------------------------------------------------------------- 
;   Parity_Pitch 
;--------------------------------------------------------------------------- 
;   Word16 Parity_Pitch(    /* output: parity bit (XOR of 6 MSB bits)    */ 
;     Word16 pitch_index   /* input : index for which parity to compute */ 
;   ) 
;----------------------------------------------------------------------- 
; 
;  Input Registers :    B =  pitch_index 
; 
;  Output Registers :   A =  Word16 Parity_Pitch(Word16 pitch_index) 
; 
;  Modified Registers : DP, A, B, AR2 
; 
;--------------------------------------------------------------------------- 
 
        .text 
        .def    Parity_Pitch 
 
        .asg    "AR2", pZero 
	.asg	 "Addr_local_buf2",zero 
Parity_Pitch: 
 
        STM     #6 - 1, BRC 
		SFTL    B,-2 
        ST     #0,*(zero) 
        LD      #1, A 
        RPTBD   EndParity_Pitch - 1 
        STM     #zero, pZero 
 
                SFTL    B, -1		;C(Carry bit)=temp&(Word16)1; 
                ADDC    *pZero, A 
EndParity_Pitch: 
 
        RETD 
        AND     #1, A