;******************************************************************************
;* TMS320C6x ANSI C Codegen                                      Version 4.20 *
;* Date/Time created: Wed Feb 19 13:54:51 2003                                *
;******************************************************************************

;******************************************************************************
;* GLOBAL FILE PARAMETERS                                                     *
;*                                                                            *
;*   Architecture      : TMS320C620x                                          *
;*   Optimization      : Disabled                                             *
;*   Optimizing for    : Compile time, Ease of Development                    *
;*                       Based on options: no -o, no -ms                      *
;*   Endian            : Little                                               *
;*   Interrupt Thrshld : Disabled                                             *
;*   Memory Model      : Small                                                *
;*   Calls to RTS      : Near                                                 *
;*   Pipelining        : Disabled                                             *
;*   Memory Aliases    : Presume are aliases (pessimistic)                    *
;*   Debug Info        : Debug                                                *
;*                                                                            *
;******************************************************************************

	.asg	A15, FP
	.asg	B14, DP
	.asg	B15, SP
	.global	$bss

	.file	"c6xdskinit.c"

	.sect	".cinit:c"
	.align	8
	.field  	(CIR - $) - 8, 32
	.field  	_polling+0,32
	.field  	0,8			; _polling @ 0
	.sect	".text"
	.global	_polling
_polling:	.usect	".bss:c",1,1
	.sym	_polling,_polling, 2, 2, 8
;	c:\ti\c6000\cgtools\bin\acp6x.exe -D_DEBUG -Ic:/ti/c6000/bios/include -Ic:/ti/c6000/rtdx/include -Ic:/ti/c6000/cgtools/include --keep_unneeded_types -m --i_output_file C:\DOCUME~1\yoder\LOCALS~1\Temp\TI3072_2 --template_info_file C:\DOCUME~1\yoder\LOCALS~1\Temp\TI3072_3 --object_file C:/ti/myprojects/sine8_intr/Debug/c6xdskinit.obj --opt_shell 9 c6xdskinit.c -g -k -s -frC:/ti/myprojects/sine8_intr/Debug -d_DEBUG -ic:/ti/c6000/bios/include -ic:/ti/c6000/rtdx/include -ic:/ti/c6000/cgtools/include 
	.sect	".text"
	.global	_enableGlobalINT
	.file	"c6xinterrupts.h"
	.sym	_enableGlobalINT,_enableGlobalINT, 32, 2, 0
	.func	24
;----------------------------------------------------------------------
;  24 | void enableGlobalINT(void)                                             
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _enableGlobalINT                                            *
;*                                                                            *
;*   Regs Modified     : B4                                                   *
;*   Regs Used         : B3,B4                                                *
;*   Local Frame Size  : 0 Args + 0 Auto + 0 Save = 0 byte                    *
;******************************************************************************
_enableGlobalINT:
;** --------------------------------------------------------------------------*
	.line	2
	.line	3
;----------------------------------------------------------------------
;  26 | CSR |= 0x1;                                                            
;----------------------------------------------------------------------
           MVC     .S2     CSR,B4            ; |26| 
           OR      .S2     1,B4,B4           ; |26| 
           MVC     .S2     B4,CSR            ; |26| 
           NOP             1
	.line	4
           B       .S2     B3                ; |27| 
           NOP             5
           ; BRANCH OCCURS                   ; |27| 
	.endfunc	27,000000000h,0


	.sect	".text"
	.global	_enableNMI
	.sym	_enableNMI,_enableNMI, 32, 2, 0
	.func	31
;----------------------------------------------------------------------
;  31 | void enableNMI(void)                                                   
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _enableNMI                                                  *
;*                                                                            *
;*   Regs Modified     : B4                                                   *
;*   Regs Used         : B3,B4                                                *
;*   Local Frame Size  : 0 Args + 0 Auto + 0 Save = 0 byte                    *
;******************************************************************************
_enableNMI:
;** --------------------------------------------------------------------------*
	.line	2
	.line	3
;----------------------------------------------------------------------
;  33 | IER = _set(IER, 1, 1);                                                 
;----------------------------------------------------------------------
           MVC     .S2     IER,B4            ; |33| 
           SET     .S2     B4,1,1,B4         ; |33| 
           MVC     .S2     B4,IER            ; |33| 
           NOP             1
	.line	4
           B       .S2     B3                ; |34| 
           NOP             5
           ; BRANCH OCCURS                   ; |34| 
	.endfunc	34,000000000h,0


	.sect	".text"
	.global	_enableSpecificINT
	.sym	_enableSpecificINT,_enableSpecificINT, 32, 2, 0
	.func	38
;----------------------------------------------------------------------
;  38 | void enableSpecificINT(int INTnumber)                                  
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _enableSpecificINT                                          *
;*                                                                            *
;*   Regs Modified     : A0,B4,B5,SP                                          *
;*   Regs Used         : A0,A4,B3,B4,B5,SP                                    *
;*   Local Frame Size  : 0 Args + 4 Auto + 0 Save = 4 byte                    *
;******************************************************************************
_enableSpecificINT:
;** --------------------------------------------------------------------------*
	.line	2
	.sym	_INTnumber,4, 4, 17, 32
	.sym	_INTnumber,4, 4, 1, 32
           SUB     .D2     SP,8,SP           ; |39| 
           STW     .D2T1   A4,*+SP(4)        ; |39| 
           NOP             2
	.line	3
;----------------------------------------------------------------------
;  40 | IER = _set(IER, INTnumber, INTnumber);                                 
;----------------------------------------------------------------------
           LDW     .D2T1   *+SP(4),A0        ; |40| 
           NOP             3
           MVC     .S2     IER,B5            ; |40| 
           MV      .S2X    A0,B4             ; |40| 

           EXTU    .S1     A0,27,22,A0       ; |40| 
||         EXTU    .S2     B4,27,27,B4       ; |40| 

           OR      .S2X    A0,B4,B4          ; |40| 
           SET     .S2     B5,B4,B4          ; |40| 
           MVC     .S2     B4,IER            ; |40| 
           NOP             1
	.line	4
           B       .S2     B3                ; |41| 
           ADD     .D2     8,SP,SP           ; |41| 
           NOP             4
           ; BRANCH OCCURS                   ; |41| 
	.endfunc	41,000000000h,8


	.sect	".text"
	.global	_config_Interrupt_Selector
	.sym	_config_Interrupt_Selector,_config_Interrupt_Selector, 32, 2, 0
	.func	51
;----------------------------------------------------------------------
;  51 | void config_Interrupt_Selector(int INTnumber, int INTsource)           
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _config_Interrupt_Selector                                  *
;*                                                                            *
;*   Regs Modified     : A0,A1,A3,B4,SP                                       *
;*   Regs Used         : A0,A1,A3,A4,B3,B4,SP                                 *
;*   Local Frame Size  : 0 Args + 16 Auto + 0 Save = 16 byte                  *
;******************************************************************************
_config_Interrupt_Selector:
;** --------------------------------------------------------------------------*
	.line	2
	.sym	_INTnumber,4, 4, 17, 32
	.sym	_INTsource,20, 4, 17, 32
	.sym	_INTnumber,4, 4, 1, 32
	.sym	_INTsource,8, 4, 1, 32
	.sym	_IMLvalue,12, 9, 1, 32, $$fake0
	.sym	_IMHvalue,16, 9, 1, 32, $$fake2
           SUB     .D2     SP,16,SP          ; |52| 
