/****************************************************************************************
*****************************************************************************************
Technická univerzita v Kosiciach
Fakulta elektrotechniky a informatiky
Katedra elektroniky a multimedialnych telekomunikacii

Tema diplomovej prace:    Implementacia zakladnych algoritmov cislicoveho spracovania
                          signalov pomocou procesorov Analog Devices ADSP218x a ADSP219x

Veduci diplomovej prace:  doc. Ing. Milos Drutarovsky, CSc.

*****************************************************************************************
Nazov suboru:             218x_int_tab.asm

Datum modifikacie:        29-04-2003

Autor:                    Peter Popadic

Verzia:                   1.00 pre ADSP2181, VisualDSP++ verzie 3


Opis:
Tabulky vektorov preruseni.
Zmenene obsluhy preruseni od SPORT0, volaju sa priamo obsluzne funkcie _next_cmd
a _new_sample.
*****************************************************************************************/

/* Example Interrupt table implementation */

#ifndef __ADSP218X__
#  define  __ADSP218X__
#endif

#include <signal.h>

.extern _stat_flag;
.extern _next_cmd;
.extern _new_sample;
.extern _irq1isr;
.extern   __lib_int_table;
.extern   __lib_int_determiner;
.extern   _____system_start;


.section/code   IVreset;
.global       ___reset;
___reset:
      JUMP  _____system_start;
      NOP; NOP; NOP;             // Pad to four instructions for lazy LDF's

.section/code IVpwrdwn;
.global ___pwrdwn, ___lib_pwdi_ctrl;
___lib_pwdi_ctrl:
___pwrdwn:
      DM(I4+=M7)=AX1;            // Save scratch DM dag
      AX1=SIGPWRDWN;
      JUMP __lib_int_determiner;
      NOP;                       // Pad to four instructions for lazy LDF's

.section/code IVirq2;
.global ___irq2, ___lib_int2_ctrl;
___lib_int2_ctrl:
___irq2:
      DM(I4+=M7)=AX1;            // Save scratch DM dag
      AX1=SIGIRQ2;
      JUMP __lib_int_determiner;
      NOP;                       // Pad to four instructions for lazy LDF's

.section/code IVirql1;
.global ___irql1, ___lib_intl1_ctrl;
___lib_intl1_ctrl:
___irql1:
      DM(I4+=M7)=AX1;            // Save scratch DM dag
      AX1=SIGIRQL1;
      JUMP __lib_int_determiner;
      NOP;                       // Pad to four instructions for lazy LDF's

.section/code IVirql0;
.global ___irql0, ___lib_intl0_ctrl;
___lib_intl0_ctrl:
___irql0:
      DM(I4+=M7)=AX1;            // Save scratch DM dag
      AX1=SIGIRQL0;
      JUMP __lib_int_determiner;
      NOP;                       // Pad to four instructions for lazy LDF's

/*** pp ***
.section/code IVsport0xmit;
.global ___sport0xmit;
___sport0xmit:
      DM(I4+=M7)=AX1;            // Save scratch DM dag
      AX1=SIGSPORT0XMIT;
      JUMP __lib_int_determiner;
      NOP;                       // Pad to four instructions for lazy LDF's
*** pp ***/

.section/code IVsport0xmit;
.global ___sport0xmit;
___sport0xmit:
      ay1 = dm(_stat_flag);             /*10: SPORT0 tx */
      af = pass ay1;
      if eq rti;
      jump _next_cmd;
/*** pp ***/


.section/code IVsport0recv;
.global ___sport0recv, ___lib_sp0x_ctrl;
___lib_sp0x_ctrl:
___sport0recv:
      jump _new_sample;
      rti;
      rti;
      rti;                       // Pad to four instructions for lazy LDF's

.section/code IVirqe;
.global ___irqe, ___lib_inte_ctrl;
___lib_inte_ctrl:
___irqe:
      DM(I4+=M7)=AX1;            // Save scratch DM dag
      AX1=SIGIRQE;
      JUMP __lib_int_determiner;
      NOP;                       // Pad to four instructions for lazy LDF's
      
.section/code IVbdma;
.global ___bdma, ___lib_bdma_ctrl;
___lib_bdma_ctrl:
___bdma:
      DM(I4+=M7)=AX1;            // Save scratch DM dag
      AX1=SIGBDMA;
      JUMP __lib_int_determiner;
      NOP;                       // Pad to four instructions for lazy LDF's

/*** pp ***
.section/code IVirq1;
.global ___irq1, ___lib_int1_ctrl;
___lib_int1_ctrl:
___irq1:
      DM(I4+=M7)=AX1;            // Save scratch DM dag
      AX1=SIGIRQ1;
      JUMP __lib_int_determiner;
      NOP;                       // Pad to four instructions for lazy LDF's
*** pp ***/
.section/code IVirq1;
.global ___irq1, ___lib_int1_ctrl;
___lib_int1_ctrl:
___irq1:
     jump _irq1isr;  // rti;
     rti;
     rti;
     rti;
/*** pp ***/
           
.section/code IVirq0;
.global ___irq0, ___lib_int0_ctrl;
___lib_int0_ctrl:
___irq0:
      DM(I4+=M7)=AX1;            // Save scratch DM dag
      AX1=SIGIRQ0;
      JUMP __lib_int_determiner;
      NOP;                       // Pad to four instructions for lazy LDF's


#ifdef __ADSP2189__
.section/code IVtimer89;
#else
.section/code IVtimer;
#endif
.global ___tmri, ___lib_tmri_ctrl;
___lib_tmri_ctrl:
___tmri:

#if defined(__EZKIT_LICENSE_RESTRICTION_21xx__) || defined(__ADSP2189__)
                                 // EZ-Kit monitor program reserves
                                 // the timer interrupt +1 and +2 locations.
                                 // Any user code placed here will be over-
                                 // written. The +3 location can be anything
                                 // as the monitors code at +2 executes an RTI.
                                 // To call a SIGTIMER handler, must call, not
                                 // JUMP. Not recommended because the interrupt
                                 // is likely to be saturated when used at
                                 // high baud rates.
#ifdef __ADSP2189__
                                 // operate as VisualDSP++ 2.0 code.
      .extern ___lib_ezkit_tmri_ctrl;
      CALL ___lib_ezkit_tmri_ctrl;
#else
      NOP;
#endif
      NOP; NOP;
      RTI;
#else
/*** pp ***
      DM(I4+=M7)=AX1;            // Save scratch DM dag
      AX1=SIGTIMER;
      JUMP __lib_int_determiner;
      NOP;                       // Pad to four instructions for lazy LDF's
*** pp ***/
      nop;                       // Pad to four instructions for lazy LDF's
      rti;
      rti;
      rti;
#endif

// end of file