Hot!Is it possible to relocate the interrupt vector table?

Author
niwnfyc
Starting Member
  • Total Posts : 49
  • Reward points : 0
  • Joined: 2007/07/15 17:47:54
  • Location: 0
  • Status: offline
2007/09/21 06:14:01 (permalink)
0

Is it possible to relocate the interrupt vector table?

I'm using the dsPIC33FJ256GP710 with the C30 compiler.


Is it possible to move the IVT to a different memory address? What I would like to do is setup a bootloader that uses memory locations 0x00000 to 0x04FFF, and then the main program uses ONLY address's 0x5000 and beyond.


That way when I load a new firmware from the bootloader, I only have to worry about overwriting address 0x5000 and beyond and not have to worry about the IVT at address 0x00004.


Is this possible? If so, can someone show what I should be changing in the .gld file?
#1

10 Replies Related Threads

    drazen
    Super Member
    • Total Posts : 2847
    • Reward points : 0
    • Joined: 2003/11/07 12:43:09
    • Location: Croatia
    • Status: offline
    RE: Is it possible to relocate the interrupt vector table? 2007/09/21 06:42:06 (permalink)
    0
    For bootloader you must use separate linker file where complete program is offseted by some value. Bootloader has placed jump instruction in every interrupt - reallocation of interrupt tables.

    Take a look at Microchip AppNotes about bootloaders.
    #2
    niwnfyc
    Starting Member
    • Total Posts : 49
    • Reward points : 0
    • Joined: 2007/07/15 17:47:54
    • Location: 0
    • Status: offline
    RE: Is it possible to relocate the interrupt vector table? 2007/09/21 06:56:15 (permalink)
    0
    My bootloader is a totally seperate MPLAB project. What I have been doing is compiling the hex file for the bootloader, and then importing it into my main program's project.

    I've looked at the dsPIC bootloader example they give (AN1094), but it doesn't show how to move the vector tables around at all.

    I've tried using the AIVT at address 0x00104 for the bootloader. Then for the main program, I used the regular IVT and changed the address of the IVT to 0x5000 in its .gld file. The interrupts did not work when I moved it to that location.

    Any suggestions?




    #3
    aschen0866
    Super Member
    • Total Posts : 4161
    • Reward points : 0
    • Joined: 2006/01/08 22:18:32
    • Location: San Diego
    • Status: offline
    RE: Is it possible to relocate the interrupt vector table? 2007/09/21 07:53:59 (permalink)
    +3 (3)
    ORIGINAL: niwnfyc
    ...
    Is it possible to move the IVT to a different memory address?

    No, you can't move both IVT and AIVT to different locations because they are governed by the chip's hardware. However, you can have them pointed to some fixed locations in the application code.
     
    I am using PIC24F and you are welcome to use these linker scripts as a starting point for your dsPIC application.
     
     
    post edited by aschen0866 - 2011/02/21 08:05:37
    #4
    niwnfyc
    Starting Member
    • Total Posts : 49
    • Reward points : 0
    • Joined: 2007/07/15 17:47:54
    • Location: 0
    • Status: offline
    RE: Is it possible to relocate the interrupt vector table? 2007/09/21 08:33:37 (permalink)
    0
    That was a big help. Thanks!


    So what you're doing is setting the bootloader to point the IVT to a later address in memory so that when you want to load new firmware, all you have to worry about is overwriting the memory after address 0xC00 where the new IVT starts?

    If thats correct, I suppose I could setup the bootloader to use the IVT and then point the AIVT to the main application's IVT later in memory. Then in the main application, I could just use the AIVT where the bootloader already set it to point to the new location.
    #5
    aschen0866
    Super Member
    • Total Posts : 4161
    • Reward points : 0
    • Joined: 2006/01/08 22:18:32
    • Location: San Diego
    • Status: offline
    RE: Is it possible to relocate the interrupt vector table? 2007/09/21 08:51:04 (permalink)
    0
    Yes, and make sure you add some code to your bootloader to prevent any write access to its own program memory area including the IVT and AIVT.
    #6
    xyrak
    Starting Member
    • Total Posts : 36
    • Reward points : 0
    • Joined: 2016/04/07 23:19:45
    • Location: 0
    • Status: offline
    Re: RE: Is it possible to relocate the interrupt vector table? 2017/04/12 03:09:24 (permalink)
    0
    Hello,
     
     Its too late but I am developing the bootloader and i want to modify GLD file for Bootloader program and application program can you explain it in more details.. how Interrupt vector tables works for bootloader and application code.
     
    XYRAK
    #7
    timijk
    Super Member
    • Total Posts : 1092
    • Reward points : 0
    • Joined: 2007/11/26 00:30:07
    • Location: Taiwan
    • Status: offline
    Re: RE: Is it possible to relocate the interrupt vector table? 2017/04/12 03:15:24 (permalink)
    +1 (1)
    You have to know how the interrupt vector tables work for a regular program first.  It's in the datasheet.  Then you can take a look at this application note about the bootloader.
     
    http://ww1.microchip.com/...en/AppNotes/01157a.pdf
    #8
    wysiwyg
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2010/07/27 09:25:10
    • Location: 0
    • Status: offline
    Re: RE: Is it possible to relocate the interrupt vector table? 2017/11/13 12:53:55 (permalink)
    0
    I'm working with a dsPIC30F6012A.  For the past entire week, I've been trying to use AN1094 as a base for my project.  So much for being as they say 'simple'.  I've been reading as much as I can stand and I'm just going to have to admit that I'm missing something.  I've read all of the usual corrections for AN1094 posted by helpful members and applied them.  I was able to load the host side C++ project into the latest Visual Studio and get it to work.  BTW, any users of virtual comm ports, to get the project to work with them, my solution was to add a couple of C++ lines concatenate the port name (i.e. COM10) with the string "\\\\.\\" so that it appears to the Windows API functions as "\\\\.\\COM10".
     
    I'd really like to get this working because I like that I have the host side C++ source.  It'll be easy to integrate it into my own new Visual Studio projects.  I know that I can improve upon the AN1094 source, both host and target side, once I get the core functionality working.
     
    Has anyone managed to get this bootloader (AN1094) to actually work with 6012A ?  Could I see your final .gld files?
     
    So far, I can use MPLab v8.91 to install the bootloader into my target PCB using ICD3 (ICSP).  The host side bootloader C++ program then has no problem downloading my target program via UART1 (which is short and simple, LED flasher and sends some text chars out UART2).
     
    After the download completes, the target program will not run and also the bootloader will no longer run.  If I use ICD3 to read back the chip, I can clearly see both the bootloader and the target app sitting in memory at the correct locations.  The reset address for the bootloader at 0x000 is correct and the reset address for the target app at 0x702 is also correct.  Resetting the board, the bootloader doesn't work.  If I use ICD3 to replace the reset destination at 0x000 with the taget app starting address of 0x702, the target app still won't run.  Programming the board with either the bootloader by itself or the target app by itself, the individual programs run okay.
     
    Both the bootloader and target apps use the some config fuse settings.  Neither program is presently using any interrupts.  The only thing that I can think of is that the IVT content change is the issue.  After installing the bootloader via ICSP, the IVT values are a certain value.  After bootloading the target app, the IVT registers all get changed to another value, apparently the same value that they are after installing the target app via ICSP.
     
    I've got over 40 hours invested in trying to get this thing to work and I think it's very close but I admit, I'm stuck, and I could really use some help.  More comments such as "go read the data sheet" or "bootloaders aren't that hard" will not be considered helpful.  I'm way past that.
     
    Btw, I'm compiling the target side bootloader using C30 v3.31.  My target application is compilied in XC16 v1.3.  I'm assuming that is doesn't matter that the two separate projects use different compilers so long as all of the code ends up in the right places.
     
    Please help me?  I'm desperate.
     
    Grrr, the system wouldn't allow me to upload my edited gld files, so apologies in advance here, I'll have to include them as text...
     
    BOOTLOADER GLD (C30 v3.31)

    /*
    ** Linker script for PIC30F6012A
    */

    OUTPUT_ARCH("30F6012A")
    CRT0_STARTUP(crt0_standard.o)
    CRT1_STARTUP(crt1_standard.o)

    OPTIONAL(-lp30F6012A)

    /*
    ** Memory Regions
    */
    MEMORY
    {
      data (a!xr) : ORIGIN = 0x800, LENGTH = 0x2000
      reset : ORIGIN = 0x0, LENGTH = 0x4
      ivt : ORIGIN = 0x4, LENGTH = 0x7C
      _reserved : ORIGIN = 0x80, LENGTH = 0x4
      aivt : ORIGIN = 0x84, LENGTH = 0x7C
    /* program (xr) : ORIGIN = 0x100, LENGTH = 0x17EFE */ /* original line */
      program (xr) : ORIGIN = 0x100, LENGTH = (0x700 - 0x100)
      eedata : ORIGIN = 0x7FF000, LENGTH = 0x1000
      FUID0 : ORIGIN = 0x8005C0, LENGTH = 0x2
      FUID1 : ORIGIN = 0x8005C2, LENGTH = 0x2
      FUID2 : ORIGIN = 0x8005C4, LENGTH = 0x2
      FUID3 : ORIGIN = 0x8005C6, LENGTH = 0x2
      FOSC : ORIGIN = 0xF80000, LENGTH = 0x2
      FWDT : ORIGIN = 0xF80002, LENGTH = 0x2
      FBORPOR : ORIGIN = 0xF80004, LENGTH = 0x2
      FBS : ORIGIN = 0xF80006, LENGTH = 0x2
      FSS : ORIGIN = 0xF80008, LENGTH = 0x2
      FGS : ORIGIN = 0xF8000A, LENGTH = 0x2
      FICD : ORIGIN = 0xF8000C, LENGTH = 0x2
    }

    __FUID0 = 0x8005C0;
    __FUID1 = 0x8005C2;
    __FUID2 = 0x8005C4;
    __FUID3 = 0x8005C6;
    __FOSC = 0xF80000;
    __FWDT = 0xF80002;
    __FBORPOR = 0xF80004;
    __FBS = 0xF80006;
    __FSS = 0xF80008;
    __FGS = 0xF8000A;
    __FICD = 0xF8000C;

    __IVT_BASE = 0x4;
    __AIVT_BASE = 0x84;
    __DATA_BASE = 0x800;
    __DATA_LENGTH = 0x2000;
    __YDATA_BASE = 0x1800;
    __CODE_BASE = 0x100;
    /* __CODE_LENGTH = 0x17F00; */ /* original line */
    __CODE_LENGTH = (0x700 - 0x100);

    /*
    ** ==================== Section Map ======================
    */
    SECTIONS
    {
      /*
      ** ========== Program Memory ==========
      */


      /*
      ** Reset Instruction
      */
      .reset :
      {
            SHORT(ABSOLUTE(__reset));
            SHORT(0x04);
            SHORT((ABSOLUTE(__reset) >> 16) & 0x7F);
            SHORT(0);
      } >reset


      /*
      ** Interrupt Vector Tables
      **
      ** The primary and alternate tables are loaded
      ** here, between sections .reset and .text.
      ** Vector table source code appears below.
      */


      /*
      ** User Code and Library Code
      **
      ** This section must not be assigned to __CODE_BASE,
      ** because CodeGuard(tm) sections may be located there.
      **
      ** Note that input sections *(.text) are not mapped here.
      ** The best-fit allocator locates them, so that .text
      ** may flow around PSV sections as needed.
      */
      .text :
      {
            *(.init);
            *(.user_init);
            KEEP (*(.handle));
            KEEP (*(.isr*));
            *(.libc) *(.libm) *(.libdsp); /* keep together in this order */
            *(.lib*);
            /*** *(.text); ***/ /* WJB: 2017-11-09: Added this line because I saw it in other examples. */
      } >program


      /*
      ** User-Defined Section in Program Memory
      **
      ** note: can specify an address using
      ** the following syntax:
      **
      ** usercode 0x1234 :
      ** {
      ** *(usercode);
      ** } >program
      */
      usercode :
      {
            *(usercode);
      } >program


      /*
      ** User-Defined Constants in Program Memory
      **
      ** For PSV type sections, the Load Memory Address (LMA)
      ** should be specified as follows:
      **
      ** userconst : AT(0x1234)
      ** {
      ** *(userconst);
      ** } >program
      **
      ** Note that mapping PSV sections in linker scripts
      ** is not generally recommended.
      **
      ** Because of page alignment restrictions, memory is
      ** often used more efficiently when PSV sections
      ** do not appear in the linker script.
      **
      ** For more information on memory allocation,
      ** please refer to chapter 10, 'Linker Processing'
      ** in the Assembler, Linker manual (DS51317).
      */


      /*
      ** Configuration Words
      */
      __FUID0 :
      { KEEP (*(__FUID0.sec*)) } >FUID0
      __FUID1 :
      { KEEP (*(__FUID1.sec*)) } >FUID1
      __FUID2 :
      { KEEP (*(__FUID2.sec*)) } >FUID2
      __FUID3 :
      { KEEP (*(__FUID3.sec*)) } >FUID3
      __FOSC :
      { KEEP (*(__FOSC.sec*)) } >FOSC
      __FWDT :
      { KEEP (*(__FWDT.sec*)) } >FWDT
      __FBORPOR :
      { KEEP (*(__FBORPOR.sec*)) } >FBORPOR
      __FBS :
      { KEEP (*(__FBS.sec*)) } >FBS
      __FSS :
      { KEEP (*(__FSS.sec*)) } >FSS
      __FGS :
      { KEEP (*(__FGS.sec*)) } >FGS
      __FICD :
      { KEEP (*(__FICD.sec*)) } >FICD


      
      /*
      ** User-Defined Section in Data Flash Memory
      **
      ** note: can specify an address using
      ** the following syntax:
      **
      ** user_eedata 0x7FF000 :
      ** {
      ** *(user_eedata);
      ** } >eedata
      */
      user_eedata :
      {
            *(user_eedata);
      } >eedata


      /*
      ** =========== Data Memory ===========
      */


      /*
      ** ICD Debug Exec
      **
      ** This section provides optional storage for
      ** the ICD2 debugger. Define a global symbol
      ** named __ICD2RAM to enable ICD2. This section
      ** must be loaded at data address 0x800.
      */
      .icd __DATA_BASE (NOLOAD):
      {
        . += (DEFINED (__ICD2RAM) ? 0x50 : 0 );
      } > data


      /*
      ** User-Defined Section in Data Memory
      **
      ** note: can specify an address using
      ** the following syntax:
      **
      ** userdata 0x1234 :
      ** {
      ** *(userdata);
      ** } >data
      */
      userdata :
      {
            *(userdata);
      } >data


      /*
      ** Other sections in data memory are not explicitly mapped.
      ** Instead they are allocated according to their section
      ** attributes, which is most efficient.
      **
      ** If a specific arrangement of sections is required
      ** (other than what can be achieved using attributes)
      ** additional sections may be defined here. See chapter
      ** 10.5 in the MPLAB ASM30/LINK30 User's Guide (DS51317)
      ** for more information.
      */


      /*
      ** ========== Debug Info ==============
      */

      .comment 0 : { *(.comment) }

      /*
      ** DWARF-2
      */
      .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
      .debug_abbrev 0 : { *(.debug_abbrev) }
      .debug_line 0 : { *(.debug_line) }
      .debug_frame 0 : { *(.debug_frame) }
      .debug_str 0 : { *(.debug_str) }
      .debug_loc 0 : { *(.debug_loc) }
      .debug_macinfo 0 : { *(.debug_macinfo) }
      .debug_pubnames 0 : { *(.debug_pubnames) }
      .debug_ranges 0 : { *(.debug_ranges) }
      .debug_aranges 0 : { *(.debug_aranges) }

    } /* SECTIONS */

    /*
    ** ================= End of Section Map ================
    */

    /*
    ** Section Map for Interrupt Vector Tables
    */
    SECTIONS
    {

    /*
    ** Interrupt Vector Table
    */
    .ivt __IVT_BASE :
      {
        LONG( DEFINED(__ReservedTrap0) ? ABSOLUTE(__ReservedTrap0) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OscillatorFail) ? ABSOLUTE(__OscillatorFail) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__AddressError) ? ABSOLUTE(__AddressError) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__StackError) ? ABSOLUTE(__StackError) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__MathError) ? ABSOLUTE(__MathError) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__ReservedTrap5) ? ABSOLUTE(__ReservedTrap5) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__ReservedTrap6) ? ABSOLUTE(__ReservedTrap6) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__ReservedTrap7) ? ABSOLUTE(__ReservedTrap7) :
             ABSOLUTE(__DefaultInterrupt));

        LONG( DEFINED(__INT0Interrupt) ? ABSOLUTE(__INT0Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC1Interrupt) ? ABSOLUTE(__IC1Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC1Interrupt) ? ABSOLUTE(__OC1Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__T1Interrupt) ? ABSOLUTE(__T1Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC2Interrupt) ? ABSOLUTE(__IC2Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC2Interrupt) ? ABSOLUTE(__OC2Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__T2Interrupt) ? ABSOLUTE(__T2Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__T3Interrupt) ? ABSOLUTE(__T3Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__SPI1Interrupt) ? ABSOLUTE(__SPI1Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__U1RXInterrupt) ? ABSOLUTE(__U1RXInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__U1TXInterrupt) ? ABSOLUTE(__U1TXInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__ADCInterrupt) ? ABSOLUTE(__ADCInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__NVMInterrupt) ? ABSOLUTE(__NVMInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__SI2CInterrupt) ? ABSOLUTE(__SI2CInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__MI2CInterrupt) ? ABSOLUTE(__MI2CInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__CNInterrupt) ? ABSOLUTE(__CNInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__INT1Interrupt) ? ABSOLUTE(__INT1Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC7Interrupt) ? ABSOLUTE(__IC7Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC8Interrupt) ? ABSOLUTE(__IC8Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC3Interrupt) ? ABSOLUTE(__OC3Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC4Interrupt) ? ABSOLUTE(__OC4Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__T4Interrupt) ? ABSOLUTE(__T4Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__T5Interrupt) ? ABSOLUTE(__T5Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__INT2Interrupt) ? ABSOLUTE(__INT2Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__U2RXInterrupt) ? ABSOLUTE(__U2RXInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__U2TXInterrupt) ? ABSOLUTE(__U2TXInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__SPI2Interrupt) ? ABSOLUTE(__SPI2Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__C1Interrupt) ? ABSOLUTE(__C1Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC3Interrupt) ? ABSOLUTE(__IC3Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC4Interrupt) ? ABSOLUTE(__IC4Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC5Interrupt) ? ABSOLUTE(__IC5Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC6Interrupt) ? ABSOLUTE(__IC6Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC5Interrupt) ? ABSOLUTE(__OC5Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC6Interrupt) ? ABSOLUTE(__OC6Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC7Interrupt) ? ABSOLUTE(__OC7Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC8Interrupt) ? ABSOLUTE(__OC8Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__INT3Interrupt) ? ABSOLUTE(__INT3Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__INT4Interrupt) ? ABSOLUTE(__INT4Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__C2Interrupt) ? ABSOLUTE(__C2Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__PWMInterrupt) ? ABSOLUTE(__PWMInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__QEIInterrupt) ? ABSOLUTE(__QEIInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__DCIInterrupt) ? ABSOLUTE(__DCIInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__LVDInterrupt) ? ABSOLUTE(__LVDInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__FLTAInterrupt) ? ABSOLUTE(__FLTAInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__FLTBInterrupt) ? ABSOLUTE(__FLTBInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt45) ? ABSOLUTE(__Interrupt45) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt46) ? ABSOLUTE(__Interrupt46) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt47) ? ABSOLUTE(__Interrupt47) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt48) ? ABSOLUTE(__Interrupt48) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt49) ? ABSOLUTE(__Interrupt49) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt50) ? ABSOLUTE(__Interrupt50) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt51) ? ABSOLUTE(__Interrupt51) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt52) ? ABSOLUTE(__Interrupt52) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt53) ? ABSOLUTE(__Interrupt53) :
             ABSOLUTE(__DefaultInterrupt));
      } >ivt


    /*
    ** Alternate Interrupt Vector Table
    */
    .aivt __AIVT_BASE :
      {
        LONG( DEFINED(__AltReservedTrap0) ? ABSOLUTE(__AltReservedTrap0) :
             (DEFINED(__ReservedTrap0) ? ABSOLUTE(__ReservedTrap0) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOscillatorFail) ? ABSOLUTE(__AltOscillatorFail) :
             (DEFINED(__OscillatorFail) ? ABSOLUTE(__OscillatorFail) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltAddressError) ? ABSOLUTE(__AltAddressError) :
             (DEFINED(__AddressError) ? ABSOLUTE(__AddressError) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltStackError) ? ABSOLUTE(__AltStackError) :
             (DEFINED(__StackError) ? ABSOLUTE(__StackError) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltMathError) ? ABSOLUTE(__AltMathError) :
             (DEFINED(__MathError) ? ABSOLUTE(__MathError) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltReservedTrap5) ? ABSOLUTE(__AltReservedTrap5) :
             (DEFINED(__ReservedTrap5) ? ABSOLUTE(__ReservedTrap5) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltReservedTrap6) ? ABSOLUTE(__AltReservedTrap6) :
             (DEFINED(__ReservedTrap6) ? ABSOLUTE(__ReservedTrap6) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltReservedTrap7) ? ABSOLUTE(__AltReservedTrap7) :
             (DEFINED(__ReservedTrap7) ? ABSOLUTE(__ReservedTrap7) :
             ABSOLUTE(__DefaultInterrupt)));

        LONG( DEFINED(__AltINT0Interrupt) ? ABSOLUTE(__AltINT0Interrupt) :
             (DEFINED(__INT0Interrupt) ? ABSOLUTE(__INT0Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC1Interrupt) ? ABSOLUTE(__AltIC1Interrupt) :
             (DEFINED(__IC1Interrupt) ? ABSOLUTE(__IC1Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC1Interrupt) ? ABSOLUTE(__AltOC1Interrupt) :
             (DEFINED(__OC1Interrupt) ? ABSOLUTE(__OC1Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltT1Interrupt) ? ABSOLUTE(__AltT1Interrupt) :
             (DEFINED(__T1Interrupt) ? ABSOLUTE(__T1Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC2Interrupt) ? ABSOLUTE(__AltIC2Interrupt) :
             (DEFINED(__IC2Interrupt) ? ABSOLUTE(__IC2Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC2Interrupt) ? ABSOLUTE(__AltOC2Interrupt) :
             (DEFINED(__OC2Interrupt) ? ABSOLUTE(__OC2Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltT2Interrupt) ? ABSOLUTE(__AltT2Interrupt) :
             (DEFINED(__T2Interrupt) ? ABSOLUTE(__T2Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltT3Interrupt) ? ABSOLUTE(__AltT3Interrupt) :
             (DEFINED(__T3Interrupt) ? ABSOLUTE(__T3Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltSPI1Interrupt) ? ABSOLUTE(__AltSPI1Interrupt) :
             (DEFINED(__SPI1Interrupt) ? ABSOLUTE(__SPI1Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltU1RXInterrupt) ? ABSOLUTE(__AltU1RXInterrupt) :
             (DEFINED(__U1RXInterrupt) ? ABSOLUTE(__U1RXInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltU1TXInterrupt) ? ABSOLUTE(__AltU1TXInterrupt) :
             (DEFINED(__U1TXInterrupt) ? ABSOLUTE(__U1TXInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltADCInterrupt) ? ABSOLUTE(__AltADCInterrupt) :
             (DEFINED(__ADCInterrupt) ? ABSOLUTE(__ADCInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltNVMInterrupt) ? ABSOLUTE(__AltNVMInterrupt) :
             (DEFINED(__NVMInterrupt) ? ABSOLUTE(__NVMInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltSI2CInterrupt) ? ABSOLUTE(__AltSI2CInterrupt) :
             (DEFINED(__SI2CInterrupt) ? ABSOLUTE(__SI2CInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltMI2CInterrupt) ? ABSOLUTE(__AltMI2CInterrupt) :
             (DEFINED(__MI2CInterrupt) ? ABSOLUTE(__MI2CInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltCNInterrupt) ? ABSOLUTE(__AltCNInterrupt) :
             (DEFINED(__CNInterrupt) ? ABSOLUTE(__CNInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltINT1Interrupt) ? ABSOLUTE(__AltINT1Interrupt) :
             (DEFINED(__INT1Interrupt) ? ABSOLUTE(__INT1Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC7Interrupt) ? ABSOLUTE(__AltIC7Interrupt) :
             (DEFINED(__IC7Interrupt) ? ABSOLUTE(__IC7Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC8Interrupt) ? ABSOLUTE(__AltIC8Interrupt) :
             (DEFINED(__IC8Interrupt) ? ABSOLUTE(__IC8Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC3Interrupt) ? ABSOLUTE(__AltOC3Interrupt) :
             (DEFINED(__OC3Interrupt) ? ABSOLUTE(__OC3Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC4Interrupt) ? ABSOLUTE(__AltOC4Interrupt) :
             (DEFINED(__OC4Interrupt) ? ABSOLUTE(__OC4Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltT4Interrupt) ? ABSOLUTE(__AltT4Interrupt) :
             (DEFINED(__T4Interrupt) ? ABSOLUTE(__T4Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltT5Interrupt) ? ABSOLUTE(__AltT5Interrupt) :
             (DEFINED(__T5Interrupt) ? ABSOLUTE(__T5Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltINT2Interrupt) ? ABSOLUTE(__AltINT2Interrupt) :
             (DEFINED(__INT2Interrupt) ? ABSOLUTE(__INT2Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltU2RXInterrupt) ? ABSOLUTE(__AltU2RXInterrupt) :
             (DEFINED(__U2RXInterrupt) ? ABSOLUTE(__U2RXInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltU2TXInterrupt) ? ABSOLUTE(__AltU2TXInterrupt) :
             (DEFINED(__U2TXInterrupt) ? ABSOLUTE(__U2TXInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltSPI2Interrupt) ? ABSOLUTE(__AltSPI2Interrupt) :
             (DEFINED(__SPI2Interrupt) ? ABSOLUTE(__SPI2Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltC1Interrupt) ? ABSOLUTE(__AltC1Interrupt) :
             (DEFINED(__C1Interrupt) ? ABSOLUTE(__C1Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC3Interrupt) ? ABSOLUTE(__AltIC3Interrupt) :
             (DEFINED(__IC3Interrupt) ? ABSOLUTE(__IC3Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC4Interrupt) ? ABSOLUTE(__AltIC4Interrupt) :
             (DEFINED(__IC4Interrupt) ? ABSOLUTE(__IC4Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC5Interrupt) ? ABSOLUTE(__AltIC5Interrupt) :
             (DEFINED(__IC5Interrupt) ? ABSOLUTE(__IC5Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC6Interrupt) ? ABSOLUTE(__AltIC6Interrupt) :
             (DEFINED(__IC6Interrupt) ? ABSOLUTE(__IC6Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC5Interrupt) ? ABSOLUTE(__AltOC5Interrupt) :
             (DEFINED(__OC5Interrupt) ? ABSOLUTE(__OC5Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC6Interrupt) ? ABSOLUTE(__AltOC6Interrupt) :
             (DEFINED(__OC6Interrupt) ? ABSOLUTE(__OC6Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC7Interrupt) ? ABSOLUTE(__AltOC7Interrupt) :
             (DEFINED(__OC7Interrupt) ? ABSOLUTE(__OC7Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC8Interrupt) ? ABSOLUTE(__AltOC8Interrupt) :
             (DEFINED(__OC8Interrupt) ? ABSOLUTE(__OC8Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltINT3Interrupt) ? ABSOLUTE(__AltINT3Interrupt) :
             (DEFINED(__INT3Interrupt) ? ABSOLUTE(__INT3Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltINT4Interrupt) ? ABSOLUTE(__AltINT4Interrupt) :
             (DEFINED(__INT4Interrupt) ? ABSOLUTE(__INT4Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltC2Interrupt) ? ABSOLUTE(__AltC2Interrupt) :
             (DEFINED(__C2Interrupt) ? ABSOLUTE(__C2Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltPWMInterrupt) ? ABSOLUTE(__AltPWMInterrupt) :
             (DEFINED(__PWMInterrupt) ? ABSOLUTE(__PWMInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltQEIInterrupt) ? ABSOLUTE(__AltQEIInterrupt) :
             (DEFINED(__QEIInterrupt) ? ABSOLUTE(__QEIInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltDCIInterrupt) ? ABSOLUTE(__AltDCIInterrupt) :
             (DEFINED(__DCIInterrupt) ? ABSOLUTE(__DCIInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltLVDInterrupt) ? ABSOLUTE(__AltLVDInterrupt) :
             (DEFINED(__LVDInterrupt) ? ABSOLUTE(__LVDInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltFLTAInterrupt) ? ABSOLUTE(__AltFLTAInterrupt) :
             (DEFINED(__FLTAInterrupt) ? ABSOLUTE(__FLTAInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltFLTBInterrupt) ? ABSOLUTE(__AltFLTBInterrupt) :
             (DEFINED(__FLTBInterrupt) ? ABSOLUTE(__FLTBInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt45) ? ABSOLUTE(__AltInterrupt45) :
             (DEFINED(__Interrupt45) ? ABSOLUTE(__Interrupt45) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt46) ? ABSOLUTE(__AltInterrupt46) :
             (DEFINED(__Interrupt46) ? ABSOLUTE(__Interrupt46) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt47) ? ABSOLUTE(__AltInterrupt47) :
             (DEFINED(__Interrupt47) ? ABSOLUTE(__Interrupt47) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt48) ? ABSOLUTE(__AltInterrupt48) :
             (DEFINED(__Interrupt48) ? ABSOLUTE(__Interrupt48) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt49) ? ABSOLUTE(__AltInterrupt49) :
             (DEFINED(__Interrupt49) ? ABSOLUTE(__Interrupt49) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt50) ? ABSOLUTE(__AltInterrupt50) :
             (DEFINED(__Interrupt50) ? ABSOLUTE(__Interrupt50) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt51) ? ABSOLUTE(__AltInterrupt51) :
             (DEFINED(__Interrupt51) ? ABSOLUTE(__Interrupt51) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt52) ? ABSOLUTE(__AltInterrupt52) :
             (DEFINED(__Interrupt52) ? ABSOLUTE(__Interrupt52) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt53) ? ABSOLUTE(__AltInterrupt53) :
             (DEFINED(__Interrupt53) ? ABSOLUTE(__Interrupt53) :
             ABSOLUTE(__DefaultInterrupt)));
      } >aivt
    } /* SECTIONS */


    /*
    ** ============== Equates for SFR Addresses =============
    */

     WREG0 = 0x0;
    _WREG0 = 0x0;
     WREG1 = 0x2;
    _WREG1 = 0x2;
     WREG2 = 0x4;
    _WREG2 = 0x4;
     WREG3 = 0x6;
    _WREG3 = 0x6;
     WREG4 = 0x8;
    _WREG4 = 0x8;
     WREG5 = 0xA;
    _WREG5 = 0xA;
     WREG6 = 0xC;
    _WREG6 = 0xC;
     WREG7 = 0xE;
    _WREG7 = 0xE;
     WREG8 = 0x10;
    _WREG8 = 0x10;
     WREG9 = 0x12;
    _WREG9 = 0x12;
     WREG10 = 0x14;
    _WREG10 = 0x14;
     WREG11 = 0x16;
    _WREG11 = 0x16;
     WREG12 = 0x18;
    _WREG12 = 0x18;
     WREG13 = 0x1A;
    _WREG13 = 0x1A;
     WREG14 = 0x1C;
    _WREG14 = 0x1C;
     WREG15 = 0x1E;
    _WREG15 = 0x1E;
     SPLIM = 0x20;
    _SPLIM = 0x20;
     ACCAL = 0x22;
    _ACCAL = 0x22;
     ACCAH = 0x24;
    _ACCAH = 0x24;
     ACCAU = 0x26;
    _ACCAU = 0x26;
     ACCBL = 0x28;
    _ACCBL = 0x28;
     ACCBH = 0x2A;
    _ACCBH = 0x2A;
     ACCBU = 0x2C;
    _ACCBU = 0x2C;
     PCL = 0x2E;
    _PCL = 0x2E;
     PCH = 0x30;
    _PCH = 0x30;
     TBLPAG = 0x32;
    _TBLPAG = 0x32;
     PSVPAG = 0x34;
    _PSVPAG = 0x34;
     RCOUNT = 0x36;
    _RCOUNT = 0x36;
     DCOUNT = 0x38;
    _DCOUNT = 0x38;
     DOSTARTL = 0x3A;
    _DOSTARTL = 0x3A;
     DOSTARTH = 0x3C;
    _DOSTARTH = 0x3C;
     DOENDL = 0x3E;
    _DOENDL = 0x3E;
     DOENDH = 0x40;
    _DOENDH = 0x40;
     SR = 0x42;
    _SR = 0x42;
    _SRbits = 0x42;
     CORCON = 0x44;
    _CORCON = 0x44;
    _CORCONbits = 0x44;
     MODCON = 0x46;
    _MODCON = 0x46;
    _MODCONbits = 0x46;
     XMODSRT = 0x48;
    _XMODSRT = 0x48;
     XMODEND = 0x4A;
    _XMODEND = 0x4A;
     YMODSRT = 0x4C;
    _YMODSRT = 0x4C;
     YMODEND = 0x4E;
    _YMODEND = 0x4E;
     XBREV = 0x50;
    _XBREV = 0x50;
    _XBREVbits = 0x50;
     DISICNT = 0x52;
    _DISICNT = 0x52;
    _DISICNTbits = 0x52;
     INTCON1 = 0x80;
    _INTCON1 = 0x80;
    _INTCON1bits = 0x80;
     INTCON2 = 0x82;
    _INTCON2 = 0x82;
    _INTCON2bits = 0x82;
     IFS0 = 0x84;
    _IFS0 = 0x84;
    _IFS0bits = 0x84;
     IFS1 = 0x86;
    _IFS1 = 0x86;
    _IFS1bits = 0x86;
     IFS2 = 0x88;
    _IFS2 = 0x88;
    _IFS2bits = 0x88;
     IEC0 = 0x8C;
    _IEC0 = 0x8C;
    _IEC0bits = 0x8C;
     IEC1 = 0x8E;
    _IEC1 = 0x8E;
    _IEC1bits = 0x8E;
     IEC2 = 0x90;
    _IEC2 = 0x90;
    _IEC2bits = 0x90;
     IPC0 = 0x94;
    _IPC0 = 0x94;
    _IPC0bits = 0x94;
     IPC1 = 0x96;
    _IPC1 = 0x96;
    _IPC1bits = 0x96;
     IPC2 = 0x98;
    _IPC2 = 0x98;
    _IPC2bits = 0x98;
     IPC3 = 0x9A;
    _IPC3 = 0x9A;
    _IPC3bits = 0x9A;
     IPC4 = 0x9C;
    _IPC4 = 0x9C;
    _IPC4bits = 0x9C;
     IPC5 = 0x9E;
    _IPC5 = 0x9E;
    _IPC5bits = 0x9E;
     IPC6 = 0xA0;
    _IPC6 = 0xA0;
    _IPC6bits = 0xA0;
     IPC7 = 0xA2;
    _IPC7 = 0xA2;
    _IPC7bits = 0xA2;
     IPC8 = 0xA4;
    _IPC8 = 0xA4;
    _IPC8bits = 0xA4;
     IPC9 = 0xA6;
    _IPC9 = 0xA6;
    _IPC9bits = 0xA6;
     IPC10 = 0xA8;
    _IPC10 = 0xA8;
    _IPC10bits = 0xA8;
     INTTREG = 0xB0;
    _INTTREG = 0xB0;
    _INTTREGbits = 0xB0;
     CNEN1 = 0xC0;
    _CNEN1 = 0xC0;
    _CNEN1bits = 0xC0;
     CNEN2 = 0xC2;
    _CNEN2 = 0xC2;
    _CNEN2bits = 0xC2;
     CNPU1 = 0xC4;
    _CNPU1 = 0xC4;
    _CNPU1bits = 0xC4;
     CNPU2 = 0xC6;
    _CNPU2 = 0xC6;
    _CNPU2bits = 0xC6;
     TMR1 = 0x100;
    _TMR1 = 0x100;
     PR1 = 0x102;
    _PR1 = 0x102;
     T1CON = 0x104;
    _T1CON = 0x104;
    _T1CONbits = 0x104;
     TMR2 = 0x106;
    _TMR2 = 0x106;
     TMR3HLD = 0x108;
    _TMR3HLD = 0x108;
     TMR3 = 0x10A;
    _TMR3 = 0x10A;
     PR2 = 0x10C;
    _PR2 = 0x10C;
     PR3 = 0x10E;
    _PR3 = 0x10E;
     T2CON = 0x110;
    _T2CON = 0x110;
    _T2CONbits = 0x110;
     T3CON = 0x112;
    _T3CON = 0x112;
    _T3CONbits = 0x112;
     TMR4 = 0x114;
    _TMR4 = 0x114;
     TMR5HLD = 0x116;
    _TMR5HLD = 0x116;
     TMR5 = 0x118;
    _TMR5 = 0x118;
     PR4 = 0x11A;
    _PR4 = 0x11A;
     PR5 = 0x11C;
    _PR5 = 0x11C;
     T4CON = 0x11E;
    _T4CON = 0x11E;
    _T4CONbits = 0x11E;
     T5CON = 0x120;
    _T5CON = 0x120;
    _T5CONbits = 0x120;
     IC1BUF = 0x140;
    _IC1BUF = 0x140;
     IC1CON = 0x142;
    _IC1CON = 0x142;
    _IC1CONbits = 0x142;
     IC2BUF = 0x144;
    _IC2BUF = 0x144;
     IC2CON = 0x146;
    _IC2CON = 0x146;
    _IC2CONbits = 0x146;
     IC3BUF = 0x148;
    _IC3BUF = 0x148;
     IC3CON = 0x14A;
    _IC3CON = 0x14A;
    _IC3CONbits = 0x14A;
     IC4BUF = 0x14C;
    _IC4BUF = 0x14C;
     IC4CON = 0x14E;
    _IC4CON = 0x14E;
    _IC4CONbits = 0x14E;
     IC5BUF = 0x150;
    _IC5BUF = 0x150;
     IC5CON = 0x152;
    _IC5CON = 0x152;
    _IC5CONbits = 0x152;
     IC6BUF = 0x154;
    _IC6BUF = 0x154;
     IC6CON = 0x156;
    _IC6CON = 0x156;
    _IC6CONbits = 0x156;
     IC7BUF = 0x158;
    _IC7BUF = 0x158;
     IC7CON = 0x15A;
    _IC7CON = 0x15A;
    _IC7CONbits = 0x15A;
     IC8BUF = 0x15C;
    _IC8BUF = 0x15C;
     IC8CON = 0x15E;
    _IC8CON = 0x15E;
    _IC8CONbits = 0x15E;
     OC1RS = 0x180;
    _OC1RS = 0x180;
     OC1R = 0x182;
    _OC1R = 0x182;
     OC1CON = 0x184;
    _OC1CON = 0x184;
    _OC1CONbits = 0x184;
     OC2RS = 0x186;
    _OC2RS = 0x186;
     OC2R = 0x188;
    _OC2R = 0x188;
     OC2CON = 0x18A;
    _OC2CON = 0x18A;
    _OC2CONbits = 0x18A;
     OC3RS = 0x18C;
    _OC3RS = 0x18C;
     OC3R = 0x18E;
    _OC3R = 0x18E;
     OC3CON = 0x190;
    _OC3CON = 0x190;
    _OC3CONbits = 0x190;
     OC4RS = 0x192;
    _OC4RS = 0x192;
     OC4R = 0x194;
    _OC4R = 0x194;
     OC4CON = 0x196;
    _OC4CON = 0x196;
    _OC4CONbits = 0x196;
     OC5RS = 0x198;
    _OC5RS = 0x198;
     OC5R = 0x19A;
    _OC5R = 0x19A;
     OC5CON = 0x19C;
    _OC5CON = 0x19C;
    _OC5CONbits = 0x19C;
     OC6RS = 0x19E;
    _OC6RS = 0x19E;
     OC6R = 0x1A0;
    _OC6R = 0x1A0;
     OC6CON = 0x1A2;
    _OC6CON = 0x1A2;
    _OC6CONbits = 0x1A2;
     OC7RS = 0x1A4;
    _OC7RS = 0x1A4;
     OC7R = 0x1A6;
    _OC7R = 0x1A6;
     OC7CON = 0x1A8;
    _OC7CON = 0x1A8;
    _OC7CONbits = 0x1A8;
     OC8RS = 0x1AA;
    _OC8RS = 0x1AA;
     OC8R = 0x1AC;
    _OC8R = 0x1AC;
     OC8CON = 0x1AE;
    _OC8CON = 0x1AE;
    _OC8CONbits = 0x1AE;
     I2CRCV = 0x200;
    _I2CRCV = 0x200;
    _I2CRCVbits = 0x200;
     I2CTRN = 0x202;
    _I2CTRN = 0x202;
    _I2CTRNbits = 0x202;
     I2CBRG = 0x204;
    _I2CBRG = 0x204;
    _I2CBRGbits = 0x204;
     I2CCON = 0x206;
    _I2CCON = 0x206;
    _I2CCONbits = 0x206;
     I2CSTAT = 0x208;
    _I2CSTAT = 0x208;
    _I2CSTATbits = 0x208;
     I2CADD = 0x20A;
    _I2CADD = 0x20A;
    _I2CADDbits = 0x20A;
     U1MODE = 0x20C;
    _U1MODE = 0x20C;
    _U1MODEbits = 0x20C;
     U1STA = 0x20E;
    _U1STA = 0x20E;
    _U1STAbits = 0x20E;
     U1TXREG = 0x210;
    _U1TXREG = 0x210;
    _U1TXREGbits = 0x210;
     U1RXREG = 0x212;
    _U1RXREG = 0x212;
    _U1RXREGbits = 0x212;
     U1BRG = 0x214;
    _U1BRG = 0x214;
     U2MODE = 0x216;
    _U2MODE = 0x216;
    _U2MODEbits = 0x216;
     U2STA = 0x218;
    _U2STA = 0x218;
    _U2STAbits = 0x218;
     U2TXREG = 0x21A;
    _U2TXREG = 0x21A;
    _U2TXREGbits = 0x21A;
     U2RXREG = 0x21C;
    _U2RXREG = 0x21C;
    _U2RXREGbits = 0x21C;
     U2BRG = 0x21E;
    _U2BRG = 0x21E;
     SPI1STAT = 0x220;
    _SPI1STAT = 0x220;
    _SPI1STATbits = 0x220;
     SPI1CON = 0x222;
    _SPI1CON = 0x222;
    _SPI1CONbits = 0x222;
     SPI1BUF = 0x224;
    _SPI1BUF = 0x224;
     SPI2STAT = 0x226;
    _SPI2STAT = 0x226;
    _SPI2STATbits = 0x226;
     SPI2CON = 0x228;
    _SPI2CON = 0x228;
    _SPI2CONbits = 0x228;
     SPI2BUF = 0x22A;
    _SPI2BUF = 0x22A;
     DCICON1 = 0x240;
    _DCICON1 = 0x240;
    _DCICON1bits = 0x240;
     DCICON2 = 0x242;
    _DCICON2 = 0x242;
    _DCICON2bits = 0x242;
     DCICON3 = 0x244;
    _DCICON3 = 0x244;
    _DCICON3bits = 0x244;
     DCISTAT = 0x246;
    _DCISTAT = 0x246;
    _DCISTATbits = 0x246;
     TSCON = 0x248;
    _TSCON = 0x248;
    _TSCONbits = 0x248;
     RSCON = 0x24C;
    _RSCON = 0x24C;
    _RSCONbits = 0x24C;
     RXBUF0 = 0x250;
    _RXBUF0 = 0x250;
     RXBUF1 = 0x252;
    _RXBUF1 = 0x252;
     RXBUF2 = 0x254;
    _RXBUF2 = 0x254;
     RXBUF3 = 0x256;
    _RXBUF3 = 0x256;
     TXBUF0 = 0x258;
    _TXBUF0 = 0x258;
     TXBUF1 = 0x25A;
    _TXBUF1 = 0x25A;
     TXBUF2 = 0x25C;
    _TXBUF2 = 0x25C;
     TXBUF3 = 0x25E;
    _TXBUF3 = 0x25E;
     ADCBUF0 = 0x280;
    _ADCBUF0 = 0x280;
     ADCBUF1 = 0x282;
    _ADCBUF1 = 0x282;
     ADCBUF2 = 0x284;
    _ADCBUF2 = 0x284;
     ADCBUF3 = 0x286;
    _ADCBUF3 = 0x286;
     ADCBUF4 = 0x288;
    _ADCBUF4 = 0x288;
     ADCBUF5 = 0x28A;
    _ADCBUF5 = 0x28A;
     ADCBUF6 = 0x28C;
    _ADCBUF6 = 0x28C;
     ADCBUF7 = 0x28E;
    _ADCBUF7 = 0x28E;
     ADCBUF8 = 0x290;
    _ADCBUF8 = 0x290;
     ADCBUF9 = 0x292;
    _ADCBUF9 = 0x292;
     ADCBUFA = 0x294;
    _ADCBUFA = 0x294;
     ADCBUFB = 0x296;
    _ADCBUFB = 0x296;
     ADCBUFC = 0x298;
    _ADCBUFC = 0x298;
     ADCBUFD = 0x29A;
    _ADCBUFD = 0x29A;
     ADCBUFE = 0x29C;
    _ADCBUFE = 0x29C;
     ADCBUFF = 0x29E;
    _ADCBUFF = 0x29E;
     ADCON1 = 0x2A0;
    _ADCON1 = 0x2A0;
    _ADCON1bits = 0x2A0;
     ADCON2 = 0x2A2;
    _ADCON2 = 0x2A2;
    _ADCON2bits = 0x2A2;
     ADCON3 = 0x2A4;
    _ADCON3 = 0x2A4;
    _ADCON3bits = 0x2A4;
     ADCHS = 0x2A6;
    _ADCHS = 0x2A6;
    _ADCHSbits = 0x2A6;
     ADPCFG = 0x2A8;
    _ADPCFG = 0x2A8;
    _ADPCFGbits = 0x2A8;
     ADCSSL = 0x2AA;
    _ADCSSL = 0x2AA;
    _ADCSSLbits = 0x2AA;
     TRISB = 0x2C6;
    _TRISB = 0x2C6;
    _TRISBbits = 0x2C6;
     PORTB = 0x2C8;
    _PORTB = 0x2C8;
    _PORTBbits = 0x2C8;
     LATB = 0x2CA;
    _LATB = 0x2CA;
    _LATBbits = 0x2CA;
     TRISC = 0x2CC;
    _TRISC = 0x2CC;
    _TRISCbits = 0x2CC;
     PORTC = 0x2CE;
    _PORTC = 0x2CE;
    _PORTCbits = 0x2CE;
     LATC = 0x2D0;
    _LATC = 0x2D0;
    _LATCbits = 0x2D0;
     TRISD = 0x2D2;
    _TRISD = 0x2D2;
    _TRISDbits = 0x2D2;
     PORTD = 0x2D4;
    _PORTD = 0x2D4;
    _PORTDbits = 0x2D4;
     LATD = 0x2D6;
    _LATD = 0x2D6;
    _LATDbits = 0x2D6;
     TRISF = 0x2DE;
    _TRISF = 0x2DE;
    _TRISFbits = 0x2DE;
     PORTF = 0x2E0;
    _PORTF = 0x2E0;
    _PORTFbits = 0x2E0;
     LATF = 0x2E2;
    _LATF = 0x2E2;
    _LATFbits = 0x2E2;
     TRISG = 0x2E4;
    _TRISG = 0x2E4;
    _TRISGbits = 0x2E4;
     PORTG = 0x2E6;
    _PORTG = 0x2E6;
    _PORTGbits = 0x2E6;
     LATG = 0x2E8;
    _LATG = 0x2E8;
    _LATGbits = 0x2E8;
     C1RXF0SID = 0x300;
    _C1RXF0SID = 0x300;
    _C1RXF0SIDbits = 0x300;
     C1RXF0EIDH = 0x302;
    _C1RXF0EIDH = 0x302;
    _C1RXF0EIDHbits = 0x302;
     C1RXF0EIDL = 0x304;
    _C1RXF0EIDL = 0x304;
    _C1RXF0EIDLbits = 0x304;
     C1RXF1SID = 0x308;
    _C1RXF1SID = 0x308;
    _C1RXF1SIDbits = 0x308;
     C1RXF1EIDH = 0x30A;
    _C1RXF1EIDH = 0x30A;
    _C1RXF1EIDHbits = 0x30A;
     C1RXF1EIDL = 0x30C;
    _C1RXF1EIDL = 0x30C;
    _C1RXF1EIDLbits = 0x30C;
     C1RXF2SID = 0x310;
    _C1RXF2SID = 0x310;
    _C1RXF2SIDbits = 0x310;
     C1RXF2EIDH = 0x312;
    _C1RXF2EIDH = 0x312;
    _C1RXF2EIDHbits = 0x312;
     C1RXF2EIDL = 0x314;
    _C1RXF2EIDL = 0x314;
    _C1RXF2EIDLbits = 0x314;
     C1RXF3SID = 0x318;
    _C1RXF3SID = 0x318;
    _C1RXF3SIDbits = 0x318;
     C1RXF3EIDH = 0x31A;
    _C1RXF3EIDH = 0x31A;
    _C1RXF3EIDHbits = 0x31A;
     C1RXF3EIDL = 0x31C;
    _C1RXF3EIDL = 0x31C;
    _C1RXF3EIDLbits = 0x31C;
     C1RXF4SID = 0x320;
    _C1RXF4SID = 0x320;
    _C1RXF4SIDbits = 0x320;
     C1RXF4EIDH = 0x322;
    _C1RXF4EIDH = 0x322;
    _C1RXF4EIDHbits = 0x322;
     C1RXF4EIDL = 0x324;
    _C1RXF4EIDL = 0x324;
    _C1RXF4EIDLbits = 0x324;
     C1RXF5SID = 0x328;
    _C1RXF5SID = 0x328;
    _C1RXF5SIDbits = 0x328;
     C1RXF5EIDH = 0x32A;
    _C1RXF5EIDH = 0x32A;
    _C1RXF5EIDHbits = 0x32A;
     C1RXF5EIDL = 0x32C;
    _C1RXF5EIDL = 0x32C;
    _C1RXF5EIDLbits = 0x32C;
     C1RXM0SID = 0x330;
    _C1RXM0SID = 0x330;
    _C1RXM0SIDbits = 0x330;
     C1RXM0EIDH = 0x332;
    _C1RXM0EIDH = 0x332;
    _C1RXM0EIDHbits = 0x332;
     C1RXM0EIDL = 0x334;
    _C1RXM0EIDL = 0x334;
    _C1RXM0EIDLbits = 0x334;
     C1RXM1SID = 0x338;
    _C1RXM1SID = 0x338;
    _C1RXM1SIDbits = 0x338;
     C1RXM1EIDH = 0x33A;
    _C1RXM1EIDH = 0x33A;
    _C1RXM1EIDHbits = 0x33A;
     C1RXM1EIDL = 0x33C;
    _C1RXM1EIDL = 0x33C;
    _C1RXM1EIDLbits = 0x33C;
     C1TX2SID = 0x340;
    _C1TX2SID = 0x340;
    _C1TX2SIDbits = 0x340;
     C1TX2EID = 0x342;
    _C1TX2EID = 0x342;
    _C1TX2EIDbits = 0x342;
     C1TX2DLC = 0x344;
    _C1TX2DLC = 0x344;
    _C1TX2DLCbits = 0x344;
     C1TX2B1 = 0x346;
    _C1TX2B1 = 0x346;
    _C1TX2B1bits = 0x346;
     C1TX2B2 = 0x348;
    _C1TX2B2 = 0x348;
    _C1TX2B2bits = 0x348;
     C1TX2B3 = 0x34A;
    _C1TX2B3 = 0x34A;
    _C1TX2B3bits = 0x34A;
     C1TX2B4 = 0x34C;
    _C1TX2B4 = 0x34C;
    _C1TX2B4bits = 0x34C;
     C1TX2CON = 0x34E;
    _C1TX2CON = 0x34E;
    _C1TX2CONbits = 0x34E;
     C1TX1SID = 0x350;
    _C1TX1SID = 0x350;
    _C1TX1SIDbits = 0x350;
     C1TX1EID = 0x352;
    _C1TX1EID = 0x352;
    _C1TX1EIDbits = 0x352;
     C1TX1DLC = 0x354;
    _C1TX1DLC = 0x354;
    _C1TX1DLCbits = 0x354;
     C1TX1B1 = 0x356;
    _C1TX1B1 = 0x356;
    _C1TX1B1bits = 0x356;
     C1TX1B2 = 0x358;
    _C1TX1B2 = 0x358;
    _C1TX1B2bits = 0x358;
     C1TX1B3 = 0x35A;
    _C1TX1B3 = 0x35A;
    _C1TX1B3bits = 0x35A;
     C1TX1B4 = 0x35C;
    _C1TX1B4 = 0x35C;
    _C1TX1B4bits = 0x35C;
     C1TX1CON = 0x35E;
    _C1TX1CON = 0x35E;
    _C1TX1CONbits = 0x35E;
     C1TX0SID = 0x360;
    _C1TX0SID = 0x360;
    _C1TX0SIDbits = 0x360;
     C1TX0EID = 0x362;
    _C1TX0EID = 0x362;
    _C1TX0EIDbits = 0x362;
     C1TX0DLC = 0x364;
    _C1TX0DLC = 0x364;
    _C1TX0DLCbits = 0x364;
     C1TX0B1 = 0x366;
    _C1TX0B1 = 0x366;
    _C1TX0B1bits = 0x366;
     C1TX0B2 = 0x368;
    _C1TX0B2 = 0x368;
    _C1TX0B2bits = 0x368;
     C1TX0B3 = 0x36A;
    _C1TX0B3 = 0x36A;
    _C1TX0B3bits = 0x36A;
     C1TX0B4 = 0x36C;
    _C1TX0B4 = 0x36C;
    _C1TX0B4bits = 0x36C;
     C1TX0CON = 0x36E;
    _C1TX0CON = 0x36E;
    _C1TX0CONbits = 0x36E;
     C1RX1SID = 0x370;
    _C1RX1SID = 0x370;
    _C1RX1SIDbits = 0x370;
     C1RX1EID = 0x372;
    _C1RX1EID = 0x372;
    _C1RX1EIDbits = 0x372;
     C1RX1DLC = 0x374;
    _C1RX1DLC = 0x374;
    _C1RX1DLCbits = 0x374;
     C1RX1B1 = 0x376;
    _C1RX1B1 = 0x376;
    _C1RX1B1bits = 0x376;
     C1RX1B2 = 0x378;
    _C1RX1B2 = 0x378;
    _C1RX1B2bits = 0x378;
     C1RX1B3 = 0x37A;
    _C1RX1B3 = 0x37A;
    _C1RX1B3bits = 0x37A;
     C1RX1B4 = 0x37C;
    _C1RX1B4 = 0x37C;
    _C1RX1B4bits = 0x37C;
     C1RX1CON = 0x37E;
    _C1RX1CON = 0x37E;
    _C1RX1CONbits = 0x37E;
     C1RX0SID = 0x380;
    _C1RX0SID = 0x380;
    _C1RX0SIDbits = 0x380;
     C1RX0EID = 0x382;
    _C1RX0EID = 0x382;
    _C1RX0EIDbits = 0x382;
     C1RX0DLC = 0x384;
    _C1RX0DLC = 0x384;
    _C1RX0DLCbits = 0x384;
     C1RX0B1 = 0x386;
    _C1RX0B1 = 0x386;
    _C1RX0B1bits = 0x386;
     C1RX0B2 = 0x388;
    _C1RX0B2 = 0x388;
    _C1RX0B2bits = 0x388;
     C1RX0B3 = 0x38A;
    _C1RX0B3 = 0x38A;
    _C1RX0B3bits = 0x38A;
     C1RX0B4 = 0x38C;
    _C1RX0B4 = 0x38C;
    _C1RX0B4bits = 0x38C;
     C1RX0CON = 0x38E;
    _C1RX0CON = 0x38E;
    _C1RX0CONbits = 0x38E;
     C1CTRL = 0x390;
    _C1CTRL = 0x390;
    _C1CTRLbits = 0x390;
     C1CFG1 = 0x392;
    _C1CFG1 = 0x392;
    _C1CFG1bits = 0x392;
     C1CFG2 = 0x394;
    _C1CFG2 = 0x394;
    _C1CFG2bits = 0x394;
     C1INTF = 0x396;
    _C1INTF = 0x396;
    _C1INTFbits = 0x396;
     C1INTE = 0x398;
    _C1INTE = 0x398;
    _C1INTEbits = 0x398;
     C1EC = 0x39A;
    _C1EC = 0x39A;
    _C1ECbits = 0x39A;
     C1RERRCNT = 0x39A;
    _C1RERRCNT = 0x39A;
     C1TERRCNT = 0x39B;
    _C1TERRCNT = 0x39B;
     C2RXF0SID = 0x3C0;
    _C2RXF0SID = 0x3C0;
    _C2RXF0SIDbits = 0x3C0;
     C2RXF0EIDH = 0x3C2;
    _C2RXF0EIDH = 0x3C2;
    _C2RXF0EIDHbits = 0x3C2;
     C2RXF0EIDL = 0x3C4;
    _C2RXF0EIDL = 0x3C4;
    _C2RXF0EIDLbits = 0x3C4;
     C2RXF1SID = 0x3C8;
    _C2RXF1SID = 0x3C8;
    _C2RXF1SIDbits = 0x3C8;
     C2RXF1EIDH = 0x3CA;
    _C2RXF1EIDH = 0x3CA;
    _C2RXF1EIDHbits = 0x3CA;
     C2RXF1EIDL = 0x3CC;
    _C2RXF1EIDL = 0x3CC;
    _C2RXF1EIDLbits = 0x3CC;
     C2RXF2SID = 0x3D0;
    _C2RXF2SID = 0x3D0;
    _C2RXF2SIDbits = 0x3D0;
     C2RXF2EIDH = 0x3D2;
    _C2RXF2EIDH = 0x3D2;
    _C2RXF2EIDHbits = 0x3D2;
     C2RXF2EIDL = 0x3D4;
    _C2RXF2EIDL = 0x3D4;
    _C2RXF2EIDLbits = 0x3D4;
     C2RXF3SID = 0x3D8;
    _C2RXF3SID = 0x3D8;
    _C2RXF3SIDbits = 0x3D8;
     C2RXF3EIDH = 0x3DA;
    _C2RXF3EIDH = 0x3DA;
    _C2RXF3EIDHbits = 0x3DA;
     C2RXF3EIDL = 0x3DC;
    _C2RXF3EIDL = 0x3DC;
    _C2RXF3EIDLbits = 0x3DC;
     C2RXF4SID = 0x3E0;
    _C2RXF4SID = 0x3E0;
    _C2RXF4SIDbits = 0x3E0;
     C2RXF4EIDH = 0x3E2;
    _C2RXF4EIDH = 0x3E2;
    _C2RXF4EIDHbits = 0x3E2;
     C2RXF4EIDL = 0x3E4;
    _C2RXF4EIDL = 0x3E4;
    _C2RXF4EIDLbits = 0x3E4;
     C2RXF5SID = 0x3E8;
    _C2RXF5SID = 0x3E8;
    _C2RXF5SIDbits = 0x3E8;
     C2RXF5EIDH = 0x3EA;
    _C2RXF5EIDH = 0x3EA;
    _C2RXF5EIDHbits = 0x3EA;
     C2RXF5EIDL = 0x3EC;
    _C2RXF5EIDL = 0x3EC;
    _C2RXF5EIDLbits = 0x3EC;
     C2RXM0SID = 0x3F0;
    _C2RXM0SID = 0x3F0;
    _C2RXM0SIDbits = 0x3F0;
     C2RXM0EIDH = 0x3F2;
    _C2RXM0EIDH = 0x3F2;
    _C2RXM0EIDHbits = 0x3F2;
     C2RXM0EIDL = 0x3F4;
    _C2RXM0EIDL = 0x3F4;
    _C2RXM0EIDLbits = 0x3F4;
     C2RXM1SID = 0x3F8;
    _C2RXM1SID = 0x3F8;
    _C2RXM1SIDbits = 0x3F8;
     C2RXM1EIDH = 0x3FA;
    _C2RXM1EIDH = 0x3FA;
    _C2RXM1EIDHbits = 0x3FA;
     C2RXM1EIDL = 0x3FC;
    _C2RXM1EIDL = 0x3FC;
    _C2RXM1EIDLbits = 0x3FC;
     C2TX2SID = 0x400;
    _C2TX2SID = 0x400;
    _C2TX2SIDbits = 0x400;
     C2TX2EID = 0x402;
    _C2TX2EID = 0x402;
    _C2TX2EIDbits = 0x402;
     C2TX2DLC = 0x404;
    _C2TX2DLC = 0x404;
    _C2TX2DLCbits = 0x404;
     C2TX2B1 = 0x406;
    _C2TX2B1 = 0x406;
    _C2TX2B1bits = 0x406;
     C2TX2B2 = 0x408;
    _C2TX2B2 = 0x408;
    _C2TX2B2bits = 0x408;
     C2TX2B3 = 0x40A;
    _C2TX2B3 = 0x40A;
    _C2TX2B3bits = 0x40A;
     C2TX2B4 = 0x40C;
    _C2TX2B4 = 0x40C;
    _C2TX2B4bits = 0x40C;
     C2TX2CON = 0x40E;
    _C2TX2CON = 0x40E;
    _C2TX2CONbits = 0x40E;
     C2TX1SID = 0x410;
    _C2TX1SID = 0x410;
    _C2TX1SIDbits = 0x410;
     C2TX1EID = 0x412;
    _C2TX1EID = 0x412;
    _C2TX1EIDbits = 0x412;
     C2TX1DLC = 0x414;
    _C2TX1DLC = 0x414;
    _C2TX1DLCbits = 0x414;
     C2TX1B1 = 0x416;
    _C2TX1B1 = 0x416;
    _C2TX1B1bits = 0x416;
     C2TX1B2 = 0x418;
    _C2TX1B2 = 0x418;
    _C2TX1B2bits = 0x418;
     C2TX1B3 = 0x41A;
    _C2TX1B3 = 0x41A;
    _C2TX1B3bits = 0x41A;
     C2TX1B4 = 0x41C;
    _C2TX1B4 = 0x41C;
    _C2TX1B4bits = 0x41C;
     C2TX1CON = 0x41E;
    _C2TX1CON = 0x41E;
    _C2TX1CONbits = 0x41E;
     C2TX0SID = 0x420;
    _C2TX0SID = 0x420;
    _C2TX0SIDbits = 0x420;
     C2TX0EID = 0x422;
    _C2TX0EID = 0x422;
    _C2TX0EIDbits = 0x422;
     C2TX0DLC = 0x424;
    _C2TX0DLC = 0x424;
    _C2TX0DLCbits = 0x424;
     C2TX0B1 = 0x426;
    _C2TX0B1 = 0x426;
    _C2TX0B1bits = 0x426;
     C2TX0B2 = 0x428;
    _C2TX0B2 = 0x428;
    _C2TX0B2bits = 0x428;
     C2TX0B3 = 0x42A;
    _C2TX0B3 = 0x42A;
    _C2TX0B3bits = 0x42A;
     C2TX0B4 = 0x42C;
    _C2TX0B4 = 0x42C;
    _C2TX0B4bits = 0x42C;
     C2TX0CON = 0x42E;
    _C2TX0CON = 0x42E;
    _C2TX0CONbits = 0x42E;
     C2RX1SID = 0x430;
    _C2RX1SID = 0x430;
    _C2RX1SIDbits = 0x430;
     C2RX1EID = 0x432;
    _C2RX1EID = 0x432;
    _C2RX1EIDbits = 0x432;
     C2RX1DLC = 0x434;
    _C2RX1DLC = 0x434;
    _C2RX1DLCbits = 0x434;
     C2RX1B1 = 0x436;
    _C2RX1B1 = 0x436;
    _C2RX1B1bits = 0x436;
     C2RX1B2 = 0x438;
    _C2RX1B2 = 0x438;
    _C2RX1B2bits = 0x438;
     C2RX1B3 = 0x43A;
    _C2RX1B3 = 0x43A;
    _C2RX1B3bits = 0x43A;
     C2RX1B4 = 0x43C;
    _C2RX1B4 = 0x43C;
    _C2RX1B4bits = 0x43C;
     C2RX1CON = 0x43E;
    _C2RX1CON = 0x43E;
    _C2RX1CONbits = 0x43E;
     C2RX0SID = 0x440;
    _C2RX0SID = 0x440;
    _C2RX0SIDbits = 0x440;
     C2RX0EID = 0x442;
    _C2RX0EID = 0x442;
    _C2RX0EIDbits = 0x442;
     C2RX0DLC = 0x444;
    _C2RX0DLC = 0x444;
    _C2RX0DLCbits = 0x444;
     C2RX0B1 = 0x446;
    _C2RX0B1 = 0x446;
    _C2RX0B1bits = 0x446;
     C2RX0B2 = 0x448;
    _C2RX0B2 = 0x448;
    _C2RX0B2bits = 0x448;
     C2RX0B3 = 0x44A;
    _C2RX0B3 = 0x44A;
    _C2RX0B3bits = 0x44A;
     C2RX0B4 = 0x44C;
    _C2RX0B4 = 0x44C;
    _C2RX0B4bits = 0x44C;
     C2RX0CON = 0x44E;
    _C2RX0CON = 0x44E;
    _C2RX0CONbits = 0x44E;
     C2CTRL = 0x450;
    _C2CTRL = 0x450;
    _C2CTRLbits = 0x450;
     C2CFG1 = 0x452;
    _C2CFG1 = 0x452;
    _C2CFG1bits = 0x452;
     C2CFG2 = 0x454;
    _C2CFG2 = 0x454;
    _C2CFG2bits = 0x454;
     C2INTF = 0x456;
    _C2INTF = 0x456;
    _C2INTFbits = 0x456;
     C2INTE = 0x458;
    _C2INTE = 0x458;
    _C2INTEbits = 0x458;
     C2EC = 0x45A;
    _C2EC = 0x45A;
    _C2ECbits = 0x45A;
     C2RERRCNT = 0x45A;
    _C2RERRCNT = 0x45A;
     C2TERRCNT = 0x45B;
    _C2TERRCNT = 0x45B;
     RCON = 0x740;
    _RCON = 0x740;
    _RCONbits = 0x740;
     OSCCON = 0x742;
    _OSCCON = 0x742;
    _OSCCONbits = 0x742;
     OSCCONL = 0x742;
    _OSCCONL = 0x742;
     OSCCONH = 0x743;
    _OSCCONH = 0x743;
     OSCTUN = 0x744;
    _OSCTUN = 0x744;
    _OSCTUNbits = 0x744;
     BSRAM = 0x750;
    _BSRAM = 0x750;
    _BSRAMbits = 0x750;
     SSRAM = 0x752;
    _SSRAM = 0x752;
    _SSRAMbits = 0x752;
     NVMCON = 0x760;
    _NVMCON = 0x760;
    _NVMCONbits = 0x760;
     NVMADR = 0x762;
    _NVMADR = 0x762;
     NVMADRU = 0x764;
    _NVMADRU = 0x764;
    _NVMADRUbits = 0x764;
     NVMKEY = 0x766;
    _NVMKEY = 0x766;
     PMD1 = 0x770;
    _PMD1 = 0x770;
    _PMD1bits = 0x770;
     PMD2 = 0x772;
    _PMD2 = 0x772;
    _PMD2bits = 0x772;
    /*
    ** ======= Base Addresses for Various Peripherals and ACC ======
    */

     ACCA = 0x22;
    _ACCA = 0x22;
     ACCB = 0x28;
    _ACCB = 0x28;
     CAN1 = 0x300;
    _CAN1 = 0x300;
     CAN2 = 0x3C0;
    _CAN2 = 0x3C0;
     IC1 = 0x140;
    _IC1 = 0x140;
     IC2 = 0x144;
    _IC2 = 0x144;
     IC3 = 0x148;
    _IC3 = 0x148;
     IC4 = 0x14C;
    _IC4 = 0x14C;
     IC5 = 0x150;
    _IC5 = 0x150;
     IC6 = 0x154;
    _IC6 = 0x154;
     IC7 = 0x158;
    _IC7 = 0x158;
     IC8 = 0x15C;
    _IC8 = 0x15C;
     OC1 = 0x180;
    _OC1 = 0x180;
     OC2 = 0x186;
    _OC2 = 0x186;
     OC3 = 0x18C;
    _OC3 = 0x18C;
     OC4 = 0x192;
    _OC4 = 0x192;
     OC5 = 0x198;
    _OC5 = 0x198;
     OC6 = 0x19E;
    _OC6 = 0x19E;
     OC7 = 0x1A4;
    _OC7 = 0x1A4;
     OC8 = 0x1AA;
    _OC8 = 0x1AA;
     SPI1 = 0x220;
    _SPI1 = 0x220;
     SPI2 = 0x226;
    _SPI2 = 0x226;
     UART1 = 0x20C;
    _UART1 = 0x20C;
     UART2 = 0x216;
    _UART2 = 0x216;

     
    Target edited GLD (XC16 v1.3)

    /*
     * Linker script for PIC30F6012A
     * (c) Copyright 2013 Microchip Technology, Inc
     * Part support version 1.30.A(22-Nov-2016)
     *
     * This software is developed by Microchip Technology Inc. and its
     * subsidiaries ("Microchip").
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are
     * met:
     *
     * 1. Redistributions of source code must retain the above copyright
     * notice, this list of conditions and the following disclaimer.
     * 2. Redistributions in binary form must reproduce the above
     * copyright notice, this list of conditions and the following
     * disclaimer in the documentation and/or other materials provided
     * with the distribution.
     * 3. Microchip's name may not be used to endorse or promote products
     * derived from this software without specific prior written
     * permission.
     *
     * THIS SOFTWARE IS PROVIDED BY MICROCHIP "AS IS" AND ANY EXPRESS OR IMPLIED
     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     * MERCHANTABILITY AND FITNESS FOR PURPOSE ARE DISCLAIMED. IN NO EVENT
     * SHALL MICROCHIP BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWSOEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     */


    OUTPUT_ARCH("30F6012A")
    CRT0_STARTUP(crt0_standard.o)
    CRT1_STARTUP(crt1_standard.o)
    #if __XC16_VERSION__ > 1027
    /*
     * Define how to startup, by default we initialize
     * everything as normal; change to crt_start_mode to
     * preserve preserved data on a restart
     *
     * Or define your own __crt_start_mode fucntion
     */
    CRT_STARTMODE(crt_start_mode_normal)
    #endif

    OPTIONAL(-lp30F6012A)
    OPTIONAL(-lfx)

    /*
    ** Memory Regions
    */
    MEMORY
    {
      data (a!xr) : ORIGIN = 0x800, LENGTH = 0x2000
      reset : ORIGIN = 0x0, LENGTH = 0x4
      ivt : ORIGIN = 0x4, LENGTH = 0x7C
      _reserved : ORIGIN = 0x80, LENGTH = 0x4
      aivt : ORIGIN = 0x84, LENGTH = 0x7C
      
    /*
      ** WJB: I changed this to reserve section 0x0100 to 0x0600 of program memory
      ** space for the AN1094 bootloader. 2017-10-31
    */
    /* program (xr) : ORIGIN = 0x600, LENGTH = 0x17A00 */
    /* program (xr) : ORIGIN = 0x700, LENGTH = 0x17900 */
      program (xr) : ORIGIN = 0x700, LENGTH = ((48K * 2) - 0x700)

    /* Original line: */
    /* program (xr) : ORIGIN = 0x100, LENGTH = 0x17F00 */
    /* program (xr) : ORIGIN = 0x100, LENGTH = ((48K * 2) - 0x100) */

      eedata : ORIGIN = 0x7FF000, LENGTH = 0x1000
      FUID0 : ORIGIN = 0x8005C0, LENGTH = 0x2
      FUID1 : ORIGIN = 0x8005C2, LENGTH = 0x2
      FUID2 : ORIGIN = 0x8005C4, LENGTH = 0x2
      FUID3 : ORIGIN = 0x8005C6, LENGTH = 0x2
      FOSC : ORIGIN = 0xF80000, LENGTH = 0x2
      FWDT : ORIGIN = 0xF80002, LENGTH = 0x2
      FBORPOR : ORIGIN = 0xF80004, LENGTH = 0x2
      FBS : ORIGIN = 0xF80006, LENGTH = 0x2
      FSS : ORIGIN = 0xF80008, LENGTH = 0x2
      FGS : ORIGIN = 0xF8000A, LENGTH = 0x2
      FICD : ORIGIN = 0xF8000C, LENGTH = 0x2
    }

    __FUID0 = 0x8005C0;
    __FUID1 = 0x8005C2;
    __FUID2 = 0x8005C4;
    __FUID3 = 0x8005C6;
    __FOSC = 0xF80000;
    __FWDT = 0xF80002;
    __FBORPOR = 0xF80004;
    __FBS = 0xF80006;
    __FSS = 0xF80008;
    __FGS = 0xF8000A;
    __FICD = 0xF8000C;

    /*
      ** WJB: I added this section to reserve section of program memory space for the AN1094 bootloader. 2017-10-31
    */
    __CODE_BASE = 0x700;
    __CODE_LENGTH = ((48K * 2) - 0x700);
    /* __CODE_LENGTH = 0x17900; */


    /* Value 0x600 is suggested by AN1094 but the bootloader is using space beyond 0x600 so can't use this */
    /*
    __CODE_BASE = 0x600;
    __CODE_LENGTH = 0x17A00;
    */

    /* Original Lines:
    __CODE_BASE = 0x100;
    __CODE_LENGTH = 0x17F00;
    */



    __IVT_BASE = 0x4;
    __AIVT_BASE = 0x84;

    __DATA_BASE = 0x800;
    __DATA_LENGTH = 0x2000;
    __YDATA_BASE = 0x1800;



    /*
    ** ==================== Section Map ======================
    */
    SECTIONS
    {
      /*
      ** ========== Program Memory ==========
      */


    #if !defined(__CORESIDENT) || defined(__DEFINE_RESET)
      /*
      ** Reset Instruction
      */
      .reset :
      {
            SHORT(ABSOLUTE(__reset));
            SHORT(0x04);
            SHORT((ABSOLUTE(__reset) >> 16) & 0x7F);
            SHORT(0);
      } >reset
    #endif


      /*
      ** Interrupt Vector Tables
      **
      ** The primary and alternate tables are loaded
      ** here, between sections .reset and .text.
      ** Vector table source code appears below.
      */


      /*
      ** User Code and Library Code
      **
      ** This section must not be assigned to __CODE_BASE,
      ** because CodeGuard(tm) sections may be located there.
      **
      ** Note that input sections *(.text) are not mapped here.
      ** The best-fit allocator locates them, so that .text
      ** may flow around PSV sections as needed.
      */
      
    #if(1)
      .text :
      {
            /*
            ** WJB: This writes the bootloader timeout value as specified by AN1094. 2017-10-31
            */
        SHORT(0x0B); /* Bootloader timeout in sec, used by AN1094 bootloader */
            *(.init);
            *(.user_init);
            KEEP (*(.handle));
            KEEP (*(.isr*));
            *(.libc) *(.libm) *(.libdsp); /* keep together in this order */
            *(.lib*);
            /*** *(.text); ***/
      } >program
    #else
    /* I read this version here: "http://www.microchip.com/forums/m266481.aspx#266567" */
        .text __CODE_BASE :
       {
       /*
          ** WJB: This writes the bootloader timeout value as specified by AN1094. 2017-10-31
          */
        SHORT(0x0A); /* Bootloader timeout in sec */
             *(.init);
             *(.user_init);
             *(.handle);
             *(.libc) *(.libm) *(.libdsp); /* keep together in this order */
             *(.lib*);
             /*** *(.text); ***/
       } >program
    #endif

      /*
      ** User-Defined Section in Program Memory
      **
      ** note: can specify an address using
      ** the following syntax:
      **
      ** usercode 0x1234 :
      ** {
      ** *(usercode);
      ** } >program
      */
      usercode :
      {
            *(usercode);
      } >program
      
      
      /*
      ** User-Defined Constants in Program Memory
      **
      ** For PSV type sections, the Load Memory Address (LMA)
      ** should be specified as follows:
      **
      ** userconst : AT(0x1234)
      ** {
      ** *(userconst);
      ** } >program
      **
      ** Note that mapping PSV sections in linker scripts
      ** is not generally recommended.
      **
      ** Because of page alignment restrictions, memory is
      ** often used more efficiently when PSV sections
      ** do not appear in the linker script.
      **
      ** For more information on memory allocation,
      ** please refer to chapter 10, 'Linker Processing'
      ** in the Assembler, Linker manual (DS51317).
      */


      /*
      ** Configuration Words
      */
      __FUID0 :
      { KEEP (*(__FUID0.sec*)) } >FUID0
      __FUID1 :
      { KEEP (*(__FUID1.sec*)) } >FUID1
      __FUID2 :
      { KEEP (*(__FUID2.sec*)) } >FUID2
      __FUID3 :
      { KEEP (*(__FUID3.sec*)) } >FUID3
      __FOSC :
      { KEEP (*(__FOSC.sec*)) } >FOSC
      __FWDT :
      { KEEP (*(__FWDT.sec*)) } >FWDT
      __FBORPOR :
      { KEEP (*(__FBORPOR.sec*)) } >FBORPOR
      __FBS :
      { KEEP (*(__FBS.sec*)) } >FBS
      __FSS :
      { KEEP (*(__FSS.sec*)) } >FSS
      __FGS :
      { KEEP (*(__FGS.sec*)) } >FGS
      __FICD :
      { KEEP (*(__FICD.sec*)) } >FICD






      
      /*
      ** User-Defined Section in Data Flash Memory
      **
      ** note: can specify an address using
      ** the following syntax:
      **
      ** user_eedata 0x7FF000 :
      ** {
      ** *(user_eedata);
      ** } >eedata
      */
      user_eedata :
      {
            *(user_eedata);
      } >eedata


      /*
      ** =========== Data Memory ===========
      */


      /*
      ** ICD Debug Exec
      **
      ** This section provides optional storage for
      ** the ICD2 debugger. Define a global symbol
      ** named __ICD2RAM to enable ICD2. This section
      ** must be loaded at data address 0x800.
      */
      .icd __DATA_BASE (NOLOAD):
      {
        . += (DEFINED (__ICD2RAM) ? 0x50 : 0 );
      } > data


      /*
      ** User-Defined Section in Data Memory
      **
      ** note: can specify an address using
      ** the following syntax:
      **
      ** userdata 0x1234 :
      ** {
      ** *(userdata);
      ** } >data
      */
      userdata :
      {
            *(userdata);
      } >data


      /*
      ** Other sections in data memory are not explicitly mapped.
      ** Instead they are allocated according to their section
      ** attributes, which is most efficient.
      **
      ** If a specific arrangement of sections is required
      ** (other than what can be achieved using attributes)
      ** additional sections may be defined here. See chapter
      ** 10.5 in the MPLAB ASM30/LINK30 User's Guide (DS51317)
      ** for more information.
      */


      /*
      ** ========== Debug Info ==============
      */

      .comment 0 : { *(.comment) }

      /*
      ** DWARF-2
      */
      .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
      .debug_abbrev 0 : { *(.debug_abbrev) }
      .debug_line 0 : { *(.debug_line) }
      .debug_frame 0 : { *(.debug_frame) }
      .debug_str 0 : { *(.debug_str) }
      .debug_loc 0 : { *(.debug_loc) }
      .debug_macinfo 0 : { *(.debug_macinfo) }
      .debug_pubnames 0 : { *(.debug_pubnames) }
      .debug_ranges 0 : { *(.debug_ranges) }
      .debug_aranges 0 : { *(.debug_aranges) }

    } /* SECTIONS */

    /*
    ** ================= End of Section Map ================
    */

    #if __XC16_VERSION < 1026
    /*
    ** These definitions are not required for XC16 versions
    ** later than XC16 v1.25 as the linker defines the addresses.
    **
    ** These definitons will cause a link error on a newer compiler
    **
    */
    /*
    ** Section Map for Interrupt Vector Tables
    */
    SECTIONS
    {

    /*
    ** Interrupt Vector Table
    */
    .ivt __IVT_BASE :
      {
        LONG( DEFINED(__ReservedTrap0) ? ABSOLUTE(__ReservedTrap0) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OscillatorFail) ? ABSOLUTE(__OscillatorFail) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__AddressError) ? ABSOLUTE(__AddressError) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__StackError) ? ABSOLUTE(__StackError) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__MathError) ? ABSOLUTE(__MathError) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__ReservedTrap5) ? ABSOLUTE(__ReservedTrap5) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__ReservedTrap6) ? ABSOLUTE(__ReservedTrap6) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__ReservedTrap7) ? ABSOLUTE(__ReservedTrap7) :
             ABSOLUTE(__DefaultInterrupt));

        LONG( DEFINED(__INT0Interrupt) ? ABSOLUTE(__INT0Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC1Interrupt) ? ABSOLUTE(__IC1Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC1Interrupt) ? ABSOLUTE(__OC1Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__T1Interrupt) ? ABSOLUTE(__T1Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC2Interrupt) ? ABSOLUTE(__IC2Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC2Interrupt) ? ABSOLUTE(__OC2Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__T2Interrupt) ? ABSOLUTE(__T2Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__T3Interrupt) ? ABSOLUTE(__T3Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__SPI1Interrupt) ? ABSOLUTE(__SPI1Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__U1RXInterrupt) ? ABSOLUTE(__U1RXInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__U1TXInterrupt) ? ABSOLUTE(__U1TXInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__ADCInterrupt) ? ABSOLUTE(__ADCInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__NVMInterrupt) ? ABSOLUTE(__NVMInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__SI2CInterrupt) ? ABSOLUTE(__SI2CInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__MI2CInterrupt) ? ABSOLUTE(__MI2CInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__CNInterrupt) ? ABSOLUTE(__CNInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__INT1Interrupt) ? ABSOLUTE(__INT1Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC7Interrupt) ? ABSOLUTE(__IC7Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC8Interrupt) ? ABSOLUTE(__IC8Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC3Interrupt) ? ABSOLUTE(__OC3Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC4Interrupt) ? ABSOLUTE(__OC4Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__T4Interrupt) ? ABSOLUTE(__T4Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__T5Interrupt) ? ABSOLUTE(__T5Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__INT2Interrupt) ? ABSOLUTE(__INT2Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__U2RXInterrupt) ? ABSOLUTE(__U2RXInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__U2TXInterrupt) ? ABSOLUTE(__U2TXInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__SPI2Interrupt) ? ABSOLUTE(__SPI2Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__C1Interrupt) ? ABSOLUTE(__C1Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC3Interrupt) ? ABSOLUTE(__IC3Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC4Interrupt) ? ABSOLUTE(__IC4Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC5Interrupt) ? ABSOLUTE(__IC5Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__IC6Interrupt) ? ABSOLUTE(__IC6Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC5Interrupt) ? ABSOLUTE(__OC5Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC6Interrupt) ? ABSOLUTE(__OC6Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC7Interrupt) ? ABSOLUTE(__OC7Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__OC8Interrupt) ? ABSOLUTE(__OC8Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__INT3Interrupt) ? ABSOLUTE(__INT3Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__INT4Interrupt) ? ABSOLUTE(__INT4Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__C2Interrupt) ? ABSOLUTE(__C2Interrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__PWMInterrupt) ? ABSOLUTE(__PWMInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__QEIInterrupt) ? ABSOLUTE(__QEIInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__DCIInterrupt) ? ABSOLUTE(__DCIInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__LVDInterrupt) ? ABSOLUTE(__LVDInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__FLTAInterrupt) ? ABSOLUTE(__FLTAInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__FLTBInterrupt) ? ABSOLUTE(__FLTBInterrupt) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt45) ? ABSOLUTE(__Interrupt45) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt46) ? ABSOLUTE(__Interrupt46) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt47) ? ABSOLUTE(__Interrupt47) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt48) ? ABSOLUTE(__Interrupt48) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt49) ? ABSOLUTE(__Interrupt49) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt50) ? ABSOLUTE(__Interrupt50) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt51) ? ABSOLUTE(__Interrupt51) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt52) ? ABSOLUTE(__Interrupt52) :
             ABSOLUTE(__DefaultInterrupt));
        LONG( DEFINED(__Interrupt53) ? ABSOLUTE(__Interrupt53) :
             ABSOLUTE(__DefaultInterrupt));
      } >ivt


    /*
    ** Alternate Interrupt Vector Table
    */
    .aivt __AIVT_BASE :
      {
        LONG( DEFINED(__AltReservedTrap0) ? ABSOLUTE(__AltReservedTrap0) :
             (DEFINED(__ReservedTrap0) ? ABSOLUTE(__ReservedTrap0) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOscillatorFail) ? ABSOLUTE(__AltOscillatorFail) :
             (DEFINED(__OscillatorFail) ? ABSOLUTE(__OscillatorFail) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltAddressError) ? ABSOLUTE(__AltAddressError) :
             (DEFINED(__AddressError) ? ABSOLUTE(__AddressError) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltStackError) ? ABSOLUTE(__AltStackError) :
             (DEFINED(__StackError) ? ABSOLUTE(__StackError) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltMathError) ? ABSOLUTE(__AltMathError) :
             (DEFINED(__MathError) ? ABSOLUTE(__MathError) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltReservedTrap5) ? ABSOLUTE(__AltReservedTrap5) :
             (DEFINED(__ReservedTrap5) ? ABSOLUTE(__ReservedTrap5) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltReservedTrap6) ? ABSOLUTE(__AltReservedTrap6) :
             (DEFINED(__ReservedTrap6) ? ABSOLUTE(__ReservedTrap6) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltReservedTrap7) ? ABSOLUTE(__AltReservedTrap7) :
             (DEFINED(__ReservedTrap7) ? ABSOLUTE(__ReservedTrap7) :
             ABSOLUTE(__DefaultInterrupt)));

        LONG( DEFINED(__AltINT0Interrupt) ? ABSOLUTE(__AltINT0Interrupt) :
             (DEFINED(__INT0Interrupt) ? ABSOLUTE(__INT0Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC1Interrupt) ? ABSOLUTE(__AltIC1Interrupt) :
             (DEFINED(__IC1Interrupt) ? ABSOLUTE(__IC1Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC1Interrupt) ? ABSOLUTE(__AltOC1Interrupt) :
             (DEFINED(__OC1Interrupt) ? ABSOLUTE(__OC1Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltT1Interrupt) ? ABSOLUTE(__AltT1Interrupt) :
             (DEFINED(__T1Interrupt) ? ABSOLUTE(__T1Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC2Interrupt) ? ABSOLUTE(__AltIC2Interrupt) :
             (DEFINED(__IC2Interrupt) ? ABSOLUTE(__IC2Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC2Interrupt) ? ABSOLUTE(__AltOC2Interrupt) :
             (DEFINED(__OC2Interrupt) ? ABSOLUTE(__OC2Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltT2Interrupt) ? ABSOLUTE(__AltT2Interrupt) :
             (DEFINED(__T2Interrupt) ? ABSOLUTE(__T2Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltT3Interrupt) ? ABSOLUTE(__AltT3Interrupt) :
             (DEFINED(__T3Interrupt) ? ABSOLUTE(__T3Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltSPI1Interrupt) ? ABSOLUTE(__AltSPI1Interrupt) :
             (DEFINED(__SPI1Interrupt) ? ABSOLUTE(__SPI1Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltU1RXInterrupt) ? ABSOLUTE(__AltU1RXInterrupt) :
             (DEFINED(__U1RXInterrupt) ? ABSOLUTE(__U1RXInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltU1TXInterrupt) ? ABSOLUTE(__AltU1TXInterrupt) :
             (DEFINED(__U1TXInterrupt) ? ABSOLUTE(__U1TXInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltADCInterrupt) ? ABSOLUTE(__AltADCInterrupt) :
             (DEFINED(__ADCInterrupt) ? ABSOLUTE(__ADCInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltNVMInterrupt) ? ABSOLUTE(__AltNVMInterrupt) :
             (DEFINED(__NVMInterrupt) ? ABSOLUTE(__NVMInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltSI2CInterrupt) ? ABSOLUTE(__AltSI2CInterrupt) :
             (DEFINED(__SI2CInterrupt) ? ABSOLUTE(__SI2CInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltMI2CInterrupt) ? ABSOLUTE(__AltMI2CInterrupt) :
             (DEFINED(__MI2CInterrupt) ? ABSOLUTE(__MI2CInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltCNInterrupt) ? ABSOLUTE(__AltCNInterrupt) :
             (DEFINED(__CNInterrupt) ? ABSOLUTE(__CNInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltINT1Interrupt) ? ABSOLUTE(__AltINT1Interrupt) :
             (DEFINED(__INT1Interrupt) ? ABSOLUTE(__INT1Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC7Interrupt) ? ABSOLUTE(__AltIC7Interrupt) :
             (DEFINED(__IC7Interrupt) ? ABSOLUTE(__IC7Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC8Interrupt) ? ABSOLUTE(__AltIC8Interrupt) :
             (DEFINED(__IC8Interrupt) ? ABSOLUTE(__IC8Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC3Interrupt) ? ABSOLUTE(__AltOC3Interrupt) :
             (DEFINED(__OC3Interrupt) ? ABSOLUTE(__OC3Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC4Interrupt) ? ABSOLUTE(__AltOC4Interrupt) :
             (DEFINED(__OC4Interrupt) ? ABSOLUTE(__OC4Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltT4Interrupt) ? ABSOLUTE(__AltT4Interrupt) :
             (DEFINED(__T4Interrupt) ? ABSOLUTE(__T4Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltT5Interrupt) ? ABSOLUTE(__AltT5Interrupt) :
             (DEFINED(__T5Interrupt) ? ABSOLUTE(__T5Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltINT2Interrupt) ? ABSOLUTE(__AltINT2Interrupt) :
             (DEFINED(__INT2Interrupt) ? ABSOLUTE(__INT2Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltU2RXInterrupt) ? ABSOLUTE(__AltU2RXInterrupt) :
             (DEFINED(__U2RXInterrupt) ? ABSOLUTE(__U2RXInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltU2TXInterrupt) ? ABSOLUTE(__AltU2TXInterrupt) :
             (DEFINED(__U2TXInterrupt) ? ABSOLUTE(__U2TXInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltSPI2Interrupt) ? ABSOLUTE(__AltSPI2Interrupt) :
             (DEFINED(__SPI2Interrupt) ? ABSOLUTE(__SPI2Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltC1Interrupt) ? ABSOLUTE(__AltC1Interrupt) :
             (DEFINED(__C1Interrupt) ? ABSOLUTE(__C1Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC3Interrupt) ? ABSOLUTE(__AltIC3Interrupt) :
             (DEFINED(__IC3Interrupt) ? ABSOLUTE(__IC3Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC4Interrupt) ? ABSOLUTE(__AltIC4Interrupt) :
             (DEFINED(__IC4Interrupt) ? ABSOLUTE(__IC4Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC5Interrupt) ? ABSOLUTE(__AltIC5Interrupt) :
             (DEFINED(__IC5Interrupt) ? ABSOLUTE(__IC5Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltIC6Interrupt) ? ABSOLUTE(__AltIC6Interrupt) :
             (DEFINED(__IC6Interrupt) ? ABSOLUTE(__IC6Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC5Interrupt) ? ABSOLUTE(__AltOC5Interrupt) :
             (DEFINED(__OC5Interrupt) ? ABSOLUTE(__OC5Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC6Interrupt) ? ABSOLUTE(__AltOC6Interrupt) :
             (DEFINED(__OC6Interrupt) ? ABSOLUTE(__OC6Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC7Interrupt) ? ABSOLUTE(__AltOC7Interrupt) :
             (DEFINED(__OC7Interrupt) ? ABSOLUTE(__OC7Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltOC8Interrupt) ? ABSOLUTE(__AltOC8Interrupt) :
             (DEFINED(__OC8Interrupt) ? ABSOLUTE(__OC8Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltINT3Interrupt) ? ABSOLUTE(__AltINT3Interrupt) :
             (DEFINED(__INT3Interrupt) ? ABSOLUTE(__INT3Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltINT4Interrupt) ? ABSOLUTE(__AltINT4Interrupt) :
             (DEFINED(__INT4Interrupt) ? ABSOLUTE(__INT4Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltC2Interrupt) ? ABSOLUTE(__AltC2Interrupt) :
             (DEFINED(__C2Interrupt) ? ABSOLUTE(__C2Interrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltPWMInterrupt) ? ABSOLUTE(__AltPWMInterrupt) :
             (DEFINED(__PWMInterrupt) ? ABSOLUTE(__PWMInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltQEIInterrupt) ? ABSOLUTE(__AltQEIInterrupt) :
             (DEFINED(__QEIInterrupt) ? ABSOLUTE(__QEIInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltDCIInterrupt) ? ABSOLUTE(__AltDCIInterrupt) :
             (DEFINED(__DCIInterrupt) ? ABSOLUTE(__DCIInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltLVDInterrupt) ? ABSOLUTE(__AltLVDInterrupt) :
             (DEFINED(__LVDInterrupt) ? ABSOLUTE(__LVDInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltFLTAInterrupt) ? ABSOLUTE(__AltFLTAInterrupt) :
             (DEFINED(__FLTAInterrupt) ? ABSOLUTE(__FLTAInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltFLTBInterrupt) ? ABSOLUTE(__AltFLTBInterrupt) :
             (DEFINED(__FLTBInterrupt) ? ABSOLUTE(__FLTBInterrupt) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt45) ? ABSOLUTE(__AltInterrupt45) :
             (DEFINED(__Interrupt45) ? ABSOLUTE(__Interrupt45) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt46) ? ABSOLUTE(__AltInterrupt46) :
             (DEFINED(__Interrupt46) ? ABSOLUTE(__Interrupt46) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt47) ? ABSOLUTE(__AltInterrupt47) :
             (DEFINED(__Interrupt47) ? ABSOLUTE(__Interrupt47) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt48) ? ABSOLUTE(__AltInterrupt48) :
             (DEFINED(__Interrupt48) ? ABSOLUTE(__Interrupt48) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt49) ? ABSOLUTE(__AltInterrupt49) :
             (DEFINED(__Interrupt49) ? ABSOLUTE(__Interrupt49) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt50) ? ABSOLUTE(__AltInterrupt50) :
             (DEFINED(__Interrupt50) ? ABSOLUTE(__Interrupt50) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt51) ? ABSOLUTE(__AltInterrupt51) :
             (DEFINED(__Interrupt51) ? ABSOLUTE(__Interrupt51) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt52) ? ABSOLUTE(__AltInterrupt52) :
             (DEFINED(__Interrupt52) ? ABSOLUTE(__Interrupt52) :
             ABSOLUTE(__DefaultInterrupt)));
        LONG( DEFINED(__AltInterrupt53) ? ABSOLUTE(__AltInterrupt53) :
             (DEFINED(__Interrupt53) ? ABSOLUTE(__Interrupt53) :
             ABSOLUTE(__DefaultInterrupt)));
      } >aivt
    } /* SECTIONS */
    #endif


    /*
    ** ============== Equates for SFR Addresses =============
    */

     WREG0 = 0x0;
    _WREG0 = 0x0;
     WREG1 = 0x2;
    _WREG1 = 0x2;
     WREG2 = 0x4;
    _WREG2 = 0x4;
     WREG3 = 0x6;
    _WREG3 = 0x6;
     WREG4 = 0x8;
    _WREG4 = 0x8;
     WREG5 = 0xA;
    _WREG5 = 0xA;
     WREG6 = 0xC;
    _WREG6 = 0xC;
     WREG7 = 0xE;
    _WREG7 = 0xE;
     WREG8 = 0x10;
    _WREG8 = 0x10;
     WREG9 = 0x12;
    _WREG9 = 0x12;
     WREG10 = 0x14;
    _WREG10 = 0x14;
     WREG11 = 0x16;
    _WREG11 = 0x16;
     WREG12 = 0x18;
    _WREG12 = 0x18;
     WREG13 = 0x1A;
    _WREG13 = 0x1A;
     WREG14 = 0x1C;
    _WREG14 = 0x1C;
     WREG15 = 0x1E;
    _WREG15 = 0x1E;
     SPLIM = 0x20;
    _SPLIM = 0x20;
     ACCAL = 0x22;
    _ACCAL = 0x22;
     ACCAH = 0x24;
    _ACCAH = 0x24;
     ACCAU = 0x26;
    _ACCAU = 0x26;
     ACCBL = 0x28;
    _ACCBL = 0x28;
     ACCBH = 0x2A;
    _ACCBH = 0x2A;
     ACCBU = 0x2C;
    _ACCBU = 0x2C;
     PCL = 0x2E;
    _PCL = 0x2E;
     PCH = 0x30;
    _PCH = 0x30;
     TBLPAG = 0x32;
    _TBLPAG = 0x32;
     PSVPAG = 0x34;
    _PSVPAG = 0x34;
     RCOUNT = 0x36;
    _RCOUNT = 0x36;
     DCOUNT = 0x38;
    _DCOUNT = 0x38;
     DOSTARTL = 0x3A;
    _DOSTARTL = 0x3A;
     DOSTARTH = 0x3C;
    _DOSTARTH = 0x3C;
     DOENDL = 0x3E;
    _DOENDL = 0x3E;
     DOENDH = 0x40;
    _DOENDH = 0x40;
     SR = 0x42;
    _SR = 0x42;
    _SRbits = 0x42;
     CORCON = 0x44;
    _CORCON = 0x44;
    _CORCONbits = 0x44;
     MODCON = 0x46;
    _MODCON = 0x46;
    _MODCONbits = 0x46;
     XMODSRT = 0x48;
    _XMODSRT = 0x48;
     XMODEND = 0x4A;
    _XMODEND = 0x4A;
     YMODSRT = 0x4C;
    _YMODSRT = 0x4C;
     YMODEND = 0x4E;
    _YMODEND = 0x4E;
     XBREV = 0x50;
    _XBREV = 0x50;
    _XBREVbits = 0x50;
     DISICNT = 0x52;
    _DISICNT = 0x52;
    _DISICNTbits = 0x52;
     INTCON1 = 0x80;
    _INTCON1 = 0x80;
    _INTCON1bits = 0x80;
     INTCON2 = 0x82;
    _INTCON2 = 0x82;
    _INTCON2bits = 0x82;
     IFS0 = 0x84;
    _IFS0 = 0x84;
    _IFS0bits = 0x84;
     IFS1 = 0x86;
    _IFS1 = 0x86;
    _IFS1bits = 0x86;
     IFS2 = 0x88;
    _IFS2 = 0x88;
    _IFS2bits = 0x88;
     IEC0 = 0x8C;
    _IEC0 = 0x8C;
    _IEC0bits = 0x8C;
     IEC1 = 0x8E;
    _IEC1 = 0x8E;
    _IEC1bits = 0x8E;
     IEC2 = 0x90;
    _IEC2 = 0x90;
    _IEC2bits = 0x90;
     IPC0 = 0x94;
    _IPC0 = 0x94;
    _IPC0bits = 0x94;
     IPC1 = 0x96;
    _IPC1 = 0x96;
    _IPC1bits = 0x96;
     IPC2 = 0x98;
    _IPC2 = 0x98;
    _IPC2bits = 0x98;
     IPC3 = 0x9A;
    _IPC3 = 0x9A;
    _IPC3bits = 0x9A;
     IPC4 = 0x9C;
    _IPC4 = 0x9C;
    _IPC4bits = 0x9C;
     IPC5 = 0x9E;
    _IPC5 = 0x9E;
    _IPC5bits = 0x9E;
     IPC6 = 0xA0;
    _IPC6 = 0xA0;
    _IPC6bits = 0xA0;
     IPC7 = 0xA2;
    _IPC7 = 0xA2;
    _IPC7bits = 0xA2;
     IPC8 = 0xA4;
    _IPC8 = 0xA4;
    _IPC8bits = 0xA4;
     IPC9 = 0xA6;
    _IPC9 = 0xA6;
    _IPC9bits = 0xA6;
     IPC10 = 0xA8;
    _IPC10 = 0xA8;
    _IPC10bits = 0xA8;
     INTTREG = 0xB0;
    _INTTREG = 0xB0;
    _INTTREGbits = 0xB0;
     CNEN1 = 0xC0;
    _CNEN1 = 0xC0;
    _CNEN1bits = 0xC0;
     CNEN2 = 0xC2;
    _CNEN2 = 0xC2;
    _CNEN2bits = 0xC2;
     CNPU1 = 0xC4;
    _CNPU1 = 0xC4;
    _CNPU1bits = 0xC4;
     CNPU2 = 0xC6;
    _CNPU2 = 0xC6;
    _CNPU2bits = 0xC6;
     TMR1 = 0x100;
    _TMR1 = 0x100;
     PR1 = 0x102;
    _PR1 = 0x102;
     T1CON = 0x104;
    _T1CON = 0x104;
    _T1CONbits = 0x104;
     TMR2 = 0x106;
    _TMR2 = 0x106;
     TMR3HLD = 0x108;
    _TMR3HLD = 0x108;
     TMR3 = 0x10A;
    _TMR3 = 0x10A;
     PR2 = 0x10C;
    _PR2 = 0x10C;
     PR3 = 0x10E;
    _PR3 = 0x10E;
     T2CON = 0x110;
    _T2CON = 0x110;
    _T2CONbits = 0x110;
     T3CON = 0x112;
    _T3CON = 0x112;
    _T3CONbits = 0x112;
     TMR4 = 0x114;
    _TMR4 = 0x114;
     TMR5HLD = 0x116;
    _TMR5HLD = 0x116;
     TMR5 = 0x118;
    _TMR5 = 0x118;
     PR4 = 0x11A;
    _PR4 = 0x11A;
     PR5 = 0x11C;
    _PR5 = 0x11C;
     T4CON = 0x11E;
    _T4CON = 0x11E;
    _T4CONbits = 0x11E;
     T5CON = 0x120;
    _T5CON = 0x120;
    _T5CONbits = 0x120;
     IC1BUF = 0x140;
    _IC1BUF = 0x140;
     IC1CON = 0x142;
    _IC1CON = 0x142;
    _IC1CONbits = 0x142;
     IC2BUF = 0x144;
    _IC2BUF = 0x144;
     IC2CON = 0x146;
    _IC2CON = 0x146;
    _IC2CONbits = 0x146;
     IC3BUF = 0x148;
    _IC3BUF = 0x148;
     IC3CON = 0x14A;
    _IC3CON = 0x14A;
    _IC3CONbits = 0x14A;
     IC4BUF = 0x14C;
    _IC4BUF = 0x14C;
     IC4CON = 0x14E;
    _IC4CON = 0x14E;
    _IC4CONbits = 0x14E;
     IC5BUF = 0x150;
    _IC5BUF = 0x150;
     IC5CON = 0x152;
    _IC5CON = 0x152;
    _IC5CONbits = 0x152;
     IC6BUF = 0x154;
    _IC6BUF = 0x154;
     IC6CON = 0x156;
    _IC6CON = 0x156;
    _IC6CONbits = 0x156;
     IC7BUF = 0x158;
    _IC7BUF = 0x158;
     IC7CON = 0x15A;
    _IC7CON = 0x15A;
    _IC7CONbits = 0x15A;
     IC8BUF = 0x15C;
    _IC8BUF = 0x15C;
     IC8CON = 0x15E;
    _IC8CON = 0x15E;
    _IC8CONbits = 0x15E;
     OC1RS = 0x180;
    _OC1RS = 0x180;
     OC1R = 0x182;
    _OC1R = 0x182;
     OC1CON = 0x184;
    _OC1CON = 0x184;
    _OC1CONbits = 0x184;
     OC2RS = 0x186;
    _OC2RS = 0x186;
     OC2R = 0x188;
    _OC2R = 0x188;
     OC2CON = 0x18A;
    _OC2CON = 0x18A;
    _OC2CONbits = 0x18A;
     OC3RS = 0x18C;
    _OC3RS = 0x18C;
     OC3R = 0x18E;
    _OC3R = 0x18E;
     OC3CON = 0x190;
    _OC3CON = 0x190;
    _OC3CONbits = 0x190;
     OC4RS = 0x192;
    _OC4RS = 0x192;
     OC4R = 0x194;
    _OC4R = 0x194;
     OC4CON = 0x196;
    _OC4CON = 0x196;
    _OC4CONbits = 0x196;
     OC5RS = 0x198;
    _OC5RS = 0x198;
     OC5R = 0x19A;
    _OC5R = 0x19A;
     OC5CON = 0x19C;
    _OC5CON = 0x19C;
    _OC5CONbits = 0x19C;
     OC6RS = 0x19E;
    _OC6RS = 0x19E;
     OC6R = 0x1A0;
    _OC6R = 0x1A0;
     OC6CON = 0x1A2;
    _OC6CON = 0x1A2;
    _OC6CONbits = 0x1A2;
     OC7RS = 0x1A4;
    _OC7RS = 0x1A4;
     OC7R = 0x1A6;
    _OC7R = 0x1A6;
     OC7CON = 0x1A8;
    _OC7CON = 0x1A8;
    _OC7CONbits = 0x1A8;
     OC8RS = 0x1AA;
    _OC8RS = 0x1AA;
     OC8R = 0x1AC;
    _OC8R = 0x1AC;
     OC8CON = 0x1AE;
    _OC8CON = 0x1AE;
    _OC8CONbits = 0x1AE;
     I2CRCV = 0x200;
    _I2CRCV = 0x200;
    _I2CRCVbits = 0x200;
     I2CTRN = 0x202;
    _I2CTRN = 0x202;
    _I2CTRNbits = 0x202;
     I2CBRG = 0x204;
    _I2CBRG = 0x204;
    _I2CBRGbits = 0x204;
     I2CCON = 0x206;
    _I2CCON = 0x206;
    _I2CCONbits = 0x206;
     I2CSTAT = 0x208;
    _I2CSTAT = 0x208;
    _I2CSTATbits = 0x208;
     I2CADD = 0x20A;
    _I2CADD = 0x20A;
    _I2CADDbits = 0x20A;
     U1MODE = 0x20C;
    _U1MODE = 0x20C;
    _U1MODEbits = 0x20C;
     U1STA = 0x20E;
    _U1STA = 0x20E;
    _U1STAbits = 0x20E;
     U1TXREG = 0x210;
    _U1TXREG = 0x210;
    _U1TXREGbits = 0x210;
     U1RXREG = 0x212;
    _U1RXREG = 0x212;
    _U1RXREGbits = 0x212;
     U1BRG = 0x214;
    _U1BRG = 0x214;
     U2MODE = 0x216;
    _U2MODE = 0x216;
    _U2MODEbits = 0x216;
     U2STA = 0x218;
    _U2STA = 0x218;
    _U2STAbits = 0x218;
     U2TXREG = 0x21A;
    _U2TXREG = 0x21A;
    _U2TXREGbits = 0x21A;
     U2RXREG = 0x21C;
    _U2RXREG = 0x21C;
    _U2RXREGbits = 0x21C;
     U2BRG = 0x21E;
    _U2BRG = 0x21E;
     SPI1STAT = 0x220;
    _SPI1STAT = 0x220;
    _SPI1STATbits = 0x220;
     SPI1CON = 0x222;
    _SPI1CON = 0x222;
    _SPI1CONbits = 0x222;
     SPI1BUF = 0x224;
    _SPI1BUF = 0x224;
     SPI2STAT = 0x226;
    _SPI2STAT = 0x226;
    _SPI2STATbits = 0x226;
     SPI2CON = 0x228;
    _SPI2CON = 0x228;
    _SPI2CONbits = 0x228;
     SPI2BUF = 0x22A;
    _SPI2BUF = 0x22A;
     DCICON1 = 0x240;
    _DCICON1 = 0x240;
    _DCICON1bits = 0x240;
     DCICON2 = 0x242;
    _DCICON2 = 0x242;
    _DCICON2bits = 0x242;
     DCICON3 = 0x244;
    _DCICON3 = 0x244;
    _DCICON3bits = 0x244;
     DCISTAT = 0x246;
    _DCISTAT = 0x246;
    _DCISTATbits = 0x246;
     TSCON = 0x248;
    _TSCON = 0x248;
    _TSCONbits = 0x248;
     RSCON = 0x24C;
    _RSCON = 0x24C;
    _RSCONbits = 0x24C;
     RXBUF0 = 0x250;
    _RXBUF0 = 0x250;
     RXBUF1 = 0x252;
    _RXBUF1 = 0x252;
     RXBUF2 = 0x254;
    _RXBUF2 = 0x254;
     RXBUF3 = 0x256;
    _RXBUF3 = 0x256;
     TXBUF0 = 0x258;
    _TXBUF0 = 0x258;
     TXBUF1 = 0x25A;
    _TXBUF1 = 0x25A;
     TXBUF2 = 0x25C;
    _TXBUF2 = 0x25C;
     TXBUF3 = 0x25E;
    _TXBUF3 = 0x25E;
     ADCBUF0 = 0x280;
    _ADCBUF0 = 0x280;
     ADCBUF1 = 0x282;
    _ADCBUF1 = 0x282;
     ADCBUF2 = 0x284;
    _ADCBUF2 = 0x284;
     ADCBUF3 = 0x286;
    _ADCBUF3 = 0x286;
     ADCBUF4 = 0x288;
    _ADCBUF4 = 0x288;
     ADCBUF5 = 0x28A;
    _ADCBUF5 = 0x28A;
     ADCBUF6 = 0x28C;
    _ADCBUF6 = 0x28C;
     ADCBUF7 = 0x28E;
    _ADCBUF7 = 0x28E;
     ADCBUF8 = 0x290;
    _ADCBUF8 = 0x290;
     ADCBUF9 = 0x292;
    _ADCBUF9 = 0x292;
     ADCBUFA = 0x294;
    _ADCBUFA = 0x294;
     ADCBUFB = 0x296;
    _ADCBUFB = 0x296;
     ADCBUFC = 0x298;
    _ADCBUFC = 0x298;
     ADCBUFD = 0x29A;
    _ADCBUFD = 0x29A;
     ADCBUFE = 0x29C;
    _ADCBUFE = 0x29C;
     ADCBUFF = 0x29E;
    _ADCBUFF = 0x29E;
     ADCON1 = 0x2A0;
    _ADCON1 = 0x2A0;
    _ADCON1bits = 0x2A0;
     ADCON2 = 0x2A2;
    _ADCON2 = 0x2A2;
    _ADCON2bits = 0x2A2;
     ADCON3 = 0x2A4;
    _ADCON3 = 0x2A4;
    _ADCON3bits = 0x2A4;
     ADCHS = 0x2A6;
    _ADCHS = 0x2A6;
    _ADCHSbits = 0x2A6;
     ADPCFG = 0x2A8;
    _ADPCFG = 0x2A8;
    _ADPCFGbits = 0x2A8;
     ADCSSL = 0x2AA;
    _ADCSSL = 0x2AA;
    _ADCSSLbits = 0x2AA;
     TRISB = 0x2C6;
    _TRISB = 0x2C6;
    _TRISBbits = 0x2C6;
     PORTB = 0x2C8;
    _PORTB = 0x2C8;
    _PORTBbits = 0x2C8;
     LATB = 0x2CA;
    _LATB = 0x2CA;
    _LATBbits = 0x2CA;
     TRISC = 0x2CC;
    _TRISC = 0x2CC;
    _TRISCbits = 0x2CC;
     PORTC = 0x2CE;
    _PORTC = 0x2CE;
    _PORTCbits = 0x2CE;
     LATC = 0x2D0;
    _LATC = 0x2D0;
    _LATCbits = 0x2D0;
     TRISD = 0x2D2;
    _TRISD = 0x2D2;
    _TRISDbits = 0x2D2;
     PORTD = 0x2D4;
    _PORTD = 0x2D4;
    _PORTDbits = 0x2D4;
     LATD = 0x2D6;
    _LATD = 0x2D6;
    _LATDbits = 0x2D6;
     TRISF = 0x2DE;
    _TRISF = 0x2DE;
    _TRISFbits = 0x2DE;
     PORTF = 0x2E0;
    _PORTF = 0x2E0;
    _PORTFbits = 0x2E0;
     LATF = 0x2E2;
    _LATF = 0x2E2;
    _LATFbits = 0x2E2;
     TRISG = 0x2E4;
    _TRISG = 0x2E4;
    _TRISGbits = 0x2E4;
     PORTG = 0x2E6;
    _PORTG = 0x2E6;
    _PORTGbits = 0x2E6;
     LATG = 0x2E8;
    _LATG = 0x2E8;
    _LATGbits = 0x2E8;
     C1RXF0SID = 0x300;
    _C1RXF0SID = 0x300;
    _C1RXF0SIDbits = 0x300;
     C1RXF0EIDH = 0x302;
    _C1RXF0EIDH = 0x302;
    _C1RXF0EIDHbits = 0x302;
     C1RXF0EIDL = 0x304;
    _C1RXF0EIDL = 0x304;
    _C1RXF0EIDLbits = 0x304;
     C1RXF1SID = 0x308;
    _C1RXF1SID = 0x308;
    _C1RXF1SIDbits = 0x308;
     C1RXF1EIDH = 0x30A;
    _C1RXF1EIDH = 0x30A;
    _C1RXF1EIDHbits = 0x30A;
     C1RXF1EIDL = 0x30C;
    _C1RXF1EIDL = 0x30C;
    _C1RXF1EIDLbits = 0x30C;
     C1RXF2SID = 0x310;
    _C1RXF2SID = 0x310;
    _C1RXF2SIDbits = 0x310;
     C1RXF2EIDH = 0x312;
    _C1RXF2EIDH = 0x312;
    _C1RXF2EIDHbits = 0x312;
     C1RXF2EIDL = 0x314;
    _C1RXF2EIDL = 0x314;
    _C1RXF2EIDLbits = 0x314;
     C1RXF3SID = 0x318;
    _C1RXF3SID = 0x318;
    _C1RXF3SIDbits = 0x318;
     C1RXF3EIDH = 0x31A;
    _C1RXF3EIDH = 0x31A;
    _C1RXF3EIDHbits = 0x31A;
     C1RXF3EIDL = 0x31C;
    _C1RXF3EIDL = 0x31C;
    _C1RXF3EIDLbits = 0x31C;
     C1RXF4SID = 0x320;
    _C1RXF4SID = 0x320;
    _C1RXF4SIDbits = 0x320;
     C1RXF4EIDH = 0x322;
    _C1RXF4EIDH = 0x322;
    _C1RXF4EIDHbits = 0x322;
     C1RXF4EIDL = 0x324;
    _C1RXF4EIDL = 0x324;
    _C1RXF4EIDLbits = 0x324;
     C1RXF5SID = 0x328;
    _C1RXF5SID = 0x328;
    _C1RXF5SIDbits = 0x328;
     C1RXF5EIDH = 0x32A;
    _C1RXF5EIDH = 0x32A;
    _C1RXF5EIDHbits = 0x32A;
     C1RXF5EIDL = 0x32C;
    _C1RXF5EIDL = 0x32C;
    _C1RXF5EIDLbits = 0x32C;
     C1RXM0SID = 0x330;
    _C1RXM0SID = 0x330;
    _C1RXM0SIDbits = 0x330;
     C1RXM0EIDH = 0x332;
    _C1RXM0EIDH = 0x332;
    _C1RXM0EIDHbits = 0x332;
     C1RXM0EIDL = 0x334;
    _C1RXM0EIDL = 0x334;
    _C1RXM0EIDLbits = 0x334;
     C1RXM1SID = 0x338;
    _C1RXM1SID = 0x338;
    _C1RXM1SIDbits = 0x338;
     C1RXM1EIDH = 0x33A;
    _C1RXM1EIDH = 0x33A;
    _C1RXM1EIDHbits = 0x33A;
     C1RXM1EIDL = 0x33C;
    _C1RXM1EIDL = 0x33C;
    _C1RXM1EIDLbits = 0x33C;
     C1TX2SID = 0x340;
    _C1TX2SID = 0x340;
    _C1TX2SIDbits = 0x340;
     C1TX2EID = 0x342;
    _C1TX2EID = 0x342;
    _C1TX2EIDbits = 0x342;
     C1TX2DLC = 0x344;
    _C1TX2DLC = 0x344;
    _C1TX2DLCbits = 0x344;
     C1TX2B1 = 0x346;
    _C1TX2B1 = 0x346;
    _C1TX2B1bits = 0x346;
     C1TX2B2 = 0x348;
    _C1TX2B2 = 0x348;
    _C1TX2B2bits = 0x348;
     C1TX2B3 = 0x34A;
    _C1TX2B3 = 0x34A;
    _C1TX2B3bits = 0x34A;
     C1TX2B4 = 0x34C;
    _C1TX2B4 = 0x34C;
    _C1TX2B4bits = 0x34C;
     C1TX2CON = 0x34E;
    _C1TX2CON = 0x34E;
    _C1TX2CONbits = 0x34E;
     C1TX1SID = 0x350;
    _C1TX1SID = 0x350;
    _C1TX1SIDbits = 0x350;
     C1TX1EID = 0x352;
    _C1TX1EID = 0x352;
    _C1TX1EIDbits = 0x352;
     C1TX1DLC = 0x354;
    _C1TX1DLC = 0x354;
    _C1TX1DLCbits = 0x354;
     C1TX1B1 = 0x356;
    _C1TX1B1 = 0x356;
    _C1TX1B1bits = 0x356;
     C1TX1B2 = 0x358;
    _C1TX1B2 = 0x358;
    _C1TX1B2bits = 0x358;
     C1TX1B3 = 0x35A;
    _C1TX1B3 = 0x35A;
    _C1TX1B3bits = 0x35A;
     C1TX1B4 = 0x35C;
    _C1TX1B4 = 0x35C;
    _C1TX1B4bits = 0x35C;
     C1TX1CON = 0x35E;
    _C1TX1CON = 0x35E;
    _C1TX1CONbits = 0x35E;
     C1TX0SID = 0x360;
    _C1TX0SID = 0x360;
    _C1TX0SIDbits = 0x360;
     C1TX0EID = 0x362;
    _C1TX0EID = 0x362;
    _C1TX0EIDbits = 0x362;
     C1TX0DLC = 0x364;
    _C1TX0DLC = 0x364;
    _C1TX0DLCbits = 0x364;
     C1TX0B1 = 0x366;
    _C1TX0B1 = 0x366;
    _C1TX0B1bits = 0x366;
     C1TX0B2 = 0x368;
    _C1TX0B2 = 0x368;
    _C1TX0B2bits = 0x368;
     C1TX0B3 = 0x36A;
    _C1TX0B3 = 0x36A;
    _C1TX0B3bits = 0x36A;
     C1TX0B4 = 0x36C;
    _C1TX0B4 = 0x36C;
    _C1TX0B4bits = 0x36C;
     C1TX0CON = 0x36E;
    _C1TX0CON = 0x36E;
    _C1TX0CONbits = 0x36E;
     C1RX1SID = 0x370;
    _C1RX1SID = 0x370;
    _C1RX1SIDbits = 0x370;
     C1RX1EID = 0x372;
    _C1RX1EID = 0x372;
    _C1RX1EIDbits = 0x372;
     C1RX1DLC = 0x374;
    _C1RX1DLC = 0x374;
    _C1RX1DLCbits = 0x374;
     C1RX1B1 = 0x376;
    _C1RX1B1 = 0x376;
    _C1RX1B1bits = 0x376;
     C1RX1B2 = 0x378;
    _C1RX1B2 = 0x378;
    _C1RX1B2bits = 0x378;
     C1RX1B3 = 0x37A;
    _C1RX1B3 = 0x37A;
    _C1RX1B3bits = 0x37A;
     C1RX1B4 = 0x37C;
    _C1RX1B4 = 0x37C;
    _C1RX1B4bits = 0x37C;
     C1RX1CON = 0x37E;
    _C1RX1CON = 0x37E;
    _C1RX1CONbits = 0x37E;
     C1RX0SID = 0x380;
    _C1RX0SID = 0x380;
    _C1RX0SIDbits = 0x380;
     C1RX0EID = 0x382;
    _C1RX0EID = 0x382;
    _C1RX0EIDbits = 0x382;
     C1RX0DLC = 0x384;
    _C1RX0DLC = 0x384;
    _C1RX0DLCbits = 0x384;
     C1RX0B1 = 0x386;
    _C1RX0B1 = 0x386;
    _C1RX0B1bits = 0x386;
     C1RX0B2 = 0x388;
    _C1RX0B2 = 0x388;
    _C1RX0B2bits = 0x388;
     C1RX0B3 = 0x38A;
    _C1RX0B3 = 0x38A;
    _C1RX0B3bits = 0x38A;
     C1RX0B4 = 0x38C;
    _C1RX0B4 = 0x38C;
    _C1RX0B4bits = 0x38C;
     C1RX0CON = 0x38E;
    _C1RX0CON = 0x38E;
    _C1RX0CONbits = 0x38E;
     C1CTRL = 0x390;
    _C1CTRL = 0x390;
    _C1CTRLbits = 0x390;
     C1CFG1 = 0x392;
    _C1CFG1 = 0x392;
    _C1CFG1bits = 0x392;
     C1CFG2 = 0x394;
    _C1CFG2 = 0x394;
    _C1CFG2bits = 0x394;
     C1INTF = 0x396;
    _C1INTF = 0x396;
    _C1INTFbits = 0x396;
     C1INTE = 0x398;
    _C1INTE = 0x398;
    _C1INTEbits = 0x398;
     C1EC = 0x39A;
    _C1EC = 0x39A;
    _C1ECbits = 0x39A;
     C1RERRCNT = 0x39A;
    _C1RERRCNT = 0x39A;
     C1TERRCNT = 0x39B;
    _C1TERRCNT = 0x39B;
     C2RXF0SID = 0x3C0;
    _C2RXF0SID = 0x3C0;
    _C2RXF0SIDbits = 0x3C0;
     C2RXF0EIDH = 0x3C2;
    _C2RXF0EIDH = 0x3C2;
    _C2RXF0EIDHbits = 0x3C2;
     C2RXF0EIDL = 0x3C4;
    _C2RXF0EIDL = 0x3C4;
    _C2RXF0EIDLbits = 0x3C4;
     C2RXF1SID = 0x3C8;
    _C2RXF1SID = 0x3C8;
    _C2RXF1SIDbits = 0x3C8;
     C2RXF1EIDH = 0x3CA;
    _C2RXF1EIDH = 0x3CA;
    _C2RXF1EIDHbits = 0x3CA;
     C2RXF1EIDL = 0x3CC;
    _C2RXF1EIDL = 0x3CC;
    _C2RXF1EIDLbits = 0x3CC;
     C2RXF2SID = 0x3D0;
    _C2RXF2SID = 0x3D0;
    _C2RXF2SIDbits = 0x3D0;
     C2RXF2EIDH = 0x3D2;
    _C2RXF2EIDH = 0x3D2;
    _C2RXF2EIDHbits = 0x3D2;
     C2RXF2EIDL = 0x3D4;
    _C2RXF2EIDL = 0x3D4;
    _C2RXF2EIDLbits = 0x3D4;
     C2RXF3SID = 0x3D8;
    _C2RXF3SID = 0x3D8;
    _C2RXF3SIDbits = 0x3D8;
     C2RXF3EIDH = 0x3DA;
    _C2RXF3EIDH = 0x3DA;
    _C2RXF3EIDHbits = 0x3DA;
     C2RXF3EIDL = 0x3DC;
    _C2RXF3EIDL = 0x3DC;
    _C2RXF3EIDLbits = 0x3DC;
     C2RXF4SID = 0x3E0;
    _C2RXF4SID = 0x3E0;
    _C2RXF4SIDbits = 0x3E0;
     C2RXF4EIDH = 0x3E2;
    _C2RXF4EIDH = 0x3E2;
    _C2RXF4EIDHbits = 0x3E2;
     C2RXF4EIDL = 0x3E4;
    _C2RXF4EIDL = 0x3E4;
    _C2RXF4EIDLbits = 0x3E4;
     C2RXF5SID = 0x3E8;
    _C2RXF5SID = 0x3E8;
    _C2RXF5SIDbits = 0x3E8;
     C2RXF5EIDH = 0x3EA;
    _C2RXF5EIDH = 0x3EA;
    _C2RXF5EIDHbits = 0x3EA;
     C2RXF5EIDL = 0x3EC;
    _C2RXF5EIDL = 0x3EC;
    _C2RXF5EIDLbits = 0x3EC;
     C2RXM0SID = 0x3F0;
    _C2RXM0SID = 0x3F0;
    _C2RXM0SIDbits = 0x3F0;
     C2RXM0EIDH = 0x3F2;
    _C2RXM0EIDH = 0x3F2;
    _C2RXM0EIDHbits = 0x3F2;
     C2RXM0EIDL = 0x3F4;
    _C2RXM0EIDL = 0x3F4;
    _C2RXM0EIDLbits = 0x3F4;
     C2RXM1SID = 0x3F8;
    _C2RXM1SID = 0x3F8;
    _C2RXM1SIDbits = 0x3F8;
     C2RXM1EIDH = 0x3FA;
    _C2RXM1EIDH = 0x3FA;
    _C2RXM1EIDHbits = 0x3FA;
     C2RXM1EIDL = 0x3FC;
    _C2RXM1EIDL = 0x3FC;
    _C2RXM1EIDLbits = 0x3FC;
     C2TX2SID = 0x400;
    _C2TX2SID = 0x400;
    _C2TX2SIDbits = 0x400;
     C2TX2EID = 0x402;
    _C2TX2EID = 0x402;
    _C2TX2EIDbits = 0x402;
     C2TX2DLC = 0x404;
    _C2TX2DLC = 0x404;
    _C2TX2DLCbits = 0x404;
     C2TX2B1 = 0x406;
    _C2TX2B1 = 0x406;
    _C2TX2B1bits = 0x406;
     C2TX2B2 = 0x408;
    _C2TX2B2 = 0x408;
    _C2TX2B2bits = 0x408;
     C2TX2B3 = 0x40A;
    _C2TX2B3 = 0x40A;
    _C2TX2B3bits = 0x40A;
     C2TX2B4 = 0x40C;
    _C2TX2B4 = 0x40C;
    _C2TX2B4bits = 0x40C;
     C2TX2CON = 0x40E;
    _C2TX2CON = 0x40E;
    _C2TX2CONbits = 0x40E;
     C2TX1SID = 0x410;
    _C2TX1SID = 0x410;
    _C2TX1SIDbits = 0x410;
     C2TX1EID = 0x412;
    _C2TX1EID = 0x412;
    _C2TX1EIDbits = 0x412;
     C2TX1DLC = 0x414;
    _C2TX1DLC = 0x414;
    _C2TX1DLCbits = 0x414;
     C2TX1B1 = 0x416;
    _C2TX1B1 = 0x416;
    _C2TX1B1bits = 0x416;
     C2TX1B2 = 0x418;
    _C2TX1B2 = 0x418;
    _C2TX1B2bits = 0x418;
     C2TX1B3 = 0x41A;
    _C2TX1B3 = 0x41A;
    _C2TX1B3bits = 0x41A;
     C2TX1B4 = 0x41C;
    _C2TX1B4 = 0x41C;
    _C2TX1B4bits = 0x41C;
     C2TX1CON = 0x41E;
    _C2TX1CON = 0x41E;
    _C2TX1CONbits = 0x41E;
     C2TX0SID = 0x420;
    _C2TX0SID = 0x420;
    _C2TX0SIDbits = 0x420;
     C2TX0EID = 0x422;
    _C2TX0EID = 0x422;
    _C2TX0EIDbits = 0x422;
     C2TX0DLC = 0x424;
    _C2TX0DLC = 0x424;
    _C2TX0DLCbits = 0x424;
     C2TX0B1 = 0x426;
    _C2TX0B1 = 0x426;
    _C2TX0B1bits = 0x426;
     C2TX0B2 = 0x428;
    _C2TX0B2 = 0x428;
    _C2TX0B2bits = 0x428;
     C2TX0B3 = 0x42A;
    _C2TX0B3 = 0x42A;
    _C2TX0B3bits = 0x42A;
     C2TX0B4 = 0x42C;
    _C2TX0B4 = 0x42C;
    _C2TX0B4bits = 0x42C;
     C2TX0CON = 0x42E;
    _C2TX0CON = 0x42E;
    _C2TX0CONbits = 0x42E;
     C2RX1SID = 0x430;
    _C2RX1SID = 0x430;
    _C2RX1SIDbits = 0x430;
     C2RX1EID = 0x432;
    _C2RX1EID = 0x432;
    _C2RX1EIDbits = 0x432;
     C2RX1DLC = 0x434;
    _C2RX1DLC = 0x434;
    _C2RX1DLCbits = 0x434;
     C2RX1B1 = 0x436;
    _C2RX1B1 = 0x436;
    _C2RX1B1bits = 0x436;
     C2RX1B2 = 0x438;
    _C2RX1B2 = 0x438;
    _C2RX1B2bits = 0x438;
     C2RX1B3 = 0x43A;
    _C2RX1B3 = 0x43A;
    _C2RX1B3bits = 0x43A;
     C2RX1B4 = 0x43C;
    _C2RX1B4 = 0x43C;
    _C2RX1B4bits = 0x43C;
     C2RX1CON = 0x43E;
    _C2RX1CON = 0x43E;
    _C2RX1CONbits = 0x43E;
     C2RX0SID = 0x440;
    _C2RX0SID = 0x440;
    _C2RX0SIDbits = 0x440;
     C2RX0EID = 0x442;
    _C2RX0EID = 0x442;
    _C2RX0EIDbits = 0x442;
     C2RX0DLC = 0x444;
    _C2RX0DLC = 0x444;
    _C2RX0DLCbits = 0x444;
     C2RX0B1 = 0x446;
    _C2RX0B1 = 0x446;
    _C2RX0B1bits = 0x446;
     C2RX0B2 = 0x448;
    _C2RX0B2 = 0x448;
    _C2RX0B2bits = 0x448;
     C2RX0B3 = 0x44A;
    _C2RX0B3 = 0x44A;
    _C2RX0B3bits = 0x44A;
     C2RX0B4 = 0x44C;
    _C2RX0B4 = 0x44C;
    _C2RX0B4bits = 0x44C;
     C2RX0CON = 0x44E;
    _C2RX0CON = 0x44E;
    _C2RX0CONbits = 0x44E;
     C2CTRL = 0x450;
    _C2CTRL = 0x450;
    _C2CTRLbits = 0x450;
     C2CFG1 = 0x452;
    _C2CFG1 = 0x452;
    _C2CFG1bits = 0x452;
     C2CFG2 = 0x454;
    _C2CFG2 = 0x454;
    _C2CFG2bits = 0x454;
     C2INTF = 0x456;
    _C2INTF = 0x456;
    _C2INTFbits = 0x456;
     C2INTE = 0x458;
    _C2INTE = 0x458;
    _C2INTEbits = 0x458;
     C2EC = 0x45A;
    _C2EC = 0x45A;
    _C2ECbits = 0x45A;
     C2RERRCNT = 0x45A;
    _C2RERRCNT = 0x45A;
     C2TERRCNT = 0x45B;
    _C2TERRCNT = 0x45B;
     RCON = 0x740;
    _RCON = 0x740;
    _RCONbits = 0x740;
     OSCCON = 0x742;
    _OSCCON = 0x742;
    _OSCCONbits = 0x742;
     OSCCONL = 0x742;
    _OSCCONL = 0x742;
     OSCCONH = 0x743;
    _OSCCONH = 0x743;
     OSCTUN = 0x744;
    _OSCTUN = 0x744;
    _OSCTUNbits = 0x744;
     BSRAM = 0x750;
    _BSRAM = 0x750;
    _BSRAMbits = 0x750;
     SSRAM = 0x752;
    _SSRAM = 0x752;
    _SSRAMbits = 0x752;
     NVMCON = 0x760;
    _NVMCON = 0x760;
    _NVMCONbits = 0x760;
     NVMADR = 0x762;
    _NVMADR = 0x762;
     NVMADRU = 0x764;
    _NVMADRU = 0x764;
    _NVMADRUbits = 0x764;
     NVMKEY = 0x766;
    _NVMKEY = 0x766;
     PMD1 = 0x770;
    _PMD1 = 0x770;
    _PMD1bits = 0x770;
     PMD2 = 0x772;
    _PMD2 = 0x772;
    _PMD2bits = 0x772;
    /*
    ** ======= Base Addresses for Various Peripherals and ACC ======
    */

     ACCA = 0x22;
    _ACCA = 0x22;
     ACCB = 0x28;
    _ACCB = 0x28;
     CAN1 = 0x300;
    _CAN1 = 0x300;
     CAN2 = 0x3C0;
    _CAN2 = 0x3C0;
     IC1 = 0x140;
    _IC1 = 0x140;
     IC2 = 0x144;
    _IC2 = 0x144;
     IC3 = 0x148;
    _IC3 = 0x148;
     IC4 = 0x14C;
    _IC4 = 0x14C;
     IC5 = 0x150;
    _IC5 = 0x150;
     IC6 = 0x154;
    _IC6 = 0x154;
     IC7 = 0x158;
    _IC7 = 0x158;
     IC8 = 0x15C;
    _IC8 = 0x15C;
     OC1 = 0x180;
    _OC1 = 0x180;
     OC2 = 0x186;
    _OC2 = 0x186;
     OC3 = 0x18C;
    _OC3 = 0x18C;
     OC4 = 0x192;
    _OC4 = 0x192;
     OC5 = 0x198;
    _OC5 = 0x198;
     OC6 = 0x19E;
    _OC6 = 0x19E;
     OC7 = 0x1A4;
    _OC7 = 0x1A4;
     OC8 = 0x1AA;
    _OC8 = 0x1AA;
     SPI1 = 0x220;
    _SPI1 = 0x220;
     SPI2 = 0x226;
    _SPI2 = 0x226;
     UART1 = 0x20C;
    _UART1 = 0x20C;
     UART2 = 0x216;
    _UART2 = 0x216;

     
    Bill B.
     
    #9
    aschen0866
    Super Member
    • Total Posts : 4161
    • Reward points : 0
    • Joined: 2006/01/08 22:18:32
    • Location: San Diego
    • Status: offline
    Re: RE: Is it possible to relocate the interrupt vector table? 2017/11/13 15:58:02 (permalink)
    0

     
    .text :
    {
    /*
    ** WJB: This writes the bootloader timeout value as specified by AN1094. 2017-10-31
    */
    SHORT(0x0B); /* Bootloader timeout in sec, used by AN1094 bootloader */
    *(.init);
    *(.user_init);
    KEEP (*(.handle));
    KEEP (*(.isr*));
    *(.libc) *(.libm) *(.libdsp); /* keep together in this order */
    *(.lib*);
    /*** *(.text); ***/
    } >program
     

    Why do you have bootloader "timeout value" in the application linker script? Anyway, when bootloader decides to jump to the application, what address does it use for the jump? The *(.init) represents the C startup module. If it is not at the first line, then your application's entry point is not 0x700. 
     
    Edit: Check your application's .map file and find out where __reset is. This is the location your bootloader should jump to.
    post edited by aschen0866 - 2017/11/13 16:03:01
    #10
    wysiwyg
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2010/07/27 09:25:10
    • Location: 0
    • Status: offline
    Re: RE: Is it possible to relocate the interrupt vector table? 2017/11/14 14:04:19 (permalink)
    +1 (1)
    Re: Why do you have bootloader "timeout value" in the application linker script?
    As per instructions in AN1094. The bootloader looks to 0x700 for the timeout value. It's 0xFF when the chip is blank so the bootloader will wait forever for a download. The target app can set the timeout value to any value desired. The target app's reset address is 0x702. The bootloader is written to goto 0x702 in order to pass control to the target app. The target app gld file sets the target app startup address to 0x702.

    I checked the map file. The the __reset is at 0x000702 as it should be.

    Here's an excerpt..
    External Symbols in Program Memory (by address):
    0x000702 __resetPRI
    0x000732 __psv_init
    0x000742 ___delay32
    0x000764 __data_init_standard
    0x000764 __data_init
    0x0007e6 __DefaultInterrupt


    Here's another section of the same file. I don't see anything strange here but I'm not an expert..
    LOAD KMAP1701_XC16_BL_TEST_01.o
    LOAD c:/program files (x86)/microchip/xc16/v1.30/bin/bin/../../lib/dsPIC30F\libp30F6012A-coff.a
    LOAD c:/program files (x86)/microchip/xc16/v1.30/bin/bin/../../lib\libfx-coff.a
    0x8005c0 __FUID0 = 0x8005c0
    0x8005c2 __FUID1 = 0x8005c2
    0x8005c4 __FUID2 = 0x8005c4
    0x8005c6 __FUID3 = 0x8005c6
    0xf80000 __FOSC = 0xf80000
    0xf80002 __FWDT = 0xf80002
    0xf80004 __FBORPOR = 0xf80004
    0xf80006 __FBS = 0xf80006
    0xf80008 __FSS = 0xf80008
    0xf8000a __FGS = 0xf8000a
    0xf8000c __FICD = 0xf8000c
    0x0700 __CODE_BASE = 0x700
    0x17900 __CODE_LENGTH = 0x17900
    0x0004 __IVT_BASE = 0x4
    0x0084 __AIVT_BASE = 0x84
    0x0800 __DATA_BASE = 0x800
    0x2000 __DATA_LENGTH = 0x2000
    0x1800 __YDATA_BASE = 0x1800
    .reset 0x000000 0x4
    0x000000 0x2 SHORT 0x702 ABSOLUTE (__reset)
    0x000001 0x2 SHORT 0x4
    0x000002 0x2 SHORT 0x0 ((ABSOLUTE (__reset) >> 0x10) & 0x7f)
    0x000003 0x2 SHORT 0x0
    .text 0x000700 0xff0
    0x000700 0x2 SHORT 0xb
    *(.init)
    *fill* 0x000701 0x200
    .init 0x000702 0x40 c:/program files (x86)/microchip/xc16/v1.30/bin/bin/../../lib\liblega-pic30-coff.a(crt0_standard.o)
    0x000702 _resetPRI
    0x000702 _reset
    0x000732 _psv_init
    .init 0x000742 0x1c c:/program files (x86)/microchip/xc16/v1.30/bin/bin/../../lib\liblega-pic30-coff.a(delay32.Lo)
    0x000742 __delay32
    .init 0x00075e 0x7c c:/program files (x86)/microchip/xc16/v1.30/bin/bin/../../lib\liblega-pic30-coff.a(data_init_standard.o)
    0x000764 _data_init_standard
    0x000764 _data_init
    *(.user_init)
    *(.handle)
    .handle 0x0007da 0xc jump_table
    *(.isr*)
    .isr 0x0007e6 0x4 default_isr
    0x0007e6 _DefaultInterrupt
    *(.libc)


    Thanks for the suggestion,
    Bill B.
    #11
    Jump to:
    © 2017 APG vNext Commercial Version 4.5