;----------------------------------------------------------------------
;  57 | union                                                                  
;  59 | struct                                                                 
;  60 |  { unsigned int INTSEL4  : 5;                                          
;  61 |    unsigned int INTSEL5  : 5;                                          
;  62 |        unsigned int INTSEL6  : 5;                                      
;  63 |        unsigned int rsvbit15 : 1;                                      
;  64 |        unsigned int INTSEL7  : 5;                                      
;  65 |    unsigned int INTSEL8  : 5;                                          
;  66 |        unsigned int INTSEL9  : 5;                                      
;  67 |        unsigned int rsvbit31 : 1;                                      
;  68 |  }exp;                                                                 
;  69 |  unsigned int reg;                                                     
;  70 |  }IMLvalue;                                   /* = {0,0,0,0,0,0,0,0}; *
;     | /                                                                      
;  72 | union                                                                  
;  74 |  unsigned int reg;                                                     
;  75 |  struct                                                                
;  76 |  { unsigned int INTSEL10  : 5;                                         
;  77 |    unsigned int INTSEL11  : 5;                                         
;  78 |        unsigned int INTSEL12  : 5;                                     
;  79 |        unsigned int rsvbit15  : 1;                                     
;  80 |        unsigned int INTSEL13  : 5;                                     
;  81 |    unsigned int INTSEL14  : 5;                                         
;  82 |        unsigned int INTSEL15  : 5;                                     
;  83 |        unsigned int rsvbit31  : 1;                                     
;  84 |  }exp;                                                                 
;  85 |  }IMHvalue;                                                            
;----------------------------------------------------------------------
           STW     .D2T2   B4,*+SP(8)        ; |52| 
           STW     .D2T1   A4,*+SP(4)        ; |52| 
           NOP             2
	.line	37
;----------------------------------------------------------------------
;  87 | IMLvalue.reg = *(unsigned volatile int *)IML;                          
;----------------------------------------------------------------------
           MVKL    .S2     0x19c0004,B4      ; |87| 
           MVKH    .S2     0x19c0004,B4      ; |87| 
           LDW     .D2T2   *B4,B4            ; |87| 
           NOP             4
           STW     .D2T2   B4,*+SP(12)       ; |87| 
           NOP             2
	.line	38
;----------------------------------------------------------------------
;  88 | IMHvalue.reg = *(unsigned volatile int *)IMH;                          
;----------------------------------------------------------------------
           ZERO    .D1     A0                ; |88| 
           MVKH    .S1     0x19c0000,A0      ; |88| 
           LDW     .D1T1   *A0,A0            ; |88| 
           NOP             4
           STW     .D2T1   A0,*+SP(16)       ; |88| 
           NOP             2
	.line	40
;----------------------------------------------------------------------
;  90 | switch (INTnumber)                                                     
;  92 |   case 4 :                                                             
;----------------------------------------------------------------------
           B       .S1     L13               ; |90| 
           NOP             5
           ; BRANCH OCCURS                   ; |90| 
;** --------------------------------------------------------------------------*
L1:    
	.line	43
;----------------------------------------------------------------------
;  93 | IMLvalue.exp.INTSEL4 = INTsource;                                      
;  94 | break;                                                                 
;  96 | case 5 :                                                               
;----------------------------------------------------------------------
           LDBU    .D2T2   *+SP(12),B4       ; |93| 
           LDW     .D2T1   *+SP(8),A0        ; |93| 
           NOP             1
           B       .S1     L14               ; |93| 
           NOP             2

           EXTU    .S1     A0,27,27,A0       ; |93| 
||         CLR     .S2     B4,0,4,B4         ; |93| 

           OR      .S2X    A0,B4,B4          ; |93| 
           STB     .D2T2   B4,*+SP(12)       ; |93| 
           ; BRANCH OCCURS                   ; |93| 
;** --------------------------------------------------------------------------*
L2:    
	.line	47
;----------------------------------------------------------------------
;  97 | IMLvalue.exp.INTSEL5 = INTsource;                                      
;  98 | break;                                                                 
; 100 | case 6 :                                                               
;----------------------------------------------------------------------
           LDW     .D2T2   *+SP(8),B4        ; |97| 
           LDHU    .D2T1   *+SP(12),A0       ; |97| 
           NOP             1
           B       .S1     L14               ; |97| 
           NOP             1
           EXTU    .S2     B4,27,27,B4       ; |97| 

           SHL     .S2     B4,5,B4           ; |97| 
||         CLR     .S1     A0,5,9,A0         ; |97| 

           OR      .S2X    B4,A0,B4          ; |97| 
           STH     .D2T2   B4,*+SP(12)       ; |97| 
           ; BRANCH OCCURS                   ; |97| 
;** --------------------------------------------------------------------------*
L3:    
	.line	51
;----------------------------------------------------------------------
; 101 | IMLvalue.exp.INTSEL6 = INTsource;                                      
; 102 | break;                                                                 
; 104 | case 7 :                                                               
;----------------------------------------------------------------------
           LDW     .D2T2   *+SP(8),B4        ; |101| 
           LDBU    .D2T1   *+SP(13),A0       ; |101| 
           NOP             1
           B       .S1     L14               ; |101| 
           NOP             1
           EXTU    .S2     B4,27,27,B4       ; |101| 

           SHL     .S2     B4,2,B4           ; |101| 
||         CLR     .S1     A0,2,6,A0         ; |101| 

           OR      .S2X    B4,A0,B4          ; |101| 
           STB     .D2T2   B4,*+SP(13)       ; |101| 
           ; BRANCH OCCURS                   ; |101| 
;** --------------------------------------------------------------------------*
L4:    
	.line	55
;----------------------------------------------------------------------
; 105 | IMLvalue.exp.INTSEL7 = INTsource;                                      
; 106 | break;                                                                 
; 108 | case 8 :                                                               
;----------------------------------------------------------------------
           LDBU    .D2T2   *+SP(14),B4       ; |105| 
           LDW     .D2T1   *+SP(8),A0        ; |105| 
           NOP             1
           B       .S1     L14               ; |105| 
           NOP             2

           EXTU    .S1     A0,27,27,A0       ; |105| 
||         CLR     .S2     B4,0,4,B4         ; |105| 

           OR      .S2X    A0,B4,B4          ; |105| 
           STB     .D2T2   B4,*+SP(14)       ; |105| 
           ; BRANCH OCCURS                   ; |105| 
;** --------------------------------------------------------------------------*
L5:    
	.line	59
;----------------------------------------------------------------------
; 109 | IMLvalue.exp.INTSEL8 = INTsource;                                      
; 110 | break;                                                                 
; 112 | case 9 :                                                               
;----------------------------------------------------------------------
           LDW     .D2T2   *+SP(8),B4        ; |109| 
           LDHU    .D2T1   *+SP(14),A0       ; |109| 
           NOP             1
           B       .S1     L14               ; |109| 
           NOP             1
           EXTU    .S2     B4,27,27,B4       ; |109| 

           SHL     .S2     B4,5,B4           ; |109| 
||         CLR     .S1     A0,5,9,A0         ; |109| 

           OR      .S2X    B4,A0,B4          ; |109| 
           STH     .D2T2   B4,*+SP(14)       ; |109| 
           ; BRANCH OCCURS                   ; |109| 
;** --------------------------------------------------------------------------*
L6:    
	.line	63
;----------------------------------------------------------------------
; 113 | IMLvalue.exp.INTSEL9 = INTsource;                                      
; 114 | break;                                                                 
; 116 | case 10 :                                                              
;----------------------------------------------------------------------
           LDW     .D2T2   *+SP(8),B4        ; |113| 
           LDBU    .D2T1   *+SP(15),A0       ; |113| 
           NOP             1
           B       .S1     L14               ; |113| 
           NOP             1
           EXTU    .S2     B4,27,27,B4       ; |113| 

           SHL     .S2     B4,2,B4           ; |113| 
||         CLR     .S1     A0,2,6,A0         ; |113| 

           OR      .S2X    B4,A0,B4          ; |113| 
           STB     .D2T2   B4,*+SP(15)       ; |113| 
           ; BRANCH OCCURS                   ; |113| 
;** --------------------------------------------------------------------------*
L7:    
	.line	67
;----------------------------------------------------------------------
; 117 | IMHvalue.exp.INTSEL10 = INTsource;                                     
; 118 | break;                                                                 
; 120 | case 11 :                                                              
;----------------------------------------------------------------------
           LDBU    .D2T2   *+SP(16),B4       ; |117| 
           LDW     .D2T1   *+SP(8),A0        ; |117| 
           NOP             1
           B       .S1     L14               ; |117| 
           NOP             2

           EXTU    .S1     A0,27,27,A0       ; |117| 
||         CLR     .S2     B4,0,4,B4         ; |117| 

           OR      .S2X    A0,B4,B4          ; |117| 
           STB     .D2T2   B4,*+SP(16)       ; |117| 
           ; BRANCH OCCURS                   ; |117| 
;** --------------------------------------------------------------------------*
L8:    
	.line	71
;----------------------------------------------------------------------
; 121 | IMHvalue.exp.INTSEL11 = INTsource;                                     
; 122 | break;                                                                 
; 124 | case 12 :                                                              
;----------------------------------------------------------------------
           LDW     .D2T2   *+SP(8),B4        ; |121| 
           LDHU    .D2T1   *+SP(16),A0       ; |121| 
           NOP             1
           B       .S1     L14               ; |121| 
           NOP             1
           EXTU    .S2     B4,27,27,B4       ; |121| 

           SHL     .S2     B4,5,B4           ; |121| 
||         CLR     .S1     A0,5,9,A0         ; |121| 

           OR      .S2X    B4,A0,B4          ; |121| 
           STH     .D2T2   B4,*+SP(16)       ; |121| 
           ; BRANCH OCCURS                   ; |121| 
;** --------------------------------------------------------------------------*
L9:    
	.line	75
;----------------------------------------------------------------------
; 125 | IMHvalue.exp.INTSEL12 = INTsource;                                     
; 126 | break;                                                                 
; 128 | case 13 :                                                              
;----------------------------------------------------------------------
           LDW     .D2T2   *+SP(8),B4        ; |125| 
           LDBU    .D2T1   *+SP(17),A0       ; |125| 
           NOP             1
           B       .S1     L14               ; |125| 
           NOP             1
           EXTU    .S2     B4,27,27,B4       ; |125| 

           SHL     .S2     B4,2,B4           ; |125| 
||         CLR     .S1     A0,2,6,A0         ; |125| 

           OR      .S2X    B4,A0,B4          ; |125| 
           STB     .D2T2   B4,*+SP(17)       ; |125| 
           ; BRANCH OCCURS                   ; |125| 
;** --------------------------------------------------------------------------*
L10:    
	.line	79
;----------------------------------------------------------------------
; 129 | IMHvalue.exp.INTSEL13 = INTsource;                                     
; 130 | break;                                                                 
; 132 | case 14 :                                                              
;----------------------------------------------------------------------
           LDBU    .D2T2   *+SP(18),B4       ; |129| 
           LDW     .D2T1   *+SP(8),A0        ; |129| 
           NOP             1
           B       .S1     L14               ; |129| 
           NOP             2

           EXTU    .S1     A0,27,27,A0       ; |129| 
||         CLR     .S2     B4,0,4,B4         ; |129| 

           OR      .S2X    A0,B4,B4          ; |129| 
           STB     .D2T2   B4,*+SP(18)       ; |129| 
           ; BRANCH OCCURS                   ; |129| 
;** --------------------------------------------------------------------------*
L11:    
	.line	83
;----------------------------------------------------------------------
; 133 | IMHvalue.exp.INTSEL14 = INTsource;                                     
; 134 | break;                                                                 
; 136 | case 15 :                                                              
;----------------------------------------------------------------------
           LDW     .D2T2   *+SP(8),B4        ; |133| 
           LDHU    .D2T1   *+SP(18),A0       ; |133| 
           NOP             1
           B       .S1     L14               ; |133| 
           NOP             1
           EXTU    .S2     B4,27,27,B4       ; |133| 

           SHL     .S2     B4,5,B4           ; |133| 
||         CLR     .S1     A0,5,9,A0         ; |133| 

           OR      .S2X    B4,A0,B4          ; |133| 
           STH     .D2T2   B4,*+SP(18)       ; |133| 
           ; BRANCH OCCURS                   ; |133| 
;** --------------------------------------------------------------------------*
L12:    
	.line	87
;----------------------------------------------------------------------
; 137 | IMHvalue.exp.INTSEL15 = INTsource;                                     
; 138 | break;                                                                 
; 140 | default : break;                                                       
;----------------------------------------------------------------------
           LDW     .D2T2   *+SP(8),B4        ; |137| 
           LDBU    .D2T1   *+SP(19),A0       ; |137| 
           NOP             1
           B       .S1     L14               ; |137| 
           NOP             1
           EXTU    .S2     B4,27,27,B4       ; |137| 

           SHL     .S2     B4,2,B4           ; |137| 
||         CLR     .S1     A0,2,6,A0         ; |137| 

           OR      .S2X    B4,A0,B4          ; |137| 
           STB     .D2T2   B4,*+SP(19)       ; |137| 
           ; BRANCH OCCURS                   ; |137| 
;** --------------------------------------------------------------------------*
L13:    
           SUB     .D1     A4,4,A3
           CMPGTU  .L1     A3,11,A1          ; |137| 
   [ A1]   B       .S1     L14               ; |137| 
           NOP             4
           MV      .D1     A4,A0
           ; BRANCH OCCURS                   ; |137| 
;** --------------------------------------------------------------------------*

           MVKL    .S2     SW1,B4            ; |137| 
||         SHL     .S1     A0,2,A0           ; |137| 

           MVKH    .S2     SW1,B4            ; |137| 
||         SUB     .D1     A0,16,A0          ; |137| 

           ADD     .S1X    B4,A0,A0          ; |137| 
           LDW     .D1T1   *A0,A0            ; |137| 
           NOP             4
           B       .S2X    A0                ; |137| 
           NOP             5
           ; BRANCH OCCURS                   ; |137| 

	.sect	".switch"
SW1:	.word	L1	; 4
	.word	L2	; 5
	.word	L3	; 6
	.word	L4	; 7
	.word	L5	; 8
	.word	L6	; 9
	.word	L7	; 10
	.word	L8	; 11
	.word	L9	; 12
	.word	L10	; 13
	.word	L11	; 14
	.word	L12	; 15
	.sect	".text"
;** --------------------------------------------------------------------------*
L14:    
	.line	93
;----------------------------------------------------------------------
; 143 | *(unsigned volatile int *)IML = IMLvalue.reg;                          
;----------------------------------------------------------------------
           LDW     .D2T1   *+SP(12),A0       ; |143| 
           MVKL    .S2     0x19c0004,B4      ; |143| 
           MVKH    .S2     0x19c0004,B4      ; |143| 
           NOP             2
           STW     .D2T1   A0,*B4            ; |143| 
           NOP             2
	.line	94
;----------------------------------------------------------------------
; 144 | *(unsigned volatile int *)IMH = IMHvalue.reg;                          
;----------------------------------------------------------------------
           LDW     .D2T2   *+SP(16),B4       ; |144| 
           ZERO    .D1     A0                ; |144| 
           MVKH    .S1     0x19c0000,A0      ; |144| 
           NOP             2
           STW     .D1T2   B4,*A0            ; |144| 
           NOP             2
	.line	96
;----------------------------------------------------------------------
; 146 | return;                                                                
;----------------------------------------------------------------------
	.line	97
           B       .S2     B3                ; |147| 
           ADDK    .S2     16,SP             ; |147| 
           NOP             4
           ; BRANCH OCCURS                   ; |147| 
	.endfunc	147,000000000h,16


	.sect	".text"
	.global	_mcbsp0_init
	.file	"c6xdskinit.c"
	.sym	_mcbsp0_init,_mcbsp0_init, 32, 2, 0
	.func	10
;----------------------------------------------------------------------
;  10 | void mcbsp0_init()                               //set up McBSP0       
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _mcbsp0_init                                                *
;*                                                                            *
;*   Regs Modified     : A0,B4,B5                                             *
;*   Regs Used         : A0,B3,B4,B5                                          *
;*   Local Frame Size  : 0 Args + 0 Auto + 0 Save = 0 byte                    *
;******************************************************************************
_mcbsp0_init:
;** --------------------------------------------------------------------------*
	.line	2
	.line	3
;----------------------------------------------------------------------
;  12 | *(unsigned volatile int *)McBSP0_SPCR = 0;      //reset serial port    
;----------------------------------------------------------------------
           MVKL    .S2     0x18c0008,B4      ; |12| 

           MVKH    .S2     0x18c0008,B4      ; |12| 
||         ZERO    .D1     A0                ; |12| 

           STW     .D2T1   A0,*B4            ; |12| 
           NOP             2
	.line	4
;----------------------------------------------------------------------
;  13 | *(unsigned volatile int *)McBSP0_PCR = 0;       //set pin control reg  
;----------------------------------------------------------------------
           MVKL    .S2     0x18c0024,B4      ; |13| 

           MVKH    .S2     0x18c0024,B4      ; |13| 
||         ZERO    .D2     B5                ; |13| 

           STW     .D2T2   B5,*B4            ; |13| 
           NOP             2
	.line	5
;----------------------------------------------------------------------
;  14 | *(unsigned volatile int *)McBSP0_RCR = 0x10040; //set rx control reg on
;     | e 16 bit data/frame                                                    
;----------------------------------------------------------------------

           MVKL    .S2     0x18c000c,B4      ; |14| 
||         MVKL    .S1     0x10040,A0        ; |14| 

           MVKH    .S2     0x18c000c,B4      ; |14| 
||         MVKH    .S1     0x10040,A0        ; |14| 

           STW     .D2T1   A0,*B4            ; |14| 
           NOP             2
	.line	6
;----------------------------------------------------------------------
;  15 | *(unsigned volatile int *)McBSP0_XCR = 0x10040; //set tx control reg on
;     | e 16 bit data/frame                                                    
;----------------------------------------------------------------------

           MVKL    .S2     0x18c0010,B4      ; |15| 
||         MVKL    .S1     0x10040,A0        ; |15| 

           MVKH    .S2     0x18c0010,B4      ; |15| 
||         MVKH    .S1     0x10040,A0        ; |15| 

           STW     .D2T1   A0,*B4            ; |15| 
           NOP             2
	.line	7
;----------------------------------------------------------------------
;  16 | *(unsigned volatile int *)McBSP0_DXR = 0;                              
;----------------------------------------------------------------------
           MVKL    .S2     0x18c0004,B4      ; |16| 
           MVKH    .S2     0x18c0004,B4      ; |16| 
           STW     .D2T2   B5,*B4            ; |16| 
           NOP             2
	.line	8
;----------------------------------------------------------------------
;  17 | *(unsigned volatile int *)McBSP0_SPCR = 0x12001;//setup SP control reg 
;----------------------------------------------------------------------

           MVKL    .S2     0x12001,B4        ; |17| 
||         MVKL    .S1     0x18c0008,A0      ; |17| 

           MVKH    .S2     0x12001,B4        ; |17| 
||         MVKH    .S1     0x18c0008,A0      ; |17| 

           STW     .D1T2   B4,*A0            ; |17| 
           NOP             2
	.line	9
           B       .S2     B3                ; |18| 
           NOP             5
           ; BRANCH OCCURS                   ; |18| 
	.endfunc	18,000000000h,0


	.sect	".text"
	.global	_mcbsp0_write
	.sym	_mcbsp0_write,_mcbsp0_write, 32, 2, 0
	.func	20
;----------------------------------------------------------------------
;  20 | void mcbsp0_write(int out_data)  //function for writing                
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _mcbsp0_write                                               *
;*                                                                            *
;*   Regs Modified     : A0,B0,B4,SP                                          *
;*   Regs Used         : A0,A4,B0,B3,B4,DP,SP                                 *
;*   Local Frame Size  : 0 Args + 8 Auto + 0 Save = 8 byte                    *
;******************************************************************************
_mcbsp0_write:
;** --------------------------------------------------------------------------*
	.line	2
	.sym	_out_data,4, 4, 17, 32
	.sym	_out_data,4, 4, 1, 32
	.sym	_temp,8, 4, 1, 32
           SUB     .D2     SP,8,SP           ; |21| 
;----------------------------------------------------------------------
;  22 | int temp;                                                              
;----------------------------------------------------------------------
           STW     .D2T1   A4,*+SP(4)        ; |21| 
           NOP             2
	.line	5
;----------------------------------------------------------------------
;  24 | if (polling)                    //bypass if interrupt-driven           
;----------------------------------------------------------------------
           LDB     .D2T2   *+DP(_polling),B0 ; |24| 
           NOP             4
   [!B0]   B       .S1     L16               ; |24| 
           NOP             5
           ; BRANCH OCCURS                   ; |24| 
;** --------------------------------------------------------------------------*
	.line	7
;----------------------------------------------------------------------
;  26 | temp = *(unsigned volatile int *)McBSP0_SPCR & 0x20000;                
;----------------------------------------------------------------------
           MVKL    .S1     0x18c0008,A0      ; |26| 
           MVKH    .S1     0x18c0008,A0      ; |26| 
           LDW     .D1T1   *A0,A0            ; |26| 
           ZERO    .D2     B4                ; |26| 
           MVKH    .S2     0x20000,B4        ; |26| 
           NOP             2
           AND     .S2X    B4,A0,B4          ; |26| 
           STW     .D2T2   B4,*+SP(8)        ; |26| 
           NOP             2
	.line	8
;----------------------------------------------------------------------
;  27 | while ( temp == 0)                                                     
;----------------------------------------------------------------------
           MV      .D2     B4,B0
   [ B0]   B       .S1     L16               ; |27| 
           NOP             5
           ; BRANCH OCCURS                   ; |27| 
;*----------------------------------------------------------------------------*
;*   SOFTWARE PIPELINE INFORMATION
;*      Disqualified loop: software pipelining disabled
;*----------------------------------------------------------------------------*
L15:    
	.line	9
;----------------------------------------------------------------------
;  28 | temp = *(unsigned volatile int *)McBSP0_SPCR & 0x20000;                
;----------------------------------------------------------------------
           MVKL    .S1     0x18c0008,A0      ; |28| 
           MVKH    .S1     0x18c0008,A0      ; |28| 
           LDW     .D1T1   *A0,A0            ; |28| 
           ZERO    .D2     B4                ; |28| 
           MVKH    .S2     0x20000,B4        ; |28| 
           NOP             2
           AND     .S2X    B4,A0,B4          ; |28| 
           MV      .D2     B4,B0             ; |28| 
   [!B0]   B       .S1     L15               ; |28| 
           STW     .D2T2   B4,*+SP(8)        ; |28| 
           NOP             4
           ; BRANCH OCCURS                   ; |28| 
;** --------------------------------------------------------------------------*
L16:    
	.line	11
;----------------------------------------------------------------------
;  30 | *(unsigned volatile int *)McBSP0_DXR = out_data;                       
;----------------------------------------------------------------------
           LDW     .D2T2   *+SP(4),B4        ; |30| 
           MVKL    .S1     0x18c0004,A0      ; |30| 
           MVKH    .S1     0x18c0004,A0      ; |30| 
           NOP             2
           STW     .D1T2   B4,*A0            ; |30| 
           NOP             2
	.line	12
           B       .S2     B3                ; |31| 
           ADD     .D2     8,SP,SP           ; |31| 
           NOP             4
           ; BRANCH OCCURS                   ; |31| 
	.endfunc	31,000000000h,8


	.sect	".text"
	.global	_mcbsp0_read
	.sym	_mcbsp0_read,_mcbsp0_read, 36, 2, 0
	.func	33
;----------------------------------------------------------------------
;  33 | int mcbsp0_read()                //function for reading                
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _mcbsp0_read                                                *
;*                                                                            *
;*   Regs Modified     : A0,A4,B0,SP                                          *
;*   Regs Used         : A0,A4,B0,B3,DP,SP                                    *
;*   Local Frame Size  : 0 Args + 4 Auto + 0 Save = 4 byte                    *
;******************************************************************************
_mcbsp0_read:
;** --------------------------------------------------------------------------*
	.line	2
;----------------------------------------------------------------------
;  35 | int temp;                                                              
;----------------------------------------------------------------------
	.sym	_temp,4, 4, 1, 32
           SUB     .D2     SP,8,SP           ; |34| 
	.line	5
;----------------------------------------------------------------------
;  37 | if (polling)                                                           
;----------------------------------------------------------------------
           LDB     .D2T2   *+DP(_polling),B0 ; |37| 
           NOP             4
   [!B0]   B       .S1     L18               ; |37| 
           NOP             5
           ; BRANCH OCCURS                   ; |37| 
;** --------------------------------------------------------------------------*
	.line	7
;----------------------------------------------------------------------
;  39 | temp = *(unsigned volatile int *)McBSP0_SPCR & 0x2;                    
;----------------------------------------------------------------------
           MVKL    .S1     0x18c0008,A0      ; |39| 
           MVKH    .S1     0x18c0008,A0      ; |39| 
           LDW     .D1T1   *A0,A0            ; |39| 
           NOP             4
           AND     .S1     2,A0,A0           ; |39| 
           STW     .D2T1   A0,*+SP(4)        ; |39| 
           NOP             2
	.line	8
;----------------------------------------------------------------------
;  40 | while ( temp == 0)                                                     
;----------------------------------------------------------------------
           MV      .S2X    A0,B0
   [ B0]   B       .S1     L18               ; |40| 
           NOP             5
           ; BRANCH OCCURS                   ; |40| 
;*----------------------------------------------------------------------------*
;*   SOFTWARE PIPELINE INFORMATION
;*      Disqualified loop: software pipelining disabled
;*----------------------------------------------------------------------------*
L17:    
	.line	9
;----------------------------------------------------------------------
;  41 | temp = *(unsigned volatile int *)McBSP0_SPCR & 0x2;                    
;----------------------------------------------------------------------
           MVKL    .S1     0x18c0008,A0      ; |41| 
           MVKH    .S1     0x18c0008,A0      ; |41| 
           LDW     .D1T1   *A0,A0            ; |41| 
           NOP             4
           AND     .S1     2,A0,A0           ; |41| 
           MV      .S2X    A0,B0             ; |41| 
   [!B0]   B       .S1     L17               ; |41| 
           STW     .D2T1   A0,*+SP(4)        ; |41| 
           NOP             4
           ; BRANCH OCCURS                   ; |41| 
;** --------------------------------------------------------------------------*
L18:    
	.line	11
;----------------------------------------------------------------------
;  43 | temp = *(unsigned volatile int *)McBSP0_DRR;                           
;----------------------------------------------------------------------
           ZERO    .D1     A0                ; |43| 
           MVKH    .S1     0x18c0000,A0      ; |43| 
           LDW     .D1T1   *A0,A0            ; |43| 
           NOP             4
           STW     .D2T1   A0,*+SP(4)        ; |43| 
           NOP             2
	.line	12
;----------------------------------------------------------------------
;  44 | return temp;                                                           
;----------------------------------------------------------------------
           MV      .D1     A0,A4
	.line	13
           B       .S2     B3                ; |45| 
           ADD     .D2     8,SP,SP           ; |45| 
           NOP             4
           ; BRANCH OCCURS                   ; |45| 
	.endfunc	45,000000000h,8


	.sect	".text"
	.global	_TLC320AD535_Init
	.sym	_TLC320AD535_Init,_TLC320AD535_Init, 32, 2, 0
	.func	47
;----------------------------------------------------------------------
;  47 | void TLC320AD535_Init()         //init AD535                           
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _TLC320AD535_Init                                           *
;*                                                                            *
;*   Regs Modified     : A0,A4,B0,B3,B4,SP                                    *
;*   Regs Used         : A0,A4,B0,B3,B4,SP                                    *
;*   Local Frame Size  : 0 Args + 0 Auto + 4 Save = 4 byte                    *
;******************************************************************************
_TLC320AD535_Init:
;** --------------------------------------------------------------------------*
	.line	2
           STW     .D2T2   B3,*SP--(8)       ; |48| 
           NOP             2
	.line	3
;----------------------------------------------------------------------
;  49 | mcbsp0_read();                //setting up AD535 Register 3            
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |49| 
           MVKL    .S2     RL0,B3            ; |49| 
           MVKH    .S2     RL0,B3            ; |49| 
           NOP             3
RL0:       ; CALL OCCURS                     ; |49| 
	.line	4
;----------------------------------------------------------------------
;  50 | mcbsp0_write(0);                                                       
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |50| 
           MVKL    .S2     RL2,B3            ; |50| 
           MVKH    .S2     RL2,B3            ; |50| 
           ZERO    .D1     A4                ; |50| 
           NOP             2
RL2:       ; CALL OCCURS                     ; |50| 
	.line	5
;----------------------------------------------------------------------
;  51 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |51| 
           MVKL    .S2     RL4,B3            ; |51| 
           MVKH    .S2     RL4,B3            ; |51| 
           NOP             3
RL4:       ; CALL OCCURS                     ; |51| 
	.line	6
;----------------------------------------------------------------------
;  52 | mcbsp0_write(0);                                                       
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |52| 
           MVKL    .S2     RL6,B3            ; |52| 
           MVKH    .S2     RL6,B3            ; |52| 
           ZERO    .D1     A4                ; |52| 
           NOP             2
RL6:       ; CALL OCCURS                     ; |52| 
	.line	7
;----------------------------------------------------------------------
;  53 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |53| 
           MVKL    .S2     RL8,B3            ; |53| 
           MVKH    .S2     RL8,B3            ; |53| 
           NOP             3
RL8:       ; CALL OCCURS                     ; |53| 
	.line	8
;----------------------------------------------------------------------
;  54 | mcbsp0_write(0);                                                       
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |54| 
           MVKL    .S2     RL10,B3           ; |54| 
           MVKH    .S2     RL10,B3           ; |54| 
           ZERO    .D1     A4                ; |54| 
           NOP             2
RL10:      ; CALL OCCURS                     ; |54| 
	.line	9
;----------------------------------------------------------------------
;  55 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |55| 
           MVKL    .S2     RL12,B3           ; |55| 
           MVKH    .S2     RL12,B3           ; |55| 
           NOP             3
RL12:      ; CALL OCCURS                     ; |55| 
	.line	10
;----------------------------------------------------------------------
;  56 | mcbsp0_write(1);              //send bit for Secondary Communications  
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |56| 
           MVKL    .S2     RL14,B3           ; |56| 
           MVKH    .S2     RL14,B3           ; |56| 
           MVK     .S1     0x1,A4            ; |56| 
           NOP             2
RL14:      ; CALL OCCURS                     ; |56| 
	.line	11
;----------------------------------------------------------------------
;  57 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |57| 
           MVKL    .S2     RL16,B3           ; |57| 
           MVKH    .S2     RL16,B3           ; |57| 
           NOP             3
RL16:      ; CALL OCCURS                     ; |57| 
	.line	12
;----------------------------------------------------------------------
;  58 | mcbsp0_write(0x0386);         //voice channel reset,pre-amps selected  
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |58| 
           MVKL    .S2     RL18,B3           ; |58| 
           MVK     .S1     0x386,A4          ; |58| 
           MVKH    .S2     RL18,B3           ; |58| 
           NOP             2
RL18:      ; CALL OCCURS                     ; |58| 
	.line	13
;----------------------------------------------------------------------
;  59 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |59| 
           MVKL    .S2     RL20,B3           ; |59| 
           MVKH    .S2     RL20,B3           ; |59| 
           NOP             3
RL20:      ; CALL OCCURS                     ; |59| 
;** --------------------------------------------------------------------------*
	.line	14
;----------------------------------------------------------------------
;  60 | mcbsp0_write(0);              //clear Secondary Communications         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |60| 
           MVKL    .S2     RL22,B3           ; |60| 
           MVKH    .S2     RL22,B3           ; |60| 
           ZERO    .D1     A4                ; |60| 
           NOP             2
RL22:      ; CALL OCCURS                     ; |60| 
	.line	15
;----------------------------------------------------------------------
;  61 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |61| 
           MVKL    .S2     RL24,B3           ; |61| 
           MVKH    .S2     RL24,B3           ; |61| 
           NOP             3
RL24:      ; CALL OCCURS                     ; |61| 
	.line	16
;----------------------------------------------------------------------
;  62 | mcbsp0_write(0);                                                       
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |62| 
           MVKL    .S2     RL26,B3           ; |62| 
           MVKH    .S2     RL26,B3           ; |62| 
           ZERO    .D1     A4                ; |62| 
           NOP             2
RL26:      ; CALL OCCURS                     ; |62| 
	.line	17
;----------------------------------------------------------------------
;  63 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |63| 
           MVKL    .S2     RL28,B3           ; |63| 
           MVKH    .S2     RL28,B3           ; |63| 
           NOP             3
RL28:      ; CALL OCCURS                     ; |63| 
	.line	18
;----------------------------------------------------------------------
;  64 | mcbsp0_write(0);                                                       
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |64| 
           MVKL    .S2     RL30,B3           ; |64| 
           MVKH    .S2     RL30,B3           ; |64| 
           ZERO    .D1     A4                ; |64| 
           NOP             2
RL30:      ; CALL OCCURS                     ; |64| 
	.line	19
;----------------------------------------------------------------------
;  65 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |65| 
           MVKL    .S2     RL32,B3           ; |65| 
           MVKH    .S2     RL32,B3           ; |65| 
           NOP             3
RL32:      ; CALL OCCURS                     ; |65| 
	.line	20
;----------------------------------------------------------------------
;  66 | mcbsp0_write(1);              //send bit for Secondary Communications  
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |66| 
           MVKL    .S2     RL34,B3           ; |66| 
           MVKH    .S2     RL34,B3           ; |66| 
           MVK     .S1     0x1,A4            ; |66| 
           NOP             2
RL34:      ; CALL OCCURS                     ; |66| 
	.line	21
;----------------------------------------------------------------------
;  67 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |67| 
           MVKL    .S2     RL36,B3           ; |67| 
           MVKH    .S2     RL36,B3           ; |67| 
           NOP             3
RL36:      ; CALL OCCURS                     ; |67| 
	.line	22
;----------------------------------------------------------------------
;  68 | mcbsp0_write(0x0306);         //voice channel clear reset,pre-amps sele
;     | cted                                                                   
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |68| 
           MVKL    .S2     RL38,B3           ; |68| 
           MVK     .S1     0x306,A4          ; |68| 
           MVKH    .S2     RL38,B3           ; |68| 
           NOP             2
RL38:      ; CALL OCCURS                     ; |68| 
	.line	23
;----------------------------------------------------------------------
;  69 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |69| 
           MVKL    .S2     RL40,B3           ; |69| 
           MVKH    .S2     RL40,B3           ; |69| 
           NOP             3
RL40:      ; CALL OCCURS                     ; |69| 
	.line	24
;----------------------------------------------------------------------
;  70 | mcbsp0_write(0);              //clear Secondary Communications         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |70| 
           MVKL    .S2     RL42,B3           ; |70| 
           MVKH    .S2     RL42,B3           ; |70| 
           ZERO    .D1     A4                ; |70| 
           NOP             2
RL42:      ; CALL OCCURS                     ; |70| 
;** --------------------------------------------------------------------------*
	.line	25
;----------------------------------------------------------------------
;  71 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |71| 
           MVKL    .S2     RL44,B3           ; |71| 
           MVKH    .S2     RL44,B3           ; |71| 
           NOP             3
RL44:      ; CALL OCCURS                     ; |71| 
	.line	27
;----------------------------------------------------------------------
;  73 | mcbsp0_write(0);              //setting up AD535 Register 4            
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |73| 
           MVKL    .S2     RL46,B3           ; |73| 
           MVKH    .S2     RL46,B3           ; |73| 
           ZERO    .D1     A4                ; |73| 
           NOP             2
RL46:      ; CALL OCCURS                     ; |73| 
	.line	28
;----------------------------------------------------------------------
;  74 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |74| 
           MVKL    .S2     RL48,B3           ; |74| 
           MVKH    .S2     RL48,B3           ; |74| 
           NOP             3
RL48:      ; CALL OCCURS                     ; |74| 
	.line	29
;----------------------------------------------------------------------
;  75 | mcbsp0_write(0);                                                       
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |75| 
           MVKL    .S2     RL50,B3           ; |75| 
           MVKH    .S2     RL50,B3           ; |75| 
           ZERO    .D1     A4                ; |75| 
           NOP             2
RL50:      ; CALL OCCURS                     ; |75| 
	.line	30
;----------------------------------------------------------------------
;  76 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |76| 
           MVKL    .S2     RL52,B3           ; |76| 
           MVKH    .S2     RL52,B3           ; |76| 
           NOP             3
RL52:      ; CALL OCCURS                     ; |76| 
	.line	31
;----------------------------------------------------------------------
;  77 | mcbsp0_write(1);                                                       
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |77| 
           MVKL    .S2     RL54,B3           ; |77| 
           MVKH    .S2     RL54,B3           ; |77| 
           MVK     .S1     0x1,A4            ; |77| 
           NOP             2
RL54:      ; CALL OCCURS                     ; |77| 
	.line	32
;----------------------------------------------------------------------
;  78 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |78| 
           MVKL    .S2     RL56,B3           ; |78| 
           MVKH    .S2     RL56,B3           ; |78| 
           NOP             3
RL56:      ; CALL OCCURS                     ; |78| 
	.line	33
;----------------------------------------------------------------------
;  79 | mcbsp0_write(0x0400);         //set microphone pre-amp gain to 20 dB   
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |79| 
           MVKL    .S2     RL58,B3           ; |79| 
           MVKH    .S2     RL58,B3           ; |79| 
           MVK     .S1     0x400,A4          ; |79| 
           NOP             2
RL58:      ; CALL OCCURS                     ; |79| 
	.line	34
;----------------------------------------------------------------------
;  80 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |80| 
           MVKL    .S2     RL60,B3           ; |80| 
           MVKH    .S2     RL60,B3           ; |80| 
           NOP             3
RL60:      ; CALL OCCURS                     ; |80| 
	.line	35
;----------------------------------------------------------------------
;  81 | mcbsp0_write(0);                                                       
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |81| 
           MVKL    .S2     RL62,B3           ; |81| 
           ZERO    .D1     A4                ; |81| 
           MVKH    .S2     RL62,B3           ; |81| 
           NOP             2
RL62:      ; CALL OCCURS                     ; |81| 
	.line	36
;----------------------------------------------------------------------
;  82 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |82| 
           MVKL    .S2     RL64,B3           ; |82| 
           MVKH    .S2     RL64,B3           ; |82| 
           NOP             3
RL64:      ; CALL OCCURS                     ; |82| 
;** --------------------------------------------------------------------------*
	.line	38
;----------------------------------------------------------------------
;  84 | mcbsp0_write(0);              //setting up AD535 Register 5            
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |84| 
           MVKL    .S2     RL66,B3           ; |84| 
           MVKH    .S2     RL66,B3           ; |84| 
           ZERO    .D1     A4                ; |84| 
           NOP             2
RL66:      ; CALL OCCURS                     ; |84| 
	.line	39
;----------------------------------------------------------------------
;  85 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |85| 
           MVKL    .S2     RL68,B3           ; |85| 
           MVKH    .S2     RL68,B3           ; |85| 
           NOP             3
RL68:      ; CALL OCCURS                     ; |85| 
	.line	40
;----------------------------------------------------------------------
;  86 | mcbsp0_write(0);                                                       
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |86| 
           MVKL    .S2     RL70,B3           ; |86| 
           MVKH    .S2     RL70,B3           ; |86| 
           ZERO    .D1     A4                ; |86| 
           NOP             2
RL70:      ; CALL OCCURS                     ; |86| 
	.line	41
;----------------------------------------------------------------------
;  87 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |87| 
           MVKL    .S2     RL72,B3           ; |87| 
           MVKH    .S2     RL72,B3           ; |87| 
           NOP             3
RL72:      ; CALL OCCURS                     ; |87| 
	.line	42
;----------------------------------------------------------------------
;  88 | mcbsp0_write(1);                                                       
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |88| 
           MVKL    .S2     RL74,B3           ; |88| 
           MVKH    .S2     RL74,B3           ; |88| 
           MVK     .S1     0x1,A4            ; |88| 
           NOP             2
RL74:      ; CALL OCCURS                     ; |88| 
	.line	43
;----------------------------------------------------------------------
;  89 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |89| 
           MVKL    .S2     RL76,B3           ; |89| 
           MVKH    .S2     RL76,B3           ; |89| 
           NOP             3
RL76:      ; CALL OCCURS                     ; |89| 
	.line	44
;----------------------------------------------------------------------
;  90 | mcbsp0_write(0x0502);         //DAC PGA = 0 dB                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |90| 
           MVKL    .S2     RL78,B3           ; |90| 
           MVKH    .S2     RL78,B3           ; |90| 
           MVK     .S1     0x502,A4          ; |90| 
           NOP             2
RL78:      ; CALL OCCURS                     ; |90| 
	.line	45
;----------------------------------------------------------------------
;  91 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |91| 
           MVKL    .S2     RL80,B3           ; |91| 
           MVKH    .S2     RL80,B3           ; |91| 
           NOP             3
RL80:      ; CALL OCCURS                     ; |91| 
	.line	46
;----------------------------------------------------------------------
;  92 | mcbsp0_write(0);                                                       
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |92| 
           MVKL    .S2     RL82,B3           ; |92| 
           ZERO    .D1     A4                ; |92| 
           MVKH    .S2     RL82,B3           ; |92| 
           NOP             2
RL82:      ; CALL OCCURS                     ; |92| 
	.line	47
;----------------------------------------------------------------------
;  93 | mcbsp0_read();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |93| 
           MVKL    .S2     RL84,B3           ; |93| 
           MVKH    .S2     RL84,B3           ; |93| 
           NOP             3
RL84:      ; CALL OCCURS                     ; |93| 
	.line	48
           LDW     .D2T2   *++SP(8),B3       ; |94| 
           NOP             4
           B       .S2     B3                ; |94| 
           NOP             5
           ; BRANCH OCCURS                   ; |94| 
	.endfunc	94,000080000h,8


	.sect	".text"
	.global	_c6x_dsk_init
	.sym	_c6x_dsk_init,_c6x_dsk_init, 32, 2, 0
	.func	96
;----------------------------------------------------------------------
;  96 | void c6x_dsk_init()                                  //dsp and peripher
;     | al init                                                                
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _c6x_dsk_init                                               *
;*                                                                            *
;*   Regs Modified     : A0,A4,B0,B3,B4,B5,SP                                 *
;*   Regs Used         : A0,A4,B0,B3,B4,B5,SP                                 *
;*   Local Frame Size  : 0 Args + 0 Auto + 4 Save = 4 byte                    *
;******************************************************************************
_c6x_dsk_init:
;** --------------------------------------------------------------------------*
	.line	2
           STW     .D2T2   B3,*SP--(8)       ; |97| 
           NOP             2
	.line	3
;----------------------------------------------------------------------
;  98 | CSR=0x100;                                          //disable all inter
;     | rupts                                                                  
;----------------------------------------------------------------------
           MVK     .S1     256,A0            ; |98| 
           MVC     .S2X    A0,CSR            ; |98| 
           NOP             1
	.line	4
;----------------------------------------------------------------------
;  99 | IER=1;                                              //disable interrupt
;     | s except NMI                                                           
;----------------------------------------------------------------------
           MVK     .S1     1,A0              ; |99| 
           MVC     .S2X    A0,IER            ; |99| 
           NOP             1
	.line	5
;----------------------------------------------------------------------
; 100 | ICR=0xffff;                                         //clear pending int
;     | errupts                                                                
;----------------------------------------------------------------------
           ZERO    .D1     A0                ; |100| 
           SET     .S1     A0,0x0,0xf,A0     ; |100| 
           MVC     .S2X    A0,ICR            ; |100| 
           NOP             1
	.line	6
;----------------------------------------------------------------------
; 101 | *(unsigned volatile int *)EMIF_GCR = 0x3300;        //EMIF global contr
;     | ol                                                                     
;----------------------------------------------------------------------
           ZERO    .D2     B4                ; |101| 

           MVK     .S1     13056,A0          ; |101| 
||         MVKH    .S2     0x1800000,B4      ; |101| 

           STW     .D2T1   A0,*B4            ; |101| 
           NOP             2
	.line	7
;----------------------------------------------------------------------
; 102 | *(unsigned volatile int *)EMIF_CE0 = 0x30;          //EMIF CE0 control
;     |                                                                        
;----------------------------------------------------------------------
           MVKL    .S2     0x1800008,B4      ; |102| 

           MVK     .S1     48,A0             ; |102| 
||         MVKH    .S2     0x1800008,B4      ; |102| 

           STW     .D2T1   A0,*B4            ; |102| 
           NOP             2
	.line	8
;----------------------------------------------------------------------
; 103 | *(unsigned volatile int *)EMIF_CE1 = 0xffffff03;    //EMIF CE1 control,
;     | 8bit async                                                             
;----------------------------------------------------------------------
           MVKL    .S2     0x1800004,B4      ; |103| 

           MVK     .S1     -253,A0           ; |103| 
||         MVKH    .S2     0x1800004,B4      ; |103| 

           STW     .D2T1   A0,*B4            ; |103| 
           NOP             2
	.line	9
;----------------------------------------------------------------------
; 104 | *(unsigned volatile int *)EMIF_SDCTRL = 0x07117000; //EMIF SDRAM contro
;     | l                                                                      
;----------------------------------------------------------------------

           MVKL    .S1     0x7117000,A0      ; |104| 
||         MVKL    .S2     0x1800018,B4      ; |104| 

           MVKH    .S1     0x7117000,A0      ; |104| 
||         MVKH    .S2     0x1800018,B4      ; |104| 

           STW     .D2T1   A0,*B4            ; |104| 
           NOP             2
	.line	10
;----------------------------------------------------------------------
; 105 | *(unsigned volatile int *)EMIF_SDRP = 0x61a;        //EMIF SDRM refresh
;     |  period                                                                
;----------------------------------------------------------------------
           MVKL    .S2     0x180001c,B4      ; |105| 

           MVK     .S1     1562,A0           ; |105| 
||         MVKH    .S2     0x180001c,B4      ; |105| 

           STW     .D2T1   A0,*B4            ; |105| 
           NOP             2
	.line	11
;----------------------------------------------------------------------
; 106 | *(unsigned volatile int *)EMIF_SDEXT = 0x54519;     //EMIF SDRAM extens
;     | ion                                                                    
;----------------------------------------------------------------------

           MVKL    .S1     0x1800020,A0      ; |106| 
||         MVKL    .S2     0x54519,B4        ; |106| 

           MVKH    .S1     0x1800020,A0      ; |106| 
||         MVKH    .S2     0x54519,B4        ; |106| 

           STW     .D1T2   B4,*A0            ; |106| 
           NOP             2
	.line	12
;----------------------------------------------------------------------
; 107 | mcbsp0_init();                                                         
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_init      ; |107| 
           MVKL    .S2     RL86,B3           ; |107| 
           MVKH    .S2     RL86,B3           ; |107| 
           NOP             3
RL86:      ; CALL OCCURS                     ; |107| 
	.line	13
;----------------------------------------------------------------------
; 108 | TLC320AD535_Init();                                                    
;----------------------------------------------------------------------
           B       .S1     _TLC320AD535_Init ; |108| 
           MVKL    .S2     RL88,B3           ; |108| 
           MVKH    .S2     RL88,B3           ; |108| 
           NOP             3
RL88:      ; CALL OCCURS                     ; |108| 
	.line	14
           LDW     .D2T2   *++SP(8),B3       ; |109| 
           NOP             4
           B       .S2     B3                ; |109| 
           NOP             5
           ; BRANCH OCCURS                   ; |109| 
	.endfunc	109,000080000h,8


	.sect	".text"
	.global	_comm_poll
	.sym	_comm_poll,_comm_poll, 32, 2, 0
	.func	111
;----------------------------------------------------------------------
; 111 | void comm_poll()                        //for communication/init using
;     | polling                                                                
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _comm_poll                                                  *
;*                                                                            *
;*   Regs Modified     : A0,A4,B0,B3,B4,B5,SP                                 *
;*   Regs Used         : A0,A4,B0,B3,B4,B5,DP,SP                              *
;*   Local Frame Size  : 0 Args + 0 Auto + 4 Save = 4 byte                    *
;******************************************************************************
_comm_poll:
;** --------------------------------------------------------------------------*
	.line	2
           STW     .D2T2   B3,*SP--(8)       ; |112| 
           NOP             2
	.line	3
;----------------------------------------------------------------------
; 113 | polling = 1;                         //if polling                      
;----------------------------------------------------------------------
           MVK     .S1     1,A0              ; |113| 
           STB     .D2T1   A0,*+DP(_polling) ; |113| 
           NOP             2
	.line	4
;----------------------------------------------------------------------
; 114 | c6x_dsk_init();                      //call init DSK function          
;----------------------------------------------------------------------
           B       .S1     _c6x_dsk_init     ; |114| 
           MVKL    .S2     RL90,B3           ; |114| 
           MVKH    .S2     RL90,B3           ; |114| 
           NOP             3
RL90:      ; CALL OCCURS                     ; |114| 
	.line	5
           LDW     .D2T2   *++SP(8),B3       ; |115| 
           NOP             4
           B       .S2     B3                ; |115| 
           NOP             5
           ; BRANCH OCCURS                   ; |115| 
	.endfunc	115,000080000h,8


	.sect	".text"
	.global	_comm_intr
	.sym	_comm_intr,_comm_intr, 32, 2, 0
	.func	117
;----------------------------------------------------------------------
; 117 | void comm_intr()                        //for communication/init using
;     | interrupt                                                              
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _comm_intr                                                  *
;*                                                                            *
;*   Regs Modified     : A0,A1,A3,A4,B0,B3,B4,B5,SP                           *
;*   Regs Used         : A0,A1,A3,A4,B0,B3,B4,B5,DP,SP                        *
;*   Local Frame Size  : 0 Args + 0 Auto + 4 Save = 4 byte                    *
;******************************************************************************
_comm_intr:
;** --------------------------------------------------------------------------*
	.line	2
           STW     .D2T2   B3,*SP--(8)       ; |118| 
           NOP             2
	.line	3
;----------------------------------------------------------------------
; 119 | polling = 0;                          //if interrupt-driven            
;----------------------------------------------------------------------
           ZERO    .D2     B4                ; |119| 
           STB     .D2T2   B4,*+DP(_polling) ; |119| 
           NOP             2
	.line	4
;----------------------------------------------------------------------
; 120 | c6x_dsk_init();                       //call init DSK function         
;----------------------------------------------------------------------
           B       .S1     _c6x_dsk_init     ; |120| 
           MVKL    .S2     RL92,B3           ; |120| 
           MVKH    .S2     RL92,B3           ; |120| 
           NOP             3
RL92:      ; CALL OCCURS                     ; |120| 
	.line	5
;----------------------------------------------------------------------
; 121 | config_Interrupt_Selector(11, XINT0); //using transmit interrupt INT11 
;----------------------------------------------------------------------
           B       .S1     _config_Interrupt_Selector ; |121| 
           MVKL    .S2     RL94,B3           ; |121| 
           MVK     .S2     0xc,B4            ; |121| 
           MVKH    .S2     RL94,B3           ; |121| 
           MVK     .S1     0xb,A4            ; |121| 
           NOP             1
RL94:      ; CALL OCCURS                     ; |121| 
	.line	6
;----------------------------------------------------------------------
; 122 | enableSpecificINT(11);                //for specific interrupt         
;----------------------------------------------------------------------
           B       .S1     _enableSpecificINT ; |122| 
           MVKL    .S2     RL96,B3           ; |122| 
           MVKH    .S2     RL96,B3           ; |122| 
           NOP             3
RL96:      ; CALL OCCURS                     ; |122| 
	.line	7
;----------------------------------------------------------------------
; 123 | enableNMI();                          //enable NMI                     
;----------------------------------------------------------------------
           B       .S1     _enableNMI        ; |123| 
           MVKL    .S2     RL98,B3           ; |123| 
           MVKH    .S2     RL98,B3           ; |123| 
           NOP             3
RL98:      ; CALL OCCURS                     ; |123| 
	.line	8
;----------------------------------------------------------------------
; 124 | enableGlobalINT();                    //enable GIE for global interrupt
;----------------------------------------------------------------------
           B       .S1     _enableGlobalINT  ; |124| 
           MVKL    .S2     RL100,B3          ; |124| 
           MVKH    .S2     RL100,B3          ; |124| 
           NOP             3
RL100:     ; CALL OCCURS                     ; |124| 
	.line	9
;----------------------------------------------------------------------
; 125 | mcbsp0_write(0);                      //write to SP0                   
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |125| 
           MVKL    .S2     RL102,B3          ; |125| 
           MVKH    .S2     RL102,B3          ; |125| 
           ZERO    .D1     A4                ; |125| 
           NOP             2
RL102:     ; CALL OCCURS                     ; |125| 
	.line	10
           LDW     .D2T2   *++SP(8),B3       ; |126| 
           NOP             4
           B       .S2     B3                ; |126| 
           NOP             5
           ; BRANCH OCCURS                   ; |126| 
	.endfunc	126,000080000h,8


	.sect	".text"
	.global	_output_sample
	.sym	_output_sample,_output_sample, 32, 2, 0
	.func	128
;----------------------------------------------------------------------
; 128 | void output_sample(int out_data)        //added for output             
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _output_sample                                              *
;*                                                                            *
;*   Regs Modified     : A0,A4,B0,B3,B4,SP                                    *
;*   Regs Used         : A0,A4,B0,B3,B4,SP                                    *
;*   Local Frame Size  : 0 Args + 4 Auto + 4 Save = 8 byte                    *
;******************************************************************************
_output_sample:
;** --------------------------------------------------------------------------*
	.line	2
	.sym	_out_data,4, 4, 17, 32
	.sym	_out_data,4, 4, 1, 32
           STW     .D2T2   B3,*SP--(8)       ; |129| 
           NOP             2
           STW     .D2T1   A4,*+SP(4)        ; |129| 
           NOP             2
	.line	3
;----------------------------------------------------------------------
; 130 | mcbsp0_write(out_data & 0xfffe);      //mask out LSB                   
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_write     ; |130| 
           ZERO    .D1     A0                ; |130| 
           SET     .S1     A0,0x1,0xf,A0     ; |130| 
           MVKL    .S2     RL104,B3          ; |130| 
           MV      .L2X    A4,B4

           AND     .S1X    A0,B4,A4          ; |130| 
||         MVKH    .S2     RL104,B3          ; |130| 

RL104:     ; CALL OCCURS                     ; |130| 
	.line	4
           LDW     .D2T2   *++SP(8),B3       ; |131| 
           NOP             4
           B       .S2     B3                ; |131| 
           NOP             5
           ; BRANCH OCCURS                   ; |131| 
	.endfunc	131,000080000h,8


	.sect	".text"
	.global	_input_sample
	.sym	_input_sample,_input_sample, 36, 2, 0
	.func	134
;----------------------------------------------------------------------
; 134 | int input_sample()                      //added for input              
;----------------------------------------------------------------------

;******************************************************************************
;* FUNCTION NAME: _input_sample                                               *
;*                                                                            *
;*   Regs Modified     : A0,A4,B0,B3,SP                                       *
;*   Regs Used         : A0,A4,B0,B3,SP                                       *
;*   Local Frame Size  : 0 Args + 0 Auto + 4 Save = 4 byte                    *
;******************************************************************************
_input_sample:
;** --------------------------------------------------------------------------*
	.line	2
           STW     .D2T2   B3,*SP--(8)       ; |135| 
           NOP             2
	.line	3
;----------------------------------------------------------------------
; 136 | return mcbsp0_read();                //read from McBSP0                
;----------------------------------------------------------------------
           B       .S1     _mcbsp0_read      ; |136| 
           MVKL    .S2     RL106,B3          ; |136| 
           MVKH    .S2     RL106,B3          ; |136| 
           NOP             3
RL106:     ; CALL OCCURS                     ; |136| 
	.line	4
           LDW     .D2T2   *++SP(8),B3       ; |137| 
           NOP             4
           B       .S2     B3                ; |137| 
           NOP             5
           ; BRANCH OCCURS                   ; |137| 
	.endfunc	137,000080000h,8


;******************************************************************************
;* MARK THE END OF THE SCALAR INIT RECORD IN CINIT:C                          *
;******************************************************************************
CIR:	.sect	".cinit:c"

;******************************************************************************
;* TYPE INFORMATION                                                           *
;******************************************************************************
	.stag	$$fake1, 32
	.member	_INTSEL4, 0, 14, 18, 5
	.member	_INTSEL5, 5, 14, 18, 5
	.member	_INTSEL6, 10, 14, 18, 5
	.member	_rsvbit15, 15, 14, 18, 1
	.member	_INTSEL7, 16, 14, 18, 5
	.member	_INTSEL8, 21, 14, 18, 5
	.member	_INTSEL9, 26, 14, 18, 5
	.member	_rsvbit31, 31, 14, 18, 1
	.eos
	.utag	$$fake0, 32
	.member	_exp, 0, 8, 11, 32, $$fake1
	.member	_reg, 0, 14, 11, 32
	.eos
	.stag	$$fake3, 32
	.member	_INTSEL10, 0, 14, 18, 5
	.member	_INTSEL11, 5, 14, 18, 5
	.member	_INTSEL12, 10, 14, 18, 5
	.member	_rsvbit15, 15, 14, 18, 1
	.member	_INTSEL13, 16, 14, 18, 5
	.member	_INTSEL14, 21, 14, 18, 5
	.member	_INTSEL15, 26, 14, 18, 5
	.member	_rsvbit31, 31, 14, 18, 1
	.eos
	.utag	$$fake2, 32
	.member	_reg, 0, 14, 11, 32
	.member	_exp, 0, 8, 11, 32, $$fake3
	.eos