* device/lib/Makefile.in: removed comment line with model-pic16,
authorvrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 4 Jun 2004 22:44:09 +0000 (22:44 +0000)
committervrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 4 Jun 2004 22:44:09 +0000 (22:44 +0000)
* (target port-specific-objects-pic16): the libraries and objects
are copied to the build directory form the device/lib/pic16/bin
directory

Cumulative patch concerning pic16 port:
* library directory has been re-organized,
* added support for PIC18F1220,
* added headers and library sources for chips 18f1220,18f6520,
18f6620,18f6680,18f6720,18f8520,18f8620,18f8680,18f8720

* configuration registers setting has changed, now each supported
device has a complete description of the registers it uses,
* all initialisations are moved to idata sections, these section
can be absolute or relocatable,
* fixed initialisation of codespace variables,
* fixed warning about PCLATU and gpsim,
* src/pic16/gen.c (genCmp): now can handle partially iCodes with no ifx,
* (genAssign): use table reads when assigning from variables in codespace,
* src/pic16/glue.c (pic16emitStaticSeg): fixed to correctly initialise
char/int variables placed in codespace,
* (pic16_emitConfigRegs): NEW, emits a list with configuration
registers set in .asm file, no need for --pomit-config-words anymore,
* (pic16glue): some 8051 legacy segments are commented out
(to be removed completely),
* added support for alternative assembler and linker with --asm=
and --link= command line arguments,
* peepholes are disabled automatically in the port, no need to
specify on command line,
* port supports natively char/int/long multiplication, but converts
all divisions to support functions,
* main.c: pic16_linkCmd and pic16_asmCmd changed to force output
to the file set in variable $2,
* pcode.c (pic16_emitDB, pic16_flushDB): modified to print printable
strings in ASCII format and not in hex,
* ralloc.c (serialRegAssign): added a triplet of conditional calls
to pic16_allocDirReg for IC_RESULT, IC_LEFT and IC_RIGHT so to
allocate proper register if iCodes aren't temporary,

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3341 4a8a32a2-be11-0410-ad9d-d568d2c75423

90 files changed:
ChangeLog
device/include/pic16/pic18f242.h
device/include/pic16/pic18f248.h
device/include/pic16/pic18f252.h
device/include/pic16/pic18f258.h
device/include/pic16/pic18f442.h
device/include/pic16/pic18f448.h
device/include/pic16/pic18f452.h
device/include/pic16/pic18f458.h
device/include/pic16/pic18fregs.h
device/lib/Makefile.in
device/lib/pic16/Makefile [new file with mode: 0644]
device/lib/pic16/Makefile.common.in [new file with mode: 0644]
device/lib/pic16/README [new file with mode: 0644]
device/lib/pic16/configure [new file with mode: 0755]
device/lib/pic16/configure.in [new file with mode: 0644]
device/lib/pic16/libdev/Makefile [new file with mode: 0644]
device/lib/pic16/libdev/pic18f1220.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f242.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f248.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f252.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f258.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f442.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f448.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f452.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f458.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f6520.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f6620.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f6680.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f6720.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f8520.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f8620.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f8680.c [new file with mode: 0644]
device/lib/pic16/libdev/pic18f8720.c [new file with mode: 0644]
device/lib/pic16/libsdcc/Makefile [new file with mode: 0644]
device/lib/pic16/libsdcc/Makefile.rules [new file with mode: 0644]
device/lib/pic16/libsdcc/char/Makefile [new file with mode: 0644]
device/lib/pic16/libsdcc/char/divschar.c [new file with mode: 0644]
device/lib/pic16/libsdcc/char/divuchar.c [new file with mode: 0644]
device/lib/pic16/libsdcc/char/modschar.c [new file with mode: 0644]
device/lib/pic16/libsdcc/char/moduchar.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/Makefile [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fs2schar.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fs2sint.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fs2slong.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fs2uchar.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fs2uint.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fs2ulong.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fsadd.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fsdiv.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fseq.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fsgt.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fslt.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fsmul.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fsneq.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/fssub.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/schar2fs.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/sint2fs.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/slong2fs.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/uchar2fs.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/uint2fs.c [new file with mode: 0644]
device/lib/pic16/libsdcc/float/ulong2fs.c [new file with mode: 0644]
device/lib/pic16/libsdcc/int/Makefile [new file with mode: 0644]
device/lib/pic16/libsdcc/int/divsint.c [new file with mode: 0644]
device/lib/pic16/libsdcc/int/divuint.c [new file with mode: 0644]
device/lib/pic16/libsdcc/int/modsint.c [new file with mode: 0644]
device/lib/pic16/libsdcc/int/moduint.c [new file with mode: 0644]
device/lib/pic16/libsdcc/int/mulint.c [new file with mode: 0644]
device/lib/pic16/libsdcc/long/Makefile [new file with mode: 0644]
device/lib/pic16/libsdcc/long/divslong.c [new file with mode: 0644]
device/lib/pic16/libsdcc/long/divulong.c [new file with mode: 0644]
device/lib/pic16/libsdcc/long/modslong.c [new file with mode: 0644]
device/lib/pic16/libsdcc/long/modulong.c [new file with mode: 0644]
device/lib/pic16/libsdcc/long/mullong.c [new file with mode: 0644]
device/lib/pic16/startup/Makefile [new file with mode: 0644]
device/lib/pic16/startup/README [new file with mode: 0644]
device/lib/pic16/startup/crt0.c [new file with mode: 0644]
device/lib/pic16/startup/crt0i.c [new file with mode: 0644]
device/lib/pic16/startup/crt0iz.c [new file with mode: 0644]
src/pic16/device.c
src/pic16/device.h
src/pic16/gen.c
src/pic16/glue.c
src/pic16/main.c
src/pic16/main.h
src/pic16/pcode.c
src/pic16/pcode.h
src/pic16/pcodepeep.c
src/pic16/ralloc.c
src/pic16/ralloc.h

index bbefa636efd5d144727b284685f08a2727ec47e0..daaf4ef5035cf76ab1915f38a757ad28483b4eed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2004-06-04 Vangelis Rokas <vrokas AT otenet.gr>
+
+       * device/lib/Makefile.in: removed comment line with model-pic16,
+       * (target port-specific-objects-pic16): the libraries and objects
+       are copied to the build directory form the device/lib/pic16/bin
+       directory
+       
+       Cumulative patch concerning pic16 port:
+       * library directory has been re-organized,
+       * added support for PIC18F1220,
+       * added headers and library sources for chips 18f1220,18f6520,
+       18f6620,18f6680,18f6720,18f8520,18f8620,18f8680,18f8720
+
+       * configuration registers setting has changed, now each supported
+       device has a complete description of the registers it uses,
+       * all initialisations are moved to idata sections, these section
+       can be absolute or relocatable,
+       * fixed initialisation of codespace variables,
+       * fixed warning about PCLATU and gpsim,
+       * src/pic16/gen.c (genCmp): now can handle partially iCodes with no ifx,
+       * (genAssign): use table reads when assigning from variables in codespace,
+       * src/pic16/glue.c (pic16emitStaticSeg): fixed to correctly initialise
+       char/int variables placed in codespace,
+       * (pic16_emitConfigRegs): NEW, emits a list with configuration
+       registers set in .asm file, no need for --pomit-config-words anymore,
+       * (pic16glue): some 8051 legacy segments are commented out
+       (to be removed completely),
+       * added support for alternative assembler and linker with --asm=
+       and --link= command line arguments,
+       * peepholes are disabled automatically in the port, no need to
+       specify on command line,
+       * port supports natively char/int/long multiplication, but converts
+       all divisions to support functions,
+       * main.c: pic16_linkCmd and pic16_asmCmd changed to force output
+       to the file set in variable $2,
+       * pcode.c (pic16_emitDB, pic16_flushDB): modified to print printable
+       strings in ASCII format and not in hex,
+       * ralloc.c (serialRegAssign): added a triplet of conditional calls
+       to pic16_allocDirReg for IC_RESULT, IC_LEFT and IC_RIGHT so to
+       allocate proper register if iCodes aren't temporary,
+
 2004-06-02 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * support/regression/tests/zeropad.c: added TEST_G macro for alpha
index d59abb91eab68c788e4433904ab0e4a4676c04c1..bd94778ea09badbb6236a17303c6e75de6b689dd 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * pic18f242.h - 18F242 Device Library Header
+ * pic18f242.h - PIC18F242 Device Library Header
  *
  * This file is part of the GNU PIC Library.
  *
@@ -60,9 +60,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTAbits_t;
+} __PORTAbits_t;
 
-extern volatile PORTAbits_t at 0xf80 PORTAbits;
+extern volatile __PORTAbits_t at 0xf80 PORTAbits;
 
 extern sfr at 0xf81 PORTB;
 typedef union {
@@ -87,9 +87,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTBbits_t;
+} __PORTBbits_t;
 
-extern volatile PORTBbits_t at 0xf81 PORTBbits;
+extern volatile __PORTBbits_t at 0xf81 PORTBbits;
 
 extern sfr at 0xf82 PORTC;
 typedef union {
@@ -125,9 +125,9 @@ typedef union {
                unsigned CK:1;
                unsigned DT:1;
        };
-} PORTCbits_t;
+} __PORTCbits_t;
 
-extern volatile PORTCbits_t at 0xf82 PORTCbits;
+extern volatile __PORTCbits_t at 0xf82 PORTCbits;
 
 extern sfr at 0xf89 LATA;
 typedef union {
@@ -141,9 +141,9 @@ typedef union {
                unsigned LATA6:1;
                unsigned :1;
        };
-} LATAbits_t;
+} __LATAbits_t;
 
-extern volatile LATAbits_t at 0xf89 LATAbits;
+extern volatile __LATAbits_t at 0xf89 LATAbits;
 
 extern sfr at 0xf8a LATB;
 typedef union {
@@ -157,9 +157,9 @@ typedef union {
                unsigned LATB6:1;
                unsigned LATB7:1;
        };
-} LATBbits_t;
+} __LATBbits_t;
 
-extern volatile LATBbits_t at 0xf8a LATBbits;
+extern volatile __LATBbits_t at 0xf8a LATBbits;
 
 extern sfr at 0xf8b LATC;
 typedef union {
@@ -173,9 +173,9 @@ typedef union {
                unsigned LATC6:1;
                unsigned LATC7:1;
        };
-} LATCbits_t;
+} __LATCbits_t;
 
-extern volatile LATCbits_t at 0xf8b LATCbits;
+extern volatile __LATCbits_t at 0xf8b LATCbits;
 
 extern sfr at 0xf92 TRISA;
 typedef union {
@@ -189,9 +189,9 @@ typedef union {
                unsigned TRISA6:1;
                unsigned :1;
        };
-} TRISAbits_t;
+} __TRISAbits_t;
 
-extern volatile TRISAbits_t at 0xf92 TRISAbits;
+extern volatile __TRISAbits_t at 0xf92 TRISAbits;
 
 extern sfr at 0xf93 TRISB;
 typedef union {
@@ -205,9 +205,9 @@ typedef union {
                unsigned TRISB6:1;
                unsigned TRISB7:1;
        };
-} TRISBbits_t;
+} __TRISBbits_t;
 
-extern volatile TRISBbits_t at 0xf93 TRISBbits;
+extern volatile __TRISBbits_t at 0xf93 TRISBbits;
 
 extern sfr at 0xf94 TRISC;
 typedef union {
@@ -221,9 +221,9 @@ typedef union {
                unsigned TRISC6:1;
                unsigned TRISC7:1;
        };
-} TRISCbits_t;
+} __TRISCbits_t;
 
-extern volatile TRISCbits_t at 0xf94 TRISCbits;
+extern volatile __TRISCbits_t at 0xf94 TRISCbits;
 
 extern sfr at 0xf9d PIE1;
 typedef union {
@@ -237,9 +237,9 @@ typedef union {
                unsigned ADIE:1;
                unsigned PSPIE:1;
        };
-} PIE1bits_t;
+} __PIE1bits_t;
 
-extern volatile PIE1bits_t at 0xf9d PIE1bits;
+extern volatile __PIE1bits_t at 0xf9d PIE1bits;
 
 extern sfr at 0xf9e PIR1;
 typedef union {
@@ -253,9 +253,9 @@ typedef union {
                unsigned ADIF:1;
                unsigned PSPIF:1;
        };
-} PIR1bits_t;
+} __PIR1bits_t;
 
-extern volatile PIR1bits_t at 0xf9e PIR1bits;
+extern volatile __PIR1bits_t at 0xf9e PIR1bits;
 
 extern sfr at 0xf9f IPR1;
 typedef union {
@@ -269,9 +269,9 @@ typedef union {
                unsigned ADIP:1;
                unsigned PSPIP:1;
        };
-} IPR1bits_t;
+} __IPR1bits_t;
 
-extern volatile IPR1bits_t at 0xf9f IPR1bits;
+extern volatile __IPR1bits_t at 0xf9f IPR1bits;
 
 extern sfr at 0xfa0 PIE2;
 typedef union {
@@ -285,9 +285,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PIE2bits_t;
+} __PIE2bits_t;
 
-extern volatile PIE2bits_t at 0xfa0 PIE2bits;
+extern volatile __PIE2bits_t at 0xfa0 PIE2bits;
 
 extern sfr at 0xfa1 PIR2;
 typedef union {
@@ -301,9 +301,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PIR2bits_t;
+} __PIR2bits_t;
 
-extern volatile PIR2bits_t at 0xfa1 PIR2bits;
+extern volatile __PIR2bits_t at 0xfa1 PIR2bits;
 
 extern sfr at 0xfa2 IPR2;
 typedef union {
@@ -317,9 +317,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} IPR2bits_t;
+} __IPR2bits_t;
 
-extern volatile IPR2bits_t at 0xfa2 IPR2bits;
+extern volatile __IPR2bits_t at 0xfa2 IPR2bits;
 
 extern sfr at 0xfa6 EECON1;
 typedef union {
@@ -333,9 +333,9 @@ typedef union {
                unsigned CFGS:1;
                unsigned EEPGD:1;
        };
-} EECON1bits_t;
+} __EECON1bits_t;
 
-extern volatile EECON1bits_t at 0xfa6 EECON1bits;
+extern volatile __EECON1bits_t at 0xfa6 EECON1bits;
 
 extern sfr at 0xfa7 EECON2;
 extern sfr at 0xfa8 EEDATA;
@@ -352,9 +352,9 @@ typedef union {
                unsigned RX9:1;
                unsigned SPEN:1;
        };
-} RCSTAbits_t;
+} __RCSTAbits_t;
 
-extern volatile RCSTAbits_t at 0xfab RCSTAbits;
+extern volatile __RCSTAbits_t at 0xfab RCSTAbits;
 
 extern sfr at 0xfac TXSTA;
 typedef union {
@@ -368,9 +368,9 @@ typedef union {
                unsigned TX9:1;
                unsigned CSRC:1;
        };
-} TXSTAbits_t;
+} __TXSTAbits_t;
 
-extern volatile TXSTAbits_t at 0xfac TXSTAbits;
+extern volatile __TXSTAbits_t at 0xfac TXSTAbits;
 
 extern sfr at 0xfad TXREG;
 extern sfr at 0xfae RCREG;
@@ -387,9 +387,9 @@ typedef union {
                unsigned T3CCP2:1;
                unsigned RD16:1;
        };
-} T3CONbits_t;
+} __T3CONbits_t;
 
-extern volatile T3CONbits_t at 0xfb1 T3CONbits;
+extern volatile __T3CONbits_t at 0xfb1 T3CONbits;
 
 extern sfr at 0xfb2 TMR3L;
 extern sfr at 0xfb3 TMR3H;
@@ -405,9 +405,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CCP2CONbits_t;
+} __CCP2CONbits_t;
 
-extern volatile CCP2CONbits_t at 0xfba CCP2CONbits;
+extern volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
 
 extern sfr at 0xfbb CCPR2L;
 extern sfr at 0xfbc CCPR2H;
@@ -423,9 +423,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CCP1CONbits_t;
+} __CCP1CONbits_t;
 
-extern volatile CCP1CONbits_t at 0xfbd CCP1CONbits;
+extern volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
 
 extern sfr at 0xfbe CCPR1L;
 extern sfr at 0xfbf CCPR1H;
@@ -441,9 +441,9 @@ typedef union {
                unsigned ADCS2:1;
                unsigned ADFM:1;
        };
-} ADCON1bits_t;
+} __ADCON1bits_t;
 
-extern volatile ADCON1bits_t at 0xfc1 ADCON1bits;
+extern volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
 
 extern sfr at 0xfc2 ADCON0;
 typedef union {
@@ -457,9 +457,9 @@ typedef union {
                unsigned ADCS0:1;
                unsigned ADCS1:1;
        };
-} ADCON0bits_t;
+} __ADCON0bits_t;
 
-extern volatile ADCON0bits_t at 0xfc2 ADCON0bits;
+extern volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
 
 extern sfr at 0xfc3 ADRESL;
 extern sfr at 0xfc4 ADRESH;
@@ -475,9 +475,9 @@ typedef union {
                unsigned ACKSTAT:1;
                unsigned GCEN:1;
        };
-} SSPCON2bits_t;
+} __SSPCON2bits_t;
 
-extern volatile SSPCON2bits_t at 0xfc5 SSPCON2bits;
+extern volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
 
 extern sfr at 0xfc6 SSPCON1;
 typedef union {
@@ -491,9 +491,9 @@ typedef union {
                unsigned SSPOV:1;
                unsigned WCOL:1;
        };
-} SSPCON1bits_t;
+} __SSPCON1bits_t;
 
-extern volatile SSPCON1bits_t at 0xfc6 SSPCON1bits;
+extern volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
 
 extern sfr at 0xfc7 SSPSTAT;
 typedef union {
@@ -507,9 +507,9 @@ typedef union {
                unsigned CKE:1;
                unsigned SMP:1;
        };
-} SSPSTATbits_t;
+} __SSPSTATbits_t;
 
-extern volatile SSPSTATbits_t at 0xfc7 SSPSTATbits;
+extern volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
 
 extern sfr at 0xfc8 SSPADD;
 extern sfr at 0xfc9 SSPBUF;
@@ -525,9 +525,9 @@ typedef union {
                unsigned TOUTPS3:1;
                unsigned :1;
        };
-} T2CONbits_t;
+} __T2CONbits_t;
 
-extern volatile T2CONbits_t at 0xfca T2CONbits;
+extern volatile __T2CONbits_t at 0xfca T2CONbits;
 
 extern sfr at 0xfcb PR2;
 extern sfr at 0xfcc TMR2;
@@ -543,9 +543,9 @@ typedef union {
                unsigned :1;
                unsigned RD16:1;
        };
-} T1CONbits_t;
+} __T1CONbits_t;
 
-extern volatile T1CONbits_t at 0xfcd T1CONbits;
+extern volatile __T1CONbits_t at 0xfcd T1CONbits;
 
 extern sfr at 0xfce TMR1L;
 extern sfr at 0xfcf TMR1H;
@@ -561,9 +561,9 @@ typedef union {
                unsigned :1;
                unsigned IPEN:1;
        };
-} RCONbits_t;
+} __RCONbits_t;
 
-extern volatile RCONbits_t at 0xfd0 RCONbits;
+extern volatile __RCONbits_t at 0xfd0 RCONbits;
 
 extern sfr at 0xfd1 WDTCON;
 typedef union {
@@ -588,9 +588,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} WDTCONbits_t;
+} __WDTCONbits_t;
 
-extern volatile WDTCONbits_t at 0xfd1 WDTCONbits;
+extern volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
 
 extern sfr at 0xfd2 LVDCON;
 typedef union {
@@ -615,9 +615,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} LVDCONbits_t;
+} __LVDCONbits_t;
 
-extern volatile LVDCONbits_t at 0xfd2 LVDCONbits;
+extern volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
 
 extern sfr at 0xfd3 OSCCON;
 typedef union {
@@ -631,9 +631,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} OSCCONbits_t;
+} __OSCCONbits_t;
 
-extern volatile OSCCONbits_t at 0xfd3 OSCCONbits;
+extern volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
 
 extern sfr at 0xfd5 T0CON;
 extern sfr at 0xfd6 TMR0L;
@@ -650,9 +650,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} STATUSbits_t;
+} __STATUSbits_t;
 
-extern volatile STATUSbits_t at 0xfd8 STATUSbits;
+extern volatile __STATUSbits_t at 0xfd8 STATUSbits;
 
 extern sfr at 0xfd9 FSR2L;
 extern sfr at 0xfda FSR2H;
@@ -700,9 +700,9 @@ typedef union {
                unsigned INT1IP:1;
                unsigned INT2IP:1;
        };
-} INTCON3bits_t;
+} __INTCON3bits_t;
 
-extern volatile INTCON3bits_t at 0xff0 INTCON3bits;
+extern volatile __INTCON3bits_t at 0xff0 INTCON3bits;
 
 extern sfr at 0xff1 INTCON2;
 typedef union {
@@ -716,9 +716,9 @@ typedef union {
                unsigned INTEDG0:1;
                unsigned RBPU:1;
        };
-} INTCON2bits_t;
+} __INTCON2bits_t;
 
-extern volatile INTCON2bits_t at 0xff1 INTCON2bits;
+extern volatile __INTCON2bits_t at 0xff1 INTCON2bits;
 
 extern sfr at 0xff2 INTCON;
 typedef union {
@@ -732,9 +732,9 @@ typedef union {
                unsigned PEIE:1;
                unsigned GIE:1;
        };
-} INTCONbits_t;
+} __INTCONbits_t;
 
-extern volatile INTCONbits_t at 0xff2 INTCONbits;
+extern volatile __INTCONbits_t at 0xff2 INTCONbits;
 
 extern sfr at 0xff3 PRODL;
 extern sfr at 0xff4 PRODH;
@@ -757,14 +757,135 @@ typedef union {
                unsigned STKUNF:1;
                unsigned STKFUL:1;
        };
-} STKPTRbits_t;
+} __STKPTRbits_t;
 
-extern volatile STKPTRbits_t at 0xffc STKPTRbits;
+extern volatile __STKPTRbits_t at 0xffc STKPTRbits;
 
 extern sfr at 0xffd TOSL;
 extern sfr at 0xffe TOSH;
 extern sfr at 0xfff TOSU;
 
 
-#endif
+/* Configuration registers locations */
+#define __CONFIG0H     0x300001
+#define __CONFIG1L     0x300002
+#define __CONFIG1H     0x300003
+#define __CONFIG2H     0x300005
+#define __CONFIG3L     0x300006
+#define __CONFIG4L     0x300008
+#define __CONFIG4H     0x300009
+#define __CONFIG5L     0x30000A
+#define __CONFIG5H     0x30000B
+#define __CONFIG6L     0x30000C
+#define __CONFIG6H     0x30000D
+
+
+
+/* Oscillator 0H options */
+#define _OSC_RC_OSC2_0H        0xFF    /* RC-OSC2 as RA6 */
+#define _OSC_HS_PLL_0H 0xFE    /* HS-PLL Enabled */
+#define _OSC_EC_OSC2_RA6_0H    0xFD    /* EC-OSC2 as RA6 */
+#define _OSC_EC_OSC2_Clock_Out_0H      0xFC    /* EC-OSC2 as Clock_Out */
+#define _OSC_RC_0H     0xFB    /* RC */
+#define _OSC_HS_0H     0xFA    /* HS */
+#define _OSC_XT_0H     0xF9    /* XT */
+#define _OSC_LP_0H     0xF8    /* LP */
+
+/* Osc. Switch Enable 0H options */
+#define _OSCS_OFF_0H   0xFF    /* Disabled */
+#define _OSCS_ON_0H    0xDF    /* Enabled */
+
+/* Power Up Timer 1L options */
+#define _PUT_OFF_1L    0xFF    /* Disabled */
+#define _PUT_ON_1L     0xFE    /* Enabled */
+
+/* Brown Out Detect 1L options */
+#define _BODEN_ON_1L   0xFF    /* Enabled */
+#define _BODEN_OFF_1L  0xFD    /* Disabled */
+
+/* Brown Out Voltage 1L options */
+#define _BODENV_2_0V_1L        0xFF    /* 2.0V */
+#define _BODENV_2_7V_1L        0xFB    /* 2.7V */
+#define _BODENV_4_2V_1L        0xF7    /* 4.2V */
+#define _BODENV_4_5V_1L        0xF3    /* 4.5V */
+
+/* Watchdog Timer 1H options */
+#define _WDT_ON_1H     0xFF    /* Enabled */
+#define _WDT_OFF_1H    0xFE    /* Disabled */
+
+/* Watchdog Postscaler 1H options */
+#define _WDTPS_1_128_1H        0xFF    /* 1:128 */
+#define _WDTPS_1_64_1H 0xFD    /* 1:64 */
+#define _WDTPS_1_32_1H 0xFB    /* 1:32 */
+#define _WDTPS_1_16_1H 0xF9    /* 1:16 */
+#define _WDTPS_1_8_1H  0xF7    /* 1:8 */
+#define _WDTPS_1_4_1H  0xF5    /* 1:4 */
+#define _WDTPS_1_2_1H  0xF3    /* 1:2 */
+#define _WDTPS_1_1_1H  0xF1    /* 1:1 */
+
+/* CCP2 Mux 2H options */
+#define _CCP2MUX_RC1_2H        0xFF    /* RC1 */
+#define _CCP2MUX_RB3_2H        0xFE    /* RB3 */
+
+/* Low Voltage Program 3L options */
+#define _LVP_ON_3L     0xFF    /* Enabled */
+#define _LVP_OFF_3L    0xFB    /* Disabled */
+
+/* Background Debug 3L options */
+#define _BACKBUG_OFF_3L        0xFF    /* Disabled */
+#define _BACKBUG_ON_3L 0x7F    /* Enabled */
+
+/* Stack Overflow Reset 3L options */
+#define _STVR_ON_3L    0xFF    /* Enabled */
+#define _STVR_OFF_3L   0xFE    /* Disabled */
+
+/* Code Protect 00200-01FFF 4L options */
+#define _CP_0_OFF_4L   0xFF    /* Disabled */
+#define _CP_0_ON_4L    0xFE    /* Enabled */
+
+/* Code Protect 02000-03FFF 4L options */
+#define _CP_1_OFF_4L   0xFF    /* Disabled */
+#define _CP_1_ON_4L    0xFD    /* Enabled */
+
+/* Data EE Read Protect 4H options */
+#define _CPD_OFF_4H    0xFF    /* Disabled */
+#define _CPD_ON_4H     0x7F    /* Enabled */
+
+/* Code Protect Boot 4H options */
+#define _CPB_OFF_4H    0xFF    /* Disabled */
+#define _CPB_ON_4H     0xBF    /* Enabled */
+
+/* Table Write Protect 00200-01FFF 5L options */
+#define _WRT_0_OFF_5L  0xFF    /* Disabled */
+#define _WRT_0_ON_5L   0xFE    /* Enabled */
+
+/* Table Write Protect 02000-03FFF 5L options */
+#define _WRT_1_OFF_5L  0xFF    /* Disabled */
+#define _WRT_1_ON_5L   0xFD    /* Enabled */
+
+/* Data EE Write Protect 5H options */
+#define _WRTD_OFF_5H   0xFF    /* Disabled */
+#define _WRTD_ON_5H    0x7F    /* Enabled */
+
+/* Table Write Protect Boot 5H options */
+#define _WRTB_OFF_5H   0xFF    /* Disabled */
+#define _WRTB_ON_5H    0xBF    /* Enabled */
+
+/* Config. Write Protect 5H options */
+#define _WRTC_OFF_5H   0xFF    /* Disabled */
+#define _WRTC_ON_5H    0xDF    /* Enabled */
+
+/* Table Read Protect 00200-01FFF 6L options */
+#define _EBTR_0_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_0_ON_6L  0xFE    /* Enabled */
+
+/* Table Read Protect 02000-03FFF 6L options */
+#define _EBTR_1_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_1_ON_6L  0xFD    /* Enabled */
+
+/* Table Read Protect Boot 6H options */
+#define _EBTRB_OFF_6H  0xFF    /* Disabled */
+#define _EBTRB_ON_6H   0xBF    /* Enabled */
 
+
+#endif
index a2ec20ece0aa79a4c696cace52ab0854a3947772..85a9d15652bffe0ff437c0fa83f9ec4b611580d3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * pic18f248.h - 18F248 Device Library Header
+ * pic18f248.h - PIC18F248 Device Library Header
  *
  * This file is part of the GNU PIC Library.
  *
@@ -27,9 +27,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF0SIDHbits_t;
+} __RXF0SIDHbits_t;
 
-extern volatile RXF0SIDHbits_t at 0xf00 RXF0SIDHbits;
+extern volatile __RXF0SIDHbits_t at 0xf00 RXF0SIDHbits;
 
 extern sfr at 0xf01 RXF0SIDL;
 typedef union {
@@ -43,9 +43,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF0SIDLbits_t;
+} __RXF0SIDLbits_t;
 
-extern volatile RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
+extern volatile __RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
 
 extern sfr at 0xf02 RXF0EIDH;
 typedef union {
@@ -59,9 +59,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF0EIDHbits_t;
+} __RXF0EIDHbits_t;
 
-extern volatile RXF0EIDHbits_t at 0xf02 RXF0EIDHbits;
+extern volatile __RXF0EIDHbits_t at 0xf02 RXF0EIDHbits;
 
 extern sfr at 0xf03 RXF0EIDL;
 typedef union {
@@ -75,9 +75,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF0EIDLbits_t;
+} __RXF0EIDLbits_t;
 
-extern volatile RXF0EIDLbits_t at 0xf03 RXF0EIDLbits;
+extern volatile __RXF0EIDLbits_t at 0xf03 RXF0EIDLbits;
 
 extern sfr at 0xf04 RXF1SIDH;
 typedef union {
@@ -91,9 +91,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF1SIDHbits_t;
+} __RXF1SIDHbits_t;
 
-extern volatile RXF1SIDHbits_t at 0xf04 RXF1SIDHbits;
+extern volatile __RXF1SIDHbits_t at 0xf04 RXF1SIDHbits;
 
 extern sfr at 0xf05 RXF1SIDL;
 typedef union {
@@ -107,9 +107,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF1SIDLbits_t;
+} __RXF1SIDLbits_t;
 
-extern volatile RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
+extern volatile __RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
 
 extern sfr at 0xf06 RXF1EIDH;
 typedef union {
@@ -123,9 +123,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF1EIDHbits_t;
+} __RXF1EIDHbits_t;
 
-extern volatile RXF1EIDHbits_t at 0xf06 RXF1EIDHbits;
+extern volatile __RXF1EIDHbits_t at 0xf06 RXF1EIDHbits;
 
 extern sfr at 0xf07 RXF1EIDL;
 typedef union {
@@ -139,9 +139,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF1EIDLbits_t;
+} __RXF1EIDLbits_t;
 
-extern volatile RXF1EIDLbits_t at 0xf07 RXF1EIDLbits;
+extern volatile __RXF1EIDLbits_t at 0xf07 RXF1EIDLbits;
 
 extern sfr at 0xf08 RXF2SIDH;
 typedef union {
@@ -155,9 +155,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF2SIDHbits_t;
+} __RXF2SIDHbits_t;
 
-extern volatile RXF2SIDHbits_t at 0xf08 RXF2SIDHbits;
+extern volatile __RXF2SIDHbits_t at 0xf08 RXF2SIDHbits;
 
 extern sfr at 0xf09 RXF2SIDL;
 typedef union {
@@ -171,9 +171,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF2SIDLbits_t;
+} __RXF2SIDLbits_t;
 
-extern volatile RXF2SIDLbits_t at 0xf09 RXF2SIDLbits;
+extern volatile __RXF2SIDLbits_t at 0xf09 RXF2SIDLbits;
 
 extern sfr at 0xf0a RXF2EIDH;
 typedef union {
@@ -187,9 +187,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF2EIDHbits_t;
+} __RXF2EIDHbits_t;
 
-extern volatile RXF2EIDHbits_t at 0xf0a RXF2EIDHbits;
+extern volatile __RXF2EIDHbits_t at 0xf0a RXF2EIDHbits;
 
 extern sfr at 0xf0b RXF2EIDL;
 typedef union {
@@ -203,9 +203,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF2EIDLbits_t;
+} __RXF2EIDLbits_t;
 
-extern volatile RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
+extern volatile __RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
 
 extern sfr at 0xf0c RXF3SIDH;
 typedef union {
@@ -219,9 +219,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF3SIDHbits_t;
+} __RXF3SIDHbits_t;
 
-extern volatile RXF3SIDHbits_t at 0xf0c RXF3SIDHbits;
+extern volatile __RXF3SIDHbits_t at 0xf0c RXF3SIDHbits;
 
 extern sfr at 0xf0d RXF3SIDL;
 typedef union {
@@ -235,9 +235,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF3SIDLbits_t;
+} __RXF3SIDLbits_t;
 
-extern volatile RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
+extern volatile __RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
 
 extern sfr at 0xf0e RXF3EIDH;
 typedef union {
@@ -251,9 +251,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF3EIDHbits_t;
+} __RXF3EIDHbits_t;
 
-extern volatile RXF3EIDHbits_t at 0xf0e RXF3EIDHbits;
+extern volatile __RXF3EIDHbits_t at 0xf0e RXF3EIDHbits;
 
 extern sfr at 0xf0f RXF3EIDL;
 typedef union {
@@ -267,9 +267,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF3EIDLbits_t;
+} __RXF3EIDLbits_t;
 
-extern volatile RXF3EIDLbits_t at 0xf0f RXF3EIDLbits;
+extern volatile __RXF3EIDLbits_t at 0xf0f RXF3EIDLbits;
 
 extern sfr at 0xf10 RXF4SIDH;
 typedef union {
@@ -283,9 +283,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF4SIDHbits_t;
+} __RXF4SIDHbits_t;
 
-extern volatile RXF4SIDHbits_t at 0xf10 RXF4SIDHbits;
+extern volatile __RXF4SIDHbits_t at 0xf10 RXF4SIDHbits;
 
 extern sfr at 0xf11 RXF4SIDL;
 typedef union {
@@ -299,9 +299,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF4SIDLbits_t;
+} __RXF4SIDLbits_t;
 
-extern volatile RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
+extern volatile __RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
 
 extern sfr at 0xf12 RXF4EIDH;
 typedef union {
@@ -315,9 +315,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF4EIDHbits_t;
+} __RXF4EIDHbits_t;
 
-extern volatile RXF4EIDHbits_t at 0xf12 RXF4EIDHbits;
+extern volatile __RXF4EIDHbits_t at 0xf12 RXF4EIDHbits;
 
 extern sfr at 0xf13 RXF4EIDL;
 typedef union {
@@ -331,9 +331,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF4EIDLbits_t;
+} __RXF4EIDLbits_t;
 
-extern volatile RXF4EIDLbits_t at 0xf13 RXF4EIDLbits;
+extern volatile __RXF4EIDLbits_t at 0xf13 RXF4EIDLbits;
 
 extern sfr at 0xf14 RXF5SIDH;
 typedef union {
@@ -347,9 +347,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF5SIDHbits_t;
+} __RXF5SIDHbits_t;
 
-extern volatile RXF5SIDHbits_t at 0xf14 RXF5SIDHbits;
+extern volatile __RXF5SIDHbits_t at 0xf14 RXF5SIDHbits;
 
 extern sfr at 0xf15 RXF5SIDL;
 typedef union {
@@ -363,9 +363,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF5SIDLbits_t;
+} __RXF5SIDLbits_t;
 
-extern volatile RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
+extern volatile __RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
 
 extern sfr at 0xf16 RXF5EIDH;
 typedef union {
@@ -379,9 +379,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF5EIDHbits_t;
+} __RXF5EIDHbits_t;
 
-extern volatile RXF5EIDHbits_t at 0xf16 RXF5EIDHbits;
+extern volatile __RXF5EIDHbits_t at 0xf16 RXF5EIDHbits;
 
 extern sfr at 0xf17 RXF5EIDL;
 typedef union {
@@ -395,9 +395,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF5EIDLbits_t;
+} __RXF5EIDLbits_t;
 
-extern volatile RXF5EIDLbits_t at 0xf17 RXF5EIDLbits;
+extern volatile __RXF5EIDLbits_t at 0xf17 RXF5EIDLbits;
 
 extern sfr at 0xf18 RXM0SIDH;
 typedef union {
@@ -411,9 +411,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXM0SIDHbits_t;
+} __RXM0SIDHbits_t;
 
-extern volatile RXM0SIDHbits_t at 0xf18 RXM0SIDHbits;
+extern volatile __RXM0SIDHbits_t at 0xf18 RXM0SIDHbits;
 
 extern sfr at 0xf19 RXM0SIDL;
 typedef union {
@@ -427,9 +427,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXM0SIDLbits_t;
+} __RXM0SIDLbits_t;
 
-extern volatile RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
+extern volatile __RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
 
 extern sfr at 0xf1a RXM0EIDH;
 typedef union {
@@ -443,9 +443,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXM0EIDHbits_t;
+} __RXM0EIDHbits_t;
 
-extern volatile RXM0EIDHbits_t at 0xf1a RXM0EIDHbits;
+extern volatile __RXM0EIDHbits_t at 0xf1a RXM0EIDHbits;
 
 extern sfr at 0xf1b RXM0EIDL;
 typedef union {
@@ -459,9 +459,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXM0EIDLbits_t;
+} __RXM0EIDLbits_t;
 
-extern volatile RXM0EIDLbits_t at 0xf1b RXM0EIDLbits;
+extern volatile __RXM0EIDLbits_t at 0xf1b RXM0EIDLbits;
 
 extern sfr at 0xf1c RXM1SIDH;
 typedef union {
@@ -475,9 +475,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXM1SIDHbits_t;
+} __RXM1SIDHbits_t;
 
-extern volatile RXM1SIDHbits_t at 0xf1c RXM1SIDHbits;
+extern volatile __RXM1SIDHbits_t at 0xf1c RXM1SIDHbits;
 
 extern sfr at 0xf1d RXM1SIDL;
 typedef union {
@@ -491,9 +491,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXM1SIDLbits_t;
+} __RXM1SIDLbits_t;
 
-extern volatile RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
+extern volatile __RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
 
 extern sfr at 0xf1e RXM1EIDH;
 typedef union {
@@ -507,9 +507,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXM1EIDHbits_t;
+} __RXM1EIDHbits_t;
 
-extern volatile RXM1EIDHbits_t at 0xf1e RXM1EIDHbits;
+extern volatile __RXM1EIDHbits_t at 0xf1e RXM1EIDHbits;
 
 extern sfr at 0xf1f RXM1EIDL;
 typedef union {
@@ -523,9 +523,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXM1EIDLbits_t;
+} __RXM1EIDLbits_t;
 
-extern volatile RXM1EIDLbits_t at 0xf1f RXM1EIDLbits;
+extern volatile __RXM1EIDLbits_t at 0xf1f RXM1EIDLbits;
 
 extern sfr at 0xf20 TXB2CON;
 typedef union {
@@ -539,9 +539,9 @@ typedef union {
                unsigned TXABT:1;
                unsigned :1;
        };
-} TXB2CONbits_t;
+} __TXB2CONbits_t;
 
-extern volatile TXB2CONbits_t at 0xf20 TXB2CONbits;
+extern volatile __TXB2CONbits_t at 0xf20 TXB2CONbits;
 
 extern sfr at 0xf21 TXB2SIDH;
 typedef union {
@@ -555,9 +555,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} TXB2SIDHbits_t;
+} __TXB2SIDHbits_t;
 
-extern volatile TXB2SIDHbits_t at 0xf21 TXB2SIDHbits;
+extern volatile __TXB2SIDHbits_t at 0xf21 TXB2SIDHbits;
 
 extern sfr at 0xf22 TXB2SIDL;
 typedef union {
@@ -571,9 +571,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} TXB2SIDLbits_t;
+} __TXB2SIDLbits_t;
 
-extern volatile TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
+extern volatile __TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
 
 extern sfr at 0xf23 TXB2EIDH;
 typedef union {
@@ -587,9 +587,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} TXB2EIDHbits_t;
+} __TXB2EIDHbits_t;
 
-extern volatile TXB2EIDHbits_t at 0xf23 TXB2EIDHbits;
+extern volatile __TXB2EIDHbits_t at 0xf23 TXB2EIDHbits;
 
 extern sfr at 0xf24 TXB2EIDL;
 typedef union {
@@ -603,9 +603,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} TXB2EIDLbits_t;
+} __TXB2EIDLbits_t;
 
-extern volatile TXB2EIDLbits_t at 0xf24 TXB2EIDLbits;
+extern volatile __TXB2EIDLbits_t at 0xf24 TXB2EIDLbits;
 
 extern sfr at 0xf25 TXB2DLC;
 typedef union {
@@ -619,9 +619,9 @@ typedef union {
                unsigned TXB2TXRTR:1;
                unsigned :1;
        };
-} TXB2DLCbits_t;
+} __TXB2DLCbits_t;
 
-extern volatile TXB2DLCbits_t at 0xf25 TXB2DLCbits;
+extern volatile __TXB2DLCbits_t at 0xf25 TXB2DLCbits;
 
 extern sfr at 0xf26 TXB2D0;
 typedef union {
@@ -635,9 +635,9 @@ typedef union {
                unsigned TXB2D06:1;
                unsigned TXB2D07:1;
        };
-} TXB2D0bits_t;
+} __TXB2D0bits_t;
 
-extern volatile TXB2D0bits_t at 0xf26 TXB2D0bits;
+extern volatile __TXB2D0bits_t at 0xf26 TXB2D0bits;
 
 extern sfr at 0xf27 TXB2D1;
 typedef union {
@@ -651,9 +651,9 @@ typedef union {
                unsigned TXB2D16:1;
                unsigned TXB2D17:1;
        };
-} TXB2D1bits_t;
+} __TXB2D1bits_t;
 
-extern volatile TXB2D1bits_t at 0xf27 TXB2D1bits;
+extern volatile __TXB2D1bits_t at 0xf27 TXB2D1bits;
 
 extern sfr at 0xf28 TXB2D2;
 typedef union {
@@ -667,9 +667,9 @@ typedef union {
                unsigned TXB2D26:1;
                unsigned TXB2D27:1;
        };
-} TXB2D2bits_t;
+} __TXB2D2bits_t;
 
-extern volatile TXB2D2bits_t at 0xf28 TXB2D2bits;
+extern volatile __TXB2D2bits_t at 0xf28 TXB2D2bits;
 
 extern sfr at 0xf29 TXB2D3;
 typedef union {
@@ -683,9 +683,9 @@ typedef union {
                unsigned TXB2D36:1;
                unsigned TXB2D37:1;
        };
-} TXB2D3bits_t;
+} __TXB2D3bits_t;
 
-extern volatile TXB2D3bits_t at 0xf29 TXB2D3bits;
+extern volatile __TXB2D3bits_t at 0xf29 TXB2D3bits;
 
 extern sfr at 0xf2a TXB2D4;
 typedef union {
@@ -699,9 +699,9 @@ typedef union {
                unsigned TXB2D46:1;
                unsigned TXB2D47:1;
        };
-} TXB2D4bits_t;
+} __TXB2D4bits_t;
 
-extern volatile TXB2D4bits_t at 0xf2a TXB2D4bits;
+extern volatile __TXB2D4bits_t at 0xf2a TXB2D4bits;
 
 extern sfr at 0xf2b TXB2D5;
 typedef union {
@@ -715,9 +715,9 @@ typedef union {
                unsigned TXB2D56:1;
                unsigned TXB2D57:1;
        };
-} TXB2D5bits_t;
+} __TXB2D5bits_t;
 
-extern volatile TXB2D5bits_t at 0xf2b TXB2D5bits;
+extern volatile __TXB2D5bits_t at 0xf2b TXB2D5bits;
 
 extern sfr at 0xf2c TXB2D6;
 typedef union {
@@ -731,9 +731,9 @@ typedef union {
                unsigned TXB2D66:1;
                unsigned TXB2D67:1;
        };
-} TXB2D6bits_t;
+} __TXB2D6bits_t;
 
-extern volatile TXB2D6bits_t at 0xf2c TXB2D6bits;
+extern volatile __TXB2D6bits_t at 0xf2c TXB2D6bits;
 
 extern sfr at 0xf2d TXB2D7;
 typedef union {
@@ -747,9 +747,9 @@ typedef union {
                unsigned TXB2D76:1;
                unsigned TXB2D77:1;
        };
-} TXB2D7bits_t;
+} __TXB2D7bits_t;
 
-extern volatile TXB2D7bits_t at 0xf2d TXB2D7bits;
+extern volatile __TXB2D7bits_t at 0xf2d TXB2D7bits;
 
 extern sfr at 0xf2e CANSTATRO4;
 typedef union {
@@ -763,9 +763,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO4bits_t;
+} __CANSTATRO4bits_t;
 
-extern volatile CANSTATRO4bits_t at 0xf2e CANSTATRO4bits;
+extern volatile __CANSTATRO4bits_t at 0xf2e CANSTATRO4bits;
 
 extern sfr at 0xf30 TXB1CON;
 typedef union {
@@ -779,9 +779,9 @@ typedef union {
                unsigned TXABT:1;
                unsigned :1;
        };
-} TXB1CONbits_t;
+} __TXB1CONbits_t;
 
-extern volatile TXB1CONbits_t at 0xf30 TXB1CONbits;
+extern volatile __TXB1CONbits_t at 0xf30 TXB1CONbits;
 
 extern sfr at 0xf31 TXB1SIDH;
 typedef union {
@@ -795,9 +795,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} TXB1SIDHbits_t;
+} __TXB1SIDHbits_t;
 
-extern volatile TXB1SIDHbits_t at 0xf31 TXB1SIDHbits;
+extern volatile __TXB1SIDHbits_t at 0xf31 TXB1SIDHbits;
 
 extern sfr at 0xf32 TXB1SIDL;
 typedef union {
@@ -811,9 +811,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} TXB1SIDLbits_t;
+} __TXB1SIDLbits_t;
 
-extern volatile TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
+extern volatile __TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
 
 extern sfr at 0xf33 TXB1EIDH;
 typedef union {
@@ -827,9 +827,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} TXB1EIDHbits_t;
+} __TXB1EIDHbits_t;
 
-extern volatile TXB1EIDHbits_t at 0xf33 TXB1EIDHbits;
+extern volatile __TXB1EIDHbits_t at 0xf33 TXB1EIDHbits;
 
 extern sfr at 0xf34 TXB1EIDL;
 typedef union {
@@ -843,9 +843,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} TXB1EIDLbits_t;
+} __TXB1EIDLbits_t;
 
-extern volatile TXB1EIDLbits_t at 0xf34 TXB1EIDLbits;
+extern volatile __TXB1EIDLbits_t at 0xf34 TXB1EIDLbits;
 
 extern sfr at 0xf35 TXB1DLC;
 typedef union {
@@ -859,9 +859,9 @@ typedef union {
                unsigned TXRTR:1;
                unsigned :1;
        };
-} TXB1DLCbits_t;
+} __TXB1DLCbits_t;
 
-extern volatile TXB1DLCbits_t at 0xf35 TXB1DLCbits;
+extern volatile __TXB1DLCbits_t at 0xf35 TXB1DLCbits;
 
 extern sfr at 0xf36 TXB1D0;
 typedef union {
@@ -875,9 +875,9 @@ typedef union {
                unsigned TXB1D06:1;
                unsigned TXB1D07:1;
        };
-} TXB1D0bits_t;
+} __TXB1D0bits_t;
 
-extern volatile TXB1D0bits_t at 0xf36 TXB1D0bits;
+extern volatile __TXB1D0bits_t at 0xf36 TXB1D0bits;
 
 extern sfr at 0xf37 TXB1D1;
 typedef union {
@@ -891,9 +891,9 @@ typedef union {
                unsigned TXB1D16:1;
                unsigned TXB1D17:1;
        };
-} TXB1D1bits_t;
+} __TXB1D1bits_t;
 
-extern volatile TXB1D1bits_t at 0xf37 TXB1D1bits;
+extern volatile __TXB1D1bits_t at 0xf37 TXB1D1bits;
 
 extern sfr at 0xf38 TXB1D2;
 typedef union {
@@ -907,9 +907,9 @@ typedef union {
                unsigned TXB1D26:1;
                unsigned TXB1D27:1;
        };
-} TXB1D2bits_t;
+} __TXB1D2bits_t;
 
-extern volatile TXB1D2bits_t at 0xf38 TXB1D2bits;
+extern volatile __TXB1D2bits_t at 0xf38 TXB1D2bits;
 
 extern sfr at 0xf39 TXB1D3;
 typedef union {
@@ -923,9 +923,9 @@ typedef union {
                unsigned TXB1D36:1;
                unsigned TXB1D37:1;
        };
-} TXB1D3bits_t;
+} __TXB1D3bits_t;
 
-extern volatile TXB1D3bits_t at 0xf39 TXB1D3bits;
+extern volatile __TXB1D3bits_t at 0xf39 TXB1D3bits;
 
 extern sfr at 0xf3a TXB1D4;
 typedef union {
@@ -939,9 +939,9 @@ typedef union {
                unsigned TXB1D46:1;
                unsigned TXB1D47:1;
        };
-} TXB1D4bits_t;
+} __TXB1D4bits_t;
 
-extern volatile TXB1D4bits_t at 0xf3a TXB1D4bits;
+extern volatile __TXB1D4bits_t at 0xf3a TXB1D4bits;
 
 extern sfr at 0xf3b TXB1D5;
 typedef union {
@@ -955,9 +955,9 @@ typedef union {
                unsigned TXB1D56:1;
                unsigned TXB1D57:1;
        };
-} TXB1D5bits_t;
+} __TXB1D5bits_t;
 
-extern volatile TXB1D5bits_t at 0xf3b TXB1D5bits;
+extern volatile __TXB1D5bits_t at 0xf3b TXB1D5bits;
 
 extern sfr at 0xf3c TXB1D6;
 typedef union {
@@ -971,9 +971,9 @@ typedef union {
                unsigned TXB1D66:1;
                unsigned TXB1D67:1;
        };
-} TXB1D6bits_t;
+} __TXB1D6bits_t;
 
-extern volatile TXB1D6bits_t at 0xf3c TXB1D6bits;
+extern volatile __TXB1D6bits_t at 0xf3c TXB1D6bits;
 
 extern sfr at 0xf3d TXB1D7;
 typedef union {
@@ -987,9 +987,9 @@ typedef union {
                unsigned TXB1D76:1;
                unsigned TXB1D77:1;
        };
-} TXB1D7bits_t;
+} __TXB1D7bits_t;
 
-extern volatile TXB1D7bits_t at 0xf3d TXB1D7bits;
+extern volatile __TXB1D7bits_t at 0xf3d TXB1D7bits;
 
 extern sfr at 0xf3e CANSTATRO3;
 typedef union {
@@ -1003,9 +1003,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO3bits_t;
+} __CANSTATRO3bits_t;
 
-extern volatile CANSTATRO3bits_t at 0xf3e CANSTATRO3bits;
+extern volatile __CANSTATRO3bits_t at 0xf3e CANSTATRO3bits;
 
 extern sfr at 0xf40 TXB0CON;
 typedef union {
@@ -1019,9 +1019,9 @@ typedef union {
                unsigned TXABT:1;
                unsigned :1;
        };
-} TXB0CONbits_t;
+} __TXB0CONbits_t;
 
-extern volatile TXB0CONbits_t at 0xf40 TXB0CONbits;
+extern volatile __TXB0CONbits_t at 0xf40 TXB0CONbits;
 
 extern sfr at 0xf41 TXB0SIDH;
 typedef union {
@@ -1035,9 +1035,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} TXB0SIDHbits_t;
+} __TXB0SIDHbits_t;
 
-extern volatile TXB0SIDHbits_t at 0xf41 TXB0SIDHbits;
+extern volatile __TXB0SIDHbits_t at 0xf41 TXB0SIDHbits;
 
 extern sfr at 0xf42 TXB0SIDL;
 typedef union {
@@ -1051,9 +1051,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} TXB0SIDLbits_t;
+} __TXB0SIDLbits_t;
 
-extern volatile TXB0SIDLbits_t at 0xf42 TXB0SIDLbits;
+extern volatile __TXB0SIDLbits_t at 0xf42 TXB0SIDLbits;
 
 extern sfr at 0xf43 TXB0EIDH;
 typedef union {
@@ -1067,9 +1067,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} TXB0EIDHbits_t;
+} __TXB0EIDHbits_t;
 
-extern volatile TXB0EIDHbits_t at 0xf43 TXB0EIDHbits;
+extern volatile __TXB0EIDHbits_t at 0xf43 TXB0EIDHbits;
 
 extern sfr at 0xf44 TXB0EIDL;
 typedef union {
@@ -1083,9 +1083,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} TXB0EIDLbits_t;
+} __TXB0EIDLbits_t;
 
-extern volatile TXB0EIDLbits_t at 0xf44 TXB0EIDLbits;
+extern volatile __TXB0EIDLbits_t at 0xf44 TXB0EIDLbits;
 
 extern sfr at 0xf45 TXB0DLC;
 typedef union {
@@ -1099,9 +1099,9 @@ typedef union {
                unsigned TXRTR:1;
                unsigned :1;
        };
-} TXB0DLCbits_t;
+} __TXB0DLCbits_t;
 
-extern volatile TXB0DLCbits_t at 0xf45 TXB0DLCbits;
+extern volatile __TXB0DLCbits_t at 0xf45 TXB0DLCbits;
 
 extern sfr at 0xf46 TXB0D0;
 typedef union {
@@ -1115,9 +1115,9 @@ typedef union {
                unsigned TXB0D06:1;
                unsigned TXB0D07:1;
        };
-} TXB0D0bits_t;
+} __TXB0D0bits_t;
 
-extern volatile TXB0D0bits_t at 0xf46 TXB0D0bits;
+extern volatile __TXB0D0bits_t at 0xf46 TXB0D0bits;
 
 extern sfr at 0xf47 TXB0D1;
 typedef union {
@@ -1131,9 +1131,9 @@ typedef union {
                unsigned TXB0D16:1;
                unsigned TXB0D17:1;
        };
-} TXB0D1bits_t;
+} __TXB0D1bits_t;
 
-extern volatile TXB0D1bits_t at 0xf47 TXB0D1bits;
+extern volatile __TXB0D1bits_t at 0xf47 TXB0D1bits;
 
 extern sfr at 0xf48 TXB0D2;
 typedef union {
@@ -1147,9 +1147,9 @@ typedef union {
                unsigned TXB0D26:1;
                unsigned TXB0D27:1;
        };
-} TXB0D2bits_t;
+} __TXB0D2bits_t;
 
-extern volatile TXB0D2bits_t at 0xf48 TXB0D2bits;
+extern volatile __TXB0D2bits_t at 0xf48 TXB0D2bits;
 
 extern sfr at 0xf49 TXB0D3;
 typedef union {
@@ -1163,9 +1163,9 @@ typedef union {
                unsigned TXBD0D36:1;
                unsigned TXB0D37:1;
        };
-} TXB0D3bits_t;
+} __TXB0D3bits_t;
 
-extern volatile TXB0D3bits_t at 0xf49 TXB0D3bits;
+extern volatile __TXB0D3bits_t at 0xf49 TXB0D3bits;
 
 extern sfr at 0xf4a TXB0D4;
 typedef union {
@@ -1179,9 +1179,9 @@ typedef union {
                unsigned TXB0D46:1;
                unsigned TXB0D47:1;
        };
-} TXB0D4bits_t;
+} __TXB0D4bits_t;
 
-extern volatile TXB0D4bits_t at 0xf4a TXB0D4bits;
+extern volatile __TXB0D4bits_t at 0xf4a TXB0D4bits;
 
 extern sfr at 0xf4b TXB0D5;
 typedef union {
@@ -1195,9 +1195,9 @@ typedef union {
                unsigned TXB0D56:1;
                unsigned TXB0D57:1;
        };
-} TXB0D5bits_t;
+} __TXB0D5bits_t;
 
-extern volatile TXB0D5bits_t at 0xf4b TXB0D5bits;
+extern volatile __TXB0D5bits_t at 0xf4b TXB0D5bits;
 
 extern sfr at 0xf4c TXB0D6;
 typedef union {
@@ -1211,9 +1211,9 @@ typedef union {
                unsigned TXB0D66:1;
                unsigned TXB0D67:1;
        };
-} TXB0D6bits_t;
+} __TXB0D6bits_t;
 
-extern volatile TXB0D6bits_t at 0xf4c TXB0D6bits;
+extern volatile __TXB0D6bits_t at 0xf4c TXB0D6bits;
 
 extern sfr at 0xf4d TXB0D7;
 typedef union {
@@ -1227,9 +1227,9 @@ typedef union {
                unsigned TXB0D76:1;
                unsigned TXB0D77:1;
        };
-} TXB0D7bits_t;
+} __TXB0D7bits_t;
 
-extern volatile TXB0D7bits_t at 0xf4d TXB0D7bits;
+extern volatile __TXB0D7bits_t at 0xf4d TXB0D7bits;
 
 extern sfr at 0xf4e CANSTATRO2;
 typedef union {
@@ -1243,9 +1243,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO2bits_t;
+} __CANSTATRO2bits_t;
 
-extern volatile CANSTATRO2bits_t at 0xf4e CANSTATRO2bits;
+extern volatile __CANSTATRO2bits_t at 0xf4e CANSTATRO2bits;
 
 extern sfr at 0xf50 RXB1CON;
 typedef union {
@@ -1259,9 +1259,9 @@ typedef union {
                unsigned RXM1:1;
                unsigned RXFUL:1;
        };
-} RXB1CONbits_t;
+} __RXB1CONbits_t;
 
-extern volatile RXB1CONbits_t at 0xf50 RXB1CONbits;
+extern volatile __RXB1CONbits_t at 0xf50 RXB1CONbits;
 
 extern sfr at 0xf51 RXB1SIDH;
 typedef union {
@@ -1275,9 +1275,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXB1SIDHbits_t;
+} __RXB1SIDHbits_t;
 
-extern volatile RXB1SIDHbits_t at 0xf51 RXB1SIDHbits;
+extern volatile __RXB1SIDHbits_t at 0xf51 RXB1SIDHbits;
 
 extern sfr at 0xf52 RXB1SIDL;
 typedef union {
@@ -1291,9 +1291,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXB1SIDLbits_t;
+} __RXB1SIDLbits_t;
 
-extern volatile RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
+extern volatile __RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
 
 extern sfr at 0xf53 RXB1EIDH;
 typedef union {
@@ -1307,9 +1307,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXB1EIDHbits_t;
+} __RXB1EIDHbits_t;
 
-extern volatile RXB1EIDHbits_t at 0xf53 RXB1EIDHbits;
+extern volatile __RXB1EIDHbits_t at 0xf53 RXB1EIDHbits;
 
 extern sfr at 0xf54 RXB1EIDL;
 typedef union {
@@ -1323,9 +1323,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXB1EIDLbits_t;
+} __RXB1EIDLbits_t;
 
-extern volatile RXB1EIDLbits_t at 0xf54 RXB1EIDLbits;
+extern volatile __RXB1EIDLbits_t at 0xf54 RXB1EIDLbits;
 
 extern sfr at 0xf55 RXB1DLC;
 typedef union {
@@ -1339,9 +1339,9 @@ typedef union {
                unsigned RXRTR:1;
                unsigned :1;
        };
-} RXB1DLCbits_t;
+} __RXB1DLCbits_t;
 
-extern volatile RXB1DLCbits_t at 0xf55 RXB1DLCbits;
+extern volatile __RXB1DLCbits_t at 0xf55 RXB1DLCbits;
 
 extern sfr at 0xf56 RXB1D0;
 typedef union {
@@ -1355,9 +1355,9 @@ typedef union {
                unsigned RXB1D06:1;
                unsigned RXB1D07:1;
        };
-} RXB1D0bits_t;
+} __RXB1D0bits_t;
 
-extern volatile RXB1D0bits_t at 0xf56 RXB1D0bits;
+extern volatile __RXB1D0bits_t at 0xf56 RXB1D0bits;
 
 extern sfr at 0xf57 RXB1D1;
 typedef union {
@@ -1371,9 +1371,9 @@ typedef union {
                unsigned RXB1D16:1;
                unsigned RXB1D17:1;
        };
-} RXB1D1bits_t;
+} __RXB1D1bits_t;
 
-extern volatile RXB1D1bits_t at 0xf57 RXB1D1bits;
+extern volatile __RXB1D1bits_t at 0xf57 RXB1D1bits;
 
 extern sfr at 0xf58 RXB1D2;
 typedef union {
@@ -1387,9 +1387,9 @@ typedef union {
                unsigned RXB1D26:1;
                unsigned RXB1D27:1;
        };
-} RXB1D2bits_t;
+} __RXB1D2bits_t;
 
-extern volatile RXB1D2bits_t at 0xf58 RXB1D2bits;
+extern volatile __RXB1D2bits_t at 0xf58 RXB1D2bits;
 
 extern sfr at 0xf59 RXB1D3;
 typedef union {
@@ -1403,9 +1403,9 @@ typedef union {
                unsigned RXB1D36:1;
                unsigned RXB1D37:1;
        };
-} RXB1D3bits_t;
+} __RXB1D3bits_t;
 
-extern volatile RXB1D3bits_t at 0xf59 RXB1D3bits;
+extern volatile __RXB1D3bits_t at 0xf59 RXB1D3bits;
 
 extern sfr at 0xf5a RXB1D4;
 typedef union {
@@ -1419,9 +1419,9 @@ typedef union {
                unsigned RXB1D46:1;
                unsigned RXB1D47:1;
        };
-} RXB1D4bits_t;
+} __RXB1D4bits_t;
 
-extern volatile RXB1D4bits_t at 0xf5a RXB1D4bits;
+extern volatile __RXB1D4bits_t at 0xf5a RXB1D4bits;
 
 extern sfr at 0xf5b RXB1D5;
 typedef union {
@@ -1435,9 +1435,9 @@ typedef union {
                unsigned RXB1D56:1;
                unsigned RXB1D57:1;
        };
-} RXB1D5bits_t;
+} __RXB1D5bits_t;
 
-extern volatile RXB1D5bits_t at 0xf5b RXB1D5bits;
+extern volatile __RXB1D5bits_t at 0xf5b RXB1D5bits;
 
 extern sfr at 0xf5c RXB1D6;
 typedef union {
@@ -1451,9 +1451,9 @@ typedef union {
                unsigned RXB1D66:1;
                unsigned RXB1D67:1;
        };
-} RXB1D6bits_t;
+} __RXB1D6bits_t;
 
-extern volatile RXB1D6bits_t at 0xf5c RXB1D6bits;
+extern volatile __RXB1D6bits_t at 0xf5c RXB1D6bits;
 
 extern sfr at 0xf5d RXB1D7;
 typedef union {
@@ -1467,9 +1467,9 @@ typedef union {
                unsigned RXB1D76:1;
                unsigned RXB1D77:1;
        };
-} RXB1D7bits_t;
+} __RXB1D7bits_t;
 
-extern volatile RXB1D7bits_t at 0xf5d RXB1D7bits;
+extern volatile __RXB1D7bits_t at 0xf5d RXB1D7bits;
 
 extern sfr at 0xf5e CANSTATRO1;
 typedef union {
@@ -1483,9 +1483,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO1bits_t;
+} __CANSTATRO1bits_t;
 
-extern volatile CANSTATRO1bits_t at 0xf5e CANSTATRO1bits;
+extern volatile __CANSTATRO1bits_t at 0xf5e CANSTATRO1bits;
 
 extern sfr at 0xf60 RXB0CON;
 typedef union {
@@ -1499,9 +1499,9 @@ typedef union {
                unsigned RXM1:1;
                unsigned RXFUL:1;
        };
-} RXB0CONbits_t;
+} __RXB0CONbits_t;
 
-extern volatile RXB0CONbits_t at 0xf60 RXB0CONbits;
+extern volatile __RXB0CONbits_t at 0xf60 RXB0CONbits;
 
 extern sfr at 0xf61 RXB0SIDH;
 typedef union {
@@ -1515,9 +1515,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXB0SIDHbits_t;
+} __RXB0SIDHbits_t;
 
-extern volatile RXB0SIDHbits_t at 0xf61 RXB0SIDHbits;
+extern volatile __RXB0SIDHbits_t at 0xf61 RXB0SIDHbits;
 
 extern sfr at 0xf62 RXB0SIDL;
 typedef union {
@@ -1531,9 +1531,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXB0SIDLbits_t;
+} __RXB0SIDLbits_t;
 
-extern volatile RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
+extern volatile __RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
 
 extern sfr at 0xf63 RXB0EIDH;
 typedef union {
@@ -1547,9 +1547,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXB0EIDHbits_t;
+} __RXB0EIDHbits_t;
 
-extern volatile RXB0EIDHbits_t at 0xf63 RXB0EIDHbits;
+extern volatile __RXB0EIDHbits_t at 0xf63 RXB0EIDHbits;
 
 extern sfr at 0xf64 RXB0EIDL;
 typedef union {
@@ -1563,9 +1563,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXB0EIDLbits_t;
+} __RXB0EIDLbits_t;
 
-extern volatile RXB0EIDLbits_t at 0xf64 RXB0EIDLbits;
+extern volatile __RXB0EIDLbits_t at 0xf64 RXB0EIDLbits;
 
 extern sfr at 0xf65 RXB0DLC;
 typedef union {
@@ -1579,9 +1579,9 @@ typedef union {
                unsigned RTR:1;
                unsigned :1;
        };
-} RXB0DLCbits_t;
+} __RXB0DLCbits_t;
 
-extern volatile RXB0DLCbits_t at 0xf65 RXB0DLCbits;
+extern volatile __RXB0DLCbits_t at 0xf65 RXB0DLCbits;
 
 extern sfr at 0xf66 RXB0D0;
 extern sfr at 0xf67 RXB0D1;
@@ -1603,9 +1603,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATbits_t;
+} __CANSTATbits_t;
 
-extern volatile CANSTATbits_t at 0xf6e CANSTATbits;
+extern volatile __CANSTATbits_t at 0xf6e CANSTATbits;
 
 extern sfr at 0xf6f CANCON;
 typedef union {
@@ -1619,9 +1619,9 @@ typedef union {
                unsigned REQOP1:1;
                unsigned REQOP2:1;
        };
-} CANCONbits_t;
+} __CANCONbits_t;
 
-extern volatile CANCONbits_t at 0xf6f CANCONbits;
+extern volatile __CANCONbits_t at 0xf6f CANCONbits;
 
 extern sfr at 0xf70 BRGCON1;
 typedef union {
@@ -1635,9 +1635,9 @@ typedef union {
                unsigned SJW0:1;
                unsigned SJW1:1;
        };
-} BRGCON1bits_t;
+} __BRGCON1bits_t;
 
-extern volatile BRGCON1bits_t at 0xf70 BRGCON1bits;
+extern volatile __BRGCON1bits_t at 0xf70 BRGCON1bits;
 
 extern sfr at 0xf71 BRGCON2;
 typedef union {
@@ -1651,9 +1651,9 @@ typedef union {
                unsigned SAM:1;
                unsigned SEG2PHTS:1;
        };
-} BRGCON2bits_t;
+} __BRGCON2bits_t;
 
-extern volatile BRGCON2bits_t at 0xf71 BRGCON2bits;
+extern volatile __BRGCON2bits_t at 0xf71 BRGCON2bits;
 
 extern sfr at 0xf72 BRGCON3;
 typedef union {
@@ -1667,9 +1667,9 @@ typedef union {
                unsigned WAKFIL:1;
                unsigned :1;
        };
-} BRGCON3bits_t;
+} __BRGCON3bits_t;
 
-extern volatile BRGCON3bits_t at 0xf72 BRGCON3bits;
+extern volatile __BRGCON3bits_t at 0xf72 BRGCON3bits;
 
 extern sfr at 0xf73 CIOCON;
 typedef union {
@@ -1683,9 +1683,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CIOCONbits_t;
+} __CIOCONbits_t;
 
-extern volatile CIOCONbits_t at 0xf73 CIOCONbits;
+extern volatile __CIOCONbits_t at 0xf73 CIOCONbits;
 
 extern sfr at 0xf74 COMSTAT;
 typedef union {
@@ -1699,9 +1699,9 @@ typedef union {
                unsigned RXB1OVFL:1;
                unsigned RXB0OVFL:1;
        };
-} COMSTATbits_t;
+} __COMSTATbits_t;
 
-extern volatile COMSTATbits_t at 0xf74 COMSTATbits;
+extern volatile __COMSTATbits_t at 0xf74 COMSTATbits;
 
 extern sfr at 0xf75 RXERRCNT;
 typedef union {
@@ -1715,9 +1715,9 @@ typedef union {
                unsigned REC6:1;
                unsigned REC7:1;
        };
-} RXERRCNTbits_t;
+} __RXERRCNTbits_t;
 
-extern volatile RXERRCNTbits_t at 0xf75 RXERRCNTbits;
+extern volatile __RXERRCNTbits_t at 0xf75 RXERRCNTbits;
 
 extern sfr at 0xf76 TXERRCNT;
 typedef union {
@@ -1731,9 +1731,9 @@ typedef union {
                unsigned TEC6:1;
                unsigned TEC7:1;
        };
-} TXERRCNTbits_t;
+} __TXERRCNTbits_t;
 
-extern volatile TXERRCNTbits_t at 0xf76 TXERRCNTbits;
+extern volatile __TXERRCNTbits_t at 0xf76 TXERRCNTbits;
 
 extern sfr at 0xf80 PORTA;
 typedef union {
@@ -1780,9 +1780,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTAbits_t;
+} __PORTAbits_t;
 
-extern volatile PORTAbits_t at 0xf80 PORTAbits;
+extern volatile __PORTAbits_t at 0xf80 PORTAbits;
 
 extern sfr at 0xf81 PORTB;
 typedef union {
@@ -1807,9 +1807,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTBbits_t;
+} __PORTBbits_t;
 
-extern volatile PORTBbits_t at 0xf81 PORTBbits;
+extern volatile __PORTBbits_t at 0xf81 PORTBbits;
 
 extern sfr at 0xf82 PORTC;
 typedef union {
@@ -1845,9 +1845,9 @@ typedef union {
                unsigned CK:1;
                unsigned DT:1;
        };
-} PORTCbits_t;
+} __PORTCbits_t;
 
-extern volatile PORTCbits_t at 0xf82 PORTCbits;
+extern volatile __PORTCbits_t at 0xf82 PORTCbits;
 
 extern sfr at 0xf89 LATA;
 typedef union {
@@ -1861,9 +1861,9 @@ typedef union {
                unsigned LATA6:1;
                unsigned :1;
        };
-} LATAbits_t;
+} __LATAbits_t;
 
-extern volatile LATAbits_t at 0xf89 LATAbits;
+extern volatile __LATAbits_t at 0xf89 LATAbits;
 
 extern sfr at 0xf8a LATB;
 typedef union {
@@ -1877,9 +1877,9 @@ typedef union {
                unsigned LATB6:1;
                unsigned LATB7:1;
        };
-} LATBbits_t;
+} __LATBbits_t;
 
-extern volatile LATBbits_t at 0xf8a LATBbits;
+extern volatile __LATBbits_t at 0xf8a LATBbits;
 
 extern sfr at 0xf8b LATC;
 typedef union {
@@ -1893,9 +1893,9 @@ typedef union {
                unsigned LATC6:1;
                unsigned LATC7:1;
        };
-} LATCbits_t;
+} __LATCbits_t;
 
-extern volatile LATCbits_t at 0xf8b LATCbits;
+extern volatile __LATCbits_t at 0xf8b LATCbits;
 
 extern sfr at 0xf92 TRISA;
 typedef union {
@@ -1909,9 +1909,9 @@ typedef union {
                unsigned TRISA6:1;
                unsigned :1;
        };
-} TRISAbits_t;
+} __TRISAbits_t;
 
-extern volatile TRISAbits_t at 0xf92 TRISAbits;
+extern volatile __TRISAbits_t at 0xf92 TRISAbits;
 
 extern sfr at 0xf93 TRISB;
 typedef union {
@@ -1925,9 +1925,9 @@ typedef union {
                unsigned TRISB6:1;
                unsigned TRISB7:1;
        };
-} TRISBbits_t;
+} __TRISBbits_t;
 
-extern volatile TRISBbits_t at 0xf93 TRISBbits;
+extern volatile __TRISBbits_t at 0xf93 TRISBbits;
 
 extern sfr at 0xf94 TRISC;
 typedef union {
@@ -1941,9 +1941,9 @@ typedef union {
                unsigned TRISC6:1;
                unsigned TRISC7:1;
        };
-} TRISCbits_t;
+} __TRISCbits_t;
 
-extern volatile TRISCbits_t at 0xf94 TRISCbits;
+extern volatile __TRISCbits_t at 0xf94 TRISCbits;
 
 extern sfr at 0xf9d PIE1;
 typedef union {
@@ -1957,9 +1957,9 @@ typedef union {
                unsigned ADIE:1;
                unsigned PSPIE:1;
        };
-} PIE1bits_t;
+} __PIE1bits_t;
 
-extern volatile PIE1bits_t at 0xf9d PIE1bits;
+extern volatile __PIE1bits_t at 0xf9d PIE1bits;
 
 extern sfr at 0xf9e PIR1;
 typedef union {
@@ -1973,9 +1973,9 @@ typedef union {
                unsigned ADIF:1;
                unsigned PSPIF:1;
        };
-} PIR1bits_t;
+} __PIR1bits_t;
 
-extern volatile PIR1bits_t at 0xf9e PIR1bits;
+extern volatile __PIR1bits_t at 0xf9e PIR1bits;
 
 extern sfr at 0xf9f IPR1;
 typedef union {
@@ -1989,9 +1989,9 @@ typedef union {
                unsigned ADIP:1;
                unsigned PSPIP:1;
        };
-} IPR1bits_t;
+} __IPR1bits_t;
 
-extern volatile IPR1bits_t at 0xf9f IPR1bits;
+extern volatile __IPR1bits_t at 0xf9f IPR1bits;
 
 extern sfr at 0xfa0 PIE2;
 typedef union {
@@ -2005,9 +2005,9 @@ typedef union {
                unsigned CMIE:1;
                unsigned :1;
        };
-} PIE2bits_t;
+} __PIE2bits_t;
 
-extern volatile PIE2bits_t at 0xfa0 PIE2bits;
+extern volatile __PIE2bits_t at 0xfa0 PIE2bits;
 
 extern sfr at 0xfa1 PIR2;
 typedef union {
@@ -2021,9 +2021,9 @@ typedef union {
                unsigned CMIF:1;
                unsigned :1;
        };
-} PIR2bits_t;
+} __PIR2bits_t;
 
-extern volatile PIR2bits_t at 0xfa1 PIR2bits;
+extern volatile __PIR2bits_t at 0xfa1 PIR2bits;
 
 extern sfr at 0xfa2 IPR2;
 typedef union {
@@ -2037,9 +2037,9 @@ typedef union {
                unsigned CMIP:1;
                unsigned :1;
        };
-} IPR2bits_t;
+} __IPR2bits_t;
 
-extern volatile IPR2bits_t at 0xfa2 IPR2bits;
+extern volatile __IPR2bits_t at 0xfa2 IPR2bits;
 
 extern sfr at 0xfa3 PIE3;
 typedef union {
@@ -2053,9 +2053,9 @@ typedef union {
                unsigned WAKIE:1;
                unsigned IVRE:1;
        };
-} PIE3bits_t;
+} __PIE3bits_t;
 
-extern volatile PIE3bits_t at 0xfa3 PIE3bits;
+extern volatile __PIE3bits_t at 0xfa3 PIE3bits;
 
 extern sfr at 0xfa4 PIR3;
 typedef union {
@@ -2069,9 +2069,9 @@ typedef union {
                unsigned WAKIF:1;
                unsigned IVRF:1;
        };
-} PIR3bits_t;
+} __PIR3bits_t;
 
-extern volatile PIR3bits_t at 0xfa4 PIR3bits;
+extern volatile __PIR3bits_t at 0xfa4 PIR3bits;
 
 extern sfr at 0xfa5 IPR3;
 typedef union {
@@ -2085,9 +2085,9 @@ typedef union {
                unsigned WAKIP:1;
                unsigned IVRP:1;
        };
-} IPR3bits_t;
+} __IPR3bits_t;
 
-extern volatile IPR3bits_t at 0xfa5 IPR3bits;
+extern volatile __IPR3bits_t at 0xfa5 IPR3bits;
 
 extern sfr at 0xfa6 EECON1;
 typedef union {
@@ -2101,9 +2101,9 @@ typedef union {
                unsigned CFGS:1;
                unsigned EEPGD:1;
        };
-} EECON1bits_t;
+} __EECON1bits_t;
 
-extern volatile EECON1bits_t at 0xfa6 EECON1bits;
+extern volatile __EECON1bits_t at 0xfa6 EECON1bits;
 
 extern sfr at 0xfa7 EECON2;
 extern sfr at 0xfa8 EEDATA;
@@ -2120,9 +2120,9 @@ typedef union {
                unsigned RX9:1;
                unsigned SPEN:1;
        };
-} RCSTAbits_t;
+} __RCSTAbits_t;
 
-extern volatile RCSTAbits_t at 0xfab RCSTAbits;
+extern volatile __RCSTAbits_t at 0xfab RCSTAbits;
 
 extern sfr at 0xfac TXSTA;
 typedef union {
@@ -2136,9 +2136,9 @@ typedef union {
                unsigned TX9:1;
                unsigned CSRC:1;
        };
-} TXSTAbits_t;
+} __TXSTAbits_t;
 
-extern volatile TXSTAbits_t at 0xfac TXSTAbits;
+extern volatile __TXSTAbits_t at 0xfac TXSTAbits;
 
 extern sfr at 0xfad TXREG;
 extern sfr at 0xfae RCREG;
@@ -2155,9 +2155,9 @@ typedef union {
                unsigned T3CCP2:1;
                unsigned RD16:1;
        };
-} T3CONbits_t;
+} __T3CONbits_t;
 
-extern volatile T3CONbits_t at 0xfb1 T3CONbits;
+extern volatile __T3CONbits_t at 0xfb1 T3CONbits;
 
 extern sfr at 0xfb2 TMR3L;
 extern sfr at 0xfb3 TMR3H;
@@ -2173,9 +2173,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CCP1CONbits_t;
+} __CCP1CONbits_t;
 
-extern volatile CCP1CONbits_t at 0xfbd CCP1CONbits;
+extern volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
 
 extern sfr at 0xfbe CCPR1L;
 extern sfr at 0xfbf CCPR1H;
@@ -2191,9 +2191,9 @@ typedef union {
                unsigned ADCS2:1;
                unsigned ADFM:1;
        };
-} ADCON1bits_t;
+} __ADCON1bits_t;
 
-extern volatile ADCON1bits_t at 0xfc1 ADCON1bits;
+extern volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
 
 extern sfr at 0xfc2 ADCON0;
 typedef union {
@@ -2207,9 +2207,9 @@ typedef union {
                unsigned ADCS0:1;
                unsigned ADCS1:1;
        };
-} ADCON0bits_t;
+} __ADCON0bits_t;
 
-extern volatile ADCON0bits_t at 0xfc2 ADCON0bits;
+extern volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
 
 extern sfr at 0xfc3 ADRESL;
 extern sfr at 0xfc4 ADRESH;
@@ -2225,9 +2225,9 @@ typedef union {
                unsigned ACKSTAT:1;
                unsigned GCEN:1;
        };
-} SSPCON2bits_t;
+} __SSPCON2bits_t;
 
-extern volatile SSPCON2bits_t at 0xfc5 SSPCON2bits;
+extern volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
 
 extern sfr at 0xfc6 SSPCON1;
 typedef union {
@@ -2241,9 +2241,9 @@ typedef union {
                unsigned SSPOV:1;
                unsigned WCOL:1;
        };
-} SSPCON1bits_t;
+} __SSPCON1bits_t;
 
-extern volatile SSPCON1bits_t at 0xfc6 SSPCON1bits;
+extern volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
 
 extern sfr at 0xfc7 SSPSTAT;
 typedef union {
@@ -2257,9 +2257,9 @@ typedef union {
                unsigned CKE:1;
                unsigned SMP:1;
        };
-} SSPSTATbits_t;
+} __SSPSTATbits_t;
 
-extern volatile SSPSTATbits_t at 0xfc7 SSPSTATbits;
+extern volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
 
 extern sfr at 0xfc8 SSPADD;
 extern sfr at 0xfc9 SSPBUF;
@@ -2275,9 +2275,9 @@ typedef union {
                unsigned TOUTPS3:1;
                unsigned :1;
        };
-} T2CONbits_t;
+} __T2CONbits_t;
 
-extern volatile T2CONbits_t at 0xfca T2CONbits;
+extern volatile __T2CONbits_t at 0xfca T2CONbits;
 
 extern sfr at 0xfcb PR2;
 extern sfr at 0xfcc TMR2;
@@ -2293,9 +2293,9 @@ typedef union {
                unsigned :1;
                unsigned RD16:1;
        };
-} T1CONbits_t;
+} __T1CONbits_t;
 
-extern volatile T1CONbits_t at 0xfcd T1CONbits;
+extern volatile __T1CONbits_t at 0xfcd T1CONbits;
 
 extern sfr at 0xfce TMR1L;
 extern sfr at 0xfcf TMR1H;
@@ -2311,9 +2311,9 @@ typedef union {
                unsigned :1;
                unsigned IPEN:1;
        };
-} RCONbits_t;
+} __RCONbits_t;
 
-extern volatile RCONbits_t at 0xfd0 RCONbits;
+extern volatile __RCONbits_t at 0xfd0 RCONbits;
 
 extern sfr at 0xfd1 WDTCON;
 typedef union {
@@ -2338,9 +2338,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} WDTCONbits_t;
+} __WDTCONbits_t;
 
-extern volatile WDTCONbits_t at 0xfd1 WDTCONbits;
+extern volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
 
 extern sfr at 0xfd2 LVDCON;
 typedef union {
@@ -2365,9 +2365,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} LVDCONbits_t;
+} __LVDCONbits_t;
 
-extern volatile LVDCONbits_t at 0xfd2 LVDCONbits;
+extern volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
 
 extern sfr at 0xfd3 OSCCON;
 typedef union {
@@ -2381,9 +2381,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} OSCCONbits_t;
+} __OSCCONbits_t;
 
-extern volatile OSCCONbits_t at 0xfd3 OSCCONbits;
+extern volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
 
 extern sfr at 0xfd5 T0CON;
 extern sfr at 0xfd6 TMR0L;
@@ -2400,9 +2400,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} STATUSbits_t;
+} __STATUSbits_t;
 
-extern volatile STATUSbits_t at 0xfd8 STATUSbits;
+extern volatile __STATUSbits_t at 0xfd8 STATUSbits;
 
 extern sfr at 0xfd9 FSR2L;
 extern sfr at 0xfda FSR2H;
@@ -2450,9 +2450,9 @@ typedef union {
                unsigned INT1IP:1;
                unsigned :1;
        };
-} INTCON3bits_t;
+} __INTCON3bits_t;
 
-extern volatile INTCON3bits_t at 0xff0 INTCON3bits;
+extern volatile __INTCON3bits_t at 0xff0 INTCON3bits;
 
 extern sfr at 0xff1 INTCON2;
 typedef union {
@@ -2466,9 +2466,9 @@ typedef union {
                unsigned INTEDG0:1;
                unsigned RBPU:1;
        };
-} INTCON2bits_t;
+} __INTCON2bits_t;
 
-extern volatile INTCON2bits_t at 0xff1 INTCON2bits;
+extern volatile __INTCON2bits_t at 0xff1 INTCON2bits;
 
 extern sfr at 0xff2 INTCON;
 typedef union {
@@ -2482,9 +2482,9 @@ typedef union {
                unsigned PEIE:1;
                unsigned GIE:1;
        };
-} INTCONbits_t;
+} __INTCONbits_t;
 
-extern volatile INTCONbits_t at 0xff2 INTCONbits;
+extern volatile __INTCONbits_t at 0xff2 INTCONbits;
 
 extern sfr at 0xff3 PRODL;
 extern sfr at 0xff4 PRODH;
@@ -2507,14 +2507,130 @@ typedef union {
                unsigned STKUNF:1;
                unsigned STKFUL:1;
        };
-} STKPTRbits_t;
+} __STKPTRbits_t;
 
-extern volatile STKPTRbits_t at 0xffc STKPTRbits;
+extern volatile __STKPTRbits_t at 0xffc STKPTRbits;
 
 extern sfr at 0xffd TOSL;
 extern sfr at 0xffe TOSH;
 extern sfr at 0xfff TOSU;
 
 
-#endif
+/* Configuration registers locations */
+#define __CONFIG0H     0x300001
+#define __CONFIG1L     0x300002
+#define __CONFIG1H     0x300003
+#define __CONFIG3L     0x300006
+#define __CONFIG4L     0x300008
+#define __CONFIG4H     0x300009
+#define __CONFIG5L     0x30000A
+#define __CONFIG5H     0x30000B
+#define __CONFIG6L     0x30000C
+#define __CONFIG6H     0x30000D
+
+
+
+/* Oscillator 0H options */
+#define _OSC_RC_OSC2_0H        0xFF    /* RC-OSC2 as RA6 */
+#define _OSC_HS_PLL_0H 0xFE    /* HS-PLL Enabled */
+#define _OSC_EC_OSC2_RA6_0H    0xFD    /* EC-OSC2 as RA6 */
+#define _OSC_EC_OSC2_Clock_Out_0H      0xFC    /* EC-OSC2 as Clock_Out */
+#define _OSC_RC_0H     0xFB    /* RC */
+#define _OSC_HS_0H     0xFA    /* HS */
+#define _OSC_XT_0H     0xF9    /* XT */
+#define _OSC_LP_0H     0xF8    /* LP */
+
+/* Osc. Switch Enable 0H options */
+#define _OSCS_OFF_0H   0xFF    /* Disabled */
+#define _OSCS_ON_0H    0xDF    /* Enabled */
+
+/* Power Up Timer 1L options */
+#define _PUT_OFF_1L    0xFF    /* Disabled */
+#define _PUT_ON_1L     0xFE    /* Enabled */
+
+/* Brown Out Detect 1L options */
+#define _BODEN_ON_1L   0xFF    /* Enabled */
+#define _BODEN_OFF_1L  0xFD    /* Disabled */
+
+/* Brown Out Voltage 1L options */
+#define _BODENV_2_0V_1L        0xFF    /* 2.0V */
+#define _BODENV_2_7V_1L        0xFB    /* 2.7V */
+#define _BODENV_4_2V_1L        0xF7    /* 4.2V */
+#define _BODENV_4_5V_1L        0xF3    /* 4.5V */
+
+/* Watchdog Timer 1H options */
+#define _WDT_ON_1H     0xFF    /* Enabled */
+#define _WDT_OFF_1H    0xFE    /* Disabled */
+
+/* Watchdog Postscaler 1H options */
+#define _WDTPS_1_128_1H        0xFF    /* 1:128 */
+#define _WDTPS_1_64_1H 0xFD    /* 1:64 */
+#define _WDTPS_1_32_1H 0xFB    /* 1:32 */
+#define _WDTPS_1_16_1H 0xF9    /* 1:16 */
+#define _WDTPS_1_8_1H  0xF7    /* 1:8 */
+#define _WDTPS_1_4_1H  0xF5    /* 1:4 */
+#define _WDTPS_1_2_1H  0xF3    /* 1:2 */
+#define _WDTPS_1_1_1H  0xF1    /* 1:1 */
+
+/* Low Voltage Program 3L options */
+#define _LVP_ON_3L     0xFF    /* Enabled */
+#define _LVP_OFF_3L    0xFB    /* Disabled */
+
+/* Background Debug 3L options */
+#define _BACKBUG_OFF_3L        0xFF    /* Disabled */
+#define _BACKBUG_ON_3L 0x7F    /* Enabled */
+
+/* Stack Overflow Reset 3L options */
+#define _STVR_ON_3L    0xFF    /* Enabled */
+#define _STVR_OFF_3L   0xFE    /* Disabled */
+
+/* Code Protect 00200-01FFF 4L options */
+#define _CP_0_OFF_4L   0xFF    /* Disabled */
+#define _CP_0_ON_4L    0xFE    /* Enabled */
+
+/* Code Protect 02000-03FFF 4L options */
+#define _CP_1_OFF_4L   0xFF    /* Disabled */
+#define _CP_1_ON_4L    0xFD    /* Enabled */
+
+/* Data EE Read Protect 4H options */
+#define _CPD_OFF_4H    0xFF    /* Disabled */
+#define _CPD_ON_4H     0x7F    /* Enabled */
+
+/* Code Protect Boot 4H options */
+#define _CPB_OFF_4H    0xFF    /* Disabled */
+#define _CPB_ON_4H     0xBF    /* Enabled */
+
+/* Table Write Protect 00200-01FFF 5L options */
+#define _WRT_0_OFF_5L  0xFF    /* Disabled */
+#define _WRT_0_ON_5L   0xFE    /* Enabled */
+
+/* Table Write Protect 02000-03FFF 5L options */
+#define _WRT_1_OFF_5L  0xFF    /* Disabled */
+#define _WRT_1_ON_5L   0xFD    /* Enabled */
+
+/* Data EE Write Protect 5H options */
+#define _WRTD_OFF_5H   0xFF    /* Disabled */
+#define _WRTD_ON_5H    0x7F    /* Enabled */
+
+/* Table Write Protect Boot 5H options */
+#define _WRTB_OFF_5H   0xFF    /* Disabled */
+#define _WRTB_ON_5H    0xBF    /* Enabled */
+
+/* Config. Write Protect 5H options */
+#define _WRTC_OFF_5H   0xFF    /* Disabled */
+#define _WRTC_ON_5H    0xDF    /* Enabled */
+
+/* Table Read Protect 00200-01FFF 6L options */
+#define _EBTR_0_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_0_ON_6L  0xFE    /* Enabled */
+
+/* Table Read Protect 02000-03FFF 6L options */
+#define _EBTR_1_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_1_ON_6L  0xFD    /* Enabled */
+
+/* Table Read Protect Boot 6H options */
+#define _EBTRB_OFF_6H  0xFF    /* Disabled */
+#define _EBTRB_ON_6H   0xBF    /* Enabled */
 
+
+#endif
index 684f87156d0488de6ea1c419a1c01ef0c3ce97d9..d1815a8a91773c4f99ea4ac8461985a71433d55e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * pic18f252.h - 18F252 Device Library Header
+ * pic18f252.h - PIC18F252 Device Library Header
  *
  * This file is part of the GNU PIC Library.
  *
@@ -60,9 +60,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTAbits_t;
+} __PORTAbits_t;
 
-extern volatile PORTAbits_t at 0xf80 PORTAbits;
+extern volatile __PORTAbits_t at 0xf80 PORTAbits;
 
 extern sfr at 0xf81 PORTB;
 typedef union {
@@ -87,9 +87,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTBbits_t;
+} __PORTBbits_t;
 
-extern volatile PORTBbits_t at 0xf81 PORTBbits;
+extern volatile __PORTBbits_t at 0xf81 PORTBbits;
 
 extern sfr at 0xf82 PORTC;
 typedef union {
@@ -125,9 +125,9 @@ typedef union {
                unsigned CK:1;
                unsigned DT:1;
        };
-} PORTCbits_t;
+} __PORTCbits_t;
 
-extern volatile PORTCbits_t at 0xf82 PORTCbits;
+extern volatile __PORTCbits_t at 0xf82 PORTCbits;
 
 extern sfr at 0xf89 LATA;
 typedef union {
@@ -141,9 +141,9 @@ typedef union {
                unsigned LATA6:1;
                unsigned :1;
        };
-} LATAbits_t;
+} __LATAbits_t;
 
-extern volatile LATAbits_t at 0xf89 LATAbits;
+extern volatile __LATAbits_t at 0xf89 LATAbits;
 
 extern sfr at 0xf8a LATB;
 typedef union {
@@ -157,9 +157,9 @@ typedef union {
                unsigned LATB6:1;
                unsigned LATB7:1;
        };
-} LATBbits_t;
+} __LATBbits_t;
 
-extern volatile LATBbits_t at 0xf8a LATBbits;
+extern volatile __LATBbits_t at 0xf8a LATBbits;
 
 extern sfr at 0xf8b LATC;
 typedef union {
@@ -173,9 +173,9 @@ typedef union {
                unsigned LATC6:1;
                unsigned LATC7:1;
        };
-} LATCbits_t;
+} __LATCbits_t;
 
-extern volatile LATCbits_t at 0xf8b LATCbits;
+extern volatile __LATCbits_t at 0xf8b LATCbits;
 
 extern sfr at 0xf92 TRISA;
 typedef union {
@@ -189,9 +189,9 @@ typedef union {
                unsigned TRISA6:1;
                unsigned :1;
        };
-} TRISAbits_t;
+} __TRISAbits_t;
 
-extern volatile TRISAbits_t at 0xf92 TRISAbits;
+extern volatile __TRISAbits_t at 0xf92 TRISAbits;
 
 extern sfr at 0xf93 TRISB;
 typedef union {
@@ -205,9 +205,9 @@ typedef union {
                unsigned TRISB6:1;
                unsigned TRISB7:1;
        };
-} TRISBbits_t;
+} __TRISBbits_t;
 
-extern volatile TRISBbits_t at 0xf93 TRISBbits;
+extern volatile __TRISBbits_t at 0xf93 TRISBbits;
 
 extern sfr at 0xf94 TRISC;
 typedef union {
@@ -221,9 +221,9 @@ typedef union {
                unsigned TRISC6:1;
                unsigned TRISC7:1;
        };
-} TRISCbits_t;
+} __TRISCbits_t;
 
-extern volatile TRISCbits_t at 0xf94 TRISCbits;
+extern volatile __TRISCbits_t at 0xf94 TRISCbits;
 
 extern sfr at 0xf9d PIE1;
 typedef union {
@@ -237,9 +237,9 @@ typedef union {
                unsigned ADIE:1;
                unsigned PSPIE:1;
        };
-} PIE1bits_t;
+} __PIE1bits_t;
 
-extern volatile PIE1bits_t at 0xf9d PIE1bits;
+extern volatile __PIE1bits_t at 0xf9d PIE1bits;
 
 extern sfr at 0xf9e PIR1;
 typedef union {
@@ -253,9 +253,9 @@ typedef union {
                unsigned ADIF:1;
                unsigned PSPIF:1;
        };
-} PIR1bits_t;
+} __PIR1bits_t;
 
-extern volatile PIR1bits_t at 0xf9e PIR1bits;
+extern volatile __PIR1bits_t at 0xf9e PIR1bits;
 
 extern sfr at 0xf9f IPR1;
 typedef union {
@@ -269,9 +269,9 @@ typedef union {
                unsigned ADIP:1;
                unsigned PSPIP:1;
        };
-} IPR1bits_t;
+} __IPR1bits_t;
 
-extern volatile IPR1bits_t at 0xf9f IPR1bits;
+extern volatile __IPR1bits_t at 0xf9f IPR1bits;
 
 extern sfr at 0xfa0 PIE2;
 typedef union {
@@ -285,9 +285,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PIE2bits_t;
+} __PIE2bits_t;
 
-extern volatile PIE2bits_t at 0xfa0 PIE2bits;
+extern volatile __PIE2bits_t at 0xfa0 PIE2bits;
 
 extern sfr at 0xfa1 PIR2;
 typedef union {
@@ -301,9 +301,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PIR2bits_t;
+} __PIR2bits_t;
 
-extern volatile PIR2bits_t at 0xfa1 PIR2bits;
+extern volatile __PIR2bits_t at 0xfa1 PIR2bits;
 
 extern sfr at 0xfa2 IPR2;
 typedef union {
@@ -317,9 +317,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} IPR2bits_t;
+} __IPR2bits_t;
 
-extern volatile IPR2bits_t at 0xfa2 IPR2bits;
+extern volatile __IPR2bits_t at 0xfa2 IPR2bits;
 
 extern sfr at 0xfa6 EECON1;
 typedef union {
@@ -333,9 +333,9 @@ typedef union {
                unsigned CFGS:1;
                unsigned EEPGD:1;
        };
-} EECON1bits_t;
+} __EECON1bits_t;
 
-extern volatile EECON1bits_t at 0xfa6 EECON1bits;
+extern volatile __EECON1bits_t at 0xfa6 EECON1bits;
 
 extern sfr at 0xfa7 EECON2;
 extern sfr at 0xfa8 EEDATA;
@@ -352,9 +352,9 @@ typedef union {
                unsigned RX9:1;
                unsigned SPEN:1;
        };
-} RCSTAbits_t;
+} __RCSTAbits_t;
 
-extern volatile RCSTAbits_t at 0xfab RCSTAbits;
+extern volatile __RCSTAbits_t at 0xfab RCSTAbits;
 
 extern sfr at 0xfac TXSTA;
 typedef union {
@@ -368,9 +368,9 @@ typedef union {
                unsigned TX9:1;
                unsigned CSRC:1;
        };
-} TXSTAbits_t;
+} __TXSTAbits_t;
 
-extern volatile TXSTAbits_t at 0xfac TXSTAbits;
+extern volatile __TXSTAbits_t at 0xfac TXSTAbits;
 
 extern sfr at 0xfad TXREG;
 extern sfr at 0xfae RCREG;
@@ -387,9 +387,9 @@ typedef union {
                unsigned T3CCP2:1;
                unsigned RD16:1;
        };
-} T3CONbits_t;
+} __T3CONbits_t;
 
-extern volatile T3CONbits_t at 0xfb1 T3CONbits;
+extern volatile __T3CONbits_t at 0xfb1 T3CONbits;
 
 extern sfr at 0xfb2 TMR3L;
 extern sfr at 0xfb3 TMR3H;
@@ -405,9 +405,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CCP2CONbits_t;
+} __CCP2CONbits_t;
 
-extern volatile CCP2CONbits_t at 0xfba CCP2CONbits;
+extern volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
 
 extern sfr at 0xfbb CCPR2L;
 extern sfr at 0xfbc CCPR2H;
@@ -423,9 +423,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CCP1CONbits_t;
+} __CCP1CONbits_t;
 
-extern volatile CCP1CONbits_t at 0xfbd CCP1CONbits;
+extern volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
 
 extern sfr at 0xfbe CCPR1L;
 extern sfr at 0xfbf CCPR1H;
@@ -441,9 +441,9 @@ typedef union {
                unsigned ADCS2:1;
                unsigned ADFM:1;
        };
-} ADCON1bits_t;
+} __ADCON1bits_t;
 
-extern volatile ADCON1bits_t at 0xfc1 ADCON1bits;
+extern volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
 
 extern sfr at 0xfc2 ADCON0;
 typedef union {
@@ -457,9 +457,9 @@ typedef union {
                unsigned ADCS0:1;
                unsigned ADCS1:1;
        };
-} ADCON0bits_t;
+} __ADCON0bits_t;
 
-extern volatile ADCON0bits_t at 0xfc2 ADCON0bits;
+extern volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
 
 extern sfr at 0xfc3 ADRESL;
 extern sfr at 0xfc4 ADRESH;
@@ -475,9 +475,9 @@ typedef union {
                unsigned ACKSTAT:1;
                unsigned GCEN:1;
        };
-} SSPCON2bits_t;
+} __SSPCON2bits_t;
 
-extern volatile SSPCON2bits_t at 0xfc5 SSPCON2bits;
+extern volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
 
 extern sfr at 0xfc6 SSPCON1;
 typedef union {
@@ -491,9 +491,9 @@ typedef union {
                unsigned SSPOV:1;
                unsigned WCOL:1;
        };
-} SSPCON1bits_t;
+} __SSPCON1bits_t;
 
-extern volatile SSPCON1bits_t at 0xfc6 SSPCON1bits;
+extern volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
 
 extern sfr at 0xfc7 SSPSTAT;
 typedef union {
@@ -507,9 +507,9 @@ typedef union {
                unsigned CKE:1;
                unsigned SMP:1;
        };
-} SSPSTATbits_t;
+} __SSPSTATbits_t;
 
-extern volatile SSPSTATbits_t at 0xfc7 SSPSTATbits;
+extern volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
 
 extern sfr at 0xfc8 SSPADD;
 extern sfr at 0xfc9 SSPBUF;
@@ -525,9 +525,9 @@ typedef union {
                unsigned TOUTPS3:1;
                unsigned :1;
        };
-} T2CONbits_t;
+} __T2CONbits_t;
 
-extern volatile T2CONbits_t at 0xfca T2CONbits;
+extern volatile __T2CONbits_t at 0xfca T2CONbits;
 
 extern sfr at 0xfcb PR2;
 extern sfr at 0xfcc TMR2;
@@ -543,9 +543,9 @@ typedef union {
                unsigned :1;
                unsigned RD16:1;
        };
-} T1CONbits_t;
+} __T1CONbits_t;
 
-extern volatile T1CONbits_t at 0xfcd T1CONbits;
+extern volatile __T1CONbits_t at 0xfcd T1CONbits;
 
 extern sfr at 0xfce TMR1L;
 extern sfr at 0xfcf TMR1H;
@@ -561,9 +561,9 @@ typedef union {
                unsigned :1;
                unsigned IPEN:1;
        };
-} RCONbits_t;
+} __RCONbits_t;
 
-extern volatile RCONbits_t at 0xfd0 RCONbits;
+extern volatile __RCONbits_t at 0xfd0 RCONbits;
 
 extern sfr at 0xfd1 WDTCON;
 typedef union {
@@ -588,9 +588,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} WDTCONbits_t;
+} __WDTCONbits_t;
 
-extern volatile WDTCONbits_t at 0xfd1 WDTCONbits;
+extern volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
 
 extern sfr at 0xfd2 LVDCON;
 typedef union {
@@ -615,9 +615,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} LVDCONbits_t;
+} __LVDCONbits_t;
 
-extern volatile LVDCONbits_t at 0xfd2 LVDCONbits;
+extern volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
 
 extern sfr at 0xfd3 OSCCON;
 typedef union {
@@ -631,9 +631,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} OSCCONbits_t;
+} __OSCCONbits_t;
 
-extern volatile OSCCONbits_t at 0xfd3 OSCCONbits;
+extern volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
 
 extern sfr at 0xfd5 T0CON;
 extern sfr at 0xfd6 TMR0L;
@@ -650,9 +650,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} STATUSbits_t;
+} __STATUSbits_t;
 
-extern volatile STATUSbits_t at 0xfd8 STATUSbits;
+extern volatile __STATUSbits_t at 0xfd8 STATUSbits;
 
 extern sfr at 0xfd9 FSR2L;
 extern sfr at 0xfda FSR2H;
@@ -700,9 +700,9 @@ typedef union {
                unsigned INT1IP:1;
                unsigned INT2IP:1;
        };
-} INTCON3bits_t;
+} __INTCON3bits_t;
 
-extern volatile INTCON3bits_t at 0xff0 INTCON3bits;
+extern volatile __INTCON3bits_t at 0xff0 INTCON3bits;
 
 extern sfr at 0xff1 INTCON2;
 typedef union {
@@ -716,9 +716,9 @@ typedef union {
                unsigned INTEDG0:1;
                unsigned RBPU:1;
        };
-} INTCON2bits_t;
+} __INTCON2bits_t;
 
-extern volatile INTCON2bits_t at 0xff1 INTCON2bits;
+extern volatile __INTCON2bits_t at 0xff1 INTCON2bits;
 
 extern sfr at 0xff2 INTCON;
 typedef union {
@@ -732,9 +732,9 @@ typedef union {
                unsigned PEIE:1;
                unsigned GIE:1;
        };
-} INTCONbits_t;
+} __INTCONbits_t;
 
-extern volatile INTCONbits_t at 0xff2 INTCONbits;
+extern volatile __INTCONbits_t at 0xff2 INTCONbits;
 
 extern sfr at 0xff3 PRODL;
 extern sfr at 0xff4 PRODH;
@@ -757,14 +757,159 @@ typedef union {
                unsigned STKUNF:1;
                unsigned STKFUL:1;
        };
-} STKPTRbits_t;
+} __STKPTRbits_t;
 
-extern volatile STKPTRbits_t at 0xffc STKPTRbits;
+extern volatile __STKPTRbits_t at 0xffc STKPTRbits;
 
 extern sfr at 0xffd TOSL;
 extern sfr at 0xffe TOSH;
 extern sfr at 0xfff TOSU;
 
 
-#endif
+/* Configuration registers locations */
+#define __CONFIG0H     0x300001
+#define __CONFIG1L     0x300002
+#define __CONFIG1H     0x300003
+#define __CONFIG2H     0x300005
+#define __CONFIG3L     0x300006
+#define __CONFIG4L     0x300008
+#define __CONFIG4H     0x300009
+#define __CONFIG5L     0x30000A
+#define __CONFIG5H     0x30000B
+#define __CONFIG6L     0x30000C
+#define __CONFIG6H     0x30000D
+
+
+
+/* Oscillator 0H options */
+#define _OSC_RC_OSC2_0H        0xFF    /* RC-OSC2 as RA6 */
+#define _OSC_HS_PLL_0H 0xFE    /* HS-PLL Enabled */
+#define _OSC_EC_OSC2_RA6_0H    0xFD    /* EC-OSC2 as RA6 */
+#define _OSC_EC_OSC2_Clock_Out_0H      0xFC    /* EC-OSC2 as Clock_Out */
+#define _OSC_RC_0H     0xFB    /* RC */
+#define _OSC_HS_0H     0xFA    /* HS */
+#define _OSC_XT_0H     0xF9    /* XT */
+#define _OSC_LP_0H     0xF8    /* LP */
+
+/* Osc. Switch Enable 0H options */
+#define _OSCS_OFF_0H   0xFF    /* Disabled */
+#define _OSCS_ON_0H    0xDF    /* Enabled */
+
+/* Power Up Timer 1L options */
+#define _PUT_OFF_1L    0xFF    /* Disabled */
+#define _PUT_ON_1L     0xFE    /* Enabled */
+
+/* Brown Out Detect 1L options */
+#define _BODEN_ON_1L   0xFF    /* Enabled */
+#define _BODEN_OFF_1L  0xFD    /* Disabled */
+
+/* Brown Out Voltage 1L options */
+#define _BODENV_2_0V_1L        0xFF    /* 2.0V */
+#define _BODENV_2_7V_1L        0xFB    /* 2.7V */
+#define _BODENV_4_2V_1L        0xF7    /* 4.2V */
+#define _BODENV_4_5V_1L        0xF3    /* 4.5V */
+
+/* Watchdog Timer 1H options */
+#define _WDT_ON_1H     0xFF    /* Enabled */
+#define _WDT_OFF_1H    0xFE    /* Disabled */
+
+/* Watchdog Postscaler 1H options */
+#define _WDTPS_1_128_1H        0xFF    /* 1:128 */
+#define _WDTPS_1_64_1H 0xFD    /* 1:64 */
+#define _WDTPS_1_32_1H 0xFB    /* 1:32 */
+#define _WDTPS_1_16_1H 0xF9    /* 1:16 */
+#define _WDTPS_1_8_1H  0xF7    /* 1:8 */
+#define _WDTPS_1_4_1H  0xF5    /* 1:4 */
+#define _WDTPS_1_2_1H  0xF3    /* 1:2 */
+#define _WDTPS_1_1_1H  0xF1    /* 1:1 */
+
+/* CCP2 Mux 2H options */
+#define _CCP2MUX_RC1_2H        0xFF    /* RC1 */
+#define _CCP2MUX_RB3_2H        0xFE    /* RB3 */
+
+/* Low Voltage Program 3L options */
+#define _LVP_ON_3L     0xFF    /* Enabled */
+#define _LVP_OFF_3L    0xFB    /* Disabled */
+
+/* Background Debug 3L options */
+#define _BACKBUG_OFF_3L        0xFF    /* Disabled */
+#define _BACKBUG_ON_3L 0x7F    /* Enabled */
+
+/* Stack Overflow Reset 3L options */
+#define _STVR_ON_3L    0xFF    /* Enabled */
+#define _STVR_OFF_3L   0xFE    /* Disabled */
+
+/* Code Protect 00200-01FFF 4L options */
+#define _CP_0_OFF_4L   0xFF    /* Disabled */
+#define _CP_0_ON_4L    0xFE    /* Enabled */
+
+/* Code Protect 02000-03FFF 4L options */
+#define _CP_1_OFF_4L   0xFF    /* Disabled */
+#define _CP_1_ON_4L    0xFD    /* Enabled */
+
+/* Code Protect 04000-05FFF 4L options */
+#define _CP_2_OFF_4L   0xFF    /* Disabled */
+#define _CP_2_ON_4L    0xFB    /* Enabled */
+
+/* Code Protect 06000-07FFF 4L options */
+#define _CP_3_OFF_4L   0xFF    /* Disabled */
+#define _CP_3_ON_4L    0xF7    /* Enabled */
+
+/* Data EE Read Protect 4H options */
+#define _CPD_OFF_4H    0xFF    /* Disabled */
+#define _CPD_ON_4H     0x7F    /* Enabled */
+
+/* Code Protect Boot 4H options */
+#define _CPB_OFF_4H    0xFF    /* Disabled */
+#define _CPB_ON_4H     0xBF    /* Enabled */
+
+/* Table Write Protect 00200-01FFF 5L options */
+#define _WRT_0_OFF_5L  0xFF    /* Disabled */
+#define _WRT_0_ON_5L   0xFE    /* Enabled */
+
+/* Table Write Protect 02000-03FFF 5L options */
+#define _WRT_1_OFF_5L  0xFF    /* Disabled */
+#define _WRT_1_ON_5L   0xFD    /* Enabled */
+
+/* Table Write Protect 04000-05FFF 5L options */
+#define _WRT_2_OFF_5L  0xFF    /* Disabled */
+#define _WRT_2_ON_5L   0xFB    /* Enabled */
+
+/* Table Write Protect 06000-07FFF 5L options */
+#define _WRT_3_OFF_5L  0xFF    /* Disabled */
+#define _WRT_3_ON_5L   0xF7    /* Enabled */
+
+/* Data EE Write Protect 5H options */
+#define _WRTD_OFF_5H   0xFF    /* Disabled */
+#define _WRTD_ON_5H    0x7F    /* Enabled */
+
+/* Table Write Protect Boot 5H options */
+#define _WRTB_OFF_5H   0xFF    /* Disabled */
+#define _WRTB_ON_5H    0xBF    /* Enabled */
+
+/* Config. Write Protect 5H options */
+#define _WRTC_OFF_5H   0xFF    /* Disabled */
+#define _WRTC_ON_5H    0xDF    /* Enabled */
+
+/* Table Read Protect 00200-01FFF 6L options */
+#define _EBTR_0_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_0_ON_6L  0xFE    /* Enabled */
+
+/* Table Read Protect 02000-03FFF 6L options */
+#define _EBTR_1_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_1_ON_6L  0xFD    /* Enabled */
+
+/* Table Read Protect 04000-05FFF 6L options */
+#define _EBTR_2_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_2_ON_6L  0xFB    /* Enabled */
 
+/* Table Read Protect 06000-07FFF 6L options */
+#define _EBTR_3_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_3_ON_6L  0xF7    /* Enabled */
+
+/* Table Read Protect Boot 6H options */
+#define _EBTRB_OFF_6H  0xFF    /* Disabled */
+#define _EBTRB_ON_6H   0xBF    /* Enabled */
+
+
+#endif
index 1279cf54e2139397b65369b8e79d9490526d6f82..7865def727d5bcc1891cdfa589f6d73d056c29a4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * pic18f258.h - 18F258 Device Library Header
+ * pic18f258.h - PIC18F258 Device Library Header
  *
  * This file is part of the GNU PIC Library.
  *
@@ -27,9 +27,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF0SIDHbits_t;
+} __RXF0SIDHbits_t;
 
-extern volatile RXF0SIDHbits_t at 0xf00 RXF0SIDHbits;
+extern volatile __RXF0SIDHbits_t at 0xf00 RXF0SIDHbits;
 
 extern sfr at 0xf01 RXF0SIDL;
 typedef union {
@@ -43,9 +43,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF0SIDLbits_t;
+} __RXF0SIDLbits_t;
 
-extern volatile RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
+extern volatile __RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
 
 extern sfr at 0xf02 RXF0EIDH;
 typedef union {
@@ -59,9 +59,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF0EIDHbits_t;
+} __RXF0EIDHbits_t;
 
-extern volatile RXF0EIDHbits_t at 0xf02 RXF0EIDHbits;
+extern volatile __RXF0EIDHbits_t at 0xf02 RXF0EIDHbits;
 
 extern sfr at 0xf03 RXF0EIDL;
 typedef union {
@@ -75,9 +75,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF0EIDLbits_t;
+} __RXF0EIDLbits_t;
 
-extern volatile RXF0EIDLbits_t at 0xf03 RXF0EIDLbits;
+extern volatile __RXF0EIDLbits_t at 0xf03 RXF0EIDLbits;
 
 extern sfr at 0xf04 RXF1SIDH;
 typedef union {
@@ -91,9 +91,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF1SIDHbits_t;
+} __RXF1SIDHbits_t;
 
-extern volatile RXF1SIDHbits_t at 0xf04 RXF1SIDHbits;
+extern volatile __RXF1SIDHbits_t at 0xf04 RXF1SIDHbits;
 
 extern sfr at 0xf05 RXF1SIDL;
 typedef union {
@@ -107,9 +107,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF1SIDLbits_t;
+} __RXF1SIDLbits_t;
 
-extern volatile RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
+extern volatile __RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
 
 extern sfr at 0xf06 RXF1EIDH;
 typedef union {
@@ -123,9 +123,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF1EIDHbits_t;
+} __RXF1EIDHbits_t;
 
-extern volatile RXF1EIDHbits_t at 0xf06 RXF1EIDHbits;
+extern volatile __RXF1EIDHbits_t at 0xf06 RXF1EIDHbits;
 
 extern sfr at 0xf07 RXF1EIDL;
 typedef union {
@@ -139,9 +139,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF1EIDLbits_t;
+} __RXF1EIDLbits_t;
 
-extern volatile RXF1EIDLbits_t at 0xf07 RXF1EIDLbits;
+extern volatile __RXF1EIDLbits_t at 0xf07 RXF1EIDLbits;
 
 extern sfr at 0xf08 RXF2SIDH;
 typedef union {
@@ -155,9 +155,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF2SIDHbits_t;
+} __RXF2SIDHbits_t;
 
-extern volatile RXF2SIDHbits_t at 0xf08 RXF2SIDHbits;
+extern volatile __RXF2SIDHbits_t at 0xf08 RXF2SIDHbits;
 
 extern sfr at 0xf09 RXF2SIDL;
 typedef union {
@@ -171,9 +171,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF2SIDLbits_t;
+} __RXF2SIDLbits_t;
 
-extern volatile RXF2SIDLbits_t at 0xf09 RXF2SIDLbits;
+extern volatile __RXF2SIDLbits_t at 0xf09 RXF2SIDLbits;
 
 extern sfr at 0xf0a RXF2EIDH;
 typedef union {
@@ -187,9 +187,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF2EIDHbits_t;
+} __RXF2EIDHbits_t;
 
-extern volatile RXF2EIDHbits_t at 0xf0a RXF2EIDHbits;
+extern volatile __RXF2EIDHbits_t at 0xf0a RXF2EIDHbits;
 
 extern sfr at 0xf0b RXF2EIDL;
 typedef union {
@@ -203,9 +203,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF2EIDLbits_t;
+} __RXF2EIDLbits_t;
 
-extern volatile RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
+extern volatile __RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
 
 extern sfr at 0xf0c RXF3SIDH;
 typedef union {
@@ -219,9 +219,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF3SIDHbits_t;
+} __RXF3SIDHbits_t;
 
-extern volatile RXF3SIDHbits_t at 0xf0c RXF3SIDHbits;
+extern volatile __RXF3SIDHbits_t at 0xf0c RXF3SIDHbits;
 
 extern sfr at 0xf0d RXF3SIDL;
 typedef union {
@@ -235,9 +235,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF3SIDLbits_t;
+} __RXF3SIDLbits_t;
 
-extern volatile RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
+extern volatile __RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
 
 extern sfr at 0xf0e RXF3EIDH;
 typedef union {
@@ -251,9 +251,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF3EIDHbits_t;
+} __RXF3EIDHbits_t;
 
-extern volatile RXF3EIDHbits_t at 0xf0e RXF3EIDHbits;
+extern volatile __RXF3EIDHbits_t at 0xf0e RXF3EIDHbits;
 
 extern sfr at 0xf0f RXF3EIDL;
 typedef union {
@@ -267,9 +267,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF3EIDLbits_t;
+} __RXF3EIDLbits_t;
 
-extern volatile RXF3EIDLbits_t at 0xf0f RXF3EIDLbits;
+extern volatile __RXF3EIDLbits_t at 0xf0f RXF3EIDLbits;
 
 extern sfr at 0xf10 RXF4SIDH;
 typedef union {
@@ -283,9 +283,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF4SIDHbits_t;
+} __RXF4SIDHbits_t;
 
-extern volatile RXF4SIDHbits_t at 0xf10 RXF4SIDHbits;
+extern volatile __RXF4SIDHbits_t at 0xf10 RXF4SIDHbits;
 
 extern sfr at 0xf11 RXF4SIDL;
 typedef union {
@@ -299,9 +299,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF4SIDLbits_t;
+} __RXF4SIDLbits_t;
 
-extern volatile RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
+extern volatile __RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
 
 extern sfr at 0xf12 RXF4EIDH;
 typedef union {
@@ -315,9 +315,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF4EIDHbits_t;
+} __RXF4EIDHbits_t;
 
-extern volatile RXF4EIDHbits_t at 0xf12 RXF4EIDHbits;
+extern volatile __RXF4EIDHbits_t at 0xf12 RXF4EIDHbits;
 
 extern sfr at 0xf13 RXF4EIDL;
 typedef union {
@@ -331,9 +331,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF4EIDLbits_t;
+} __RXF4EIDLbits_t;
 
-extern volatile RXF4EIDLbits_t at 0xf13 RXF4EIDLbits;
+extern volatile __RXF4EIDLbits_t at 0xf13 RXF4EIDLbits;
 
 extern sfr at 0xf14 RXF5SIDH;
 typedef union {
@@ -347,9 +347,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF5SIDHbits_t;
+} __RXF5SIDHbits_t;
 
-extern volatile RXF5SIDHbits_t at 0xf14 RXF5SIDHbits;
+extern volatile __RXF5SIDHbits_t at 0xf14 RXF5SIDHbits;
 
 extern sfr at 0xf15 RXF5SIDL;
 typedef union {
@@ -363,9 +363,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF5SIDLbits_t;
+} __RXF5SIDLbits_t;
 
-extern volatile RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
+extern volatile __RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
 
 extern sfr at 0xf16 RXF5EIDH;
 typedef union {
@@ -379,9 +379,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF5EIDHbits_t;
+} __RXF5EIDHbits_t;
 
-extern volatile RXF5EIDHbits_t at 0xf16 RXF5EIDHbits;
+extern volatile __RXF5EIDHbits_t at 0xf16 RXF5EIDHbits;
 
 extern sfr at 0xf17 RXF5EIDL;
 typedef union {
@@ -395,9 +395,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF5EIDLbits_t;
+} __RXF5EIDLbits_t;
 
-extern volatile RXF5EIDLbits_t at 0xf17 RXF5EIDLbits;
+extern volatile __RXF5EIDLbits_t at 0xf17 RXF5EIDLbits;
 
 extern sfr at 0xf18 RXM0SIDH;
 typedef union {
@@ -411,9 +411,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXM0SIDHbits_t;
+} __RXM0SIDHbits_t;
 
-extern volatile RXM0SIDHbits_t at 0xf18 RXM0SIDHbits;
+extern volatile __RXM0SIDHbits_t at 0xf18 RXM0SIDHbits;
 
 extern sfr at 0xf19 RXM0SIDL;
 typedef union {
@@ -427,9 +427,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXM0SIDLbits_t;
+} __RXM0SIDLbits_t;
 
-extern volatile RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
+extern volatile __RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
 
 extern sfr at 0xf1a RXM0EIDH;
 typedef union {
@@ -443,9 +443,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXM0EIDHbits_t;
+} __RXM0EIDHbits_t;
 
-extern volatile RXM0EIDHbits_t at 0xf1a RXM0EIDHbits;
+extern volatile __RXM0EIDHbits_t at 0xf1a RXM0EIDHbits;
 
 extern sfr at 0xf1b RXM0EIDL;
 typedef union {
@@ -459,9 +459,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXM0EIDLbits_t;
+} __RXM0EIDLbits_t;
 
-extern volatile RXM0EIDLbits_t at 0xf1b RXM0EIDLbits;
+extern volatile __RXM0EIDLbits_t at 0xf1b RXM0EIDLbits;
 
 extern sfr at 0xf1c RXM1SIDH;
 typedef union {
@@ -475,9 +475,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXM1SIDHbits_t;
+} __RXM1SIDHbits_t;
 
-extern volatile RXM1SIDHbits_t at 0xf1c RXM1SIDHbits;
+extern volatile __RXM1SIDHbits_t at 0xf1c RXM1SIDHbits;
 
 extern sfr at 0xf1d RXM1SIDL;
 typedef union {
@@ -491,9 +491,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXM1SIDLbits_t;
+} __RXM1SIDLbits_t;
 
-extern volatile RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
+extern volatile __RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
 
 extern sfr at 0xf1e RXM1EIDH;
 typedef union {
@@ -507,9 +507,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXM1EIDHbits_t;
+} __RXM1EIDHbits_t;
 
-extern volatile RXM1EIDHbits_t at 0xf1e RXM1EIDHbits;
+extern volatile __RXM1EIDHbits_t at 0xf1e RXM1EIDHbits;
 
 extern sfr at 0xf1f RXM1EIDL;
 typedef union {
@@ -523,9 +523,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXM1EIDLbits_t;
+} __RXM1EIDLbits_t;
 
-extern volatile RXM1EIDLbits_t at 0xf1f RXM1EIDLbits;
+extern volatile __RXM1EIDLbits_t at 0xf1f RXM1EIDLbits;
 
 extern sfr at 0xf20 TXB2CON;
 typedef union {
@@ -539,9 +539,9 @@ typedef union {
                unsigned TXABT:1;
                unsigned :1;
        };
-} TXB2CONbits_t;
+} __TXB2CONbits_t;
 
-extern volatile TXB2CONbits_t at 0xf20 TXB2CONbits;
+extern volatile __TXB2CONbits_t at 0xf20 TXB2CONbits;
 
 extern sfr at 0xf21 TXB2SIDH;
 typedef union {
@@ -555,9 +555,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} TXB2SIDHbits_t;
+} __TXB2SIDHbits_t;
 
-extern volatile TXB2SIDHbits_t at 0xf21 TXB2SIDHbits;
+extern volatile __TXB2SIDHbits_t at 0xf21 TXB2SIDHbits;
 
 extern sfr at 0xf22 TXB2SIDL;
 typedef union {
@@ -571,9 +571,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} TXB2SIDLbits_t;
+} __TXB2SIDLbits_t;
 
-extern volatile TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
+extern volatile __TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
 
 extern sfr at 0xf23 TXB2EIDH;
 typedef union {
@@ -587,9 +587,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} TXB2EIDHbits_t;
+} __TXB2EIDHbits_t;
 
-extern volatile TXB2EIDHbits_t at 0xf23 TXB2EIDHbits;
+extern volatile __TXB2EIDHbits_t at 0xf23 TXB2EIDHbits;
 
 extern sfr at 0xf24 TXB2EIDL;
 typedef union {
@@ -603,9 +603,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} TXB2EIDLbits_t;
+} __TXB2EIDLbits_t;
 
-extern volatile TXB2EIDLbits_t at 0xf24 TXB2EIDLbits;
+extern volatile __TXB2EIDLbits_t at 0xf24 TXB2EIDLbits;
 
 extern sfr at 0xf25 TXB2DLC;
 typedef union {
@@ -619,9 +619,9 @@ typedef union {
                unsigned TXB2TXRTR:1;
                unsigned :1;
        };
-} TXB2DLCbits_t;
+} __TXB2DLCbits_t;
 
-extern volatile TXB2DLCbits_t at 0xf25 TXB2DLCbits;
+extern volatile __TXB2DLCbits_t at 0xf25 TXB2DLCbits;
 
 extern sfr at 0xf26 TXB2D0;
 typedef union {
@@ -635,9 +635,9 @@ typedef union {
                unsigned TXB2D06:1;
                unsigned TXB2D07:1;
        };
-} TXB2D0bits_t;
+} __TXB2D0bits_t;
 
-extern volatile TXB2D0bits_t at 0xf26 TXB2D0bits;
+extern volatile __TXB2D0bits_t at 0xf26 TXB2D0bits;
 
 extern sfr at 0xf27 TXB2D1;
 typedef union {
@@ -651,9 +651,9 @@ typedef union {
                unsigned TXB2D16:1;
                unsigned TXB2D17:1;
        };
-} TXB2D1bits_t;
+} __TXB2D1bits_t;
 
-extern volatile TXB2D1bits_t at 0xf27 TXB2D1bits;
+extern volatile __TXB2D1bits_t at 0xf27 TXB2D1bits;
 
 extern sfr at 0xf28 TXB2D2;
 typedef union {
@@ -667,9 +667,9 @@ typedef union {
                unsigned TXB2D26:1;
                unsigned TXB2D27:1;
        };
-} TXB2D2bits_t;
+} __TXB2D2bits_t;
 
-extern volatile TXB2D2bits_t at 0xf28 TXB2D2bits;
+extern volatile __TXB2D2bits_t at 0xf28 TXB2D2bits;
 
 extern sfr at 0xf29 TXB2D3;
 typedef union {
@@ -683,9 +683,9 @@ typedef union {
                unsigned TXB2D36:1;
                unsigned TXB2D37:1;
        };
-} TXB2D3bits_t;
+} __TXB2D3bits_t;
 
-extern volatile TXB2D3bits_t at 0xf29 TXB2D3bits;
+extern volatile __TXB2D3bits_t at 0xf29 TXB2D3bits;
 
 extern sfr at 0xf2a TXB2D4;
 typedef union {
@@ -699,9 +699,9 @@ typedef union {
                unsigned TXB2D46:1;
                unsigned TXB2D47:1;
        };
-} TXB2D4bits_t;
+} __TXB2D4bits_t;
 
-extern volatile TXB2D4bits_t at 0xf2a TXB2D4bits;
+extern volatile __TXB2D4bits_t at 0xf2a TXB2D4bits;
 
 extern sfr at 0xf2b TXB2D5;
 typedef union {
@@ -715,9 +715,9 @@ typedef union {
                unsigned TXB2D56:1;
                unsigned TXB2D57:1;
        };
-} TXB2D5bits_t;
+} __TXB2D5bits_t;
 
-extern volatile TXB2D5bits_t at 0xf2b TXB2D5bits;
+extern volatile __TXB2D5bits_t at 0xf2b TXB2D5bits;
 
 extern sfr at 0xf2c TXB2D6;
 typedef union {
@@ -731,9 +731,9 @@ typedef union {
                unsigned TXB2D66:1;
                unsigned TXB2D67:1;
        };
-} TXB2D6bits_t;
+} __TXB2D6bits_t;
 
-extern volatile TXB2D6bits_t at 0xf2c TXB2D6bits;
+extern volatile __TXB2D6bits_t at 0xf2c TXB2D6bits;
 
 extern sfr at 0xf2d TXB2D7;
 typedef union {
@@ -747,9 +747,9 @@ typedef union {
                unsigned TXB2D76:1;
                unsigned TXB2D77:1;
        };
-} TXB2D7bits_t;
+} __TXB2D7bits_t;
 
-extern volatile TXB2D7bits_t at 0xf2d TXB2D7bits;
+extern volatile __TXB2D7bits_t at 0xf2d TXB2D7bits;
 
 extern sfr at 0xf2e CANSTATRO4;
 typedef union {
@@ -763,9 +763,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO4bits_t;
+} __CANSTATRO4bits_t;
 
-extern volatile CANSTATRO4bits_t at 0xf2e CANSTATRO4bits;
+extern volatile __CANSTATRO4bits_t at 0xf2e CANSTATRO4bits;
 
 extern sfr at 0xf30 TXB1CON;
 typedef union {
@@ -779,9 +779,9 @@ typedef union {
                unsigned TXABT:1;
                unsigned :1;
        };
-} TXB1CONbits_t;
+} __TXB1CONbits_t;
 
-extern volatile TXB1CONbits_t at 0xf30 TXB1CONbits;
+extern volatile __TXB1CONbits_t at 0xf30 TXB1CONbits;
 
 extern sfr at 0xf31 TXB1SIDH;
 typedef union {
@@ -795,9 +795,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} TXB1SIDHbits_t;
+} __TXB1SIDHbits_t;
 
-extern volatile TXB1SIDHbits_t at 0xf31 TXB1SIDHbits;
+extern volatile __TXB1SIDHbits_t at 0xf31 TXB1SIDHbits;
 
 extern sfr at 0xf32 TXB1SIDL;
 typedef union {
@@ -811,9 +811,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} TXB1SIDLbits_t;
+} __TXB1SIDLbits_t;
 
-extern volatile TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
+extern volatile __TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
 
 extern sfr at 0xf33 TXB1EIDH;
 typedef union {
@@ -827,9 +827,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} TXB1EIDHbits_t;
+} __TXB1EIDHbits_t;
 
-extern volatile TXB1EIDHbits_t at 0xf33 TXB1EIDHbits;
+extern volatile __TXB1EIDHbits_t at 0xf33 TXB1EIDHbits;
 
 extern sfr at 0xf34 TXB1EIDL;
 typedef union {
@@ -843,9 +843,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} TXB1EIDLbits_t;
+} __TXB1EIDLbits_t;
 
-extern volatile TXB1EIDLbits_t at 0xf34 TXB1EIDLbits;
+extern volatile __TXB1EIDLbits_t at 0xf34 TXB1EIDLbits;
 
 extern sfr at 0xf35 TXB1DLC;
 typedef union {
@@ -859,9 +859,9 @@ typedef union {
                unsigned TXRTR:1;
                unsigned :1;
        };
-} TXB1DLCbits_t;
+} __TXB1DLCbits_t;
 
-extern volatile TXB1DLCbits_t at 0xf35 TXB1DLCbits;
+extern volatile __TXB1DLCbits_t at 0xf35 TXB1DLCbits;
 
 extern sfr at 0xf36 TXB1D0;
 typedef union {
@@ -875,9 +875,9 @@ typedef union {
                unsigned TXB1D06:1;
                unsigned TXB1D07:1;
        };
-} TXB1D0bits_t;
+} __TXB1D0bits_t;
 
-extern volatile TXB1D0bits_t at 0xf36 TXB1D0bits;
+extern volatile __TXB1D0bits_t at 0xf36 TXB1D0bits;
 
 extern sfr at 0xf37 TXB1D1;
 typedef union {
@@ -891,9 +891,9 @@ typedef union {
                unsigned TXB1D16:1;
                unsigned TXB1D17:1;
        };
-} TXB1D1bits_t;
+} __TXB1D1bits_t;
 
-extern volatile TXB1D1bits_t at 0xf37 TXB1D1bits;
+extern volatile __TXB1D1bits_t at 0xf37 TXB1D1bits;
 
 extern sfr at 0xf38 TXB1D2;
 typedef union {
@@ -907,9 +907,9 @@ typedef union {
                unsigned TXB1D26:1;
                unsigned TXB1D27:1;
        };
-} TXB1D2bits_t;
+} __TXB1D2bits_t;
 
-extern volatile TXB1D2bits_t at 0xf38 TXB1D2bits;
+extern volatile __TXB1D2bits_t at 0xf38 TXB1D2bits;
 
 extern sfr at 0xf39 TXB1D3;
 typedef union {
@@ -923,9 +923,9 @@ typedef union {
                unsigned TXB1D36:1;
                unsigned TXB1D37:1;
        };
-} TXB1D3bits_t;
+} __TXB1D3bits_t;
 
-extern volatile TXB1D3bits_t at 0xf39 TXB1D3bits;
+extern volatile __TXB1D3bits_t at 0xf39 TXB1D3bits;
 
 extern sfr at 0xf3a TXB1D4;
 typedef union {
@@ -939,9 +939,9 @@ typedef union {
                unsigned TXB1D46:1;
                unsigned TXB1D47:1;
        };
-} TXB1D4bits_t;
+} __TXB1D4bits_t;
 
-extern volatile TXB1D4bits_t at 0xf3a TXB1D4bits;
+extern volatile __TXB1D4bits_t at 0xf3a TXB1D4bits;
 
 extern sfr at 0xf3b TXB1D5;
 typedef union {
@@ -955,9 +955,9 @@ typedef union {
                unsigned TXB1D56:1;
                unsigned TXB1D57:1;
        };
-} TXB1D5bits_t;
+} __TXB1D5bits_t;
 
-extern volatile TXB1D5bits_t at 0xf3b TXB1D5bits;
+extern volatile __TXB1D5bits_t at 0xf3b TXB1D5bits;
 
 extern sfr at 0xf3c TXB1D6;
 typedef union {
@@ -971,9 +971,9 @@ typedef union {
                unsigned TXB1D66:1;
                unsigned TXB1D67:1;
        };
-} TXB1D6bits_t;
+} __TXB1D6bits_t;
 
-extern volatile TXB1D6bits_t at 0xf3c TXB1D6bits;
+extern volatile __TXB1D6bits_t at 0xf3c TXB1D6bits;
 
 extern sfr at 0xf3d TXB1D7;
 typedef union {
@@ -987,9 +987,9 @@ typedef union {
                unsigned TXB1D76:1;
                unsigned TXB1D77:1;
        };
-} TXB1D7bits_t;
+} __TXB1D7bits_t;
 
-extern volatile TXB1D7bits_t at 0xf3d TXB1D7bits;
+extern volatile __TXB1D7bits_t at 0xf3d TXB1D7bits;
 
 extern sfr at 0xf3e CANSTATRO3;
 typedef union {
@@ -1003,9 +1003,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO3bits_t;
+} __CANSTATRO3bits_t;
 
-extern volatile CANSTATRO3bits_t at 0xf3e CANSTATRO3bits;
+extern volatile __CANSTATRO3bits_t at 0xf3e CANSTATRO3bits;
 
 extern sfr at 0xf40 TXB0CON;
 typedef union {
@@ -1019,9 +1019,9 @@ typedef union {
                unsigned TXABT:1;
                unsigned :1;
        };
-} TXB0CONbits_t;
+} __TXB0CONbits_t;
 
-extern volatile TXB0CONbits_t at 0xf40 TXB0CONbits;
+extern volatile __TXB0CONbits_t at 0xf40 TXB0CONbits;
 
 extern sfr at 0xf41 TXB0SIDH;
 typedef union {
@@ -1035,9 +1035,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} TXB0SIDHbits_t;
+} __TXB0SIDHbits_t;
 
-extern volatile TXB0SIDHbits_t at 0xf41 TXB0SIDHbits;
+extern volatile __TXB0SIDHbits_t at 0xf41 TXB0SIDHbits;
 
 extern sfr at 0xf42 TXB0SIDL;
 typedef union {
@@ -1051,9 +1051,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} TXB0SIDLbits_t;
+} __TXB0SIDLbits_t;
 
-extern volatile TXB0SIDLbits_t at 0xf42 TXB0SIDLbits;
+extern volatile __TXB0SIDLbits_t at 0xf42 TXB0SIDLbits;
 
 extern sfr at 0xf43 TXB0EIDH;
 typedef union {
@@ -1067,9 +1067,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} TXB0EIDHbits_t;
+} __TXB0EIDHbits_t;
 
-extern volatile TXB0EIDHbits_t at 0xf43 TXB0EIDHbits;
+extern volatile __TXB0EIDHbits_t at 0xf43 TXB0EIDHbits;
 
 extern sfr at 0xf44 TXB0EIDL;
 typedef union {
@@ -1083,9 +1083,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} TXB0EIDLbits_t;
+} __TXB0EIDLbits_t;
 
-extern volatile TXB0EIDLbits_t at 0xf44 TXB0EIDLbits;
+extern volatile __TXB0EIDLbits_t at 0xf44 TXB0EIDLbits;
 
 extern sfr at 0xf45 TXB0DLC;
 typedef union {
@@ -1099,9 +1099,9 @@ typedef union {
                unsigned TXRTR:1;
                unsigned :1;
        };
-} TXB0DLCbits_t;
+} __TXB0DLCbits_t;
 
-extern volatile TXB0DLCbits_t at 0xf45 TXB0DLCbits;
+extern volatile __TXB0DLCbits_t at 0xf45 TXB0DLCbits;
 
 extern sfr at 0xf46 TXB0D0;
 typedef union {
@@ -1115,9 +1115,9 @@ typedef union {
                unsigned TXB0D06:1;
                unsigned TXB0D07:1;
        };
-} TXB0D0bits_t;
+} __TXB0D0bits_t;
 
-extern volatile TXB0D0bits_t at 0xf46 TXB0D0bits;
+extern volatile __TXB0D0bits_t at 0xf46 TXB0D0bits;
 
 extern sfr at 0xf47 TXB0D1;
 typedef union {
@@ -1131,9 +1131,9 @@ typedef union {
                unsigned TXB0D16:1;
                unsigned TXB0D17:1;
        };
-} TXB0D1bits_t;
+} __TXB0D1bits_t;
 
-extern volatile TXB0D1bits_t at 0xf47 TXB0D1bits;
+extern volatile __TXB0D1bits_t at 0xf47 TXB0D1bits;
 
 extern sfr at 0xf48 TXB0D2;
 typedef union {
@@ -1147,9 +1147,9 @@ typedef union {
                unsigned TXB0D26:1;
                unsigned TXB0D27:1;
        };
-} TXB0D2bits_t;
+} __TXB0D2bits_t;
 
-extern volatile TXB0D2bits_t at 0xf48 TXB0D2bits;
+extern volatile __TXB0D2bits_t at 0xf48 TXB0D2bits;
 
 extern sfr at 0xf49 TXB0D3;
 typedef union {
@@ -1163,9 +1163,9 @@ typedef union {
                unsigned TXBD0D36:1;
                unsigned TXB0D37:1;
        };
-} TXB0D3bits_t;
+} __TXB0D3bits_t;
 
-extern volatile TXB0D3bits_t at 0xf49 TXB0D3bits;
+extern volatile __TXB0D3bits_t at 0xf49 TXB0D3bits;
 
 extern sfr at 0xf4a TXB0D4;
 typedef union {
@@ -1179,9 +1179,9 @@ typedef union {
                unsigned TXB0D46:1;
                unsigned TXB0D47:1;
        };
-} TXB0D4bits_t;
+} __TXB0D4bits_t;
 
-extern volatile TXB0D4bits_t at 0xf4a TXB0D4bits;
+extern volatile __TXB0D4bits_t at 0xf4a TXB0D4bits;
 
 extern sfr at 0xf4b TXB0D5;
 typedef union {
@@ -1195,9 +1195,9 @@ typedef union {
                unsigned TXB0D56:1;
                unsigned TXB0D57:1;
        };
-} TXB0D5bits_t;
+} __TXB0D5bits_t;
 
-extern volatile TXB0D5bits_t at 0xf4b TXB0D5bits;
+extern volatile __TXB0D5bits_t at 0xf4b TXB0D5bits;
 
 extern sfr at 0xf4c TXB0D6;
 typedef union {
@@ -1211,9 +1211,9 @@ typedef union {
                unsigned TXB0D66:1;
                unsigned TXB0D67:1;
        };
-} TXB0D6bits_t;
+} __TXB0D6bits_t;
 
-extern volatile TXB0D6bits_t at 0xf4c TXB0D6bits;
+extern volatile __TXB0D6bits_t at 0xf4c TXB0D6bits;
 
 extern sfr at 0xf4d TXB0D7;
 typedef union {
@@ -1227,9 +1227,9 @@ typedef union {
                unsigned TXB0D76:1;
                unsigned TXB0D77:1;
        };
-} TXB0D7bits_t;
+} __TXB0D7bits_t;
 
-extern volatile TXB0D7bits_t at 0xf4d TXB0D7bits;
+extern volatile __TXB0D7bits_t at 0xf4d TXB0D7bits;
 
 extern sfr at 0xf4e CANSTATRO2;
 typedef union {
@@ -1243,9 +1243,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO2bits_t;
+} __CANSTATRO2bits_t;
 
-extern volatile CANSTATRO2bits_t at 0xf4e CANSTATRO2bits;
+extern volatile __CANSTATRO2bits_t at 0xf4e CANSTATRO2bits;
 
 extern sfr at 0xf50 RXB1CON;
 typedef union {
@@ -1259,9 +1259,9 @@ typedef union {
                unsigned RXM1:1;
                unsigned RXFUL:1;
        };
-} RXB1CONbits_t;
+} __RXB1CONbits_t;
 
-extern volatile RXB1CONbits_t at 0xf50 RXB1CONbits;
+extern volatile __RXB1CONbits_t at 0xf50 RXB1CONbits;
 
 extern sfr at 0xf51 RXB1SIDH;
 typedef union {
@@ -1275,9 +1275,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXB1SIDHbits_t;
+} __RXB1SIDHbits_t;
 
-extern volatile RXB1SIDHbits_t at 0xf51 RXB1SIDHbits;
+extern volatile __RXB1SIDHbits_t at 0xf51 RXB1SIDHbits;
 
 extern sfr at 0xf52 RXB1SIDL;
 typedef union {
@@ -1291,9 +1291,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXB1SIDLbits_t;
+} __RXB1SIDLbits_t;
 
-extern volatile RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
+extern volatile __RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
 
 extern sfr at 0xf53 RXB1EIDH;
 typedef union {
@@ -1307,9 +1307,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXB1EIDHbits_t;
+} __RXB1EIDHbits_t;
 
-extern volatile RXB1EIDHbits_t at 0xf53 RXB1EIDHbits;
+extern volatile __RXB1EIDHbits_t at 0xf53 RXB1EIDHbits;
 
 extern sfr at 0xf54 RXB1EIDL;
 typedef union {
@@ -1323,9 +1323,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXB1EIDLbits_t;
+} __RXB1EIDLbits_t;
 
-extern volatile RXB1EIDLbits_t at 0xf54 RXB1EIDLbits;
+extern volatile __RXB1EIDLbits_t at 0xf54 RXB1EIDLbits;
 
 extern sfr at 0xf55 RXB1DLC;
 typedef union {
@@ -1339,9 +1339,9 @@ typedef union {
                unsigned RXRTR:1;
                unsigned :1;
        };
-} RXB1DLCbits_t;
+} __RXB1DLCbits_t;
 
-extern volatile RXB1DLCbits_t at 0xf55 RXB1DLCbits;
+extern volatile __RXB1DLCbits_t at 0xf55 RXB1DLCbits;
 
 extern sfr at 0xf56 RXB1D0;
 typedef union {
@@ -1355,9 +1355,9 @@ typedef union {
                unsigned RXB1D06:1;
                unsigned RXB1D07:1;
        };
-} RXB1D0bits_t;
+} __RXB1D0bits_t;
 
-extern volatile RXB1D0bits_t at 0xf56 RXB1D0bits;
+extern volatile __RXB1D0bits_t at 0xf56 RXB1D0bits;
 
 extern sfr at 0xf57 RXB1D1;
 typedef union {
@@ -1371,9 +1371,9 @@ typedef union {
                unsigned RXB1D16:1;
                unsigned RXB1D17:1;
        };
-} RXB1D1bits_t;
+} __RXB1D1bits_t;
 
-extern volatile RXB1D1bits_t at 0xf57 RXB1D1bits;
+extern volatile __RXB1D1bits_t at 0xf57 RXB1D1bits;
 
 extern sfr at 0xf58 RXB1D2;
 typedef union {
@@ -1387,9 +1387,9 @@ typedef union {
                unsigned RXB1D26:1;
                unsigned RXB1D27:1;
        };
-} RXB1D2bits_t;
+} __RXB1D2bits_t;
 
-extern volatile RXB1D2bits_t at 0xf58 RXB1D2bits;
+extern volatile __RXB1D2bits_t at 0xf58 RXB1D2bits;
 
 extern sfr at 0xf59 RXB1D3;
 typedef union {
@@ -1403,9 +1403,9 @@ typedef union {
                unsigned RXB1D36:1;
                unsigned RXB1D37:1;
        };
-} RXB1D3bits_t;
+} __RXB1D3bits_t;
 
-extern volatile RXB1D3bits_t at 0xf59 RXB1D3bits;
+extern volatile __RXB1D3bits_t at 0xf59 RXB1D3bits;
 
 extern sfr at 0xf5a RXB1D4;
 typedef union {
@@ -1419,9 +1419,9 @@ typedef union {
                unsigned RXB1D46:1;
                unsigned RXB1D47:1;
        };
-} RXB1D4bits_t;
+} __RXB1D4bits_t;
 
-extern volatile RXB1D4bits_t at 0xf5a RXB1D4bits;
+extern volatile __RXB1D4bits_t at 0xf5a RXB1D4bits;
 
 extern sfr at 0xf5b RXB1D5;
 typedef union {
@@ -1435,9 +1435,9 @@ typedef union {
                unsigned RXB1D56:1;
                unsigned RXB1D57:1;
        };
-} RXB1D5bits_t;
+} __RXB1D5bits_t;
 
-extern volatile RXB1D5bits_t at 0xf5b RXB1D5bits;
+extern volatile __RXB1D5bits_t at 0xf5b RXB1D5bits;
 
 extern sfr at 0xf5c RXB1D6;
 typedef union {
@@ -1451,9 +1451,9 @@ typedef union {
                unsigned RXB1D66:1;
                unsigned RXB1D67:1;
        };
-} RXB1D6bits_t;
+} __RXB1D6bits_t;
 
-extern volatile RXB1D6bits_t at 0xf5c RXB1D6bits;
+extern volatile __RXB1D6bits_t at 0xf5c RXB1D6bits;
 
 extern sfr at 0xf5d RXB1D7;
 typedef union {
@@ -1467,9 +1467,9 @@ typedef union {
                unsigned RXB1D76:1;
                unsigned RXB1D77:1;
        };
-} RXB1D7bits_t;
+} __RXB1D7bits_t;
 
-extern volatile RXB1D7bits_t at 0xf5d RXB1D7bits;
+extern volatile __RXB1D7bits_t at 0xf5d RXB1D7bits;
 
 extern sfr at 0xf5e CANSTATRO1;
 typedef union {
@@ -1483,9 +1483,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO1bits_t;
+} __CANSTATRO1bits_t;
 
-extern volatile CANSTATRO1bits_t at 0xf5e CANSTATRO1bits;
+extern volatile __CANSTATRO1bits_t at 0xf5e CANSTATRO1bits;
 
 extern sfr at 0xf60 RXB0CON;
 typedef union {
@@ -1499,9 +1499,9 @@ typedef union {
                unsigned RXM1:1;
                unsigned RXFUL:1;
        };
-} RXB0CONbits_t;
+} __RXB0CONbits_t;
 
-extern volatile RXB0CONbits_t at 0xf60 RXB0CONbits;
+extern volatile __RXB0CONbits_t at 0xf60 RXB0CONbits;
 
 extern sfr at 0xf61 RXB0SIDH;
 typedef union {
@@ -1515,9 +1515,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXB0SIDHbits_t;
+} __RXB0SIDHbits_t;
 
-extern volatile RXB0SIDHbits_t at 0xf61 RXB0SIDHbits;
+extern volatile __RXB0SIDHbits_t at 0xf61 RXB0SIDHbits;
 
 extern sfr at 0xf62 RXB0SIDL;
 typedef union {
@@ -1531,9 +1531,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXB0SIDLbits_t;
+} __RXB0SIDLbits_t;
 
-extern volatile RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
+extern volatile __RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
 
 extern sfr at 0xf63 RXB0EIDH;
 typedef union {
@@ -1547,9 +1547,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXB0EIDHbits_t;
+} __RXB0EIDHbits_t;
 
-extern volatile RXB0EIDHbits_t at 0xf63 RXB0EIDHbits;
+extern volatile __RXB0EIDHbits_t at 0xf63 RXB0EIDHbits;
 
 extern sfr at 0xf64 RXB0EIDL;
 typedef union {
@@ -1563,9 +1563,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXB0EIDLbits_t;
+} __RXB0EIDLbits_t;
 
-extern volatile RXB0EIDLbits_t at 0xf64 RXB0EIDLbits;
+extern volatile __RXB0EIDLbits_t at 0xf64 RXB0EIDLbits;
 
 extern sfr at 0xf65 RXB0DLC;
 typedef union {
@@ -1579,9 +1579,9 @@ typedef union {
                unsigned RTR:1;
                unsigned :1;
        };
-} RXB0DLCbits_t;
+} __RXB0DLCbits_t;
 
-extern volatile RXB0DLCbits_t at 0xf65 RXB0DLCbits;
+extern volatile __RXB0DLCbits_t at 0xf65 RXB0DLCbits;
 
 extern sfr at 0xf66 RXB0D0;
 extern sfr at 0xf67 RXB0D1;
@@ -1603,9 +1603,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATbits_t;
+} __CANSTATbits_t;
 
-extern volatile CANSTATbits_t at 0xf6e CANSTATbits;
+extern volatile __CANSTATbits_t at 0xf6e CANSTATbits;
 
 extern sfr at 0xf6f CANCON;
 typedef union {
@@ -1619,9 +1619,9 @@ typedef union {
                unsigned REQOP1:1;
                unsigned REQOP2:1;
        };
-} CANCONbits_t;
+} __CANCONbits_t;
 
-extern volatile CANCONbits_t at 0xf6f CANCONbits;
+extern volatile __CANCONbits_t at 0xf6f CANCONbits;
 
 extern sfr at 0xf70 BRGCON1;
 typedef union {
@@ -1635,9 +1635,9 @@ typedef union {
                unsigned SJW0:1;
                unsigned SJW1:1;
        };
-} BRGCON1bits_t;
+} __BRGCON1bits_t;
 
-extern volatile BRGCON1bits_t at 0xf70 BRGCON1bits;
+extern volatile __BRGCON1bits_t at 0xf70 BRGCON1bits;
 
 extern sfr at 0xf71 BRGCON2;
 typedef union {
@@ -1651,9 +1651,9 @@ typedef union {
                unsigned SAM:1;
                unsigned SEG2PHTS:1;
        };
-} BRGCON2bits_t;
+} __BRGCON2bits_t;
 
-extern volatile BRGCON2bits_t at 0xf71 BRGCON2bits;
+extern volatile __BRGCON2bits_t at 0xf71 BRGCON2bits;
 
 extern sfr at 0xf72 BRGCON3;
 typedef union {
@@ -1667,9 +1667,9 @@ typedef union {
                unsigned WAKFIL:1;
                unsigned :1;
        };
-} BRGCON3bits_t;
+} __BRGCON3bits_t;
 
-extern volatile BRGCON3bits_t at 0xf72 BRGCON3bits;
+extern volatile __BRGCON3bits_t at 0xf72 BRGCON3bits;
 
 extern sfr at 0xf73 CIOCON;
 typedef union {
@@ -1683,9 +1683,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CIOCONbits_t;
+} __CIOCONbits_t;
 
-extern volatile CIOCONbits_t at 0xf73 CIOCONbits;
+extern volatile __CIOCONbits_t at 0xf73 CIOCONbits;
 
 extern sfr at 0xf74 COMSTAT;
 typedef union {
@@ -1699,9 +1699,9 @@ typedef union {
                unsigned RXB1OVFL:1;
                unsigned RXB0OVFL:1;
        };
-} COMSTATbits_t;
+} __COMSTATbits_t;
 
-extern volatile COMSTATbits_t at 0xf74 COMSTATbits;
+extern volatile __COMSTATbits_t at 0xf74 COMSTATbits;
 
 extern sfr at 0xf75 RXERRCNT;
 typedef union {
@@ -1715,9 +1715,9 @@ typedef union {
                unsigned REC6:1;
                unsigned REC7:1;
        };
-} RXERRCNTbits_t;
+} __RXERRCNTbits_t;
 
-extern volatile RXERRCNTbits_t at 0xf75 RXERRCNTbits;
+extern volatile __RXERRCNTbits_t at 0xf75 RXERRCNTbits;
 
 extern sfr at 0xf76 TXERRCNT;
 typedef union {
@@ -1731,9 +1731,9 @@ typedef union {
                unsigned TEC6:1;
                unsigned TEC7:1;
        };
-} TXERRCNTbits_t;
+} __TXERRCNTbits_t;
 
-extern volatile TXERRCNTbits_t at 0xf76 TXERRCNTbits;
+extern volatile __TXERRCNTbits_t at 0xf76 TXERRCNTbits;
 
 extern sfr at 0xf80 PORTA;
 typedef union {
@@ -1780,9 +1780,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTAbits_t;
+} __PORTAbits_t;
 
-extern volatile PORTAbits_t at 0xf80 PORTAbits;
+extern volatile __PORTAbits_t at 0xf80 PORTAbits;
 
 extern sfr at 0xf81 PORTB;
 typedef union {
@@ -1807,9 +1807,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTBbits_t;
+} __PORTBbits_t;
 
-extern volatile PORTBbits_t at 0xf81 PORTBbits;
+extern volatile __PORTBbits_t at 0xf81 PORTBbits;
 
 extern sfr at 0xf82 PORTC;
 typedef union {
@@ -1845,9 +1845,9 @@ typedef union {
                unsigned CK:1;
                unsigned DT:1;
        };
-} PORTCbits_t;
+} __PORTCbits_t;
 
-extern volatile PORTCbits_t at 0xf82 PORTCbits;
+extern volatile __PORTCbits_t at 0xf82 PORTCbits;
 
 extern sfr at 0xf89 LATA;
 typedef union {
@@ -1861,9 +1861,9 @@ typedef union {
                unsigned LATA6:1;
                unsigned :1;
        };
-} LATAbits_t;
+} __LATAbits_t;
 
-extern volatile LATAbits_t at 0xf89 LATAbits;
+extern volatile __LATAbits_t at 0xf89 LATAbits;
 
 extern sfr at 0xf8a LATB;
 typedef union {
@@ -1877,9 +1877,9 @@ typedef union {
                unsigned LATB6:1;
                unsigned LATB7:1;
        };
-} LATBbits_t;
+} __LATBbits_t;
 
-extern volatile LATBbits_t at 0xf8a LATBbits;
+extern volatile __LATBbits_t at 0xf8a LATBbits;
 
 extern sfr at 0xf8b LATC;
 typedef union {
@@ -1893,9 +1893,9 @@ typedef union {
                unsigned LATC6:1;
                unsigned LATC7:1;
        };
-} LATCbits_t;
+} __LATCbits_t;
 
-extern volatile LATCbits_t at 0xf8b LATCbits;
+extern volatile __LATCbits_t at 0xf8b LATCbits;
 
 extern sfr at 0xf92 TRISA;
 typedef union {
@@ -1909,9 +1909,9 @@ typedef union {
                unsigned TRISA6:1;
                unsigned :1;
        };
-} TRISAbits_t;
+} __TRISAbits_t;
 
-extern volatile TRISAbits_t at 0xf92 TRISAbits;
+extern volatile __TRISAbits_t at 0xf92 TRISAbits;
 
 extern sfr at 0xf93 TRISB;
 typedef union {
@@ -1925,9 +1925,9 @@ typedef union {
                unsigned TRISB6:1;
                unsigned TRISB7:1;
        };
-} TRISBbits_t;
+} __TRISBbits_t;
 
-extern volatile TRISBbits_t at 0xf93 TRISBbits;
+extern volatile __TRISBbits_t at 0xf93 TRISBbits;
 
 extern sfr at 0xf94 TRISC;
 typedef union {
@@ -1941,9 +1941,9 @@ typedef union {
                unsigned TRISC6:1;
                unsigned TRISC7:1;
        };
-} TRISCbits_t;
+} __TRISCbits_t;
 
-extern volatile TRISCbits_t at 0xf94 TRISCbits;
+extern volatile __TRISCbits_t at 0xf94 TRISCbits;
 
 extern sfr at 0xf9d PIE1;
 typedef union {
@@ -1957,9 +1957,9 @@ typedef union {
                unsigned ADIE:1;
                unsigned PSPIE:1;
        };
-} PIE1bits_t;
+} __PIE1bits_t;
 
-extern volatile PIE1bits_t at 0xf9d PIE1bits;
+extern volatile __PIE1bits_t at 0xf9d PIE1bits;
 
 extern sfr at 0xf9e PIR1;
 typedef union {
@@ -1973,9 +1973,9 @@ typedef union {
                unsigned ADIF:1;
                unsigned PSPIF:1;
        };
-} PIR1bits_t;
+} __PIR1bits_t;
 
-extern volatile PIR1bits_t at 0xf9e PIR1bits;
+extern volatile __PIR1bits_t at 0xf9e PIR1bits;
 
 extern sfr at 0xf9f IPR1;
 typedef union {
@@ -1989,9 +1989,9 @@ typedef union {
                unsigned ADIP:1;
                unsigned PSPIP:1;
        };
-} IPR1bits_t;
+} __IPR1bits_t;
 
-extern volatile IPR1bits_t at 0xf9f IPR1bits;
+extern volatile __IPR1bits_t at 0xf9f IPR1bits;
 
 extern sfr at 0xfa0 PIE2;
 typedef union {
@@ -2005,9 +2005,9 @@ typedef union {
                unsigned CMIE:1;
                unsigned :1;
        };
-} PIE2bits_t;
+} __PIE2bits_t;
 
-extern volatile PIE2bits_t at 0xfa0 PIE2bits;
+extern volatile __PIE2bits_t at 0xfa0 PIE2bits;
 
 extern sfr at 0xfa1 PIR2;
 typedef union {
@@ -2021,9 +2021,9 @@ typedef union {
                unsigned CMIF:1;
                unsigned :1;
        };
-} PIR2bits_t;
+} __PIR2bits_t;
 
-extern volatile PIR2bits_t at 0xfa1 PIR2bits;
+extern volatile __PIR2bits_t at 0xfa1 PIR2bits;
 
 extern sfr at 0xfa2 IPR2;
 typedef union {
@@ -2037,9 +2037,9 @@ typedef union {
                unsigned CMIP:1;
                unsigned :1;
        };
-} IPR2bits_t;
+} __IPR2bits_t;
 
-extern volatile IPR2bits_t at 0xfa2 IPR2bits;
+extern volatile __IPR2bits_t at 0xfa2 IPR2bits;
 
 extern sfr at 0xfa3 PIE3;
 typedef union {
@@ -2053,9 +2053,9 @@ typedef union {
                unsigned WAKIE:1;
                unsigned IVRE:1;
        };
-} PIE3bits_t;
+} __PIE3bits_t;
 
-extern volatile PIE3bits_t at 0xfa3 PIE3bits;
+extern volatile __PIE3bits_t at 0xfa3 PIE3bits;
 
 extern sfr at 0xfa4 PIR3;
 typedef union {
@@ -2069,9 +2069,9 @@ typedef union {
                unsigned WAKIF:1;
                unsigned IVRF:1;
        };
-} PIR3bits_t;
+} __PIR3bits_t;
 
-extern volatile PIR3bits_t at 0xfa4 PIR3bits;
+extern volatile __PIR3bits_t at 0xfa4 PIR3bits;
 
 extern sfr at 0xfa5 IPR3;
 typedef union {
@@ -2085,9 +2085,9 @@ typedef union {
                unsigned WAKIP:1;
                unsigned IVRP:1;
        };
-} IPR3bits_t;
+} __IPR3bits_t;
 
-extern volatile IPR3bits_t at 0xfa5 IPR3bits;
+extern volatile __IPR3bits_t at 0xfa5 IPR3bits;
 
 extern sfr at 0xfa6 EECON1;
 typedef union {
@@ -2101,9 +2101,9 @@ typedef union {
                unsigned CFGS:1;
                unsigned EEPGD:1;
        };
-} EECON1bits_t;
+} __EECON1bits_t;
 
-extern volatile EECON1bits_t at 0xfa6 EECON1bits;
+extern volatile __EECON1bits_t at 0xfa6 EECON1bits;
 
 extern sfr at 0xfa7 EECON2;
 extern sfr at 0xfa8 EEDATA;
@@ -2120,9 +2120,9 @@ typedef union {
                unsigned RX9:1;
                unsigned SPEN:1;
        };
-} RCSTAbits_t;
+} __RCSTAbits_t;
 
-extern volatile RCSTAbits_t at 0xfab RCSTAbits;
+extern volatile __RCSTAbits_t at 0xfab RCSTAbits;
 
 extern sfr at 0xfac TXSTA;
 typedef union {
@@ -2136,9 +2136,9 @@ typedef union {
                unsigned TX9:1;
                unsigned CSRC:1;
        };
-} TXSTAbits_t;
+} __TXSTAbits_t;
 
-extern volatile TXSTAbits_t at 0xfac TXSTAbits;
+extern volatile __TXSTAbits_t at 0xfac TXSTAbits;
 
 extern sfr at 0xfad TXREG;
 extern sfr at 0xfae RCREG;
@@ -2155,9 +2155,9 @@ typedef union {
                unsigned T3CCP2:1;
                unsigned RD16:1;
        };
-} T3CONbits_t;
+} __T3CONbits_t;
 
-extern volatile T3CONbits_t at 0xfb1 T3CONbits;
+extern volatile __T3CONbits_t at 0xfb1 T3CONbits;
 
 extern sfr at 0xfb2 TMR3L;
 extern sfr at 0xfb3 TMR3H;
@@ -2173,9 +2173,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CCP1CONbits_t;
+} __CCP1CONbits_t;
 
-extern volatile CCP1CONbits_t at 0xfbd CCP1CONbits;
+extern volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
 
 extern sfr at 0xfbe CCPR1L;
 extern sfr at 0xfbf CCPR1H;
@@ -2191,9 +2191,9 @@ typedef union {
                unsigned ADCS2:1;
                unsigned ADFM:1;
        };
-} ADCON1bits_t;
+} __ADCON1bits_t;
 
-extern volatile ADCON1bits_t at 0xfc1 ADCON1bits;
+extern volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
 
 extern sfr at 0xfc2 ADCON0;
 typedef union {
@@ -2207,9 +2207,9 @@ typedef union {
                unsigned ADCS0:1;
                unsigned ADCS1:1;
        };
-} ADCON0bits_t;
+} __ADCON0bits_t;
 
-extern volatile ADCON0bits_t at 0xfc2 ADCON0bits;
+extern volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
 
 extern sfr at 0xfc3 ADRESL;
 extern sfr at 0xfc4 ADRESH;
@@ -2225,9 +2225,9 @@ typedef union {
                unsigned ACKSTAT:1;
                unsigned GCEN:1;
        };
-} SSPCON2bits_t;
+} __SSPCON2bits_t;
 
-extern volatile SSPCON2bits_t at 0xfc5 SSPCON2bits;
+extern volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
 
 extern sfr at 0xfc6 SSPCON1;
 typedef union {
@@ -2241,9 +2241,9 @@ typedef union {
                unsigned SSPOV:1;
                unsigned WCOL:1;
        };
-} SSPCON1bits_t;
+} __SSPCON1bits_t;
 
-extern volatile SSPCON1bits_t at 0xfc6 SSPCON1bits;
+extern volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
 
 extern sfr at 0xfc7 SSPSTAT;
 typedef union {
@@ -2257,9 +2257,9 @@ typedef union {
                unsigned CKE:1;
                unsigned SMP:1;
        };
-} SSPSTATbits_t;
+} __SSPSTATbits_t;
 
-extern volatile SSPSTATbits_t at 0xfc7 SSPSTATbits;
+extern volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
 
 extern sfr at 0xfc8 SSPADD;
 extern sfr at 0xfc9 SSPBUF;
@@ -2275,9 +2275,9 @@ typedef union {
                unsigned TOUTPS3:1;
                unsigned :1;
        };
-} T2CONbits_t;
+} __T2CONbits_t;
 
-extern volatile T2CONbits_t at 0xfca T2CONbits;
+extern volatile __T2CONbits_t at 0xfca T2CONbits;
 
 extern sfr at 0xfcb PR2;
 extern sfr at 0xfcc TMR2;
@@ -2293,9 +2293,9 @@ typedef union {
                unsigned :1;
                unsigned RD16:1;
        };
-} T1CONbits_t;
+} __T1CONbits_t;
 
-extern volatile T1CONbits_t at 0xfcd T1CONbits;
+extern volatile __T1CONbits_t at 0xfcd T1CONbits;
 
 extern sfr at 0xfce TMR1L;
 extern sfr at 0xfcf TMR1H;
@@ -2311,9 +2311,9 @@ typedef union {
                unsigned :1;
                unsigned IPEN:1;
        };
-} RCONbits_t;
+} __RCONbits_t;
 
-extern volatile RCONbits_t at 0xfd0 RCONbits;
+extern volatile __RCONbits_t at 0xfd0 RCONbits;
 
 extern sfr at 0xfd1 WDTCON;
 typedef union {
@@ -2338,9 +2338,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} WDTCONbits_t;
+} __WDTCONbits_t;
 
-extern volatile WDTCONbits_t at 0xfd1 WDTCONbits;
+extern volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
 
 extern sfr at 0xfd2 LVDCON;
 typedef union {
@@ -2365,9 +2365,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} LVDCONbits_t;
+} __LVDCONbits_t;
 
-extern volatile LVDCONbits_t at 0xfd2 LVDCONbits;
+extern volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
 
 extern sfr at 0xfd3 OSCCON;
 typedef union {
@@ -2381,9 +2381,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} OSCCONbits_t;
+} __OSCCONbits_t;
 
-extern volatile OSCCONbits_t at 0xfd3 OSCCONbits;
+extern volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
 
 extern sfr at 0xfd5 T0CON;
 extern sfr at 0xfd6 TMR0L;
@@ -2400,9 +2400,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} STATUSbits_t;
+} __STATUSbits_t;
 
-extern volatile STATUSbits_t at 0xfd8 STATUSbits;
+extern volatile __STATUSbits_t at 0xfd8 STATUSbits;
 
 extern sfr at 0xfd9 FSR2L;
 extern sfr at 0xfda FSR2H;
@@ -2450,9 +2450,9 @@ typedef union {
                unsigned INT1IP:1;
                unsigned :1;
        };
-} INTCON3bits_t;
+} __INTCON3bits_t;
 
-extern volatile INTCON3bits_t at 0xff0 INTCON3bits;
+extern volatile __INTCON3bits_t at 0xff0 INTCON3bits;
 
 extern sfr at 0xff1 INTCON2;
 typedef union {
@@ -2466,9 +2466,9 @@ typedef union {
                unsigned INTEDG0:1;
                unsigned RBPU:1;
        };
-} INTCON2bits_t;
+} __INTCON2bits_t;
 
-extern volatile INTCON2bits_t at 0xff1 INTCON2bits;
+extern volatile __INTCON2bits_t at 0xff1 INTCON2bits;
 
 extern sfr at 0xff2 INTCON;
 typedef union {
@@ -2482,9 +2482,9 @@ typedef union {
                unsigned PEIE:1;
                unsigned GIE:1;
        };
-} INTCONbits_t;
+} __INTCONbits_t;
 
-extern volatile INTCONbits_t at 0xff2 INTCONbits;
+extern volatile __INTCONbits_t at 0xff2 INTCONbits;
 
 extern sfr at 0xff3 PRODL;
 extern sfr at 0xff4 PRODH;
@@ -2507,14 +2507,154 @@ typedef union {
                unsigned STKUNF:1;
                unsigned STKFUL:1;
        };
-} STKPTRbits_t;
+} __STKPTRbits_t;
 
-extern volatile STKPTRbits_t at 0xffc STKPTRbits;
+extern volatile __STKPTRbits_t at 0xffc STKPTRbits;
 
 extern sfr at 0xffd TOSL;
 extern sfr at 0xffe TOSH;
 extern sfr at 0xfff TOSU;
 
 
-#endif
+/* Configuration registers locations */
+#define __CONFIG0H     0x300001
+#define __CONFIG1L     0x300002
+#define __CONFIG1H     0x300003
+#define __CONFIG3L     0x300006
+#define __CONFIG4L     0x300008
+#define __CONFIG4H     0x300009
+#define __CONFIG5L     0x30000A
+#define __CONFIG5H     0x30000B
+#define __CONFIG6L     0x30000C
+#define __CONFIG6H     0x30000D
+
+
+
+/* Oscillator 0H options */
+#define _OSC_RC_OSC2_0H        0xFF    /* RC-OSC2 as RA6 */
+#define _OSC_HS_PLL_0H 0xFE    /* HS-PLL Enabled */
+#define _OSC_EC_OSC2_RA6_0H    0xFD    /* EC-OSC2 as RA6 */
+#define _OSC_EC_OSC2_Clock_Out_0H      0xFC    /* EC-OSC2 as Clock_Out */
+#define _OSC_RC_0H     0xFB    /* RC */
+#define _OSC_HS_0H     0xFA    /* HS */
+#define _OSC_XT_0H     0xF9    /* XT */
+#define _OSC_LP_0H     0xF8    /* LP */
+
+/* Osc. Switch Enable 0H options */
+#define _OSCS_OFF_0H   0xFF    /* Disabled */
+#define _OSCS_ON_0H    0xDF    /* Enabled */
+
+/* Power Up Timer 1L options */
+#define _PUT_OFF_1L    0xFF    /* Disabled */
+#define _PUT_ON_1L     0xFE    /* Enabled */
+
+/* Brown Out Detect 1L options */
+#define _BODEN_ON_1L   0xFF    /* Enabled */
+#define _BODEN_OFF_1L  0xFD    /* Disabled */
+
+/* Brown Out Voltage 1L options */
+#define _BODENV_2_0V_1L        0xFF    /* 2.0V */
+#define _BODENV_2_7V_1L        0xFB    /* 2.7V */
+#define _BODENV_4_2V_1L        0xF7    /* 4.2V */
+#define _BODENV_4_5V_1L        0xF3    /* 4.5V */
+
+/* Watchdog Timer 1H options */
+#define _WDT_ON_1H     0xFF    /* Enabled */
+#define _WDT_OFF_1H    0xFE    /* Disabled */
+
+/* Watchdog Postscaler 1H options */
+#define _WDTPS_1_128_1H        0xFF    /* 1:128 */
+#define _WDTPS_1_64_1H 0xFD    /* 1:64 */
+#define _WDTPS_1_32_1H 0xFB    /* 1:32 */
+#define _WDTPS_1_16_1H 0xF9    /* 1:16 */
+#define _WDTPS_1_8_1H  0xF7    /* 1:8 */
+#define _WDTPS_1_4_1H  0xF5    /* 1:4 */
+#define _WDTPS_1_2_1H  0xF3    /* 1:2 */
+#define _WDTPS_1_1_1H  0xF1    /* 1:1 */
+
+/* Low Voltage Program 3L options */
+#define _LVP_ON_3L     0xFF    /* Enabled */
+#define _LVP_OFF_3L    0xFB    /* Disabled */
+
+/* Background Debug 3L options */
+#define _BACKBUG_OFF_3L        0xFF    /* Disabled */
+#define _BACKBUG_ON_3L 0x7F    /* Enabled */
+
+/* Stack Overflow Reset 3L options */
+#define _STVR_ON_3L    0xFF    /* Enabled */
+#define _STVR_OFF_3L   0xFE    /* Disabled */
+
+/* Code Protect 00200-01FFF 4L options */
+#define _CP_0_OFF_4L   0xFF    /* Disabled */
+#define _CP_0_ON_4L    0xFE    /* Enabled */
+
+/* Code Protect 02000-03FFF 4L options */
+#define _CP_1_OFF_4L   0xFF    /* Disabled */
+#define _CP_1_ON_4L    0xFD    /* Enabled */
+
+/* Code Protect 04000-05FFF 4L options */
+#define _CP_2_OFF_4L   0xFF    /* Disabled */
+#define _CP_2_ON_4L    0xFB    /* Enabled */
+
+/* Code Protect 06000-07FFF 4L options */
+#define _CP_3_OFF_4L   0xFF    /* Disabled */
+#define _CP_3_ON_4L    0xF7    /* Enabled */
+
+/* Data EE Read Protect 4H options */
+#define _CPD_OFF_4H    0xFF    /* Disabled */
+#define _CPD_ON_4H     0x7F    /* Enabled */
+
+/* Code Protect Boot 4H options */
+#define _CPB_OFF_4H    0xFF    /* Disabled */
+#define _CPB_ON_4H     0xBF    /* Enabled */
+
+/* Table Write Protect 00200-01FFF 5L options */
+#define _WRT_0_OFF_5L  0xFF    /* Disabled */
+#define _WRT_0_ON_5L   0xFE    /* Enabled */
+
+/* Table Write Protect 02000-03FFF 5L options */
+#define _WRT_1_OFF_5L  0xFF    /* Disabled */
+#define _WRT_1_ON_5L   0xFD    /* Enabled */
+
+/* Table Write Protect 04000-05FFF 5L options */
+#define _WRT_2_OFF_5L  0xFF    /* Disabled */
+#define _WRT_2_ON_5L   0xFB    /* Enabled */
+
+/* Table Write Protect 06000-07FFF 5L options */
+#define _WRT_3_OFF_5L  0xFF    /* Disabled */
+#define _WRT_3_ON_5L   0xF7    /* Enabled */
+
+/* Data EE Write Protect 5H options */
+#define _WRTD_OFF_5H   0xFF    /* Disabled */
+#define _WRTD_ON_5H    0x7F    /* Enabled */
+
+/* Table Write Protect Boot 5H options */
+#define _WRTB_OFF_5H   0xFF    /* Disabled */
+#define _WRTB_ON_5H    0xBF    /* Enabled */
+
+/* Config. Write Protect 5H options */
+#define _WRTC_OFF_5H   0xFF    /* Disabled */
+#define _WRTC_ON_5H    0xDF    /* Enabled */
+
+/* Table Read Protect 00200-01FFF 6L options */
+#define _EBTR_0_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_0_ON_6L  0xFE    /* Enabled */
+
+/* Table Read Protect 02000-03FFF 6L options */
+#define _EBTR_1_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_1_ON_6L  0xFD    /* Enabled */
+
+/* Table Read Protect 04000-05FFF 6L options */
+#define _EBTR_2_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_2_ON_6L  0xFB    /* Enabled */
 
+/* Table Read Protect 06000-07FFF 6L options */
+#define _EBTR_3_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_3_ON_6L  0xF7    /* Enabled */
+
+/* Table Read Protect Boot 6H options */
+#define _EBTRB_OFF_6H  0xFF    /* Disabled */
+#define _EBTRB_ON_6H   0xBF    /* Enabled */
+
+
+#endif
index 7ad7569ad6684d7b46cd2082934f74b5551478f3..124b9210e5703ec67502e38cb18fa34d507796a1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * pic18f442.h - 18F442 Device Library Header
+ * pic18f442.h - PIC18F442 Device Library Header
  *
  * This file is part of the GNU PIC Library.
  *
@@ -60,9 +60,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTAbits_t;
+} __PORTAbits_t;
 
-extern volatile PORTAbits_t at 0xf80 PORTAbits;
+extern volatile __PORTAbits_t at 0xf80 PORTAbits;
 
 extern sfr at 0xf81 PORTB;
 typedef union {
@@ -87,9 +87,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTBbits_t;
+} __PORTBbits_t;
 
-extern volatile PORTBbits_t at 0xf81 PORTBbits;
+extern volatile __PORTBbits_t at 0xf81 PORTBbits;
 
 extern sfr at 0xf82 PORTC;
 typedef union {
@@ -125,9 +125,9 @@ typedef union {
                unsigned CK:1;
                unsigned DT:1;
        };
-} PORTCbits_t;
+} __PORTCbits_t;
 
-extern volatile PORTCbits_t at 0xf82 PORTCbits;
+extern volatile __PORTCbits_t at 0xf82 PORTCbits;
 
 extern sfr at 0xf83 PORTD;
 typedef union {
@@ -152,9 +152,9 @@ typedef union {
                unsigned AD6:1;
                unsigned AD7:1;
        };
-} PORTDbits_t;
+} __PORTDbits_t;
 
-extern volatile PORTDbits_t at 0xf83 PORTDbits;
+extern volatile __PORTDbits_t at 0xf83 PORTDbits;
 
 extern sfr at 0xf84 PORTE;
 typedef union {
@@ -190,9 +190,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTEbits_t;
+} __PORTEbits_t;
 
-extern volatile PORTEbits_t at 0xf84 PORTEbits;
+extern volatile __PORTEbits_t at 0xf84 PORTEbits;
 
 extern sfr at 0xf89 LATA;
 typedef union {
@@ -206,9 +206,9 @@ typedef union {
                unsigned LATA6:1;
                unsigned :1;
        };
-} LATAbits_t;
+} __LATAbits_t;
 
-extern volatile LATAbits_t at 0xf89 LATAbits;
+extern volatile __LATAbits_t at 0xf89 LATAbits;
 
 extern sfr at 0xf8a LATB;
 typedef union {
@@ -222,9 +222,9 @@ typedef union {
                unsigned LATB6:1;
                unsigned LATB7:1;
        };
-} LATBbits_t;
+} __LATBbits_t;
 
-extern volatile LATBbits_t at 0xf8a LATBbits;
+extern volatile __LATBbits_t at 0xf8a LATBbits;
 
 extern sfr at 0xf8b LATC;
 typedef union {
@@ -238,9 +238,9 @@ typedef union {
                unsigned LATC6:1;
                unsigned LATC7:1;
        };
-} LATCbits_t;
+} __LATCbits_t;
 
-extern volatile LATCbits_t at 0xf8b LATCbits;
+extern volatile __LATCbits_t at 0xf8b LATCbits;
 
 extern sfr at 0xf8c LATD;
 typedef union {
@@ -254,9 +254,9 @@ typedef union {
                unsigned LATD6:1;
                unsigned LATD7:1;
        };
-} LATDbits_t;
+} __LATDbits_t;
 
-extern volatile LATDbits_t at 0xf8c LATDbits;
+extern volatile __LATDbits_t at 0xf8c LATDbits;
 
 extern sfr at 0xf8d LATE;
 typedef union {
@@ -270,9 +270,9 @@ typedef union {
                unsigned LATE6:1;
                unsigned LATE7:1;
        };
-} LATEbits_t;
+} __LATEbits_t;
 
-extern volatile LATEbits_t at 0xf8d LATEbits;
+extern volatile __LATEbits_t at 0xf8d LATEbits;
 
 extern sfr at 0xf92 TRISA;
 typedef union {
@@ -286,9 +286,9 @@ typedef union {
                unsigned TRISA6:1;
                unsigned :1;
        };
-} TRISAbits_t;
+} __TRISAbits_t;
 
-extern volatile TRISAbits_t at 0xf92 TRISAbits;
+extern volatile __TRISAbits_t at 0xf92 TRISAbits;
 
 extern sfr at 0xf93 TRISB;
 typedef union {
@@ -302,9 +302,9 @@ typedef union {
                unsigned TRISB6:1;
                unsigned TRISB7:1;
        };
-} TRISBbits_t;
+} __TRISBbits_t;
 
-extern volatile TRISBbits_t at 0xf93 TRISBbits;
+extern volatile __TRISBbits_t at 0xf93 TRISBbits;
 
 extern sfr at 0xf94 TRISC;
 typedef union {
@@ -318,9 +318,9 @@ typedef union {
                unsigned TRISC6:1;
                unsigned TRISC7:1;
        };
-} TRISCbits_t;
+} __TRISCbits_t;
 
-extern volatile TRISCbits_t at 0xf94 TRISCbits;
+extern volatile __TRISCbits_t at 0xf94 TRISCbits;
 
 extern sfr at 0xf95 TRISD;
 typedef union {
@@ -334,9 +334,9 @@ typedef union {
                unsigned TRISD6:1;
                unsigned TRISD7:1;
        };
-} TRISDbits_t;
+} __TRISDbits_t;
 
-extern volatile TRISDbits_t at 0xf95 TRISDbits;
+extern volatile __TRISDbits_t at 0xf95 TRISDbits;
 
 extern sfr at 0xf96 TRISE;
 typedef union {
@@ -350,9 +350,9 @@ typedef union {
                unsigned OBF:1;
                unsigned IBF:1;
        };
-} TRISEbits_t;
+} __TRISEbits_t;
 
-extern volatile TRISEbits_t at 0xf96 TRISEbits;
+extern volatile __TRISEbits_t at 0xf96 TRISEbits;
 
 extern sfr at 0xf9d PIE1;
 typedef union {
@@ -366,9 +366,9 @@ typedef union {
                unsigned ADIE:1;
                unsigned PSPIE:1;
        };
-} PIE1bits_t;
+} __PIE1bits_t;
 
-extern volatile PIE1bits_t at 0xf9d PIE1bits;
+extern volatile __PIE1bits_t at 0xf9d PIE1bits;
 
 extern sfr at 0xf9e PIR1;
 typedef union {
@@ -382,9 +382,9 @@ typedef union {
                unsigned ADIF:1;
                unsigned PSPIF:1;
        };
-} PIR1bits_t;
+} __PIR1bits_t;
 
-extern volatile PIR1bits_t at 0xf9e PIR1bits;
+extern volatile __PIR1bits_t at 0xf9e PIR1bits;
 
 extern sfr at 0xf9f IPR1;
 typedef union {
@@ -398,9 +398,9 @@ typedef union {
                unsigned ADIP:1;
                unsigned PSPIP:1;
        };
-} IPR1bits_t;
+} __IPR1bits_t;
 
-extern volatile IPR1bits_t at 0xf9f IPR1bits;
+extern volatile __IPR1bits_t at 0xf9f IPR1bits;
 
 extern sfr at 0xfa0 PIE2;
 typedef union {
@@ -414,9 +414,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PIE2bits_t;
+} __PIE2bits_t;
 
-extern volatile PIE2bits_t at 0xfa0 PIE2bits;
+extern volatile __PIE2bits_t at 0xfa0 PIE2bits;
 
 extern sfr at 0xfa1 PIR2;
 typedef union {
@@ -430,9 +430,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PIR2bits_t;
+} __PIR2bits_t;
 
-extern volatile PIR2bits_t at 0xfa1 PIR2bits;
+extern volatile __PIR2bits_t at 0xfa1 PIR2bits;
 
 extern sfr at 0xfa2 IPR2;
 typedef union {
@@ -446,9 +446,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} IPR2bits_t;
+} __IPR2bits_t;
 
-extern volatile IPR2bits_t at 0xfa2 IPR2bits;
+extern volatile __IPR2bits_t at 0xfa2 IPR2bits;
 
 extern sfr at 0xfa6 EECON1;
 typedef union {
@@ -462,9 +462,9 @@ typedef union {
                unsigned CFGS:1;
                unsigned EEPGD:1;
        };
-} EECON1bits_t;
+} __EECON1bits_t;
 
-extern volatile EECON1bits_t at 0xfa6 EECON1bits;
+extern volatile __EECON1bits_t at 0xfa6 EECON1bits;
 
 extern sfr at 0xfa7 EECON2;
 extern sfr at 0xfa8 EEDATA;
@@ -481,9 +481,9 @@ typedef union {
                unsigned RX9:1;
                unsigned SPEN:1;
        };
-} RCSTAbits_t;
+} __RCSTAbits_t;
 
-extern volatile RCSTAbits_t at 0xfab RCSTAbits;
+extern volatile __RCSTAbits_t at 0xfab RCSTAbits;
 
 extern sfr at 0xfac TXSTA;
 typedef union {
@@ -497,9 +497,9 @@ typedef union {
                unsigned TX9:1;
                unsigned CSRC:1;
        };
-} TXSTAbits_t;
+} __TXSTAbits_t;
 
-extern volatile TXSTAbits_t at 0xfac TXSTAbits;
+extern volatile __TXSTAbits_t at 0xfac TXSTAbits;
 
 extern sfr at 0xfad TXREG;
 extern sfr at 0xfae RCREG;
@@ -516,9 +516,9 @@ typedef union {
                unsigned T3CCP2:1;
                unsigned RD16:1;
        };
-} T3CONbits_t;
+} __T3CONbits_t;
 
-extern volatile T3CONbits_t at 0xfb1 T3CONbits;
+extern volatile __T3CONbits_t at 0xfb1 T3CONbits;
 
 extern sfr at 0xfb2 TMR3L;
 extern sfr at 0xfb3 TMR3H;
@@ -534,9 +534,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CCP2CONbits_t;
+} __CCP2CONbits_t;
 
-extern volatile CCP2CONbits_t at 0xfba CCP2CONbits;
+extern volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
 
 extern sfr at 0xfbb CCPR2L;
 extern sfr at 0xfbc CCPR2H;
@@ -552,9 +552,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CCP1CONbits_t;
+} __CCP1CONbits_t;
 
-extern volatile CCP1CONbits_t at 0xfbd CCP1CONbits;
+extern volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
 
 extern sfr at 0xfbe CCPR1L;
 extern sfr at 0xfbf CCPR1H;
@@ -570,9 +570,9 @@ typedef union {
                unsigned ADCS2:1;
                unsigned ADFM:1;
        };
-} ADCON1bits_t;
+} __ADCON1bits_t;
 
-extern volatile ADCON1bits_t at 0xfc1 ADCON1bits;
+extern volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
 
 extern sfr at 0xfc2 ADCON0;
 typedef union {
@@ -586,9 +586,9 @@ typedef union {
                unsigned ADCS0:1;
                unsigned ADCS1:1;
        };
-} ADCON0bits_t;
+} __ADCON0bits_t;
 
-extern volatile ADCON0bits_t at 0xfc2 ADCON0bits;
+extern volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
 
 extern sfr at 0xfc3 ADRESL;
 extern sfr at 0xfc4 ADRESH;
@@ -604,9 +604,9 @@ typedef union {
                unsigned ACKSTAT:1;
                unsigned GCEN:1;
        };
-} SSPCON2bits_t;
+} __SSPCON2bits_t;
 
-extern volatile SSPCON2bits_t at 0xfc5 SSPCON2bits;
+extern volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
 
 extern sfr at 0xfc6 SSPCON1;
 typedef union {
@@ -620,9 +620,9 @@ typedef union {
                unsigned SSPOV:1;
                unsigned WCOL:1;
        };
-} SSPCON1bits_t;
+} __SSPCON1bits_t;
 
-extern volatile SSPCON1bits_t at 0xfc6 SSPCON1bits;
+extern volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
 
 extern sfr at 0xfc7 SSPSTAT;
 typedef union {
@@ -636,9 +636,9 @@ typedef union {
                unsigned CKE:1;
                unsigned SMP:1;
        };
-} SSPSTATbits_t;
+} __SSPSTATbits_t;
 
-extern volatile SSPSTATbits_t at 0xfc7 SSPSTATbits;
+extern volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
 
 extern sfr at 0xfc8 SSPADD;
 extern sfr at 0xfc9 SSPBUF;
@@ -654,9 +654,9 @@ typedef union {
                unsigned TOUTPS3:1;
                unsigned :1;
        };
-} T2CONbits_t;
+} __T2CONbits_t;
 
-extern volatile T2CONbits_t at 0xfca T2CONbits;
+extern volatile __T2CONbits_t at 0xfca T2CONbits;
 
 extern sfr at 0xfcb PR2;
 extern sfr at 0xfcc TMR2;
@@ -672,9 +672,9 @@ typedef union {
                unsigned :1;
                unsigned RD16:1;
        };
-} T1CONbits_t;
+} __T1CONbits_t;
 
-extern volatile T1CONbits_t at 0xfcd T1CONbits;
+extern volatile __T1CONbits_t at 0xfcd T1CONbits;
 
 extern sfr at 0xfce TMR1L;
 extern sfr at 0xfcf TMR1H;
@@ -690,9 +690,9 @@ typedef union {
                unsigned :1;
                unsigned IPEN:1;
        };
-} RCONbits_t;
+} __RCONbits_t;
 
-extern volatile RCONbits_t at 0xfd0 RCONbits;
+extern volatile __RCONbits_t at 0xfd0 RCONbits;
 
 extern sfr at 0xfd1 WDTCON;
 typedef union {
@@ -717,9 +717,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} WDTCONbits_t;
+} __WDTCONbits_t;
 
-extern volatile WDTCONbits_t at 0xfd1 WDTCONbits;
+extern volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
 
 extern sfr at 0xfd2 LVDCON;
 typedef union {
@@ -744,9 +744,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} LVDCONbits_t;
+} __LVDCONbits_t;
 
-extern volatile LVDCONbits_t at 0xfd2 LVDCONbits;
+extern volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
 
 extern sfr at 0xfd3 OSCCON;
 typedef union {
@@ -760,9 +760,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} OSCCONbits_t;
+} __OSCCONbits_t;
 
-extern volatile OSCCONbits_t at 0xfd3 OSCCONbits;
+extern volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
 
 extern sfr at 0xfd5 T0CON;
 extern sfr at 0xfd6 TMR0L;
@@ -779,9 +779,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} STATUSbits_t;
+} __STATUSbits_t;
 
-extern volatile STATUSbits_t at 0xfd8 STATUSbits;
+extern volatile __STATUSbits_t at 0xfd8 STATUSbits;
 
 extern sfr at 0xfd9 FSR2L;
 extern sfr at 0xfda FSR2H;
@@ -829,9 +829,9 @@ typedef union {
                unsigned INT1IP:1;
                unsigned INT2IP:1;
        };
-} INTCON3bits_t;
+} __INTCON3bits_t;
 
-extern volatile INTCON3bits_t at 0xff0 INTCON3bits;
+extern volatile __INTCON3bits_t at 0xff0 INTCON3bits;
 
 extern sfr at 0xff1 INTCON2;
 typedef union {
@@ -845,9 +845,9 @@ typedef union {
                unsigned INTEDG0:1;
                unsigned RBPU:1;
        };
-} INTCON2bits_t;
+} __INTCON2bits_t;
 
-extern volatile INTCON2bits_t at 0xff1 INTCON2bits;
+extern volatile __INTCON2bits_t at 0xff1 INTCON2bits;
 
 extern sfr at 0xff2 INTCON;
 typedef union {
@@ -861,9 +861,9 @@ typedef union {
                unsigned PEIE:1;
                unsigned GIE:1;
        };
-} INTCONbits_t;
+} __INTCONbits_t;
 
-extern volatile INTCONbits_t at 0xff2 INTCONbits;
+extern volatile __INTCONbits_t at 0xff2 INTCONbits;
 
 extern sfr at 0xff3 PRODL;
 extern sfr at 0xff4 PRODH;
@@ -886,14 +886,135 @@ typedef union {
                unsigned STKUNF:1;
                unsigned STKFUL:1;
        };
-} STKPTRbits_t;
+} __STKPTRbits_t;
 
-extern volatile STKPTRbits_t at 0xffc STKPTRbits;
+extern volatile __STKPTRbits_t at 0xffc STKPTRbits;
 
 extern sfr at 0xffd TOSL;
 extern sfr at 0xffe TOSH;
 extern sfr at 0xfff TOSU;
 
 
-#endif
+/* Configuration registers locations */
+#define __CONFIG0H     0x300001
+#define __CONFIG1L     0x300002
+#define __CONFIG1H     0x300003
+#define __CONFIG2H     0x300005
+#define __CONFIG3L     0x300006
+#define __CONFIG4L     0x300008
+#define __CONFIG4H     0x300009
+#define __CONFIG5L     0x30000A
+#define __CONFIG5H     0x30000B
+#define __CONFIG6L     0x30000C
+#define __CONFIG6H     0x30000D
+
+
+
+/* Oscillator 0H options */
+#define _OSC_RC_OSC2_0H        0xFF    /* RC-OSC2 as RA6 */
+#define _OSC_HS_PLL_0H 0xFE    /* HS-PLL Enabled */
+#define _OSC_EC_OSC2_RA6_0H    0xFD    /* EC-OSC2 as RA6 */
+#define _OSC_EC_OSC2_Clock_Out_0H      0xFC    /* EC-OSC2 as Clock_Out */
+#define _OSC_RC_0H     0xFB    /* RC */
+#define _OSC_HS_0H     0xFA    /* HS */
+#define _OSC_XT_0H     0xF9    /* XT */
+#define _OSC_LP_0H     0xF8    /* LP */
+
+/* Osc. Switch Enable 0H options */
+#define _OSCS_OFF_0H   0xFF    /* Disabled */
+#define _OSCS_ON_0H    0xDF    /* Enabled */
+
+/* Power Up Timer 1L options */
+#define _PUT_OFF_1L    0xFF    /* Disabled */
+#define _PUT_ON_1L     0xFE    /* Enabled */
+
+/* Brown Out Detect 1L options */
+#define _BODEN_ON_1L   0xFF    /* Enabled */
+#define _BODEN_OFF_1L  0xFD    /* Disabled */
+
+/* Brown Out Voltage 1L options */
+#define _BODENV_2_0V_1L        0xFF    /* 2.0V */
+#define _BODENV_2_7V_1L        0xFB    /* 2.7V */
+#define _BODENV_4_2V_1L        0xF7    /* 4.2V */
+#define _BODENV_4_5V_1L        0xF3    /* 4.5V */
+
+/* Watchdog Timer 1H options */
+#define _WDT_ON_1H     0xFF    /* Enabled */
+#define _WDT_OFF_1H    0xFE    /* Disabled */
+
+/* Watchdog Postscaler 1H options */
+#define _WDTPS_1_128_1H        0xFF    /* 1:128 */
+#define _WDTPS_1_64_1H 0xFD    /* 1:64 */
+#define _WDTPS_1_32_1H 0xFB    /* 1:32 */
+#define _WDTPS_1_16_1H 0xF9    /* 1:16 */
+#define _WDTPS_1_8_1H  0xF7    /* 1:8 */
+#define _WDTPS_1_4_1H  0xF5    /* 1:4 */
+#define _WDTPS_1_2_1H  0xF3    /* 1:2 */
+#define _WDTPS_1_1_1H  0xF1    /* 1:1 */
+
+/* CCP2 Mux 2H options */
+#define _CCP2MUX_RC1_2H        0xFF    /* RC1 */
+#define _CCP2MUX_RB3_2H        0xFE    /* RB3 */
+
+/* Low Voltage Program 3L options */
+#define _LVP_ON_3L     0xFF    /* Enabled */
+#define _LVP_OFF_3L    0xFB    /* Disabled */
+
+/* Background Debug 3L options */
+#define _BACKBUG_OFF_3L        0xFF    /* Disabled */
+#define _BACKBUG_ON_3L 0x7F    /* Enabled */
+
+/* Stack Overflow Reset 3L options */
+#define _STVR_ON_3L    0xFF    /* Enabled */
+#define _STVR_OFF_3L   0xFE    /* Disabled */
+
+/* Code Protect 00200-01FFF 4L options */
+#define _CP_0_OFF_4L   0xFF    /* Disabled */
+#define _CP_0_ON_4L    0xFE    /* Enabled */
+
+/* Code Protect 02000-03FFF 4L options */
+#define _CP_1_OFF_4L   0xFF    /* Disabled */
+#define _CP_1_ON_4L    0xFD    /* Enabled */
+
+/* Data EE Read Protect 4H options */
+#define _CPD_OFF_4H    0xFF    /* Disabled */
+#define _CPD_ON_4H     0x7F    /* Enabled */
+
+/* Code Protect Boot 4H options */
+#define _CPB_OFF_4H    0xFF    /* Disabled */
+#define _CPB_ON_4H     0xBF    /* Enabled */
+
+/* Table Write Protect 00200-01FFF 5L options */
+#define _WRT_0_OFF_5L  0xFF    /* Disabled */
+#define _WRT_0_ON_5L   0xFE    /* Enabled */
+
+/* Table Write Protect 02000-03FFF 5L options */
+#define _WRT_1_OFF_5L  0xFF    /* Disabled */
+#define _WRT_1_ON_5L   0xFD    /* Enabled */
+
+/* Data EE Write Protect 5H options */
+#define _WRTD_OFF_5H   0xFF    /* Disabled */
+#define _WRTD_ON_5H    0x7F    /* Enabled */
+
+/* Table Write Protect Boot 5H options */
+#define _WRTB_OFF_5H   0xFF    /* Disabled */
+#define _WRTB_ON_5H    0xBF    /* Enabled */
+
+/* Config. Write Protect 5H options */
+#define _WRTC_OFF_5H   0xFF    /* Disabled */
+#define _WRTC_ON_5H    0xDF    /* Enabled */
+
+/* Table Read Protect 00200-01FFF 6L options */
+#define _EBTR_0_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_0_ON_6L  0xFE    /* Enabled */
+
+/* Table Read Protect 02000-03FFF 6L options */
+#define _EBTR_1_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_1_ON_6L  0xFD    /* Enabled */
+
+/* Table Read Protect Boot 6H options */
+#define _EBTRB_OFF_6H  0xFF    /* Disabled */
+#define _EBTRB_ON_6H   0xBF    /* Enabled */
 
+
+#endif
index e0c7cdd2be0f1cf0b8c39766de2bdae5d03dbe87..78a38a470a3975067933b837a3c6eaff06e883d0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * pic18f448.h - 18F448 Device Library Header
+ * pic18f448.h - PIC18F448 Device Library Header
  *
  * This file is part of the GNU PIC Library.
  *
@@ -27,9 +27,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF0SIDHbits_t;
+} __RXF0SIDHbits_t;
 
-extern volatile RXF0SIDHbits_t at 0xf00 RXF0SIDHbits;
+extern volatile __RXF0SIDHbits_t at 0xf00 RXF0SIDHbits;
 
 extern sfr at 0xf01 RXF0SIDL;
 typedef union {
@@ -43,9 +43,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF0SIDLbits_t;
+} __RXF0SIDLbits_t;
 
-extern volatile RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
+extern volatile __RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
 
 extern sfr at 0xf02 RXF0EIDH;
 typedef union {
@@ -59,9 +59,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF0EIDHbits_t;
+} __RXF0EIDHbits_t;
 
-extern volatile RXF0EIDHbits_t at 0xf02 RXF0EIDHbits;
+extern volatile __RXF0EIDHbits_t at 0xf02 RXF0EIDHbits;
 
 extern sfr at 0xf03 RXF0EIDL;
 typedef union {
@@ -75,9 +75,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF0EIDLbits_t;
+} __RXF0EIDLbits_t;
 
-extern volatile RXF0EIDLbits_t at 0xf03 RXF0EIDLbits;
+extern volatile __RXF0EIDLbits_t at 0xf03 RXF0EIDLbits;
 
 extern sfr at 0xf04 RXF1SIDH;
 typedef union {
@@ -91,9 +91,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF1SIDHbits_t;
+} __RXF1SIDHbits_t;
 
-extern volatile RXF1SIDHbits_t at 0xf04 RXF1SIDHbits;
+extern volatile __RXF1SIDHbits_t at 0xf04 RXF1SIDHbits;
 
 extern sfr at 0xf05 RXF1SIDL;
 typedef union {
@@ -107,9 +107,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF1SIDLbits_t;
+} __RXF1SIDLbits_t;
 
-extern volatile RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
+extern volatile __RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
 
 extern sfr at 0xf06 RXF1EIDH;
 typedef union {
@@ -123,9 +123,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF1EIDHbits_t;
+} __RXF1EIDHbits_t;
 
-extern volatile RXF1EIDHbits_t at 0xf06 RXF1EIDHbits;
+extern volatile __RXF1EIDHbits_t at 0xf06 RXF1EIDHbits;
 
 extern sfr at 0xf07 RXF1EIDL;
 typedef union {
@@ -139,9 +139,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF1EIDLbits_t;
+} __RXF1EIDLbits_t;
 
-extern volatile RXF1EIDLbits_t at 0xf07 RXF1EIDLbits;
+extern volatile __RXF1EIDLbits_t at 0xf07 RXF1EIDLbits;
 
 extern sfr at 0xf08 RXF2SIDH;
 typedef union {
@@ -155,9 +155,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF2SIDHbits_t;
+} __RXF2SIDHbits_t;
 
-extern volatile RXF2SIDHbits_t at 0xf08 RXF2SIDHbits;
+extern volatile __RXF2SIDHbits_t at 0xf08 RXF2SIDHbits;
 
 extern sfr at 0xf09 RXF2SIDL;
 typedef union {
@@ -171,9 +171,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF2SIDLbits_t;
+} __RXF2SIDLbits_t;
 
-extern volatile RXF2SIDLbits_t at 0xf09 RXF2SIDLbits;
+extern volatile __RXF2SIDLbits_t at 0xf09 RXF2SIDLbits;
 
 extern sfr at 0xf0a RXF2EIDH;
 typedef union {
@@ -187,9 +187,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF2EIDHbits_t;
+} __RXF2EIDHbits_t;
 
-extern volatile RXF2EIDHbits_t at 0xf0a RXF2EIDHbits;
+extern volatile __RXF2EIDHbits_t at 0xf0a RXF2EIDHbits;
 
 extern sfr at 0xf0b RXF2EIDL;
 typedef union {
@@ -203,9 +203,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF2EIDLbits_t;
+} __RXF2EIDLbits_t;
 
-extern volatile RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
+extern volatile __RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
 
 extern sfr at 0xf0c RXF3SIDH;
 typedef union {
@@ -219,9 +219,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF3SIDHbits_t;
+} __RXF3SIDHbits_t;
 
-extern volatile RXF3SIDHbits_t at 0xf0c RXF3SIDHbits;
+extern volatile __RXF3SIDHbits_t at 0xf0c RXF3SIDHbits;
 
 extern sfr at 0xf0d RXF3SIDL;
 typedef union {
@@ -235,9 +235,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF3SIDLbits_t;
+} __RXF3SIDLbits_t;
 
-extern volatile RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
+extern volatile __RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
 
 extern sfr at 0xf0e RXF3EIDH;
 typedef union {
@@ -251,9 +251,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF3EIDHbits_t;
+} __RXF3EIDHbits_t;
 
-extern volatile RXF3EIDHbits_t at 0xf0e RXF3EIDHbits;
+extern volatile __RXF3EIDHbits_t at 0xf0e RXF3EIDHbits;
 
 extern sfr at 0xf0f RXF3EIDL;
 typedef union {
@@ -267,9 +267,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF3EIDLbits_t;
+} __RXF3EIDLbits_t;
 
-extern volatile RXF3EIDLbits_t at 0xf0f RXF3EIDLbits;
+extern volatile __RXF3EIDLbits_t at 0xf0f RXF3EIDLbits;
 
 extern sfr at 0xf10 RXF4SIDH;
 typedef union {
@@ -283,9 +283,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF4SIDHbits_t;
+} __RXF4SIDHbits_t;
 
-extern volatile RXF4SIDHbits_t at 0xf10 RXF4SIDHbits;
+extern volatile __RXF4SIDHbits_t at 0xf10 RXF4SIDHbits;
 
 extern sfr at 0xf11 RXF4SIDL;
 typedef union {
@@ -299,9 +299,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF4SIDLbits_t;
+} __RXF4SIDLbits_t;
 
-extern volatile RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
+extern volatile __RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
 
 extern sfr at 0xf12 RXF4EIDH;
 typedef union {
@@ -315,9 +315,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF4EIDHbits_t;
+} __RXF4EIDHbits_t;
 
-extern volatile RXF4EIDHbits_t at 0xf12 RXF4EIDHbits;
+extern volatile __RXF4EIDHbits_t at 0xf12 RXF4EIDHbits;
 
 extern sfr at 0xf13 RXF4EIDL;
 typedef union {
@@ -331,9 +331,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF4EIDLbits_t;
+} __RXF4EIDLbits_t;
 
-extern volatile RXF4EIDLbits_t at 0xf13 RXF4EIDLbits;
+extern volatile __RXF4EIDLbits_t at 0xf13 RXF4EIDLbits;
 
 extern sfr at 0xf14 RXF5SIDH;
 typedef union {
@@ -347,9 +347,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF5SIDHbits_t;
+} __RXF5SIDHbits_t;
 
-extern volatile RXF5SIDHbits_t at 0xf14 RXF5SIDHbits;
+extern volatile __RXF5SIDHbits_t at 0xf14 RXF5SIDHbits;
 
 extern sfr at 0xf15 RXF5SIDL;
 typedef union {
@@ -363,9 +363,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF5SIDLbits_t;
+} __RXF5SIDLbits_t;
 
-extern volatile RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
+extern volatile __RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
 
 extern sfr at 0xf16 RXF5EIDH;
 typedef union {
@@ -379,9 +379,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF5EIDHbits_t;
+} __RXF5EIDHbits_t;
 
-extern volatile RXF5EIDHbits_t at 0xf16 RXF5EIDHbits;
+extern volatile __RXF5EIDHbits_t at 0xf16 RXF5EIDHbits;
 
 extern sfr at 0xf17 RXF5EIDL;
 typedef union {
@@ -395,9 +395,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF5EIDLbits_t;
+} __RXF5EIDLbits_t;
 
-extern volatile RXF5EIDLbits_t at 0xf17 RXF5EIDLbits;
+extern volatile __RXF5EIDLbits_t at 0xf17 RXF5EIDLbits;
 
 extern sfr at 0xf18 RXM0SIDH;
 typedef union {
@@ -411,9 +411,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXM0SIDHbits_t;
+} __RXM0SIDHbits_t;
 
-extern volatile RXM0SIDHbits_t at 0xf18 RXM0SIDHbits;
+extern volatile __RXM0SIDHbits_t at 0xf18 RXM0SIDHbits;
 
 extern sfr at 0xf19 RXM0SIDL;
 typedef union {
@@ -427,9 +427,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXM0SIDLbits_t;
+} __RXM0SIDLbits_t;
 
-extern volatile RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
+extern volatile __RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
 
 extern sfr at 0xf1a RXM0EIDH;
 typedef union {
@@ -443,9 +443,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXM0EIDHbits_t;
+} __RXM0EIDHbits_t;
 
-extern volatile RXM0EIDHbits_t at 0xf1a RXM0EIDHbits;
+extern volatile __RXM0EIDHbits_t at 0xf1a RXM0EIDHbits;
 
 extern sfr at 0xf1b RXM0EIDL;
 typedef union {
@@ -459,9 +459,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXM0EIDLbits_t;
+} __RXM0EIDLbits_t;
 
-extern volatile RXM0EIDLbits_t at 0xf1b RXM0EIDLbits;
+extern volatile __RXM0EIDLbits_t at 0xf1b RXM0EIDLbits;
 
 extern sfr at 0xf1c RXM1SIDH;
 typedef union {
@@ -475,9 +475,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXM1SIDHbits_t;
+} __RXM1SIDHbits_t;
 
-extern volatile RXM1SIDHbits_t at 0xf1c RXM1SIDHbits;
+extern volatile __RXM1SIDHbits_t at 0xf1c RXM1SIDHbits;
 
 extern sfr at 0xf1d RXM1SIDL;
 typedef union {
@@ -491,9 +491,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXM1SIDLbits_t;
+} __RXM1SIDLbits_t;
 
-extern volatile RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
+extern volatile __RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
 
 extern sfr at 0xf1e RXM1EIDH;
 typedef union {
@@ -507,9 +507,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXM1EIDHbits_t;
+} __RXM1EIDHbits_t;
 
-extern volatile RXM1EIDHbits_t at 0xf1e RXM1EIDHbits;
+extern volatile __RXM1EIDHbits_t at 0xf1e RXM1EIDHbits;
 
 extern sfr at 0xf1f RXM1EIDL;
 typedef union {
@@ -523,9 +523,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXM1EIDLbits_t;
+} __RXM1EIDLbits_t;
 
-extern volatile RXM1EIDLbits_t at 0xf1f RXM1EIDLbits;
+extern volatile __RXM1EIDLbits_t at 0xf1f RXM1EIDLbits;
 
 extern sfr at 0xf20 TXB2CON;
 typedef union {
@@ -539,9 +539,9 @@ typedef union {
                unsigned TXABT:1;
                unsigned :1;
        };
-} TXB2CONbits_t;
+} __TXB2CONbits_t;
 
-extern volatile TXB2CONbits_t at 0xf20 TXB2CONbits;
+extern volatile __TXB2CONbits_t at 0xf20 TXB2CONbits;
 
 extern sfr at 0xf21 TXB2SIDH;
 typedef union {
@@ -555,9 +555,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} TXB2SIDHbits_t;
+} __TXB2SIDHbits_t;
 
-extern volatile TXB2SIDHbits_t at 0xf21 TXB2SIDHbits;
+extern volatile __TXB2SIDHbits_t at 0xf21 TXB2SIDHbits;
 
 extern sfr at 0xf22 TXB2SIDL;
 typedef union {
@@ -571,9 +571,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} TXB2SIDLbits_t;
+} __TXB2SIDLbits_t;
 
-extern volatile TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
+extern volatile __TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
 
 extern sfr at 0xf23 TXB2EIDH;
 typedef union {
@@ -587,9 +587,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} TXB2EIDHbits_t;
+} __TXB2EIDHbits_t;
 
-extern volatile TXB2EIDHbits_t at 0xf23 TXB2EIDHbits;
+extern volatile __TXB2EIDHbits_t at 0xf23 TXB2EIDHbits;
 
 extern sfr at 0xf24 TXB2EIDL;
 typedef union {
@@ -603,9 +603,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} TXB2EIDLbits_t;
+} __TXB2EIDLbits_t;
 
-extern volatile TXB2EIDLbits_t at 0xf24 TXB2EIDLbits;
+extern volatile __TXB2EIDLbits_t at 0xf24 TXB2EIDLbits;
 
 extern sfr at 0xf25 TXB2DLC;
 typedef union {
@@ -619,9 +619,9 @@ typedef union {
                unsigned TXB2TXRTR:1;
                unsigned :1;
        };
-} TXB2DLCbits_t;
+} __TXB2DLCbits_t;
 
-extern volatile TXB2DLCbits_t at 0xf25 TXB2DLCbits;
+extern volatile __TXB2DLCbits_t at 0xf25 TXB2DLCbits;
 
 extern sfr at 0xf26 TXB2D0;
 typedef union {
@@ -635,9 +635,9 @@ typedef union {
                unsigned TXB2D06:1;
                unsigned TXB2D07:1;
        };
-} TXB2D0bits_t;
+} __TXB2D0bits_t;
 
-extern volatile TXB2D0bits_t at 0xf26 TXB2D0bits;
+extern volatile __TXB2D0bits_t at 0xf26 TXB2D0bits;
 
 extern sfr at 0xf27 TXB2D1;
 typedef union {
@@ -651,9 +651,9 @@ typedef union {
                unsigned TXB2D16:1;
                unsigned TXB2D17:1;
        };
-} TXB2D1bits_t;
+} __TXB2D1bits_t;
 
-extern volatile TXB2D1bits_t at 0xf27 TXB2D1bits;
+extern volatile __TXB2D1bits_t at 0xf27 TXB2D1bits;
 
 extern sfr at 0xf28 TXB2D2;
 typedef union {
@@ -667,9 +667,9 @@ typedef union {
                unsigned TXB2D26:1;
                unsigned TXB2D27:1;
        };
-} TXB2D2bits_t;
+} __TXB2D2bits_t;
 
-extern volatile TXB2D2bits_t at 0xf28 TXB2D2bits;
+extern volatile __TXB2D2bits_t at 0xf28 TXB2D2bits;
 
 extern sfr at 0xf29 TXB2D3;
 typedef union {
@@ -683,9 +683,9 @@ typedef union {
                unsigned TXB2D36:1;
                unsigned TXB2D37:1;
        };
-} TXB2D3bits_t;
+} __TXB2D3bits_t;
 
-extern volatile TXB2D3bits_t at 0xf29 TXB2D3bits;
+extern volatile __TXB2D3bits_t at 0xf29 TXB2D3bits;
 
 extern sfr at 0xf2a TXB2D4;
 typedef union {
@@ -699,9 +699,9 @@ typedef union {
                unsigned TXB2D46:1;
                unsigned TXB2D47:1;
        };
-} TXB2D4bits_t;
+} __TXB2D4bits_t;
 
-extern volatile TXB2D4bits_t at 0xf2a TXB2D4bits;
+extern volatile __TXB2D4bits_t at 0xf2a TXB2D4bits;
 
 extern sfr at 0xf2b TXB2D5;
 typedef union {
@@ -715,9 +715,9 @@ typedef union {
                unsigned TXB2D56:1;
                unsigned TXB2D57:1;
        };
-} TXB2D5bits_t;
+} __TXB2D5bits_t;
 
-extern volatile TXB2D5bits_t at 0xf2b TXB2D5bits;
+extern volatile __TXB2D5bits_t at 0xf2b TXB2D5bits;
 
 extern sfr at 0xf2c TXB2D6;
 typedef union {
@@ -731,9 +731,9 @@ typedef union {
                unsigned TXB2D66:1;
                unsigned TXB2D67:1;
        };
-} TXB2D6bits_t;
+} __TXB2D6bits_t;
 
-extern volatile TXB2D6bits_t at 0xf2c TXB2D6bits;
+extern volatile __TXB2D6bits_t at 0xf2c TXB2D6bits;
 
 extern sfr at 0xf2d TXB2D7;
 typedef union {
@@ -747,9 +747,9 @@ typedef union {
                unsigned TXB2D76:1;
                unsigned TXB2D77:1;
        };
-} TXB2D7bits_t;
+} __TXB2D7bits_t;
 
-extern volatile TXB2D7bits_t at 0xf2d TXB2D7bits;
+extern volatile __TXB2D7bits_t at 0xf2d TXB2D7bits;
 
 extern sfr at 0xf2e CANSTATRO4;
 typedef union {
@@ -763,9 +763,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO4bits_t;
+} __CANSTATRO4bits_t;
 
-extern volatile CANSTATRO4bits_t at 0xf2e CANSTATRO4bits;
+extern volatile __CANSTATRO4bits_t at 0xf2e CANSTATRO4bits;
 
 extern sfr at 0xf30 TXB1CON;
 typedef union {
@@ -779,9 +779,9 @@ typedef union {
                unsigned TXABT:1;
                unsigned :1;
        };
-} TXB1CONbits_t;
+} __TXB1CONbits_t;
 
-extern volatile TXB1CONbits_t at 0xf30 TXB1CONbits;
+extern volatile __TXB1CONbits_t at 0xf30 TXB1CONbits;
 
 extern sfr at 0xf31 TXB1SIDH;
 typedef union {
@@ -795,9 +795,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} TXB1SIDHbits_t;
+} __TXB1SIDHbits_t;
 
-extern volatile TXB1SIDHbits_t at 0xf31 TXB1SIDHbits;
+extern volatile __TXB1SIDHbits_t at 0xf31 TXB1SIDHbits;
 
 extern sfr at 0xf32 TXB1SIDL;
 typedef union {
@@ -811,9 +811,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} TXB1SIDLbits_t;
+} __TXB1SIDLbits_t;
 
-extern volatile TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
+extern volatile __TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
 
 extern sfr at 0xf33 TXB1EIDH;
 typedef union {
@@ -827,9 +827,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} TXB1EIDHbits_t;
+} __TXB1EIDHbits_t;
 
-extern volatile TXB1EIDHbits_t at 0xf33 TXB1EIDHbits;
+extern volatile __TXB1EIDHbits_t at 0xf33 TXB1EIDHbits;
 
 extern sfr at 0xf34 TXB1EIDL;
 typedef union {
@@ -843,9 +843,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} TXB1EIDLbits_t;
+} __TXB1EIDLbits_t;
 
-extern volatile TXB1EIDLbits_t at 0xf34 TXB1EIDLbits;
+extern volatile __TXB1EIDLbits_t at 0xf34 TXB1EIDLbits;
 
 extern sfr at 0xf35 TXB1DLC;
 typedef union {
@@ -859,9 +859,9 @@ typedef union {
                unsigned TXRTR:1;
                unsigned :1;
        };
-} TXB1DLCbits_t;
+} __TXB1DLCbits_t;
 
-extern volatile TXB1DLCbits_t at 0xf35 TXB1DLCbits;
+extern volatile __TXB1DLCbits_t at 0xf35 TXB1DLCbits;
 
 extern sfr at 0xf36 TXB1D0;
 typedef union {
@@ -875,9 +875,9 @@ typedef union {
                unsigned TXB1D06:1;
                unsigned TXB1D07:1;
        };
-} TXB1D0bits_t;
+} __TXB1D0bits_t;
 
-extern volatile TXB1D0bits_t at 0xf36 TXB1D0bits;
+extern volatile __TXB1D0bits_t at 0xf36 TXB1D0bits;
 
 extern sfr at 0xf37 TXB1D1;
 typedef union {
@@ -891,9 +891,9 @@ typedef union {
                unsigned TXB1D16:1;
                unsigned TXB1D17:1;
        };
-} TXB1D1bits_t;
+} __TXB1D1bits_t;
 
-extern volatile TXB1D1bits_t at 0xf37 TXB1D1bits;
+extern volatile __TXB1D1bits_t at 0xf37 TXB1D1bits;
 
 extern sfr at 0xf38 TXB1D2;
 typedef union {
@@ -907,9 +907,9 @@ typedef union {
                unsigned TXB1D26:1;
                unsigned TXB1D27:1;
        };
-} TXB1D2bits_t;
+} __TXB1D2bits_t;
 
-extern volatile TXB1D2bits_t at 0xf38 TXB1D2bits;
+extern volatile __TXB1D2bits_t at 0xf38 TXB1D2bits;
 
 extern sfr at 0xf39 TXB1D3;
 typedef union {
@@ -923,9 +923,9 @@ typedef union {
                unsigned TXB1D36:1;
                unsigned TXB1D37:1;
        };
-} TXB1D3bits_t;
+} __TXB1D3bits_t;
 
-extern volatile TXB1D3bits_t at 0xf39 TXB1D3bits;
+extern volatile __TXB1D3bits_t at 0xf39 TXB1D3bits;
 
 extern sfr at 0xf3a TXB1D4;
 typedef union {
@@ -939,9 +939,9 @@ typedef union {
                unsigned TXB1D46:1;
                unsigned TXB1D47:1;
        };
-} TXB1D4bits_t;
+} __TXB1D4bits_t;
 
-extern volatile TXB1D4bits_t at 0xf3a TXB1D4bits;
+extern volatile __TXB1D4bits_t at 0xf3a TXB1D4bits;
 
 extern sfr at 0xf3b TXB1D5;
 typedef union {
@@ -955,9 +955,9 @@ typedef union {
                unsigned TXB1D56:1;
                unsigned TXB1D57:1;
        };
-} TXB1D5bits_t;
+} __TXB1D5bits_t;
 
-extern volatile TXB1D5bits_t at 0xf3b TXB1D5bits;
+extern volatile __TXB1D5bits_t at 0xf3b TXB1D5bits;
 
 extern sfr at 0xf3c TXB1D6;
 typedef union {
@@ -971,9 +971,9 @@ typedef union {
                unsigned TXB1D66:1;
                unsigned TXB1D67:1;
        };
-} TXB1D6bits_t;
+} __TXB1D6bits_t;
 
-extern volatile TXB1D6bits_t at 0xf3c TXB1D6bits;
+extern volatile __TXB1D6bits_t at 0xf3c TXB1D6bits;
 
 extern sfr at 0xf3d TXB1D7;
 typedef union {
@@ -987,9 +987,9 @@ typedef union {
                unsigned TXB1D76:1;
                unsigned TXB1D77:1;
        };
-} TXB1D7bits_t;
+} __TXB1D7bits_t;
 
-extern volatile TXB1D7bits_t at 0xf3d TXB1D7bits;
+extern volatile __TXB1D7bits_t at 0xf3d TXB1D7bits;
 
 extern sfr at 0xf3e CANSTATRO3;
 typedef union {
@@ -1003,9 +1003,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO3bits_t;
+} __CANSTATRO3bits_t;
 
-extern volatile CANSTATRO3bits_t at 0xf3e CANSTATRO3bits;
+extern volatile __CANSTATRO3bits_t at 0xf3e CANSTATRO3bits;
 
 extern sfr at 0xf40 TXB0CON;
 typedef union {
@@ -1019,9 +1019,9 @@ typedef union {
                unsigned TXABT:1;
                unsigned :1;
        };
-} TXB0CONbits_t;
+} __TXB0CONbits_t;
 
-extern volatile TXB0CONbits_t at 0xf40 TXB0CONbits;
+extern volatile __TXB0CONbits_t at 0xf40 TXB0CONbits;
 
 extern sfr at 0xf41 TXB0SIDH;
 typedef union {
@@ -1035,9 +1035,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} TXB0SIDHbits_t;
+} __TXB0SIDHbits_t;
 
-extern volatile TXB0SIDHbits_t at 0xf41 TXB0SIDHbits;
+extern volatile __TXB0SIDHbits_t at 0xf41 TXB0SIDHbits;
 
 extern sfr at 0xf42 TXB0SIDL;
 typedef union {
@@ -1051,9 +1051,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} TXB0SIDLbits_t;
+} __TXB0SIDLbits_t;
 
-extern volatile TXB0SIDLbits_t at 0xf42 TXB0SIDLbits;
+extern volatile __TXB0SIDLbits_t at 0xf42 TXB0SIDLbits;
 
 extern sfr at 0xf43 TXB0EIDH;
 typedef union {
@@ -1067,9 +1067,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} TXB0EIDHbits_t;
+} __TXB0EIDHbits_t;
 
-extern volatile TXB0EIDHbits_t at 0xf43 TXB0EIDHbits;
+extern volatile __TXB0EIDHbits_t at 0xf43 TXB0EIDHbits;
 
 extern sfr at 0xf44 TXB0EIDL;
 typedef union {
@@ -1083,9 +1083,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} TXB0EIDLbits_t;
+} __TXB0EIDLbits_t;
 
-extern volatile TXB0EIDLbits_t at 0xf44 TXB0EIDLbits;
+extern volatile __TXB0EIDLbits_t at 0xf44 TXB0EIDLbits;
 
 extern sfr at 0xf45 TXB0DLC;
 typedef union {
@@ -1099,9 +1099,9 @@ typedef union {
                unsigned TXRTR:1;
                unsigned :1;
        };
-} TXB0DLCbits_t;
+} __TXB0DLCbits_t;
 
-extern volatile TXB0DLCbits_t at 0xf45 TXB0DLCbits;
+extern volatile __TXB0DLCbits_t at 0xf45 TXB0DLCbits;
 
 extern sfr at 0xf46 TXB0D0;
 typedef union {
@@ -1115,9 +1115,9 @@ typedef union {
                unsigned TXB0D06:1;
                unsigned TXB0D07:1;
        };
-} TXB0D0bits_t;
+} __TXB0D0bits_t;
 
-extern volatile TXB0D0bits_t at 0xf46 TXB0D0bits;
+extern volatile __TXB0D0bits_t at 0xf46 TXB0D0bits;
 
 extern sfr at 0xf47 TXB0D1;
 typedef union {
@@ -1131,9 +1131,9 @@ typedef union {
                unsigned TXB0D16:1;
                unsigned TXB0D17:1;
        };
-} TXB0D1bits_t;
+} __TXB0D1bits_t;
 
-extern volatile TXB0D1bits_t at 0xf47 TXB0D1bits;
+extern volatile __TXB0D1bits_t at 0xf47 TXB0D1bits;
 
 extern sfr at 0xf48 TXB0D2;
 typedef union {
@@ -1147,9 +1147,9 @@ typedef union {
                unsigned TXB0D26:1;
                unsigned TXB0D27:1;
        };
-} TXB0D2bits_t;
+} __TXB0D2bits_t;
 
-extern volatile TXB0D2bits_t at 0xf48 TXB0D2bits;
+extern volatile __TXB0D2bits_t at 0xf48 TXB0D2bits;
 
 extern sfr at 0xf49 TXB0D3;
 typedef union {
@@ -1163,9 +1163,9 @@ typedef union {
                unsigned TXBD0D36:1;
                unsigned TXB0D37:1;
        };
-} TXB0D3bits_t;
+} __TXB0D3bits_t;
 
-extern volatile TXB0D3bits_t at 0xf49 TXB0D3bits;
+extern volatile __TXB0D3bits_t at 0xf49 TXB0D3bits;
 
 extern sfr at 0xf4a TXB0D4;
 typedef union {
@@ -1179,9 +1179,9 @@ typedef union {
                unsigned TXB0D46:1;
                unsigned TXB0D47:1;
        };
-} TXB0D4bits_t;
+} __TXB0D4bits_t;
 
-extern volatile TXB0D4bits_t at 0xf4a TXB0D4bits;
+extern volatile __TXB0D4bits_t at 0xf4a TXB0D4bits;
 
 extern sfr at 0xf4b TXB0D5;
 typedef union {
@@ -1195,9 +1195,9 @@ typedef union {
                unsigned TXB0D56:1;
                unsigned TXB0D57:1;
        };
-} TXB0D5bits_t;
+} __TXB0D5bits_t;
 
-extern volatile TXB0D5bits_t at 0xf4b TXB0D5bits;
+extern volatile __TXB0D5bits_t at 0xf4b TXB0D5bits;
 
 extern sfr at 0xf4c TXB0D6;
 typedef union {
@@ -1211,9 +1211,9 @@ typedef union {
                unsigned TXB0D66:1;
                unsigned TXB0D67:1;
        };
-} TXB0D6bits_t;
+} __TXB0D6bits_t;
 
-extern volatile TXB0D6bits_t at 0xf4c TXB0D6bits;
+extern volatile __TXB0D6bits_t at 0xf4c TXB0D6bits;
 
 extern sfr at 0xf4d TXB0D7;
 typedef union {
@@ -1227,9 +1227,9 @@ typedef union {
                unsigned TXB0D76:1;
                unsigned TXB0D77:1;
        };
-} TXB0D7bits_t;
+} __TXB0D7bits_t;
 
-extern volatile TXB0D7bits_t at 0xf4d TXB0D7bits;
+extern volatile __TXB0D7bits_t at 0xf4d TXB0D7bits;
 
 extern sfr at 0xf4e CANSTATRO2;
 typedef union {
@@ -1243,9 +1243,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO2bits_t;
+} __CANSTATRO2bits_t;
 
-extern volatile CANSTATRO2bits_t at 0xf4e CANSTATRO2bits;
+extern volatile __CANSTATRO2bits_t at 0xf4e CANSTATRO2bits;
 
 extern sfr at 0xf50 RXB1CON;
 typedef union {
@@ -1259,9 +1259,9 @@ typedef union {
                unsigned RXM1:1;
                unsigned RXFUL:1;
        };
-} RXB1CONbits_t;
+} __RXB1CONbits_t;
 
-extern volatile RXB1CONbits_t at 0xf50 RXB1CONbits;
+extern volatile __RXB1CONbits_t at 0xf50 RXB1CONbits;
 
 extern sfr at 0xf51 RXB1SIDH;
 typedef union {
@@ -1275,9 +1275,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXB1SIDHbits_t;
+} __RXB1SIDHbits_t;
 
-extern volatile RXB1SIDHbits_t at 0xf51 RXB1SIDHbits;
+extern volatile __RXB1SIDHbits_t at 0xf51 RXB1SIDHbits;
 
 extern sfr at 0xf52 RXB1SIDL;
 typedef union {
@@ -1291,9 +1291,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXB1SIDLbits_t;
+} __RXB1SIDLbits_t;
 
-extern volatile RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
+extern volatile __RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
 
 extern sfr at 0xf53 RXB1EIDH;
 typedef union {
@@ -1307,9 +1307,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXB1EIDHbits_t;
+} __RXB1EIDHbits_t;
 
-extern volatile RXB1EIDHbits_t at 0xf53 RXB1EIDHbits;
+extern volatile __RXB1EIDHbits_t at 0xf53 RXB1EIDHbits;
 
 extern sfr at 0xf54 RXB1EIDL;
 typedef union {
@@ -1323,9 +1323,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXB1EIDLbits_t;
+} __RXB1EIDLbits_t;
 
-extern volatile RXB1EIDLbits_t at 0xf54 RXB1EIDLbits;
+extern volatile __RXB1EIDLbits_t at 0xf54 RXB1EIDLbits;
 
 extern sfr at 0xf55 RXB1DLC;
 typedef union {
@@ -1339,9 +1339,9 @@ typedef union {
                unsigned RXRTR:1;
                unsigned :1;
        };
-} RXB1DLCbits_t;
+} __RXB1DLCbits_t;
 
-extern volatile RXB1DLCbits_t at 0xf55 RXB1DLCbits;
+extern volatile __RXB1DLCbits_t at 0xf55 RXB1DLCbits;
 
 extern sfr at 0xf56 RXB1D0;
 typedef union {
@@ -1355,9 +1355,9 @@ typedef union {
                unsigned RXB1D06:1;
                unsigned RXB1D07:1;
        };
-} RXB1D0bits_t;
+} __RXB1D0bits_t;
 
-extern volatile RXB1D0bits_t at 0xf56 RXB1D0bits;
+extern volatile __RXB1D0bits_t at 0xf56 RXB1D0bits;
 
 extern sfr at 0xf57 RXB1D1;
 typedef union {
@@ -1371,9 +1371,9 @@ typedef union {
                unsigned RXB1D16:1;
                unsigned RXB1D17:1;
        };
-} RXB1D1bits_t;
+} __RXB1D1bits_t;
 
-extern volatile RXB1D1bits_t at 0xf57 RXB1D1bits;
+extern volatile __RXB1D1bits_t at 0xf57 RXB1D1bits;
 
 extern sfr at 0xf58 RXB1D2;
 typedef union {
@@ -1387,9 +1387,9 @@ typedef union {
                unsigned RXB1D26:1;
                unsigned RXB1D27:1;
        };
-} RXB1D2bits_t;
+} __RXB1D2bits_t;
 
-extern volatile RXB1D2bits_t at 0xf58 RXB1D2bits;
+extern volatile __RXB1D2bits_t at 0xf58 RXB1D2bits;
 
 extern sfr at 0xf59 RXB1D3;
 typedef union {
@@ -1403,9 +1403,9 @@ typedef union {
                unsigned RXB1D36:1;
                unsigned RXB1D37:1;
        };
-} RXB1D3bits_t;
+} __RXB1D3bits_t;
 
-extern volatile RXB1D3bits_t at 0xf59 RXB1D3bits;
+extern volatile __RXB1D3bits_t at 0xf59 RXB1D3bits;
 
 extern sfr at 0xf5a RXB1D4;
 typedef union {
@@ -1419,9 +1419,9 @@ typedef union {
                unsigned RXB1D46:1;
                unsigned RXB1D47:1;
        };
-} RXB1D4bits_t;
+} __RXB1D4bits_t;
 
-extern volatile RXB1D4bits_t at 0xf5a RXB1D4bits;
+extern volatile __RXB1D4bits_t at 0xf5a RXB1D4bits;
 
 extern sfr at 0xf5b RXB1D5;
 typedef union {
@@ -1435,9 +1435,9 @@ typedef union {
                unsigned RXB1D56:1;
                unsigned RXB1D57:1;
        };
-} RXB1D5bits_t;
+} __RXB1D5bits_t;
 
-extern volatile RXB1D5bits_t at 0xf5b RXB1D5bits;
+extern volatile __RXB1D5bits_t at 0xf5b RXB1D5bits;
 
 extern sfr at 0xf5c RXB1D6;
 typedef union {
@@ -1451,9 +1451,9 @@ typedef union {
                unsigned RXB1D66:1;
                unsigned RXB1D67:1;
        };
-} RXB1D6bits_t;
+} __RXB1D6bits_t;
 
-extern volatile RXB1D6bits_t at 0xf5c RXB1D6bits;
+extern volatile __RXB1D6bits_t at 0xf5c RXB1D6bits;
 
 extern sfr at 0xf5d RXB1D7;
 typedef union {
@@ -1467,9 +1467,9 @@ typedef union {
                unsigned RXB1D76:1;
                unsigned RXB1D77:1;
        };
-} RXB1D7bits_t;
+} __RXB1D7bits_t;
 
-extern volatile RXB1D7bits_t at 0xf5d RXB1D7bits;
+extern volatile __RXB1D7bits_t at 0xf5d RXB1D7bits;
 
 extern sfr at 0xf5e CANSTATRO1;
 typedef union {
@@ -1483,9 +1483,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO1bits_t;
+} __CANSTATRO1bits_t;
 
-extern volatile CANSTATRO1bits_t at 0xf5e CANSTATRO1bits;
+extern volatile __CANSTATRO1bits_t at 0xf5e CANSTATRO1bits;
 
 extern sfr at 0xf60 RXB0CON;
 typedef union {
@@ -1499,9 +1499,9 @@ typedef union {
                unsigned RXM1:1;
                unsigned RXFUL:1;
        };
-} RXB0CONbits_t;
+} __RXB0CONbits_t;
 
-extern volatile RXB0CONbits_t at 0xf60 RXB0CONbits;
+extern volatile __RXB0CONbits_t at 0xf60 RXB0CONbits;
 
 extern sfr at 0xf61 RXB0SIDH;
 typedef union {
@@ -1515,9 +1515,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXB0SIDHbits_t;
+} __RXB0SIDHbits_t;
 
-extern volatile RXB0SIDHbits_t at 0xf61 RXB0SIDHbits;
+extern volatile __RXB0SIDHbits_t at 0xf61 RXB0SIDHbits;
 
 extern sfr at 0xf62 RXB0SIDL;
 typedef union {
@@ -1531,9 +1531,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXB0SIDLbits_t;
+} __RXB0SIDLbits_t;
 
-extern volatile RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
+extern volatile __RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
 
 extern sfr at 0xf63 RXB0EIDH;
 typedef union {
@@ -1547,9 +1547,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXB0EIDHbits_t;
+} __RXB0EIDHbits_t;
 
-extern volatile RXB0EIDHbits_t at 0xf63 RXB0EIDHbits;
+extern volatile __RXB0EIDHbits_t at 0xf63 RXB0EIDHbits;
 
 extern sfr at 0xf64 RXB0EIDL;
 typedef union {
@@ -1563,9 +1563,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXB0EIDLbits_t;
+} __RXB0EIDLbits_t;
 
-extern volatile RXB0EIDLbits_t at 0xf64 RXB0EIDLbits;
+extern volatile __RXB0EIDLbits_t at 0xf64 RXB0EIDLbits;
 
 extern sfr at 0xf65 RXB0DLC;
 typedef union {
@@ -1579,9 +1579,9 @@ typedef union {
                unsigned RTR:1;
                unsigned :1;
        };
-} RXB0DLCbits_t;
+} __RXB0DLCbits_t;
 
-extern volatile RXB0DLCbits_t at 0xf65 RXB0DLCbits;
+extern volatile __RXB0DLCbits_t at 0xf65 RXB0DLCbits;
 
 extern sfr at 0xf66 RXB0D0;
 extern sfr at 0xf67 RXB0D1;
@@ -1603,9 +1603,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATbits_t;
+} __CANSTATbits_t;
 
-extern volatile CANSTATbits_t at 0xf6e CANSTATbits;
+extern volatile __CANSTATbits_t at 0xf6e CANSTATbits;
 
 extern sfr at 0xf6f CANCON;
 typedef union {
@@ -1619,9 +1619,9 @@ typedef union {
                unsigned REQOP1:1;
                unsigned REQOP2:1;
        };
-} CANCONbits_t;
+} __CANCONbits_t;
 
-extern volatile CANCONbits_t at 0xf6f CANCONbits;
+extern volatile __CANCONbits_t at 0xf6f CANCONbits;
 
 extern sfr at 0xf70 BRGCON1;
 typedef union {
@@ -1635,9 +1635,9 @@ typedef union {
                unsigned SJW0:1;
                unsigned SJW1:1;
        };
-} BRGCON1bits_t;
+} __BRGCON1bits_t;
 
-extern volatile BRGCON1bits_t at 0xf70 BRGCON1bits;
+extern volatile __BRGCON1bits_t at 0xf70 BRGCON1bits;
 
 extern sfr at 0xf71 BRGCON2;
 typedef union {
@@ -1651,9 +1651,9 @@ typedef union {
                unsigned SAM:1;
                unsigned SEG2PHTS:1;
        };
-} BRGCON2bits_t;
+} __BRGCON2bits_t;
 
-extern volatile BRGCON2bits_t at 0xf71 BRGCON2bits;
+extern volatile __BRGCON2bits_t at 0xf71 BRGCON2bits;
 
 extern sfr at 0xf72 BRGCON3;
 typedef union {
@@ -1667,9 +1667,9 @@ typedef union {
                unsigned WAKFIL:1;
                unsigned :1;
        };
-} BRGCON3bits_t;
+} __BRGCON3bits_t;
 
-extern volatile BRGCON3bits_t at 0xf72 BRGCON3bits;
+extern volatile __BRGCON3bits_t at 0xf72 BRGCON3bits;
 
 extern sfr at 0xf73 CIOCON;
 typedef union {
@@ -1683,9 +1683,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CIOCONbits_t;
+} __CIOCONbits_t;
 
-extern volatile CIOCONbits_t at 0xf73 CIOCONbits;
+extern volatile __CIOCONbits_t at 0xf73 CIOCONbits;
 
 extern sfr at 0xf74 COMSTAT;
 typedef union {
@@ -1699,9 +1699,9 @@ typedef union {
                unsigned RXB1OVFL:1;
                unsigned RXB0OVFL:1;
        };
-} COMSTATbits_t;
+} __COMSTATbits_t;
 
-extern volatile COMSTATbits_t at 0xf74 COMSTATbits;
+extern volatile __COMSTATbits_t at 0xf74 COMSTATbits;
 
 extern sfr at 0xf75 RXERRCNT;
 typedef union {
@@ -1715,9 +1715,9 @@ typedef union {
                unsigned REC6:1;
                unsigned REC7:1;
        };
-} RXERRCNTbits_t;
+} __RXERRCNTbits_t;
 
-extern volatile RXERRCNTbits_t at 0xf75 RXERRCNTbits;
+extern volatile __RXERRCNTbits_t at 0xf75 RXERRCNTbits;
 
 extern sfr at 0xf76 TXERRCNT;
 typedef union {
@@ -1731,9 +1731,9 @@ typedef union {
                unsigned TEC6:1;
                unsigned TEC7:1;
        };
-} TXERRCNTbits_t;
+} __TXERRCNTbits_t;
 
-extern volatile TXERRCNTbits_t at 0xf76 TXERRCNTbits;
+extern volatile __TXERRCNTbits_t at 0xf76 TXERRCNTbits;
 
 extern sfr at 0xf80 PORTA;
 typedef union {
@@ -1780,9 +1780,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTAbits_t;
+} __PORTAbits_t;
 
-extern volatile PORTAbits_t at 0xf80 PORTAbits;
+extern volatile __PORTAbits_t at 0xf80 PORTAbits;
 
 extern sfr at 0xf81 PORTB;
 typedef union {
@@ -1807,9 +1807,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTBbits_t;
+} __PORTBbits_t;
 
-extern volatile PORTBbits_t at 0xf81 PORTBbits;
+extern volatile __PORTBbits_t at 0xf81 PORTBbits;
 
 extern sfr at 0xf82 PORTC;
 typedef union {
@@ -1845,9 +1845,9 @@ typedef union {
                unsigned CK:1;
                unsigned DT:1;
        };
-} PORTCbits_t;
+} __PORTCbits_t;
 
-extern volatile PORTCbits_t at 0xf82 PORTCbits;
+extern volatile __PORTCbits_t at 0xf82 PORTCbits;
 
 extern sfr at 0xf83 PORTD;
 typedef union {
@@ -1872,9 +1872,9 @@ typedef union {
                unsigned AD6:1;
                unsigned AD7:1;
        };
-} PORTDbits_t;
+} __PORTDbits_t;
 
-extern volatile PORTDbits_t at 0xf83 PORTDbits;
+extern volatile __PORTDbits_t at 0xf83 PORTDbits;
 
 extern sfr at 0xf84 PORTE;
 typedef union {
@@ -1910,9 +1910,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTEbits_t;
+} __PORTEbits_t;
 
-extern volatile PORTEbits_t at 0xf84 PORTEbits;
+extern volatile __PORTEbits_t at 0xf84 PORTEbits;
 
 extern sfr at 0xf89 LATA;
 typedef union {
@@ -1926,9 +1926,9 @@ typedef union {
                unsigned LATA6:1;
                unsigned :1;
        };
-} LATAbits_t;
+} __LATAbits_t;
 
-extern volatile LATAbits_t at 0xf89 LATAbits;
+extern volatile __LATAbits_t at 0xf89 LATAbits;
 
 extern sfr at 0xf8a LATB;
 typedef union {
@@ -1942,9 +1942,9 @@ typedef union {
                unsigned LATB6:1;
                unsigned LATB7:1;
        };
-} LATBbits_t;
+} __LATBbits_t;
 
-extern volatile LATBbits_t at 0xf8a LATBbits;
+extern volatile __LATBbits_t at 0xf8a LATBbits;
 
 extern sfr at 0xf8b LATC;
 typedef union {
@@ -1958,9 +1958,9 @@ typedef union {
                unsigned LATC6:1;
                unsigned LATC7:1;
        };
-} LATCbits_t;
+} __LATCbits_t;
 
-extern volatile LATCbits_t at 0xf8b LATCbits;
+extern volatile __LATCbits_t at 0xf8b LATCbits;
 
 extern sfr at 0xf8c LATD;
 typedef union {
@@ -1974,9 +1974,9 @@ typedef union {
                unsigned LATD6:1;
                unsigned LATD7:1;
        };
-} LATDbits_t;
+} __LATDbits_t;
 
-extern volatile LATDbits_t at 0xf8c LATDbits;
+extern volatile __LATDbits_t at 0xf8c LATDbits;
 
 extern sfr at 0xf8d LATE;
 typedef union {
@@ -1990,9 +1990,9 @@ typedef union {
                unsigned LATE6:1;
                unsigned LATE7:1;
        };
-} LATEbits_t;
+} __LATEbits_t;
 
-extern volatile LATEbits_t at 0xf8d LATEbits;
+extern volatile __LATEbits_t at 0xf8d LATEbits;
 
 extern sfr at 0xf92 TRISA;
 typedef union {
@@ -2006,9 +2006,9 @@ typedef union {
                unsigned TRISA6:1;
                unsigned :1;
        };
-} TRISAbits_t;
+} __TRISAbits_t;
 
-extern volatile TRISAbits_t at 0xf92 TRISAbits;
+extern volatile __TRISAbits_t at 0xf92 TRISAbits;
 
 extern sfr at 0xf93 TRISB;
 typedef union {
@@ -2022,9 +2022,9 @@ typedef union {
                unsigned TRISB6:1;
                unsigned TRISB7:1;
        };
-} TRISBbits_t;
+} __TRISBbits_t;
 
-extern volatile TRISBbits_t at 0xf93 TRISBbits;
+extern volatile __TRISBbits_t at 0xf93 TRISBbits;
 
 extern sfr at 0xf94 TRISC;
 typedef union {
@@ -2038,9 +2038,9 @@ typedef union {
                unsigned TRISC6:1;
                unsigned TRISC7:1;
        };
-} TRISCbits_t;
+} __TRISCbits_t;
 
-extern volatile TRISCbits_t at 0xf94 TRISCbits;
+extern volatile __TRISCbits_t at 0xf94 TRISCbits;
 
 extern sfr at 0xf95 TRISD;
 typedef union {
@@ -2054,9 +2054,9 @@ typedef union {
                unsigned TRISD6:1;
                unsigned TRISD7:1;
        };
-} TRISDbits_t;
+} __TRISDbits_t;
 
-extern volatile TRISDbits_t at 0xf95 TRISDbits;
+extern volatile __TRISDbits_t at 0xf95 TRISDbits;
 
 extern sfr at 0xf96 TRISE;
 typedef union {
@@ -2070,9 +2070,9 @@ typedef union {
                unsigned OBF:1;
                unsigned IBF:1;
        };
-} TRISEbits_t;
+} __TRISEbits_t;
 
-extern volatile TRISEbits_t at 0xf96 TRISEbits;
+extern volatile __TRISEbits_t at 0xf96 TRISEbits;
 
 extern sfr at 0xf9d PIE1;
 typedef union {
@@ -2086,9 +2086,9 @@ typedef union {
                unsigned ADIE:1;
                unsigned PSPIE:1;
        };
-} PIE1bits_t;
+} __PIE1bits_t;
 
-extern volatile PIE1bits_t at 0xf9d PIE1bits;
+extern volatile __PIE1bits_t at 0xf9d PIE1bits;
 
 extern sfr at 0xf9e PIR1;
 typedef union {
@@ -2102,9 +2102,9 @@ typedef union {
                unsigned ADIF:1;
                unsigned PSPIF:1;
        };
-} PIR1bits_t;
+} __PIR1bits_t;
 
-extern volatile PIR1bits_t at 0xf9e PIR1bits;
+extern volatile __PIR1bits_t at 0xf9e PIR1bits;
 
 extern sfr at 0xf9f IPR1;
 typedef union {
@@ -2118,9 +2118,9 @@ typedef union {
                unsigned ADIP:1;
                unsigned PSPIP:1;
        };
-} IPR1bits_t;
+} __IPR1bits_t;
 
-extern volatile IPR1bits_t at 0xf9f IPR1bits;
+extern volatile __IPR1bits_t at 0xf9f IPR1bits;
 
 extern sfr at 0xfa0 PIE2;
 typedef union {
@@ -2134,9 +2134,9 @@ typedef union {
                unsigned CMIE:1;
                unsigned :1;
        };
-} PIE2bits_t;
+} __PIE2bits_t;
 
-extern volatile PIE2bits_t at 0xfa0 PIE2bits;
+extern volatile __PIE2bits_t at 0xfa0 PIE2bits;
 
 extern sfr at 0xfa1 PIR2;
 typedef union {
@@ -2150,9 +2150,9 @@ typedef union {
                unsigned CMIF:1;
                unsigned :1;
        };
-} PIR2bits_t;
+} __PIR2bits_t;
 
-extern volatile PIR2bits_t at 0xfa1 PIR2bits;
+extern volatile __PIR2bits_t at 0xfa1 PIR2bits;
 
 extern sfr at 0xfa2 IPR2;
 typedef union {
@@ -2166,9 +2166,9 @@ typedef union {
                unsigned CMIP:1;
                unsigned :1;
        };
-} IPR2bits_t;
+} __IPR2bits_t;
 
-extern volatile IPR2bits_t at 0xfa2 IPR2bits;
+extern volatile __IPR2bits_t at 0xfa2 IPR2bits;
 
 extern sfr at 0xfa3 PIE3;
 typedef union {
@@ -2182,9 +2182,9 @@ typedef union {
                unsigned WAKIE:1;
                unsigned IVRE:1;
        };
-} PIE3bits_t;
+} __PIE3bits_t;
 
-extern volatile PIE3bits_t at 0xfa3 PIE3bits;
+extern volatile __PIE3bits_t at 0xfa3 PIE3bits;
 
 extern sfr at 0xfa4 PIR3;
 typedef union {
@@ -2198,9 +2198,9 @@ typedef union {
                unsigned WAKIF:1;
                unsigned IVRF:1;
        };
-} PIR3bits_t;
+} __PIR3bits_t;
 
-extern volatile PIR3bits_t at 0xfa4 PIR3bits;
+extern volatile __PIR3bits_t at 0xfa4 PIR3bits;
 
 extern sfr at 0xfa5 IPR3;
 typedef union {
@@ -2214,9 +2214,9 @@ typedef union {
                unsigned WAKIP:1;
                unsigned IVRP:1;
        };
-} IPR3bits_t;
+} __IPR3bits_t;
 
-extern volatile IPR3bits_t at 0xfa5 IPR3bits;
+extern volatile __IPR3bits_t at 0xfa5 IPR3bits;
 
 extern sfr at 0xfa6 EECON1;
 typedef union {
@@ -2230,9 +2230,9 @@ typedef union {
                unsigned CFGS:1;
                unsigned EEPGD:1;
        };
-} EECON1bits_t;
+} __EECON1bits_t;
 
-extern volatile EECON1bits_t at 0xfa6 EECON1bits;
+extern volatile __EECON1bits_t at 0xfa6 EECON1bits;
 
 extern sfr at 0xfa7 EECON2;
 extern sfr at 0xfa8 EEDATA;
@@ -2249,9 +2249,9 @@ typedef union {
                unsigned RX9:1;
                unsigned SPEN:1;
        };
-} RCSTAbits_t;
+} __RCSTAbits_t;
 
-extern volatile RCSTAbits_t at 0xfab RCSTAbits;
+extern volatile __RCSTAbits_t at 0xfab RCSTAbits;
 
 extern sfr at 0xfac TXSTA;
 typedef union {
@@ -2265,9 +2265,9 @@ typedef union {
                unsigned TX9:1;
                unsigned CSRC:1;
        };
-} TXSTAbits_t;
+} __TXSTAbits_t;
 
-extern volatile TXSTAbits_t at 0xfac TXSTAbits;
+extern volatile __TXSTAbits_t at 0xfac TXSTAbits;
 
 extern sfr at 0xfad TXREG;
 extern sfr at 0xfae RCREG;
@@ -2284,9 +2284,9 @@ typedef union {
                unsigned OBF:1;
                unsigned IBF:1;
        };
-} PSPCONbits_t;
+} __PSPCONbits_t;
 
-extern volatile PSPCONbits_t at 0xfb0 PSPCONbits;
+extern volatile __PSPCONbits_t at 0xfb0 PSPCONbits;
 
 extern sfr at 0xfb1 T3CON;
 typedef union {
@@ -2300,9 +2300,9 @@ typedef union {
                unsigned T3CCP2:1;
                unsigned RD16:1;
        };
-} T3CONbits_t;
+} __T3CONbits_t;
 
-extern volatile T3CONbits_t at 0xfb1 T3CONbits;
+extern volatile __T3CONbits_t at 0xfb1 T3CONbits;
 
 extern sfr at 0xfb2 TMR3L;
 extern sfr at 0xfb3 TMR3H;
@@ -2318,9 +2318,9 @@ typedef union {
                unsigned C1OUT:1;
                unsigned C2OUT:1;
        };
-} CMCONbits_t;
+} __CMCONbits_t;
 
-extern volatile CMCONbits_t at 0xfb4 CMCONbits;
+extern volatile __CMCONbits_t at 0xfb4 CMCONbits;
 
 extern sfr at 0xfb5 CVRCON;
 typedef union {
@@ -2334,9 +2334,9 @@ typedef union {
                unsigned CVROE:1;
                unsigned CVREN:1;
        };
-} CVRCONbits_t;
+} __CVRCONbits_t;
 
-extern volatile CVRCONbits_t at 0xfb5 CVRCONbits;
+extern volatile __CVRCONbits_t at 0xfb5 CVRCONbits;
 
 extern sfr at 0xfb6 ECCPAS;
 typedef union {
@@ -2350,9 +2350,9 @@ typedef union {
                unsigned ECCPAS2:1;
                unsigned ECCPASE:1;
        };
-} ECCPASbits_t;
+} __ECCPASbits_t;
 
-extern volatile ECCPASbits_t at 0xfb6 ECCPASbits;
+extern volatile __ECCPASbits_t at 0xfb6 ECCPASbits;
 
 extern sfr at 0xfb7 ECCP1DEL;
 typedef union {
@@ -2366,9 +2366,9 @@ typedef union {
                unsigned EPDC6:1;
                unsigned EPDC7:1;
        };
-} ECCP1DELbits_t;
+} __ECCP1DELbits_t;
 
-extern volatile ECCP1DELbits_t at 0xfb7 ECCP1DELbits;
+extern volatile __ECCP1DELbits_t at 0xfb7 ECCP1DELbits;
 
 extern sfr at 0xfba ECCP1CON;
 typedef union {
@@ -2382,9 +2382,9 @@ typedef union {
                unsigned EPWM1M0:1;
                unsigned EPWM1M1:1;
        };
-} ECCP1CONbits_t;
+} __ECCP1CONbits_t;
 
-extern volatile ECCP1CONbits_t at 0xfba ECCP1CONbits;
+extern volatile __ECCP1CONbits_t at 0xfba ECCP1CONbits;
 
 extern sfr at 0xfbb ECCPR1L;
 extern sfr at 0xfbc ECCPR1H;
@@ -2400,9 +2400,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CCP1CONbits_t;
+} __CCP1CONbits_t;
 
-extern volatile CCP1CONbits_t at 0xfbd CCP1CONbits;
+extern volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
 
 extern sfr at 0xfbe CCPR1L;
 extern sfr at 0xfbf CCPR1H;
@@ -2418,9 +2418,9 @@ typedef union {
                unsigned ADCS2:1;
                unsigned ADFM:1;
        };
-} ADCON1bits_t;
+} __ADCON1bits_t;
 
-extern volatile ADCON1bits_t at 0xfc1 ADCON1bits;
+extern volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
 
 extern sfr at 0xfc2 ADCON0;
 typedef union {
@@ -2434,9 +2434,9 @@ typedef union {
                unsigned ADCS0:1;
                unsigned ADCS1:1;
        };
-} ADCON0bits_t;
+} __ADCON0bits_t;
 
-extern volatile ADCON0bits_t at 0xfc2 ADCON0bits;
+extern volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
 
 extern sfr at 0xfc3 ADRESL;
 extern sfr at 0xfc4 ADRESH;
@@ -2452,9 +2452,9 @@ typedef union {
                unsigned ACKSTAT:1;
                unsigned GCEN:1;
        };
-} SSPCON2bits_t;
+} __SSPCON2bits_t;
 
-extern volatile SSPCON2bits_t at 0xfc5 SSPCON2bits;
+extern volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
 
 extern sfr at 0xfc6 SSPCON1;
 typedef union {
@@ -2468,9 +2468,9 @@ typedef union {
                unsigned SSPOV:1;
                unsigned WCOL:1;
        };
-} SSPCON1bits_t;
+} __SSPCON1bits_t;
 
-extern volatile SSPCON1bits_t at 0xfc6 SSPCON1bits;
+extern volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
 
 extern sfr at 0xfc7 SSPSTAT;
 typedef union {
@@ -2484,9 +2484,9 @@ typedef union {
                unsigned CKE:1;
                unsigned SMP:1;
        };
-} SSPSTATbits_t;
+} __SSPSTATbits_t;
 
-extern volatile SSPSTATbits_t at 0xfc7 SSPSTATbits;
+extern volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
 
 extern sfr at 0xfc8 SSPADD;
 extern sfr at 0xfc9 SSPBUF;
@@ -2502,9 +2502,9 @@ typedef union {
                unsigned TOUTPS3:1;
                unsigned :1;
        };
-} T2CONbits_t;
+} __T2CONbits_t;
 
-extern volatile T2CONbits_t at 0xfca T2CONbits;
+extern volatile __T2CONbits_t at 0xfca T2CONbits;
 
 extern sfr at 0xfcb PR2;
 extern sfr at 0xfcc TMR2;
@@ -2520,9 +2520,9 @@ typedef union {
                unsigned :1;
                unsigned RD16:1;
        };
-} T1CONbits_t;
+} __T1CONbits_t;
 
-extern volatile T1CONbits_t at 0xfcd T1CONbits;
+extern volatile __T1CONbits_t at 0xfcd T1CONbits;
 
 extern sfr at 0xfce TMR1L;
 extern sfr at 0xfcf TMR1H;
@@ -2538,9 +2538,9 @@ typedef union {
                unsigned :1;
                unsigned IPEN:1;
        };
-} RCONbits_t;
+} __RCONbits_t;
 
-extern volatile RCONbits_t at 0xfd0 RCONbits;
+extern volatile __RCONbits_t at 0xfd0 RCONbits;
 
 extern sfr at 0xfd1 WDTCON;
 typedef union {
@@ -2565,9 +2565,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} WDTCONbits_t;
+} __WDTCONbits_t;
 
-extern volatile WDTCONbits_t at 0xfd1 WDTCONbits;
+extern volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
 
 extern sfr at 0xfd2 LVDCON;
 typedef union {
@@ -2592,9 +2592,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} LVDCONbits_t;
+} __LVDCONbits_t;
 
-extern volatile LVDCONbits_t at 0xfd2 LVDCONbits;
+extern volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
 
 extern sfr at 0xfd3 OSCCON;
 typedef union {
@@ -2608,9 +2608,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} OSCCONbits_t;
+} __OSCCONbits_t;
 
-extern volatile OSCCONbits_t at 0xfd3 OSCCONbits;
+extern volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
 
 extern sfr at 0xfd5 T0CON;
 extern sfr at 0xfd6 TMR0L;
@@ -2627,9 +2627,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} STATUSbits_t;
+} __STATUSbits_t;
 
-extern volatile STATUSbits_t at 0xfd8 STATUSbits;
+extern volatile __STATUSbits_t at 0xfd8 STATUSbits;
 
 extern sfr at 0xfd9 FSR2L;
 extern sfr at 0xfda FSR2H;
@@ -2677,9 +2677,9 @@ typedef union {
                unsigned INT1IP:1;
                unsigned :1;
        };
-} INTCON3bits_t;
+} __INTCON3bits_t;
 
-extern volatile INTCON3bits_t at 0xff0 INTCON3bits;
+extern volatile __INTCON3bits_t at 0xff0 INTCON3bits;
 
 extern sfr at 0xff1 INTCON2;
 typedef union {
@@ -2693,9 +2693,9 @@ typedef union {
                unsigned INTEDG0:1;
                unsigned RBPU:1;
        };
-} INTCON2bits_t;
+} __INTCON2bits_t;
 
-extern volatile INTCON2bits_t at 0xff1 INTCON2bits;
+extern volatile __INTCON2bits_t at 0xff1 INTCON2bits;
 
 extern sfr at 0xff2 INTCON;
 typedef union {
@@ -2709,9 +2709,9 @@ typedef union {
                unsigned PEIE:1;
                unsigned GIE:1;
        };
-} INTCONbits_t;
+} __INTCONbits_t;
 
-extern volatile INTCONbits_t at 0xff2 INTCONbits;
+extern volatile __INTCONbits_t at 0xff2 INTCONbits;
 
 extern sfr at 0xff3 PRODL;
 extern sfr at 0xff4 PRODH;
@@ -2734,14 +2734,130 @@ typedef union {
                unsigned STKUNF:1;
                unsigned STKFUL:1;
        };
-} STKPTRbits_t;
+} __STKPTRbits_t;
 
-extern volatile STKPTRbits_t at 0xffc STKPTRbits;
+extern volatile __STKPTRbits_t at 0xffc STKPTRbits;
 
 extern sfr at 0xffd TOSL;
 extern sfr at 0xffe TOSH;
 extern sfr at 0xfff TOSU;
 
 
-#endif
+/* Configuration registers locations */
+#define __CONFIG0H     0x300001
+#define __CONFIG1L     0x300002
+#define __CONFIG1H     0x300003
+#define __CONFIG3L     0x300006
+#define __CONFIG4L     0x300008
+#define __CONFIG4H     0x300009
+#define __CONFIG5L     0x30000A
+#define __CONFIG5H     0x30000B
+#define __CONFIG6L     0x30000C
+#define __CONFIG6H     0x30000D
+
+
+
+/* Oscillator 0H options */
+#define _OSC_RC_OSC2_0H        0xFF    /* RC-OSC2 as RA6 */
+#define _OSC_HS_PLL_0H 0xFE    /* HS-PLL Enabled */
+#define _OSC_EC_OSC2_RA6_0H    0xFD    /* EC-OSC2 as RA6 */
+#define _OSC_EC_OSC2_Clock_Out_0H      0xFC    /* EC-OSC2 as Clock_Out */
+#define _OSC_RC_0H     0xFB    /* RC */
+#define _OSC_HS_0H     0xFA    /* HS */
+#define _OSC_XT_0H     0xF9    /* XT */
+#define _OSC_LP_0H     0xF8    /* LP */
+
+/* Osc. Switch Enable 0H options */
+#define _OSCS_OFF_0H   0xFF    /* Disabled */
+#define _OSCS_ON_0H    0xDF    /* Enabled */
+
+/* Power Up Timer 1L options */
+#define _PUT_OFF_1L    0xFF    /* Disabled */
+#define _PUT_ON_1L     0xFE    /* Enabled */
+
+/* Brown Out Detect 1L options */
+#define _BODEN_ON_1L   0xFF    /* Enabled */
+#define _BODEN_OFF_1L  0xFD    /* Disabled */
+
+/* Brown Out Voltage 1L options */
+#define _BODENV_2_0V_1L        0xFF    /* 2.0V */
+#define _BODENV_2_7V_1L        0xFB    /* 2.7V */
+#define _BODENV_4_2V_1L        0xF7    /* 4.2V */
+#define _BODENV_4_5V_1L        0xF3    /* 4.5V */
+
+/* Watchdog Timer 1H options */
+#define _WDT_ON_1H     0xFF    /* Enabled */
+#define _WDT_OFF_1H    0xFE    /* Disabled */
+
+/* Watchdog Postscaler 1H options */
+#define _WDTPS_1_128_1H        0xFF    /* 1:128 */
+#define _WDTPS_1_64_1H 0xFD    /* 1:64 */
+#define _WDTPS_1_32_1H 0xFB    /* 1:32 */
+#define _WDTPS_1_16_1H 0xF9    /* 1:16 */
+#define _WDTPS_1_8_1H  0xF7    /* 1:8 */
+#define _WDTPS_1_4_1H  0xF5    /* 1:4 */
+#define _WDTPS_1_2_1H  0xF3    /* 1:2 */
+#define _WDTPS_1_1_1H  0xF1    /* 1:1 */
+
+/* Low Voltage Program 3L options */
+#define _LVP_ON_3L     0xFF    /* Enabled */
+#define _LVP_OFF_3L    0xFB    /* Disabled */
+
+/* Background Debug 3L options */
+#define _BACKBUG_OFF_3L        0xFF    /* Disabled */
+#define _BACKBUG_ON_3L 0x7F    /* Enabled */
+
+/* Stack Overflow Reset 3L options */
+#define _STVR_ON_3L    0xFF    /* Enabled */
+#define _STVR_OFF_3L   0xFE    /* Disabled */
+
+/* Code Protect 00200-01FFF 4L options */
+#define _CP_0_OFF_4L   0xFF    /* Disabled */
+#define _CP_0_ON_4L    0xFE    /* Enabled */
+
+/* Code Protect 02000-03FFF 4L options */
+#define _CP_1_OFF_4L   0xFF    /* Disabled */
+#define _CP_1_ON_4L    0xFD    /* Enabled */
+
+/* Data EE Read Protect 4H options */
+#define _CPD_OFF_4H    0xFF    /* Disabled */
+#define _CPD_ON_4H     0x7F    /* Enabled */
+
+/* Code Protect Boot 4H options */
+#define _CPB_OFF_4H    0xFF    /* Disabled */
+#define _CPB_ON_4H     0xBF    /* Enabled */
+
+/* Table Write Protect 00200-01FFF 5L options */
+#define _WRT_0_OFF_5L  0xFF    /* Disabled */
+#define _WRT_0_ON_5L   0xFE    /* Enabled */
+
+/* Table Write Protect 02000-03FFF 5L options */
+#define _WRT_1_OFF_5L  0xFF    /* Disabled */
+#define _WRT_1_ON_5L   0xFD    /* Enabled */
+
+/* Data EE Write Protect 5H options */
+#define _WRTD_OFF_5H   0xFF    /* Disabled */
+#define _WRTD_ON_5H    0x7F    /* Enabled */
+
+/* Table Write Protect Boot 5H options */
+#define _WRTB_OFF_5H   0xFF    /* Disabled */
+#define _WRTB_ON_5H    0xBF    /* Enabled */
+
+/* Config. Write Protect 5H options */
+#define _WRTC_OFF_5H   0xFF    /* Disabled */
+#define _WRTC_ON_5H    0xDF    /* Enabled */
+
+/* Table Read Protect 00200-01FFF 6L options */
+#define _EBTR_0_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_0_ON_6L  0xFE    /* Enabled */
+
+/* Table Read Protect 02000-03FFF 6L options */
+#define _EBTR_1_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_1_ON_6L  0xFD    /* Enabled */
+
+/* Table Read Protect Boot 6H options */
+#define _EBTRB_OFF_6H  0xFF    /* Disabled */
+#define _EBTRB_ON_6H   0xBF    /* Enabled */
 
+
+#endif
index 5367875ba5a96846942e8dff02b54fe4bcb54165..c3dd631cd7214323980f6db83bee4ff50690a78b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * pic18f452.h - 18F452 Device Library Header
+ * pic18f452.h - PIC18F452 Device Library Header
  *
  * This file is part of the GNU PIC Library.
  *
@@ -60,9 +60,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTAbits_t;
+} __PORTAbits_t;
 
-extern volatile PORTAbits_t at 0xf80 PORTAbits;
+extern volatile __PORTAbits_t at 0xf80 PORTAbits;
 
 extern sfr at 0xf81 PORTB;
 typedef union {
@@ -87,9 +87,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTBbits_t;
+} __PORTBbits_t;
 
-extern volatile PORTBbits_t at 0xf81 PORTBbits;
+extern volatile __PORTBbits_t at 0xf81 PORTBbits;
 
 extern sfr at 0xf82 PORTC;
 typedef union {
@@ -125,9 +125,9 @@ typedef union {
                unsigned CK:1;
                unsigned DT:1;
        };
-} PORTCbits_t;
+} __PORTCbits_t;
 
-extern volatile PORTCbits_t at 0xf82 PORTCbits;
+extern volatile __PORTCbits_t at 0xf82 PORTCbits;
 
 extern sfr at 0xf83 PORTD;
 typedef union {
@@ -152,9 +152,9 @@ typedef union {
                unsigned AD6:1;
                unsigned AD7:1;
        };
-} PORTDbits_t;
+} __PORTDbits_t;
 
-extern volatile PORTDbits_t at 0xf83 PORTDbits;
+extern volatile __PORTDbits_t at 0xf83 PORTDbits;
 
 extern sfr at 0xf84 PORTE;
 typedef union {
@@ -190,9 +190,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTEbits_t;
+} __PORTEbits_t;
 
-extern volatile PORTEbits_t at 0xf84 PORTEbits;
+extern volatile __PORTEbits_t at 0xf84 PORTEbits;
 
 extern sfr at 0xf89 LATA;
 typedef union {
@@ -206,9 +206,9 @@ typedef union {
                unsigned LATA6:1;
                unsigned :1;
        };
-} LATAbits_t;
+} __LATAbits_t;
 
-extern volatile LATAbits_t at 0xf89 LATAbits;
+extern volatile __LATAbits_t at 0xf89 LATAbits;
 
 extern sfr at 0xf8a LATB;
 typedef union {
@@ -222,9 +222,9 @@ typedef union {
                unsigned LATB6:1;
                unsigned LATB7:1;
        };
-} LATBbits_t;
+} __LATBbits_t;
 
-extern volatile LATBbits_t at 0xf8a LATBbits;
+extern volatile __LATBbits_t at 0xf8a LATBbits;
 
 extern sfr at 0xf8b LATC;
 typedef union {
@@ -238,9 +238,9 @@ typedef union {
                unsigned LATC6:1;
                unsigned LATC7:1;
        };
-} LATCbits_t;
+} __LATCbits_t;
 
-extern volatile LATCbits_t at 0xf8b LATCbits;
+extern volatile __LATCbits_t at 0xf8b LATCbits;
 
 extern sfr at 0xf8c LATD;
 typedef union {
@@ -254,9 +254,9 @@ typedef union {
                unsigned LATD6:1;
                unsigned LATD7:1;
        };
-} LATDbits_t;
+} __LATDbits_t;
 
-extern volatile LATDbits_t at 0xf8c LATDbits;
+extern volatile __LATDbits_t at 0xf8c LATDbits;
 
 extern sfr at 0xf8d LATE;
 typedef union {
@@ -270,9 +270,9 @@ typedef union {
                unsigned LATE6:1;
                unsigned LATE7:1;
        };
-} LATEbits_t;
+} __LATEbits_t;
 
-extern volatile LATEbits_t at 0xf8d LATEbits;
+extern volatile __LATEbits_t at 0xf8d LATEbits;
 
 extern sfr at 0xf92 TRISA;
 typedef union {
@@ -286,9 +286,9 @@ typedef union {
                unsigned TRISA6:1;
                unsigned :1;
        };
-} TRISAbits_t;
+} __TRISAbits_t;
 
-extern volatile TRISAbits_t at 0xf92 TRISAbits;
+extern volatile __TRISAbits_t at 0xf92 TRISAbits;
 
 extern sfr at 0xf93 TRISB;
 typedef union {
@@ -302,9 +302,9 @@ typedef union {
                unsigned TRISB6:1;
                unsigned TRISB7:1;
        };
-} TRISBbits_t;
+} __TRISBbits_t;
 
-extern volatile TRISBbits_t at 0xf93 TRISBbits;
+extern volatile __TRISBbits_t at 0xf93 TRISBbits;
 
 extern sfr at 0xf94 TRISC;
 typedef union {
@@ -318,9 +318,9 @@ typedef union {
                unsigned TRISC6:1;
                unsigned TRISC7:1;
        };
-} TRISCbits_t;
+} __TRISCbits_t;
 
-extern volatile TRISCbits_t at 0xf94 TRISCbits;
+extern volatile __TRISCbits_t at 0xf94 TRISCbits;
 
 extern sfr at 0xf95 TRISD;
 typedef union {
@@ -334,9 +334,9 @@ typedef union {
                unsigned TRISD6:1;
                unsigned TRISD7:1;
        };
-} TRISDbits_t;
+} __TRISDbits_t;
 
-extern volatile TRISDbits_t at 0xf95 TRISDbits;
+extern volatile __TRISDbits_t at 0xf95 TRISDbits;
 
 extern sfr at 0xf96 TRISE;
 typedef union {
@@ -350,9 +350,9 @@ typedef union {
                unsigned OBF:1;
                unsigned IBF:1;
        };
-} TRISEbits_t;
+} __TRISEbits_t;
 
-extern volatile TRISEbits_t at 0xf96 TRISEbits;
+extern volatile __TRISEbits_t at 0xf96 TRISEbits;
 
 extern sfr at 0xf9d PIE1;
 typedef union {
@@ -366,9 +366,9 @@ typedef union {
                unsigned ADIE:1;
                unsigned PSPIE:1;
        };
-} PIE1bits_t;
+} __PIE1bits_t;
 
-extern volatile PIE1bits_t at 0xf9d PIE1bits;
+extern volatile __PIE1bits_t at 0xf9d PIE1bits;
 
 extern sfr at 0xf9e PIR1;
 typedef union {
@@ -382,9 +382,9 @@ typedef union {
                unsigned ADIF:1;
                unsigned PSPIF:1;
        };
-} PIR1bits_t;
+} __PIR1bits_t;
 
-extern volatile PIR1bits_t at 0xf9e PIR1bits;
+extern volatile __PIR1bits_t at 0xf9e PIR1bits;
 
 extern sfr at 0xf9f IPR1;
 typedef union {
@@ -398,9 +398,9 @@ typedef union {
                unsigned ADIP:1;
                unsigned PSPIP:1;
        };
-} IPR1bits_t;
+} __IPR1bits_t;
 
-extern volatile IPR1bits_t at 0xf9f IPR1bits;
+extern volatile __IPR1bits_t at 0xf9f IPR1bits;
 
 extern sfr at 0xfa0 PIE2;
 typedef union {
@@ -414,9 +414,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PIE2bits_t;
+} __PIE2bits_t;
 
-extern volatile PIE2bits_t at 0xfa0 PIE2bits;
+extern volatile __PIE2bits_t at 0xfa0 PIE2bits;
 
 extern sfr at 0xfa1 PIR2;
 typedef union {
@@ -430,9 +430,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PIR2bits_t;
+} __PIR2bits_t;
 
-extern volatile PIR2bits_t at 0xfa1 PIR2bits;
+extern volatile __PIR2bits_t at 0xfa1 PIR2bits;
 
 extern sfr at 0xfa2 IPR2;
 typedef union {
@@ -446,9 +446,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} IPR2bits_t;
+} __IPR2bits_t;
 
-extern volatile IPR2bits_t at 0xfa2 IPR2bits;
+extern volatile __IPR2bits_t at 0xfa2 IPR2bits;
 
 extern sfr at 0xfa6 EECON1;
 typedef union {
@@ -462,9 +462,9 @@ typedef union {
                unsigned CFGS:1;
                unsigned EEPGD:1;
        };
-} EECON1bits_t;
+} __EECON1bits_t;
 
-extern volatile EECON1bits_t at 0xfa6 EECON1bits;
+extern volatile __EECON1bits_t at 0xfa6 EECON1bits;
 
 extern sfr at 0xfa7 EECON2;
 extern sfr at 0xfa8 EEDATA;
@@ -481,9 +481,9 @@ typedef union {
                unsigned RX9:1;
                unsigned SPEN:1;
        };
-} RCSTAbits_t;
+} __RCSTAbits_t;
 
-extern volatile RCSTAbits_t at 0xfab RCSTAbits;
+extern volatile __RCSTAbits_t at 0xfab RCSTAbits;
 
 extern sfr at 0xfac TXSTA;
 typedef union {
@@ -497,9 +497,9 @@ typedef union {
                unsigned TX9:1;
                unsigned CSRC:1;
        };
-} TXSTAbits_t;
+} __TXSTAbits_t;
 
-extern volatile TXSTAbits_t at 0xfac TXSTAbits;
+extern volatile __TXSTAbits_t at 0xfac TXSTAbits;
 
 extern sfr at 0xfad TXREG;
 extern sfr at 0xfae RCREG;
@@ -516,9 +516,9 @@ typedef union {
                unsigned T3CCP2:1;
                unsigned RD16:1;
        };
-} T3CONbits_t;
+} __T3CONbits_t;
 
-extern volatile T3CONbits_t at 0xfb1 T3CONbits;
+extern volatile __T3CONbits_t at 0xfb1 T3CONbits;
 
 extern sfr at 0xfb2 TMR3L;
 extern sfr at 0xfb3 TMR3H;
@@ -534,9 +534,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CCP2CONbits_t;
+} __CCP2CONbits_t;
 
-extern volatile CCP2CONbits_t at 0xfba CCP2CONbits;
+extern volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
 
 extern sfr at 0xfbb CCPR2L;
 extern sfr at 0xfbc CCPR2H;
@@ -552,9 +552,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CCP1CONbits_t;
+} __CCP1CONbits_t;
 
-extern volatile CCP1CONbits_t at 0xfbd CCP1CONbits;
+extern volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
 
 extern sfr at 0xfbe CCPR1L;
 extern sfr at 0xfbf CCPR1H;
@@ -570,9 +570,9 @@ typedef union {
                unsigned ADCS2:1;
                unsigned ADFM:1;
        };
-} ADCON1bits_t;
+} __ADCON1bits_t;
 
-extern volatile ADCON1bits_t at 0xfc1 ADCON1bits;
+extern volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
 
 extern sfr at 0xfc2 ADCON0;
 typedef union {
@@ -586,9 +586,9 @@ typedef union {
                unsigned ADCS0:1;
                unsigned ADCS1:1;
        };
-} ADCON0bits_t;
+} __ADCON0bits_t;
 
-extern volatile ADCON0bits_t at 0xfc2 ADCON0bits;
+extern volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
 
 extern sfr at 0xfc3 ADRESL;
 extern sfr at 0xfc4 ADRESH;
@@ -604,9 +604,9 @@ typedef union {
                unsigned ACKSTAT:1;
                unsigned GCEN:1;
        };
-} SSPCON2bits_t;
+} __SSPCON2bits_t;
 
-extern volatile SSPCON2bits_t at 0xfc5 SSPCON2bits;
+extern volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
 
 extern sfr at 0xfc6 SSPCON1;
 typedef union {
@@ -620,9 +620,9 @@ typedef union {
                unsigned SSPOV:1;
                unsigned WCOL:1;
        };
-} SSPCON1bits_t;
+} __SSPCON1bits_t;
 
-extern volatile SSPCON1bits_t at 0xfc6 SSPCON1bits;
+extern volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
 
 extern sfr at 0xfc7 SSPSTAT;
 typedef union {
@@ -636,9 +636,9 @@ typedef union {
                unsigned CKE:1;
                unsigned SMP:1;
        };
-} SSPSTATbits_t;
+} __SSPSTATbits_t;
 
-extern volatile SSPSTATbits_t at 0xfc7 SSPSTATbits;
+extern volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
 
 extern sfr at 0xfc8 SSPADD;
 extern sfr at 0xfc9 SSPBUF;
@@ -654,9 +654,9 @@ typedef union {
                unsigned TOUTPS3:1;
                unsigned :1;
        };
-} T2CONbits_t;
+} __T2CONbits_t;
 
-extern volatile T2CONbits_t at 0xfca T2CONbits;
+extern volatile __T2CONbits_t at 0xfca T2CONbits;
 
 extern sfr at 0xfcb PR2;
 extern sfr at 0xfcc TMR2;
@@ -672,9 +672,9 @@ typedef union {
                unsigned :1;
                unsigned RD16:1;
        };
-} T1CONbits_t;
+} __T1CONbits_t;
 
-extern volatile T1CONbits_t at 0xfcd T1CONbits;
+extern volatile __T1CONbits_t at 0xfcd T1CONbits;
 
 extern sfr at 0xfce TMR1L;
 extern sfr at 0xfcf TMR1H;
@@ -690,9 +690,9 @@ typedef union {
                unsigned :1;
                unsigned IPEN:1;
        };
-} RCONbits_t;
+} __RCONbits_t;
 
-extern volatile RCONbits_t at 0xfd0 RCONbits;
+extern volatile __RCONbits_t at 0xfd0 RCONbits;
 
 extern sfr at 0xfd1 WDTCON;
 typedef union {
@@ -717,9 +717,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} WDTCONbits_t;
+} __WDTCONbits_t;
 
-extern volatile WDTCONbits_t at 0xfd1 WDTCONbits;
+extern volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
 
 extern sfr at 0xfd2 LVDCON;
 typedef union {
@@ -744,9 +744,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} LVDCONbits_t;
+} __LVDCONbits_t;
 
-extern volatile LVDCONbits_t at 0xfd2 LVDCONbits;
+extern volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
 
 extern sfr at 0xfd3 OSCCON;
 typedef union {
@@ -760,9 +760,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} OSCCONbits_t;
+} __OSCCONbits_t;
 
-extern volatile OSCCONbits_t at 0xfd3 OSCCONbits;
+extern volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
 
 extern sfr at 0xfd5 T0CON;
 extern sfr at 0xfd6 TMR0L;
@@ -779,9 +779,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} STATUSbits_t;
+} __STATUSbits_t;
 
-extern volatile STATUSbits_t at 0xfd8 STATUSbits;
+extern volatile __STATUSbits_t at 0xfd8 STATUSbits;
 
 extern sfr at 0xfd9 FSR2L;
 extern sfr at 0xfda FSR2H;
@@ -829,9 +829,9 @@ typedef union {
                unsigned INT1IP:1;
                unsigned INT2IP:1;
        };
-} INTCON3bits_t;
+} __INTCON3bits_t;
 
-extern volatile INTCON3bits_t at 0xff0 INTCON3bits;
+extern volatile __INTCON3bits_t at 0xff0 INTCON3bits;
 
 extern sfr at 0xff1 INTCON2;
 typedef union {
@@ -845,9 +845,9 @@ typedef union {
                unsigned INTEDG0:1;
                unsigned RBPU:1;
        };
-} INTCON2bits_t;
+} __INTCON2bits_t;
 
-extern volatile INTCON2bits_t at 0xff1 INTCON2bits;
+extern volatile __INTCON2bits_t at 0xff1 INTCON2bits;
 
 extern sfr at 0xff2 INTCON;
 typedef union {
@@ -861,9 +861,9 @@ typedef union {
                unsigned PEIE:1;
                unsigned GIE:1;
        };
-} INTCONbits_t;
+} __INTCONbits_t;
 
-extern volatile INTCONbits_t at 0xff2 INTCONbits;
+extern volatile __INTCONbits_t at 0xff2 INTCONbits;
 
 extern sfr at 0xff3 PRODL;
 extern sfr at 0xff4 PRODH;
@@ -886,14 +886,159 @@ typedef union {
                unsigned STKUNF:1;
                unsigned STKFUL:1;
        };
-} STKPTRbits_t;
+} __STKPTRbits_t;
 
-extern volatile STKPTRbits_t at 0xffc STKPTRbits;
+extern volatile __STKPTRbits_t at 0xffc STKPTRbits;
 
 extern sfr at 0xffd TOSL;
 extern sfr at 0xffe TOSH;
 extern sfr at 0xfff TOSU;
 
 
-#endif
+/* Configuration registers locations */
+#define __CONFIG0H     0x300001
+#define __CONFIG1L     0x300002
+#define __CONFIG1H     0x300003
+#define __CONFIG2H     0x300005
+#define __CONFIG3L     0x300006
+#define __CONFIG4L     0x300008
+#define __CONFIG4H     0x300009
+#define __CONFIG5L     0x30000A
+#define __CONFIG5H     0x30000B
+#define __CONFIG6L     0x30000C
+#define __CONFIG6H     0x30000D
+
+
+
+/* Oscillator 0H options */
+#define _OSC_RC_OSC2_0H        0xFF    /* RC-OSC2 as RA6 */
+#define _OSC_HS_PLL_0H 0xFE    /* HS-PLL Enabled */
+#define _OSC_EC_OSC2_RA6_0H    0xFD    /* EC-OSC2 as RA6 */
+#define _OSC_EC_OSC2_Clock_Out_0H      0xFC    /* EC-OSC2 as Clock_Out */
+#define _OSC_RC_0H     0xFB    /* RC */
+#define _OSC_HS_0H     0xFA    /* HS */
+#define _OSC_XT_0H     0xF9    /* XT */
+#define _OSC_LP_0H     0xF8    /* LP */
+
+/* Osc. Switch Enable 0H options */
+#define _OSCS_OFF_0H   0xFF    /* Disabled */
+#define _OSCS_ON_0H    0xDF    /* Enabled */
+
+/* Power Up Timer 1L options */
+#define _PUT_OFF_1L    0xFF    /* Disabled */
+#define _PUT_ON_1L     0xFE    /* Enabled */
+
+/* Brown Out Detect 1L options */
+#define _BODEN_ON_1L   0xFF    /* Enabled */
+#define _BODEN_OFF_1L  0xFD    /* Disabled */
+
+/* Brown Out Voltage 1L options */
+#define _BODENV_2_0V_1L        0xFF    /* 2.0V */
+#define _BODENV_2_7V_1L        0xFB    /* 2.7V */
+#define _BODENV_4_2V_1L        0xF7    /* 4.2V */
+#define _BODENV_4_5V_1L        0xF3    /* 4.5V */
+
+/* Watchdog Timer 1H options */
+#define _WDT_ON_1H     0xFF    /* Enabled */
+#define _WDT_OFF_1H    0xFE    /* Disabled */
+
+/* Watchdog Postscaler 1H options */
+#define _WDTPS_1_128_1H        0xFF    /* 1:128 */
+#define _WDTPS_1_64_1H 0xFD    /* 1:64 */
+#define _WDTPS_1_32_1H 0xFB    /* 1:32 */
+#define _WDTPS_1_16_1H 0xF9    /* 1:16 */
+#define _WDTPS_1_8_1H  0xF7    /* 1:8 */
+#define _WDTPS_1_4_1H  0xF5    /* 1:4 */
+#define _WDTPS_1_2_1H  0xF3    /* 1:2 */
+#define _WDTPS_1_1_1H  0xF1    /* 1:1 */
+
+/* CCP2 Mux 2H options */
+#define _CCP2MUX_RC1_2H        0xFF    /* RC1 */
+#define _CCP2MUX_RB3_2H        0xFE    /* RB3 */
+
+/* Low Voltage Program 3L options */
+#define _LVP_ON_3L     0xFF    /* Enabled */
+#define _LVP_OFF_3L    0xFB    /* Disabled */
+
+/* Background Debug 3L options */
+#define _BACKBUG_OFF_3L        0xFF    /* Disabled */
+#define _BACKBUG_ON_3L 0x7F    /* Enabled */
+
+/* Stack Overflow Reset 3L options */
+#define _STVR_ON_3L    0xFF    /* Enabled */
+#define _STVR_OFF_3L   0xFE    /* Disabled */
+
+/* Code Protect 00200-01FFF 4L options */
+#define _CP_0_OFF_4L   0xFF    /* Disabled */
+#define _CP_0_ON_4L    0xFE    /* Enabled */
+
+/* Code Protect 02000-03FFF 4L options */
+#define _CP_1_OFF_4L   0xFF    /* Disabled */
+#define _CP_1_ON_4L    0xFD    /* Enabled */
+
+/* Code Protect 04000-05FFF 4L options */
+#define _CP_2_OFF_4L   0xFF    /* Disabled */
+#define _CP_2_ON_4L    0xFB    /* Enabled */
+
+/* Code Protect 06000-07FFF 4L options */
+#define _CP_3_OFF_4L   0xFF    /* Disabled */
+#define _CP_3_ON_4L    0xF7    /* Enabled */
+
+/* Data EE Read Protect 4H options */
+#define _CPD_OFF_4H    0xFF    /* Disabled */
+#define _CPD_ON_4H     0x7F    /* Enabled */
+
+/* Code Protect Boot 4H options */
+#define _CPB_OFF_4H    0xFF    /* Disabled */
+#define _CPB_ON_4H     0xBF    /* Enabled */
+
+/* Table Write Protect 00200-01FFF 5L options */
+#define _WRT_0_OFF_5L  0xFF    /* Disabled */
+#define _WRT_0_ON_5L   0xFE    /* Enabled */
+
+/* Table Write Protect 02000-03FFF 5L options */
+#define _WRT_1_OFF_5L  0xFF    /* Disabled */
+#define _WRT_1_ON_5L   0xFD    /* Enabled */
+
+/* Table Write Protect 04000-05FFF 5L options */
+#define _WRT_2_OFF_5L  0xFF    /* Disabled */
+#define _WRT_2_ON_5L   0xFB    /* Enabled */
+
+/* Table Write Protect 06000-07FFF 5L options */
+#define _WRT_3_OFF_5L  0xFF    /* Disabled */
+#define _WRT_3_ON_5L   0xF7    /* Enabled */
+
+/* Data EE Write Protect 5H options */
+#define _WRTD_OFF_5H   0xFF    /* Disabled */
+#define _WRTD_ON_5H    0x7F    /* Enabled */
+
+/* Table Write Protect Boot 5H options */
+#define _WRTB_OFF_5H   0xFF    /* Disabled */
+#define _WRTB_ON_5H    0xBF    /* Enabled */
+
+/* Config. Write Protect 5H options */
+#define _WRTC_OFF_5H   0xFF    /* Disabled */
+#define _WRTC_ON_5H    0xDF    /* Enabled */
+
+/* Table Read Protect 00200-01FFF 6L options */
+#define _EBTR_0_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_0_ON_6L  0xFE    /* Enabled */
+
+/* Table Read Protect 02000-03FFF 6L options */
+#define _EBTR_1_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_1_ON_6L  0xFD    /* Enabled */
+
+/* Table Read Protect 04000-05FFF 6L options */
+#define _EBTR_2_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_2_ON_6L  0xFB    /* Enabled */
 
+/* Table Read Protect 06000-07FFF 6L options */
+#define _EBTR_3_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_3_ON_6L  0xF7    /* Enabled */
+
+/* Table Read Protect Boot 6H options */
+#define _EBTRB_OFF_6H  0xFF    /* Disabled */
+#define _EBTRB_ON_6H   0xBF    /* Enabled */
+
+
+#endif
index 9b10fe18c59aba03db3325473576bd46b64c824e..9854327be7197645628ffce6b6f990286b21c084 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * pic18f458.h - 18F458 Device Library Header
+ * pic18f458.h - PIC18F458 Device Library Header
  *
  * This file is part of the GNU PIC Library.
  *
@@ -27,9 +27,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF0SIDHbits_t;
+} __RXF0SIDHbits_t;
 
-extern volatile RXF0SIDHbits_t at 0xf00 RXF0SIDHbits;
+extern volatile __RXF0SIDHbits_t at 0xf00 RXF0SIDHbits;
 
 extern sfr at 0xf01 RXF0SIDL;
 typedef union {
@@ -43,9 +43,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF0SIDLbits_t;
+} __RXF0SIDLbits_t;
 
-extern volatile RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
+extern volatile __RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
 
 extern sfr at 0xf02 RXF0EIDH;
 typedef union {
@@ -59,9 +59,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF0EIDHbits_t;
+} __RXF0EIDHbits_t;
 
-extern volatile RXF0EIDHbits_t at 0xf02 RXF0EIDHbits;
+extern volatile __RXF0EIDHbits_t at 0xf02 RXF0EIDHbits;
 
 extern sfr at 0xf03 RXF0EIDL;
 typedef union {
@@ -75,9 +75,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF0EIDLbits_t;
+} __RXF0EIDLbits_t;
 
-extern volatile RXF0EIDLbits_t at 0xf03 RXF0EIDLbits;
+extern volatile __RXF0EIDLbits_t at 0xf03 RXF0EIDLbits;
 
 extern sfr at 0xf04 RXF1SIDH;
 typedef union {
@@ -91,9 +91,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF1SIDHbits_t;
+} __RXF1SIDHbits_t;
 
-extern volatile RXF1SIDHbits_t at 0xf04 RXF1SIDHbits;
+extern volatile __RXF1SIDHbits_t at 0xf04 RXF1SIDHbits;
 
 extern sfr at 0xf05 RXF1SIDL;
 typedef union {
@@ -107,9 +107,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF1SIDLbits_t;
+} __RXF1SIDLbits_t;
 
-extern volatile RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
+extern volatile __RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
 
 extern sfr at 0xf06 RXF1EIDH;
 typedef union {
@@ -123,9 +123,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF1EIDHbits_t;
+} __RXF1EIDHbits_t;
 
-extern volatile RXF1EIDHbits_t at 0xf06 RXF1EIDHbits;
+extern volatile __RXF1EIDHbits_t at 0xf06 RXF1EIDHbits;
 
 extern sfr at 0xf07 RXF1EIDL;
 typedef union {
@@ -139,9 +139,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF1EIDLbits_t;
+} __RXF1EIDLbits_t;
 
-extern volatile RXF1EIDLbits_t at 0xf07 RXF1EIDLbits;
+extern volatile __RXF1EIDLbits_t at 0xf07 RXF1EIDLbits;
 
 extern sfr at 0xf08 RXF2SIDH;
 typedef union {
@@ -155,9 +155,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF2SIDHbits_t;
+} __RXF2SIDHbits_t;
 
-extern volatile RXF2SIDHbits_t at 0xf08 RXF2SIDHbits;
+extern volatile __RXF2SIDHbits_t at 0xf08 RXF2SIDHbits;
 
 extern sfr at 0xf09 RXF2SIDL;
 typedef union {
@@ -171,9 +171,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF2SIDLbits_t;
+} __RXF2SIDLbits_t;
 
-extern volatile RXF2SIDLbits_t at 0xf09 RXF2SIDLbits;
+extern volatile __RXF2SIDLbits_t at 0xf09 RXF2SIDLbits;
 
 extern sfr at 0xf0a RXF2EIDH;
 typedef union {
@@ -187,9 +187,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF2EIDHbits_t;
+} __RXF2EIDHbits_t;
 
-extern volatile RXF2EIDHbits_t at 0xf0a RXF2EIDHbits;
+extern volatile __RXF2EIDHbits_t at 0xf0a RXF2EIDHbits;
 
 extern sfr at 0xf0b RXF2EIDL;
 typedef union {
@@ -203,9 +203,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF2EIDLbits_t;
+} __RXF2EIDLbits_t;
 
-extern volatile RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
+extern volatile __RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
 
 extern sfr at 0xf0c RXF3SIDH;
 typedef union {
@@ -219,9 +219,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF3SIDHbits_t;
+} __RXF3SIDHbits_t;
 
-extern volatile RXF3SIDHbits_t at 0xf0c RXF3SIDHbits;
+extern volatile __RXF3SIDHbits_t at 0xf0c RXF3SIDHbits;
 
 extern sfr at 0xf0d RXF3SIDL;
 typedef union {
@@ -235,9 +235,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF3SIDLbits_t;
+} __RXF3SIDLbits_t;
 
-extern volatile RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
+extern volatile __RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
 
 extern sfr at 0xf0e RXF3EIDH;
 typedef union {
@@ -251,9 +251,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF3EIDHbits_t;
+} __RXF3EIDHbits_t;
 
-extern volatile RXF3EIDHbits_t at 0xf0e RXF3EIDHbits;
+extern volatile __RXF3EIDHbits_t at 0xf0e RXF3EIDHbits;
 
 extern sfr at 0xf0f RXF3EIDL;
 typedef union {
@@ -267,9 +267,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF3EIDLbits_t;
+} __RXF3EIDLbits_t;
 
-extern volatile RXF3EIDLbits_t at 0xf0f RXF3EIDLbits;
+extern volatile __RXF3EIDLbits_t at 0xf0f RXF3EIDLbits;
 
 extern sfr at 0xf10 RXF4SIDH;
 typedef union {
@@ -283,9 +283,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF4SIDHbits_t;
+} __RXF4SIDHbits_t;
 
-extern volatile RXF4SIDHbits_t at 0xf10 RXF4SIDHbits;
+extern volatile __RXF4SIDHbits_t at 0xf10 RXF4SIDHbits;
 
 extern sfr at 0xf11 RXF4SIDL;
 typedef union {
@@ -299,9 +299,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF4SIDLbits_t;
+} __RXF4SIDLbits_t;
 
-extern volatile RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
+extern volatile __RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
 
 extern sfr at 0xf12 RXF4EIDH;
 typedef union {
@@ -315,9 +315,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF4EIDHbits_t;
+} __RXF4EIDHbits_t;
 
-extern volatile RXF4EIDHbits_t at 0xf12 RXF4EIDHbits;
+extern volatile __RXF4EIDHbits_t at 0xf12 RXF4EIDHbits;
 
 extern sfr at 0xf13 RXF4EIDL;
 typedef union {
@@ -331,9 +331,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF4EIDLbits_t;
+} __RXF4EIDLbits_t;
 
-extern volatile RXF4EIDLbits_t at 0xf13 RXF4EIDLbits;
+extern volatile __RXF4EIDLbits_t at 0xf13 RXF4EIDLbits;
 
 extern sfr at 0xf14 RXF5SIDH;
 typedef union {
@@ -347,9 +347,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXF5SIDHbits_t;
+} __RXF5SIDHbits_t;
 
-extern volatile RXF5SIDHbits_t at 0xf14 RXF5SIDHbits;
+extern volatile __RXF5SIDHbits_t at 0xf14 RXF5SIDHbits;
 
 extern sfr at 0xf15 RXF5SIDL;
 typedef union {
@@ -363,9 +363,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXF5SIDLbits_t;
+} __RXF5SIDLbits_t;
 
-extern volatile RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
+extern volatile __RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
 
 extern sfr at 0xf16 RXF5EIDH;
 typedef union {
@@ -379,9 +379,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXF5EIDHbits_t;
+} __RXF5EIDHbits_t;
 
-extern volatile RXF5EIDHbits_t at 0xf16 RXF5EIDHbits;
+extern volatile __RXF5EIDHbits_t at 0xf16 RXF5EIDHbits;
 
 extern sfr at 0xf17 RXF5EIDL;
 typedef union {
@@ -395,9 +395,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXF5EIDLbits_t;
+} __RXF5EIDLbits_t;
 
-extern volatile RXF5EIDLbits_t at 0xf17 RXF5EIDLbits;
+extern volatile __RXF5EIDLbits_t at 0xf17 RXF5EIDLbits;
 
 extern sfr at 0xf18 RXM0SIDH;
 typedef union {
@@ -411,9 +411,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXM0SIDHbits_t;
+} __RXM0SIDHbits_t;
 
-extern volatile RXM0SIDHbits_t at 0xf18 RXM0SIDHbits;
+extern volatile __RXM0SIDHbits_t at 0xf18 RXM0SIDHbits;
 
 extern sfr at 0xf19 RXM0SIDL;
 typedef union {
@@ -427,9 +427,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXM0SIDLbits_t;
+} __RXM0SIDLbits_t;
 
-extern volatile RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
+extern volatile __RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
 
 extern sfr at 0xf1a RXM0EIDH;
 typedef union {
@@ -443,9 +443,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXM0EIDHbits_t;
+} __RXM0EIDHbits_t;
 
-extern volatile RXM0EIDHbits_t at 0xf1a RXM0EIDHbits;
+extern volatile __RXM0EIDHbits_t at 0xf1a RXM0EIDHbits;
 
 extern sfr at 0xf1b RXM0EIDL;
 typedef union {
@@ -459,9 +459,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXM0EIDLbits_t;
+} __RXM0EIDLbits_t;
 
-extern volatile RXM0EIDLbits_t at 0xf1b RXM0EIDLbits;
+extern volatile __RXM0EIDLbits_t at 0xf1b RXM0EIDLbits;
 
 extern sfr at 0xf1c RXM1SIDH;
 typedef union {
@@ -475,9 +475,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXM1SIDHbits_t;
+} __RXM1SIDHbits_t;
 
-extern volatile RXM1SIDHbits_t at 0xf1c RXM1SIDHbits;
+extern volatile __RXM1SIDHbits_t at 0xf1c RXM1SIDHbits;
 
 extern sfr at 0xf1d RXM1SIDL;
 typedef union {
@@ -491,9 +491,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXM1SIDLbits_t;
+} __RXM1SIDLbits_t;
 
-extern volatile RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
+extern volatile __RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
 
 extern sfr at 0xf1e RXM1EIDH;
 typedef union {
@@ -507,9 +507,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXM1EIDHbits_t;
+} __RXM1EIDHbits_t;
 
-extern volatile RXM1EIDHbits_t at 0xf1e RXM1EIDHbits;
+extern volatile __RXM1EIDHbits_t at 0xf1e RXM1EIDHbits;
 
 extern sfr at 0xf1f RXM1EIDL;
 typedef union {
@@ -523,9 +523,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXM1EIDLbits_t;
+} __RXM1EIDLbits_t;
 
-extern volatile RXM1EIDLbits_t at 0xf1f RXM1EIDLbits;
+extern volatile __RXM1EIDLbits_t at 0xf1f RXM1EIDLbits;
 
 extern sfr at 0xf20 TXB2CON;
 typedef union {
@@ -539,9 +539,9 @@ typedef union {
                unsigned TXABT:1;
                unsigned :1;
        };
-} TXB2CONbits_t;
+} __TXB2CONbits_t;
 
-extern volatile TXB2CONbits_t at 0xf20 TXB2CONbits;
+extern volatile __TXB2CONbits_t at 0xf20 TXB2CONbits;
 
 extern sfr at 0xf21 TXB2SIDH;
 typedef union {
@@ -555,9 +555,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} TXB2SIDHbits_t;
+} __TXB2SIDHbits_t;
 
-extern volatile TXB2SIDHbits_t at 0xf21 TXB2SIDHbits;
+extern volatile __TXB2SIDHbits_t at 0xf21 TXB2SIDHbits;
 
 extern sfr at 0xf22 TXB2SIDL;
 typedef union {
@@ -571,9 +571,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} TXB2SIDLbits_t;
+} __TXB2SIDLbits_t;
 
-extern volatile TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
+extern volatile __TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
 
 extern sfr at 0xf23 TXB2EIDH;
 typedef union {
@@ -587,9 +587,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} TXB2EIDHbits_t;
+} __TXB2EIDHbits_t;
 
-extern volatile TXB2EIDHbits_t at 0xf23 TXB2EIDHbits;
+extern volatile __TXB2EIDHbits_t at 0xf23 TXB2EIDHbits;
 
 extern sfr at 0xf24 TXB2EIDL;
 typedef union {
@@ -603,9 +603,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} TXB2EIDLbits_t;
+} __TXB2EIDLbits_t;
 
-extern volatile TXB2EIDLbits_t at 0xf24 TXB2EIDLbits;
+extern volatile __TXB2EIDLbits_t at 0xf24 TXB2EIDLbits;
 
 extern sfr at 0xf25 TXB2DLC;
 typedef union {
@@ -619,9 +619,9 @@ typedef union {
                unsigned TXB2TXRTR:1;
                unsigned :1;
        };
-} TXB2DLCbits_t;
+} __TXB2DLCbits_t;
 
-extern volatile TXB2DLCbits_t at 0xf25 TXB2DLCbits;
+extern volatile __TXB2DLCbits_t at 0xf25 TXB2DLCbits;
 
 extern sfr at 0xf26 TXB2D0;
 typedef union {
@@ -635,9 +635,9 @@ typedef union {
                unsigned TXB2D06:1;
                unsigned TXB2D07:1;
        };
-} TXB2D0bits_t;
+} __TXB2D0bits_t;
 
-extern volatile TXB2D0bits_t at 0xf26 TXB2D0bits;
+extern volatile __TXB2D0bits_t at 0xf26 TXB2D0bits;
 
 extern sfr at 0xf27 TXB2D1;
 typedef union {
@@ -651,9 +651,9 @@ typedef union {
                unsigned TXB2D16:1;
                unsigned TXB2D17:1;
        };
-} TXB2D1bits_t;
+} __TXB2D1bits_t;
 
-extern volatile TXB2D1bits_t at 0xf27 TXB2D1bits;
+extern volatile __TXB2D1bits_t at 0xf27 TXB2D1bits;
 
 extern sfr at 0xf28 TXB2D2;
 typedef union {
@@ -667,9 +667,9 @@ typedef union {
                unsigned TXB2D26:1;
                unsigned TXB2D27:1;
        };
-} TXB2D2bits_t;
+} __TXB2D2bits_t;
 
-extern volatile TXB2D2bits_t at 0xf28 TXB2D2bits;
+extern volatile __TXB2D2bits_t at 0xf28 TXB2D2bits;
 
 extern sfr at 0xf29 TXB2D3;
 typedef union {
@@ -683,9 +683,9 @@ typedef union {
                unsigned TXB2D36:1;
                unsigned TXB2D37:1;
        };
-} TXB2D3bits_t;
+} __TXB2D3bits_t;
 
-extern volatile TXB2D3bits_t at 0xf29 TXB2D3bits;
+extern volatile __TXB2D3bits_t at 0xf29 TXB2D3bits;
 
 extern sfr at 0xf2a TXB2D4;
 typedef union {
@@ -699,9 +699,9 @@ typedef union {
                unsigned TXB2D46:1;
                unsigned TXB2D47:1;
        };
-} TXB2D4bits_t;
+} __TXB2D4bits_t;
 
-extern volatile TXB2D4bits_t at 0xf2a TXB2D4bits;
+extern volatile __TXB2D4bits_t at 0xf2a TXB2D4bits;
 
 extern sfr at 0xf2b TXB2D5;
 typedef union {
@@ -715,9 +715,9 @@ typedef union {
                unsigned TXB2D56:1;
                unsigned TXB2D57:1;
        };
-} TXB2D5bits_t;
+} __TXB2D5bits_t;
 
-extern volatile TXB2D5bits_t at 0xf2b TXB2D5bits;
+extern volatile __TXB2D5bits_t at 0xf2b TXB2D5bits;
 
 extern sfr at 0xf2c TXB2D6;
 typedef union {
@@ -731,9 +731,9 @@ typedef union {
                unsigned TXB2D66:1;
                unsigned TXB2D67:1;
        };
-} TXB2D6bits_t;
+} __TXB2D6bits_t;
 
-extern volatile TXB2D6bits_t at 0xf2c TXB2D6bits;
+extern volatile __TXB2D6bits_t at 0xf2c TXB2D6bits;
 
 extern sfr at 0xf2d TXB2D7;
 typedef union {
@@ -747,9 +747,9 @@ typedef union {
                unsigned TXB2D76:1;
                unsigned TXB2D77:1;
        };
-} TXB2D7bits_t;
+} __TXB2D7bits_t;
 
-extern volatile TXB2D7bits_t at 0xf2d TXB2D7bits;
+extern volatile __TXB2D7bits_t at 0xf2d TXB2D7bits;
 
 extern sfr at 0xf2e CANSTATRO4;
 typedef union {
@@ -763,9 +763,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO4bits_t;
+} __CANSTATRO4bits_t;
 
-extern volatile CANSTATRO4bits_t at 0xf2e CANSTATRO4bits;
+extern volatile __CANSTATRO4bits_t at 0xf2e CANSTATRO4bits;
 
 extern sfr at 0xf30 TXB1CON;
 typedef union {
@@ -779,9 +779,9 @@ typedef union {
                unsigned TXABT:1;
                unsigned :1;
        };
-} TXB1CONbits_t;
+} __TXB1CONbits_t;
 
-extern volatile TXB1CONbits_t at 0xf30 TXB1CONbits;
+extern volatile __TXB1CONbits_t at 0xf30 TXB1CONbits;
 
 extern sfr at 0xf31 TXB1SIDH;
 typedef union {
@@ -795,9 +795,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} TXB1SIDHbits_t;
+} __TXB1SIDHbits_t;
 
-extern volatile TXB1SIDHbits_t at 0xf31 TXB1SIDHbits;
+extern volatile __TXB1SIDHbits_t at 0xf31 TXB1SIDHbits;
 
 extern sfr at 0xf32 TXB1SIDL;
 typedef union {
@@ -811,9 +811,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} TXB1SIDLbits_t;
+} __TXB1SIDLbits_t;
 
-extern volatile TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
+extern volatile __TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
 
 extern sfr at 0xf33 TXB1EIDH;
 typedef union {
@@ -827,9 +827,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} TXB1EIDHbits_t;
+} __TXB1EIDHbits_t;
 
-extern volatile TXB1EIDHbits_t at 0xf33 TXB1EIDHbits;
+extern volatile __TXB1EIDHbits_t at 0xf33 TXB1EIDHbits;
 
 extern sfr at 0xf34 TXB1EIDL;
 typedef union {
@@ -843,9 +843,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} TXB1EIDLbits_t;
+} __TXB1EIDLbits_t;
 
-extern volatile TXB1EIDLbits_t at 0xf34 TXB1EIDLbits;
+extern volatile __TXB1EIDLbits_t at 0xf34 TXB1EIDLbits;
 
 extern sfr at 0xf35 TXB1DLC;
 typedef union {
@@ -859,9 +859,9 @@ typedef union {
                unsigned TXRTR:1;
                unsigned :1;
        };
-} TXB1DLCbits_t;
+} __TXB1DLCbits_t;
 
-extern volatile TXB1DLCbits_t at 0xf35 TXB1DLCbits;
+extern volatile __TXB1DLCbits_t at 0xf35 TXB1DLCbits;
 
 extern sfr at 0xf36 TXB1D0;
 typedef union {
@@ -875,9 +875,9 @@ typedef union {
                unsigned TXB1D06:1;
                unsigned TXB1D07:1;
        };
-} TXB1D0bits_t;
+} __TXB1D0bits_t;
 
-extern volatile TXB1D0bits_t at 0xf36 TXB1D0bits;
+extern volatile __TXB1D0bits_t at 0xf36 TXB1D0bits;
 
 extern sfr at 0xf37 TXB1D1;
 typedef union {
@@ -891,9 +891,9 @@ typedef union {
                unsigned TXB1D16:1;
                unsigned TXB1D17:1;
        };
-} TXB1D1bits_t;
+} __TXB1D1bits_t;
 
-extern volatile TXB1D1bits_t at 0xf37 TXB1D1bits;
+extern volatile __TXB1D1bits_t at 0xf37 TXB1D1bits;
 
 extern sfr at 0xf38 TXB1D2;
 typedef union {
@@ -907,9 +907,9 @@ typedef union {
                unsigned TXB1D26:1;
                unsigned TXB1D27:1;
        };
-} TXB1D2bits_t;
+} __TXB1D2bits_t;
 
-extern volatile TXB1D2bits_t at 0xf38 TXB1D2bits;
+extern volatile __TXB1D2bits_t at 0xf38 TXB1D2bits;
 
 extern sfr at 0xf39 TXB1D3;
 typedef union {
@@ -923,9 +923,9 @@ typedef union {
                unsigned TXB1D36:1;
                unsigned TXB1D37:1;
        };
-} TXB1D3bits_t;
+} __TXB1D3bits_t;
 
-extern volatile TXB1D3bits_t at 0xf39 TXB1D3bits;
+extern volatile __TXB1D3bits_t at 0xf39 TXB1D3bits;
 
 extern sfr at 0xf3a TXB1D4;
 typedef union {
@@ -939,9 +939,9 @@ typedef union {
                unsigned TXB1D46:1;
                unsigned TXB1D47:1;
        };
-} TXB1D4bits_t;
+} __TXB1D4bits_t;
 
-extern volatile TXB1D4bits_t at 0xf3a TXB1D4bits;
+extern volatile __TXB1D4bits_t at 0xf3a TXB1D4bits;
 
 extern sfr at 0xf3b TXB1D5;
 typedef union {
@@ -955,9 +955,9 @@ typedef union {
                unsigned TXB1D56:1;
                unsigned TXB1D57:1;
        };
-} TXB1D5bits_t;
+} __TXB1D5bits_t;
 
-extern volatile TXB1D5bits_t at 0xf3b TXB1D5bits;
+extern volatile __TXB1D5bits_t at 0xf3b TXB1D5bits;
 
 extern sfr at 0xf3c TXB1D6;
 typedef union {
@@ -971,9 +971,9 @@ typedef union {
                unsigned TXB1D66:1;
                unsigned TXB1D67:1;
        };
-} TXB1D6bits_t;
+} __TXB1D6bits_t;
 
-extern volatile TXB1D6bits_t at 0xf3c TXB1D6bits;
+extern volatile __TXB1D6bits_t at 0xf3c TXB1D6bits;
 
 extern sfr at 0xf3d TXB1D7;
 typedef union {
@@ -987,9 +987,9 @@ typedef union {
                unsigned TXB1D76:1;
                unsigned TXB1D77:1;
        };
-} TXB1D7bits_t;
+} __TXB1D7bits_t;
 
-extern volatile TXB1D7bits_t at 0xf3d TXB1D7bits;
+extern volatile __TXB1D7bits_t at 0xf3d TXB1D7bits;
 
 extern sfr at 0xf3e CANSTATRO3;
 typedef union {
@@ -1003,9 +1003,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO3bits_t;
+} __CANSTATRO3bits_t;
 
-extern volatile CANSTATRO3bits_t at 0xf3e CANSTATRO3bits;
+extern volatile __CANSTATRO3bits_t at 0xf3e CANSTATRO3bits;
 
 extern sfr at 0xf40 TXB0CON;
 typedef union {
@@ -1019,9 +1019,9 @@ typedef union {
                unsigned TXABT:1;
                unsigned :1;
        };
-} TXB0CONbits_t;
+} __TXB0CONbits_t;
 
-extern volatile TXB0CONbits_t at 0xf40 TXB0CONbits;
+extern volatile __TXB0CONbits_t at 0xf40 TXB0CONbits;
 
 extern sfr at 0xf41 TXB0SIDH;
 typedef union {
@@ -1035,9 +1035,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} TXB0SIDHbits_t;
+} __TXB0SIDHbits_t;
 
-extern volatile TXB0SIDHbits_t at 0xf41 TXB0SIDHbits;
+extern volatile __TXB0SIDHbits_t at 0xf41 TXB0SIDHbits;
 
 extern sfr at 0xf42 TXB0SIDL;
 typedef union {
@@ -1051,9 +1051,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} TXB0SIDLbits_t;
+} __TXB0SIDLbits_t;
 
-extern volatile TXB0SIDLbits_t at 0xf42 TXB0SIDLbits;
+extern volatile __TXB0SIDLbits_t at 0xf42 TXB0SIDLbits;
 
 extern sfr at 0xf43 TXB0EIDH;
 typedef union {
@@ -1067,9 +1067,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} TXB0EIDHbits_t;
+} __TXB0EIDHbits_t;
 
-extern volatile TXB0EIDHbits_t at 0xf43 TXB0EIDHbits;
+extern volatile __TXB0EIDHbits_t at 0xf43 TXB0EIDHbits;
 
 extern sfr at 0xf44 TXB0EIDL;
 typedef union {
@@ -1083,9 +1083,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} TXB0EIDLbits_t;
+} __TXB0EIDLbits_t;
 
-extern volatile TXB0EIDLbits_t at 0xf44 TXB0EIDLbits;
+extern volatile __TXB0EIDLbits_t at 0xf44 TXB0EIDLbits;
 
 extern sfr at 0xf45 TXB0DLC;
 typedef union {
@@ -1099,9 +1099,9 @@ typedef union {
                unsigned TXRTR:1;
                unsigned :1;
        };
-} TXB0DLCbits_t;
+} __TXB0DLCbits_t;
 
-extern volatile TXB0DLCbits_t at 0xf45 TXB0DLCbits;
+extern volatile __TXB0DLCbits_t at 0xf45 TXB0DLCbits;
 
 extern sfr at 0xf46 TXB0D0;
 typedef union {
@@ -1115,9 +1115,9 @@ typedef union {
                unsigned TXB0D06:1;
                unsigned TXB0D07:1;
        };
-} TXB0D0bits_t;
+} __TXB0D0bits_t;
 
-extern volatile TXB0D0bits_t at 0xf46 TXB0D0bits;
+extern volatile __TXB0D0bits_t at 0xf46 TXB0D0bits;
 
 extern sfr at 0xf47 TXB0D1;
 typedef union {
@@ -1131,9 +1131,9 @@ typedef union {
                unsigned TXB0D16:1;
                unsigned TXB0D17:1;
        };
-} TXB0D1bits_t;
+} __TXB0D1bits_t;
 
-extern volatile TXB0D1bits_t at 0xf47 TXB0D1bits;
+extern volatile __TXB0D1bits_t at 0xf47 TXB0D1bits;
 
 extern sfr at 0xf48 TXB0D2;
 typedef union {
@@ -1147,9 +1147,9 @@ typedef union {
                unsigned TXB0D26:1;
                unsigned TXB0D27:1;
        };
-} TXB0D2bits_t;
+} __TXB0D2bits_t;
 
-extern volatile TXB0D2bits_t at 0xf48 TXB0D2bits;
+extern volatile __TXB0D2bits_t at 0xf48 TXB0D2bits;
 
 extern sfr at 0xf49 TXB0D3;
 typedef union {
@@ -1163,9 +1163,9 @@ typedef union {
                unsigned TXBD0D36:1;
                unsigned TXB0D37:1;
        };
-} TXB0D3bits_t;
+} __TXB0D3bits_t;
 
-extern volatile TXB0D3bits_t at 0xf49 TXB0D3bits;
+extern volatile __TXB0D3bits_t at 0xf49 TXB0D3bits;
 
 extern sfr at 0xf4a TXB0D4;
 typedef union {
@@ -1179,9 +1179,9 @@ typedef union {
                unsigned TXB0D46:1;
                unsigned TXB0D47:1;
        };
-} TXB0D4bits_t;
+} __TXB0D4bits_t;
 
-extern volatile TXB0D4bits_t at 0xf4a TXB0D4bits;
+extern volatile __TXB0D4bits_t at 0xf4a TXB0D4bits;
 
 extern sfr at 0xf4b TXB0D5;
 typedef union {
@@ -1195,9 +1195,9 @@ typedef union {
                unsigned TXB0D56:1;
                unsigned TXB0D57:1;
        };
-} TXB0D5bits_t;
+} __TXB0D5bits_t;
 
-extern volatile TXB0D5bits_t at 0xf4b TXB0D5bits;
+extern volatile __TXB0D5bits_t at 0xf4b TXB0D5bits;
 
 extern sfr at 0xf4c TXB0D6;
 typedef union {
@@ -1211,9 +1211,9 @@ typedef union {
                unsigned TXB0D66:1;
                unsigned TXB0D67:1;
        };
-} TXB0D6bits_t;
+} __TXB0D6bits_t;
 
-extern volatile TXB0D6bits_t at 0xf4c TXB0D6bits;
+extern volatile __TXB0D6bits_t at 0xf4c TXB0D6bits;
 
 extern sfr at 0xf4d TXB0D7;
 typedef union {
@@ -1227,9 +1227,9 @@ typedef union {
                unsigned TXB0D76:1;
                unsigned TXB0D77:1;
        };
-} TXB0D7bits_t;
+} __TXB0D7bits_t;
 
-extern volatile TXB0D7bits_t at 0xf4d TXB0D7bits;
+extern volatile __TXB0D7bits_t at 0xf4d TXB0D7bits;
 
 extern sfr at 0xf4e CANSTATRO2;
 typedef union {
@@ -1243,9 +1243,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO2bits_t;
+} __CANSTATRO2bits_t;
 
-extern volatile CANSTATRO2bits_t at 0xf4e CANSTATRO2bits;
+extern volatile __CANSTATRO2bits_t at 0xf4e CANSTATRO2bits;
 
 extern sfr at 0xf50 RXB1CON;
 typedef union {
@@ -1259,9 +1259,9 @@ typedef union {
                unsigned RXM1:1;
                unsigned RXFUL:1;
        };
-} RXB1CONbits_t;
+} __RXB1CONbits_t;
 
-extern volatile RXB1CONbits_t at 0xf50 RXB1CONbits;
+extern volatile __RXB1CONbits_t at 0xf50 RXB1CONbits;
 
 extern sfr at 0xf51 RXB1SIDH;
 typedef union {
@@ -1275,9 +1275,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXB1SIDHbits_t;
+} __RXB1SIDHbits_t;
 
-extern volatile RXB1SIDHbits_t at 0xf51 RXB1SIDHbits;
+extern volatile __RXB1SIDHbits_t at 0xf51 RXB1SIDHbits;
 
 extern sfr at 0xf52 RXB1SIDL;
 typedef union {
@@ -1291,9 +1291,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXB1SIDLbits_t;
+} __RXB1SIDLbits_t;
 
-extern volatile RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
+extern volatile __RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
 
 extern sfr at 0xf53 RXB1EIDH;
 typedef union {
@@ -1307,9 +1307,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXB1EIDHbits_t;
+} __RXB1EIDHbits_t;
 
-extern volatile RXB1EIDHbits_t at 0xf53 RXB1EIDHbits;
+extern volatile __RXB1EIDHbits_t at 0xf53 RXB1EIDHbits;
 
 extern sfr at 0xf54 RXB1EIDL;
 typedef union {
@@ -1323,9 +1323,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXB1EIDLbits_t;
+} __RXB1EIDLbits_t;
 
-extern volatile RXB1EIDLbits_t at 0xf54 RXB1EIDLbits;
+extern volatile __RXB1EIDLbits_t at 0xf54 RXB1EIDLbits;
 
 extern sfr at 0xf55 RXB1DLC;
 typedef union {
@@ -1339,9 +1339,9 @@ typedef union {
                unsigned RXRTR:1;
                unsigned :1;
        };
-} RXB1DLCbits_t;
+} __RXB1DLCbits_t;
 
-extern volatile RXB1DLCbits_t at 0xf55 RXB1DLCbits;
+extern volatile __RXB1DLCbits_t at 0xf55 RXB1DLCbits;
 
 extern sfr at 0xf56 RXB1D0;
 typedef union {
@@ -1355,9 +1355,9 @@ typedef union {
                unsigned RXB1D06:1;
                unsigned RXB1D07:1;
        };
-} RXB1D0bits_t;
+} __RXB1D0bits_t;
 
-extern volatile RXB1D0bits_t at 0xf56 RXB1D0bits;
+extern volatile __RXB1D0bits_t at 0xf56 RXB1D0bits;
 
 extern sfr at 0xf57 RXB1D1;
 typedef union {
@@ -1371,9 +1371,9 @@ typedef union {
                unsigned RXB1D16:1;
                unsigned RXB1D17:1;
        };
-} RXB1D1bits_t;
+} __RXB1D1bits_t;
 
-extern volatile RXB1D1bits_t at 0xf57 RXB1D1bits;
+extern volatile __RXB1D1bits_t at 0xf57 RXB1D1bits;
 
 extern sfr at 0xf58 RXB1D2;
 typedef union {
@@ -1387,9 +1387,9 @@ typedef union {
                unsigned RXB1D26:1;
                unsigned RXB1D27:1;
        };
-} RXB1D2bits_t;
+} __RXB1D2bits_t;
 
-extern volatile RXB1D2bits_t at 0xf58 RXB1D2bits;
+extern volatile __RXB1D2bits_t at 0xf58 RXB1D2bits;
 
 extern sfr at 0xf59 RXB1D3;
 typedef union {
@@ -1403,9 +1403,9 @@ typedef union {
                unsigned RXB1D36:1;
                unsigned RXB1D37:1;
        };
-} RXB1D3bits_t;
+} __RXB1D3bits_t;
 
-extern volatile RXB1D3bits_t at 0xf59 RXB1D3bits;
+extern volatile __RXB1D3bits_t at 0xf59 RXB1D3bits;
 
 extern sfr at 0xf5a RXB1D4;
 typedef union {
@@ -1419,9 +1419,9 @@ typedef union {
                unsigned RXB1D46:1;
                unsigned RXB1D47:1;
        };
-} RXB1D4bits_t;
+} __RXB1D4bits_t;
 
-extern volatile RXB1D4bits_t at 0xf5a RXB1D4bits;
+extern volatile __RXB1D4bits_t at 0xf5a RXB1D4bits;
 
 extern sfr at 0xf5b RXB1D5;
 typedef union {
@@ -1435,9 +1435,9 @@ typedef union {
                unsigned RXB1D56:1;
                unsigned RXB1D57:1;
        };
-} RXB1D5bits_t;
+} __RXB1D5bits_t;
 
-extern volatile RXB1D5bits_t at 0xf5b RXB1D5bits;
+extern volatile __RXB1D5bits_t at 0xf5b RXB1D5bits;
 
 extern sfr at 0xf5c RXB1D6;
 typedef union {
@@ -1451,9 +1451,9 @@ typedef union {
                unsigned RXB1D66:1;
                unsigned RXB1D67:1;
        };
-} RXB1D6bits_t;
+} __RXB1D6bits_t;
 
-extern volatile RXB1D6bits_t at 0xf5c RXB1D6bits;
+extern volatile __RXB1D6bits_t at 0xf5c RXB1D6bits;
 
 extern sfr at 0xf5d RXB1D7;
 typedef union {
@@ -1467,9 +1467,9 @@ typedef union {
                unsigned RXB1D76:1;
                unsigned RXB1D77:1;
        };
-} RXB1D7bits_t;
+} __RXB1D7bits_t;
 
-extern volatile RXB1D7bits_t at 0xf5d RXB1D7bits;
+extern volatile __RXB1D7bits_t at 0xf5d RXB1D7bits;
 
 extern sfr at 0xf5e CANSTATRO1;
 typedef union {
@@ -1483,9 +1483,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATRO1bits_t;
+} __CANSTATRO1bits_t;
 
-extern volatile CANSTATRO1bits_t at 0xf5e CANSTATRO1bits;
+extern volatile __CANSTATRO1bits_t at 0xf5e CANSTATRO1bits;
 
 extern sfr at 0xf60 RXB0CON;
 typedef union {
@@ -1499,9 +1499,9 @@ typedef union {
                unsigned RXM1:1;
                unsigned RXFUL:1;
        };
-} RXB0CONbits_t;
+} __RXB0CONbits_t;
 
-extern volatile RXB0CONbits_t at 0xf60 RXB0CONbits;
+extern volatile __RXB0CONbits_t at 0xf60 RXB0CONbits;
 
 extern sfr at 0xf61 RXB0SIDH;
 typedef union {
@@ -1515,9 +1515,9 @@ typedef union {
                unsigned SID9:1;
                unsigned SID10:1;
        };
-} RXB0SIDHbits_t;
+} __RXB0SIDHbits_t;
 
-extern volatile RXB0SIDHbits_t at 0xf61 RXB0SIDHbits;
+extern volatile __RXB0SIDHbits_t at 0xf61 RXB0SIDHbits;
 
 extern sfr at 0xf62 RXB0SIDL;
 typedef union {
@@ -1531,9 +1531,9 @@ typedef union {
                unsigned SID1:1;
                unsigned SID2:1;
        };
-} RXB0SIDLbits_t;
+} __RXB0SIDLbits_t;
 
-extern volatile RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
+extern volatile __RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
 
 extern sfr at 0xf63 RXB0EIDH;
 typedef union {
@@ -1547,9 +1547,9 @@ typedef union {
                unsigned EID14:1;
                unsigned EID15:1;
        };
-} RXB0EIDHbits_t;
+} __RXB0EIDHbits_t;
 
-extern volatile RXB0EIDHbits_t at 0xf63 RXB0EIDHbits;
+extern volatile __RXB0EIDHbits_t at 0xf63 RXB0EIDHbits;
 
 extern sfr at 0xf64 RXB0EIDL;
 typedef union {
@@ -1563,9 +1563,9 @@ typedef union {
                unsigned EID6:1;
                unsigned EID7:1;
        };
-} RXB0EIDLbits_t;
+} __RXB0EIDLbits_t;
 
-extern volatile RXB0EIDLbits_t at 0xf64 RXB0EIDLbits;
+extern volatile __RXB0EIDLbits_t at 0xf64 RXB0EIDLbits;
 
 extern sfr at 0xf65 RXB0DLC;
 typedef union {
@@ -1579,9 +1579,9 @@ typedef union {
                unsigned RTR:1;
                unsigned :1;
        };
-} RXB0DLCbits_t;
+} __RXB0DLCbits_t;
 
-extern volatile RXB0DLCbits_t at 0xf65 RXB0DLCbits;
+extern volatile __RXB0DLCbits_t at 0xf65 RXB0DLCbits;
 
 extern sfr at 0xf66 RXB0D0;
 extern sfr at 0xf67 RXB0D1;
@@ -1603,9 +1603,9 @@ typedef union {
                unsigned OPMODE1:1;
                unsigned OPMODE2:1;
        };
-} CANSTATbits_t;
+} __CANSTATbits_t;
 
-extern volatile CANSTATbits_t at 0xf6e CANSTATbits;
+extern volatile __CANSTATbits_t at 0xf6e CANSTATbits;
 
 extern sfr at 0xf6f CANCON;
 typedef union {
@@ -1619,9 +1619,9 @@ typedef union {
                unsigned REQOP1:1;
                unsigned REQOP2:1;
        };
-} CANCONbits_t;
+} __CANCONbits_t;
 
-extern volatile CANCONbits_t at 0xf6f CANCONbits;
+extern volatile __CANCONbits_t at 0xf6f CANCONbits;
 
 extern sfr at 0xf70 BRGCON1;
 typedef union {
@@ -1635,9 +1635,9 @@ typedef union {
                unsigned SJW0:1;
                unsigned SJW1:1;
        };
-} BRGCON1bits_t;
+} __BRGCON1bits_t;
 
-extern volatile BRGCON1bits_t at 0xf70 BRGCON1bits;
+extern volatile __BRGCON1bits_t at 0xf70 BRGCON1bits;
 
 extern sfr at 0xf71 BRGCON2;
 typedef union {
@@ -1651,9 +1651,9 @@ typedef union {
                unsigned SAM:1;
                unsigned SEG2PHTS:1;
        };
-} BRGCON2bits_t;
+} __BRGCON2bits_t;
 
-extern volatile BRGCON2bits_t at 0xf71 BRGCON2bits;
+extern volatile __BRGCON2bits_t at 0xf71 BRGCON2bits;
 
 extern sfr at 0xf72 BRGCON3;
 typedef union {
@@ -1667,9 +1667,9 @@ typedef union {
                unsigned WAKFIL:1;
                unsigned :1;
        };
-} BRGCON3bits_t;
+} __BRGCON3bits_t;
 
-extern volatile BRGCON3bits_t at 0xf72 BRGCON3bits;
+extern volatile __BRGCON3bits_t at 0xf72 BRGCON3bits;
 
 extern sfr at 0xf73 CIOCON;
 typedef union {
@@ -1683,9 +1683,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CIOCONbits_t;
+} __CIOCONbits_t;
 
-extern volatile CIOCONbits_t at 0xf73 CIOCONbits;
+extern volatile __CIOCONbits_t at 0xf73 CIOCONbits;
 
 extern sfr at 0xf74 COMSTAT;
 typedef union {
@@ -1699,9 +1699,9 @@ typedef union {
                unsigned RXB1OVFL:1;
                unsigned RXB0OVFL:1;
        };
-} COMSTATbits_t;
+} __COMSTATbits_t;
 
-extern volatile COMSTATbits_t at 0xf74 COMSTATbits;
+extern volatile __COMSTATbits_t at 0xf74 COMSTATbits;
 
 extern sfr at 0xf75 RXERRCNT;
 typedef union {
@@ -1715,9 +1715,9 @@ typedef union {
                unsigned REC6:1;
                unsigned REC7:1;
        };
-} RXERRCNTbits_t;
+} __RXERRCNTbits_t;
 
-extern volatile RXERRCNTbits_t at 0xf75 RXERRCNTbits;
+extern volatile __RXERRCNTbits_t at 0xf75 RXERRCNTbits;
 
 extern sfr at 0xf76 TXERRCNT;
 typedef union {
@@ -1731,9 +1731,9 @@ typedef union {
                unsigned TEC6:1;
                unsigned TEC7:1;
        };
-} TXERRCNTbits_t;
+} __TXERRCNTbits_t;
 
-extern volatile TXERRCNTbits_t at 0xf76 TXERRCNTbits;
+extern volatile __TXERRCNTbits_t at 0xf76 TXERRCNTbits;
 
 extern sfr at 0xf80 PORTA;
 typedef union {
@@ -1780,9 +1780,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTAbits_t;
+} __PORTAbits_t;
 
-extern volatile PORTAbits_t at 0xf80 PORTAbits;
+extern volatile __PORTAbits_t at 0xf80 PORTAbits;
 
 extern sfr at 0xf81 PORTB;
 typedef union {
@@ -1807,9 +1807,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTBbits_t;
+} __PORTBbits_t;
 
-extern volatile PORTBbits_t at 0xf81 PORTBbits;
+extern volatile __PORTBbits_t at 0xf81 PORTBbits;
 
 extern sfr at 0xf82 PORTC;
 typedef union {
@@ -1845,9 +1845,9 @@ typedef union {
                unsigned CK:1;
                unsigned DT:1;
        };
-} PORTCbits_t;
+} __PORTCbits_t;
 
-extern volatile PORTCbits_t at 0xf82 PORTCbits;
+extern volatile __PORTCbits_t at 0xf82 PORTCbits;
 
 extern sfr at 0xf83 PORTD;
 typedef union {
@@ -1872,9 +1872,9 @@ typedef union {
                unsigned AD6:1;
                unsigned AD7:1;
        };
-} PORTDbits_t;
+} __PORTDbits_t;
 
-extern volatile PORTDbits_t at 0xf83 PORTDbits;
+extern volatile __PORTDbits_t at 0xf83 PORTDbits;
 
 extern sfr at 0xf84 PORTE;
 typedef union {
@@ -1910,9 +1910,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} PORTEbits_t;
+} __PORTEbits_t;
 
-extern volatile PORTEbits_t at 0xf84 PORTEbits;
+extern volatile __PORTEbits_t at 0xf84 PORTEbits;
 
 extern sfr at 0xf89 LATA;
 typedef union {
@@ -1926,9 +1926,9 @@ typedef union {
                unsigned LATA6:1;
                unsigned :1;
        };
-} LATAbits_t;
+} __LATAbits_t;
 
-extern volatile LATAbits_t at 0xf89 LATAbits;
+extern volatile __LATAbits_t at 0xf89 LATAbits;
 
 extern sfr at 0xf8a LATB;
 typedef union {
@@ -1942,9 +1942,9 @@ typedef union {
                unsigned LATB6:1;
                unsigned LATB7:1;
        };
-} LATBbits_t;
+} __LATBbits_t;
 
-extern volatile LATBbits_t at 0xf8a LATBbits;
+extern volatile __LATBbits_t at 0xf8a LATBbits;
 
 extern sfr at 0xf8b LATC;
 typedef union {
@@ -1958,9 +1958,9 @@ typedef union {
                unsigned LATC6:1;
                unsigned LATC7:1;
        };
-} LATCbits_t;
+} __LATCbits_t;
 
-extern volatile LATCbits_t at 0xf8b LATCbits;
+extern volatile __LATCbits_t at 0xf8b LATCbits;
 
 extern sfr at 0xf8c LATD;
 typedef union {
@@ -1974,9 +1974,9 @@ typedef union {
                unsigned LATD6:1;
                unsigned LATD7:1;
        };
-} LATDbits_t;
+} __LATDbits_t;
 
-extern volatile LATDbits_t at 0xf8c LATDbits;
+extern volatile __LATDbits_t at 0xf8c LATDbits;
 
 extern sfr at 0xf8d LATE;
 typedef union {
@@ -1990,9 +1990,9 @@ typedef union {
                unsigned LATE6:1;
                unsigned LATE7:1;
        };
-} LATEbits_t;
+} __LATEbits_t;
 
-extern volatile LATEbits_t at 0xf8d LATEbits;
+extern volatile __LATEbits_t at 0xf8d LATEbits;
 
 extern sfr at 0xf92 TRISA;
 typedef union {
@@ -2006,9 +2006,9 @@ typedef union {
                unsigned TRISA6:1;
                unsigned :1;
        };
-} TRISAbits_t;
+} __TRISAbits_t;
 
-extern volatile TRISAbits_t at 0xf92 TRISAbits;
+extern volatile __TRISAbits_t at 0xf92 TRISAbits;
 
 extern sfr at 0xf93 TRISB;
 typedef union {
@@ -2022,9 +2022,9 @@ typedef union {
                unsigned TRISB6:1;
                unsigned TRISB7:1;
        };
-} TRISBbits_t;
+} __TRISBbits_t;
 
-extern volatile TRISBbits_t at 0xf93 TRISBbits;
+extern volatile __TRISBbits_t at 0xf93 TRISBbits;
 
 extern sfr at 0xf94 TRISC;
 typedef union {
@@ -2038,9 +2038,9 @@ typedef union {
                unsigned TRISC6:1;
                unsigned TRISC7:1;
        };
-} TRISCbits_t;
+} __TRISCbits_t;
 
-extern volatile TRISCbits_t at 0xf94 TRISCbits;
+extern volatile __TRISCbits_t at 0xf94 TRISCbits;
 
 extern sfr at 0xf95 TRISD;
 typedef union {
@@ -2054,9 +2054,9 @@ typedef union {
                unsigned TRISD6:1;
                unsigned TRISD7:1;
        };
-} TRISDbits_t;
+} __TRISDbits_t;
 
-extern volatile TRISDbits_t at 0xf95 TRISDbits;
+extern volatile __TRISDbits_t at 0xf95 TRISDbits;
 
 extern sfr at 0xf96 TRISE;
 typedef union {
@@ -2070,9 +2070,9 @@ typedef union {
                unsigned OBF:1;
                unsigned IBF:1;
        };
-} TRISEbits_t;
+} __TRISEbits_t;
 
-extern volatile TRISEbits_t at 0xf96 TRISEbits;
+extern volatile __TRISEbits_t at 0xf96 TRISEbits;
 
 extern sfr at 0xf9d PIE1;
 typedef union {
@@ -2086,9 +2086,9 @@ typedef union {
                unsigned ADIE:1;
                unsigned PSPIE:1;
        };
-} PIE1bits_t;
+} __PIE1bits_t;
 
-extern volatile PIE1bits_t at 0xf9d PIE1bits;
+extern volatile __PIE1bits_t at 0xf9d PIE1bits;
 
 extern sfr at 0xf9e PIR1;
 typedef union {
@@ -2102,9 +2102,9 @@ typedef union {
                unsigned ADIF:1;
                unsigned PSPIF:1;
        };
-} PIR1bits_t;
+} __PIR1bits_t;
 
-extern volatile PIR1bits_t at 0xf9e PIR1bits;
+extern volatile __PIR1bits_t at 0xf9e PIR1bits;
 
 extern sfr at 0xf9f IPR1;
 typedef union {
@@ -2118,9 +2118,9 @@ typedef union {
                unsigned ADIP:1;
                unsigned PSPIP:1;
        };
-} IPR1bits_t;
+} __IPR1bits_t;
 
-extern volatile IPR1bits_t at 0xf9f IPR1bits;
+extern volatile __IPR1bits_t at 0xf9f IPR1bits;
 
 extern sfr at 0xfa0 PIE2;
 typedef union {
@@ -2134,9 +2134,9 @@ typedef union {
                unsigned CMIE:1;
                unsigned :1;
        };
-} PIE2bits_t;
+} __PIE2bits_t;
 
-extern volatile PIE2bits_t at 0xfa0 PIE2bits;
+extern volatile __PIE2bits_t at 0xfa0 PIE2bits;
 
 extern sfr at 0xfa1 PIR2;
 typedef union {
@@ -2150,9 +2150,9 @@ typedef union {
                unsigned CMIF:1;
                unsigned :1;
        };
-} PIR2bits_t;
+} __PIR2bits_t;
 
-extern volatile PIR2bits_t at 0xfa1 PIR2bits;
+extern volatile __PIR2bits_t at 0xfa1 PIR2bits;
 
 extern sfr at 0xfa2 IPR2;
 typedef union {
@@ -2166,9 +2166,9 @@ typedef union {
                unsigned CMIP:1;
                unsigned :1;
        };
-} IPR2bits_t;
+} __IPR2bits_t;
 
-extern volatile IPR2bits_t at 0xfa2 IPR2bits;
+extern volatile __IPR2bits_t at 0xfa2 IPR2bits;
 
 extern sfr at 0xfa3 PIE3;
 typedef union {
@@ -2182,9 +2182,9 @@ typedef union {
                unsigned WAKIE:1;
                unsigned IVRE:1;
        };
-} PIE3bits_t;
+} __PIE3bits_t;
 
-extern volatile PIE3bits_t at 0xfa3 PIE3bits;
+extern volatile __PIE3bits_t at 0xfa3 PIE3bits;
 
 extern sfr at 0xfa4 PIR3;
 typedef union {
@@ -2198,9 +2198,9 @@ typedef union {
                unsigned WAKIF:1;
                unsigned IVRF:1;
        };
-} PIR3bits_t;
+} __PIR3bits_t;
 
-extern volatile PIR3bits_t at 0xfa4 PIR3bits;
+extern volatile __PIR3bits_t at 0xfa4 PIR3bits;
 
 extern sfr at 0xfa5 IPR3;
 typedef union {
@@ -2214,9 +2214,9 @@ typedef union {
                unsigned WAKIP:1;
                unsigned IVRP:1;
        };
-} IPR3bits_t;
+} __IPR3bits_t;
 
-extern volatile IPR3bits_t at 0xfa5 IPR3bits;
+extern volatile __IPR3bits_t at 0xfa5 IPR3bits;
 
 extern sfr at 0xfa6 EECON1;
 typedef union {
@@ -2230,9 +2230,9 @@ typedef union {
                unsigned CFGS:1;
                unsigned EEPGD:1;
        };
-} EECON1bits_t;
+} __EECON1bits_t;
 
-extern volatile EECON1bits_t at 0xfa6 EECON1bits;
+extern volatile __EECON1bits_t at 0xfa6 EECON1bits;
 
 extern sfr at 0xfa7 EECON2;
 extern sfr at 0xfa8 EEDATA;
@@ -2249,9 +2249,9 @@ typedef union {
                unsigned RX9:1;
                unsigned SPEN:1;
        };
-} RCSTAbits_t;
+} __RCSTAbits_t;
 
-extern volatile RCSTAbits_t at 0xfab RCSTAbits;
+extern volatile __RCSTAbits_t at 0xfab RCSTAbits;
 
 extern sfr at 0xfac TXSTA;
 typedef union {
@@ -2265,9 +2265,9 @@ typedef union {
                unsigned TX9:1;
                unsigned CSRC:1;
        };
-} TXSTAbits_t;
+} __TXSTAbits_t;
 
-extern volatile TXSTAbits_t at 0xfac TXSTAbits;
+extern volatile __TXSTAbits_t at 0xfac TXSTAbits;
 
 extern sfr at 0xfad TXREG;
 extern sfr at 0xfae RCREG;
@@ -2284,9 +2284,9 @@ typedef union {
                unsigned OBF:1;
                unsigned IBF:1;
        };
-} PSPCONbits_t;
+} __PSPCONbits_t;
 
-extern volatile PSPCONbits_t at 0xfb0 PSPCONbits;
+extern volatile __PSPCONbits_t at 0xfb0 PSPCONbits;
 
 extern sfr at 0xfb1 T3CON;
 typedef union {
@@ -2300,9 +2300,9 @@ typedef union {
                unsigned T3CCP2:1;
                unsigned RD16:1;
        };
-} T3CONbits_t;
+} __T3CONbits_t;
 
-extern volatile T3CONbits_t at 0xfb1 T3CONbits;
+extern volatile __T3CONbits_t at 0xfb1 T3CONbits;
 
 extern sfr at 0xfb2 TMR3L;
 extern sfr at 0xfb3 TMR3H;
@@ -2318,9 +2318,9 @@ typedef union {
                unsigned C1OUT:1;
                unsigned C2OUT:1;
        };
-} CMCONbits_t;
+} __CMCONbits_t;
 
-extern volatile CMCONbits_t at 0xfb4 CMCONbits;
+extern volatile __CMCONbits_t at 0xfb4 CMCONbits;
 
 extern sfr at 0xfb5 CVRCON;
 typedef union {
@@ -2334,9 +2334,9 @@ typedef union {
                unsigned CVROE:1;
                unsigned CVREN:1;
        };
-} CVRCONbits_t;
+} __CVRCONbits_t;
 
-extern volatile CVRCONbits_t at 0xfb5 CVRCONbits;
+extern volatile __CVRCONbits_t at 0xfb5 CVRCONbits;
 
 extern sfr at 0xfb6 ECCPAS;
 typedef union {
@@ -2350,9 +2350,9 @@ typedef union {
                unsigned ECCPAS2:1;
                unsigned ECCPASE:1;
        };
-} ECCPASbits_t;
+} __ECCPASbits_t;
 
-extern volatile ECCPASbits_t at 0xfb6 ECCPASbits;
+extern volatile __ECCPASbits_t at 0xfb6 ECCPASbits;
 
 extern sfr at 0xfb7 ECCP1DEL;
 typedef union {
@@ -2366,9 +2366,9 @@ typedef union {
                unsigned EPDC6:1;
                unsigned EPDC7:1;
        };
-} ECCP1DELbits_t;
+} __ECCP1DELbits_t;
 
-extern volatile ECCP1DELbits_t at 0xfb7 ECCP1DELbits;
+extern volatile __ECCP1DELbits_t at 0xfb7 ECCP1DELbits;
 
 extern sfr at 0xfba ECCP1CON;
 typedef union {
@@ -2382,9 +2382,9 @@ typedef union {
                unsigned EPWM1M0:1;
                unsigned EPWM1M1:1;
        };
-} ECCP1CONbits_t;
+} __ECCP1CONbits_t;
 
-extern volatile ECCP1CONbits_t at 0xfba ECCP1CONbits;
+extern volatile __ECCP1CONbits_t at 0xfba ECCP1CONbits;
 
 extern sfr at 0xfbb ECCPR1L;
 extern sfr at 0xfbc ECCPR1H;
@@ -2400,9 +2400,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} CCP1CONbits_t;
+} __CCP1CONbits_t;
 
-extern volatile CCP1CONbits_t at 0xfbd CCP1CONbits;
+extern volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
 
 extern sfr at 0xfbe CCPR1L;
 extern sfr at 0xfbf CCPR1H;
@@ -2418,9 +2418,9 @@ typedef union {
                unsigned ADCS2:1;
                unsigned ADFM:1;
        };
-} ADCON1bits_t;
+} __ADCON1bits_t;
 
-extern volatile ADCON1bits_t at 0xfc1 ADCON1bits;
+extern volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
 
 extern sfr at 0xfc2 ADCON0;
 typedef union {
@@ -2434,9 +2434,9 @@ typedef union {
                unsigned ADCS0:1;
                unsigned ADCS1:1;
        };
-} ADCON0bits_t;
+} __ADCON0bits_t;
 
-extern volatile ADCON0bits_t at 0xfc2 ADCON0bits;
+extern volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
 
 extern sfr at 0xfc3 ADRESL;
 extern sfr at 0xfc4 ADRESH;
@@ -2452,9 +2452,9 @@ typedef union {
                unsigned ACKSTAT:1;
                unsigned GCEN:1;
        };
-} SSPCON2bits_t;
+} __SSPCON2bits_t;
 
-extern volatile SSPCON2bits_t at 0xfc5 SSPCON2bits;
+extern volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
 
 extern sfr at 0xfc6 SSPCON1;
 typedef union {
@@ -2468,9 +2468,9 @@ typedef union {
                unsigned SSPOV:1;
                unsigned WCOL:1;
        };
-} SSPCON1bits_t;
+} __SSPCON1bits_t;
 
-extern volatile SSPCON1bits_t at 0xfc6 SSPCON1bits;
+extern volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
 
 extern sfr at 0xfc7 SSPSTAT;
 typedef union {
@@ -2484,9 +2484,9 @@ typedef union {
                unsigned CKE:1;
                unsigned SMP:1;
        };
-} SSPSTATbits_t;
+} __SSPSTATbits_t;
 
-extern volatile SSPSTATbits_t at 0xfc7 SSPSTATbits;
+extern volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
 
 extern sfr at 0xfc8 SSPADD;
 extern sfr at 0xfc9 SSPBUF;
@@ -2502,9 +2502,9 @@ typedef union {
                unsigned TOUTPS3:1;
                unsigned :1;
        };
-} T2CONbits_t;
+} __T2CONbits_t;
 
-extern volatile T2CONbits_t at 0xfca T2CONbits;
+extern volatile __T2CONbits_t at 0xfca T2CONbits;
 
 extern sfr at 0xfcb PR2;
 extern sfr at 0xfcc TMR2;
@@ -2520,9 +2520,9 @@ typedef union {
                unsigned :1;
                unsigned RD16:1;
        };
-} T1CONbits_t;
+} __T1CONbits_t;
 
-extern volatile T1CONbits_t at 0xfcd T1CONbits;
+extern volatile __T1CONbits_t at 0xfcd T1CONbits;
 
 extern sfr at 0xfce TMR1L;
 extern sfr at 0xfcf TMR1H;
@@ -2538,9 +2538,9 @@ typedef union {
                unsigned :1;
                unsigned IPEN:1;
        };
-} RCONbits_t;
+} __RCONbits_t;
 
-extern volatile RCONbits_t at 0xfd0 RCONbits;
+extern volatile __RCONbits_t at 0xfd0 RCONbits;
 
 extern sfr at 0xfd1 WDTCON;
 typedef union {
@@ -2565,9 +2565,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} WDTCONbits_t;
+} __WDTCONbits_t;
 
-extern volatile WDTCONbits_t at 0xfd1 WDTCONbits;
+extern volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
 
 extern sfr at 0xfd2 LVDCON;
 typedef union {
@@ -2592,9 +2592,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} LVDCONbits_t;
+} __LVDCONbits_t;
 
-extern volatile LVDCONbits_t at 0xfd2 LVDCONbits;
+extern volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
 
 extern sfr at 0xfd3 OSCCON;
 typedef union {
@@ -2608,9 +2608,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} OSCCONbits_t;
+} __OSCCONbits_t;
 
-extern volatile OSCCONbits_t at 0xfd3 OSCCONbits;
+extern volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
 
 extern sfr at 0xfd5 T0CON;
 extern sfr at 0xfd6 TMR0L;
@@ -2627,9 +2627,9 @@ typedef union {
                unsigned :1;
                unsigned :1;
        };
-} STATUSbits_t;
+} __STATUSbits_t;
 
-extern volatile STATUSbits_t at 0xfd8 STATUSbits;
+extern volatile __STATUSbits_t at 0xfd8 STATUSbits;
 
 extern sfr at 0xfd9 FSR2L;
 extern sfr at 0xfda FSR2H;
@@ -2677,9 +2677,9 @@ typedef union {
                unsigned INT1IP:1;
                unsigned :1;
        };
-} INTCON3bits_t;
+} __INTCON3bits_t;
 
-extern volatile INTCON3bits_t at 0xff0 INTCON3bits;
+extern volatile __INTCON3bits_t at 0xff0 INTCON3bits;
 
 extern sfr at 0xff1 INTCON2;
 typedef union {
@@ -2693,9 +2693,9 @@ typedef union {
                unsigned INTEDG0:1;
                unsigned RBPU:1;
        };
-} INTCON2bits_t;
+} __INTCON2bits_t;
 
-extern volatile INTCON2bits_t at 0xff1 INTCON2bits;
+extern volatile __INTCON2bits_t at 0xff1 INTCON2bits;
 
 extern sfr at 0xff2 INTCON;
 typedef union {
@@ -2709,9 +2709,9 @@ typedef union {
                unsigned PEIE:1;
                unsigned GIE:1;
        };
-} INTCONbits_t;
+} __INTCONbits_t;
 
-extern volatile INTCONbits_t at 0xff2 INTCONbits;
+extern volatile __INTCONbits_t at 0xff2 INTCONbits;
 
 extern sfr at 0xff3 PRODL;
 extern sfr at 0xff4 PRODH;
@@ -2734,14 +2734,154 @@ typedef union {
                unsigned STKUNF:1;
                unsigned STKFUL:1;
        };
-} STKPTRbits_t;
+} __STKPTRbits_t;
 
-extern volatile STKPTRbits_t at 0xffc STKPTRbits;
+extern volatile __STKPTRbits_t at 0xffc STKPTRbits;
 
 extern sfr at 0xffd TOSL;
 extern sfr at 0xffe TOSH;
 extern sfr at 0xfff TOSU;
 
 
-#endif
+/* Configuration registers locations */
+#define __CONFIG0H     0x300001
+#define __CONFIG1L     0x300002
+#define __CONFIG1H     0x300003
+#define __CONFIG3L     0x300006
+#define __CONFIG4L     0x300008
+#define __CONFIG4H     0x300009
+#define __CONFIG5L     0x30000A
+#define __CONFIG5H     0x30000B
+#define __CONFIG6L     0x30000C
+#define __CONFIG6H     0x30000D
+
+
+
+/* Oscillator 0H options */
+#define _OSC_RC_OSC2_0H        0xFF    /* RC-OSC2 as RA6 */
+#define _OSC_HS_PLL_0H 0xFE    /* HS-PLL Enabled */
+#define _OSC_EC_OSC2_RA6_0H    0xFD    /* EC-OSC2 as RA6 */
+#define _OSC_EC_OSC2_Clock_Out_0H      0xFC    /* EC-OSC2 as Clock_Out */
+#define _OSC_RC_0H     0xFB    /* RC */
+#define _OSC_HS_0H     0xFA    /* HS */
+#define _OSC_XT_0H     0xF9    /* XT */
+#define _OSC_LP_0H     0xF8    /* LP */
+
+/* Osc. Switch Enable 0H options */
+#define _OSCS_OFF_0H   0xFF    /* Disabled */
+#define _OSCS_ON_0H    0xDF    /* Enabled */
+
+/* Power Up Timer 1L options */
+#define _PUT_OFF_1L    0xFF    /* Disabled */
+#define _PUT_ON_1L     0xFE    /* Enabled */
+
+/* Brown Out Detect 1L options */
+#define _BODEN_ON_1L   0xFF    /* Enabled */
+#define _BODEN_OFF_1L  0xFD    /* Disabled */
+
+/* Brown Out Voltage 1L options */
+#define _BODENV_2_0V_1L        0xFF    /* 2.0V */
+#define _BODENV_2_7V_1L        0xFB    /* 2.7V */
+#define _BODENV_4_2V_1L        0xF7    /* 4.2V */
+#define _BODENV_4_5V_1L        0xF3    /* 4.5V */
+
+/* Watchdog Timer 1H options */
+#define _WDT_ON_1H     0xFF    /* Enabled */
+#define _WDT_OFF_1H    0xFE    /* Disabled */
+
+/* Watchdog Postscaler 1H options */
+#define _WDTPS_1_128_1H        0xFF    /* 1:128 */
+#define _WDTPS_1_64_1H 0xFD    /* 1:64 */
+#define _WDTPS_1_32_1H 0xFB    /* 1:32 */
+#define _WDTPS_1_16_1H 0xF9    /* 1:16 */
+#define _WDTPS_1_8_1H  0xF7    /* 1:8 */
+#define _WDTPS_1_4_1H  0xF5    /* 1:4 */
+#define _WDTPS_1_2_1H  0xF3    /* 1:2 */
+#define _WDTPS_1_1_1H  0xF1    /* 1:1 */
+
+/* Low Voltage Program 3L options */
+#define _LVP_ON_3L     0xFF    /* Enabled */
+#define _LVP_OFF_3L    0xFB    /* Disabled */
+
+/* Background Debug 3L options */
+#define _BACKBUG_OFF_3L        0xFF    /* Disabled */
+#define _BACKBUG_ON_3L 0x7F    /* Enabled */
+
+/* Stack Overflow Reset 3L options */
+#define _STVR_ON_3L    0xFF    /* Enabled */
+#define _STVR_OFF_3L   0xFE    /* Disabled */
+
+/* Code Protect 00200-01FFF 4L options */
+#define _CP_0_OFF_4L   0xFF    /* Disabled */
+#define _CP_0_ON_4L    0xFE    /* Enabled */
+
+/* Code Protect 02000-03FFF 4L options */
+#define _CP_1_OFF_4L   0xFF    /* Disabled */
+#define _CP_1_ON_4L    0xFD    /* Enabled */
+
+/* Code Protect 04000-05FFF 4L options */
+#define _CP_2_OFF_4L   0xFF    /* Disabled */
+#define _CP_2_ON_4L    0xFB    /* Enabled */
+
+/* Code Protect 06000-07FFF 4L options */
+#define _CP_3_OFF_4L   0xFF    /* Disabled */
+#define _CP_3_ON_4L    0xF7    /* Enabled */
+
+/* Data EE Read Protect 4H options */
+#define _CPD_OFF_4H    0xFF    /* Disabled */
+#define _CPD_ON_4H     0x7F    /* Enabled */
+
+/* Code Protect Boot 4H options */
+#define _CPB_OFF_4H    0xFF    /* Disabled */
+#define _CPB_ON_4H     0xBF    /* Enabled */
+
+/* Table Write Protect 00200-01FFF 5L options */
+#define _WRT_0_OFF_5L  0xFF    /* Disabled */
+#define _WRT_0_ON_5L   0xFE    /* Enabled */
+
+/* Table Write Protect 02000-03FFF 5L options */
+#define _WRT_1_OFF_5L  0xFF    /* Disabled */
+#define _WRT_1_ON_5L   0xFD    /* Enabled */
+
+/* Table Write Protect 04000-05FFF 5L options */
+#define _WRT_2_OFF_5L  0xFF    /* Disabled */
+#define _WRT_2_ON_5L   0xFB    /* Enabled */
+
+/* Table Write Protect 06000-07FFF 5L options */
+#define _WRT_3_OFF_5L  0xFF    /* Disabled */
+#define _WRT_3_ON_5L   0xF7    /* Enabled */
+
+/* Data EE Write Protect 5H options */
+#define _WRTD_OFF_5H   0xFF    /* Disabled */
+#define _WRTD_ON_5H    0x7F    /* Enabled */
+
+/* Table Write Protect Boot 5H options */
+#define _WRTB_OFF_5H   0xFF    /* Disabled */
+#define _WRTB_ON_5H    0xBF    /* Enabled */
+
+/* Config. Write Protect 5H options */
+#define _WRTC_OFF_5H   0xFF    /* Disabled */
+#define _WRTC_ON_5H    0xDF    /* Enabled */
+
+/* Table Read Protect 00200-01FFF 6L options */
+#define _EBTR_0_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_0_ON_6L  0xFE    /* Enabled */
+
+/* Table Read Protect 02000-03FFF 6L options */
+#define _EBTR_1_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_1_ON_6L  0xFD    /* Enabled */
+
+/* Table Read Protect 04000-05FFF 6L options */
+#define _EBTR_2_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_2_ON_6L  0xFB    /* Enabled */
 
+/* Table Read Protect 06000-07FFF 6L options */
+#define _EBTR_3_OFF_6L 0xFF    /* Disabled */
+#define _EBTR_3_ON_6L  0xF7    /* Enabled */
+
+/* Table Read Protect Boot 6H options */
+#define _EBTRB_OFF_6H  0xFF    /* Disabled */
+#define _EBTRB_ON_6H   0xBF    /* Enabled */
+
+
+#endif
index 2954aef91c458c596c07291cbb3043c6da616c9d..351671340d97aa723169b1450b104e5525824ab7 100644 (file)
 #elif defined(pic18f458)
 #  include <pic18f458.h>
 
+#elif defined(pic18f1220)
+#  include <pic18f1220.h>
+
+#elif defined(pic18f6520)
+#  include <pic18f6520.h>
+
+#elif defined(pic18f6620)
+#  include <pic18f6620.h>
+
+#elif defined(pic18f6680)
+#  include <pic18f6680.h>
+
+#elif defined(pic18f6720)
+#  include <pic18f6780.h>
+
+#elif defined(pic18f8520)
+#  include <pic18f8520.h>
+
+#elif defined(pic18f8620)
+#  include <pic18f8620.h>
+
+#elif defined(pic18f8680)
+#  include <pic18f8680.h>
+
+#elif defined(pic18f8720)
+#  include <pic18f8720.h>
+
 #else
 #  error Unsupported processor
 
index 8c978cf0ee229cc4c424a4e77f354c9886443884..0ff899cd4d24e8eb46a6311f1c3864fc17c2d7a4 100644 (file)
@@ -208,7 +208,7 @@ model-pic16:
          fi
 
 objects-pic16: build-dir port-specific-objects-pic16 clean_intermediate-pic16
-       cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib
+       cd $(PORTDIR)/bin; ls *$(OEXT) > $(PORT).lib
 
 
 build-dir: $(PORTDIR)
@@ -225,7 +225,7 @@ port-specific-objects:
 port-specific-objects-pic16:
        if [ -d $(PORT) ]; then \
          $(MAKE) -C $(PORT); \
-         cp -f $(PORT)/*.lib $(PORTDIR); \
+         cp -f $(PORT)/bin/* $(PORTDIR); \
        fi
 
 lib-files:
diff --git a/device/lib/pic16/Makefile b/device/lib/pic16/Makefile
new file mode 100644 (file)
index 0000000..78715a8
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# Makefile - toplevel makefile that builds everything
+#
+# This file is part of the GNU PIC Library.
+#
+# January, 2004
+# The GNU PIC Library is maintained by,
+#      Vangelis Rokas <vrokas@otenet.gr>
+#
+# $Id$
+#
+#
+
+
+include ./Makefile.common
+
+
+DIRS   =       libdev  \
+               libsdcc \
+               startup
+
+
+all: build-all-libraries
+
+build-all-libraries:
+       @for temp in $(DIRS) ; do \
+               $(MAKE) -C $$temp MODELFLAGS=$(MODELFLAGS) ; \
+       done
+
+
+clean: all-clean
+       $(RM) -f bin/*
+
+
+
+all-clean:
+       @for temp in $(DIRS) ; do \
+               $(MAKE) -C $$temp clean ; \
+       done
+
+clean-intermediate:
+       @for temp in $(DIRS) ; do \
+               $(MAKE) -C $$temp clean-intermediate ; \
+       done
+
+
+dep: all-dep
+
+all-dep:
+       for temp in $(DIRS) ; do \
+               $(MAKE) -C $$temp dep ; \
+       done
+       
\ No newline at end of file
diff --git a/device/lib/pic16/Makefile.common.in b/device/lib/pic16/Makefile.common.in
new file mode 100644 (file)
index 0000000..2bd5633
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# Makefile.common - common variables makefile
+#
+# This file is part of the GNU PIC Library.
+#
+# January, 2004
+# The GNU PIC Library is maintained by,
+#      Vangelis Rokas <vrokas@otenet.gr>
+#
+# $Id$
+#
+#
+
+CC     = $(PRJDIR)/bin/sdcc
+CPP    = $(PRJDIR)/bin/sdcpp
+
+AS     = @GPASM@
+LD     = @GPLINK@
+AR     = @GPLIB@
+
+RM     = @RM@
+CP     = @CP@
+MV     = @MV@
+LS     = @LS@
+SED    = @SED@
+
+MM     = -MM
+MODELFLAGS     = -mpic16
\ No newline at end of file
diff --git a/device/lib/pic16/README b/device/lib/pic16/README
new file mode 100644 (file)
index 0000000..1c811dd
--- /dev/null
@@ -0,0 +1 @@
+This directory contains pic16 specific libraries
diff --git a/device/lib/pic16/configure b/device/lib/pic16/configure
new file mode 100755 (executable)
index 0000000..5ea2db5
--- /dev/null
@@ -0,0 +1,2360 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.57.
+#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)$' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+         /^X\/\(\/\/\)$/{ s//\1/; q; }
+         /^X\/\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+        case $as_dir in
+        /*)
+          if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+            CONFIG_SHELL=$as_dir/$as_base
+            export CONFIG_SHELL
+            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+          fi;;
+        esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='     ' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS="  $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS GPASM GPLINK GPLIB RM CP MV LS SED LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+              localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$0" : 'X\(//\)[^/]' \| \
+         X"$0" : 'X\(//\)$' \| \
+         X"$0" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+           test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd $ac_popdir
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.57.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+        ac_must_keep_next=false # Got value, back to normal.
+      else
+        case $ac_arg in
+          *=* | --config-cache | -C | -disable-* | --disable-* \
+          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+          | -with-* | --with-* | -without-* | --without-* | --x)
+            case "$ac_configure_args0 " in
+              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+            esac
+            ;;
+          -* ) ac_must_keep_next=true ;;
+        esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=$`echo $ac_var`
+        echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core core.* *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+        ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#AC_DEFUN(AC_CONFIG_SRCDIR)
+#AC_DEFUN(AC_CONFIG_FILES)
+
+# Checks for programs.
+# Extract the first word of "gpasm", so it can be a program name with args.
+set dummy gpasm; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GPASM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$GPASM"; then
+  ac_cv_prog_GPASM="$GPASM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GPASM="gpasm"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_GPASM" && ac_cv_prog_GPASM=":"
+fi
+fi
+GPASM=$ac_cv_prog_GPASM
+if test -n "$GPASM"; then
+  echo "$as_me:$LINENO: result: $GPASM" >&5
+echo "${ECHO_T}$GPASM" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+# Extract the first word of "gplink", so it can be a program name with args.
+set dummy gplink; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GPLINK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$GPLINK"; then
+  ac_cv_prog_GPLINK="$GPLINK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GPLINK="gplink"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_GPLINK" && ac_cv_prog_GPLINK=":"
+fi
+fi
+GPLINK=$ac_cv_prog_GPLINK
+if test -n "$GPLINK"; then
+  echo "$as_me:$LINENO: result: $GPLINK" >&5
+echo "${ECHO_T}$GPLINK" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+# Extract the first word of "gplib", so it can be a program name with args.
+set dummy gplib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GPLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$GPLIB"; then
+  ac_cv_prog_GPLIB="$GPLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GPLIB="gplib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_GPLIB" && ac_cv_prog_GPLIB=":"
+fi
+fi
+GPLIB=$ac_cv_prog_GPLIB
+if test -n "$GPLIB"; then
+  echo "$as_me:$LINENO: result: $GPLIB" >&5
+echo "${ECHO_T}$GPLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+# Extract the first word of "rm", so it can be a program name with args.
+set dummy rm; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RM"; then
+  ac_cv_prog_RM="$RM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RM="rm"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_RM" && ac_cv_prog_RM=":"
+fi
+fi
+RM=$ac_cv_prog_RM
+if test -n "$RM"; then
+  echo "$as_me:$LINENO: result: $RM" >&5
+echo "${ECHO_T}$RM" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+# Extract the first word of "cp", so it can be a program name with args.
+set dummy cp; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CP"; then
+  ac_cv_prog_CP="$CP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CP="cp"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_CP" && ac_cv_prog_CP=":"
+fi
+fi
+CP=$ac_cv_prog_CP
+if test -n "$CP"; then
+  echo "$as_me:$LINENO: result: $CP" >&5
+echo "${ECHO_T}$CP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+# Extract the first word of "mv", so it can be a program name with args.
+set dummy mv; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MV+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MV"; then
+  ac_cv_prog_MV="$MV" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_MV="mv"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_MV" && ac_cv_prog_MV=":"
+fi
+fi
+MV=$ac_cv_prog_MV
+if test -n "$MV"; then
+  echo "$as_me:$LINENO: result: $MV" >&5
+echo "${ECHO_T}$MV" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+# Extract the first word of "ls", so it can be a program name with args.
+set dummy ls; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LS"; then
+  ac_cv_prog_LS="$LS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LS="ls"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_LS" && ac_cv_prog_LS=":"
+fi
+fi
+LS=$ac_cv_prog_LS
+if test -n "$LS"; then
+  echo "$as_me:$LINENO: result: $LS" >&5
+echo "${ECHO_T}$LS" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+# Extract the first word of "sed", so it can be a program name with args.
+set dummy sed; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$SED"; then
+  ac_cv_prog_SED="$SED" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_SED="sed"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_SED" && ac_cv_prog_SED=":"
+fi
+fi
+SED=$ac_cv_prog_SED
+if test -n "$SED"; then
+  echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+# Checks for libraries.
+
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+
+# Checks for library functions.
+
+          ac_config_files="$ac_config_files Makefile.common"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+        "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[        ]*VPATH[        ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[   ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[     ]*$//;
+}'
+fi
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[   ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\),-D\1=\2,g
+t quote
+s,^[   ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[    `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output.  A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)$' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+         /^X\/\(\/\/\)$/{ s//\1/; q; }
+         /^X\/\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+        case $as_dir in
+        /*)
+          if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+            CONFIG_SHELL=$as_dir/$as_base
+            export CONFIG_SHELL
+            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+          fi;;
+        esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='     ' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS="  $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.57.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.57,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile.common" ) CONFIG_FILES="$CONFIG_FILES Makefile.common" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@GPASM@,$GPASM,;t t
+s,@GPLINK@,$GPLINK,;t t
+s,@GPLIB@,$GPLIB,;t t
+s,@RM@,$RM,;t t
+s,@CP@,$CP,;t t
+s,@MV@,$MV,;t t
+s,@LS@,$LS,;t t
+s,@SED@,$SED,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+       ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+       ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+        cat >$tmp/stdin
+        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_file" : 'X\(//\)[^/]' \| \
+         X"$ac_file" : 'X\(//\)$' \| \
+         X"$ac_file" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$as_dir" : 'X\(//\)[^/]' \| \
+         X"$as_dir" : 'X\(//\)$' \| \
+         X"$as_dir" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+                                     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+         # Absolute (can't be DOS-style, as IFS=:)
+         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         echo $f;;
+      *) # Relative
+         if test -f "$f"; then
+           # Build tree
+           echo $f
+         elif test -f "$srcdir/$f"; then
+           # Source tree
+           echo $srcdir/$f
+         else
+           # /dev/null tree
+           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff --git a/device/lib/pic16/configure.in b/device/lib/pic16/configure.in
new file mode 100644 (file)
index 0000000..d6daa2d
--- /dev/null
@@ -0,0 +1,41 @@
+#
+# configure.in - input script to autoconf to
+#                configure directory
+#
+# This file is part of the GNU PIC Library.
+#
+# January, 2004
+# The GNU PIC Library is maintained by,
+#      Vangelis Rokas <vrokas@otenet.gr>
+#
+# $Id$
+#
+
+# Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.57)
+AC_INIT
+
+#AC_DEFUN(AC_CONFIG_SRCDIR)
+#AC_DEFUN(AC_CONFIG_FILES)
+
+# Checks for programs.
+AC_CHECK_PROG(GPASM,   gpasm,  gpasm, :)
+AC_CHECK_PROG(GPLINK,  gplink, gplink, :)
+AC_CHECK_PROG(GPLIB,   gplib,  gplib, :)
+
+AC_CHECK_PROG(RM,      rm,     rm, :)
+AC_CHECK_PROG(CP,      cp,     cp, :)
+AC_CHECK_PROG(MV,      mv,     mv, :)
+AC_CHECK_PROG(LS,      ls,     ls, :)
+AC_CHECK_PROG(SED,     sed,    sed, :)
+
+# Checks for libraries.
+
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+
+# Checks for library functions.
+
+AC_CONFIG_FILES([Makefile.common])
+AC_OUTPUT
diff --git a/device/lib/pic16/libdev/Makefile b/device/lib/pic16/libdev/Makefile
new file mode 100644 (file)
index 0000000..3b946f3
--- /dev/null
@@ -0,0 +1,93 @@
+#
+# Makefile  - Makefile to build device libraries
+#
+# This file is part of the GNU PIC Library.
+#
+# January, 2004
+# The GNU PIC Library is maintained by,
+#      Vangelis Rokas <vrokas@otenet.gr>
+#
+# $Id$
+#
+#
+
+include ../Makefile.common
+
+# The SDCC project directory
+PRJDIR = ../../../..
+
+# headers directory
+INCDIR = $(PRJDIR)/device/include
+
+
+# Supported devices
+DEVS   =       18f242 \
+               18f248 \
+               18f252 \
+               18f258 \
+               18f442 \
+               18f448 \
+               18f452 \
+               18f458 \
+               18f1220 \
+               18f6520 \
+               18f6620 \
+               18f6680 \
+               18f6720 \
+               18f8520 \
+               18f8620 \
+               18f8680 \
+               18f8720
+
+
+# pic16 port specific headers
+PIC16_INCDIR   = $(INCDIR)/pic16
+
+CFLAGS = -I$(PIC16_INCDIR)
+
+#COMPILE_FLAGS = --pomit-config-words --pomit-ivt --no-peep
+COMPILE_FLAGS  += $(MODELFLAGS) --nostdinc
+
+
+CFILES = $(patsubst %,pic%.c, $(DEVS))
+OFILES = $(patsubst %.c,%.o,$(CFILES))
+LFILES = $(patsubst %.c,%.lib,$(CFILES))
+
+PFILE  = $(patsubst pic%.c,%,$<)
+LFILE  = $(patsubst %.c,%.lib,$<)
+
+
+.c.o:
+       $(CC) -p$(PFILE) $(CFLAGS) $(COMPILE_FLAGS) -c $<
+
+%.lib: %.o
+       $(AR) -c $@ $<
+       
+all: make-lib
+
+make-lib: $(LFILES)
+       @$(MV) -v $(LFILES) ../bin
+       
+$(LFILES): $(OFILES)
+
+$(OFILES): $(CFILES)
+
+
+clean-intermediate:
+       $(RM) -f *.lst *.asm *.dump*
+       
+clean: clean-intermediate
+       $(RM) -f *.o
+
+real-clean: clean
+       $(RM) -f .depend
+
+dep .depend:
+       rm -f .depend
+       for temp in $(CFILES); do               \
+               $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend;     \
+               $(SED) s/.rel/.o/g .tmpdepend >> .depend;       \
+               $(RM) -f .tmpdepend;    \
+       done
+       
+include .depend
diff --git a/device/lib/pic16/libdev/pic18f1220.c b/device/lib/pic16/libdev/pic18f1220.c
new file mode 100644 (file)
index 0000000..4df5d68
--- /dev/null
@@ -0,0 +1,167 @@
+
+/*
+ * pic18f1220.c - PIC18F1220 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f1220.h>
+
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfaa BAUDCTL;
+sfr at 0xfab RCSTA;
+volatile __RCSTAbits_t at 0xfab RCSTAbits;
+
+sfr at 0xfac TXSTA;
+volatile __TXSTAbits_t at 0xfac TXSTAbits;
+
+sfr at 0xfad TXREG;
+sfr at 0xfae RCREG;
+sfr at 0xfaf SPBRG;
+sfr at 0xfb0 SPBRGH;
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc0 ADCON2;
+volatile __ADCON2bits_t at 0xfc0 ADCON2bits;
+
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f242.c b/device/lib/pic16/libdev/pic18f242.c
new file mode 100644 (file)
index 0000000..dc281a7
--- /dev/null
@@ -0,0 +1,187 @@
+
+/*
+ * pic18f242.c - PIC18F242 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f242.h>
+
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfab RCSTA;
+volatile __RCSTAbits_t at 0xfab RCSTAbits;
+
+sfr at 0xfac TXSTA;
+volatile __TXSTAbits_t at 0xfac TXSTAbits;
+
+sfr at 0xfad TXREG;
+sfr at 0xfae RCREG;
+sfr at 0xfaf SPBRG;
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfba CCP2CON;
+volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
+
+sfr at 0xfbb CCPR2L;
+sfr at 0xfbc CCPR2H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f248.c b/device/lib/pic16/libdev/pic18f248.c
new file mode 100644 (file)
index 0000000..5dd454a
--- /dev/null
@@ -0,0 +1,520 @@
+
+/*
+ * pic18f248.c - PIC18F248 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f248.h>
+
+sfr at 0xf00 RXF0SIDH;
+volatile __RXF0SIDHbits_t at 0xf00 RXF0SIDHbits;
+
+sfr at 0xf01 RXF0SIDL;
+volatile __RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
+
+sfr at 0xf02 RXF0EIDH;
+volatile __RXF0EIDHbits_t at 0xf02 RXF0EIDHbits;
+
+sfr at 0xf03 RXF0EIDL;
+volatile __RXF0EIDLbits_t at 0xf03 RXF0EIDLbits;
+
+sfr at 0xf04 RXF1SIDH;
+volatile __RXF1SIDHbits_t at 0xf04 RXF1SIDHbits;
+
+sfr at 0xf05 RXF1SIDL;
+volatile __RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
+
+sfr at 0xf06 RXF1EIDH;
+volatile __RXF1EIDHbits_t at 0xf06 RXF1EIDHbits;
+
+sfr at 0xf07 RXF1EIDL;
+volatile __RXF1EIDLbits_t at 0xf07 RXF1EIDLbits;
+
+sfr at 0xf08 RXF2SIDH;
+volatile __RXF2SIDHbits_t at 0xf08 RXF2SIDHbits;
+
+sfr at 0xf09 RXF2SIDL;
+volatile __RXF2SIDLbits_t at 0xf09 RXF2SIDLbits;
+
+sfr at 0xf0a RXF2EIDH;
+volatile __RXF2EIDHbits_t at 0xf0a RXF2EIDHbits;
+
+sfr at 0xf0b RXF2EIDL;
+volatile __RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
+
+sfr at 0xf0c RXF3SIDH;
+volatile __RXF3SIDHbits_t at 0xf0c RXF3SIDHbits;
+
+sfr at 0xf0d RXF3SIDL;
+volatile __RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
+
+sfr at 0xf0e RXF3EIDH;
+volatile __RXF3EIDHbits_t at 0xf0e RXF3EIDHbits;
+
+sfr at 0xf0f RXF3EIDL;
+volatile __RXF3EIDLbits_t at 0xf0f RXF3EIDLbits;
+
+sfr at 0xf10 RXF4SIDH;
+volatile __RXF4SIDHbits_t at 0xf10 RXF4SIDHbits;
+
+sfr at 0xf11 RXF4SIDL;
+volatile __RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
+
+sfr at 0xf12 RXF4EIDH;
+volatile __RXF4EIDHbits_t at 0xf12 RXF4EIDHbits;
+
+sfr at 0xf13 RXF4EIDL;
+volatile __RXF4EIDLbits_t at 0xf13 RXF4EIDLbits;
+
+sfr at 0xf14 RXF5SIDH;
+volatile __RXF5SIDHbits_t at 0xf14 RXF5SIDHbits;
+
+sfr at 0xf15 RXF5SIDL;
+volatile __RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
+
+sfr at 0xf16 RXF5EIDH;
+volatile __RXF5EIDHbits_t at 0xf16 RXF5EIDHbits;
+
+sfr at 0xf17 RXF5EIDL;
+volatile __RXF5EIDLbits_t at 0xf17 RXF5EIDLbits;
+
+sfr at 0xf18 RXM0SIDH;
+volatile __RXM0SIDHbits_t at 0xf18 RXM0SIDHbits;
+
+sfr at 0xf19 RXM0SIDL;
+volatile __RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
+
+sfr at 0xf1a RXM0EIDH;
+volatile __RXM0EIDHbits_t at 0xf1a RXM0EIDHbits;
+
+sfr at 0xf1b RXM0EIDL;
+volatile __RXM0EIDLbits_t at 0xf1b RXM0EIDLbits;
+
+sfr at 0xf1c RXM1SIDH;
+volatile __RXM1SIDHbits_t at 0xf1c RXM1SIDHbits;
+
+sfr at 0xf1d RXM1SIDL;
+volatile __RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
+
+sfr at 0xf1e RXM1EIDH;
+volatile __RXM1EIDHbits_t at 0xf1e RXM1EIDHbits;
+
+sfr at 0xf1f RXM1EIDL;
+volatile __RXM1EIDLbits_t at 0xf1f RXM1EIDLbits;
+
+sfr at 0xf20 TXB2CON;
+volatile __TXB2CONbits_t at 0xf20 TXB2CONbits;
+
+sfr at 0xf21 TXB2SIDH;
+volatile __TXB2SIDHbits_t at 0xf21 TXB2SIDHbits;
+
+sfr at 0xf22 TXB2SIDL;
+volatile __TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
+
+sfr at 0xf23 TXB2EIDH;
+volatile __TXB2EIDHbits_t at 0xf23 TXB2EIDHbits;
+
+sfr at 0xf24 TXB2EIDL;
+volatile __TXB2EIDLbits_t at 0xf24 TXB2EIDLbits;
+
+sfr at 0xf25 TXB2DLC;
+volatile __TXB2DLCbits_t at 0xf25 TXB2DLCbits;
+
+sfr at 0xf26 TXB2D0;
+volatile __TXB2D0bits_t at 0xf26 TXB2D0bits;
+
+sfr at 0xf27 TXB2D1;
+volatile __TXB2D1bits_t at 0xf27 TXB2D1bits;
+
+sfr at 0xf28 TXB2D2;
+volatile __TXB2D2bits_t at 0xf28 TXB2D2bits;
+
+sfr at 0xf29 TXB2D3;
+volatile __TXB2D3bits_t at 0xf29 TXB2D3bits;
+
+sfr at 0xf2a TXB2D4;
+volatile __TXB2D4bits_t at 0xf2a TXB2D4bits;
+
+sfr at 0xf2b TXB2D5;
+volatile __TXB2D5bits_t at 0xf2b TXB2D5bits;
+
+sfr at 0xf2c TXB2D6;
+volatile __TXB2D6bits_t at 0xf2c TXB2D6bits;
+
+sfr at 0xf2d TXB2D7;
+volatile __TXB2D7bits_t at 0xf2d TXB2D7bits;
+
+sfr at 0xf2e CANSTATRO4;
+volatile __CANSTATRO4bits_t at 0xf2e CANSTATRO4bits;
+
+sfr at 0xf30 TXB1CON;
+volatile __TXB1CONbits_t at 0xf30 TXB1CONbits;
+
+sfr at 0xf31 TXB1SIDH;
+volatile __TXB1SIDHbits_t at 0xf31 TXB1SIDHbits;
+
+sfr at 0xf32 TXB1SIDL;
+volatile __TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
+
+sfr at 0xf33 TXB1EIDH;
+volatile __TXB1EIDHbits_t at 0xf33 TXB1EIDHbits;
+
+sfr at 0xf34 TXB1EIDL;
+volatile __TXB1EIDLbits_t at 0xf34 TXB1EIDLbits;
+
+sfr at 0xf35 TXB1DLC;
+volatile __TXB1DLCbits_t at 0xf35 TXB1DLCbits;
+
+sfr at 0xf36 TXB1D0;
+volatile __TXB1D0bits_t at 0xf36 TXB1D0bits;
+
+sfr at 0xf37 TXB1D1;
+volatile __TXB1D1bits_t at 0xf37 TXB1D1bits;
+
+sfr at 0xf38 TXB1D2;
+volatile __TXB1D2bits_t at 0xf38 TXB1D2bits;
+
+sfr at 0xf39 TXB1D3;
+volatile __TXB1D3bits_t at 0xf39 TXB1D3bits;
+
+sfr at 0xf3a TXB1D4;
+volatile __TXB1D4bits_t at 0xf3a TXB1D4bits;
+
+sfr at 0xf3b TXB1D5;
+volatile __TXB1D5bits_t at 0xf3b TXB1D5bits;
+
+sfr at 0xf3c TXB1D6;
+volatile __TXB1D6bits_t at 0xf3c TXB1D6bits;
+
+sfr at 0xf3d TXB1D7;
+volatile __TXB1D7bits_t at 0xf3d TXB1D7bits;
+
+sfr at 0xf3e CANSTATRO3;
+volatile __CANSTATRO3bits_t at 0xf3e CANSTATRO3bits;
+
+sfr at 0xf40 TXB0CON;
+volatile __TXB0CONbits_t at 0xf40 TXB0CONbits;
+
+sfr at 0xf41 TXB0SIDH;
+volatile __TXB0SIDHbits_t at 0xf41 TXB0SIDHbits;
+
+sfr at 0xf42 TXB0SIDL;
+volatile __TXB0SIDLbits_t at 0xf42 TXB0SIDLbits;
+
+sfr at 0xf43 TXB0EIDH;
+volatile __TXB0EIDHbits_t at 0xf43 TXB0EIDHbits;
+
+sfr at 0xf44 TXB0EIDL;
+volatile __TXB0EIDLbits_t at 0xf44 TXB0EIDLbits;
+
+sfr at 0xf45 TXB0DLC;
+volatile __TXB0DLCbits_t at 0xf45 TXB0DLCbits;
+
+sfr at 0xf46 TXB0D0;
+volatile __TXB0D0bits_t at 0xf46 TXB0D0bits;
+
+sfr at 0xf47 TXB0D1;
+volatile __TXB0D1bits_t at 0xf47 TXB0D1bits;
+
+sfr at 0xf48 TXB0D2;
+volatile __TXB0D2bits_t at 0xf48 TXB0D2bits;
+
+sfr at 0xf49 TXB0D3;
+volatile __TXB0D3bits_t at 0xf49 TXB0D3bits;
+
+sfr at 0xf4a TXB0D4;
+volatile __TXB0D4bits_t at 0xf4a TXB0D4bits;
+
+sfr at 0xf4b TXB0D5;
+volatile __TXB0D5bits_t at 0xf4b TXB0D5bits;
+
+sfr at 0xf4c TXB0D6;
+volatile __TXB0D6bits_t at 0xf4c TXB0D6bits;
+
+sfr at 0xf4d TXB0D7;
+volatile __TXB0D7bits_t at 0xf4d TXB0D7bits;
+
+sfr at 0xf4e CANSTATRO2;
+volatile __CANSTATRO2bits_t at 0xf4e CANSTATRO2bits;
+
+sfr at 0xf50 RXB1CON;
+volatile __RXB1CONbits_t at 0xf50 RXB1CONbits;
+
+sfr at 0xf51 RXB1SIDH;
+volatile __RXB1SIDHbits_t at 0xf51 RXB1SIDHbits;
+
+sfr at 0xf52 RXB1SIDL;
+volatile __RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
+
+sfr at 0xf53 RXB1EIDH;
+volatile __RXB1EIDHbits_t at 0xf53 RXB1EIDHbits;
+
+sfr at 0xf54 RXB1EIDL;
+volatile __RXB1EIDLbits_t at 0xf54 RXB1EIDLbits;
+
+sfr at 0xf55 RXB1DLC;
+volatile __RXB1DLCbits_t at 0xf55 RXB1DLCbits;
+
+sfr at 0xf56 RXB1D0;
+volatile __RXB1D0bits_t at 0xf56 RXB1D0bits;
+
+sfr at 0xf57 RXB1D1;
+volatile __RXB1D1bits_t at 0xf57 RXB1D1bits;
+
+sfr at 0xf58 RXB1D2;
+volatile __RXB1D2bits_t at 0xf58 RXB1D2bits;
+
+sfr at 0xf59 RXB1D3;
+volatile __RXB1D3bits_t at 0xf59 RXB1D3bits;
+
+sfr at 0xf5a RXB1D4;
+volatile __RXB1D4bits_t at 0xf5a RXB1D4bits;
+
+sfr at 0xf5b RXB1D5;
+volatile __RXB1D5bits_t at 0xf5b RXB1D5bits;
+
+sfr at 0xf5c RXB1D6;
+volatile __RXB1D6bits_t at 0xf5c RXB1D6bits;
+
+sfr at 0xf5d RXB1D7;
+volatile __RXB1D7bits_t at 0xf5d RXB1D7bits;
+
+sfr at 0xf5e CANSTATRO1;
+volatile __CANSTATRO1bits_t at 0xf5e CANSTATRO1bits;
+
+sfr at 0xf60 RXB0CON;
+volatile __RXB0CONbits_t at 0xf60 RXB0CONbits;
+
+sfr at 0xf61 RXB0SIDH;
+volatile __RXB0SIDHbits_t at 0xf61 RXB0SIDHbits;
+
+sfr at 0xf62 RXB0SIDL;
+volatile __RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
+
+sfr at 0xf63 RXB0EIDH;
+volatile __RXB0EIDHbits_t at 0xf63 RXB0EIDHbits;
+
+sfr at 0xf64 RXB0EIDL;
+volatile __RXB0EIDLbits_t at 0xf64 RXB0EIDLbits;
+
+sfr at 0xf65 RXB0DLC;
+volatile __RXB0DLCbits_t at 0xf65 RXB0DLCbits;
+
+sfr at 0xf66 RXB0D0;
+sfr at 0xf67 RXB0D1;
+sfr at 0xf68 RXB0D2;
+sfr at 0xf69 RXB0D3;
+sfr at 0xf6a RXB0D4;
+sfr at 0xf6b RXB0D5;
+sfr at 0xf6c RXB0D6;
+sfr at 0xf6d RXB0D7;
+sfr at 0xf6e CANSTAT;
+volatile __CANSTATbits_t at 0xf6e CANSTATbits;
+
+sfr at 0xf6f CANCON;
+volatile __CANCONbits_t at 0xf6f CANCONbits;
+
+sfr at 0xf70 BRGCON1;
+volatile __BRGCON1bits_t at 0xf70 BRGCON1bits;
+
+sfr at 0xf71 BRGCON2;
+volatile __BRGCON2bits_t at 0xf71 BRGCON2bits;
+
+sfr at 0xf72 BRGCON3;
+volatile __BRGCON3bits_t at 0xf72 BRGCON3bits;
+
+sfr at 0xf73 CIOCON;
+volatile __CIOCONbits_t at 0xf73 CIOCONbits;
+
+sfr at 0xf74 COMSTAT;
+volatile __COMSTATbits_t at 0xf74 COMSTATbits;
+
+sfr at 0xf75 RXERRCNT;
+volatile __RXERRCNTbits_t at 0xf75 RXERRCNTbits;
+
+sfr at 0xf76 TXERRCNT;
+volatile __TXERRCNTbits_t at 0xf76 TXERRCNTbits;
+
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa3 PIE3;
+volatile __PIE3bits_t at 0xfa3 PIE3bits;
+
+sfr at 0xfa4 PIR3;
+volatile __PIR3bits_t at 0xfa4 PIR3bits;
+
+sfr at 0xfa5 IPR3;
+volatile __IPR3bits_t at 0xfa5 IPR3bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfab RCSTA;
+volatile __RCSTAbits_t at 0xfab RCSTAbits;
+
+sfr at 0xfac TXSTA;
+volatile __TXSTAbits_t at 0xfac TXSTAbits;
+
+sfr at 0xfad TXREG;
+sfr at 0xfae RCREG;
+sfr at 0xfaf SPBRG;
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f252.c b/device/lib/pic16/libdev/pic18f252.c
new file mode 100644 (file)
index 0000000..f85c109
--- /dev/null
@@ -0,0 +1,187 @@
+
+/*
+ * pic18f252.c - PIC18F252 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f252.h>
+
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfab RCSTA;
+volatile __RCSTAbits_t at 0xfab RCSTAbits;
+
+sfr at 0xfac TXSTA;
+volatile __TXSTAbits_t at 0xfac TXSTAbits;
+
+sfr at 0xfad TXREG;
+sfr at 0xfae RCREG;
+sfr at 0xfaf SPBRG;
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfba CCP2CON;
+volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
+
+sfr at 0xfbb CCPR2L;
+sfr at 0xfbc CCPR2H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f258.c b/device/lib/pic16/libdev/pic18f258.c
new file mode 100644 (file)
index 0000000..0b73c2b
--- /dev/null
@@ -0,0 +1,520 @@
+
+/*
+ * pic18f258.c - PIC18F258 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f258.h>
+
+sfr at 0xf00 RXF0SIDH;
+volatile __RXF0SIDHbits_t at 0xf00 RXF0SIDHbits;
+
+sfr at 0xf01 RXF0SIDL;
+volatile __RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
+
+sfr at 0xf02 RXF0EIDH;
+volatile __RXF0EIDHbits_t at 0xf02 RXF0EIDHbits;
+
+sfr at 0xf03 RXF0EIDL;
+volatile __RXF0EIDLbits_t at 0xf03 RXF0EIDLbits;
+
+sfr at 0xf04 RXF1SIDH;
+volatile __RXF1SIDHbits_t at 0xf04 RXF1SIDHbits;
+
+sfr at 0xf05 RXF1SIDL;
+volatile __RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
+
+sfr at 0xf06 RXF1EIDH;
+volatile __RXF1EIDHbits_t at 0xf06 RXF1EIDHbits;
+
+sfr at 0xf07 RXF1EIDL;
+volatile __RXF1EIDLbits_t at 0xf07 RXF1EIDLbits;
+
+sfr at 0xf08 RXF2SIDH;
+volatile __RXF2SIDHbits_t at 0xf08 RXF2SIDHbits;
+
+sfr at 0xf09 RXF2SIDL;
+volatile __RXF2SIDLbits_t at 0xf09 RXF2SIDLbits;
+
+sfr at 0xf0a RXF2EIDH;
+volatile __RXF2EIDHbits_t at 0xf0a RXF2EIDHbits;
+
+sfr at 0xf0b RXF2EIDL;
+volatile __RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
+
+sfr at 0xf0c RXF3SIDH;
+volatile __RXF3SIDHbits_t at 0xf0c RXF3SIDHbits;
+
+sfr at 0xf0d RXF3SIDL;
+volatile __RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
+
+sfr at 0xf0e RXF3EIDH;
+volatile __RXF3EIDHbits_t at 0xf0e RXF3EIDHbits;
+
+sfr at 0xf0f RXF3EIDL;
+volatile __RXF3EIDLbits_t at 0xf0f RXF3EIDLbits;
+
+sfr at 0xf10 RXF4SIDH;
+volatile __RXF4SIDHbits_t at 0xf10 RXF4SIDHbits;
+
+sfr at 0xf11 RXF4SIDL;
+volatile __RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
+
+sfr at 0xf12 RXF4EIDH;
+volatile __RXF4EIDHbits_t at 0xf12 RXF4EIDHbits;
+
+sfr at 0xf13 RXF4EIDL;
+volatile __RXF4EIDLbits_t at 0xf13 RXF4EIDLbits;
+
+sfr at 0xf14 RXF5SIDH;
+volatile __RXF5SIDHbits_t at 0xf14 RXF5SIDHbits;
+
+sfr at 0xf15 RXF5SIDL;
+volatile __RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
+
+sfr at 0xf16 RXF5EIDH;
+volatile __RXF5EIDHbits_t at 0xf16 RXF5EIDHbits;
+
+sfr at 0xf17 RXF5EIDL;
+volatile __RXF5EIDLbits_t at 0xf17 RXF5EIDLbits;
+
+sfr at 0xf18 RXM0SIDH;
+volatile __RXM0SIDHbits_t at 0xf18 RXM0SIDHbits;
+
+sfr at 0xf19 RXM0SIDL;
+volatile __RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
+
+sfr at 0xf1a RXM0EIDH;
+volatile __RXM0EIDHbits_t at 0xf1a RXM0EIDHbits;
+
+sfr at 0xf1b RXM0EIDL;
+volatile __RXM0EIDLbits_t at 0xf1b RXM0EIDLbits;
+
+sfr at 0xf1c RXM1SIDH;
+volatile __RXM1SIDHbits_t at 0xf1c RXM1SIDHbits;
+
+sfr at 0xf1d RXM1SIDL;
+volatile __RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
+
+sfr at 0xf1e RXM1EIDH;
+volatile __RXM1EIDHbits_t at 0xf1e RXM1EIDHbits;
+
+sfr at 0xf1f RXM1EIDL;
+volatile __RXM1EIDLbits_t at 0xf1f RXM1EIDLbits;
+
+sfr at 0xf20 TXB2CON;
+volatile __TXB2CONbits_t at 0xf20 TXB2CONbits;
+
+sfr at 0xf21 TXB2SIDH;
+volatile __TXB2SIDHbits_t at 0xf21 TXB2SIDHbits;
+
+sfr at 0xf22 TXB2SIDL;
+volatile __TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
+
+sfr at 0xf23 TXB2EIDH;
+volatile __TXB2EIDHbits_t at 0xf23 TXB2EIDHbits;
+
+sfr at 0xf24 TXB2EIDL;
+volatile __TXB2EIDLbits_t at 0xf24 TXB2EIDLbits;
+
+sfr at 0xf25 TXB2DLC;
+volatile __TXB2DLCbits_t at 0xf25 TXB2DLCbits;
+
+sfr at 0xf26 TXB2D0;
+volatile __TXB2D0bits_t at 0xf26 TXB2D0bits;
+
+sfr at 0xf27 TXB2D1;
+volatile __TXB2D1bits_t at 0xf27 TXB2D1bits;
+
+sfr at 0xf28 TXB2D2;
+volatile __TXB2D2bits_t at 0xf28 TXB2D2bits;
+
+sfr at 0xf29 TXB2D3;
+volatile __TXB2D3bits_t at 0xf29 TXB2D3bits;
+
+sfr at 0xf2a TXB2D4;
+volatile __TXB2D4bits_t at 0xf2a TXB2D4bits;
+
+sfr at 0xf2b TXB2D5;
+volatile __TXB2D5bits_t at 0xf2b TXB2D5bits;
+
+sfr at 0xf2c TXB2D6;
+volatile __TXB2D6bits_t at 0xf2c TXB2D6bits;
+
+sfr at 0xf2d TXB2D7;
+volatile __TXB2D7bits_t at 0xf2d TXB2D7bits;
+
+sfr at 0xf2e CANSTATRO4;
+volatile __CANSTATRO4bits_t at 0xf2e CANSTATRO4bits;
+
+sfr at 0xf30 TXB1CON;
+volatile __TXB1CONbits_t at 0xf30 TXB1CONbits;
+
+sfr at 0xf31 TXB1SIDH;
+volatile __TXB1SIDHbits_t at 0xf31 TXB1SIDHbits;
+
+sfr at 0xf32 TXB1SIDL;
+volatile __TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
+
+sfr at 0xf33 TXB1EIDH;
+volatile __TXB1EIDHbits_t at 0xf33 TXB1EIDHbits;
+
+sfr at 0xf34 TXB1EIDL;
+volatile __TXB1EIDLbits_t at 0xf34 TXB1EIDLbits;
+
+sfr at 0xf35 TXB1DLC;
+volatile __TXB1DLCbits_t at 0xf35 TXB1DLCbits;
+
+sfr at 0xf36 TXB1D0;
+volatile __TXB1D0bits_t at 0xf36 TXB1D0bits;
+
+sfr at 0xf37 TXB1D1;
+volatile __TXB1D1bits_t at 0xf37 TXB1D1bits;
+
+sfr at 0xf38 TXB1D2;
+volatile __TXB1D2bits_t at 0xf38 TXB1D2bits;
+
+sfr at 0xf39 TXB1D3;
+volatile __TXB1D3bits_t at 0xf39 TXB1D3bits;
+
+sfr at 0xf3a TXB1D4;
+volatile __TXB1D4bits_t at 0xf3a TXB1D4bits;
+
+sfr at 0xf3b TXB1D5;
+volatile __TXB1D5bits_t at 0xf3b TXB1D5bits;
+
+sfr at 0xf3c TXB1D6;
+volatile __TXB1D6bits_t at 0xf3c TXB1D6bits;
+
+sfr at 0xf3d TXB1D7;
+volatile __TXB1D7bits_t at 0xf3d TXB1D7bits;
+
+sfr at 0xf3e CANSTATRO3;
+volatile __CANSTATRO3bits_t at 0xf3e CANSTATRO3bits;
+
+sfr at 0xf40 TXB0CON;
+volatile __TXB0CONbits_t at 0xf40 TXB0CONbits;
+
+sfr at 0xf41 TXB0SIDH;
+volatile __TXB0SIDHbits_t at 0xf41 TXB0SIDHbits;
+
+sfr at 0xf42 TXB0SIDL;
+volatile __TXB0SIDLbits_t at 0xf42 TXB0SIDLbits;
+
+sfr at 0xf43 TXB0EIDH;
+volatile __TXB0EIDHbits_t at 0xf43 TXB0EIDHbits;
+
+sfr at 0xf44 TXB0EIDL;
+volatile __TXB0EIDLbits_t at 0xf44 TXB0EIDLbits;
+
+sfr at 0xf45 TXB0DLC;
+volatile __TXB0DLCbits_t at 0xf45 TXB0DLCbits;
+
+sfr at 0xf46 TXB0D0;
+volatile __TXB0D0bits_t at 0xf46 TXB0D0bits;
+
+sfr at 0xf47 TXB0D1;
+volatile __TXB0D1bits_t at 0xf47 TXB0D1bits;
+
+sfr at 0xf48 TXB0D2;
+volatile __TXB0D2bits_t at 0xf48 TXB0D2bits;
+
+sfr at 0xf49 TXB0D3;
+volatile __TXB0D3bits_t at 0xf49 TXB0D3bits;
+
+sfr at 0xf4a TXB0D4;
+volatile __TXB0D4bits_t at 0xf4a TXB0D4bits;
+
+sfr at 0xf4b TXB0D5;
+volatile __TXB0D5bits_t at 0xf4b TXB0D5bits;
+
+sfr at 0xf4c TXB0D6;
+volatile __TXB0D6bits_t at 0xf4c TXB0D6bits;
+
+sfr at 0xf4d TXB0D7;
+volatile __TXB0D7bits_t at 0xf4d TXB0D7bits;
+
+sfr at 0xf4e CANSTATRO2;
+volatile __CANSTATRO2bits_t at 0xf4e CANSTATRO2bits;
+
+sfr at 0xf50 RXB1CON;
+volatile __RXB1CONbits_t at 0xf50 RXB1CONbits;
+
+sfr at 0xf51 RXB1SIDH;
+volatile __RXB1SIDHbits_t at 0xf51 RXB1SIDHbits;
+
+sfr at 0xf52 RXB1SIDL;
+volatile __RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
+
+sfr at 0xf53 RXB1EIDH;
+volatile __RXB1EIDHbits_t at 0xf53 RXB1EIDHbits;
+
+sfr at 0xf54 RXB1EIDL;
+volatile __RXB1EIDLbits_t at 0xf54 RXB1EIDLbits;
+
+sfr at 0xf55 RXB1DLC;
+volatile __RXB1DLCbits_t at 0xf55 RXB1DLCbits;
+
+sfr at 0xf56 RXB1D0;
+volatile __RXB1D0bits_t at 0xf56 RXB1D0bits;
+
+sfr at 0xf57 RXB1D1;
+volatile __RXB1D1bits_t at 0xf57 RXB1D1bits;
+
+sfr at 0xf58 RXB1D2;
+volatile __RXB1D2bits_t at 0xf58 RXB1D2bits;
+
+sfr at 0xf59 RXB1D3;
+volatile __RXB1D3bits_t at 0xf59 RXB1D3bits;
+
+sfr at 0xf5a RXB1D4;
+volatile __RXB1D4bits_t at 0xf5a RXB1D4bits;
+
+sfr at 0xf5b RXB1D5;
+volatile __RXB1D5bits_t at 0xf5b RXB1D5bits;
+
+sfr at 0xf5c RXB1D6;
+volatile __RXB1D6bits_t at 0xf5c RXB1D6bits;
+
+sfr at 0xf5d RXB1D7;
+volatile __RXB1D7bits_t at 0xf5d RXB1D7bits;
+
+sfr at 0xf5e CANSTATRO1;
+volatile __CANSTATRO1bits_t at 0xf5e CANSTATRO1bits;
+
+sfr at 0xf60 RXB0CON;
+volatile __RXB0CONbits_t at 0xf60 RXB0CONbits;
+
+sfr at 0xf61 RXB0SIDH;
+volatile __RXB0SIDHbits_t at 0xf61 RXB0SIDHbits;
+
+sfr at 0xf62 RXB0SIDL;
+volatile __RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
+
+sfr at 0xf63 RXB0EIDH;
+volatile __RXB0EIDHbits_t at 0xf63 RXB0EIDHbits;
+
+sfr at 0xf64 RXB0EIDL;
+volatile __RXB0EIDLbits_t at 0xf64 RXB0EIDLbits;
+
+sfr at 0xf65 RXB0DLC;
+volatile __RXB0DLCbits_t at 0xf65 RXB0DLCbits;
+
+sfr at 0xf66 RXB0D0;
+sfr at 0xf67 RXB0D1;
+sfr at 0xf68 RXB0D2;
+sfr at 0xf69 RXB0D3;
+sfr at 0xf6a RXB0D4;
+sfr at 0xf6b RXB0D5;
+sfr at 0xf6c RXB0D6;
+sfr at 0xf6d RXB0D7;
+sfr at 0xf6e CANSTAT;
+volatile __CANSTATbits_t at 0xf6e CANSTATbits;
+
+sfr at 0xf6f CANCON;
+volatile __CANCONbits_t at 0xf6f CANCONbits;
+
+sfr at 0xf70 BRGCON1;
+volatile __BRGCON1bits_t at 0xf70 BRGCON1bits;
+
+sfr at 0xf71 BRGCON2;
+volatile __BRGCON2bits_t at 0xf71 BRGCON2bits;
+
+sfr at 0xf72 BRGCON3;
+volatile __BRGCON3bits_t at 0xf72 BRGCON3bits;
+
+sfr at 0xf73 CIOCON;
+volatile __CIOCONbits_t at 0xf73 CIOCONbits;
+
+sfr at 0xf74 COMSTAT;
+volatile __COMSTATbits_t at 0xf74 COMSTATbits;
+
+sfr at 0xf75 RXERRCNT;
+volatile __RXERRCNTbits_t at 0xf75 RXERRCNTbits;
+
+sfr at 0xf76 TXERRCNT;
+volatile __TXERRCNTbits_t at 0xf76 TXERRCNTbits;
+
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa3 PIE3;
+volatile __PIE3bits_t at 0xfa3 PIE3bits;
+
+sfr at 0xfa4 PIR3;
+volatile __PIR3bits_t at 0xfa4 PIR3bits;
+
+sfr at 0xfa5 IPR3;
+volatile __IPR3bits_t at 0xfa5 IPR3bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfab RCSTA;
+volatile __RCSTAbits_t at 0xfab RCSTAbits;
+
+sfr at 0xfac TXSTA;
+volatile __TXSTAbits_t at 0xfac TXSTAbits;
+
+sfr at 0xfad TXREG;
+sfr at 0xfae RCREG;
+sfr at 0xfaf SPBRG;
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f442.c b/device/lib/pic16/libdev/pic18f442.c
new file mode 100644 (file)
index 0000000..b73436c
--- /dev/null
@@ -0,0 +1,205 @@
+
+/*
+ * pic18f442.c - PIC18F442 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f442.h>
+
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf83 PORTD;
+volatile __PORTDbits_t at 0xf83 PORTDbits;
+
+sfr at 0xf84 PORTE;
+volatile __PORTEbits_t at 0xf84 PORTEbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf8c LATD;
+volatile __LATDbits_t at 0xf8c LATDbits;
+
+sfr at 0xf8d LATE;
+volatile __LATEbits_t at 0xf8d LATEbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf95 TRISD;
+volatile __TRISDbits_t at 0xf95 TRISDbits;
+
+sfr at 0xf96 TRISE;
+volatile __TRISEbits_t at 0xf96 TRISEbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfab RCSTA;
+volatile __RCSTAbits_t at 0xfab RCSTAbits;
+
+sfr at 0xfac TXSTA;
+volatile __TXSTAbits_t at 0xfac TXSTAbits;
+
+sfr at 0xfad TXREG;
+sfr at 0xfae RCREG;
+sfr at 0xfaf SPBRG;
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfba CCP2CON;
+volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
+
+sfr at 0xfbb CCPR2L;
+sfr at 0xfbc CCPR2H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f448.c b/device/lib/pic16/libdev/pic18f448.c
new file mode 100644 (file)
index 0000000..84fe46a
--- /dev/null
@@ -0,0 +1,558 @@
+
+/*
+ * pic18f448.c - PIC18F448 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f448.h>
+
+sfr at 0xf00 RXF0SIDH;
+volatile __RXF0SIDHbits_t at 0xf00 RXF0SIDHbits;
+
+sfr at 0xf01 RXF0SIDL;
+volatile __RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
+
+sfr at 0xf02 RXF0EIDH;
+volatile __RXF0EIDHbits_t at 0xf02 RXF0EIDHbits;
+
+sfr at 0xf03 RXF0EIDL;
+volatile __RXF0EIDLbits_t at 0xf03 RXF0EIDLbits;
+
+sfr at 0xf04 RXF1SIDH;
+volatile __RXF1SIDHbits_t at 0xf04 RXF1SIDHbits;
+
+sfr at 0xf05 RXF1SIDL;
+volatile __RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
+
+sfr at 0xf06 RXF1EIDH;
+volatile __RXF1EIDHbits_t at 0xf06 RXF1EIDHbits;
+
+sfr at 0xf07 RXF1EIDL;
+volatile __RXF1EIDLbits_t at 0xf07 RXF1EIDLbits;
+
+sfr at 0xf08 RXF2SIDH;
+volatile __RXF2SIDHbits_t at 0xf08 RXF2SIDHbits;
+
+sfr at 0xf09 RXF2SIDL;
+volatile __RXF2SIDLbits_t at 0xf09 RXF2SIDLbits;
+
+sfr at 0xf0a RXF2EIDH;
+volatile __RXF2EIDHbits_t at 0xf0a RXF2EIDHbits;
+
+sfr at 0xf0b RXF2EIDL;
+volatile __RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
+
+sfr at 0xf0c RXF3SIDH;
+volatile __RXF3SIDHbits_t at 0xf0c RXF3SIDHbits;
+
+sfr at 0xf0d RXF3SIDL;
+volatile __RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
+
+sfr at 0xf0e RXF3EIDH;
+volatile __RXF3EIDHbits_t at 0xf0e RXF3EIDHbits;
+
+sfr at 0xf0f RXF3EIDL;
+volatile __RXF3EIDLbits_t at 0xf0f RXF3EIDLbits;
+
+sfr at 0xf10 RXF4SIDH;
+volatile __RXF4SIDHbits_t at 0xf10 RXF4SIDHbits;
+
+sfr at 0xf11 RXF4SIDL;
+volatile __RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
+
+sfr at 0xf12 RXF4EIDH;
+volatile __RXF4EIDHbits_t at 0xf12 RXF4EIDHbits;
+
+sfr at 0xf13 RXF4EIDL;
+volatile __RXF4EIDLbits_t at 0xf13 RXF4EIDLbits;
+
+sfr at 0xf14 RXF5SIDH;
+volatile __RXF5SIDHbits_t at 0xf14 RXF5SIDHbits;
+
+sfr at 0xf15 RXF5SIDL;
+volatile __RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
+
+sfr at 0xf16 RXF5EIDH;
+volatile __RXF5EIDHbits_t at 0xf16 RXF5EIDHbits;
+
+sfr at 0xf17 RXF5EIDL;
+volatile __RXF5EIDLbits_t at 0xf17 RXF5EIDLbits;
+
+sfr at 0xf18 RXM0SIDH;
+volatile __RXM0SIDHbits_t at 0xf18 RXM0SIDHbits;
+
+sfr at 0xf19 RXM0SIDL;
+volatile __RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
+
+sfr at 0xf1a RXM0EIDH;
+volatile __RXM0EIDHbits_t at 0xf1a RXM0EIDHbits;
+
+sfr at 0xf1b RXM0EIDL;
+volatile __RXM0EIDLbits_t at 0xf1b RXM0EIDLbits;
+
+sfr at 0xf1c RXM1SIDH;
+volatile __RXM1SIDHbits_t at 0xf1c RXM1SIDHbits;
+
+sfr at 0xf1d RXM1SIDL;
+volatile __RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
+
+sfr at 0xf1e RXM1EIDH;
+volatile __RXM1EIDHbits_t at 0xf1e RXM1EIDHbits;
+
+sfr at 0xf1f RXM1EIDL;
+volatile __RXM1EIDLbits_t at 0xf1f RXM1EIDLbits;
+
+sfr at 0xf20 TXB2CON;
+volatile __TXB2CONbits_t at 0xf20 TXB2CONbits;
+
+sfr at 0xf21 TXB2SIDH;
+volatile __TXB2SIDHbits_t at 0xf21 TXB2SIDHbits;
+
+sfr at 0xf22 TXB2SIDL;
+volatile __TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
+
+sfr at 0xf23 TXB2EIDH;
+volatile __TXB2EIDHbits_t at 0xf23 TXB2EIDHbits;
+
+sfr at 0xf24 TXB2EIDL;
+volatile __TXB2EIDLbits_t at 0xf24 TXB2EIDLbits;
+
+sfr at 0xf25 TXB2DLC;
+volatile __TXB2DLCbits_t at 0xf25 TXB2DLCbits;
+
+sfr at 0xf26 TXB2D0;
+volatile __TXB2D0bits_t at 0xf26 TXB2D0bits;
+
+sfr at 0xf27 TXB2D1;
+volatile __TXB2D1bits_t at 0xf27 TXB2D1bits;
+
+sfr at 0xf28 TXB2D2;
+volatile __TXB2D2bits_t at 0xf28 TXB2D2bits;
+
+sfr at 0xf29 TXB2D3;
+volatile __TXB2D3bits_t at 0xf29 TXB2D3bits;
+
+sfr at 0xf2a TXB2D4;
+volatile __TXB2D4bits_t at 0xf2a TXB2D4bits;
+
+sfr at 0xf2b TXB2D5;
+volatile __TXB2D5bits_t at 0xf2b TXB2D5bits;
+
+sfr at 0xf2c TXB2D6;
+volatile __TXB2D6bits_t at 0xf2c TXB2D6bits;
+
+sfr at 0xf2d TXB2D7;
+volatile __TXB2D7bits_t at 0xf2d TXB2D7bits;
+
+sfr at 0xf2e CANSTATRO4;
+volatile __CANSTATRO4bits_t at 0xf2e CANSTATRO4bits;
+
+sfr at 0xf30 TXB1CON;
+volatile __TXB1CONbits_t at 0xf30 TXB1CONbits;
+
+sfr at 0xf31 TXB1SIDH;
+volatile __TXB1SIDHbits_t at 0xf31 TXB1SIDHbits;
+
+sfr at 0xf32 TXB1SIDL;
+volatile __TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
+
+sfr at 0xf33 TXB1EIDH;
+volatile __TXB1EIDHbits_t at 0xf33 TXB1EIDHbits;
+
+sfr at 0xf34 TXB1EIDL;
+volatile __TXB1EIDLbits_t at 0xf34 TXB1EIDLbits;
+
+sfr at 0xf35 TXB1DLC;
+volatile __TXB1DLCbits_t at 0xf35 TXB1DLCbits;
+
+sfr at 0xf36 TXB1D0;
+volatile __TXB1D0bits_t at 0xf36 TXB1D0bits;
+
+sfr at 0xf37 TXB1D1;
+volatile __TXB1D1bits_t at 0xf37 TXB1D1bits;
+
+sfr at 0xf38 TXB1D2;
+volatile __TXB1D2bits_t at 0xf38 TXB1D2bits;
+
+sfr at 0xf39 TXB1D3;
+volatile __TXB1D3bits_t at 0xf39 TXB1D3bits;
+
+sfr at 0xf3a TXB1D4;
+volatile __TXB1D4bits_t at 0xf3a TXB1D4bits;
+
+sfr at 0xf3b TXB1D5;
+volatile __TXB1D5bits_t at 0xf3b TXB1D5bits;
+
+sfr at 0xf3c TXB1D6;
+volatile __TXB1D6bits_t at 0xf3c TXB1D6bits;
+
+sfr at 0xf3d TXB1D7;
+volatile __TXB1D7bits_t at 0xf3d TXB1D7bits;
+
+sfr at 0xf3e CANSTATRO3;
+volatile __CANSTATRO3bits_t at 0xf3e CANSTATRO3bits;
+
+sfr at 0xf40 TXB0CON;
+volatile __TXB0CONbits_t at 0xf40 TXB0CONbits;
+
+sfr at 0xf41 TXB0SIDH;
+volatile __TXB0SIDHbits_t at 0xf41 TXB0SIDHbits;
+
+sfr at 0xf42 TXB0SIDL;
+volatile __TXB0SIDLbits_t at 0xf42 TXB0SIDLbits;
+
+sfr at 0xf43 TXB0EIDH;
+volatile __TXB0EIDHbits_t at 0xf43 TXB0EIDHbits;
+
+sfr at 0xf44 TXB0EIDL;
+volatile __TXB0EIDLbits_t at 0xf44 TXB0EIDLbits;
+
+sfr at 0xf45 TXB0DLC;
+volatile __TXB0DLCbits_t at 0xf45 TXB0DLCbits;
+
+sfr at 0xf46 TXB0D0;
+volatile __TXB0D0bits_t at 0xf46 TXB0D0bits;
+
+sfr at 0xf47 TXB0D1;
+volatile __TXB0D1bits_t at 0xf47 TXB0D1bits;
+
+sfr at 0xf48 TXB0D2;
+volatile __TXB0D2bits_t at 0xf48 TXB0D2bits;
+
+sfr at 0xf49 TXB0D3;
+volatile __TXB0D3bits_t at 0xf49 TXB0D3bits;
+
+sfr at 0xf4a TXB0D4;
+volatile __TXB0D4bits_t at 0xf4a TXB0D4bits;
+
+sfr at 0xf4b TXB0D5;
+volatile __TXB0D5bits_t at 0xf4b TXB0D5bits;
+
+sfr at 0xf4c TXB0D6;
+volatile __TXB0D6bits_t at 0xf4c TXB0D6bits;
+
+sfr at 0xf4d TXB0D7;
+volatile __TXB0D7bits_t at 0xf4d TXB0D7bits;
+
+sfr at 0xf4e CANSTATRO2;
+volatile __CANSTATRO2bits_t at 0xf4e CANSTATRO2bits;
+
+sfr at 0xf50 RXB1CON;
+volatile __RXB1CONbits_t at 0xf50 RXB1CONbits;
+
+sfr at 0xf51 RXB1SIDH;
+volatile __RXB1SIDHbits_t at 0xf51 RXB1SIDHbits;
+
+sfr at 0xf52 RXB1SIDL;
+volatile __RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
+
+sfr at 0xf53 RXB1EIDH;
+volatile __RXB1EIDHbits_t at 0xf53 RXB1EIDHbits;
+
+sfr at 0xf54 RXB1EIDL;
+volatile __RXB1EIDLbits_t at 0xf54 RXB1EIDLbits;
+
+sfr at 0xf55 RXB1DLC;
+volatile __RXB1DLCbits_t at 0xf55 RXB1DLCbits;
+
+sfr at 0xf56 RXB1D0;
+volatile __RXB1D0bits_t at 0xf56 RXB1D0bits;
+
+sfr at 0xf57 RXB1D1;
+volatile __RXB1D1bits_t at 0xf57 RXB1D1bits;
+
+sfr at 0xf58 RXB1D2;
+volatile __RXB1D2bits_t at 0xf58 RXB1D2bits;
+
+sfr at 0xf59 RXB1D3;
+volatile __RXB1D3bits_t at 0xf59 RXB1D3bits;
+
+sfr at 0xf5a RXB1D4;
+volatile __RXB1D4bits_t at 0xf5a RXB1D4bits;
+
+sfr at 0xf5b RXB1D5;
+volatile __RXB1D5bits_t at 0xf5b RXB1D5bits;
+
+sfr at 0xf5c RXB1D6;
+volatile __RXB1D6bits_t at 0xf5c RXB1D6bits;
+
+sfr at 0xf5d RXB1D7;
+volatile __RXB1D7bits_t at 0xf5d RXB1D7bits;
+
+sfr at 0xf5e CANSTATRO1;
+volatile __CANSTATRO1bits_t at 0xf5e CANSTATRO1bits;
+
+sfr at 0xf60 RXB0CON;
+volatile __RXB0CONbits_t at 0xf60 RXB0CONbits;
+
+sfr at 0xf61 RXB0SIDH;
+volatile __RXB0SIDHbits_t at 0xf61 RXB0SIDHbits;
+
+sfr at 0xf62 RXB0SIDL;
+volatile __RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
+
+sfr at 0xf63 RXB0EIDH;
+volatile __RXB0EIDHbits_t at 0xf63 RXB0EIDHbits;
+
+sfr at 0xf64 RXB0EIDL;
+volatile __RXB0EIDLbits_t at 0xf64 RXB0EIDLbits;
+
+sfr at 0xf65 RXB0DLC;
+volatile __RXB0DLCbits_t at 0xf65 RXB0DLCbits;
+
+sfr at 0xf66 RXB0D0;
+sfr at 0xf67 RXB0D1;
+sfr at 0xf68 RXB0D2;
+sfr at 0xf69 RXB0D3;
+sfr at 0xf6a RXB0D4;
+sfr at 0xf6b RXB0D5;
+sfr at 0xf6c RXB0D6;
+sfr at 0xf6d RXB0D7;
+sfr at 0xf6e CANSTAT;
+volatile __CANSTATbits_t at 0xf6e CANSTATbits;
+
+sfr at 0xf6f CANCON;
+volatile __CANCONbits_t at 0xf6f CANCONbits;
+
+sfr at 0xf70 BRGCON1;
+volatile __BRGCON1bits_t at 0xf70 BRGCON1bits;
+
+sfr at 0xf71 BRGCON2;
+volatile __BRGCON2bits_t at 0xf71 BRGCON2bits;
+
+sfr at 0xf72 BRGCON3;
+volatile __BRGCON3bits_t at 0xf72 BRGCON3bits;
+
+sfr at 0xf73 CIOCON;
+volatile __CIOCONbits_t at 0xf73 CIOCONbits;
+
+sfr at 0xf74 COMSTAT;
+volatile __COMSTATbits_t at 0xf74 COMSTATbits;
+
+sfr at 0xf75 RXERRCNT;
+volatile __RXERRCNTbits_t at 0xf75 RXERRCNTbits;
+
+sfr at 0xf76 TXERRCNT;
+volatile __TXERRCNTbits_t at 0xf76 TXERRCNTbits;
+
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf83 PORTD;
+volatile __PORTDbits_t at 0xf83 PORTDbits;
+
+sfr at 0xf84 PORTE;
+volatile __PORTEbits_t at 0xf84 PORTEbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf8c LATD;
+volatile __LATDbits_t at 0xf8c LATDbits;
+
+sfr at 0xf8d LATE;
+volatile __LATEbits_t at 0xf8d LATEbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf95 TRISD;
+volatile __TRISDbits_t at 0xf95 TRISDbits;
+
+sfr at 0xf96 TRISE;
+volatile __TRISEbits_t at 0xf96 TRISEbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa3 PIE3;
+volatile __PIE3bits_t at 0xfa3 PIE3bits;
+
+sfr at 0xfa4 PIR3;
+volatile __PIR3bits_t at 0xfa4 PIR3bits;
+
+sfr at 0xfa5 IPR3;
+volatile __IPR3bits_t at 0xfa5 IPR3bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfab RCSTA;
+volatile __RCSTAbits_t at 0xfab RCSTAbits;
+
+sfr at 0xfac TXSTA;
+volatile __TXSTAbits_t at 0xfac TXSTAbits;
+
+sfr at 0xfad TXREG;
+sfr at 0xfae RCREG;
+sfr at 0xfaf SPBRG;
+sfr at 0xfb0 PSPCON;
+volatile __PSPCONbits_t at 0xfb0 PSPCONbits;
+
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfb4 CMCON;
+volatile __CMCONbits_t at 0xfb4 CMCONbits;
+
+sfr at 0xfb5 CVRCON;
+volatile __CVRCONbits_t at 0xfb5 CVRCONbits;
+
+sfr at 0xfb6 ECCPAS;
+volatile __ECCPASbits_t at 0xfb6 ECCPASbits;
+
+sfr at 0xfb7 ECCP1DEL;
+volatile __ECCP1DELbits_t at 0xfb7 ECCP1DELbits;
+
+sfr at 0xfba ECCP1CON;
+volatile __ECCP1CONbits_t at 0xfba ECCP1CONbits;
+
+sfr at 0xfbb ECCPR1L;
+sfr at 0xfbc ECCPR1H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f452.c b/device/lib/pic16/libdev/pic18f452.c
new file mode 100644 (file)
index 0000000..d8fdd31
--- /dev/null
@@ -0,0 +1,205 @@
+
+/*
+ * pic18f452.c - PIC18F452 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f452.h>
+
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf83 PORTD;
+volatile __PORTDbits_t at 0xf83 PORTDbits;
+
+sfr at 0xf84 PORTE;
+volatile __PORTEbits_t at 0xf84 PORTEbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf8c LATD;
+volatile __LATDbits_t at 0xf8c LATDbits;
+
+sfr at 0xf8d LATE;
+volatile __LATEbits_t at 0xf8d LATEbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf95 TRISD;
+volatile __TRISDbits_t at 0xf95 TRISDbits;
+
+sfr at 0xf96 TRISE;
+volatile __TRISEbits_t at 0xf96 TRISEbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfab RCSTA;
+volatile __RCSTAbits_t at 0xfab RCSTAbits;
+
+sfr at 0xfac TXSTA;
+volatile __TXSTAbits_t at 0xfac TXSTAbits;
+
+sfr at 0xfad TXREG;
+sfr at 0xfae RCREG;
+sfr at 0xfaf SPBRG;
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfba CCP2CON;
+volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
+
+sfr at 0xfbb CCPR2L;
+sfr at 0xfbc CCPR2H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f458.c b/device/lib/pic16/libdev/pic18f458.c
new file mode 100644 (file)
index 0000000..38f6580
--- /dev/null
@@ -0,0 +1,558 @@
+
+/*
+ * pic18f458.c - PIC18F458 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f458.h>
+
+sfr at 0xf00 RXF0SIDH;
+volatile __RXF0SIDHbits_t at 0xf00 RXF0SIDHbits;
+
+sfr at 0xf01 RXF0SIDL;
+volatile __RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
+
+sfr at 0xf02 RXF0EIDH;
+volatile __RXF0EIDHbits_t at 0xf02 RXF0EIDHbits;
+
+sfr at 0xf03 RXF0EIDL;
+volatile __RXF0EIDLbits_t at 0xf03 RXF0EIDLbits;
+
+sfr at 0xf04 RXF1SIDH;
+volatile __RXF1SIDHbits_t at 0xf04 RXF1SIDHbits;
+
+sfr at 0xf05 RXF1SIDL;
+volatile __RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
+
+sfr at 0xf06 RXF1EIDH;
+volatile __RXF1EIDHbits_t at 0xf06 RXF1EIDHbits;
+
+sfr at 0xf07 RXF1EIDL;
+volatile __RXF1EIDLbits_t at 0xf07 RXF1EIDLbits;
+
+sfr at 0xf08 RXF2SIDH;
+volatile __RXF2SIDHbits_t at 0xf08 RXF2SIDHbits;
+
+sfr at 0xf09 RXF2SIDL;
+volatile __RXF2SIDLbits_t at 0xf09 RXF2SIDLbits;
+
+sfr at 0xf0a RXF2EIDH;
+volatile __RXF2EIDHbits_t at 0xf0a RXF2EIDHbits;
+
+sfr at 0xf0b RXF2EIDL;
+volatile __RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
+
+sfr at 0xf0c RXF3SIDH;
+volatile __RXF3SIDHbits_t at 0xf0c RXF3SIDHbits;
+
+sfr at 0xf0d RXF3SIDL;
+volatile __RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
+
+sfr at 0xf0e RXF3EIDH;
+volatile __RXF3EIDHbits_t at 0xf0e RXF3EIDHbits;
+
+sfr at 0xf0f RXF3EIDL;
+volatile __RXF3EIDLbits_t at 0xf0f RXF3EIDLbits;
+
+sfr at 0xf10 RXF4SIDH;
+volatile __RXF4SIDHbits_t at 0xf10 RXF4SIDHbits;
+
+sfr at 0xf11 RXF4SIDL;
+volatile __RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
+
+sfr at 0xf12 RXF4EIDH;
+volatile __RXF4EIDHbits_t at 0xf12 RXF4EIDHbits;
+
+sfr at 0xf13 RXF4EIDL;
+volatile __RXF4EIDLbits_t at 0xf13 RXF4EIDLbits;
+
+sfr at 0xf14 RXF5SIDH;
+volatile __RXF5SIDHbits_t at 0xf14 RXF5SIDHbits;
+
+sfr at 0xf15 RXF5SIDL;
+volatile __RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
+
+sfr at 0xf16 RXF5EIDH;
+volatile __RXF5EIDHbits_t at 0xf16 RXF5EIDHbits;
+
+sfr at 0xf17 RXF5EIDL;
+volatile __RXF5EIDLbits_t at 0xf17 RXF5EIDLbits;
+
+sfr at 0xf18 RXM0SIDH;
+volatile __RXM0SIDHbits_t at 0xf18 RXM0SIDHbits;
+
+sfr at 0xf19 RXM0SIDL;
+volatile __RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
+
+sfr at 0xf1a RXM0EIDH;
+volatile __RXM0EIDHbits_t at 0xf1a RXM0EIDHbits;
+
+sfr at 0xf1b RXM0EIDL;
+volatile __RXM0EIDLbits_t at 0xf1b RXM0EIDLbits;
+
+sfr at 0xf1c RXM1SIDH;
+volatile __RXM1SIDHbits_t at 0xf1c RXM1SIDHbits;
+
+sfr at 0xf1d RXM1SIDL;
+volatile __RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
+
+sfr at 0xf1e RXM1EIDH;
+volatile __RXM1EIDHbits_t at 0xf1e RXM1EIDHbits;
+
+sfr at 0xf1f RXM1EIDL;
+volatile __RXM1EIDLbits_t at 0xf1f RXM1EIDLbits;
+
+sfr at 0xf20 TXB2CON;
+volatile __TXB2CONbits_t at 0xf20 TXB2CONbits;
+
+sfr at 0xf21 TXB2SIDH;
+volatile __TXB2SIDHbits_t at 0xf21 TXB2SIDHbits;
+
+sfr at 0xf22 TXB2SIDL;
+volatile __TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
+
+sfr at 0xf23 TXB2EIDH;
+volatile __TXB2EIDHbits_t at 0xf23 TXB2EIDHbits;
+
+sfr at 0xf24 TXB2EIDL;
+volatile __TXB2EIDLbits_t at 0xf24 TXB2EIDLbits;
+
+sfr at 0xf25 TXB2DLC;
+volatile __TXB2DLCbits_t at 0xf25 TXB2DLCbits;
+
+sfr at 0xf26 TXB2D0;
+volatile __TXB2D0bits_t at 0xf26 TXB2D0bits;
+
+sfr at 0xf27 TXB2D1;
+volatile __TXB2D1bits_t at 0xf27 TXB2D1bits;
+
+sfr at 0xf28 TXB2D2;
+volatile __TXB2D2bits_t at 0xf28 TXB2D2bits;
+
+sfr at 0xf29 TXB2D3;
+volatile __TXB2D3bits_t at 0xf29 TXB2D3bits;
+
+sfr at 0xf2a TXB2D4;
+volatile __TXB2D4bits_t at 0xf2a TXB2D4bits;
+
+sfr at 0xf2b TXB2D5;
+volatile __TXB2D5bits_t at 0xf2b TXB2D5bits;
+
+sfr at 0xf2c TXB2D6;
+volatile __TXB2D6bits_t at 0xf2c TXB2D6bits;
+
+sfr at 0xf2d TXB2D7;
+volatile __TXB2D7bits_t at 0xf2d TXB2D7bits;
+
+sfr at 0xf2e CANSTATRO4;
+volatile __CANSTATRO4bits_t at 0xf2e CANSTATRO4bits;
+
+sfr at 0xf30 TXB1CON;
+volatile __TXB1CONbits_t at 0xf30 TXB1CONbits;
+
+sfr at 0xf31 TXB1SIDH;
+volatile __TXB1SIDHbits_t at 0xf31 TXB1SIDHbits;
+
+sfr at 0xf32 TXB1SIDL;
+volatile __TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
+
+sfr at 0xf33 TXB1EIDH;
+volatile __TXB1EIDHbits_t at 0xf33 TXB1EIDHbits;
+
+sfr at 0xf34 TXB1EIDL;
+volatile __TXB1EIDLbits_t at 0xf34 TXB1EIDLbits;
+
+sfr at 0xf35 TXB1DLC;
+volatile __TXB1DLCbits_t at 0xf35 TXB1DLCbits;
+
+sfr at 0xf36 TXB1D0;
+volatile __TXB1D0bits_t at 0xf36 TXB1D0bits;
+
+sfr at 0xf37 TXB1D1;
+volatile __TXB1D1bits_t at 0xf37 TXB1D1bits;
+
+sfr at 0xf38 TXB1D2;
+volatile __TXB1D2bits_t at 0xf38 TXB1D2bits;
+
+sfr at 0xf39 TXB1D3;
+volatile __TXB1D3bits_t at 0xf39 TXB1D3bits;
+
+sfr at 0xf3a TXB1D4;
+volatile __TXB1D4bits_t at 0xf3a TXB1D4bits;
+
+sfr at 0xf3b TXB1D5;
+volatile __TXB1D5bits_t at 0xf3b TXB1D5bits;
+
+sfr at 0xf3c TXB1D6;
+volatile __TXB1D6bits_t at 0xf3c TXB1D6bits;
+
+sfr at 0xf3d TXB1D7;
+volatile __TXB1D7bits_t at 0xf3d TXB1D7bits;
+
+sfr at 0xf3e CANSTATRO3;
+volatile __CANSTATRO3bits_t at 0xf3e CANSTATRO3bits;
+
+sfr at 0xf40 TXB0CON;
+volatile __TXB0CONbits_t at 0xf40 TXB0CONbits;
+
+sfr at 0xf41 TXB0SIDH;
+volatile __TXB0SIDHbits_t at 0xf41 TXB0SIDHbits;
+
+sfr at 0xf42 TXB0SIDL;
+volatile __TXB0SIDLbits_t at 0xf42 TXB0SIDLbits;
+
+sfr at 0xf43 TXB0EIDH;
+volatile __TXB0EIDHbits_t at 0xf43 TXB0EIDHbits;
+
+sfr at 0xf44 TXB0EIDL;
+volatile __TXB0EIDLbits_t at 0xf44 TXB0EIDLbits;
+
+sfr at 0xf45 TXB0DLC;
+volatile __TXB0DLCbits_t at 0xf45 TXB0DLCbits;
+
+sfr at 0xf46 TXB0D0;
+volatile __TXB0D0bits_t at 0xf46 TXB0D0bits;
+
+sfr at 0xf47 TXB0D1;
+volatile __TXB0D1bits_t at 0xf47 TXB0D1bits;
+
+sfr at 0xf48 TXB0D2;
+volatile __TXB0D2bits_t at 0xf48 TXB0D2bits;
+
+sfr at 0xf49 TXB0D3;
+volatile __TXB0D3bits_t at 0xf49 TXB0D3bits;
+
+sfr at 0xf4a TXB0D4;
+volatile __TXB0D4bits_t at 0xf4a TXB0D4bits;
+
+sfr at 0xf4b TXB0D5;
+volatile __TXB0D5bits_t at 0xf4b TXB0D5bits;
+
+sfr at 0xf4c TXB0D6;
+volatile __TXB0D6bits_t at 0xf4c TXB0D6bits;
+
+sfr at 0xf4d TXB0D7;
+volatile __TXB0D7bits_t at 0xf4d TXB0D7bits;
+
+sfr at 0xf4e CANSTATRO2;
+volatile __CANSTATRO2bits_t at 0xf4e CANSTATRO2bits;
+
+sfr at 0xf50 RXB1CON;
+volatile __RXB1CONbits_t at 0xf50 RXB1CONbits;
+
+sfr at 0xf51 RXB1SIDH;
+volatile __RXB1SIDHbits_t at 0xf51 RXB1SIDHbits;
+
+sfr at 0xf52 RXB1SIDL;
+volatile __RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
+
+sfr at 0xf53 RXB1EIDH;
+volatile __RXB1EIDHbits_t at 0xf53 RXB1EIDHbits;
+
+sfr at 0xf54 RXB1EIDL;
+volatile __RXB1EIDLbits_t at 0xf54 RXB1EIDLbits;
+
+sfr at 0xf55 RXB1DLC;
+volatile __RXB1DLCbits_t at 0xf55 RXB1DLCbits;
+
+sfr at 0xf56 RXB1D0;
+volatile __RXB1D0bits_t at 0xf56 RXB1D0bits;
+
+sfr at 0xf57 RXB1D1;
+volatile __RXB1D1bits_t at 0xf57 RXB1D1bits;
+
+sfr at 0xf58 RXB1D2;
+volatile __RXB1D2bits_t at 0xf58 RXB1D2bits;
+
+sfr at 0xf59 RXB1D3;
+volatile __RXB1D3bits_t at 0xf59 RXB1D3bits;
+
+sfr at 0xf5a RXB1D4;
+volatile __RXB1D4bits_t at 0xf5a RXB1D4bits;
+
+sfr at 0xf5b RXB1D5;
+volatile __RXB1D5bits_t at 0xf5b RXB1D5bits;
+
+sfr at 0xf5c RXB1D6;
+volatile __RXB1D6bits_t at 0xf5c RXB1D6bits;
+
+sfr at 0xf5d RXB1D7;
+volatile __RXB1D7bits_t at 0xf5d RXB1D7bits;
+
+sfr at 0xf5e CANSTATRO1;
+volatile __CANSTATRO1bits_t at 0xf5e CANSTATRO1bits;
+
+sfr at 0xf60 RXB0CON;
+volatile __RXB0CONbits_t at 0xf60 RXB0CONbits;
+
+sfr at 0xf61 RXB0SIDH;
+volatile __RXB0SIDHbits_t at 0xf61 RXB0SIDHbits;
+
+sfr at 0xf62 RXB0SIDL;
+volatile __RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
+
+sfr at 0xf63 RXB0EIDH;
+volatile __RXB0EIDHbits_t at 0xf63 RXB0EIDHbits;
+
+sfr at 0xf64 RXB0EIDL;
+volatile __RXB0EIDLbits_t at 0xf64 RXB0EIDLbits;
+
+sfr at 0xf65 RXB0DLC;
+volatile __RXB0DLCbits_t at 0xf65 RXB0DLCbits;
+
+sfr at 0xf66 RXB0D0;
+sfr at 0xf67 RXB0D1;
+sfr at 0xf68 RXB0D2;
+sfr at 0xf69 RXB0D3;
+sfr at 0xf6a RXB0D4;
+sfr at 0xf6b RXB0D5;
+sfr at 0xf6c RXB0D6;
+sfr at 0xf6d RXB0D7;
+sfr at 0xf6e CANSTAT;
+volatile __CANSTATbits_t at 0xf6e CANSTATbits;
+
+sfr at 0xf6f CANCON;
+volatile __CANCONbits_t at 0xf6f CANCONbits;
+
+sfr at 0xf70 BRGCON1;
+volatile __BRGCON1bits_t at 0xf70 BRGCON1bits;
+
+sfr at 0xf71 BRGCON2;
+volatile __BRGCON2bits_t at 0xf71 BRGCON2bits;
+
+sfr at 0xf72 BRGCON3;
+volatile __BRGCON3bits_t at 0xf72 BRGCON3bits;
+
+sfr at 0xf73 CIOCON;
+volatile __CIOCONbits_t at 0xf73 CIOCONbits;
+
+sfr at 0xf74 COMSTAT;
+volatile __COMSTATbits_t at 0xf74 COMSTATbits;
+
+sfr at 0xf75 RXERRCNT;
+volatile __RXERRCNTbits_t at 0xf75 RXERRCNTbits;
+
+sfr at 0xf76 TXERRCNT;
+volatile __TXERRCNTbits_t at 0xf76 TXERRCNTbits;
+
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf83 PORTD;
+volatile __PORTDbits_t at 0xf83 PORTDbits;
+
+sfr at 0xf84 PORTE;
+volatile __PORTEbits_t at 0xf84 PORTEbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf8c LATD;
+volatile __LATDbits_t at 0xf8c LATDbits;
+
+sfr at 0xf8d LATE;
+volatile __LATEbits_t at 0xf8d LATEbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf95 TRISD;
+volatile __TRISDbits_t at 0xf95 TRISDbits;
+
+sfr at 0xf96 TRISE;
+volatile __TRISEbits_t at 0xf96 TRISEbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa3 PIE3;
+volatile __PIE3bits_t at 0xfa3 PIE3bits;
+
+sfr at 0xfa4 PIR3;
+volatile __PIR3bits_t at 0xfa4 PIR3bits;
+
+sfr at 0xfa5 IPR3;
+volatile __IPR3bits_t at 0xfa5 IPR3bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfab RCSTA;
+volatile __RCSTAbits_t at 0xfab RCSTAbits;
+
+sfr at 0xfac TXSTA;
+volatile __TXSTAbits_t at 0xfac TXSTAbits;
+
+sfr at 0xfad TXREG;
+sfr at 0xfae RCREG;
+sfr at 0xfaf SPBRG;
+sfr at 0xfb0 PSPCON;
+volatile __PSPCONbits_t at 0xfb0 PSPCONbits;
+
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfb4 CMCON;
+volatile __CMCONbits_t at 0xfb4 CMCONbits;
+
+sfr at 0xfb5 CVRCON;
+volatile __CVRCONbits_t at 0xfb5 CVRCONbits;
+
+sfr at 0xfb6 ECCPAS;
+volatile __ECCPASbits_t at 0xfb6 ECCPASbits;
+
+sfr at 0xfb7 ECCP1DEL;
+volatile __ECCP1DELbits_t at 0xfb7 ECCP1DELbits;
+
+sfr at 0xfba ECCP1CON;
+volatile __ECCP1CONbits_t at 0xfba ECCP1CONbits;
+
+sfr at 0xfbb ECCPR1L;
+sfr at 0xfbc ECCPR1H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f6520.c b/device/lib/pic16/libdev/pic18f6520.c
new file mode 100644 (file)
index 0000000..4d23130
--- /dev/null
@@ -0,0 +1,277 @@
+
+/*
+ * pic18f6520.c - PIC18F6520 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f6520.h>
+
+sfr at 0xf6b RCSTA2;
+volatile __RCSTA2bits_t at 0xf6b RCSTA2bits;
+
+sfr at 0xf6c TXSTA2;
+volatile __TXSTA2bits_t at 0xf6c TXSTA2bits;
+
+sfr at 0xf6d TXREG2;
+sfr at 0xf6e RCREG2;
+sfr at 0xf6f SPBRG2;
+sfr at 0xf70 CCP5CON;
+volatile __CCP5CONbits_t at 0xf70 CCP5CONbits;
+
+sfr at 0xf71 CCPR5L;
+sfr at 0xf72 CCPR5H;
+sfr at 0xf73 CCP4CON;
+volatile __CCP4CONbits_t at 0xf73 CCP4CONbits;
+
+sfr at 0xf74 CCPR4L;
+sfr at 0xf75 CCPR4H;
+sfr at 0xf76 T4CON;
+volatile __T4CONbits_t at 0xf76 T4CONbits;
+
+sfr at 0xf77 PR4;
+sfr at 0xf78 TMR4;
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf83 PORTD;
+volatile __PORTDbits_t at 0xf83 PORTDbits;
+
+sfr at 0xf84 PORTE;
+volatile __PORTEbits_t at 0xf84 PORTEbits;
+
+sfr at 0xf85 PORTF;
+volatile __PORTFbits_t at 0xf85 PORTFbits;
+
+sfr at 0xf86 PORTG;
+volatile __PORTGbits_t at 0xf86 PORTGbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf8c LATD;
+volatile __LATDbits_t at 0xf8c LATDbits;
+
+sfr at 0xf8d LATE;
+volatile __LATEbits_t at 0xf8d LATEbits;
+
+sfr at 0xf8e LATF;
+volatile __LATFbits_t at 0xf8e LATFbits;
+
+sfr at 0xf8f LATG;
+volatile __LATGbits_t at 0xf8f LATGbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf95 TRISD;
+volatile __TRISDbits_t at 0xf95 TRISDbits;
+
+sfr at 0xf96 TRISE;
+volatile __TRISEbits_t at 0xf96 TRISEbits;
+
+sfr at 0xf97 TRISF;
+volatile __TRISFbits_t at 0xf97 TRISFbits;
+
+sfr at 0xf98 TRISG;
+volatile __TRISGbits_t at 0xf98 TRISGbits;
+
+sfr at 0xf9c MEMCON;
+volatile __MEMCONbits_t at 0xf9c MEMCONbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa3 PIE3;
+volatile __PIE3bits_t at 0xfa3 PIE3bits;
+
+sfr at 0xfa4 PIR3;
+volatile __PIR3bits_t at 0xfa4 PIR3bits;
+
+sfr at 0xfa5 IPR3;
+volatile __IPR3bits_t at 0xfa5 IPR3bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfaa EEADRH;
+sfr at 0xfab RCSTA1;
+volatile __RCSTA1bits_t at 0xfab RCSTA1bits;
+
+sfr at 0xfac TXSTA1;
+volatile __TXSTA1bits_t at 0xfac TXSTA1bits;
+
+sfr at 0xfad TXREG1;
+sfr at 0xfae RCREG1;
+sfr at 0xfaf SPBRG1;
+sfr at 0xfb0 PSPCON;
+volatile __PSPCONbits_t at 0xfb0 PSPCONbits;
+
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfb4 CMCON;
+volatile __CMCONbits_t at 0xfb4 CMCONbits;
+
+sfr at 0xfb5 CVRCON;
+volatile __CVRCONbits_t at 0xfb5 CVRCONbits;
+
+sfr at 0xfb7 CCP3CON;
+volatile __CCP3CONbits_t at 0xfb7 CCP3CONbits;
+
+sfr at 0xfb8 CCPR3L;
+sfr at 0xfb9 CCPR3H;
+sfr at 0xfba CCP2CON;
+volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
+
+sfr at 0xfbb CCPR2L;
+sfr at 0xfbc CCPR2H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc0 ADCON2;
+volatile __ADCON2bits_t at 0xfc0 ADCON2bits;
+
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f6620.c b/device/lib/pic16/libdev/pic18f6620.c
new file mode 100644 (file)
index 0000000..55fd343
--- /dev/null
@@ -0,0 +1,274 @@
+
+/*
+ * pic18f6620.c - PIC18F6620 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f6620.h>
+
+sfr at 0xf6b RCSTA2;
+volatile __RCSTA2bits_t at 0xf6b RCSTA2bits;
+
+sfr at 0xf6c TXSTA2;
+volatile __TXSTA2bits_t at 0xf6c TXSTA2bits;
+
+sfr at 0xf6d TXREG2;
+sfr at 0xf6e RCREG2;
+sfr at 0xf6f SPBRG2;
+sfr at 0xf70 CCP5CON;
+volatile __CCP5CONbits_t at 0xf70 CCP5CONbits;
+
+sfr at 0xf71 CCPR5L;
+sfr at 0xf72 CCPR5H;
+sfr at 0xf73 CCP4CON;
+volatile __CCP4CONbits_t at 0xf73 CCP4CONbits;
+
+sfr at 0xf74 CCPR4L;
+sfr at 0xf75 CCPR4H;
+sfr at 0xf76 T4CON;
+volatile __T4CONbits_t at 0xf76 T4CONbits;
+
+sfr at 0xf77 PR4;
+sfr at 0xf78 TMR4;
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf83 PORTD;
+volatile __PORTDbits_t at 0xf83 PORTDbits;
+
+sfr at 0xf84 PORTE;
+volatile __PORTEbits_t at 0xf84 PORTEbits;
+
+sfr at 0xf85 PORTF;
+volatile __PORTFbits_t at 0xf85 PORTFbits;
+
+sfr at 0xf86 PORTG;
+volatile __PORTGbits_t at 0xf86 PORTGbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf8c LATD;
+volatile __LATDbits_t at 0xf8c LATDbits;
+
+sfr at 0xf8d LATE;
+volatile __LATEbits_t at 0xf8d LATEbits;
+
+sfr at 0xf8e LATF;
+volatile __LATFbits_t at 0xf8e LATFbits;
+
+sfr at 0xf8f LATG;
+volatile __LATGbits_t at 0xf8f LATGbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf95 TRISD;
+volatile __TRISDbits_t at 0xf95 TRISDbits;
+
+sfr at 0xf96 TRISE;
+volatile __TRISEbits_t at 0xf96 TRISEbits;
+
+sfr at 0xf97 TRISF;
+volatile __TRISFbits_t at 0xf97 TRISFbits;
+
+sfr at 0xf98 TRISG;
+volatile __TRISGbits_t at 0xf98 TRISGbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa3 PIE3;
+volatile __PIE3bits_t at 0xfa3 PIE3bits;
+
+sfr at 0xfa4 PIR3;
+volatile __PIR3bits_t at 0xfa4 PIR3bits;
+
+sfr at 0xfa5 IPR3;
+volatile __IPR3bits_t at 0xfa5 IPR3bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfaa EEADRH;
+sfr at 0xfab RCSTA1;
+volatile __RCSTA1bits_t at 0xfab RCSTA1bits;
+
+sfr at 0xfac TXSTA1;
+volatile __TXSTA1bits_t at 0xfac TXSTA1bits;
+
+sfr at 0xfad TXREG1;
+sfr at 0xfae RCREG1;
+sfr at 0xfaf SPBRG1;
+sfr at 0xfb0 PSPCON;
+volatile __PSPCONbits_t at 0xfb0 PSPCONbits;
+
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfb4 CMCON;
+volatile __CMCONbits_t at 0xfb4 CMCONbits;
+
+sfr at 0xfb5 CVRCON;
+volatile __CVRCONbits_t at 0xfb5 CVRCONbits;
+
+sfr at 0xfb7 CCP3CON;
+volatile __CCP3CONbits_t at 0xfb7 CCP3CONbits;
+
+sfr at 0xfb8 CCPR3L;
+sfr at 0xfb9 CCPR3H;
+sfr at 0xfba CCP2CON;
+volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
+
+sfr at 0xfbb CCPR2L;
+sfr at 0xfbc CCPR2H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc0 ADCON2;
+volatile __ADCON2bits_t at 0xfc0 ADCON2bits;
+
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f6680.c b/device/lib/pic16/libdev/pic18f6680.c
new file mode 100644 (file)
index 0000000..a5493b1
--- /dev/null
@@ -0,0 +1,426 @@
+
+/*
+ * pic18f6680.c - PIC18F6680 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f6680.h>
+
+sfr at 0xf00 RXF0SIDH;
+sfr at 0xf01 RXF0SIDL;
+volatile __RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
+
+sfr at 0xf02 RXF0EIDH;
+sfr at 0xf03 RXF0EIDL;
+sfr at 0xf04 RXF1SIDH;
+sfr at 0xf05 RXF1SIDL;
+volatile __RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
+
+sfr at 0xf06 RXF1EIDH;
+sfr at 0xf07 RXF1EIDL;
+sfr at 0xf08 RXF2SIDH;
+sfr at 0xf09 RXF2SIDL;
+sfr at 0xf0a RXF2EIDH;
+sfr at 0xf0b RXF2EIDL;
+volatile __RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
+
+sfr at 0xf0c RXF3SIDH;
+sfr at 0xf0d RXF3SIDL;
+volatile __RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
+
+sfr at 0xf0e RXF3EIDH;
+sfr at 0xf0f RXF3EIDL;
+sfr at 0xf10 RXF4SIDH;
+sfr at 0xf11 RXF4SIDL;
+volatile __RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
+
+sfr at 0xf12 RXF4EIDH;
+sfr at 0xf13 RXF4EIDL;
+sfr at 0xf14 RXF5SIDH;
+sfr at 0xf15 RXF5SIDL;
+volatile __RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
+
+sfr at 0xf16 RXF5EIDH;
+sfr at 0xf17 RXF5EIDL;
+sfr at 0xf18 RXM0SIDH;
+sfr at 0xf19 RXM0SIDL;
+volatile __RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
+
+sfr at 0xf1a RXM0EIDH;
+sfr at 0xf1b RXM0EIDL;
+sfr at 0xf1c RXM1SIDH;
+sfr at 0xf1d RXM1SIDL;
+volatile __RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
+
+sfr at 0xf1e RXM1EIDH;
+sfr at 0xf1f RXM1EIDL;
+sfr at 0xf20 TXB2CON;
+volatile __TXB2CONbits_t at 0xf20 TXB2CONbits;
+
+sfr at 0xf21 TXB2SIDH;
+sfr at 0xf22 TXB2SIDL;
+volatile __TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
+
+sfr at 0xf23 TXB2EIDH;
+sfr at 0xf24 TXB2EIDL;
+sfr at 0xf25 TXB2DLC;
+volatile __TXB2DLCbits_t at 0xf25 TXB2DLCbits;
+
+sfr at 0xf26 TXB2D0;
+sfr at 0xf27 TXB2D1;
+sfr at 0xf28 TXB2D2;
+sfr at 0xf29 TXB2D3;
+sfr at 0xf2a TXB2D4;
+sfr at 0xf2b TXB2D5;
+sfr at 0xf2c TXB2D6;
+sfr at 0xf2d TXB2D7;
+sfr at 0xf2e CANSTATRO3;
+sfr at 0xf30 TXB1CON;
+volatile __TXB1CONbits_t at 0xf30 TXB1CONbits;
+
+sfr at 0xf31 TXB1SIDH;
+sfr at 0xf32 TXB1SIDL;
+volatile __TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
+
+sfr at 0xf33 TXB1EIDH;
+sfr at 0xf34 TXB1EIDL;
+sfr at 0xf35 TXB1DLC;
+volatile __TXB1DLCbits_t at 0xf35 TXB1DLCbits;
+
+sfr at 0xf36 TXB1D0;
+sfr at 0xf37 TXB1D1;
+sfr at 0xf38 TXB1D2;
+sfr at 0xf39 TXB1D3;
+sfr at 0xf3a TXB1D4;
+sfr at 0xf3b TXB1D5;
+sfr at 0xf3c TXB1D6;
+sfr at 0xf3d TXB1D7;
+sfr at 0xf3e CANSTATRO2;
+sfr at 0xf40 TXB0CON;
+volatile __TXB0CONbits_t at 0xf40 TXB0CONbits;
+
+sfr at 0xf41 TXB0SIDH;
+sfr at 0xf42 TXB0SIDL;
+sfr at 0xf43 TXB0EIDH;
+sfr at 0xf44 TXB0EIDL;
+sfr at 0xf45 TXB0DLC;
+volatile __TXB0DLCbits_t at 0xf45 TXB0DLCbits;
+
+sfr at 0xf46 TXB0D0;
+sfr at 0xf47 TXB0D1;
+sfr at 0xf48 TXB0D2;
+sfr at 0xf49 TXB0D3;
+sfr at 0xf4a TXB0D4;
+sfr at 0xf4b TXB0D5;
+sfr at 0xf4c TXB0D6;
+sfr at 0xf4d TXB0D7;
+sfr at 0xf4e CANSTATRO1;
+sfr at 0xf50 RXB1CON;
+volatile __RXB1CONbits_t at 0xf50 RXB1CONbits;
+
+sfr at 0xf51 RXB1SIDH;
+sfr at 0xf52 RXB1SIDL;
+volatile __RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
+
+sfr at 0xf53 RXB1EIDH;
+sfr at 0xf54 RXB1EIDL;
+sfr at 0xf55 RXB1DLC;
+volatile __RXB1DLCbits_t at 0xf55 RXB1DLCbits;
+
+sfr at 0xf56 RXB1D0;
+sfr at 0xf57 RXB1D1;
+sfr at 0xf58 RXB1D2;
+sfr at 0xf59 RXB1D3;
+sfr at 0xf5a RXB1D4;
+sfr at 0xf5b RXB1D5;
+sfr at 0xf5c RXB1D6;
+sfr at 0xf5d RXB1D7;
+sfr at 0xf5e CANSTATRO0;
+sfr at 0xf60 RXB0CON;
+volatile __RXB0CONbits_t at 0xf60 RXB0CONbits;
+
+sfr at 0xf61 RXB0SIDH;
+sfr at 0xf62 RXB0SIDL;
+volatile __RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
+
+sfr at 0xf63 RXB0EIDH;
+sfr at 0xf64 RXB0EIDL;
+sfr at 0xf65 RXB0DLC;
+sfr at 0xf66 RXB0D0;
+sfr at 0xf67 RXB0D1;
+sfr at 0xf68 RXB0D2;
+sfr at 0xf69 RXB0D3;
+sfr at 0xf6a RXB0D4;
+sfr at 0xf6b RXB0D5;
+sfr at 0xf6c RXB0D6;
+sfr at 0xf6d RXB0D7;
+sfr at 0xf6e CANSTAT;
+volatile __CANSTATbits_t at 0xf6e CANSTATbits;
+
+sfr at 0xf6f CANCON;
+volatile __CANCONbits_t at 0xf6f CANCONbits;
+
+sfr at 0xf70 BRGCON1;
+volatile __BRGCON1bits_t at 0xf70 BRGCON1bits;
+
+sfr at 0xf71 BRGCON2;
+volatile __BRGCON2bits_t at 0xf71 BRGCON2bits;
+
+sfr at 0xf72 BRGCON3;
+volatile __BRGCON3bits_t at 0xf72 BRGCON3bits;
+
+sfr at 0xf73 CIOCON;
+volatile __CIOCONbits_t at 0xf73 CIOCONbits;
+
+sfr at 0xf74 COMSTAT;
+volatile __COMSTATbits_t at 0xf74 COMSTATbits;
+
+sfr at 0xf75 RXERRCNT;
+volatile __RXERRCNTbits_t at 0xf75 RXERRCNTbits;
+
+sfr at 0xf76 TXERRCNT;
+volatile __TXERRCNTbits_t at 0xf76 TXERRCNTbits;
+
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf83 PORTD;
+volatile __PORTDbits_t at 0xf83 PORTDbits;
+
+sfr at 0xf84 PORTE;
+volatile __PORTEbits_t at 0xf84 PORTEbits;
+
+sfr at 0xf85 PORTF;
+volatile __PORTFbits_t at 0xf85 PORTFbits;
+
+sfr at 0xf86 PORTG;
+volatile __PORTGbits_t at 0xf86 PORTGbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf8c LATD;
+volatile __LATDbits_t at 0xf8c LATDbits;
+
+sfr at 0xf8d LATE;
+volatile __LATEbits_t at 0xf8d LATEbits;
+
+sfr at 0xf8e LATF;
+volatile __LATFbits_t at 0xf8e LATFbits;
+
+sfr at 0xf8f LATG;
+volatile __LATGbits_t at 0xf8f LATGbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf95 TRISD;
+volatile __TRISDbits_t at 0xf95 TRISDbits;
+
+sfr at 0xf96 TRISE;
+volatile __TRISEbits_t at 0xf96 TRISEbits;
+
+sfr at 0xf97 TRISF;
+volatile __TRISFbits_t at 0xf97 TRISFbits;
+
+sfr at 0xf98 TRISG;
+volatile __TRISGbits_t at 0xf98 TRISGbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa3 PIE3;
+volatile __PIE3bits_t at 0xfa3 PIE3bits;
+
+sfr at 0xfa4 PIR3;
+volatile __PIR3bits_t at 0xfa4 PIR3bits;
+
+sfr at 0xfa5 IPR3;
+volatile __IPR3bits_t at 0xfa5 IPR3bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfaa EEADRH;
+sfr at 0xfab RCSTA;
+volatile __RCSTAbits_t at 0xfab RCSTAbits;
+
+sfr at 0xfac TXSTA;
+volatile __TXSTAbits_t at 0xfac TXSTAbits;
+
+sfr at 0xfad TXREG;
+sfr at 0xfae RCREG;
+sfr at 0xfaf SPBRG;
+sfr at 0xfb0 PSPCON;
+volatile __PSPCONbits_t at 0xfb0 PSPCONbits;
+
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfb4 CMCON;
+volatile __CMCONbits_t at 0xfb4 CMCONbits;
+
+sfr at 0xfb5 CVRCON;
+volatile __CVRCONbits_t at 0xfb5 CVRCONbits;
+
+sfr at 0xfb6 ECCPAS;
+volatile __ECCPASbits_t at 0xfb6 ECCPASbits;
+
+sfr at 0xfb7 ECCP1DEL;
+volatile __ECCP1DELbits_t at 0xfb7 ECCP1DELbits;
+
+sfr at 0xfba ECCP1CON;
+volatile __ECCP1CONbits_t at 0xfba ECCP1CONbits;
+
+sfr at 0xfba CCP2CON;
+volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
+
+sfr at 0xfbb ECCPR1L;
+sfr at 0xfbb CCPR2L;
+sfr at 0xfbc ECCPR1H;
+sfr at 0xfbc CCPR2H;
+sfr at 0xfc0 ADCON2;
+volatile __ADCON2bits_t at 0xfc0 ADCON2bits;
+
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f6720.c b/device/lib/pic16/libdev/pic18f6720.c
new file mode 100644 (file)
index 0000000..6425f48
--- /dev/null
@@ -0,0 +1,274 @@
+
+/*
+ * pic18f6720.c - PIC18F6720 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f6720.h>
+
+sfr at 0xf6b RCSTA2;
+volatile __RCSTA2bits_t at 0xf6b RCSTA2bits;
+
+sfr at 0xf6c TXSTA2;
+volatile __TXSTA2bits_t at 0xf6c TXSTA2bits;
+
+sfr at 0xf6d TXREG2;
+sfr at 0xf6e RCREG2;
+sfr at 0xf6f SPBRG2;
+sfr at 0xf70 CCP5CON;
+volatile __CCP5CONbits_t at 0xf70 CCP5CONbits;
+
+sfr at 0xf71 CCPR5L;
+sfr at 0xf72 CCPR5H;
+sfr at 0xf73 CCP4CON;
+volatile __CCP4CONbits_t at 0xf73 CCP4CONbits;
+
+sfr at 0xf74 CCPR4L;
+sfr at 0xf75 CCPR4H;
+sfr at 0xf76 T4CON;
+volatile __T4CONbits_t at 0xf76 T4CONbits;
+
+sfr at 0xf77 PR4;
+sfr at 0xf78 TMR4;
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf83 PORTD;
+volatile __PORTDbits_t at 0xf83 PORTDbits;
+
+sfr at 0xf84 PORTE;
+volatile __PORTEbits_t at 0xf84 PORTEbits;
+
+sfr at 0xf85 PORTF;
+volatile __PORTFbits_t at 0xf85 PORTFbits;
+
+sfr at 0xf86 PORTG;
+volatile __PORTGbits_t at 0xf86 PORTGbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf8c LATD;
+volatile __LATDbits_t at 0xf8c LATDbits;
+
+sfr at 0xf8d LATE;
+volatile __LATEbits_t at 0xf8d LATEbits;
+
+sfr at 0xf8e LATF;
+volatile __LATFbits_t at 0xf8e LATFbits;
+
+sfr at 0xf8f LATG;
+volatile __LATGbits_t at 0xf8f LATGbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf95 TRISD;
+volatile __TRISDbits_t at 0xf95 TRISDbits;
+
+sfr at 0xf96 TRISE;
+volatile __TRISEbits_t at 0xf96 TRISEbits;
+
+sfr at 0xf97 TRISF;
+volatile __TRISFbits_t at 0xf97 TRISFbits;
+
+sfr at 0xf98 TRISG;
+volatile __TRISGbits_t at 0xf98 TRISGbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa3 PIE3;
+volatile __PIE3bits_t at 0xfa3 PIE3bits;
+
+sfr at 0xfa4 PIR3;
+volatile __PIR3bits_t at 0xfa4 PIR3bits;
+
+sfr at 0xfa5 IPR3;
+volatile __IPR3bits_t at 0xfa5 IPR3bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfaa EEADRH;
+sfr at 0xfab RCSTA1;
+volatile __RCSTA1bits_t at 0xfab RCSTA1bits;
+
+sfr at 0xfac TXSTA1;
+volatile __TXSTA1bits_t at 0xfac TXSTA1bits;
+
+sfr at 0xfad TXREG1;
+sfr at 0xfae RCREG1;
+sfr at 0xfaf SPBRG1;
+sfr at 0xfb0 PSPCON;
+volatile __PSPCONbits_t at 0xfb0 PSPCONbits;
+
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfb4 CMCON;
+volatile __CMCONbits_t at 0xfb4 CMCONbits;
+
+sfr at 0xfb5 CVRCON;
+volatile __CVRCONbits_t at 0xfb5 CVRCONbits;
+
+sfr at 0xfb7 CCP3CON;
+volatile __CCP3CONbits_t at 0xfb7 CCP3CONbits;
+
+sfr at 0xfb8 CCPR3L;
+sfr at 0xfb9 CCPR3H;
+sfr at 0xfba CCP2CON;
+volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
+
+sfr at 0xfbb CCPR2L;
+sfr at 0xfbc CCPR2H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc0 ADCON2;
+volatile __ADCON2bits_t at 0xfc0 ADCON2bits;
+
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f8520.c b/device/lib/pic16/libdev/pic18f8520.c
new file mode 100644 (file)
index 0000000..ef3b66a
--- /dev/null
@@ -0,0 +1,295 @@
+
+/*
+ * pic18f8520.c - PIC18F8520 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f8520.h>
+
+sfr at 0xf6b RCSTA2;
+volatile __RCSTA2bits_t at 0xf6b RCSTA2bits;
+
+sfr at 0xf6c TXSTA2;
+volatile __TXSTA2bits_t at 0xf6c TXSTA2bits;
+
+sfr at 0xf6d TXREG2;
+sfr at 0xf6e RCREG2;
+sfr at 0xf6f SPBRG2;
+sfr at 0xf70 CCP5CON;
+volatile __CCP5CONbits_t at 0xf70 CCP5CONbits;
+
+sfr at 0xf71 CCPR5L;
+sfr at 0xf72 CCPR5H;
+sfr at 0xf73 CCP4CON;
+volatile __CCP4CONbits_t at 0xf73 CCP4CONbits;
+
+sfr at 0xf74 CCPR4L;
+sfr at 0xf75 CCPR4H;
+sfr at 0xf76 T4CON;
+volatile __T4CONbits_t at 0xf76 T4CONbits;
+
+sfr at 0xf77 PR4;
+sfr at 0xf78 TMR4;
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf83 PORTD;
+volatile __PORTDbits_t at 0xf83 PORTDbits;
+
+sfr at 0xf84 PORTE;
+volatile __PORTEbits_t at 0xf84 PORTEbits;
+
+sfr at 0xf85 PORTF;
+volatile __PORTFbits_t at 0xf85 PORTFbits;
+
+sfr at 0xf86 PORTG;
+volatile __PORTGbits_t at 0xf86 PORTGbits;
+
+sfr at 0xf87 PORTH;
+volatile __PORTHbits_t at 0xf87 PORTHbits;
+
+sfr at 0xf88 PORTJ;
+volatile __PORTJbits_t at 0xf88 PORTJbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf8c LATD;
+volatile __LATDbits_t at 0xf8c LATDbits;
+
+sfr at 0xf8d LATE;
+volatile __LATEbits_t at 0xf8d LATEbits;
+
+sfr at 0xf8e LATF;
+volatile __LATFbits_t at 0xf8e LATFbits;
+
+sfr at 0xf8f LATG;
+volatile __LATGbits_t at 0xf8f LATGbits;
+
+sfr at 0xf90 LATH;
+volatile __LATHbits_t at 0xf90 LATHbits;
+
+sfr at 0xf91 LATJ;
+volatile __LATJbits_t at 0xf91 LATJbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf95 TRISD;
+volatile __TRISDbits_t at 0xf95 TRISDbits;
+
+sfr at 0xf96 TRISE;
+volatile __TRISEbits_t at 0xf96 TRISEbits;
+
+sfr at 0xf97 TRISF;
+volatile __TRISFbits_t at 0xf97 TRISFbits;
+
+sfr at 0xf98 TRISG;
+volatile __TRISGbits_t at 0xf98 TRISGbits;
+
+sfr at 0xf99 TRISH;
+volatile __TRISHbits_t at 0xf99 TRISHbits;
+
+sfr at 0xf9a TRISJ;
+volatile __TRISJbits_t at 0xf9a TRISJbits;
+
+sfr at 0xf9c MEMCON;
+volatile __MEMCONbits_t at 0xf9c MEMCONbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa3 PIE3;
+volatile __PIE3bits_t at 0xfa3 PIE3bits;
+
+sfr at 0xfa4 PIR3;
+volatile __PIR3bits_t at 0xfa4 PIR3bits;
+
+sfr at 0xfa5 IPR3;
+volatile __IPR3bits_t at 0xfa5 IPR3bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfaa EEADRH;
+sfr at 0xfab RCSTA1;
+volatile __RCSTA1bits_t at 0xfab RCSTA1bits;
+
+sfr at 0xfac TXSTA1;
+volatile __TXSTA1bits_t at 0xfac TXSTA1bits;
+
+sfr at 0xfad TXREG1;
+sfr at 0xfae RCREG1;
+sfr at 0xfaf SPBRG1;
+sfr at 0xfb0 PSPCON;
+volatile __PSPCONbits_t at 0xfb0 PSPCONbits;
+
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfb4 CMCON;
+volatile __CMCONbits_t at 0xfb4 CMCONbits;
+
+sfr at 0xfb5 CVRCON;
+volatile __CVRCONbits_t at 0xfb5 CVRCONbits;
+
+sfr at 0xfb7 CCP3CON;
+volatile __CCP3CONbits_t at 0xfb7 CCP3CONbits;
+
+sfr at 0xfb8 CCPR3L;
+sfr at 0xfb9 CCPR3H;
+sfr at 0xfba CCP2CON;
+volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
+
+sfr at 0xfbb CCPR2L;
+sfr at 0xfbc CCPR2H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc0 ADCON2;
+volatile __ADCON2bits_t at 0xfc0 ADCON2bits;
+
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f8620.c b/device/lib/pic16/libdev/pic18f8620.c
new file mode 100644 (file)
index 0000000..5bbc97e
--- /dev/null
@@ -0,0 +1,295 @@
+
+/*
+ * pic18f8620.c - PIC18F8620 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f8620.h>
+
+sfr at 0xf6b RCSTA2;
+volatile __RCSTA2bits_t at 0xf6b RCSTA2bits;
+
+sfr at 0xf6c TXSTA2;
+volatile __TXSTA2bits_t at 0xf6c TXSTA2bits;
+
+sfr at 0xf6d TXREG2;
+sfr at 0xf6e RCREG2;
+sfr at 0xf6f SPBRG2;
+sfr at 0xf70 CCP5CON;
+volatile __CCP5CONbits_t at 0xf70 CCP5CONbits;
+
+sfr at 0xf71 CCPR5L;
+sfr at 0xf72 CCPR5H;
+sfr at 0xf73 CCP4CON;
+volatile __CCP4CONbits_t at 0xf73 CCP4CONbits;
+
+sfr at 0xf74 CCPR4L;
+sfr at 0xf75 CCPR4H;
+sfr at 0xf76 T4CON;
+volatile __T4CONbits_t at 0xf76 T4CONbits;
+
+sfr at 0xf77 PR4;
+sfr at 0xf78 TMR4;
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf83 PORTD;
+volatile __PORTDbits_t at 0xf83 PORTDbits;
+
+sfr at 0xf84 PORTE;
+volatile __PORTEbits_t at 0xf84 PORTEbits;
+
+sfr at 0xf85 PORTF;
+volatile __PORTFbits_t at 0xf85 PORTFbits;
+
+sfr at 0xf86 PORTG;
+volatile __PORTGbits_t at 0xf86 PORTGbits;
+
+sfr at 0xf87 PORTH;
+volatile __PORTHbits_t at 0xf87 PORTHbits;
+
+sfr at 0xf88 PORTJ;
+volatile __PORTJbits_t at 0xf88 PORTJbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf8c LATD;
+volatile __LATDbits_t at 0xf8c LATDbits;
+
+sfr at 0xf8d LATE;
+volatile __LATEbits_t at 0xf8d LATEbits;
+
+sfr at 0xf8e LATF;
+volatile __LATFbits_t at 0xf8e LATFbits;
+
+sfr at 0xf8f LATG;
+volatile __LATGbits_t at 0xf8f LATGbits;
+
+sfr at 0xf90 LATH;
+volatile __LATHbits_t at 0xf90 LATHbits;
+
+sfr at 0xf91 LATJ;
+volatile __LATJbits_t at 0xf91 LATJbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf95 TRISD;
+volatile __TRISDbits_t at 0xf95 TRISDbits;
+
+sfr at 0xf96 TRISE;
+volatile __TRISEbits_t at 0xf96 TRISEbits;
+
+sfr at 0xf97 TRISF;
+volatile __TRISFbits_t at 0xf97 TRISFbits;
+
+sfr at 0xf98 TRISG;
+volatile __TRISGbits_t at 0xf98 TRISGbits;
+
+sfr at 0xf99 TRISH;
+volatile __TRISHbits_t at 0xf99 TRISHbits;
+
+sfr at 0xf9a TRISJ;
+volatile __TRISJbits_t at 0xf9a TRISJbits;
+
+sfr at 0xf9c MEMCON;
+volatile __MEMCONbits_t at 0xf9c MEMCONbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa3 PIE3;
+volatile __PIE3bits_t at 0xfa3 PIE3bits;
+
+sfr at 0xfa4 PIR3;
+volatile __PIR3bits_t at 0xfa4 PIR3bits;
+
+sfr at 0xfa5 IPR3;
+volatile __IPR3bits_t at 0xfa5 IPR3bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfaa EEADRH;
+sfr at 0xfab RCSTA1;
+volatile __RCSTA1bits_t at 0xfab RCSTA1bits;
+
+sfr at 0xfac TXSTA1;
+volatile __TXSTA1bits_t at 0xfac TXSTA1bits;
+
+sfr at 0xfad TXREG1;
+sfr at 0xfae RCREG1;
+sfr at 0xfaf SPBRG1;
+sfr at 0xfb0 PSPCON;
+volatile __PSPCONbits_t at 0xfb0 PSPCONbits;
+
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfb4 CMCON;
+volatile __CMCONbits_t at 0xfb4 CMCONbits;
+
+sfr at 0xfb5 CVRCON;
+volatile __CVRCONbits_t at 0xfb5 CVRCONbits;
+
+sfr at 0xfb7 CCP3CON;
+volatile __CCP3CONbits_t at 0xfb7 CCP3CONbits;
+
+sfr at 0xfb8 CCPR3L;
+sfr at 0xfb9 CCPR3H;
+sfr at 0xfba CCP2CON;
+volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
+
+sfr at 0xfbb CCPR2L;
+sfr at 0xfbc CCPR2H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc0 ADCON2;
+volatile __ADCON2bits_t at 0xfc0 ADCON2bits;
+
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f8680.c b/device/lib/pic16/libdev/pic18f8680.c
new file mode 100644 (file)
index 0000000..5080294
--- /dev/null
@@ -0,0 +1,447 @@
+
+/*
+ * pic18f8680.c - PIC18F8680 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f8680.h>
+
+sfr at 0xf00 RXF0SIDH;
+sfr at 0xf01 RXF0SIDL;
+volatile __RXF0SIDLbits_t at 0xf01 RXF0SIDLbits;
+
+sfr at 0xf02 RXF0EIDH;
+sfr at 0xf03 RXF0EIDL;
+sfr at 0xf04 RXF1SIDH;
+sfr at 0xf05 RXF1SIDL;
+volatile __RXF1SIDLbits_t at 0xf05 RXF1SIDLbits;
+
+sfr at 0xf06 RXF1EIDH;
+sfr at 0xf07 RXF1EIDL;
+sfr at 0xf08 RXF2SIDH;
+sfr at 0xf09 RXF2SIDL;
+sfr at 0xf0a RXF2EIDH;
+sfr at 0xf0b RXF2EIDL;
+volatile __RXF2EIDLbits_t at 0xf0b RXF2EIDLbits;
+
+sfr at 0xf0c RXF3SIDH;
+sfr at 0xf0d RXF3SIDL;
+volatile __RXF3SIDLbits_t at 0xf0d RXF3SIDLbits;
+
+sfr at 0xf0e RXF3EIDH;
+sfr at 0xf0f RXF3EIDL;
+sfr at 0xf10 RXF4SIDH;
+sfr at 0xf11 RXF4SIDL;
+volatile __RXF4SIDLbits_t at 0xf11 RXF4SIDLbits;
+
+sfr at 0xf12 RXF4EIDH;
+sfr at 0xf13 RXF4EIDL;
+sfr at 0xf14 RXF5SIDH;
+sfr at 0xf15 RXF5SIDL;
+volatile __RXF5SIDLbits_t at 0xf15 RXF5SIDLbits;
+
+sfr at 0xf16 RXF5EIDH;
+sfr at 0xf17 RXF5EIDL;
+sfr at 0xf18 RXM0SIDH;
+sfr at 0xf19 RXM0SIDL;
+volatile __RXM0SIDLbits_t at 0xf19 RXM0SIDLbits;
+
+sfr at 0xf1a RXM0EIDH;
+sfr at 0xf1b RXM0EIDL;
+sfr at 0xf1c RXM1SIDH;
+sfr at 0xf1d RXM1SIDL;
+volatile __RXM1SIDLbits_t at 0xf1d RXM1SIDLbits;
+
+sfr at 0xf1e RXM1EIDH;
+sfr at 0xf1f RXM1EIDL;
+sfr at 0xf20 TXB2CON;
+volatile __TXB2CONbits_t at 0xf20 TXB2CONbits;
+
+sfr at 0xf21 TXB2SIDH;
+sfr at 0xf22 TXB2SIDL;
+volatile __TXB2SIDLbits_t at 0xf22 TXB2SIDLbits;
+
+sfr at 0xf23 TXB2EIDH;
+sfr at 0xf24 TXB2EIDL;
+sfr at 0xf25 TXB2DLC;
+volatile __TXB2DLCbits_t at 0xf25 TXB2DLCbits;
+
+sfr at 0xf26 TXB2D0;
+sfr at 0xf27 TXB2D1;
+sfr at 0xf28 TXB2D2;
+sfr at 0xf29 TXB2D3;
+sfr at 0xf2a TXB2D4;
+sfr at 0xf2b TXB2D5;
+sfr at 0xf2c TXB2D6;
+sfr at 0xf2d TXB2D7;
+sfr at 0xf2e CANSTATRO3;
+sfr at 0xf30 TXB1CON;
+volatile __TXB1CONbits_t at 0xf30 TXB1CONbits;
+
+sfr at 0xf31 TXB1SIDH;
+sfr at 0xf32 TXB1SIDL;
+volatile __TXB1SIDLbits_t at 0xf32 TXB1SIDLbits;
+
+sfr at 0xf33 TXB1EIDH;
+sfr at 0xf34 TXB1EIDL;
+sfr at 0xf35 TXB1DLC;
+volatile __TXB1DLCbits_t at 0xf35 TXB1DLCbits;
+
+sfr at 0xf36 TXB1D0;
+sfr at 0xf37 TXB1D1;
+sfr at 0xf38 TXB1D2;
+sfr at 0xf39 TXB1D3;
+sfr at 0xf3a TXB1D4;
+sfr at 0xf3b TXB1D5;
+sfr at 0xf3c TXB1D6;
+sfr at 0xf3d TXB1D7;
+sfr at 0xf3e CANSTATRO2;
+sfr at 0xf40 TXB0CON;
+volatile __TXB0CONbits_t at 0xf40 TXB0CONbits;
+
+sfr at 0xf41 TXB0SIDH;
+sfr at 0xf42 TXB0SIDL;
+sfr at 0xf43 TXB0EIDH;
+sfr at 0xf44 TXB0EIDL;
+sfr at 0xf45 TXB0DLC;
+volatile __TXB0DLCbits_t at 0xf45 TXB0DLCbits;
+
+sfr at 0xf46 TXB0D0;
+sfr at 0xf47 TXB0D1;
+sfr at 0xf48 TXB0D2;
+sfr at 0xf49 TXB0D3;
+sfr at 0xf4a TXB0D4;
+sfr at 0xf4b TXB0D5;
+sfr at 0xf4c TXB0D6;
+sfr at 0xf4d TXB0D7;
+sfr at 0xf4e CANSTATRO1;
+sfr at 0xf50 RXB1CON;
+volatile __RXB1CONbits_t at 0xf50 RXB1CONbits;
+
+sfr at 0xf51 RXB1SIDH;
+sfr at 0xf52 RXB1SIDL;
+volatile __RXB1SIDLbits_t at 0xf52 RXB1SIDLbits;
+
+sfr at 0xf53 RXB1EIDH;
+sfr at 0xf54 RXB1EIDL;
+sfr at 0xf55 RXB1DLC;
+volatile __RXB1DLCbits_t at 0xf55 RXB1DLCbits;
+
+sfr at 0xf56 RXB1D0;
+sfr at 0xf57 RXB1D1;
+sfr at 0xf58 RXB1D2;
+sfr at 0xf59 RXB1D3;
+sfr at 0xf5a RXB1D4;
+sfr at 0xf5b RXB1D5;
+sfr at 0xf5c RXB1D6;
+sfr at 0xf5d RXB1D7;
+sfr at 0xf5e CANSTATRO0;
+sfr at 0xf60 RXB0CON;
+volatile __RXB0CONbits_t at 0xf60 RXB0CONbits;
+
+sfr at 0xf61 RXB0SIDH;
+sfr at 0xf62 RXB0SIDL;
+volatile __RXB0SIDLbits_t at 0xf62 RXB0SIDLbits;
+
+sfr at 0xf63 RXB0EIDH;
+sfr at 0xf64 RXB0EIDL;
+sfr at 0xf65 RXB0DLC;
+sfr at 0xf66 RXB0D0;
+sfr at 0xf67 RXB0D1;
+sfr at 0xf68 RXB0D2;
+sfr at 0xf69 RXB0D3;
+sfr at 0xf6a RXB0D4;
+sfr at 0xf6b RXB0D5;
+sfr at 0xf6c RXB0D6;
+sfr at 0xf6d RXB0D7;
+sfr at 0xf6e CANSTAT;
+volatile __CANSTATbits_t at 0xf6e CANSTATbits;
+
+sfr at 0xf6f CANCON;
+volatile __CANCONbits_t at 0xf6f CANCONbits;
+
+sfr at 0xf70 BRGCON1;
+volatile __BRGCON1bits_t at 0xf70 BRGCON1bits;
+
+sfr at 0xf71 BRGCON2;
+volatile __BRGCON2bits_t at 0xf71 BRGCON2bits;
+
+sfr at 0xf72 BRGCON3;
+volatile __BRGCON3bits_t at 0xf72 BRGCON3bits;
+
+sfr at 0xf73 CIOCON;
+volatile __CIOCONbits_t at 0xf73 CIOCONbits;
+
+sfr at 0xf74 COMSTAT;
+volatile __COMSTATbits_t at 0xf74 COMSTATbits;
+
+sfr at 0xf75 RXERRCNT;
+volatile __RXERRCNTbits_t at 0xf75 RXERRCNTbits;
+
+sfr at 0xf76 TXERRCNT;
+volatile __TXERRCNTbits_t at 0xf76 TXERRCNTbits;
+
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf83 PORTD;
+volatile __PORTDbits_t at 0xf83 PORTDbits;
+
+sfr at 0xf84 PORTE;
+volatile __PORTEbits_t at 0xf84 PORTEbits;
+
+sfr at 0xf85 PORTF;
+volatile __PORTFbits_t at 0xf85 PORTFbits;
+
+sfr at 0xf86 PORTG;
+volatile __PORTGbits_t at 0xf86 PORTGbits;
+
+sfr at 0xf87 PORTH;
+volatile __PORTHbits_t at 0xf87 PORTHbits;
+
+sfr at 0xf88 PORTJ;
+volatile __PORTJbits_t at 0xf88 PORTJbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf8c LATD;
+volatile __LATDbits_t at 0xf8c LATDbits;
+
+sfr at 0xf8d LATE;
+volatile __LATEbits_t at 0xf8d LATEbits;
+
+sfr at 0xf8e LATF;
+volatile __LATFbits_t at 0xf8e LATFbits;
+
+sfr at 0xf8f LATG;
+volatile __LATGbits_t at 0xf8f LATGbits;
+
+sfr at 0xf90 LATH;
+volatile __LATHbits_t at 0xf90 LATHbits;
+
+sfr at 0xf91 LATJ;
+volatile __LATJbits_t at 0xf91 LATJbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf95 TRISD;
+volatile __TRISDbits_t at 0xf95 TRISDbits;
+
+sfr at 0xf96 TRISE;
+volatile __TRISEbits_t at 0xf96 TRISEbits;
+
+sfr at 0xf97 TRISF;
+volatile __TRISFbits_t at 0xf97 TRISFbits;
+
+sfr at 0xf98 TRISG;
+volatile __TRISGbits_t at 0xf98 TRISGbits;
+
+sfr at 0xf99 TRISH;
+volatile __TRISHbits_t at 0xf99 TRISHbits;
+
+sfr at 0xf9a TRISJ;
+volatile __TRISJbits_t at 0xf9a TRISJbits;
+
+sfr at 0xf9c MEMCON;
+volatile __MEMCONbits_t at 0xf9c MEMCONbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa3 PIE3;
+volatile __PIE3bits_t at 0xfa3 PIE3bits;
+
+sfr at 0xfa4 PIR3;
+volatile __PIR3bits_t at 0xfa4 PIR3bits;
+
+sfr at 0xfa5 IPR3;
+volatile __IPR3bits_t at 0xfa5 IPR3bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfaa EEADRH;
+sfr at 0xfab RCSTA;
+volatile __RCSTAbits_t at 0xfab RCSTAbits;
+
+sfr at 0xfac TXSTA;
+volatile __TXSTAbits_t at 0xfac TXSTAbits;
+
+sfr at 0xfad TXREG;
+sfr at 0xfae RCREG;
+sfr at 0xfaf SPBRG;
+sfr at 0xfb0 PSPCON;
+volatile __PSPCONbits_t at 0xfb0 PSPCONbits;
+
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfb4 CMCON;
+volatile __CMCONbits_t at 0xfb4 CMCONbits;
+
+sfr at 0xfb5 CVRCON;
+volatile __CVRCONbits_t at 0xfb5 CVRCONbits;
+
+sfr at 0xfb6 ECCPAS;
+volatile __ECCPASbits_t at 0xfb6 ECCPASbits;
+
+sfr at 0xfb7 ECCP1DEL;
+volatile __ECCP1DELbits_t at 0xfb7 ECCP1DELbits;
+
+sfr at 0xfba ECCP1CON;
+volatile __ECCP1CONbits_t at 0xfba ECCP1CONbits;
+
+sfr at 0xfba CCP2CON;
+volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
+
+sfr at 0xfbb ECCPR1L;
+sfr at 0xfbb CCPR2L;
+sfr at 0xfbc ECCPR1H;
+sfr at 0xfbc CCPR2H;
+sfr at 0xfc0 ADCON2;
+volatile __ADCON2bits_t at 0xfc0 ADCON2bits;
+
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libdev/pic18f8720.c b/device/lib/pic16/libdev/pic18f8720.c
new file mode 100644 (file)
index 0000000..30b5e88
--- /dev/null
@@ -0,0 +1,295 @@
+
+/*
+ * pic18f8720.c - PIC18F8720 Device Library Source
+ *
+ * This file is part of the GNU PIC Library.
+ *
+ * January, 2004
+ * The GNU PIC Library is maintained by,
+ *     Vangelis Rokas <vrokas@otenet.gr>
+ *
+ * $Id$
+ *
+ */
+
+#include <pic18f8720.h>
+
+sfr at 0xf6b RCSTA2;
+volatile __RCSTA2bits_t at 0xf6b RCSTA2bits;
+
+sfr at 0xf6c TXSTA2;
+volatile __TXSTA2bits_t at 0xf6c TXSTA2bits;
+
+sfr at 0xf6d TXREG2;
+sfr at 0xf6e RCREG2;
+sfr at 0xf6f SPBRG2;
+sfr at 0xf70 CCP5CON;
+volatile __CCP5CONbits_t at 0xf70 CCP5CONbits;
+
+sfr at 0xf71 CCPR5L;
+sfr at 0xf72 CCPR5H;
+sfr at 0xf73 CCP4CON;
+volatile __CCP4CONbits_t at 0xf73 CCP4CONbits;
+
+sfr at 0xf74 CCPR4L;
+sfr at 0xf75 CCPR4H;
+sfr at 0xf76 T4CON;
+volatile __T4CONbits_t at 0xf76 T4CONbits;
+
+sfr at 0xf77 PR4;
+sfr at 0xf78 TMR4;
+sfr at 0xf80 PORTA;
+volatile __PORTAbits_t at 0xf80 PORTAbits;
+
+sfr at 0xf81 PORTB;
+volatile __PORTBbits_t at 0xf81 PORTBbits;
+
+sfr at 0xf82 PORTC;
+volatile __PORTCbits_t at 0xf82 PORTCbits;
+
+sfr at 0xf83 PORTD;
+volatile __PORTDbits_t at 0xf83 PORTDbits;
+
+sfr at 0xf84 PORTE;
+volatile __PORTEbits_t at 0xf84 PORTEbits;
+
+sfr at 0xf85 PORTF;
+volatile __PORTFbits_t at 0xf85 PORTFbits;
+
+sfr at 0xf86 PORTG;
+volatile __PORTGbits_t at 0xf86 PORTGbits;
+
+sfr at 0xf87 PORTH;
+volatile __PORTHbits_t at 0xf87 PORTHbits;
+
+sfr at 0xf88 PORTJ;
+volatile __PORTJbits_t at 0xf88 PORTJbits;
+
+sfr at 0xf89 LATA;
+volatile __LATAbits_t at 0xf89 LATAbits;
+
+sfr at 0xf8a LATB;
+volatile __LATBbits_t at 0xf8a LATBbits;
+
+sfr at 0xf8b LATC;
+volatile __LATCbits_t at 0xf8b LATCbits;
+
+sfr at 0xf8c LATD;
+volatile __LATDbits_t at 0xf8c LATDbits;
+
+sfr at 0xf8d LATE;
+volatile __LATEbits_t at 0xf8d LATEbits;
+
+sfr at 0xf8e LATF;
+volatile __LATFbits_t at 0xf8e LATFbits;
+
+sfr at 0xf8f LATG;
+volatile __LATGbits_t at 0xf8f LATGbits;
+
+sfr at 0xf90 LATH;
+volatile __LATHbits_t at 0xf90 LATHbits;
+
+sfr at 0xf91 LATJ;
+volatile __LATJbits_t at 0xf91 LATJbits;
+
+sfr at 0xf92 TRISA;
+volatile __TRISAbits_t at 0xf92 TRISAbits;
+
+sfr at 0xf93 TRISB;
+volatile __TRISBbits_t at 0xf93 TRISBbits;
+
+sfr at 0xf94 TRISC;
+volatile __TRISCbits_t at 0xf94 TRISCbits;
+
+sfr at 0xf95 TRISD;
+volatile __TRISDbits_t at 0xf95 TRISDbits;
+
+sfr at 0xf96 TRISE;
+volatile __TRISEbits_t at 0xf96 TRISEbits;
+
+sfr at 0xf97 TRISF;
+volatile __TRISFbits_t at 0xf97 TRISFbits;
+
+sfr at 0xf98 TRISG;
+volatile __TRISGbits_t at 0xf98 TRISGbits;
+
+sfr at 0xf99 TRISH;
+volatile __TRISHbits_t at 0xf99 TRISHbits;
+
+sfr at 0xf9a TRISJ;
+volatile __TRISJbits_t at 0xf9a TRISJbits;
+
+sfr at 0xf9c MEMCON;
+volatile __MEMCONbits_t at 0xf9c MEMCONbits;
+
+sfr at 0xf9d PIE1;
+volatile __PIE1bits_t at 0xf9d PIE1bits;
+
+sfr at 0xf9e PIR1;
+volatile __PIR1bits_t at 0xf9e PIR1bits;
+
+sfr at 0xf9f IPR1;
+volatile __IPR1bits_t at 0xf9f IPR1bits;
+
+sfr at 0xfa0 PIE2;
+volatile __PIE2bits_t at 0xfa0 PIE2bits;
+
+sfr at 0xfa1 PIR2;
+volatile __PIR2bits_t at 0xfa1 PIR2bits;
+
+sfr at 0xfa2 IPR2;
+volatile __IPR2bits_t at 0xfa2 IPR2bits;
+
+sfr at 0xfa3 PIE3;
+volatile __PIE3bits_t at 0xfa3 PIE3bits;
+
+sfr at 0xfa4 PIR3;
+volatile __PIR3bits_t at 0xfa4 PIR3bits;
+
+sfr at 0xfa5 IPR3;
+volatile __IPR3bits_t at 0xfa5 IPR3bits;
+
+sfr at 0xfa6 EECON1;
+volatile __EECON1bits_t at 0xfa6 EECON1bits;
+
+sfr at 0xfa7 EECON2;
+sfr at 0xfa8 EEDATA;
+sfr at 0xfa9 EEADR;
+sfr at 0xfaa EEADRH;
+sfr at 0xfab RCSTA1;
+volatile __RCSTA1bits_t at 0xfab RCSTA1bits;
+
+sfr at 0xfac TXSTA1;
+volatile __TXSTA1bits_t at 0xfac TXSTA1bits;
+
+sfr at 0xfad TXREG1;
+sfr at 0xfae RCREG1;
+sfr at 0xfaf SPBRG1;
+sfr at 0xfb0 PSPCON;
+volatile __PSPCONbits_t at 0xfb0 PSPCONbits;
+
+sfr at 0xfb1 T3CON;
+volatile __T3CONbits_t at 0xfb1 T3CONbits;
+
+sfr at 0xfb2 TMR3L;
+sfr at 0xfb3 TMR3H;
+sfr at 0xfb4 CMCON;
+volatile __CMCONbits_t at 0xfb4 CMCONbits;
+
+sfr at 0xfb5 CVRCON;
+volatile __CVRCONbits_t at 0xfb5 CVRCONbits;
+
+sfr at 0xfb7 CCP3CON;
+volatile __CCP3CONbits_t at 0xfb7 CCP3CONbits;
+
+sfr at 0xfb8 CCPR3L;
+sfr at 0xfb9 CCPR3H;
+sfr at 0xfba CCP2CON;
+volatile __CCP2CONbits_t at 0xfba CCP2CONbits;
+
+sfr at 0xfbb CCPR2L;
+sfr at 0xfbc CCPR2H;
+sfr at 0xfbd CCP1CON;
+volatile __CCP1CONbits_t at 0xfbd CCP1CONbits;
+
+sfr at 0xfbe CCPR1L;
+sfr at 0xfbf CCPR1H;
+sfr at 0xfc0 ADCON2;
+volatile __ADCON2bits_t at 0xfc0 ADCON2bits;
+
+sfr at 0xfc1 ADCON1;
+volatile __ADCON1bits_t at 0xfc1 ADCON1bits;
+
+sfr at 0xfc2 ADCON0;
+volatile __ADCON0bits_t at 0xfc2 ADCON0bits;
+
+sfr at 0xfc3 ADRESL;
+sfr at 0xfc4 ADRESH;
+sfr at 0xfc5 SSPCON2;
+volatile __SSPCON2bits_t at 0xfc5 SSPCON2bits;
+
+sfr at 0xfc6 SSPCON1;
+volatile __SSPCON1bits_t at 0xfc6 SSPCON1bits;
+
+sfr at 0xfc7 SSPSTAT;
+volatile __SSPSTATbits_t at 0xfc7 SSPSTATbits;
+
+sfr at 0xfc8 SSPADD;
+sfr at 0xfc9 SSPBUF;
+sfr at 0xfca T2CON;
+volatile __T2CONbits_t at 0xfca T2CONbits;
+
+sfr at 0xfcb PR2;
+sfr at 0xfcc TMR2;
+sfr at 0xfcd T1CON;
+volatile __T1CONbits_t at 0xfcd T1CONbits;
+
+sfr at 0xfce TMR1L;
+sfr at 0xfcf TMR1H;
+sfr at 0xfd0 RCON;
+volatile __RCONbits_t at 0xfd0 RCONbits;
+
+sfr at 0xfd1 WDTCON;
+volatile __WDTCONbits_t at 0xfd1 WDTCONbits;
+
+sfr at 0xfd2 LVDCON;
+volatile __LVDCONbits_t at 0xfd2 LVDCONbits;
+
+sfr at 0xfd3 OSCCON;
+volatile __OSCCONbits_t at 0xfd3 OSCCONbits;
+
+sfr at 0xfd5 T0CON;
+sfr at 0xfd6 TMR0L;
+sfr at 0xfd7 TMR0H;
+sfr at 0xfd8 STATUS;
+volatile __STATUSbits_t at 0xfd8 STATUSbits;
+
+sfr at 0xfd9 FSR2L;
+sfr at 0xfda FSR2H;
+sfr at 0xfdb PLUSW2;
+sfr at 0xfdc PREINC2;
+sfr at 0xfdd POSTDEC2;
+sfr at 0xfde POSTINC2;
+sfr at 0xfdf INDF2;
+sfr at 0xfe0 BSR;
+sfr at 0xfe1 FSR1L;
+sfr at 0xfe2 FSR1H;
+sfr at 0xfe3 PLUSW1;
+sfr at 0xfe4 PREINC1;
+sfr at 0xfe5 POSTDEC1;
+sfr at 0xfe6 POSTINC1;
+sfr at 0xfe7 INDF1;
+sfr at 0xfe8 WREG;
+sfr at 0xfe9 FSR0L;
+sfr at 0xfea FSR0H;
+sfr at 0xfeb PLUSW0;
+sfr at 0xfec PREINC0;
+sfr at 0xfed POSTDEC0;
+sfr at 0xfee POSTINC0;
+sfr at 0xfef INDF0;
+sfr at 0xff0 INTCON3;
+volatile __INTCON3bits_t at 0xff0 INTCON3bits;
+
+sfr at 0xff1 INTCON2;
+volatile __INTCON2bits_t at 0xff1 INTCON2bits;
+
+sfr at 0xff2 INTCON;
+volatile __INTCONbits_t at 0xff2 INTCONbits;
+
+sfr at 0xff3 PRODL;
+sfr at 0xff4 PRODH;
+sfr at 0xff5 TABLAT;
+sfr at 0xff6 TBLPTRL;
+sfr at 0xff7 TBLPTRH;
+sfr at 0xff8 TBLPTRU;
+sfr at 0xff9 PCL;
+sfr at 0xffa PCLATH;
+sfr at 0xffb PCLATU;
+sfr at 0xffc STKPTR;
+volatile __STKPTRbits_t at 0xffc STKPTRbits;
+
+sfr at 0xffd TOSL;
+sfr at 0xffe TOSH;
+sfr at 0xfff TOSU;
+
+
diff --git a/device/lib/pic16/libsdcc/Makefile b/device/lib/pic16/libsdcc/Makefile
new file mode 100644 (file)
index 0000000..8882141
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Makefile - Makefile to build pic16 support libraries
+#
+# This file is part of the GNU PIC Library.
+#
+# January, 2004
+# The GNU PIC Library is maintained by,
+#      Vangelis Rokas <vrokas@otenet.gr>
+#
+# $Id$
+#
+#
+
+
+DIRS   =       char \
+               int \
+               long \
+               float
+
+
+LIB    = libsdcc.lib
+
+all: build-libraries
+
+make-target: build-libraries
+
+build-libraries:
+       for dir in $(DIRS) ; do  \
+               $(MAKE) -C $$dir ; \
+       done;
+       gplib -c $(LIB) char/*.o int/*.o long/*.o float/*.o
+       mv -v $(LIB) ../bin
+       
+
+clean-intermediate:
+       @for dir in $(DIRS) ; do \
+               $(MAKE) -C $$dir clean-intermediate ; \
+       done ;
+       
+clean:
+       for dir in $(DIRS) ; do \
+               $(MAKE) -C $$dir clean; \
+       done ;
+       rm -fv $(LIB)
+
+
+real-clean: clean
+       find -name *.adb -print | xargs -- rm -fv ;
+       find -name *.p -print | xargs -- rm -fv ;
+       find -name *.d -print | xargs -- rm -fv ;
+       find -name *.dump* -print | xargs -- rm -fv ;
+       
+
+dep:
+       for dir in $(DIRS) ; do \
+               $(MAKE) -C $$dir dep; \
+       done
diff --git a/device/lib/pic16/libsdcc/Makefile.rules b/device/lib/pic16/libsdcc/Makefile.rules
new file mode 100644 (file)
index 0000000..abea515
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Makefile.rules - Common Makefile rules to build pic16
+#                  support libraries
+#
+# This file is part of the GNU PIC Library.
+#
+# January, 2004
+# The GNU PIC Library is maintained by,
+#      Vangelis Rokas <vrokas@otenet.gr>
+#
+# $Id$
+#
+#
+
+
+include ../../Makefile.common
+
+PRJDIR = ../../../../..
+
+LIBC_INC_DIR   = $(PRJDIR)/device/include/pic16
+
+COMPILE_FLAGS  += $(MODELFLAGS) --pomit-config-words --pomit-ivt --no-peep --i-code-in-asm
+
+CFILES = $(patsubst %,%.c,$(SRCS))
+OFILES = $(patsubst %.c,%.o,$(CFILES))
+
+%.o: %.c
+       $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
+
+
+all: build-library
+
+clean-intermediate:
+       $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
+
+
+clean: clean-intermediate
+       $(RM) -f $(LIB) *.o
+
+dep .depend:
+       rm -f .depend
+       for temp in $(CFILES); do \
+               $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
+               $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
+               $(RM) -f .tmpdepend; \
+       done;
+
+include .depend
diff --git a/device/lib/pic16/libsdcc/char/Makefile b/device/lib/pic16/libsdcc/char/Makefile
new file mode 100644 (file)
index 0000000..d00b3d7
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# Makefile - Makefile to build pic16 char support library
+#
+# This file is part of the GNU PIC Library.
+#
+# January, 2004
+# The GNU PIC Library is maintained by,
+#      Vangelis Rokas <vrokas@otenet.gr>
+#
+# $Id$
+#
+#
+
+
+LIB    = sdccchar.lib
+
+SRCS   =       divschar \
+               divuchar \
+               modschar \
+               moduchar
+
+include ../Makefile.rules
+
+
+all: build-library
+
+build-library: $(LIB)
+
+$(LIB): $(OFILES)
+       @echo Creating $(LIB) ...
+       @for object in $(OFILES) ; do \
+               if [ ! -e $(LIB) ]; then \
+                       $(AR) -c $(LIB) $$object ; \
+               else \
+                       $(AR) -r $(LIB) $$object ; \
+               fi; \
+               echo adding $$object ; \
+       done ;
diff --git a/device/lib/pic16/libsdcc/char/divschar.c b/device/lib/pic16/libsdcc/char/divschar.c
new file mode 100644 (file)
index 0000000..4fe34f7
--- /dev/null
@@ -0,0 +1,48 @@
+/*-------------------------------------------------------------------------
+  _divschar.c :- routine for signed char (8 bit) division. just calls
+                routine for unsigned division after sign adjustment
+
+             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+            Adopted for char (8-bit) and pic16 port by
+                       - Vangelis Rokas, vrokas@otenet.gr (2004)
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+
+unsigned char _divuchar (unsigned char a, unsigned char b);
+
+char _divschar (char a, char b)
+{
+  register char r;
+  char ta, tb;
+
+       if(a<0)ta = -a; else ta = a;
+       if(b<0)tb = -b; else tb = b;
+       
+       r = _divuchar(ta, tb);
+
+#if 1
+       if ( (a < 0) ^ (b < 0))
+               return -r;
+       else
+               return r;
+#endif
+}
+
diff --git a/device/lib/pic16/libsdcc/char/divuchar.c b/device/lib/pic16/libsdcc/char/divuchar.c
new file mode 100644 (file)
index 0000000..0b99c5d
--- /dev/null
@@ -0,0 +1,54 @@
+/*-------------------------------------------------------------------------
+  _divuchar.c :- routine for unsigned char (8 bit) division
+
+             Ecrit par -  Jean-Louis Vern . jlvern@writeme.com (1999)
+            Adopted for char (8-bit) and pic16 port by
+                       - Vangelis Rokas, vrokas@otenet.gr (2004)
+                                      
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+
+#define MSB_SET(x) ((x >> (8*sizeof(x)-1)) & 1)
+
+unsigned char _divuchar (unsigned char a, unsigned char b)
+{
+  unsigned char reste = 0;
+  unsigned char count = 8;
+    char c;
+
+  do
+  {
+    // reste: a <- 0;
+    c = MSB_SET(a);
+    a <<= 1;
+    reste <<= 1;
+    if (c)
+      reste |= 1;
+
+    if (reste >= b)
+    {
+      reste -= b;
+      // a <- (result = 1)
+      a |= 1;
+    }
+  }
+  while (--count);
+  return a;
+}
diff --git a/device/lib/pic16/libsdcc/char/modschar.c b/device/lib/pic16/libsdcc/char/modschar.c
new file mode 100644 (file)
index 0000000..a61c036
--- /dev/null
@@ -0,0 +1,46 @@
+/*-------------------------------------------------------------------------
+  _modschar.c :- routine for signed char (8 bit) modulus
+
+             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+            Adopted for char (8-bit) and pic16 port by
+                       - Vangelis Rokas, vrokas@otenet.gr (2004)
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+unsigned char _moduchar (unsigned char a, unsigned char b);
+
+char _modschar (char a, char b)
+{
+  register char r;
+  register char ta, tb;
+
+       if(a<0)ta = -a; else ta = a;
+       if(b<0)tb = -b; else tb = b;
+       
+//     r = _moduchar((a < 0 ? -a : a),
+//                 (b < 0 ? -b : b));
+       r = _moduchar(ta, tb);
+
+       if (a < 0)
+           return -r;
+       else
+           return r;
+}              
+
diff --git a/device/lib/pic16/libsdcc/char/moduchar.c b/device/lib/pic16/libsdcc/char/moduchar.c
new file mode 100644 (file)
index 0000000..70f162a
--- /dev/null
@@ -0,0 +1,54 @@
+/*-------------------------------------------------------------------------
+  _moduchar.c :- routine for unsigned char (8 bit) modulus
+
+             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+             Bug fixes by Martijn van Balen, aed@iae.nl
+             Adopted for char (8-bit) and pic16 port by
+                        - Vangelis Rokas, vrokas@otenet.gr (2004)
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+
+#define MSB_SET(x) ((x >> (8*sizeof(x)-1)) & 1) 
+
+unsigned char _moduchar (unsigned char a, unsigned char b)
+{
+  unsigned char count = 0;
+    
+    
+  while (!MSB_SET(b))
+  {
+    b <<= 1;
+    if (b > a)
+    {
+      b >>=1;
+      break;
+    }
+    count++;
+  }
+  do
+  {
+    if (a >= b)
+      a -= b;
+    b >>= 1;
+  }
+  while (count--);
+  return a;
+}
diff --git a/device/lib/pic16/libsdcc/float/Makefile b/device/lib/pic16/libsdcc/float/Makefile
new file mode 100644 (file)
index 0000000..cc1dd1f
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Makefile - Makefile to build pic16 float support library
+#
+# This file is part of the GNU PIC Library.
+#
+# January, 2004
+# The GNU PIC Library is maintained by,
+#      Vangelis Rokas <vrokas@otenet.gr>
+#
+# $Id$
+#
+#
+
+
+LIB    = sdccfloat.lib
+
+SRCS   =       fs2schar \
+               fs2sint \
+               fs2slong \
+               fs2uchar \
+               fs2uint \
+               fs2ulong \
+               fsadd \
+               fsdiv \
+               fseq \
+               fsgt \
+               fslt \
+               fsmul \
+               fsneq \
+               fssub \
+               schar2fs \
+               sint2fs \
+               slong2fs \
+               uchar2fs \
+               uint2fs \
+               ulong2fs
+
+
+include ../Makefile.rules
+
+CFLAGS += -I$(LIBC_INC_DIR)
+
+
+all: build-library
+
+build-library: $(LIB)
+
+$(LIB): $(OFILES)
+       @echo Creating $(LIB) ...
+       @for object in $(OFILES) ; do \
+               if [ ! -e $(LIB) ]; then \
+                       $(AR) -c $(LIB) $$object ; \
+               else \
+                       $(AR) -r $(LIB) $$object ; \
+               fi; \
+               echo adding $$object ; \
+       done ;
diff --git a/device/lib/pic16/libsdcc/float/fs2schar.c b/device/lib/pic16/libsdcc/float/fs2schar.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fs2sint.c b/device/lib/pic16/libsdcc/float/fs2sint.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fs2slong.c b/device/lib/pic16/libsdcc/float/fs2slong.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fs2uchar.c b/device/lib/pic16/libsdcc/float/fs2uchar.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fs2uint.c b/device/lib/pic16/libsdcc/float/fs2uint.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fs2ulong.c b/device/lib/pic16/libsdcc/float/fs2ulong.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fsadd.c b/device/lib/pic16/libsdcc/float/fsadd.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fsdiv.c b/device/lib/pic16/libsdcc/float/fsdiv.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fseq.c b/device/lib/pic16/libsdcc/float/fseq.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fsgt.c b/device/lib/pic16/libsdcc/float/fsgt.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fslt.c b/device/lib/pic16/libsdcc/float/fslt.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fsmul.c b/device/lib/pic16/libsdcc/float/fsmul.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fsneq.c b/device/lib/pic16/libsdcc/float/fsneq.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/fssub.c b/device/lib/pic16/libsdcc/float/fssub.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/schar2fs.c b/device/lib/pic16/libsdcc/float/schar2fs.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/sint2fs.c b/device/lib/pic16/libsdcc/float/sint2fs.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/slong2fs.c b/device/lib/pic16/libsdcc/float/slong2fs.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/uchar2fs.c b/device/lib/pic16/libsdcc/float/uchar2fs.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/uint2fs.c b/device/lib/pic16/libsdcc/float/uint2fs.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/float/ulong2fs.c b/device/lib/pic16/libsdcc/float/ulong2fs.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/device/lib/pic16/libsdcc/int/Makefile b/device/lib/pic16/libsdcc/int/Makefile
new file mode 100644 (file)
index 0000000..f2ae367
--- /dev/null
@@ -0,0 +1,39 @@
+#
+# Makefile - Makefile to build pic16 int upport library
+#
+# This file is part of the GNU PIC Library.
+#
+# January, 2004
+# The GNU PIC Library is maintained by,
+#      Vangelis Rokas <vrokas@otenet.gr>
+#
+# $Id$
+#
+#
+
+
+LIB    = sdccint.lib
+
+SRCS   =       divsint \
+               divuint \
+               modsint \
+               moduint \
+               mulint
+
+include ../Makefile.rules
+
+
+all: build-library
+
+build-library: $(LIB)
+
+$(LIB): $(OFILES)
+       @echo Creating $(LIB) ...
+       @for object in $(OFILES) ; do \
+               if [ ! -e $(LIB) ]; then \
+                       $(AR) -c $(LIB) $$object ; \
+               else \
+                       $(AR) -r $(LIB) $$object ; \
+               fi; \
+               echo adding $$object ; \
+       done ;
diff --git a/device/lib/pic16/libsdcc/int/divsint.c b/device/lib/pic16/libsdcc/int/divsint.c
new file mode 100644 (file)
index 0000000..2db46c1
--- /dev/null
@@ -0,0 +1,40 @@
+/*-------------------------------------------------------------------------
+  _divsint.c :- routine for signed int (16 bit) division. just calls
+                routine for unsigned division after sign adjustment
+
+             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+
+unsigned unsigned _divuint (unsigned a, unsigned b);
+
+int _divsint (int a, int b)
+{
+  register int r;
+
+  r = _divuint((a < 0 ? -a : a),
+               (b < 0 ? -b : b));
+  if ( (a < 0) ^ (b < 0))
+    return -r;
+  else
+    return r;
+}
+
diff --git a/device/lib/pic16/libsdcc/int/divuint.c b/device/lib/pic16/libsdcc/int/divuint.c
new file mode 100644 (file)
index 0000000..1c54fd4
--- /dev/null
@@ -0,0 +1,52 @@
+/*-------------------------------------------------------------------------
+  _divuint.c :- routine for unsigned int (16 bit) division
+
+             Ecrit par -  Jean-Louis Vern . jlvern@writeme.com (1999)
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+
+#define MSB_SET(x) ((x >> (8*sizeof(x)-1)) & 1)
+
+unsigned int _divuint (unsigned int a, unsigned int b)
+{
+  unsigned int reste = 0;
+  unsigned char count = 16;
+    char c;
+
+  do
+  {
+    // reste: a <- 0;
+    c = MSB_SET(a);
+    a <<= 1;
+    reste <<= 1;
+    if (c)
+      reste |= 1;
+
+    if (reste >= b)
+    {
+      reste -= b;
+      // a <- (result = 1)
+      a |= 1;
+    }
+  }
+  while (--count);
+  return a;
+}
diff --git a/device/lib/pic16/libsdcc/int/modsint.c b/device/lib/pic16/libsdcc/int/modsint.c
new file mode 100644 (file)
index 0000000..4ed9a78
--- /dev/null
@@ -0,0 +1,39 @@
+/*-------------------------------------------------------------------------
+  _modsint.c :- routine for signed int (16 bit) modulus
+
+             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+unsigned unsigned _moduint (unsigned a, unsigned b);
+
+int _modsint (int a, int b)
+{
+       register int r;
+       
+       r = _moduint((a < 0 ? -a : a),
+                   (b < 0 ? -b : b));
+
+       if (a < 0)
+           return -r;
+       else
+           return r;
+}              
+
diff --git a/device/lib/pic16/libsdcc/int/moduint.c b/device/lib/pic16/libsdcc/int/moduint.c
new file mode 100644 (file)
index 0000000..f0235be
--- /dev/null
@@ -0,0 +1,54 @@
+/*-------------------------------------------------------------------------
+  _moduint.c :- routine for unsigned int (16 bit) modulus
+
+             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+
+             Bug fixes by Martijn van Balen, aed@iae.nl
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+
+#define MSB_SET(x) ((x >> (8*sizeof(x)-1)) & 1) 
+
+unsigned int _moduint (unsigned int a, unsigned int b)
+{
+  unsigned char count = 0;
+    
+    
+  while (!MSB_SET(b))
+  {
+    b <<= 1;
+    if (b > a)
+    {
+      b >>=1;
+      break;
+    }
+    count++;
+  }
+  do
+  {
+    if (a >= b)
+      a -= b;
+    b >>= 1;
+  }
+  while (count--);
+  return a;
+}
+
diff --git a/device/lib/pic16/libsdcc/int/mulint.c b/device/lib/pic16/libsdcc/int/mulint.c
new file mode 100644 (file)
index 0000000..f024fe7
--- /dev/null
@@ -0,0 +1,61 @@
+/*-------------------------------------------------------------------------
+  _mulint.c :- routine for (unsigned) int (16 bit) multiplication
+
+             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+            Modified for pic16 port by - Vangelis Rokas, vrokas@otenet.gr (2004)
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+/* Signed and unsigned multiplication are the same - as long as the output
+   has the same precision as the input.
+*/
+
+union uu {
+       struct { unsigned char lo,hi ;} s;
+        unsigned int t;
+} ;
+
+int _mulint (int a, int b)
+{
+#if 0
+  register union uu *x;
+  register union uu *y;
+  union uu t;
+
+       x = (union uu *)&a;
+       y = (union uu *)&b;
+
+        t.t = x->s.lo * y->s.lo;
+        t.s.hi += (x->s.lo * y->s.hi) + (x->s.hi * y->s.lo);
+
+       return t.t;
+#else
+  union uu x;
+  union uu y;
+  union uu t;
+
+        x.t = a;
+        y.t = b;
+        t.t = x.s.lo * y.s.lo;
+        t.s.hi += (x.s.lo * y.s.hi) + (x.s.hi * y.s.lo);
+
+  return t.t;
+#endif
+}
diff --git a/device/lib/pic16/libsdcc/long/Makefile b/device/lib/pic16/libsdcc/long/Makefile
new file mode 100644 (file)
index 0000000..57c4b7e
--- /dev/null
@@ -0,0 +1,39 @@
+#
+# Makefile - Makefile to build pic16 long support library
+#
+# This file is part of the GNU PIC Library.
+#
+# January, 2004
+# The GNU PIC Library is maintained by,
+#      Vangelis Rokas <vrokas@otenet.gr>
+#
+# $Id$
+#
+#
+
+
+LIB    = sdcclong.lib
+
+SRCS   =       divslong \
+               divulong \
+               modslong \
+               modulong \
+               mullong
+
+include ../Makefile.rules
+
+
+all: build-library
+
+build-library: $(LIB)
+
+$(LIB): $(OFILES)
+       @echo Creating $(LIB) ...
+       @for object in $(OFILES) ; do \
+               if [ ! -e $(LIB) ]; then \
+                       $(AR) -c $(LIB) $$object ; \
+               else \
+                       $(AR) -r $(LIB) $$object ; \
+               fi; \
+               echo adding $$object ; \
+       done ;
diff --git a/device/lib/pic16/libsdcc/long/divslong.c b/device/lib/pic16/libsdcc/long/divslong.c
new file mode 100644 (file)
index 0000000..12cc543
--- /dev/null
@@ -0,0 +1,37 @@
+/*-------------------------------------------------------------------------
+   _divslong.c - routine for division of 32 bit long
+
+             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+unsigned long _divulong(unsigned long a, unsigned long b);
+
+long _divslong (long a, long b)
+{
+  long r;
+
+  r = _divulong((a < 0 ? -a : a),
+                (b < 0 ? -b : b));
+  if ( (a < 0) ^ (b < 0))
+    return -r;
+  else
+    return r;
+}
diff --git a/device/lib/pic16/libsdcc/long/divulong.c b/device/lib/pic16/libsdcc/long/divulong.c
new file mode 100644 (file)
index 0000000..8679641
--- /dev/null
@@ -0,0 +1,52 @@
+/*-------------------------------------------------------------------------
+   _divulong.c - routine for division of 32 bit unsigned long
+
+             Ecrit par -  Jean-Louis Vern . jlvern@writeme.com (1999)
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+#define MSB_SET(x) ((x >> (8*sizeof(x)-1)) & 1)
+
+unsigned long _divulong (unsigned long a, unsigned long b)
+{
+  unsigned long reste = 0L;
+  unsigned char count = 32;
+  char c;
+
+  do
+  {
+    // reste: a <- 0;
+    c = MSB_SET(a);
+    a <<= 1;
+    reste <<= 1;
+    if (c)
+      reste |= 1L;
+
+    if (reste >= b)
+    {
+      reste -= b;
+      // a <- (result = 1)
+      a |= 1L;
+    }
+  }
+  while (--count);
+  return a;
+}
+
diff --git a/device/lib/pic16/libsdcc/long/modslong.c b/device/lib/pic16/libsdcc/long/modslong.c
new file mode 100644 (file)
index 0000000..ee875f9
--- /dev/null
@@ -0,0 +1,37 @@
+/*-------------------------------------------------------------------------
+   _modslong.c - routine for modulus of 32 bit signed long
+
+             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+unsigned long _modulong (unsigned long a, unsigned long b);
+
+long _modslong (long a, long b)
+{
+  long r;
+
+  r = _modulong((a < 0 ? -a : a),
+                (b < 0 ? -b : b));
+  if (a < 0)
+    return -r;
+  else
+    return r;
+}
diff --git a/device/lib/pic16/libsdcc/long/modulong.c b/device/lib/pic16/libsdcc/long/modulong.c
new file mode 100644 (file)
index 0000000..628c980
--- /dev/null
@@ -0,0 +1,52 @@
+/*-------------------------------------------------------------------------
+   _modulong.c - routine for modulus of 32 bit unsigned long
+
+             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+
+             Bug fixes by Martijn van Balen, aed@iae.nl
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+#define MSB_SET(x) ((x >> (8*sizeof(x)-1)) & 1)
+
+unsigned long _modulong (unsigned long a, unsigned long b)
+{
+  unsigned char count = 0;
+
+  while (!MSB_SET(b))
+  {
+     b <<= 1;
+     if (b > a)
+     {
+        b >>=1;
+        break;
+     }
+     count++;
+  }
+  do
+  {
+    if (a >= b)
+      a -= b;
+    b >>= 1;
+  }
+  while (count--);
+
+  return a;
+}
diff --git a/device/lib/pic16/libsdcc/long/mullong.c b/device/lib/pic16/libsdcc/long/mullong.c
new file mode 100644 (file)
index 0000000..ae9764c
--- /dev/null
@@ -0,0 +1,116 @@
+/*-------------------------------------------------------------------------
+   _mullong.c - routine for multiplication of 32 bit (unsigned) long
+
+             Written By -  Jean Louis VERN jlvern@writeme.com (1999)
+             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+            Modified for pic16 port by - Vangelis Rokas, vrokas@otenet.gr (2004)
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+   In other words, you are welcome to use, share and improve this program.
+   You are forbidden to forbid anyone else to use, share and improve
+   what you give them.   Help stamp out software-hoarding!
+-------------------------------------------------------------------------*/
+
+union bil {
+        struct {unsigned char b0,b1,b2,b3 ;} b;
+        struct {unsigned short lo,hi ;} i;
+        unsigned long l;
+        struct { unsigned char b0; unsigned short i12; unsigned char b3;} bi;
+};
+
+#define bcast(x) ((union bil near  *)&(x))
+
+/*
+                     3   2   1   0
+       X             3   2   1   0
+       ----------------------------
+                   0.3 0.2 0.1 0.0
+               1.3 1.2 1.1 1.0
+           2.3 2.2 2.1 2.0
+       3.3 3.2 3.1 3.0
+       ----------------------------
+                  |3.3|1.3|0.2|0.0|   A
+                    |2.3|0.3|0.1|     B
+                    |3.2|1.2|1.0|     C
+                      |2.2|1.1|       D
+                      |3.1|2.0|       E
+                        |2.1|         F
+                        |3.0|         G
+                          |-------> only this side 32 x 32 -> 32
+*/
+
+long _mullong (long a, long b)
+{
+#if 0
+        union bil t;
+
+        t.i.hi = bcast(a)->b.b0 * bcast(b)->b.b2;       // A
+        t.i.lo = bcast(a)->b.b0 * bcast(b)->b.b0;       // A
+        t.b.b3 += bcast(a)->b.b3 *
+                                  bcast(b)->b.b0;       // G
+        t.b.b3 += bcast(a)->b.b2 *
+                                  bcast(b)->b.b1;       // F
+        t.i.hi += bcast(a)->b.b2 * bcast(b)->b.b0;      // E <- b lost in .lst
+        // bcast(a)->i.hi is free !
+        t.i.hi += bcast(a)->b.b1 * bcast(b)->b.b1;      // D <- b lost in .lst
+
+        bcast(a)->bi.b3 = bcast(a)->b.b1 *
+                                          bcast(b)->b.b2;
+        bcast(a)->bi.i12 = bcast(a)->b.b1 *
+                           bcast(b)->b.b0;              // C
+
+        bcast(b)->bi.b3 = bcast(a)->b.b0 *
+                                          bcast(b)->b.b3;
+        bcast(b)->bi.i12 = bcast(a)->b.b0 *
+                           bcast(b)->b.b1;              // B
+        bcast(b)->bi.b0 = 0;                            // B
+        bcast(a)->bi.b0 = 0;                            // C
+        t.l += a;
+
+        return t.l + b;
+#else
+
+  union bil x;
+  union bil y;
+  union bil t;
+  union bil t1, t2;
+  
+       x.l = a;
+       y.l = b;
+       
+       t.i.hi = x.b.b0 * y.b.b2;
+       t.i.lo = x.b.b0 * y.b.b0;
+       
+       t.b.b3 += x.b.b3 * y.b.b0;
+       t.b.b3 += x.b.b2 * y.b.b1;
+       
+       t.i.hi += x.b.b2 * y.b.b0;
+       t.i.hi += x.b.b1 * y.b.b1;
+       
+       t1.bi.b3 = x.b.b1 * y.b.b2;
+       t1.bi.i12 = x.b.b1 * y.b.b0;
+       
+       t2.bi.b3 = x.b.b0 * y.b.b3;
+       t2.bi.i12 = x.b.b0 * y.b.b1;
+       
+       t1.bi.b0 = 0;
+       t2.bi.b0 = 0;
+       t.l += t1.l;
+
+  return (t.l + t2.l);
+
+#endif
+}
diff --git a/device/lib/pic16/startup/Makefile b/device/lib/pic16/startup/Makefile
new file mode 100644 (file)
index 0000000..0e1f4c9
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Makefile - Makefile to build startup files
+#
+# This file is part of the GNU PIC Library.
+#
+# January, 2004
+# The GNU PIC Library is maintained by,
+#      Vangelis Rokas <vrokas@otenet.gr>
+#
+# $Id$
+#
+#
+
+
+PRJDIR = ../../../..
+include ../Makefile.common
+
+
+SRCS   =       crt0    \
+               crt0i   \
+               crt0iz
+
+
+# add nostdinc and nostdlib for this device libraries
+COMPILE_FLAGS  += --nostdinc --nostdlib
+
+CFILES = $(patsubst %,%.c,$(SRCS))
+OFILES = $(patsubst %.c,%.o,$(CFILES))
+
+
+%.o: %.c
+       $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
+
+
+all: build-library
+       @$(CP) -v $(OFILES) ../bin
+
+build-library: compile-sources
+
+compile-sources: $(OFILES)
+
+
+clean:
+       rm -f *.o *.lst *.asm
+
+
+clean-intermediate:
+       $(RM) -f *.lst *.asm *.dump*
diff --git a/device/lib/pic16/startup/README b/device/lib/pic16/startup/README
new file mode 100644 (file)
index 0000000..95b6158
--- /dev/null
@@ -0,0 +1,5 @@
+This directory contains the startup files for the SDCC pic16 port.
+There are 3 startup files,
+crt0.o         minimal initialisation routine
+crt0i.o                initialisation of variables
+crt0iz.o       RAM cleanup and initialisation of variables
diff --git a/device/lib/pic16/startup/crt0.c b/device/lib/pic16/startup/crt0.c
new file mode 100644 (file)
index 0000000..a6d134d
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * crt0.c - SDCC pic16 port runtime start code
+ *
+ * Converted for SDCC and pic16 port
+ * by Vangelis Rokas (vrokas@otenet.gr)
+ *
+ * based on Microchip MPLAB-C18 startup files
+ *
+ * $Id$
+ */
+
+extern stack;
+
+extern TBLPTRU;
+
+/* external reference to the user's main routine */
+extern void main (void);
+
+/* prototype for the startup function */
+void _entry (void) _naked interrupt 0;
+void _startup (void);
+
+
+/*
+ * entry function, placed at interrupt vector 0 (RESET)
+ */
+
+void _entry (void) _naked interrupt 0
+{
+  _asm goto __startup _endasm;
+}
+
+
+void _startup (void)
+{
+       _asm
+               // Initialize the stack pointer
+               lfsr 1, _stack
+               lfsr 2, _stack
+               clrf _TBLPTRU, 0        // 1st silicon doesn't do this on POR
+    
+               // initialize the flash memory access configuration. this is harmless
+               // for non-flash devices, so we do it on all parts.
+               bsf 0xa6, 7, 0
+               bcf 0xa6, 6, 0
+
+       _endasm ;
+    
+       /* Call the user's main routine */
+       main ();
+
+loop:
+       /* return from main will lock up */
+       goto loop;
+}
+
diff --git a/device/lib/pic16/startup/crt0i.c b/device/lib/pic16/startup/crt0i.c
new file mode 100644 (file)
index 0000000..487403f
--- /dev/null
@@ -0,0 +1,256 @@
+/*
+ * crt0i.c - SDCC pic16 port runtime start code with
+ *           initialisation
+ *
+ * Converted for SDCC and pic16 port
+ * by Vangelis Rokas (vrokas@otenet.gr)
+ *
+ * based on Microchip MPLAB-C18 startup files
+ *
+ * $Id$
+ */
+
+extern stack;
+
+extern TBLPTRU;
+extern TBLPTRH;
+extern TBLPTRL;
+extern FSR0L;
+extern FSR0H;
+extern TABLAT;
+extern POSTINC0;
+
+/* external reference to the user's main routine */
+extern void main (void);
+
+/* prototype for the startup function */
+void _entry (void) _naked interrupt 0;
+void _startup (void);
+
+/* prototype for the initialized data setup */
+void _do_cinit (void);
+
+
+/*
+ * entry function, placed at interrupt vector 0 (RESET)
+ */
+
+void _entry (void) _naked interrupt 0
+{
+  _asm goto __startup _endasm;
+}
+
+
+void _startup (void)
+{
+       _asm
+               // Initialize the stack pointer
+               lfsr 1, _stack
+               lfsr 2, _stack
+               clrf _TBLPTRU, 0        // 1st silicon doesn't do this on POR
+    
+               // initialize the flash memory access configuration. this is harmless
+               // for non-flash devices, so we do it on all parts.
+               bsf 0xa6, 7, 0
+               bcf 0xa6, 6, 0
+
+       _endasm ;
+    
+       _do_cinit();
+
+       /* Call the user's main routine */
+       main ();
+
+loop:
+       /* return from main will lock up */
+       goto loop;
+}
+
+
+/* the cinit table will be filled by the linker */
+extern code struct
+{
+  unsigned short num_init;
+  struct _init_entry {
+    unsigned long from;
+    unsigned long to;
+    unsigned long size;
+  } entries[];
+} cinit;
+
+
+#define tblrdpostinc   tblrd*+
+
+/* the variable initialisation routine */
+void _do_cinit (void)
+{
+  /*
+   * we'll make the assumption in the following code that these statics
+   * will be allocated into the same bank.
+   */
+  static short long prom;
+  static unsigned short curr_byte;
+  static unsigned short curr_entry;
+  static short long data_ptr;
+
+
+       /* TBLPTR = &cinit */
+       _asm
+               movlw low(_cinit)
+               movwf _TBLPTRL, 0
+               movlw high(_cinit)
+               movwf _TBLPTRH, 0
+               movlw upper(_cinit)
+               movwf _TBLPTRU, 0
+       _endasm;
+
+       
+       /* curr_entry = cinit.num_init */
+       _asm
+               movlb __do_cinit_data_ptr_1_1
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_curr_entry_1_1, 1
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_curr_entry_1_1+1, 1
+       _endasm;
+
+
+       //while (curr_entry) {
+       _asm
+test:
+       bnz done1
+       tstfsz __do_cinit_curr_entry_1_1, 1
+       bra cont1
+
+done1:
+       goto done
+
+cont1:
+       _endasm;
+
+
+      /* Count down so we only have to look up the data in _cinit
+       * once.
+       *
+       * At this point we know that TBLPTR points to the top of the current
+       * entry in _cinit, so we can just start reading the from, to, and
+       * size values.
+       */
+       _asm
+               
+               /* read the source address low */
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_prom_1_1, 1
+               
+               /* source address high */
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_prom_1_1 + 1, 1
+
+               /* source address upper */
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_prom_1_1 + 2, 1
+
+               /* skip a byte since it's stored as a 32bit int */
+               tblrdpostinc
+
+               /* read the destination address directly into FSR0 */
+               /* destination address low */
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf _FSR0L, 0
+
+               /* destination address high */
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf _FSR0H, 0
+
+               /* skip two bytes since it's stored as a 32bit int */
+               tblrdpostinc
+               tblrdpostinc
+
+               /* read the destination address directly into FSR0 */
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_curr_byte_1_1, 1
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_curr_byte_1_1+1, 1
+
+               /* skip two bytes since it's stored as a 32bit int */
+               tblrdpostinc
+               tblrdpostinc
+       _endasm;
+
+       //prom = data_ptr->from;
+       //FSR0 = data_ptr->to;
+       //curr_byte = (unsigned short) data_ptr->size;
+       /* the table pointer now points to the next entry. Save it
+        * off since we'll be using the table pointer to do the copying
+        * for the entry */
+  
+       /*  data_ptr = TBLPTR */
+       _asm
+               movff _TBLPTRL, __do_cinit_data_ptr_1_1
+               movff _TBLPTRH, __do_cinit_data_ptr_1_1 + 1
+               movff _TBLPTRU, __do_cinit_data_ptr_1_1 + 2
+       _endasm;
+  
+      
+       /* now assign the source address to the table pointer */
+       /*  TBLPTR = prom */
+       _asm
+               movff __do_cinit_prom_1_1, _TBLPTRL
+               movff __do_cinit_prom_1_1 + 1, _TBLPTRH
+               movff __do_cinit_prom_1_1 + 2, _TBLPTRU
+       _endasm;
+
+       /* do the copy loop */
+       _asm
+
+               /* determine if we have any more bytes to copy */
+               movlb __do_cinit_curr_byte_1_1
+               movf __do_cinit_curr_byte_1_1, 1, 1
+copy_loop:
+               bnz copy_one_byte // copy_one_byte
+               movf __do_cinit_curr_byte_1_1 + 1, 1, 1
+               bz done_copying
+
+copy_one_byte:
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf _POSTINC0, 0
+
+               /* decrement byte counter */
+               decf __do_cinit_curr_byte_1_1, 1, 1
+               bnc copy_loop // copy_loop
+               decf __do_cinit_curr_byte_1_1 + 1, 1, 1
+
+               bra copy_loop
+done_copying:
+       _endasm;
+  
+       /* restore the table pointer for the next entry */
+       /*  TBLPTR = data_ptr */
+       _asm
+               movff __do_cinit_data_ptr_1_1, _TBLPTRL
+               movff __do_cinit_data_ptr_1_1 + 1, _TBLPTRH
+               movff __do_cinit_data_ptr_1_1 + 2, _TBLPTRU
+       _endasm;
+
+  
+       /* next entry... */
+       curr_entry--;
+
+       _asm
+               goto test;
+
+       /* emit done label */
+done:
+       _endasm;
+}
+
diff --git a/device/lib/pic16/startup/crt0iz.c b/device/lib/pic16/startup/crt0iz.c
new file mode 100644 (file)
index 0000000..a557301
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ * crt0iz.c - SDCC pic16 port runtime start code with
+ *            initialisation and RAM memory zero
+ *
+ * Converted for SDCC and pic16 port
+ * by Vangelis Rokas (vrokas@otenet.gr)
+ *
+ * based on Microchip MPLAB-C18 startup files
+ *
+ * $Id$
+ */
+
+extern stack;
+
+extern TBLPTRU;
+extern TBLPTRH;
+extern TBLPTRL;
+extern FSR0L;
+extern FSR0H;
+extern TABLAT;
+extern POSTINC0;
+extern POSTDEC0;
+
+/* external reference to the user's main routine */
+extern void main (void);
+
+/* prototype for the startup function */
+void _entry (void) _naked interrupt 0;
+void _startup (void);
+
+/* prototype for the initialized data setup */
+void _do_cinit (void);
+
+
+/*
+ * entry function, placed at interrupt vector 0 (RESET)
+ */
+
+void _entry (void) _naked interrupt 0
+{
+  _asm goto __startup _endasm;
+}
+
+
+void _startup (void)
+{
+       _asm
+               // Initialize the stack pointer
+               lfsr 1, _stack
+               lfsr 2, _stack
+               clrf _TBLPTRU, 0        // 1st silicon doesn't do this on POR
+    
+               // initialize the flash memory access configuration. this is harmless
+               // for non-flash devices, so we do it on all parts.
+               bsf 0xa6, 7, 0
+               bcf 0xa6, 6, 0
+
+       _endasm ;
+    
+       /* cleanup the RAM */
+       _asm
+               /* load FSR0 with top of RAM memory */
+               movlw 0xff
+               movwf _FSR0L, 0
+               movlw 0x0e
+               movwf _FSR0H, 0
+               
+               /* place a 1 at address 0x00, as a marker 
+                * we haven't reached yet to it */
+               movlw 1
+               movwf 0x00, 0
+               
+               /* load WREG with zero */
+               movlw 0x00
+               
+clear_loop:
+               movwf _POSTDEC0, 0
+               movf 0x00, 1, 0
+               bnz clear_loop
+       _endasm ;
+
+
+       _do_cinit();
+
+       /* Call the user's main routine */
+       main ();
+
+loop:
+       /* return from main will lock up */
+       goto loop;
+}
+
+
+/* the cinit table will be filled by the linker */
+extern code struct
+{
+  unsigned short num_init;
+  struct _init_entry {
+    unsigned long from;
+    unsigned long to;
+    unsigned long size;
+  } entries[];
+} cinit;
+
+
+#define tblrdpostinc   tblrd*+
+
+/* the variable initialisation routine */
+void _do_cinit (void)
+{
+  /*
+   * we'll make the assumption in the following code that these statics
+   * will be allocated into the same bank.
+   */
+  static short long prom;
+  static unsigned short curr_byte;
+  static unsigned short curr_entry;
+  static short long data_ptr;
+
+
+       /* TBLPTR = &cinit */
+       _asm
+               movlw low(_cinit)
+               movwf _TBLPTRL, 0
+               movlw high(_cinit)
+               movwf _TBLPTRH, 0
+               movlw upper(_cinit)
+               movwf _TBLPTRU, 0
+       _endasm;
+
+       
+       /* curr_entry = cinit.num_init */
+       _asm
+               movlb __do_cinit_data_ptr_1_1
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_curr_entry_1_1, 1
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_curr_entry_1_1+1, 1
+       _endasm;
+
+
+       //while (curr_entry) {
+       _asm
+test:
+       bnz done1
+       tstfsz __do_cinit_curr_entry_1_1, 1
+       bra cont1
+
+done1:
+       goto done
+
+cont1:
+       _endasm;
+
+
+      /* Count down so we only have to look up the data in _cinit
+       * once.
+       *
+       * At this point we know that TBLPTR points to the top of the current
+       * entry in _cinit, so we can just start reading the from, to, and
+       * size values.
+       */
+       _asm
+               
+               /* read the source address low */
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_prom_1_1, 1
+               
+               /* source address high */
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_prom_1_1 + 1, 1
+
+               /* source address upper */
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_prom_1_1 + 2, 1
+
+               /* skip a byte since it's stored as a 32bit int */
+               tblrdpostinc
+
+               /* read the destination address directly into FSR0 */
+               /* destination address low */
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf _FSR0L, 0
+
+               /* destination address high */
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf _FSR0H, 0
+
+               /* skip two bytes since it's stored as a 32bit int */
+               tblrdpostinc
+               tblrdpostinc
+
+               /* read the destination address directly into FSR0 */
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_curr_byte_1_1, 1
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf __do_cinit_curr_byte_1_1+1, 1
+
+               /* skip two bytes since it's stored as a 32bit int */
+               tblrdpostinc
+               tblrdpostinc
+       _endasm;
+
+       //prom = data_ptr->from;
+       //FSR0 = data_ptr->to;
+       //curr_byte = (unsigned short) data_ptr->size;
+       /* the table pointer now points to the next entry. Save it
+        * off since we'll be using the table pointer to do the copying
+        * for the entry */
+  
+       /*  data_ptr = TBLPTR */
+       _asm
+               movff _TBLPTRL, __do_cinit_data_ptr_1_1
+               movff _TBLPTRH, __do_cinit_data_ptr_1_1 + 1
+               movff _TBLPTRU, __do_cinit_data_ptr_1_1 + 2
+       _endasm;
+  
+      
+       /* now assign the source address to the table pointer */
+       /*  TBLPTR = prom */
+       _asm
+               movff __do_cinit_prom_1_1, _TBLPTRL
+               movff __do_cinit_prom_1_1 + 1, _TBLPTRH
+               movff __do_cinit_prom_1_1 + 2, _TBLPTRU
+       _endasm;
+
+       /* do the copy loop */
+       _asm
+
+               /* determine if we have any more bytes to copy */
+               movlb __do_cinit_curr_byte_1_1
+               movf __do_cinit_curr_byte_1_1, 1, 1
+copy_loop:
+               bnz copy_one_byte // copy_one_byte
+               movf __do_cinit_curr_byte_1_1 + 1, 1, 1
+               bz done_copying
+
+copy_one_byte:
+               tblrdpostinc
+               movf _TABLAT, 0, 0
+               movwf _POSTINC0, 0
+
+               /* decrement byte counter */
+               decf __do_cinit_curr_byte_1_1, 1, 1
+               bnc copy_loop // copy_loop
+               decf __do_cinit_curr_byte_1_1 + 1, 1, 1
+
+               bra copy_loop
+done_copying:
+       _endasm;
+  
+       /* restore the table pointer for the next entry */
+       /*  TBLPTR = data_ptr */
+       _asm
+               movff __do_cinit_data_ptr_1_1, _TBLPTRL
+               movff __do_cinit_data_ptr_1_1 + 1, _TBLPTRH
+               movff __do_cinit_data_ptr_1_1 + 2, _TBLPTRU
+       _endasm;
+
+  
+       /* next entry... */
+       curr_entry--;
+
+       _asm
+               goto test;
+
+       /* emit done label */
+done:
+       _endasm;
+}
+
index 1dbcac769f26eb31675517d519fe634478e3ef36..096af7444383c14df5f8ec8fbf188a48a125a128 100644 (file)
@@ -46,39 +46,53 @@ static PIC16_device Pics16[] = {
     0,
     0x300,                                             // bank mask
     0x300,                                             // RAMsize
-    0
-  },
-
-  {
-    {"p18f252", "18f252", "pic18f252", "f252"},                // aliases
     0,
-    0x600,                                             // bank mask
-    0x600,                                             // RAMsize
-    0
+       {
+               /* PIC18F242 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x03, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x03, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x03, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
   },
 
   {
-    {"p18f442", "18f442", "pic18f442", "f442"},                // aliases
+    {"p18f248", "18f248", "pic18f248", "f248"},                // aliases
     0,
     0x300,                                             // bank mask
     0x300,                                             // RAMsize
-    0
+    0,
+       {
+               /* PIC18F248 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { -1, 0, 0xff } /* 4 */  , { -1, 0, 0xff } /* 5 */  , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x03, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x03, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x03, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
   },
 
   {
-    {"p18f452", "18f452", "pic18f452", "f452"},                // aliases
+    {"p18f252", "18f252", "pic18f252", "f252"},                // aliases
     0,
     0x600,                                             // bank mask
     0x600,                                             // RAMsize
-    0
-  },
-
-  {
-    {"p18f248", "18f248", "pic18f248", "f248"},                // aliases
     0,
-    0x300,                                             // bank mask
-    0x300,                                             // RAMsize
-    0
+       {
+               /* PIC18F252 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
   },
 
   {
@@ -86,7 +100,35 @@ static PIC16_device Pics16[] = {
     0,
     0x600,                                             // bank mask
     0x600,                                             // RAMsize
-    0
+    0,
+       {
+               /* PIC18F258 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { -1, 0, 0xff } /* 4 */  , { -1, 0, 0xff } /* 5 */  , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
+  },
+
+  {
+    {"p18f442", "18f442", "pic18f442", "f442"},                // aliases
+    0,
+    0x300,                                             // bank mask
+    0x300,                                             // RAMsize
+    0,
+       {
+               /* PIC18F442 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x03, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x03, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x03, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
   },
 
   {
@@ -94,7 +136,35 @@ static PIC16_device Pics16[] = {
     0,
     0x300,                                             // bank mask
     0x300,                                             // RAMsize
-    0
+    0,
+       {
+               /* PIC18F448 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { -1, 0, 0xff } /* 4 */  , { -1, 0, 0xff } /* 5 */  , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x03, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x03, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x03, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
+  },
+  
+  {
+    {"p18f452", "18f452", "pic18f452", "f452"},                // aliases
+    0,
+    0x600,                                             // bank mask
+    0x600,                                             // RAMsize
+    0,
+       {
+               /* PIC18F452 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
   },
 
   {
@@ -102,15 +172,54 @@ static PIC16_device Pics16[] = {
     0,
     0x600,                                             // bank mask
     0x600,                                             // RAMsize
-    0
+    0,
+       {
+               /* PIC18F458 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { -1, 0, 0xff } /* 4 */  , { -1, 0, 0xff } /* 5 */  , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
+  },
+
+  {
+    {"p18f1220", "18f1220", "pic18f1220", "f1220"},    // aliases
+    0,
+    0x200,
+    0x200,
+    0,
+       {
+               /* PIC18F1220 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0xcf, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
+               { -1, 0, 0xff } /* 4 */  , { 0x80, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x03, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x03, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x03, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
   },
 
+
   {
     {"p18f6520", "18f6520", "pic18f6520", "f6520"},    // aliases
     0,
     0x800,                                             // bank mask
     0x800,                                             // RAMsize
-    1
+    1,
+       {
+               /* PIC18F6520 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { 0x80, 0, 0xff } /* 4 */ , { 0x88, 0, 0xff } /* 5 */ , { -1, 0, 0xff } /* 6 */  , 
+               { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
   },
 
   {
@@ -118,50 +227,125 @@ static PIC16_device Pics16[] = {
     0,
     0xf00,                                             // bank mask
     0xf00,                                             // RAMsize
-    1
+    1,
+       {
+               /* PIC18F6620 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
   },
+
   {
     {"p18f6680", "18f6680", "pic18f6680", "f6680"},    // aliases
     0,
     0xc00,                                             // bank mask
     0xc00,                                             // RAMsize
-    1
+    1,
+       {
+               /* PIC18F6680 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x2f, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
+               { -1, 0, 0xff } /* 4 */  , { 0x83, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
   },
+
   {
     {"p18f6720", "18f6720", "pic18f6720", "f6720"},    // aliases
     0,
     0xf00,                                             // bank mask
     0xf00,                                             // RAMsize
-    1
+    1,
+       {
+               /* PIC18F6720 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0xff, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0xff, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0xff, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
   },
+
   {
     {"p18f8520", "18f8520", "pic18f8520", "f8520"},    // aliases
     0,
     0x800,                                             // bank mask
     0x800,                                             // RAMsize
-    1
+    1,
+       {
+               /* PIC18F8520 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { 0x83, 0, 0xff } /* 4 */ , { 0x88, 0, 0xff } /* 5 */ , { -1, 0, 0xff } /* 6 */  , 
+               { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ } 
+       }
   },
+
   {
     {"p18f8620", "18f8620", "pic18f8620", "f8620"},    // aliases
     0,
     0xf00,                                             // bank mask
     0xf00,                                             // RAMsize
-    1
+    1,
+       {
+               /* PIC18F8620 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { 0x83, 0, 0xff } /* 4 */ , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ }
+       }
   },
   {
     {"p18f8680", "18f8680", "pic18f8680", "f8680"},    // aliases
     0,
     0xc00,                                             // bank mask
     0x800,                                             // RAMsize
-    1
+    1,
+       {
+               /* PIC18F8680 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x2f, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
+               { 0x83, 0, 0xff } /* 4 */ , { 0x83, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ }
+       }
   },
+
   {
     {"p18f8720", "18f8720", "pic18f8720", "f8720"},    // aliases
     0,
     0xf00,                                             // bank mask
     0xf00,                                             // RAMsize
-    1
-  },
+    1,
+       {
+               /* PIC18F8720 configuration words */
+               0x300001,
+               0x30000d,
+               { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
+               { 0x83, 0, 0xff } /* 4 */ , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
+               { -1, 0, 0xff } /* 7 */  , { 0xff, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
+               { 0xff, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0xff, 0, 0xff } /* c */ , 
+               { 0x40, 0, 0xff } /* d */ }
+       }
+  }
 
 };
 
@@ -170,54 +354,6 @@ static int num_of_supported_PICS = sizeof(Pics16)/sizeof(PIC16_device);
 #define DEFAULT_PIC "452"
 
 PIC16_device *pic16=NULL;
-
-#define DEFAULT_CONFIG_BYTE 0xff
-
-#define CONFIG1H_WORD_ADDRESS 0x300001
-#define DEFAULT_CONFIG1H_WORD DEFAULT_CONFIG_BYTE
-
-#define CONFIG2L_WORD_ADDRESS 0x300002
-#define DEFAULT_CONFIG2L_WORD DEFAULT_CONFIG_BYTE
-
-#define CONFIG2H_WORD_ADDRESS 0x300003
-#define DEFAULT_CONFIG2H_WORD DEFAULT_CONFIG_BYTE
-
-#define CONFIG3H_WORD_ADDRESS 0x300005
-#define DEFAULT_CONFIG3H_WORD DEFAULT_CONFIG_BYTE
-
-#define CONFIG4L_WORD_ADDRESS 0x300006
-#define DEFAULT_CONFIG4L_WORD DEFAULT_CONFIG_BYTE
-
-#define CONFIG5L_WORD_ADDRESS 0x300008
-#define DEFAULT_CONFIG5L_WORD DEFAULT_CONFIG_BYTE
-
-#define CONFIG5H_WORD_ADDRESS 0x300009
-#define DEFAULT_CONFIG5H_WORD DEFAULT_CONFIG_BYTE
-
-#define CONFIG6L_WORD_ADDRESS 0x30000a
-#define DEFAULT_CONFIG6L_WORD DEFAULT_CONFIG_BYTE
-
-#define CONFIG6H_WORD_ADDRESS 0x30000b
-#define DEFAULT_CONFIG6H_WORD DEFAULT_CONFIG_BYTE
-
-#define CONFIG7L_WORD_ADDRESS 0x30000c
-#define DEFAULT_CONFIG7L_WORD DEFAULT_CONFIG_BYTE
-
-#define CONFIG7H_WORD_ADDRESS 0x30000d
-#define DEFAULT_CONFIG7H_WORD DEFAULT_CONFIG_BYTE
-
-static unsigned int config1h_word = DEFAULT_CONFIG1H_WORD;
-static unsigned int config2l_word = DEFAULT_CONFIG2L_WORD;
-static unsigned int config2h_word = DEFAULT_CONFIG2H_WORD;
-static unsigned int config3h_word = DEFAULT_CONFIG3H_WORD;
-static unsigned int config4l_word = DEFAULT_CONFIG4L_WORD;
-static unsigned int config5l_word = DEFAULT_CONFIG5L_WORD;
-static unsigned int config5h_word = DEFAULT_CONFIG5H_WORD;
-static unsigned int config6l_word = DEFAULT_CONFIG6L_WORD;
-static unsigned int config6h_word = DEFAULT_CONFIG6H_WORD;
-static unsigned int config7l_word = DEFAULT_CONFIG7L_WORD;
-static unsigned int config7h_word = DEFAULT_CONFIG7H_WORD;
-
 unsigned int stackPos = 0;
 
 extern regs* newReg(short type, short pc_type, int rIdx, char *name, int size, int alias, operand *refop);
@@ -263,23 +399,43 @@ int regCompare(const void *a, const void *b)
        if( (*i)->address < (*j)->address)return -1;
        
        /* and secondarily by size */
+       /* register size sorting may have strange results use with care */
        if( (*i)->size > (*j)->size)return 1;
        if( (*i)->size < (*j)->size)return -1;
        
-       /* register size sorting may have strange results use with care */
-       
        /* finally if in same address and same size sort by name */
        return (strcmp( (*i)->name, (*j)->name));
 
   return 0;
 }
 
-void pic16_dump_section(FILE *of, set *section, int fix)
+int symCompare(const void *a, const void *b)
 {
-  static int abs_section_no=0;
+  const symbol *const *i = a;
+  const symbol *const *j = b;
+
+       /* sort primarily by the address */
+       if( SPEC_ADDR((*i)->etype) > SPEC_ADDR((*j)->etype))return 1;
+       if( SPEC_ADDR((*i)->etype) < SPEC_ADDR((*j)->etype))return -1;
+       
+       /* and secondarily by size */
+       /* register size sorting may have strange results use with care */
+       if( getSize((*i)->etype) > getSize((*j)->etype))return 1;
+       if( getSize((*i)->etype) < getSize((*j)->etype))return -1;
+
+       /* finally if in same address and same size sort by name */
+       return (strcmp( (*i)->rname, (*j)->rname));
+
+  return 0;
+}
+
+void pic16_dump_usection(FILE *of, set *section, int fix)
+{
+  static int abs_usection_no=0;
   regs *r, *rprev;
   int init_addr, i;
   regs **rlist;
+  regs *r1;
 
        /* put all symbols in an array */
        rlist = Safe_calloc(elementsInSet(section), sizeof(regs *));
@@ -303,35 +459,103 @@ void pic16_dump_section(FILE *of, set *section, int fix)
                }
        } else {
          int j=0;
-         regs *r1;
-         
+         int deb_addr=0;
+
                rprev = NULL;
                init_addr = rlist[j]->address;
-               fprintf(of, "\n\nstatic_%s_%02d\tudata\t0X%04X\n", moduleName, abs_section_no++, init_addr);
+               deb_addr = init_addr;
+               fprintf(of, "\n\nustat_%s_%02d\tudata\t0X%04X\n", moduleName, abs_usection_no++, init_addr);
        
                for(j=0;j<i;j++) {
                        r = rlist[j];
                        if(j < i-1)r1 = rlist[j+1]; else r1 = NULL;
                        
                        init_addr = r->address;
+                       deb_addr = init_addr;
+                       
+                       if((rprev && (init_addr > (rprev->address + rprev->size)))) {
+                               fprintf(of, "\n\nustat_%s_%02d\tudata\t0X%04X\n", moduleName, abs_usection_no++, init_addr);
+                       }
 
-                       if(rprev && (init_addr > (rprev->address + rprev->size))) {
-                               fprintf(of, "\nstatic_%s_%02d\tudata\t0X%04X\n", moduleName, abs_section_no++, init_addr);
+                       if(r1 && (init_addr == r1->address)) {
+                               fprintf(of, "\n%s\tres\t0\n", r->name);
+                       } else {
+                               fprintf(of, "%s\tres\t%d\n", r->name, r->size);
+                               deb_addr += r->size;
                        }
+                       
+                       rprev = r;
+               }
+       }
+       free(rlist);
+}
+
 
+/* forward declaration */
+void print_idata(FILE *of, symbol * sym, sym_link * type, initList * ilist);
+
+void pic16_dump_isection(FILE *of, set *section, int fix)
+{
+  static int abs_isection_no=0;
+  symbol *s, *sprev;
+  int init_addr, i;
+  symbol **slist;
+
+       /* put all symbols in an array */
+       slist = Safe_calloc(elementsInSet(section), sizeof(symbol *));
+       s = slist[0]; i = 0;
+       for(sprev = setFirstItem(section); sprev; sprev = setNextItem(section)) {
+               slist[i] = sprev; i++;
+       }
+       
+       if(!i) {
+               if(slist)free(slist);
+         return;
+       }
 
+       /* sort symbols according to their address */
+       qsort(slist, i, sizeof(symbol *), symCompare);
+       
+       if(!fix) {
+               fprintf(of, "\n\n\tidata\n");
+               for(s = setFirstItem(section); s; s = setNextItem(section)) {
+                       print_idata(of, s, s->type, s->ival);
+               }
+       } else {
+         int j=0;
+         symbol *s1;
+         
+               sprev = NULL;
+               init_addr = SPEC_ADDR(slist[j]->etype);
+               fprintf(of, "\n\nistat_%s_%02d\tidata\t0X%04X\n", moduleName, abs_isection_no++, init_addr);
+       
+               for(j=0;j<i;j++) {
+                       s = slist[j];
+                       if(j < i-1)s1 = slist[j+1]; else s1 = NULL;
+                       
+                       init_addr = SPEC_ADDR(s->etype);
+
+                       if(sprev && (init_addr > (SPEC_ADDR(sprev->etype) + getSize(sprev->etype)))) {
+                               fprintf(of, "\nistat_%s_%02d\tidata\t0X%04X\n", moduleName, abs_isection_no++, init_addr);
+                       }
+
+                       print_idata(of, s, s->type, s->ival);
+                       
+#if 0
                        if(r1 && (init_addr == r1->address)) {
                                fprintf(of, "%s\tres\t0\n\n", r->name);
                        } else {
                                fprintf(of, "%s\tres\t%d\n", r->name, r->size);
                        }
+#endif
                        
-                       rprev = r;
+                       sprev = s;
                }
        }
-       free(rlist);
+       free(slist);
 }
 
+
 void pic16_dump_int_registers(FILE *of, set *section)
 {
   regs *r, *rprev;
@@ -371,6 +595,8 @@ void pic16_dump_int_registers(FILE *of, set *section)
 
 #define BYTE_IN_LONG(x,b) ((x>>(8*_ENDIAN(b)))&0xff)
 
+
+
 /*-----------------------------------------------------------------*/
 /* printIvalType - generates ival for int/char                     */
 /*-----------------------------------------------------------------*/
@@ -405,21 +631,22 @@ void print_idataType (FILE *of, symbol *sym, sym_link * type, initList * ilist)
 
   switch (getSize (type)) {
     case 1:
-       fprintf(of, "%s\tdata\t0x%02x\n", sym->name, (unsigned char)BYTE_IN_LONG(ulval, 0));
+       if(isprint(BYTE_IN_LONG(ulval, 0)))
+               fprintf(of, "%s\tdata\t\"%c\"\n", sym->rname, (unsigned char)BYTE_IN_LONG(ulval, 0));
+       else
+               fprintf(of, "%s\tdata\t0x%02x\n", sym->rname, (unsigned char)BYTE_IN_LONG(ulval, 0));
 //     pic16_addpCode2pBlock(pb,pic16_newpCode(POC_RETLW,pic16_newpCodeOpLit(BYTE_IN_LONG(ulval,0))));
        break;
 
     case 2:
-//     fprintf(of, "%s\tdw\t0x%04x\n", sym->name, (unsigned int)(BYTE_IN_LONG(ulval, 0)
-//                                     + (BYTE_IN_LONG(ulval, 1) << 8)));
-       fprintf(of, "%s\tdata\t0x%02x,0x%02x\n", sym->name, (unsigned char)BYTE_IN_LONG(ulval, 0),
-                                       (unsigned char)(BYTE_IN_LONG(ulval, 1) << 8));
-//     pic16_addpCode2pBlock(pb,pic16_newpCode(POC_RETLW,pic16_newpCodeOpLit(BYTE_IN_LONG(ulval,0))));
-//     pic16_addpCode2pBlock(pb,pic16_newpCode(POC_RETLW,pic16_newpCodeOpLit(BYTE_IN_LONG(ulval,1))));
+       fprintf(of, "%s\tdw\t0x%02x, 0x%02x\n", sym->rname, (unsigned int)(BYTE_IN_LONG(ulval, 0)),
+                                       (unsigned int)(BYTE_IN_LONG(ulval, 1)));
+//     fprintf(of, "%s\tdata\t0x%04x\n", sym->rname, (unsigned int)BYTE_IN_LONG(ulval, 0) +
+//                                     (unsigned int)(BYTE_IN_LONG(ulval, 1) << 8));
        break;
 
     case 4:
-       fprintf(of, "%s\tdw\t0x%04x,0x%04x\n", sym->name, (unsigned int)(BYTE_IN_LONG(ulval, 0)
+       fprintf(of, "%s\tdw\t0x%04x,0x%04x\n", sym->rname, (unsigned int)(BYTE_IN_LONG(ulval, 0)
                                        + (BYTE_IN_LONG(ulval, 1) << 8)),
                                        (unsigned)(BYTE_IN_LONG(ulval, 2)
                                        + (BYTE_IN_LONG(ulval, 3) << 8)));
@@ -432,9 +659,139 @@ void print_idataType (FILE *of, symbol *sym, sym_link * type, initList * ilist)
 }
 
 
+/*-----------------------------------------------------------------*/
+/* print_idataChar - generates initital value for character array    */
+/*-----------------------------------------------------------------*/
+static int 
+print_idataChar (FILE *of, symbol *sym, sym_link * type, initList * ilist, char *s)
+{
+  value *val;
+  int remain;
+  char old_ch=0, *vchar;
+
+  // fprintf(stderr, "%s\n",__FUNCTION__);
+  if (!s)
+    {
+
+      val = list2val (ilist);
+      /* if the value is a character string  */
+      if (IS_ARRAY (val->type) && IS_CHAR (val->etype))
+       {
+         if (!DCL_ELEM (type))
+           DCL_ELEM (type) = strlen (SPEC_CVAL (val->etype).v_char) + 1;
+
+
+         fprintf(of, "%s\tdata\t", sym->rname);
+         vchar = SPEC_CVAL(val->etype).v_char;
+         for(remain=0; remain<DCL_ELEM(type); remain++) {
+               if(!isprint(old_ch)) {
+                       if(isprint(vchar[remain]))fprintf(of, "%s\"%c", (remain?", ":""), vchar[remain]);
+                       else fprintf(of, "0x%02x", vchar[remain]);
+               } else
+                       if(!isprint(vchar[remain]))fprintf(of, "\", 0x%02x", vchar[remain]);
+                       else fprintf(of, "%c", vchar[remain]);
+               old_ch = vchar[ remain ];
+         }
+//          fprintf(of, "0x%02x%s", SPEC_CVAL(val->etype).v_char[ remain ], (remain==DCL_ELEM(type)-1?"":","));
+                       
+
+         if ((remain = (DCL_ELEM (type) - strlen (SPEC_CVAL (val->etype).v_char) - 1)) > 0)
+            {
+             while (remain--)
+                {
+                 fprintf(of, "0x%02x%s", 0x00 /*SPEC_CVAL(val->etype).v_char[ remain ]*/ , (remain==DCL_ELEM(type)-1?"":","));
+                }
+            }
+               fprintf(of, "\n");
+         return 1;
+       }
+      else
+       return 0;
+    }
+  else {
+    fprintf(of, "%s\tdata\t", sym->rname);
+    vchar = s; old_ch = 0;
+    for(remain=0; remain<strlen(s); remain++) 
+      {
+       if(!isprint(old_ch)) {
+               if(isprint(vchar[remain]))fprintf(of, "%s\"%c", (remain?", ":""), vchar[remain]);
+               else fprintf(of, "0x%02x", vchar[remain]);
+       } else
+               if(!isprint(vchar[remain]))fprintf(of, "\", 0x%02x", vchar[remain]);
+               else fprintf(of, "%c", vchar[remain]);
+       old_ch = vchar[ remain ];
+//     fprintf(of, "0x%02x%s", s[ remain ], (remain==strlen(s)-1?"":","));
+      }
+  }
+  return 1;
+}
+
+/*-----------------------------------------------------------------*/
+/* print_idataArray - generates code for array initialization        */
+/*-----------------------------------------------------------------*/
+static void 
+print_idataArray (FILE *of, symbol * sym, sym_link * type, initList * ilist)
+{
+  initList *iloop;
+  int lcnt = 0, size = 0;
+
+  /* take care of the special   case  */
+  /* array of characters can be init  */
+  /* by a string                      */
+  if (IS_CHAR (type->next)) {
+//    fprintf(stderr,"%s:%d - is_char\n",__FUNCTION__,__LINE__);
+    if (!IS_LITERAL(list2val(ilist)->etype)) {
+      werror (W_INIT_WRONG);
+      return;
+    }
+    if (print_idataChar (of, sym, type,
+                      (ilist->type == INIT_DEEP ? ilist->init.deep : ilist),
+                      SPEC_CVAL (sym->etype).v_char))
+      return;
+  }
+  /* not the special case             */
+  if (ilist->type != INIT_DEEP)
+    {
+      werror (E_INIT_STRUCT, sym->name);
+      return;
+    }
+
+  iloop = ilist->init.deep;
+  lcnt = DCL_ELEM (type);
+
+  for (;;)
+    {
+      //fprintf(stderr,"%s:%d - is_char\n",__FUNCTION__,__LINE__);
+      size++;
+      print_idata (of, sym, type->next, iloop);
+      iloop = (iloop ? iloop->next : NULL);
+
+
+      /* if not array limits given & we */
+      /* are out of initialisers then   */
+      if (!DCL_ELEM (type) && !iloop)
+       break;
+
+      /* no of elements given and we    */
+      /* have generated for all of them */
+      if (!--lcnt) {
+       /* if initializers left */
+       if (iloop) {
+         werror (W_EXCESS_INITIALIZERS, "array", sym->name, sym->lineDef);
+       }
+       break;
+      }
+    }
+
+  /* if we have not been given a size  */
+  if (!DCL_ELEM (type))
+    DCL_ELEM (type) = size;
+
+  return;
+}
 
 /*-----------------------------------------------------------------*/
-/* printIval - generates code for initial value                    */
+/* print_idata - generates code for initial value                    */
 /*-----------------------------------------------------------------*/
 void print_idata(FILE *of, symbol * sym, sym_link * type, initList * ilist)
 {
@@ -446,6 +803,9 @@ void print_idata(FILE *of, symbol * sym, sym_link * type, initList * ilist)
     {
       //fprintf(stderr,"%s struct\n",__FUNCTION__);
       //printIvalStruct (sym, type, ilist, oFile);
+      fprintf(stderr, "%s:%d: PIC16 port error: structure initialisation is not implemented yet.\n",
+       __FILE__, __LINE__);
+      abort();
       return;
     }
 
@@ -454,6 +814,9 @@ void print_idata(FILE *of, symbol * sym, sym_link * type, initList * ilist)
     {
       //fprintf(stderr,"%s pointer\n",__FUNCTION__);
       //printIvalPtr (sym, type, ilist, oFile);
+      fprintf(stderr, "%s:%d: PIC16 port error: pointer initialisation is not immplemented yet.\n",
+       __FILE__, __LINE__);
+      abort();
       return;
     }
 
@@ -461,7 +824,7 @@ void print_idata(FILE *of, symbol * sym, sym_link * type, initList * ilist)
   if (IS_ARRAY (type))
     {
       //fprintf(stderr,"%s array\n",__FUNCTION__);
-//      printIvalArray (sym, type, ilist, pb);
+      print_idataArray (of, sym, type, ilist);
       return;
     }
 
@@ -475,21 +838,6 @@ void print_idata(FILE *of, symbol * sym, sym_link * type, initList * ilist)
 }
 
 
-void pic16_dump_idata(FILE *of, set *idataSymSet)
-{
-  int i;
-  symbol *ids;
-  
-
-       i = elementsInSet(idataSymSet);
-       if(!i)return;
-       
-       fprintf(of, "\n\n; Initialised data (idata)\n");
-       fprintf(of, "\tidata\n");
-       for(ids = setFirstItem(idataSymSet); ids; ids = setNextItem(idataSymSet))
-             print_idata(of, ids, ids->type, ids->ival);
-
-}
 
 
 /*-----------------------------------------------------------------*
@@ -691,9 +1039,18 @@ void pic16_groupRegistersInSection(set *regset)
 
                if(reg->wasUsed
                        && !(reg->regop && SPEC_EXTR(OP_SYM_ETYPE(reg->regop)))) {
-
-//                     fprintf(stderr, "%s:%d register %s alias:%d fix:%d\n",
-//                             __FILE__, __LINE__, reg->name, reg->alias, reg->isFixed);
+                       
+                       /* avoid grouping registers that have an initial value,
+                        * they will be added later in idataSymSet */
+                       if(reg->regop && (OP_SYMBOL(reg->regop)->ival && !OP_SYMBOL(reg->regop)->level))
+                               continue;
+
+#if 0
+                       fprintf(stderr, "%s:%d register %s alias:%d fix:%d ival=%i level=%i\n",
+                               __FILE__, __LINE__, reg->name, reg->alias, reg->isFixed,
+                                       (reg->regop?(OP_SYMBOL(reg->regop)->ival?1:0):-1),
+                                       (reg->regop?(OP_SYMBOL(reg->regop)->level):-1) );
+#endif
 
                        if(reg->alias) {
                                checkAddReg(&pic16_equ_data, reg);
@@ -723,82 +1080,17 @@ void pic16_groupRegistersInSection(set *regset)
  * This routine will assign a value to that address.
  *
  *-----------------------------------------------------------------*/
-
 void pic16_assignConfigWordValue(int address, int value)
 {
-  switch(address) {
-  case CONFIG1H_WORD_ADDRESS:
-    config1h_word = value;
-    break;
-  case CONFIG2L_WORD_ADDRESS:
-    config2l_word = value;
-    break;
-  case CONFIG2H_WORD_ADDRESS:
-    config2h_word = value;
-    break;
-  case CONFIG3H_WORD_ADDRESS:
-    config3h_word = value;
-    break;
-  case CONFIG4L_WORD_ADDRESS:
-    config4l_word = value;
-    break;
-  case CONFIG5L_WORD_ADDRESS:
-    config5l_word = value;
-    break;
-  case CONFIG5H_WORD_ADDRESS:
-    config5h_word = value;
-    break;
-  case CONFIG6L_WORD_ADDRESS:
-    config6l_word = value;
-    break;
-  case CONFIG6H_WORD_ADDRESS:
-    config6h_word = value;
-    break;
-  case CONFIG7L_WORD_ADDRESS:
-    config7l_word = value;
-    break;
-  case CONFIG7H_WORD_ADDRESS:
-    config7h_word = value;
-    break;
-  }
-
-//     fprintf(stderr,"setting config word to 0x%x\n",value);
-
-}
-/*-----------------------------------------------------------------*
- * int pic16_getConfigWord(int address)
- *
- * Get the current value of the config word.
- *
- *-----------------------------------------------------------------*/
+  int i;
 
-int pic16_getConfigWord(int address)
-{
-  switch(address) {
-  case CONFIG1H_WORD_ADDRESS:
-    return config1h_word;
-  case CONFIG2L_WORD_ADDRESS:
-    return config2l_word;
-  case CONFIG2H_WORD_ADDRESS:
-    return config2h_word;
-  case CONFIG3H_WORD_ADDRESS:
-    return config3h_word;
-  case CONFIG4L_WORD_ADDRESS:
-    return config4l_word;
-  case CONFIG5L_WORD_ADDRESS:
-    return config5l_word;
-  case CONFIG5H_WORD_ADDRESS:
-    return config5h_word;
-  case CONFIG6L_WORD_ADDRESS:
-    return config6l_word;
-  case CONFIG6H_WORD_ADDRESS:
-    return config6h_word;
-  case CONFIG7L_WORD_ADDRESS:
-    return config7l_word;
-  case CONFIG7H_WORD_ADDRESS:
-    return config7h_word;
-  default:
-    return 0;
-  }
+       for(i=0;i<pic16->cwInfo.confAddrEnd-pic16->cwInfo.confAddrStart+1;i++) {
+               if(pic16->cwInfo.crInfo[i].mask != -1) {
+//                     fprintf(stderr, "setting location 0x%X\n", pic16->cwInfo.confAddrStart+i);
+                       pic16->cwInfo.crInfo[i].value = value;
+                       pic16->cwInfo.crInfo[i].emit = 1;
+                       return;
+               }
+       }
 }
 
index ca6e9b36df8ae6875e7f5a9777fdc6c019f96b42..f9bef22108e03f765c2659817b9e0b61449ced94 100644 (file)
 #define STRCASECMP strcasecmp
 #endif
 
+#define CONFIGURATION_WORDS    20
+
+typedef struct {
+       int mask;
+       int emit;
+       int value;
+} configRegInfo;
+
+typedef struct {
+       int confAddrStart;      /* starting address */
+       int confAddrEnd;        /* ending address */
+       configRegInfo crInfo[ CONFIGURATION_WORDS ];
+} configWordsInfo;
+
+
 
 #define PROCESSOR_NAMES    4
 /* Processor unique attributes */
@@ -46,6 +61,7 @@ typedef struct PIC16_device {
   int bankMask;               /* Bitmask that is ANDed with address to extract banking bits */
   int RAMsize;               /* size of Data RAM - VR 031120 */
   int extMIface;               /* device has external memory interface */
+  configWordsInfo cwInfo;      /* configuration words info */
 } PIC16_device;
 
 /* Given a pointer to a register, this macro returns the bank that it is in */
@@ -67,7 +83,8 @@ typedef struct {
 #define STACK_MODEL_SMALL      (pic16_options.stack_model == 0)
 #define STACK_MODEL_LARGE      (pic16_options.stack_model == 1)
 
-extern set *idataSymSet;
+extern set *fix_idataSymSet;
+extern set *rel_idataSymSet;
 
 extern pic16_options_t pic16_options;
 extern PIC16_device *pic16;
@@ -78,6 +95,7 @@ int pic16_getConfigWord(int address);
 int pic16_isREGinBank(regs *reg, int bank);
 int pic16_REGallBanks(regs *reg);
 void pic16_setMaxRAM(int size);
+int PIC16_IS_CONFIG_ADDRESS(int address);
 
 int checkAddReg(set **set, regs *reg);
 int checkAddSym(set **set, symbol *reg);
index 5a1072dd09fc09e8369ddf3d53ae0bed99f54b8a..c84e20e5e5349c4133a59ef01d04ec335147156b 100644 (file)
@@ -6,6 +6,7 @@
   Bug Fixes  -  Wojciech Stryjewski  wstryj1@tiger.lsu.edu (1999 v2.1.9a)
   PIC port   -  Scott Dattalo scott@dattalo.com (2000)
   PIC16 port -  Martin Dubuc m.dubuc@rogers.com (2002)
+             -  Vangelis Rokas vrokas@otenet.gr (2003)
   
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
@@ -54,7 +55,7 @@ void pic16_genMult32X32_32(operand *, operand *, operand *);
 pCode *pic16_AssembleLine(char *line, int peeps);
 extern void pic16_printpBlock(FILE *of, pBlock *pb);
 static asmop *newAsmop (short type);
-static pCodeOp *pic16_popRegFromString(char *str, int size, int offset);
+static pCodeOp *pic16_popRegFromString(char *str, int size, int offset, operand *op);
 extern pCode *pic16_newpCodeAsmDir(char *asdir, char *argfmt, ...);
 static void mov2w (asmop *aop, int offset);
 static int aopIdx (asmop *aop, int offset);
@@ -83,6 +84,7 @@ void pic16_pushpCodeOp(pCodeOp *pcop);
 void pic16_poppCodeOp(pCodeOp *pcop);
 
 static bool is_LitOp(operand *op);
+static bool is_LitAOp(asmop *aop);
 
 
 #define BYTEofLONG(l,b) ( (l>> (b<<3)) & 0xff)
@@ -510,15 +512,20 @@ static int pointerCode (sym_link *etype)
 
 }
 #endif
+
 /*-----------------------------------------------------------------*/
 /* aopForSym - for a true symbol                                   */
 /*-----------------------------------------------------------------*/
-static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
+static asmop *aopForSym (iCode *ic, operand *op, bool result)
 {
+    symbol *sym=OP_SYMBOL(op);
     asmop *aop;
     memmap *space= SPEC_OCLS(sym->etype);
 
     DEBUGpic16_emitcode("; ***","%s %d",__FUNCTION__,__LINE__);
+
+//    sym = OP_SYMBOL(op);
+
     /* if already has one */
     if (sym->aop) {
            DEBUGpic16_emitcode("; ***", "already has sym %s %d", __FUNCTION__, __LINE__);
@@ -651,7 +658,7 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
                PCOI(aop->aopu.pcop)->index = 0;
        } else {
                /* try to allocate via direct register */
-               aop->aopu.pcop = pic16_popRegFromString(sym->rname, getSize(sym->type), sym->offset); // Patch 8
+               aop->aopu.pcop = pic16_popRegFromString(sym->rname, getSize(sym->type), sym->offset, op); // Patch 8
 //             aop->size = getSize( sym->type );
        }
 
@@ -740,7 +747,8 @@ static asmop *aopForRemat (operand *op) // x symbol *sym)
        } else {
                DEBUGpic16_emitcode("%s:%d dir", __FILE__, __LINE__);
 
-               aop->aopu.pcop = pic16_popRegFromString(OP_SYMBOL(IC_LEFT(ic))->rname, getSize( OP_SYMBOL( IC_LEFT(ic))->type), val);
+               aop->aopu.pcop = pic16_popRegFromString(OP_SYMBOL(IC_LEFT(ic))->rname,
+                               getSize( OP_SYMBOL( IC_LEFT(ic))->type), val, op);
 //             aop->size = AOP_SIZE( IC_LEFT(ic) );
        }
 
@@ -925,7 +933,7 @@ void pic16_aopOp (operand *op, iCode *ic, bool result)
     /* if this is a true symbol */
     if (IS_TRUE_SYMOP(op)) {    
        DEBUGpic16_emitcode(";","%d - true symop",__LINE__);
-      op->aop = aopForSym(ic,OP_SYMBOL(op),result);
+      op->aop = aopForSym(ic, op, result);
       return ;
     }
 
@@ -1012,7 +1020,7 @@ void pic16_aopOp (operand *op, iCode *ic, bool result)
        //aop->aopu.pcop = pic16_popGetImmd(sym->usl.spillLoc->rname,0,sym->usl.spillLoc->offset);
        aop->aopu.pcop = pic16_popRegFromString(sym->usl.spillLoc->rname, 
                                          getSize(sym->type), 
-                                         sym->usl.spillLoc->offset);
+                                         sym->usl.spillLoc->offset, op);
         aop->size = getSize(sym->type);
 
         return;
@@ -1425,7 +1433,7 @@ pCodeOp *pic16_popGetWithString(char *str)
 /*-----------------------------------------------------------------*/
 /* pic16_popRegFromString -                                        */
 /*-----------------------------------------------------------------*/
-static pCodeOp *pic16_popRegFromString(char *str, int size, int offset)
+static pCodeOp *pic16_popRegFromString(char *str, int size, int offset, operand *op)
 {
 
   pCodeOp *pcop = Safe_calloc(1,sizeof(pCodeOpReg) );
@@ -1446,7 +1454,7 @@ static pCodeOp *pic16_popRegFromString(char *str, int size, int offset)
   if(PCOR(pcop)->r == NULL) {
 //     fprintf(stderr, "%s:%d - couldn't find %s in allocated regsters, size= %d ofs= %d\n",
 //             __FUNCTION__, __LINE__, str, size, offset);
-    PCOR(pcop)->r = pic16_allocRegByName (pcop->name,size);
+    PCOR(pcop)->r = pic16_allocRegByName (pcop->name,size, op);
 
        //fprintf(stderr, "allocating new register -> %s\n", str);
 
@@ -1599,7 +1607,7 @@ pCodeOp *pic16_popGet (asmop *aop, int offset) //, bool bit16, bool dname)
        
     case AOP_DIR:
       DEBUGpic16_emitcode(";","%d\tAOP_DIR", __LINE__);
-      return pic16_popRegFromString(aop->aopu.aop_dir, aop->size, offset);
+      return pic16_popRegFromString(aop->aopu.aop_dir, aop->size, offset, NULL);
        
     case AOP_REG:
       {
@@ -1906,16 +1914,15 @@ void pic16_aopPut (asmop *aop, char *s, int offset)
 static void mov2w (asmop *aop, int offset)
 {
 
-  if(!aop)
-    return;
+//  if(!aop)
+//    return;
 
-  DEBUGpic16_emitcode ("; ***","%s  %d  offset=%d",__FUNCTION__,__LINE__,offset);
+       DEBUGpic16_emitcode ("; ***","%s  %d  offset=%d",__FUNCTION__,__LINE__,offset);
 
-  if ( aop->type == AOP_PCODE ||
-       aop->type == AOP_LIT )
-    pic16_emitpcode(POC_MOVLW,pic16_popGet(aop,offset));
-  else
-    pic16_emitpcode(POC_MOVFW,pic16_popGet(aop,offset));
+       if(is_LitAOp(aop))
+               pic16_emitpcode(POC_MOVLW,pic16_popGet(aop,offset));
+       else
+               pic16_emitpcode(POC_MOVFW,pic16_popGet(aop,offset));
 
 }
 
@@ -2968,7 +2975,7 @@ static void genPcall (iCode *ic)
        pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_tosu));
 
        /* make the call by writing the pointer into pc */
-// FIXME Disabled writes to PCLATU because of gpsim problems
+       // FIXME Disabled writes to PCLATU because of gpsim problems
 #if 1
        pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(IC_LEFT(ic)),2), pic16_popCopyReg(&pic16_pc_pclatu)));
 #else
@@ -3605,10 +3612,7 @@ static void genEndFunction (iCode *ic)
 void pic16_storeForReturn(operand *op, int offset, pCodeOp *dest)
 {
 
-       if(is_LitOp(op))
-//     if((AOP(op)->aopu.pcop->type == PO_IMMEDIATE)
-//             || (AOP(op)->aopu.pcop->type == PO_LITERAL))
-       {
+       if(is_LitOp(op)) {
                pic16_emitpcode(POC_MOVLW, pic16_popGet(AOP(op), offset)); // patch 12
 
                if(dest->type != PO_WREG)
@@ -4921,8 +4925,9 @@ static void genCmp (operand *left,operand *right,
        }
 
        if(ifx) ifx->generated = 1;
-       goto check_carry;
-//     return;
+       if ((AOP_TYPE(result) != AOP_CRY) && (AOP_SIZE(result)))
+               goto check_carry;
+       return;
 
       } else {
 
@@ -5588,6 +5593,18 @@ static bool is_LitOp(operand *op)
               || (AOP(op)->aopu.pcop->type == PO_IMMEDIATE) ));  
 }
 
+/*-----------------------------------------------------------------*/
+/* is_LitAOp - check if operand has to be treated as literal        */
+/*-----------------------------------------------------------------*/
+static bool is_LitAOp(asmop *aop)
+{
+  return (aop->type == AOP_LIT)
+      || ( (aop->type == AOP_PCODE)
+          && ( (aop->aopu.pcop->type == PO_LITERAL)
+              || (aop->aopu.pcop->type == PO_IMMEDIATE) ));  
+}
+
+
 
 /*-----------------------------------------------------------------*/
 /* genCmpEq - generates code for equal to                          */
@@ -9121,6 +9138,15 @@ static void genDataPointerGet(operand *left,
        }
 #endif
 
+#if 1
+       if(!strcmp(pic16_aopGet(AOP(result), 0, TRUE, FALSE),
+               pic16_aopGet(AOP(left), 0, TRUE, FALSE))) {
+               DEBUGpic16_emitcode("; ***", "left and result names are same, skipping moving");
+               goto release;
+       }
+#endif
+
+
 #if 0
        if ( AOP_TYPE(left) == AOP_PCODE) {
                fprintf(stderr,"genDataPointerGet   %s, %d\n",
@@ -9153,7 +9179,7 @@ static void genDataPointerGet(operand *left,
                leoffset++;
        }
 
-//release:
+release:
     pic16_freeAsmop(result,NULL,ic,TRUE);
 }
 
@@ -9181,8 +9207,8 @@ static void genNearPointerGet (operand *left,
     
        pic16_aopOp(left,ic,FALSE);
 
-       pic16_DumpOp("(left)",left);
-       pic16_DumpOp("(result)",result);
+//     pic16_DumpOp("(left)",left);
+//     pic16_DumpOp("(result)",result);
 
        /* if left is rematerialisable and
         * result is not bit variable type and
@@ -10609,15 +10635,61 @@ static void genAssign (iCode *ic)
 //  fprintf(stderr, "%s:%d: assigning value 0x%04lx (%d:%d)\n", __FUNCTION__, __LINE__, lit,
 //                     sizeof(unsigned long int), sizeof(float));
 
+  if(AOP_TYPE(right) != AOP_LIT
+       && IN_CODESPACE(SPEC_OCLS(OP_SYMBOL(right)->etype))) {
+       DEBUGpic16_emitcode(";   ", "%s:%d symbol in code space, take special care\n", __FUNCTION__, __LINE__);
+
+       // set up table pointer
+       if( (AOP_TYPE(right) == AOP_PCODE)
+               && ((AOP(right)->aopu.pcop->type == PO_IMMEDIATE)
+               || (AOP(right)->aopu.pcop->type == PO_DIR)))
+       {
+               pic16_emitpcode(POC_MOVLW,pic16_popGet(AOP(right),0));
+               pic16_emitpcode(POC_MOVWF,pic16_popCopyReg(&pic16_pc_tblptrl));
+               pic16_emitpcode(POC_MOVLW,pic16_popGet(AOP(right),1));
+               pic16_emitpcode(POC_MOVWF,pic16_popCopyReg(&pic16_pc_tblptrh));
+               pic16_emitpcode(POC_MOVLW,pic16_popGet(AOP(right),2));
+               pic16_emitpcode(POC_MOVWF,pic16_popCopyReg(&pic16_pc_tblptru));
+       } else {
+               pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(right),0),
+                               pic16_popCopyReg(&pic16_pc_tblptrl)));
+               pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(right),1),
+                               pic16_popCopyReg(&pic16_pc_tblptrh)));
+               pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(right),2),
+                               pic16_popCopyReg(&pic16_pc_tblptru)));
+       }
+
+       size = min(AOP_SIZE(right), AOP_SIZE(result));
+       while(size--) {
+               pic16_emitpcodeNULLop(POC_TBLRD_POSTINC);
+               pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg(&pic16_pc_tablat),
+                       pic16_popGet(AOP(result),offset)));
+               offset++;
+       }
+
+       if(AOP_SIZE(result) > AOP_SIZE(right)) {
+               size = AOP_SIZE(result) - AOP_SIZE(right);
+               while(size--) {
+                       pic16_emitpcode(POC_CLRF, pic16_popGet(AOP(result), offset));
+                       offset++;
+               }
+       }
+       goto release;
+  }
+
+
+
 /* VR - What is this?! */
   if( AOP_TYPE(right) == AOP_DIR  && (AOP_TYPE(result) == AOP_REG) && size==1)  {
   DEBUGpic16_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     if(aopIdx(AOP(result),0) == 4) {
   DEBUGpic16_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
+       assert(0);
       pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(right),offset));
       pic16_emitpcode(POC_MOVWF, pic16_popGet(AOP(result),offset));
       goto release;
     } else
+//     assert(0);
       DEBUGpic16_emitcode ("; WARNING","%s  %d ignoring register storage",__FUNCTION__,__LINE__);
   }
 
index a685c9ab1630c5195a7b0532c708e4a67f9edc6b..211c3822e5bcead403ced7bc2da7a84427ca9485 100644 (file)
@@ -61,7 +61,8 @@ extern char *iComments2;
 
 extern int initsfpnt;
 
-set *idataSymSet=NULL;
+set *rel_idataSymSet=NULL;
+set *fix_idataSymSet=NULL;
 
 extern DEFSETFUNC (closeTmpFiles);
 extern DEFSETFUNC (rmTmpFiles);
@@ -74,11 +75,11 @@ extern void pic16_writeUsedRegs(FILE *);
 extern void initialComments (FILE * afile);
 extern void printPublics (FILE * afile);
 
-extern void printChar (FILE * ofile, char *s, int plen);
 void  pic16_pCodeInitRegisters(void);
 pCodeOp *pic16_popGetLit(unsigned int lit);
 pCodeOp *pic16_popGetLit2(unsigned int lit, pCodeOp *arg2);
 pCodeOp *pic16_popCopyReg(pCodeOpReg *pc);
+extern void pic16_pCodeConstString(char *name, char *value);
 
 /*-----------------------------------------------------------------*/
 /* aopLiteral - string from a literal value                        */
@@ -120,14 +121,14 @@ static void
 pic16emitRegularMap (memmap * map, bool addPublics, bool arFlag)
 {
   symbol *sym;
-  int i, size, bitvars = 0;;
+//  int i, size, bitvars = 0;;
 
 //     fprintf(stderr, "%s:%d map name= %s\n", __FUNCTION__, __LINE__, map->sname);
        
        if(addPublics)
                fprintf (map->oFile, ";\t.area\t%s\n", map->sname);
-
                /* print the area name */
+
        for (sym = setFirstItem (map->syms); sym; sym = setNextItem (map->syms)) {
 
 #if 0
@@ -136,6 +137,11 @@ pic16emitRegularMap (memmap * map, bool addPublics, bool arFlag)
                printTypeChain( sym->type, stderr );
                fprintf(stderr, "\n");
 #endif
+
+//             if(PIC16_IS_CONFIG_ADDRESS(SPEC_ADDR(sym->etype)))
+//                     continue;
+
+
                /* if extern then add to externs */
                if (IS_EXTERN (sym->etype)) {
                        checkAddSym(&externs, sym);
@@ -149,7 +155,7 @@ pic16emitRegularMap (memmap * map, bool addPublics, bool arFlag)
                        !(sym->_isparm && !IS_REGPARM (sym->etype)) &&
                        !sym->allocreq && sym->level) {
 
-                       fprintf(stderr, "%s:%d special case, continuing...\n", __FILE__, __LINE__);
+//                     fprintf(stderr, "%s:%d special case, continuing...\n", __FILE__, __LINE__);
 
                        continue;
                }
@@ -164,12 +170,14 @@ pic16emitRegularMap (memmap * map, bool addPublics, bool arFlag)
                        checkAddSym(&publics, sym);
 //                     addSetHead(&publics, sym);
                } else
-                       if(IS_STATIC(sym->etype)) {
+                       if(IS_STATIC(sym->etype)
+                               && !(sym->ival && !sym->level)
+                       ) {
                          regs *reg;
                                /* add it to udata list */
 
-                               fprintf(stderr, "%s:%d adding %s (%s) remat=%d\n", __FILE__, __LINE__,
-                                       sym->name, sym->rname, sym->remat);
+//                             fprintf(stderr, "%s:%d adding %s (%s) remat=%d\n", __FILE__, __LINE__,
+//                                     sym->name, sym->rname, sym->remat);
                                        
                                                //, OP_SYMBOL(operandFromSymbol(sym))->name);
 #define SET_IMPLICIT   1
@@ -189,7 +197,6 @@ pic16emitRegularMap (memmap * map, bool addPublics, bool arFlag)
                        if(SPEC_OCLS(sym->etype) == code) {
 //                             fprintf(stderr, "%s:%d: symbol added: %s\n", __FILE__, __LINE__, sym->rname);
                                checkAddSym(&publics, sym);
-//                             addSetHead(&publics, sym);
                        }
                        continue;
                }
@@ -211,9 +218,6 @@ pic16emitRegularMap (memmap * map, bool addPublics, bool arFlag)
                }
 #endif
 
-               /* FIXME -- VR
-                * The equates are nice, but do not allow relocatable objects to
-                * be created in the form that I (VR) want to make SDCC to work */
 
                /* if is has an absolute address then generate
                an equate for this no need to allocate space */
@@ -242,13 +246,16 @@ pic16emitRegularMap (memmap * map, bool addPublics, bool arFlag)
                                        if(IS_STRUCT(sym->type))
                                                sym->implicit = 1;              // mark as implicit
 #endif
-                                       reg = pic16_allocDirReg( operandFromSymbol(sym) );
-                                       if(reg) {
-                                               if(checkAddReg(&pic16_fix_udata, reg)) {
-                                                       /* and add to globals list if not exist */
-                                                       addSet(&publics, sym);
+                                       if(!sym->ival) {
+                                               reg = pic16_allocDirReg( operandFromSymbol(sym) );
+                                               if(reg) {
+                                                       if(checkAddReg(&pic16_fix_udata, reg)) {
+                                                               /* and add to globals list if not exist */
+                                                               addSet(&publics, sym);
+                                                       }
                                                }
-                                       }
+                                       } else
+                                               addSet(&publics, sym);
                                }
                        }
                } else {
@@ -264,13 +271,16 @@ pic16emitRegularMap (memmap * map, bool addPublics, bool arFlag)
                                if(IS_STRUCT(sym->type))
                                        sym->implicit = 1;              // mark as implicit
 #endif
-                               reg = pic16_allocDirReg( operandFromSymbol( sym ) );
-                               if(checkAddReg(&pic16_rel_udata, reg)) {
+                               if(!sym->ival) {
+                                       reg = pic16_allocDirReg( operandFromSymbol( sym ) );
+                                       if(checkAddReg(&pic16_rel_udata, reg)) {
+                                               addSetHead(&publics, sym);
+                                       }
+                               } else
                                        addSetHead(&publics, sym);
-//                                     addSetHead(&externs, sym);
-                               }
                        }
 
+#if 0
                        /* allocate space */
                        /* If this is a bit variable, then allocate storage after 8 bits have been declared */
                        /* unlike the 8051, the pic does not have a separate bit area. So we emulate bit ram */
@@ -284,7 +294,8 @@ pic16emitRegularMap (memmap * map, bool addPublics, bool arFlag)
                                                fprintf (map->oFile, "\t%s_%d\n", sym->rname, i);
                                }
                        }
-//                     fprintf (map->oFile, "\t.ds\t0x%04x\n", (unsigned int)getSize (sym->type) & 0xffff);
+                       fprintf (map->oFile, "\t.ds\t0x%04x\n", (unsigned int)getSize (sym->type) & 0xffff);
+#endif
                }
        
                /* FIXME -- VR Fix the following, so that syms to be placed
@@ -293,77 +304,45 @@ pic16emitRegularMap (memmap * map, bool addPublics, bool arFlag)
                /* if it has an initial value then do it only if
                        it is a global variable */
 
-#if 1
                if (sym->ival && sym->level == 0) {
                  ast *ival = NULL;
 
-//                     if(SPEC_OCLS(sym->etype)==data) {
-//                             fprintf(stderr, "%s: sym %s placed in data\n", map->sname, sym->name);
-//                     }
+#if 0
+                       if(SPEC_OCLS(sym->etype)==data) {
+                               fprintf(stderr, "%s: sym %s placed in data segment\n", map->sname, sym->name);
+                       }
+
+                       if(SPEC_OCLS(sym->etype)==code) {
+                               fprintf(stderr, "%s: sym %s placed in code segment\n", map->sname, sym->name);
+                       }
+#endif
 
 //                     fprintf(stderr, "'%s': sym '%s' has initial value\n", map->sname, sym->name);
 
-                       if (IS_AGGREGATE (sym->type))
-                               ival = initAggregates (sym, sym->ival, NULL);
-                       else {
-#if 0
-                               tic = iCodeFromAst(decorateType (resolveSymbols (list2expr (sym->ival)), RESULT_CHECK));
+                       if (IS_AGGREGATE (sym->type)) {
+                               if(SPEC_ABSA(sym->etype))
+                                       addSet(&fix_idataSymSet, copySymbol(sym));
+                               else
+                                       addSet(&rel_idataSymSet, copySymbol(sym));
+//                             ival = initAggregates (sym, sym->ival, NULL);
+                       } else {
+                               if(SPEC_ABSA(sym->etype))
+                                       addSet(&fix_idataSymSet, copySymbol(sym));
+                               else
+                                       addSet(&rel_idataSymSet, copySymbol(sym));
 
-                               if(IS_PTR(sym->type)
-                                       && !IS_CODEPTR(sym->type)
-                                       && IS_AGGREGATE(OP_SYMBOL(IC_LEFT(tic))->type)) {
-                                       
-                                               fprintf(stderr, "symbol %s is a non-code pointer with aggregate initialiser\n", sym->name);
-
-                                               nsym = copySymbol( sym );
-                                               sprintf(tbuffer, "_tempbuf_%s", sym->name);
-                                               strcpy(nsym->name, tbuffer);
-                                               
-//                                             nsym->name = Safe_strdup( tbuf );
-                                               
-                                               codeOutFile = statsg->oFile;
-                                               GcurMemmap = statsg;
-                                               /* assignment of temporary buffer initialiser */
-                                               ival = initAggregates(nsym, nsym->ival, NULL);
-
-/*
-                                               ival = newNode ('=', newAst_VALUE(symbolVal (nsym)),
-                                                       decorateType (resolveSymbols (list2expr (nsym->ival)), RESULT_CHECK));
-*/
-
-                                               fprintf(stderr, "%s:%d: iCode: %s\n", __FILE__, __LINE__,
-                                                       strdup( printILine(iCodeFromAst(ival) )));
-
-                                               eBBlockFromiCode(iCodeFromAst(ival));
-                                               
-                                               /* assignment of symbol to temporary buffer */
-                                               ival = newNode ('=', newAst_VALUE(symbolVal (sym)),
-                                                       newAst_VALUE(symbolVal(nsym)));
-
-                                               fprintf(stderr, "%s:%d: iCode: %s\n", __FILE__, __LINE__,
-                                                       strdup( printILine(iCodeFromAst(ival) )));
-
-
-                                               eBBlockFromiCode(iCodeFromAst(ival));
-                                               
-                                               sym->ival = NULL;
-                                               ival = NULL;
-                               } else {
-#endif
-                                       addSet(&idataSymSet, copySymbol(sym));
-                                       ival = newNode ('=', newAst_VALUE(symbolVal (sym)),
-                                               decorateType (resolveSymbols (list2expr (sym->ival)), RESULT_CHECK));
-//                             }
+//                                     ival = newNode ('=', newAst_VALUE(symbolVal (sym)),
+//                                             decorateType (resolveSymbols (list2expr (sym->ival)), RESULT_CHECK));
                        }
 
                        if(ival) {
+                               setAstLineno(ival, sym->lineDef);
                                codeOutFile = statsg->oFile;
                                GcurMemmap = statsg;
                                eBBlockFromiCode (iCodeFromAst (ival));
                                sym->ival = NULL;
                        }
                }
-#endif
        }
 }
 
@@ -450,9 +429,10 @@ printIvalChar (sym_link * type, initList * ilist, pBlock *pb, char *s)
          if (!DCL_ELEM (type))
            DCL_ELEM (type) = strlen (SPEC_CVAL (val->etype).v_char) + 1;
 
-         //printChar (oFile, SPEC_CVAL (val->etype).v_char, DCL_ELEM (type));
-         //fprintf(stderr, "%s omitting call to printChar\n",__FUNCTION__);
-         pic16_addpCode2pBlock(pb,pic16_newpCodeCharP(";omitting call to printChar"));
+               for(remain=0; remain<DCL_ELEM(type); remain++)
+                       pic16_emitDB(pb, SPEC_CVAL(val->etype).v_char[ remain ]);
+                       
+//       pic16_addpCode2pBlock(pb,pic16_newpCodeCharP(";omitting call to printChar"));
 
          if ((remain = (DCL_ELEM (type) - strlen (SPEC_CVAL (val->etype).v_char) - 1)) > 0)
             {
@@ -505,6 +485,13 @@ printIvalArray (symbol * sym, sym_link * type, initList * ilist,
       werror (W_INIT_WRONG);
       return;
     }
+
+       fprintf(stderr, "%s:%d adding %s to idata\n", __FILE__, __LINE__, sym->name);
+       if(SPEC_ABSA(sym->etype))
+               addSet(&fix_idataSymSet, copySymbol(sym));
+       else
+               addSet(&rel_idataSymSet, copySymbol(sym));
+
     if (printIvalChar (type,
                       (ilist->type == INIT_DEEP ? ilist->init.deep : ilist),
                       pb, SPEC_CVAL (sym->etype).v_char))
@@ -551,6 +538,8 @@ printIvalArray (symbol * sym, sym_link * type, initList * ilist,
   return;
 }
 
+
+
 /*-----------------------------------------------------------------*/
 /* printIval - generates code for initial value                    */
 /*-----------------------------------------------------------------*/
@@ -560,11 +549,16 @@ printIval (symbol * sym, sym_link * type, initList * ilist, pBlock *pb)
   if (!ilist || !pb)
     return;
 
+//     fprintf(stderr, "%s:%d generating init for %s\n", __FILE__, __LINE__, sym->name);
+
   /* if structure then    */
   if (IS_STRUCT (type))
     {
       //fprintf(stderr,"%s struct\n",__FUNCTION__);
       //printIvalStruct (sym, type, ilist, oFile);
+       fprintf(stderr, "%s:%d: PIC16 port error: structure initialisation is not implemented yet.\n",
+               __FILE__, __LINE__);
+       abort();
       return;
     }
 
@@ -573,6 +567,9 @@ printIval (symbol * sym, sym_link * type, initList * ilist, pBlock *pb)
     {
       //fprintf(stderr,"%s pointer\n",__FUNCTION__);
       //printIvalPtr (sym, type, ilist, oFile);
+       fprintf(stderr, "%s:%d: PIC16 port error: pointer initialisation is not implemented yet.\n",
+               __FILE__, __LINE__);
+       abort();
       return;
     }
 
@@ -593,7 +590,12 @@ printIval (symbol * sym, sym_link * type, initList * ilist, pBlock *pb)
     }
 }
 
-extern void pic16_pCodeConstString(char *name, char *value);
+int PIC16_IS_CONFIG_ADDRESS(int address)
+{
+
+  return (address >= pic16->cwInfo.confAddrStart && address <= pic16->cwInfo.confAddrEnd);
+}
+
 /*-----------------------------------------------------------------*/
 /* emitStaticSeg - emitcode for the static segment                 */
 /*-----------------------------------------------------------------*/
@@ -617,6 +619,14 @@ pic16emitStaticSeg (memmap * map)
        fprintf(stderr, "\n");
 #endif
 
+        if(SPEC_ABSA(sym->etype)
+             && (SPEC_ABSA(sym->etype) && PIC16_IS_CONFIG_ADDRESS(SPEC_ADDR(sym->etype)))) {
+             
+               pic16_assignConfigWordValue(SPEC_ADDR (sym->etype),
+                       (int) floatFromVal(list2val( sym->ival )));
+
+               continue;
+        }
 
        /* if it is "extern" then do nothing */
        if (IS_EXTERN (sym->etype)) {
@@ -631,11 +641,8 @@ pic16emitStaticSeg (memmap * map)
        /* if it is not static add it to the public
           table */
        if (!IS_STATIC (sym->etype)) {
-
                /* do not emit if it is a config word declaration */
-               if(!SPEC_ABSA(sym->etype)
-                       || (SPEC_ABSA(sym->etype) && !PIC16_IS_CONFIG_ADDRESS(SPEC_ADDR(sym->etype))))
-                               checkAddSym(&publics, sym);
+               checkAddSym(&publics, sym);
        }
 
 #if 0
@@ -675,11 +682,56 @@ pic16emitStaticSeg (memmap * map)
          fprintf (code->oFile, "%s\t=\t0x%04x\n",
                   sym->rname,
                   SPEC_ADDR (sym->etype));
-       }
-      else
-       {
-               fprintf(stderr, "%s:%d spec_absa is false for symbol: %s\n",
-                       __FILE__, __LINE__, sym->name);
+
+         /* if it has an initial value */
+         if (sym->ival)
+           {
+             pBlock *pb;
+              symbol *asym;
+              absSym *abSym;
+              pCode *pcf;
+              
+             noAlloc++;
+             resolveIvalSym (sym->ival, sym->type);
+             asym = newSymbol(sym->rname, 0);
+             abSym = Safe_calloc(1, sizeof(absSym));
+             abSym->name = Safe_strdup( sym->rname );
+             abSym->address = SPEC_ADDR( sym->etype );
+             addSet(&absSymSet, abSym);
+             
+             pb = pic16_newpCodeChain(NULL, 'A',pic16_newpCodeCharP("; Starting pCode block for absolute Ival"));
+             pic16_addpBlock(pb);
+
+             pcf = pic16_newpCodeFunction(moduleName, asym->name);
+             PCF(pcf)->absblock = 1;
+             
+             pic16_addpCode2pBlock(pb,pcf);
+             pic16_addpCode2pBlock(pb,pic16_newpCodeLabel(sym->rname,-1));
+             printIval (sym, sym->type, sym->ival, pb);
+              pic16_flushDB(pb);
+
+             pic16_addpCode2pBlock(pb, pic16_newpCodeFunction(NULL, NULL));
+             noAlloc--;
+           }
+         else
+           {
+
+             /* allocate space */
+             fprintf (code->oFile, "%s:\n", sym->rname);
+             /* special case for character strings */
+             if (IS_ARRAY (sym->type) && IS_CHAR (sym->type->next) &&
+                 SPEC_CVAL (sym->etype).v_char)
+               pic16_pCodeConstString(sym->rname , SPEC_CVAL (sym->etype).v_char);
+               /*printChar (code->oFile,
+                          SPEC_CVAL (sym->etype).v_char,
+                          strlen (SPEC_CVAL (sym->etype).v_char) + 1);*/
+             else
+               fprintf (code->oFile, "\t.ds\t0x%04x\n", (unsigned int) getSize (sym->type) & 0xffff);
+           }
+  
+       } else {
+//             fprintf(stderr, "%s:%d spec_absa is false for symbol: %s\n",
+//                     __FILE__, __LINE__, sym->name);
 
          if (options.debug || sym->level == 0)
            fprintf (code->oFile, " == .\n");
@@ -723,8 +775,20 @@ pic16emitStaticSeg (memmap * map)
 
 
 /*-----------------------------------------------------------------*/
-/* emitMaps - emits the code for the data portion the code         */
+/* pic16_emitConfigRegs - emits the configuration registers              */
 /*-----------------------------------------------------------------*/
+void pic16_emitConfigRegs(FILE *of)
+{
+  int i;
+
+       for(i=0;i<pic16->cwInfo.confAddrEnd-pic16->cwInfo.confAddrStart;i++)
+               if(pic16->cwInfo.crInfo[i].emit)        //mask != -1)
+                       fprintf (of, "\t__config 0x%x, 0x%hhx\n",
+                               pic16->cwInfo.confAddrStart+i,
+                               pic16->cwInfo.crInfo[i].value);
+}
+
+
 static void
 pic16emitMaps ()
 {
@@ -772,13 +836,13 @@ pic16createInterruptVect (FILE * vFile)
 
 
 /*-----------------------------------------------------------------*/
-/* initialComments - puts in some initial comments                 */
+/* pic16initialComments - puts in some initial comments            */
 /*-----------------------------------------------------------------*/
 static void
 pic16initialComments (FILE * afile)
 {
   initialComments (afile);
-  fprintf (afile, "; PIC port for the 16-bit core\n");
+  fprintf (afile, "; PIC16 port for the Microchip 16-bit core micros\n");
   fprintf (afile, iComments2);
 
 }
@@ -961,7 +1025,7 @@ pic16glue ()
                pic16_addpBlock(pb);
 
                /* entry point @ start of CSEG */
-               pic16_addpCode2pBlock(pb,pic16_newpCodeLabel("__sdcc_program_startup\t;VR1",-1));
+               pic16_addpCode2pBlock(pb,pic16_newpCodeLabel("__sdcc_program_startup",-1));
 
                if(initsfpnt) {
                        pic16_addpCode2pBlock(pb, pic16_newpCode(POC_LFSR,
@@ -1045,7 +1109,6 @@ pic16glue ()
        pic16initialComments (asmFile);
     
        /* print module name */
-//     fprintf (asmFile, ";\t.module %s\n", moduleName);
        fprintf(asmFile, "#FILE\t\"%s\"\n", fullSrcFileName);
     
        /* Let the port generate any global directives, etc. */
@@ -1072,11 +1135,15 @@ pic16glue ()
        pic16_AnalyzeBanking();
        pic16_writeUsedRegs(asmFile);
 
+#if 0
        /* create the overlay segments */
        fprintf (asmFile, "%s", iComments2);
        fprintf (asmFile, "; overlayable items in internal ram \n");
        fprintf (asmFile, "%s", iComments2);    
        copyFile (asmFile, ovrFile);
+#endif
+
+#if 0
 
        /* create the stack segment MOF */
        if (mainf && IFFUNC_HASBODY(mainf->type)) {
@@ -1086,6 +1153,7 @@ pic16glue ()
                fprintf (asmFile, ";\t.area\tSSEG\t(DATA)\n"
                        ";__start__stack:\n;\t.ds\t1\n\n");
        }
+#endif
 
 #if 0
        /* no indirect data in pic */
@@ -1118,12 +1186,13 @@ pic16glue ()
        copyFile (asmFile, xdata->oFile);
 #endif
 
+#if 0
        /* copy the bit segment */
        fprintf (asmFile, "%s", iComments2);
        fprintf (asmFile, "; bit data\n");
        fprintf (asmFile, "%s", iComments2);
        copyFile (asmFile, bit->oFile);
-
+#endif
 
        /* copy the interrupt vector table */
        if(mainf && IFFUNC_HASBODY(mainf->type)) {
@@ -1138,19 +1207,6 @@ pic16glue ()
        fprintf (asmFile, "; global & static initialisations\n");
        fprintf (asmFile, "%s", iComments2);
     
-#if 0
-       /* FIXME 8051 Legacy -- VR */
-       /* Everywhere we generate a reference to the static_name area, 
-       * (which is currently only here), we immediately follow it with a 
-       * definition of the post_static_name area. This guarantees that
-       * the post_static_name area will immediately follow the static_name
-       * area.
-       */
-       fprintf (asmFile, ";\t.area %s\n", port->mem.static_name); /* MOF */
-       fprintf (asmFile, ";\t.area %s\n", port->mem.post_static_name);
-       fprintf (asmFile, ";\t.area %s\n", port->mem.static_name);
-#endif
-
 #if 0
        /* copy over code */
        fprintf (asmFile, "%s", iComments2);
@@ -1158,7 +1214,8 @@ pic16glue ()
        fprintf (asmFile, "%s", iComments2);
 #endif
 
-       fprintf(asmFile, "; A code from now on!\n");
+       if(pic16_debug_verbose)
+               fprintf(asmFile, "; A code from now on!\n");
        pic16_copypCode(asmFile, 'A');
 
 
@@ -1186,21 +1243,21 @@ pic16glue ()
        fprintf(asmFile, "; I code from now on!\n");
        pic16_copypCode(asmFile, 'I');
 
-//     if(pic16_debug_verbose)
+       if(pic16_debug_verbose)
                fprintf(asmFile, "; dbName from now on!\n");
        pic16_copypCode(asmFile, statsg->dbName);
 
 
        if (port->general.glue_up_main && mainf && IFFUNC_HASBODY(mainf->type)) {
-               fprintf (asmFile,"\tgoto\t__sdcc_program_startup\t;VR2\n");
+               fprintf (asmFile,"\tgoto\t__sdcc_program_startup\n");
        }
        
 
-//     if(pic16_debug_verbose)
+       if(pic16_debug_verbose)
                fprintf(asmFile, "; X code from now on!\n");
        pic16_copypCode(asmFile, 'X');
 
-//     if(pic16_debug_verbose)
+       if(pic16_debug_verbose)
                fprintf(asmFile, "; M code from now on!\n");
        pic16_copypCode(asmFile, 'M');
 
index 93be098cf5a11a2fbfec52242efc3fcfce248023..3e4f9c7df8fd2f454fefd138059dc9eee5bc51e4 100644 (file)
@@ -90,18 +90,15 @@ extern set *libFilesSet;
 /* for an unknowned reason. - EEP */
 void pic16_emitDebuggerSymbol (char *);
  
+extern regs* newReg(short type, short pc_type, int rIdx, char *name, int size, int alias, operand *refop);
+extern void pic16_emitConfigRegs(FILE *of);
+
+
+
 
 static void
 _pic16_init (void)
 {
-#if 0
-  char pic16incDir[512];
-  char pic16libDir[512];
-  set *pic16incDirsSet;
-  set *pic16libDirsSet;
-  char devlib[512];
-#endif
-
        asm_addTree (&asm_asxxxx_mapping);
        pic16_pCodeInitRegisters();
        maxInterrupts = 2;
@@ -113,31 +110,6 @@ _pic16_init (void)
        pic16_options.omit_ivt = 0;
        pic16_options.leave_reset = 0;
        pic16_options.stack_model = 0;                  /* 0 for 'small', 1 for 'large' */
-
-
-#if 0
-       setMainValue("mcu", pic16->name[2] );
-       addSet(&preArgvSet, Safe_strdup("-D{mcu}"));
-
-       sprintf(pic16incDir, "%s/pic16", INCLUDE_DIR_SUFFIX);
-       sprintf(pic16libDir, "%s/pic16", LIB_DIR_SUFFIX);
-
-       if(!options.nostdinc) {
-               /* setup pic16 include directory */
-               pic16incDirsSet = appendStrSet(dataDirsSet, NULL, pic16incDir);
-               mergeSets(&includeDirsSet, pic16incDirsSet);
-       }
-       
-       if(!options.nostdlib) {
-               /* setup pic16 library directory */
-               pic16libDirsSet = appendStrSet(dataDirsSet, NULL, pic16libDir);
-               mergeSets(&libDirsSet, pic16libDirsSet);
-       
-               /* now add the library for the device */
-               sprintf(devlib, "%s.lib", pic16->name[2]);
-               addSet(&libFilesSet, Safe_strdup(devlib));
-       }
-#endif
 }
 
 static void
@@ -226,6 +198,11 @@ _process_pragma(const char *sz)
 #define STACK_MODEL    "--pstack-model="
 #define OPT_BANKSEL    "--obanksel="
 
+#define ALT_ASM                "--asm="
+#define ALT_LINK       "--link="
+
+char *alt_asm=NULL;
+char *alt_link=NULL;
 
 extern int pic16_debug_verbose;
 extern int pic16_ralloc_debug;
@@ -245,6 +222,9 @@ OPTION pic16_optionsTable[]= {
                
        { 0,    REP_UDATA,      NULL,   "Place udata variables at another section: udata_acs, udata_ovr, udata_shr"},
 
+       { 0,    ALT_ASM,        NULL,   "Use alternative assembler"},
+       { 0,    ALT_LINK,       NULL,   "Use alternative linker"},
+
        { 0,    NULL,           NULL,   NULL}
        };
 
@@ -294,25 +274,33 @@ _pic16_parseOptions (int *pargc, char **argv, int *i)
                return TRUE;
        }
        
+       if(ISOPT(ALT_ASM)) {
+               alt_asm = Safe_strdup(getStringArg(ALT_ASM, argv, i, *pargc));
+               return TRUE;
+       }
+       
+       if(ISOPT(ALT_LINK)) {
+               alt_link = Safe_strdup(getStringArg(ALT_LINK, argv, i, *pargc));
+               return TRUE;
+       }
+
+
   return FALSE;
 }
 
 static void _pic16_initPaths(void)
 {
-#if 1
   char pic16incDir[512];
   char pic16libDir[512];
   set *pic16incDirsSet;
   set *pic16libDirsSet;
   char devlib[512];
-#endif
 
-#if 1
        setMainValue("mcu", pic16->name[2] );
        addSet(&preArgvSet, Safe_strdup("-D{mcu}"));
 
-       sprintf(pic16incDir, "%s/pic16", INCLUDE_DIR_SUFFIX);
-       sprintf(pic16libDir, "%s/pic16", LIB_DIR_SUFFIX);
+       sprintf(pic16incDir, "%s%cpic16", INCLUDE_DIR_SUFFIX, DIR_SEPARATOR_CHAR);
+       sprintf(pic16libDir, "%s%cpic16", LIB_DIR_SUFFIX, DIR_SEPARATOR_CHAR);
 
        if(!options.nostdinc) {
                /* setup pic16 include directory */
@@ -329,50 +317,32 @@ static void _pic16_initPaths(void)
                sprintf(devlib, "%s.lib", pic16->name[2]);
                addSet(&libFilesSet, Safe_strdup(devlib));
        }
-#endif
 }
 
 
+/* forward declarations */
+extern const char *pic16_linkCmd[];
+extern const char *pic16_asmCmd[];
+
 static void
 _pic16_finaliseOptions (void)
 {
-#if 0
-  char pic16incDir[512];
-  char pic16libDir[512];
-  set *pic16incDirsSet;
-  set *pic16libDirsSet;
-  char devlib[512];
-#endif
        port->mem.default_local_map = data;
        port->mem.default_globl_map = data;
 
+       /* peepholes are disabled for the time being */
+       options.nopeep = 1;
+
        options.all_callee_saves = 1;           // always callee saves
 //     options.float_rent = 1;
 //     options.intlong_rent = 1;
        
-#if 0
-       setMainValue("mcu", pic16->name[2] );
-       addSet(&preArgvSet, Safe_strdup("-D{mcu}"));
-
-       sprintf(pic16incDir, "%s/pic16", INCLUDE_DIR_SUFFIX);
-       sprintf(pic16libDir, "%s/pic16", LIB_DIR_SUFFIX);
 
-       if(!options.nostdinc) {
-               /* setup pic16 include directory */
-               pic16incDirsSet = appendStrSet(dataDirsSet, NULL, pic16incDir);
-               mergeSets(&includeDirsSet, pic16incDirsSet);
-       }
+       if(alt_asm && strlen(alt_asm))
+               pic16_asmCmd[0] = alt_asm;
        
-       if(!options.nostdlib) {
-               /* setup pic16 library directory */
-               pic16libDirsSet = appendStrSet(dataDirsSet, NULL, pic16libDir);
-               mergeSets(&libDirsSet, pic16libDirsSet);
-       
-               /* now add the library for the device */
-               sprintf(devlib, "%s.lib", pic16->name[2]);
-               addSet(&libFilesSet, Safe_strdup(devlib));
-       }
-#endif
+       if(alt_link && strlen(alt_link))
+               pic16_linkCmd[0] = alt_link;
 }
 
 
@@ -439,27 +409,6 @@ _pic16_setDefaultOptions (void)
 {
        /* initialize to defaults section locations, names and addresses */
        pic16_sectioninfo.at_udata      = "udata";
-       pic16_sectioninfo.at_udataacs   = "udata_acs";
-       pic16_sectioninfo.at_udataovr   = "udata_ovr";
-       pic16_sectioninfo.at_udatashr   = "udata_shr";
-
-       /* initialize to nothing, so let linker decide about their names */
-       pic16_sectioninfo.name_code     =
-       pic16_sectioninfo.name_idata    =
-       pic16_sectioninfo.name_udata    =
-       pic16_sectioninfo.name_udataacs =
-       pic16_sectioninfo.name_udataovr =
-       pic16_sectioninfo.name_udatashr = "";
-
-       /* initialize to -1, so let linker decide about their address */
-       pic16_sectioninfo.addr_code     =
-       pic16_sectioninfo.addr_idata    =
-       pic16_sectioninfo.addr_udata    =
-       pic16_sectioninfo.addr_udataacs =
-       pic16_sectioninfo.addr_udataovr =
-       pic16_sectioninfo.addr_udatashr = -1;
-
-
 
        /* set pic16 port options to defaults */
        pic16_options.no_banksel = 0;
@@ -502,6 +451,8 @@ _pic16_genAssemblerPreamble (FILE * of)
        fprintf (of, "\tlist\tp=%s\n",&name[1]);
 
        if(!pic16_options.omit_configw) {
+               pic16_emitConfigRegs(of);
+#if 0          
                fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x300001, pic16_getConfigWord(0x300001));
                fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x300002, pic16_getConfigWord(0x300002));
                fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x300003, pic16_getConfigWord(0x300003));
@@ -513,6 +464,7 @@ _pic16_genAssemblerPreamble (FILE * of)
                fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x30000b, pic16_getConfigWord(0x30000b));
                fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x30000c, pic16_getConfigWord(0x30000c));
                fprintf (of, "\t__config 0x%x,0x%hhx\n", 0x30000d, pic16_getConfigWord(0x30000d));
+#endif
        }
        
   fprintf (of, "\tradix dec\n");
@@ -561,13 +513,18 @@ static bool _hasNativeMulFor (iCode *ic, sym_link *left, sym_link *right)
 {
 //     fprintf(stderr,"checking for native mult for %c (size: %d)\n", ic->op, getSize(OP_SYMBOL(IC_RESULT(ic))->type));
 
-       /* support mul for char/int {/long} */
-       if((getSize(OP_SYMBOL(IC_LEFT(ic))->type ) < 2)
+#if 1
+       /* multiplication is fixed */
+       /* support mul for char/int/long */
+       if((getSize(OP_SYMBOL(IC_LEFT(ic))->type ) <= 4)
                && (ic->op == '*'))return TRUE;
-       
+#endif
+
+#if 0
        /* support div for char/int/long */
-       if((getSize(OP_SYMBOL(IC_LEFT(ic))->type ) < 0)
+       if((getSize(OP_SYMBOL(IC_LEFT(ic))->type ) <= 0)
                && (ic->op == '/'))return TRUE;
+#endif
        
   return FALSE;
 }
@@ -644,9 +601,9 @@ oclsExpense (struct memmap *oclass)
     $l is the list of extra options that should be there somewhere...
     MUST be terminated with a NULL.
 */
-static const char *_linkCmd[] =
+const char *pic16_linkCmd[] =
 {
-  "gplink", "$3", "\"$1.o\"", "-o $1", "$l", NULL
+  "gplink", "$3", "\"$1.o\"", "-o \"$2\"", "$l", NULL
 };
 
 
@@ -657,9 +614,9 @@ static const char *_linkCmd[] =
     $l is the list of extra options that should be there somewhere...
     MUST be terminated with a NULL.
 */
-static const char *_asmCmd[] =
+const char *pic16_asmCmd[] =
 {
-  "gpasm", "$l", "$3", "-c", "\"$1.asm\"", NULL
+  "gpasm", "$l", "$3", "-c", "\"$1.asm\"", "-o \"$2\"", NULL
 
 };
 
@@ -677,7 +634,7 @@ PORT pic16_port =
     MODEL_SMALL
   },
   {
-    _asmCmd,                   /* assembler command and arguments */
+    pic16_asmCmd,              /* assembler command and arguments */
     NULL,                      /* alternate macro based form */
     "-g",                      /* arguments for debug mode */
     NULL,                      /* arguments for normal mode */
@@ -686,7 +643,7 @@ PORT pic16_port =
     NULL                       /* no do_assemble function */
   },
   {
-    _linkCmd,                  /* linker command and arguments */
+    pic16_linkCmd,             /* linker command and arguments */
     NULL,                      /* alternate macro based form */
     NULL,                      /* no do_link function */
     ".o",                      /* extension for object files */
index a49bc5ca729f22854a542fb46d2bdf8141961054..9cc78d0599364c74accc1a647a679abe3c97b7e0 100644 (file)
@@ -8,23 +8,6 @@ void x_finaliseOptions (void);
 
 typedef struct {
        char *at_udata;
-       char *at_udataacs;
-       char *at_udataovr;
-       char *at_udatashr;
-       
-       char *name_code;
-       char *name_idata;
-       char *name_udata;
-       char *name_udataacs;
-       char *name_udataovr;
-       char *name_udatashr;
-       
-       unsigned int addr_code;
-       unsigned int addr_idata;
-       unsigned int addr_udata;
-       unsigned int addr_udataacs;
-       unsigned int addr_udataovr;
-       unsigned int addr_udatashr;
 } pic16_sectioninfo_t;
 
 typedef struct absSym {
index 46b61880af12e00d0387aa510ecfa2ec4fada0d1..12ca4c6c0a6106075a3939f16eeb0ccb19b0ae65 100644 (file)
@@ -3446,7 +3446,8 @@ pCode *pic16_newpCodeFunction(char *mod,char *f)
   pcf->pc.print = pCodePrintFunction;
 
   pcf->ncalled = 0;
-
+  pcf->absblock = 0;
+  
   if(mod) {
     pcf->modname = Safe_calloc(1,strlen(mod)+1);
     strcpy(pcf->modname,mod);
@@ -3845,6 +3846,35 @@ pCodeOp *pic16_newpCodeOpWild(int id, pCodeWildBlock *pcwb, pCodeOp *subtype)
   return pcop;
 }
 
+/*-----------------------------------------------------------------*/
+/*-----------------------------------------------------------------*/
+pCodeOp *pic16_newpCodeOpWild2(int id, int id2, pCodeWildBlock *pcwb, pCodeOp *subtype, pCodeOp *subtype2)
+{
+  char *s = buffer;
+  pCodeOp *pcop;
+
+
+  if(!pcwb || !subtype || !subtype2) {
+    fprintf(stderr, "Wild opcode declaration error: %s-%d\n",__FILE__,__LINE__);
+    exit(1);
+  }
+
+  pcop = Safe_calloc(1,sizeof(pCodeOpWild));
+  pcop->type = PO_WILD;
+  sprintf(s,"%%%d",id);
+  pcop->name = Safe_strdup(s);
+
+  PCOW(pcop)->id = id;
+  PCOW(pcop)->pcwb = pcwb;
+  PCOW(pcop)->subtype = subtype;
+  PCOW(pcop)->matched = NULL;
+
+  PCOW(pcop)->id2 = id2;
+  PCOW(pcop)->subtype2 = subtype2;
+
+  return pcop;
+}
+
 /*-----------------------------------------------------------------*/
 /*-----------------------------------------------------------------*/
 pCodeOp *pic16_newpCodeOpBit(char *s, int bit, int inBitSpace)
@@ -3909,7 +3939,7 @@ pCodeOp *pic16_newpCodeOpRegFromStr(char *name)
   regs *r;
 
        pcop = Safe_calloc(1,sizeof(pCodeOpReg) );
-       PCOR(pcop)->r = r = pic16_allocRegByName(name, 1);
+       PCOR(pcop)->r = r = pic16_allocRegByName(name, 1, NULL);
        PCOR(pcop)->rIdx = PCOR(pcop)->r->rIdx;
        pcop->type = PCOR(pcop)->r->pc_type;
        pcop->name = PCOR(pcop)->r->name;
@@ -3974,6 +4004,7 @@ typedef struct DBdata
 
 struct DBdata DBd;
 static int DBd_init = -1;
+static int DB_prev = -1;
 
 /*-----------------------------------------------------------------*/
 /*    Add "DB" directives to a pBlock                              */
@@ -3981,33 +4012,52 @@ static int DBd_init = -1;
 void pic16_emitDB(pBlock *pb, char c)
 {
   int l;
-  if (DBd_init<0) // we need to initialize
-    {
-      DBd_init = 0;
-      DBd.count = 0;
-      DBd.buffer[0] = '\0';
-    }
+  char *frm, tbuf[8];;
+  char frm_alnum[]="%c";
+  char frm_other[]="0x%02x";
 
-  l = strlen(DBd.buffer);
 
-  if (DBd.count>0)
-    {
-      sprintf(DBd.buffer+l,", 0x%02x", c & 0xff);
-    }
-  else
-    {
-      sprintf(DBd.buffer,"0x%02x", c & 0xff);
-    }
-   
-  DBd.count++;
+       if (DBd_init<0) {
+        // we need to initialize
+               DBd_init = 0;
+               DBd.count = 0;
+               DBd.buffer[0] = '\0';
+       }
 
-  if (DBd.count>=16)
-    {
-       pic16_addpCode2pBlock(pb,pic16_newpCodeAsmDir("DB", "%s", DBd.buffer));
-       DBd.count = 0;
-       DBd.buffer[0] = '\0';
-    }
-   
+       l = strlen(DBd.buffer);
+
+       if(isprint( c ))frm = frm_alnum;
+       else frm = frm_other;
+       sprintf(tbuf, frm, c & 0xff);
+       
+       if(!isprint(DB_prev)) {
+               if(isprint(c))
+                       if(DBd.count)strcat(DBd.buffer, ", \"");
+                       else strcat(DBd.buffer, "\"");
+               else if(DBd.count) strcat(DBd.buffer, ", ");
+       } else
+               if(!isprint(c))strcat(DBd.buffer, "\", ");
+       
+       strcat(DBd.buffer, tbuf);
+
+#if 0          
+       if (DBd.count>0) {
+               sprintf(DBd.buffer+l,", 0x%02x", c & 0xff);
+       } else {
+               sprintf(DBd.buffer,"0x%02x", c & 0xff);
+       }
+#endif
+
+       DBd.count++;
+       DB_prev = c;
+       
+       if (DBd.count>=16) {
+               if(isprint(c))strcat(DBd.buffer, "\"");
+               pic16_addpCode2pBlock(pb,pic16_newpCodeAsmDir("DB", "%s", DBd.buffer));
+               DBd.count = 0;
+               DBd.buffer[0] = '\0';
+               DB_prev = 0;
+       }
 }
 
 /*-----------------------------------------------------------------*/
@@ -4017,6 +4067,7 @@ void pic16_flushDB(pBlock *pb)
 {
   if (DBd.count>0)
     {
+       if(isprint(DB_prev))strcat(DBd.buffer, "\"");
        pic16_addpCode2pBlock(pb,pic16_newpCodeAsmDir("DB", "%s", DBd.buffer));
        DBd.count = 0;
        DBd.buffer[0] = '\0';
@@ -4194,7 +4245,7 @@ void pic16_printpBlock(FILE *of, pBlock *pb)
                          absSym *ab;
                                for(ab=setFirstItem(absSymSet); ab; ab=setNextItem(absSymSet)) {
                                        if(!strcmp(ab->name, PCF(pc)->fname)) {
-                                               fprintf(of, "\t0X%06X\n", ab->address);
+                                               fprintf(of, "\t0X%06X", ab->address);
                                                break;
                                        }
                                }
@@ -4483,7 +4534,7 @@ static void pCodeOpPrint(FILE *of, pCodeOp *pcop)
 /*-----------------------------------------------------------------*/
 /* pic16_pCode2str - convert a pCode instruction to string               */
 /*-----------------------------------------------------------------*/
-static char *pic16_pCode2str(char *str, size_t size, pCode *pc)
+char *pic16_pCode2str(char *str, size_t size, pCode *pc)
 {
   char *s = str;
   regs *r;
@@ -4715,28 +4766,30 @@ static void pCodePrintFunction(FILE *of, pCode *pc)
     fprintf(of,"F_%s",((pCodeFunction *)pc)->modname);
 #endif
 
-  if(PCF(pc)->fname) {
-    pBranch *exits = PCF(pc)->to;
-    int i=0;
-    fprintf(of,"%s", PCF(pc)->fname);
+  if(!PCF(pc)->absblock) {
+      if(PCF(pc)->fname) {
+      pBranch *exits = PCF(pc)->to;
+      int i=0;
+
+      fprintf(of,"%s:", PCF(pc)->fname);
     
-//     if(pic16_pcode_verbose)
-               fprintf(of, "\t;Function start");
+      if(pic16_pcode_verbose)
+        fprintf(of, "\t;Function start");
     
-    fprintf(of, "\n");
+      fprintf(of, "\n");
     
-    while(exits) {
-      i++;
-      exits = exits->next;
-    }
-    //if(i) i--;
+      while(exits) {
+        i++;
+        exits = exits->next;
+      }
+      //if(i) i--;
 
-       if(pic16_pcode_verbose)
-               fprintf(of,"; %d exit point%c\n",i, ((i==1) ? ' ':'s'));
+      if(pic16_pcode_verbose)
+        fprintf(of,"; %d exit point%c\n",i, ((i==1) ? ' ':'s'));
     
-  } else {
-       if((PCF(pc)->from && 
-               PCF(pc)->from->pc->type == PC_FUNCTION &&
+    } else {
+       if((PCF(pc)->from && 
+               PCF(pc)->from->pc->type == PC_FUNCTION &&
                PCF(PCF(pc)->from->pc)->fname) ) {
 
                if(pic16_pcode_verbose)
@@ -4746,6 +4799,7 @@ static void pCodePrintFunction(FILE *of, pCode *pc)
                        fprintf(of,"; exit point [can't find entry point]\n");
        }
        fprintf(of, "\n");
+    }
   }
 }
 /*-----------------------------------------------------------------*/
@@ -5747,8 +5801,10 @@ static void LinkFlow(pBlock *pb)
                /* continue if label is '$' which assembler knows how to parse */
                if(((PCI(pc)->pcop->type == PO_STR) && !strcmp(PCI(pc)->pcop->name, "$")))continue;
 
-               pc->print(stderr,pc);
-               fprintf(stderr, "ERROR: %s, branch instruction doesn't have label\n",__FUNCTION__);
+               if(pic16_pcode_verbose) {
+                       pc->print(stderr,pc);
+                       fprintf(stderr, "ERROR: %s, branch instruction doesn't have label\n",__FUNCTION__);
+               }
        }
        continue;
       }
@@ -5808,56 +5864,50 @@ int pic16_isPCinFlow(pCode *pc, pCode *pcflow)
 
 
 /*-----------------------------------------------------------------*/
-/* insertBankSwitch - inserts a bank switch statement in the assembly listing */
+/* insertBankSwitch - inserts a bank switch statement in the       */
+/*                    assembly listing                             */
+/*                                                                 */
+/* position == 0: insert before                                    */
+/* position == 1: insert after pc                                  */
+/* position == 2: 0 previous was a skip instruction                */
 /*-----------------------------------------------------------------*/
-static void insertBankSwitch(int position, pCode *pc, int bsr)
+static void insertBankSwitch(int position, pCode *pc)
 {
   pCode *new_pc;
   regs *reg;
 
-  if(!pc)
-    return;
-
-/*
- * if bsr == -1 then do not insert a MOVLB instruction, but rather
- * insert a BANKSEL assembler directive for the symbol used by
- * the pCode. This will allow the linker to setup the correct
- * bank at linking time
- */
-
-       if(pic16_options.no_banksel || bsr != -1) {
-//             new_pc = pic16_newpCode(POC_MOVLB, pic16_newpCodeOpLit(bsr));
+       if(!pc)
                return;
-       } else {
-               /* emit the BANKSEL [symbol] */
 
-               /* FIXME */
-               /* IMPORTANT: The following code does not check if a symbol is
-                * split in multiple banks. This should be corrected. - VR 6/6/2003 */
+       /* emit BANKSEL [symbol] */
 
-               reg = pic16_getRegFromInstruction(pc);
-               if(!reg)return;
-               new_pc = pic16_newpCodeAsmDir("BANKSEL", "%s", pic16_get_op_from_instruction(PCI(pc)));
-               
-               position = 0;           // position is always before (sanity check!)
-       }
+       reg = pic16_getRegFromInstruction(pc);
+       if(!reg)return;
+       new_pc = pic16_newpCodeAsmDir("BANKSEL", "%s", pic16_get_op_from_instruction(PCI(pc)));
+       
+//     position = 0;           // position is always before (sanity check!)
 
 #if 0
        fprintf(stderr, "%s:%d: inserting bank switch\tbank = %d\n", __FUNCTION__, __LINE__, bsr);
        pc->print(stderr, pc);
 #endif
 
-       if(position) {
-               /* insert the bank switch after this pc instruction */
-               pCode *pcnext = pic16_findNextInstruction(pc);
-               pic16_pCodeInsertAfter(pc, new_pc);
-               if(pcnext)
-                       pc = pcnext;
-
-       } else
-               pic16_pCodeInsertAfter(pc->prev, new_pc);
+       switch(position) {
+               case 1: {
+                       /* insert the bank switch after this pc instruction */
+                       pCode *pcnext = pic16_findNextInstruction(pc);
+                       pic16_pCodeInsertAfter(pc, new_pc);
+                       if(pcnext)pc = pcnext;
+               }; break;
+               
+               case 0:
+                       /* insert the bank switch BEFORE this pc instruction */
+                       pic16_pCodeInsertAfter(pc->prev, new_pc);
+                       break;
+       }
+       
 
-  /* Move the label, if there is one */
+       /* Move the label, if there is one */
 
        if(PCI(pc)->label) {
 //             fprintf(stderr, "%s:%d: moving label due to bank switch directive src= 0x%p dst= 0x%p\n",
@@ -6202,6 +6252,7 @@ void pic16_pBlockMergeLabels(pBlock *pb)
        PCI(pcnext)->label = pic16_pBranchAppend(PCI(pcnext)->label,pbr);
 #endif
       } else {
+       if(pic16_pcode_verbose)
        fprintf(stderr, "WARNING: couldn't associate label %s with an instruction\n",PCL(pc)->label);
       }
     } else if(pc->type == PC_CSOURCE) {
@@ -6340,7 +6391,8 @@ static void pic16_FixRegisterBanking(pBlock *pb)
                         * before SKIP, but we have to check if the SKIP uses BANKSEL, etc... */
                        if(!pcprev || (pcprev && !isPCI_SKIP(pcprev))) {
                                prevreg = reg;
-                               insertBankSwitch(0, pc, (pic16_options.no_banksel)?0:-1);
+                               if(!pic16_options.no_banksel)
+                                       insertBankSwitch(0, pc);
                        }
                }
 
index c41ddc58c8a9967b4326a7d2583e3c84f159c758..3f8a1da3f910647a919d61eb3ac3ce70e1396306 100644 (file)
@@ -439,6 +439,9 @@ typedef struct pCodeOpWild
                           * card will be expanded */
   pCodeOp *matched;       /* When a wild matches, we'll store a pointer to the
                           * opcode we matched */
+  int id2;               /* same as id but for second wild operand */
+  pCodeOp *subtype2;     /* Poiter to the second Operand type */
+  pCodeOp *matched2;     /* same as matched but for second wil operand */
 
 } pCodeOpWild;
 
@@ -669,6 +672,8 @@ typedef struct pCodeFunction
 
   int  ncalled;    /* Number of times function is called */
 
+  int absblock;    /* hack to emulate a block pCodes in absolute position
+                      but not inside a function */
 } pCodeFunction;
 
 
index 69aac418fd87b7ef0c7f4b904fb50c5481122211..7a2409cfcc570bf090bf4b81cef341eed579ce88 100644 (file)
@@ -25,7 +25,9 @@
 
 #include "common.h"   // Include everything in the SDCC src directory
 #include "newalloc.h"
+
 //#define PCODE_DEBUG
+
 #include "pcode.h"
 #include "pcodeflow.h"
 #include "ralloc.h"
 pCodeOp *pic16_popCopyGPR2Bit(pCodeOpReg *pc, int bitval);
 
 pCodeOp *pic16_newpCodeOpWild(int id, pCodeWildBlock *pcwb, pCodeOp *subtype);
+pCodeOp *pic16_newpCodeOpWild2(int id, int id2, pCodeWildBlock *pcwb, pCodeOp *subtype, pCodeOp *subtype2);
 pCode *pic16_newpCodeWild(int pCodeID, pCodeOp *optional_operand, pCodeOp *optional_label);
 pCode * pic16_findNextInstruction(pCode *pc);
 int pic16_getpCode(char *mnem,int dest);
 int pic16_getpCodePeepCommand(char *cmd);
 void pic16_pBlockMergeLabels(pBlock *pb);
-char *pCode2str(char *str, int size, pCode *pc);
+char *pic16_pCode2str(char *str, int size, pCode *pc);
 char *pic16_get_op( pCodeOp *pcop,char *buf,int buf_size);
 pCodeOp *pic16_popCombine2(pCodeOp *, pCodeOp *, int);
 
@@ -219,7 +222,7 @@ static char alt_mnem1a[]    = { PCP_STR, PCP_WILDVAR, 0};
 static char alt_mnem1b[]    = { PCP_STR, PCP_NUMBER, 0};
 static char alt_mnem2[]     = { PCP_STR, PCP_STR, PCP_COMMA, PCP_STR, 0};
 static char alt_mnem2a[]    = { PCP_STR, PCP_WILDVAR, PCP_COMMA, PCP_STR, 0};
-//static char alt_mnem2b[]    = { PCP_STR, PCP_WILDVAR, PCP_COMMA, PCP_WILDVAR, 0};
+static char alt_mnem2b[]    = { PCP_STR, PCP_WILDVAR, PCP_COMMA, PCP_WILDVAR, 0};
 static char alt_mnem3[]     = { PCP_STR, PCP_STR, PCP_COMMA, PCP_NUMBER, 0};
 static char alt_mnem4[]            = { PCP_STR, PCP_NUMBER, PCP_COMMA, PCP_STR, 0};    // for lfsr 0 , name
 static char alt_mnem4a[]    = { PCP_STR, PCP_NUMBER, PCP_COMMA, PCP_NUMBER, 0}; // for lfsr 0 , value
@@ -233,7 +236,7 @@ static void * cvt_altpat_mnem1a(void *pp,pCodeWildBlock *pcwb);
 static void * cvt_altpat_mnem1b(void *pp,pCodeWildBlock *pcwb);
 static void * cvt_altpat_mnem2(void *pp,pCodeWildBlock *pcwb);
 static void * cvt_altpat_mnem2a(void *pp,pCodeWildBlock *pcwb);
-//static void * cvt_altpat_mnem2b(void *pp, pCodeWildBlock *pcwb);
+static void * cvt_altpat_mnem2b(void *pp, pCodeWildBlock *pcwb);
 static void * cvt_altpat_mnem3(void *pp,pCodeWildBlock *pcwb);
 static void * cvt_altpat_mnem4(void *pp, pCodeWildBlock *pcwb);
 static void * cvt_altpat_mnem4a(void *pp, pCodeWildBlock *pcwb);
@@ -245,7 +248,7 @@ static pcPattern altArr[] = {
   {ALT_MNEM4a,       alt_mnem4a, cvt_altpat_mnem4a},
   {ALT_MNEM4,        alt_mnem4,  cvt_altpat_mnem4},
   {ALT_MNEM3,        alt_mnem3,  cvt_altpat_mnem3},
-//  {ALT_MNEM2B,       alt_mnem2b, cvt_altpat_mnem2b},
+  {ALT_MNEM2B,       alt_mnem2b, cvt_altpat_mnem2b},
   {ALT_MNEM2A,       alt_mnem2a, cvt_altpat_mnem2a},
   {ALT_MNEM2,        alt_mnem2,  cvt_altpat_mnem2},
   {ALT_MNEM1B,       alt_mnem1b, cvt_altpat_mnem1b},
@@ -634,7 +637,7 @@ static void * cvt_altpat_mnem2a(void *pp,pCodeWildBlock *pcwb)
   int dest;
 
   pCodeInstruction *pci=NULL;
-  pCodeOp *pcosubtype;
+  pCodeOp *pcosubtype, *pcosubtype2;
 
   if(!pcwb) {
     fprintf(stderr,"ERROR %s:%d - can't assemble line\n",__FILE__,__LINE__);
@@ -656,21 +659,25 @@ static void * cvt_altpat_mnem2a(void *pp,pCodeWildBlock *pcwb)
     return NULL;
   }
 
-  if(pic16Mnemonics[opcode]->isBitInst)
+  if(pic16Mnemonics[opcode]->isBitInst) {
     pcosubtype = pic16_newpCodeOp(NULL,PO_BIT);
-  else
+    pcosubtype2 = NULL;
+  } else
   if(pic16Mnemonics[opcode]->is2MemOp) {
        return NULL;
        /* support for movff instruction */
-       pcosubtype = pic16_popCombine2(
-               pic16_newpCodeOp(p[1].pct[0].tok.s, PO_GPR_REGISTER),
-               pic16_newpCodeOp(p[3].pct[0].tok.s, PO_GPR_REGISTER), 0);
-  } else
-    pcosubtype = pic16_newpCodeOp(NULL,PO_GPR_REGISTER);
+       pcosubtype = pic16_newpCodeOp(NULL, PO_GPR_REGISTER);
+       pcosubtype2 = pic16_newpCodeOp(p[3].pct[0].tok.s, PO_GPR_REGISTER);
+  } else {
+    pcosubtype = pic16_newpCodeOp(NULL,PO_GPR_REGISTER); pcosubtype2 = NULL; }
 
 
-  pci = PCI(pic16_newpCode(opcode,
+  if(!pcosubtype2)
+       pci = PCI(pic16_newpCode(opcode,
                     pic16_newpCodeOpWild(p[1].pct[1].tok.n, pcwb, pcosubtype)));
+  else
+       pci = PCI(pic16_newpCode(opcode,
+                    pic16_newpCodeOpWild2(p[1].pct[1].tok.n, p[3].pct[1].tok.n, pcwb, pcosubtype, pcosubtype2)));
 
   /* Save the index of the maximum wildcard variable */
   //if(p[1].pct[1].tok.n > sMaxWildVar)
@@ -686,7 +693,7 @@ static void * cvt_altpat_mnem2a(void *pp,pCodeWildBlock *pcwb)
 
 }
 
-#if 0
+#if 1
 /*-----------------------------------------------------------------*/
 /* cvt_altpat_mem2b - convert assembly line type to a pCode        */
 /*                    instruction with 2 wild operands             */
@@ -704,7 +711,7 @@ static void * cvt_altpat_mnem2b(void *pp,pCodeWildBlock *pcwb)
   int dest;
 
   pCodeInstruction *pci=NULL;
-  pCodeOp *pcosubtype;
+  pCodeOp *pcosubtype, *pcosubtype2;
 
   if(!pcwb) {
     fprintf(stderr,"ERROR %s:%d - can't assemble line\n",__FILE__,__LINE__);
@@ -718,6 +725,12 @@ static void * cvt_altpat_mnem2b(void *pp,pCodeWildBlock *pcwb)
          p[1].pct[1].tok.n,
          p[3].pct[1].tok.n));
 
+#if 0
+  fprintf(stderr,"altpat_mnem2b %s src: %d dst: %d\n",
+         p->pct[0].tok.s,
+         p[1].pct[1].tok.n,
+         p[3].pct[1].tok.n);
+#endif
 
   opcode = pic16_getpCode(p->pct[0].tok.s,dest);
   if(opcode < 0) {
@@ -727,13 +740,13 @@ static void * cvt_altpat_mnem2b(void *pp,pCodeWildBlock *pcwb)
 
   if(pic16Mnemonics[opcode]->is2MemOp) {
        /* support for movff instruction */
-       pcosubtype = pic16_popCombine2(
-               pic16_newpCodeOp(NULL, PO_GPR_REGISTER),
-               pic16_newpCodeOp(NULL, PO_GPR_REGISTER), 0);
-  } else pcosubtype = NULL;
+       pcosubtype = pic16_newpCodeOp(NULL, PO_GPR_REGISTER);
+       pcosubtype2 = pic16_newpCodeOp(NULL, PO_GPR_REGISTER);
+  } else pcosubtype = pcosubtype2 = NULL;
 
   pci = PCI(pic16_newpCode(opcode,
-                    pic16_newpCodeOpWild(p[1].pct[1].tok.n, pcwb, pcosubtype)));
+                    pic16_newpCodeOpWild2(p[1].pct[1].tok.n, p[3].pct[1].tok.n,
+                       pcwb, pcosubtype, pcosubtype2)));
 
   /* Save the index of the maximum wildcard variable */
   //if(p[1].pct[1].tok.n > sMaxWildVar)
@@ -1857,7 +1870,8 @@ static int pCodePeepMatchLabels(pCodePeep *peepBlock, pCode *pcs, pCode *pcd)
 static int pCodePeepMatchLine(pCodePeep *peepBlock, pCode *pcs, pCode *pcd)
 {
   int index;   // index into wild card arrays
-
+  int havematch=0;
+  
   /* one-for-one match. Here the source and destination opcodes 
    * are not wild. However, there may be a label or a wild operand */
 
@@ -1912,10 +1926,11 @@ static int pCodePeepMatchLine(pCodePeep *peepBlock, pCode *pcs, pCode *pcd)
              );
            */
 
-           return pCodeOpCompare(PCI(pcs)->pcop, peepBlock->target.wildpCodeOps[index]);
+           havematch = pCodeOpCompare(PCI(pcs)->pcop, peepBlock->target.wildpCodeOps[index]);
+//         return pCodeOpCompare(PCI(pcs)->pcop, peepBlock->target.wildpCodeOps[index]);
          }
 
-         if(PCI(pcs)->pcop) {
+         if(!havematch && PCI(pcs)->pcop) {
            char *n;
 
            switch(PCI(pcs)->pcop->type) {
@@ -1934,43 +1949,87 @@ static int pCodePeepMatchLine(pCodePeep *peepBlock, pCode *pcs, pCode *pcd)
            else {
              DFPRINTF((stderr,"first time for a variable: %d, %s\n",index,n));
              peepBlock->target.vars[index] = n;
-             return 1;
+             havematch = 1;
+//           return 1;
            }
          }
-         
-         if(PCI(pcs)->is2MemOp) {
-           char *n;
 
-           switch(PCOP(PCOR2(PCI(pcs))->pcop2)->type) {
-           case PO_GPR_TEMP:
-           case PO_FSR0:
-             //case PO_INDF0:
-               n = PCOR(PCOR2(PCI(pcs))->pcop2)->r->name;
+         /* now check whether the second operand matches */
+         if(PCI(pcd)->is2MemOp && (PCOR2(PCI(pcd)->pcop)->pcop2->type == PO_WILD)) {
+       
+               fprintf(stderr, "%s:%d %s second operand is wild\n", __FILE__, __LINE__, __FUNCTION__);
+       
+                 index = PCOW(PCI(pcd)->pcop)->id2;
+               //DFPRINTF((stderr,"destination is wild\n"));
+#ifdef DEBUG_PCODEPEEP
+               if (index > peepBlock->nops) {
+                       DFPRINTF((stderr,"%s - variables exceeded\n",__FUNCTION__));
+                       exit(1);
+               }
+#endif
 
-             break;
-           default:
-             n = PCI(pcs)->pcop->name;
-           }
+               PCOW(PCI(pcd)->pcop)->matched2 = PCOR2(PCI(pcs)->pcop)->pcop2;
+               if(!peepBlock->target.wildpCodeOps[index]) {
+                       peepBlock->target.wildpCodeOps[index] = PCOR2(PCI(pcs)->pcop)->pcop2;
+
+               //if(PCI(pcs)->pcop->type == PO_GPR_TEMP) 
+
+               } else {
+                       /*
+                       pcs->print(stderr,pcs);
+                       pcd->print(stderr,pcd);
+
+                       fprintf(stderr, "comparing operands of these instructions, result %d\n",
+                               pCodeOpCompare(PCI(pcs)->pcop, peepBlock->target.wildpCodeOps[index])
+                               );
+                       */
+
+                 return (havematch && pCodeOpCompare(PCOR2(PCI(pcs)->pcop)->pcop2,
+                               peepBlock->target.wildpCodeOps[index]));
+               }
+
+               if(PCOR2(PCI(pcs)->pcop)->pcop2) {
+                 char *n;
+
+                       switch(PCOR2(PCI(pcs)->pcop)->pcop2->type) {
+                       case PO_GPR_TEMP:
+                       case PO_FSR0:
+                     //case PO_INDF0:
+                               n = PCOR(PCOR2(PCI(pcs)->pcop)->pcop2)->r->name;
+                               break;
+                       default:
+                               n = PCOR2(PCI(pcs)->pcop)->pcop2->name;
+                       }
+
+                       if(peepBlock->target.vars[index])
+                               return  (havematch && (strcmp(peepBlock->target.vars[index],n) == 0));
+                       else {
+                               DFPRINTF((stderr,"first time for a variable: %d, %s\n",index,n));
+                               peepBlock->target.vars[index] = n;
+                               return (havematch);             //&& 1;
+                       }
+               }
+         
+       } else return (havematch);
+#if 0
+        else if (PCI(pcd)->pcop->type == PO_LITERAL) {
+         return (havematch &&
+               pCodeOpCompare(PCOR2(PCI(pcs)->pcop)->pcop2, PCOR2(PCI(pcd)->pcop)->pcop2);
 
-           if(peepBlock->target.vars[index])
-             return  (strcmp(peepBlock->target.vars[index],n) == 0);
-           else {
-             DFPRINTF((stderr,"first time for a variable: %d, %s\n",index,n));
-             peepBlock->target.vars[index] = n;
-             return 1;
-           }
-         }
+       }
+#endif
 
        } else if (PCI(pcd)->pcop->type == PO_LITERAL) {
          return pCodeOpCompare(PCI(pcs)->pcop, PCI(pcd)->pcop);
 
        }
+  }
+
        /* FIXME - need an else to check the case when the destination 
         * isn't a wild card */
       } else
        /* The pcd has no operand. Lines match if pcs has no operand either*/
        return (PCI(pcs)->pcop == NULL);
-    }
   }
 
   /* Compare a wild instruction to a regular one. */
@@ -2383,7 +2442,7 @@ int pic16_pCodePeepMatchRule(pCode *pc)
            }
          }
 
-         pCode2str(&buf[2], 254, pc);
+         pic16_pCode2str(&buf[2], 254, pc);
          pic16_pCodeInsertAfter(pcprev, pic16_newpCodeCharP(buf));
          pcprev = pcprev->next;
          pc = pc->next;
@@ -2397,6 +2456,8 @@ int pic16_pCodePeepMatchRule(pCode *pc)
       if(pcin)
        pCodeDeleteChain(pc,pcin);
 
+       fprintf(stderr, "%s:%d rule matched\n", __FILE__, __LINE__);
+
       /* Generate the replacement code */
       pc = pcprev;
       pcr = peepBlock->replace.pb->pcHead;  // This is the replacement code
@@ -2411,6 +2472,7 @@ int pic16_pCodePeepMatchRule(pCode *pc)
             * Is it wild? */
            if(PCI(pcr)->pcop->type == PO_WILD) {
              int index = PCOW(PCI(pcr)->pcop)->id;
+               fprintf(stderr, "%s:%d replacing index= %d\n", __FUNCTION__, __LINE__, index);
              //DFPRINTF((stderr,"copying wildopcode\n"));
              if(peepBlock->target.wildpCodeOps[index])
                pcop = pic16_pCodeOpCopy(peepBlock->target.wildpCodeOps[index]);
@@ -2419,6 +2481,26 @@ int pic16_pCodePeepMatchRule(pCode *pc)
            } else
              pcop = pic16_pCodeOpCopy(PCI(pcr)->pcop);
          }
+
+         if(PCI(pcr)->is2MemOp && PCOR2(PCI(pcr)->pcop)->pcop2) {
+           /* The replacing instruction has also a second operand.
+            * Is it wild? */
+               fprintf(stderr, "%s:%d pcop2= %p\n", __FILE__, __LINE__, PCOR2(PCI(pcr)->pcop)->pcop2);
+           if(PCOR2(PCI(pcr)->pcop)->pcop2->type == PO_WILD) {
+             int index = PCOW(PCI(pcr)->pcop)->id2;
+               fprintf(stderr, "%s:%d replacing index= %d\n", __FUNCTION__, __LINE__, index);
+             //DFPRINTF((stderr,"copying wildopcode\n"));
+             if(peepBlock->target.wildpCodeOps[index])
+               pcop = pic16_popCombine2(pic16_pCodeOpCopy(pcop),
+                       pic16_pCodeOpCopy(peepBlock->target.wildpCodeOps[index]), 0);
+             else
+               DFPRINTF((stderr,"error, wildopcode in replace but not source?\n"));
+           } else
+             pcop = pic16_popCombine2(pic16_pCodeOpCopy(pcop),
+               pic16_pCodeOpCopy(PCI(pcr)->pcop), 0);
+             
+         }
+         
          //DFPRINTF((stderr,"inserting pCode\n"));
          pic16_pCodeInsertAfter(pc, pic16_newpCode(PCI(pcr)->op,pcop));
        } else if (pcr->type == PC_WILD) {
index 52932b0ce7887d263c12b9b1e41af1d29c0f2263..b283377805b123adaf9a30e055f873b1bc971b66 100644 (file)
@@ -48,7 +48,6 @@
 
 regs *pic16_typeRegWithIdx (int idx, int type, int fixed);
 extern void genpic16Code (iCode *);
-extern void pic16_assignConfigWordValue(int address, int value);
 
 /* Global data */
 static struct
@@ -373,8 +372,8 @@ regs* newReg(short type, short pc_type, int rIdx, char *name, int size, int alia
                dReg->accessBank = 0;
        }
 
-//     fprintf(stderr,"newReg: %s, rIdx = 0x%02x\taccess= %d\n",dReg->name,rIdx, dReg->accessBank);
-       
+//     fprintf(stderr,"newReg: %s, rIdx = 0x%02x\taccess= %d\tregop= %p\n",dReg->name,rIdx, dReg->accessBank, refop);
+
        dReg->size = size;
        dReg->alias = alias;
        dReg->reg_alias = NULL;
@@ -557,11 +556,6 @@ pic16_dirregWithName (char *name)
   return NULL; // name wasn't found in the hash table
 }
 
-int PIC16_IS_CONFIG_ADDRESS(int address)
-{
-
-  return address >= 0x300000 && address <= 0x300000d;
-}
 
 /*-----------------------------------------------------------------*/
 /* pic16_allocDirReg - allocates register of given type                  */
@@ -653,14 +647,16 @@ pic16_allocDirReg (operand *op )
                 * a new one and put it in the hash table AND in the 
                 * dynDirectRegNames set */
                if(IN_CODESPACE( SPEC_OCLS( OP_SYM_ETYPE(op)))) {
-                       if(pic16_debug_verbose)
-                               fprintf(stderr, "%s:%d symbol %s in codespace\n", __FILE__, __LINE__,
-                                       OP_SYMBOL(op)->name);
+
+//                     if(pic16_debug_verbose)
+//                             fprintf(stderr, "%s:%d symbol %s in codespace\n", __FILE__, __LINE__,
+//                                     OP_SYMBOL(op)->name);
+
                        debugLog("%s:%d sym: %s in codespace\n", __FUNCTION__, __LINE__, OP_SYMBOL(op)->name);
                  return NULL;
                }
 
-               if(!PIC16_IS_CONFIG_ADDRESS(address)) {
+               if(1) { //!PIC16_IS_CONFIG_ADDRESS(address)) {
 //                     fprintf(stderr,"%s:allocating new reg %s\n",__FUNCTION__, name);
 
                        /* this is an error, why added? -- VR */
@@ -736,7 +732,7 @@ pic16_allocDirReg (operand *op )
 /* pic16_allocRegByName - allocates register of given type                  */
 /*-----------------------------------------------------------------*/
 regs *
-pic16_allocRegByName (char *name, int size)
+pic16_allocRegByName (char *name, int size, operand *op)
 {
 
   regs *reg;
@@ -754,8 +750,8 @@ pic16_allocRegByName (char *name, int size)
     /* Register wasn't found in hash, so let's create
      * a new one and put it in the hash table AND in the 
      * dynDirectRegNames set */
-    //fprintf (stderr,"%s symbol name %s\n", __FUNCTION__,name);
-    reg = newReg(REG_GPR, PO_DIR, rDirectIdx++, name,size,0, NULL);
+       fprintf (stderr,"%s:%d symbol name %s\tregop= %p\n", __FUNCTION__, __LINE__, name, op);
+    reg = newReg(REG_GPR, PO_DIR, rDirectIdx++, name,size,0, op);
 
     debugLog ("%d  -- added %s to hash, size = %d\n", __LINE__, name,reg->size);
        //fprintf(stderr, "  -- added %s to hash, size = %d\n", name,reg->size);
@@ -978,7 +974,8 @@ extern void pic16_groupRegistersInSection(set *regset);
 
 extern void pic16_dump_equates(FILE *of, set *equs);
 //extern void pic16_dump_map(void);
-extern void pic16_dump_section(FILE *of, set *section, int fix);
+extern void pic16_dump_usection(FILE *of, set *section, int fix);
+extern void pic16_dump_isection(FILE *of, set *section, int fix);
 extern void pic16_dump_int_registers(FILE *of, set *section);
 extern void pic16_dump_idata(FILE *of, set *idataSymSet);
 
@@ -1136,14 +1133,17 @@ void pic16_writeUsedRegs(FILE *of)
        pic16_dump_equates(of, pic16_equ_data);
 
        /* dump initialised data */
-       pic16_dump_idata(of, idataSymSet);
+       pic16_dump_isection(of, rel_idataSymSet, 0);
+       pic16_dump_isection(of, fix_idataSymSet, 1);
+
+//     pic16_dump_idata(of, idataSymSet);
 
        /* dump internal registers */
        pic16_dump_int_registers(of, pic16_int_regs);
        
        /* dump other variables */
-       pic16_dump_section(of, pic16_rel_udata, 0);
-       pic16_dump_section(of, pic16_fix_udata, 1);
+       pic16_dump_usection(of, pic16_rel_udata, 0);
+       pic16_dump_usection(of, pic16_fix_udata, 1);
        
 }
 
@@ -2114,6 +2114,15 @@ serialRegAssign (eBBlock ** ebbs, int count)
 
          debugLog ("  op: %s\n", decodeOp (ic->op));
 
+               if(IC_RESULT(ic) && !IS_ITEMP( IC_RESULT(ic)))
+                       pic16_allocDirReg(IC_RESULT(ic));
+
+               if(IC_LEFT(ic) && !IS_ITEMP( IC_LEFT(ic)))
+                       pic16_allocDirReg(IC_LEFT(ic));
+
+               if(IC_RIGHT(ic) && !IS_ITEMP( IC_RIGHT(ic)))
+                       pic16_allocDirReg(IC_RIGHT(ic));
+
          /* if this is an ipop that means some live
             range will have to be assigned again */
          if (ic->op == IPOP)
@@ -2786,6 +2795,7 @@ packRegsForAssign (iCode * ic, eBBlock * ebp)
 
 //     fprintf(stderr, "%s:%d symbol = %s\n", __FILE__, __LINE__, OP_SYMBOL( IC_RESULT(ic))->name);
 
+#if 0
   /* if this is at an absolute address, then get the address. */
   if (SPEC_ABSA ( OP_SYM_ETYPE(IC_RESULT(ic))) ) {
     if(PIC16_IS_CONFIG_ADDRESS( SPEC_ADDR ( OP_SYM_ETYPE(IC_RESULT(ic))))) {
@@ -2793,8 +2803,10 @@ packRegsForAssign (iCode * ic, eBBlock * ebp)
       if(IS_VALOP(IC_RIGHT(ic))) {
        debugLog ("  setting config word to %x\n", 
                  (int) floatFromVal (IC_RIGHT(ic)->operand.valOperand));
-//     fprintf(stderr, "  setting config word to %x\n", 
-//               (int) floatFromVal (IC_RIGHT(ic)->operand.valOperand));
+
+       fprintf(stderr, "%s:%d  setting config word to %x\n", __FILE__, __LINE__, 
+                 (int) floatFromVal (IC_RIGHT(ic)->operand.valOperand));
+
        pic16_assignConfigWordValue(  SPEC_ADDR ( OP_SYM_ETYPE(IC_RESULT(ic))),
                                (int) floatFromVal (IC_RIGHT(ic)->operand.valOperand));
       }
@@ -2812,6 +2824,7 @@ packRegsForAssign (iCode * ic, eBBlock * ebp)
 
     }
   }
+#endif
        debugLog(" %d - actuall processing\n", __LINE__ );
 
   if (!IS_ITEMP (IC_RESULT (ic))) {
@@ -2819,12 +2832,6 @@ packRegsForAssign (iCode * ic, eBBlock * ebp)
     debugLog ("  %d - result is not temp\n", __LINE__);
   }
 
-#if 0
-  if (IC_LEFT (ic) && !IS_ITEMP (IC_LEFT (ic))) {
-    debugLog ("  %d - left is not temp, allocating\n", __LINE__);
-    pic16_allocDirReg(IC_LEFT (ic));
-  }
-#endif
 
 /* See BUGLOG0001 - VR */
 #if 1
@@ -2876,21 +2883,6 @@ packRegsForAssign (iCode * ic, eBBlock * ebp)
 
        debugLog("%d\tSearching for iTempNN\n", __LINE__);
 
-#if 0
-       if(IS_TRUE_SYMOP( IC_RESULT(dic))) {
-               debugLog("%d - dic result is a TRUE_SYMOP\n", __LINE__);
-               debugAopGet(" result is ", IC_RESULT(dic));
-       }
-       if(IS_TRUE_SYMOP( IC_LEFT(dic))) {
-               debugLog("%d - dic left is a SYMOP\n", __LINE__);
-               debugAopGet("   left is ", IC_LEFT(dic));
-       }
-       if(IS_TRUE_SYMOP( IC_RIGHT(dic))) {
-               debugLog("%d - dic right is a SYMOP\n", __LINE__);
-               debugAopGet("  right is ", IC_RIGHT(dic));
-       }
-#endif
-
       if (IS_TRUE_SYMOP (IC_RESULT (dic)) &&
          IS_OP_VOLATILE (IC_RESULT (dic)))
        {
@@ -2899,27 +2891,6 @@ packRegsForAssign (iCode * ic, eBBlock * ebp)
          break;
        }
 
-#if 0
-      if (IS_TRUE_SYMOP( IC_RIGHT (dic)) &&
-               IS_OP_VOLATILE (IC_RIGHT(dic)))
-       {
-         debugLog ("  %d - dic right is VOLATILE\n", __LINE__);
-         dic = NULL;
-         break;
-       }
-#endif
-
-#if 0
-      if (IS_TRUE_SYMOP( IC_LEFT (dic)) &&
-               IS_OP_VOLATILE (IC_LEFT(dic)))
-       {
-         debugLog ("  %d - dic left is VOLATILE\n", __LINE__);
-         dic = NULL;
-         break;
-       }
-#endif
-
-
 #if 1
       if( IS_SYMOP( IC_RESULT(dic)) &&
        IS_BITFIELD( OP_SYMBOL(IC_RESULT(dic))->etype ) ) {
index aecec160441e8903e852acca9c9e59f23e3da933..730d261ed54013f1a0123dea23974fc83d004662 100644 (file)
@@ -117,12 +117,10 @@ regs *pic16_findFreeReg(short type);
 regs *pic16_allocWithIdx (int idx);
 
 regs *pic16_allocDirReg (operand *op );
-regs *pic16_allocRegByName (char *name, int size );
+regs *pic16_allocRegByName (char *name, int size, operand *op);
 
 regs* newReg(short type, short pc_type, int rIdx, char *name, int size, int alias, operand *refop);
 
-int PIC16_IS_CONFIG_ADDRESS(int address);
-
 /* Define register address that are constant across PIC16 family */
 #define IDX_TMR0    0xfd6
 #define IDX_PCL     0xff9