
; HI-TECH Software PICC Assembler header file.
; Definitions based on C header file: pic1677x.h.

; NOTE: PICC assembler option -P is required to preprocess assembler sources. 

; Special Function Register definitions
TMR0		equ	001h
PCL		equ	002h
STATUS		equ	003h
FSR		equ	004h
PORTA		equ	005h
PORTB		equ	006h
PORTC		equ	007h
PORTD		equ	008h
PORTE		equ	009h
PCLATH		equ	00Ah
INTCON		equ	00Bh
PIR1		equ	00Ch
PIR2		equ	00Dh
TMR1L		equ	00Eh
TMR1H		equ	00Fh
T1CON		equ	010h
TMR2		equ	011h
T2CON		equ	012h
SSPBUF		equ	013h
SSPCON		equ	014h
CCPR1L		equ	015h
CCPR1H		equ	016h
CCP1CON		equ	017h
RCSTA		equ	018h
TXREG		equ	019h
RCREG		equ	01Ah
CCPR2L		equ	01Bh
CCPR2H		equ	01Ch
CCP2CON		equ	01Dh
ADRESH		equ	01Eh
ADCON0		equ	01Fh
OPTION		equ	081h
TRISA		equ	085h
TRISB		equ	086h
TRISC		equ	087h
TRISD		equ	088h
TRISE		equ	089h
PIE1		equ	08Ch
PIE2		equ	08Dh
PCON		equ	08Eh
SSPCON2		equ	091h
PR2		equ	092h
SSPADD		equ	093h
SSPSTAT		equ	094h
WPUB		equ	095h
IOCB		equ	096h
P1DEL		equ	097h
TXSTA		equ	098h
SPBRG		equ	099h
REFCON		equ	09Bh
LVDCON		equ	09Ch
ANSEL		equ	09Dh
ADRESL		equ	09Eh
ADCON1		equ	09Fh
PMDATL		equ	010Ch
PMADRL		equ	010Dh
PMDATH		equ	010Eh
PMADRH		equ	010Fh
UIR		equ	0190h
UIE		equ	0191h
UEIR		equ	0192h
UEIE		equ	0193h
USTAT		equ	0194h
UCTRL		equ	0195h
UADDR		equ	0196h
USWSTAT		equ	0197h
UEP0		equ	0198h
UEP1		equ	0199h
UEP2		equ	019Ah
BD0OST		equ	01A0h
BD1OST		equ	01A8h
BD2OST		equ	01B0h
BD0IST		equ	01A4h
BD1IST		equ	01ACh
BD2IST		equ	01B4h
BD0OBC		equ	01A1h
BD1OBC		equ	01A9h
BD2OBC		equ	01B1h
BD0IBC		equ	01A5h
BD1IBC		equ	01ADh
BD2IBC		equ	01B5h
BD0OAL		equ	01A2h
BD1OAL		equ	01AAh
BD2OAL		equ	01B2h
BD0IAL		equ	01A6h
BD1IAL		equ	01AEh
BD2IAL		equ	01B6h
USBMEM[40]	equ	01B8h

; Bit variables associates within SFRs
#define TMR07	TMR0,7
#define TMR06	TMR0,6
#define TMR05	TMR0,5
#define TMR04	TMR0,4
#define TMR03	TMR0,3
#define TMR02	TMR0,2
#define TMR01	TMR0,1
#define TMR00	TMR0,0
#define PCL7	PCL,7
#define PCL6	PCL,6
#define PCL5	PCL,5
#define PCL4	PCL,4
#define PCL3	PCL,3
#define PCL2	PCL,2
#define PCL1	PCL,1
#define PCL0	PCL,0
#define IRP	STATUS,7
#define RP1	STATUS,6
#define RP0	STATUS,5
#define TO	STATUS,4
#define PD	STATUS,3
#define ZERO	STATUS,2
#define DC	STATUS,1
#define CARRY	STATUS,0
#define RA7	PORTA,7
#define RA6	PORTA,6
#define RA5	PORTA,5
#define RA4	PORTA,4
#define RA3	PORTA,3
#define RA2	PORTA,2
#define RA1	PORTA,1
#define RA0	PORTA,0
#define RB7	PORTB,7
#define RB6	PORTB,6
#define RB5	PORTB,5
#define RB4	PORTB,4
#define RB3	PORTB,3
#define RB2	PORTB,2
#define RB1	PORTB,1
#define RB0	PORTB,0
#define RC7	PORTC,7
#define RC6	PORTC,6
#define RC5	PORTC,5
#define RC4	PORTC,4
#define RC3	PORTC,3
#define RC2	PORTC,2
#define RC1	PORTC,1
#define RC0	PORTC,0
#define RD7	PORTD,7
#define RD6	PORTD,6
#define RD5	PORTD,5
#define RD4	PORTD,4
#define RD3	PORTD,3
#define RD2	PORTD,2
#define RD1	PORTD,1
#define RD0	PORTD,0
#define RE2	PORTE,2
#define RE1	PORTE,1
#define RE0	PORTE,0
#define GIE	INTCON,7
#define PEIE	INTCON,6
#define T0IE	INTCON,5
#define INTE	INTCON,4
#define RBIE	INTCON,3
#define T0IF	INTCON,2
#define INTF	INTCON,1
#define RBIF	INTCON,0
#define PSPIF	PIR1,7
#define ADIF	PIR1,6
#define RCIF	PIR1,5
#define TXIF	PIR1,4
#define USBIF	PIR1,3
#define SSPIF	PIR1,3
#define CCP1IF	PIR1,2
#define TMR2IF	PIR1,1
#define TMR1IF	PIR1,0
#define LVDIF	PIR2,7
#define BCLIF	PIR2,3
#define CCP2IF	PIR2,0
#define TMR1L7	TMR1L,7
#define TMR1L6	TMR1L,6
#define TMR1L5	TMR1L,5
#define TMR1L4	TMR1L,4
#define TMR1L3	TMR1L,3
#define TMR1L2	TMR1L,2
#define TMR1L1	TMR1L,1
#define TMR1L0	TMR1L,0
#define TMR1H7	TMR1H,7
#define TMR1H6	TMR1H,6
#define TMR1H5	TMR1H,5
#define TMR1H4	TMR1H,4
#define TMR1H3	TMR1H,3
#define TMR1H2	TMR1H,2
#define TMR1H1	TMR1H,1
#define TMR1H0	TMR1H,0
#define TMR27	TMR2,7
#define TMR26	TMR2,6
#define TMR25	TMR2,5
#define TMR24	TMR2,4
#define TMR23	TMR2,3
#define TMR22	TMR2,2
#define TMR21	TMR2,1
#define TMR20	TMR2,0
#define T1CKPS1	T1CON,5
#define T1CKPS0	T1CON,4
#define T1OSCEN	T1CON,3
#define T1SYNC	T1CON,2
#define TMR1CS	T1CON,1
#define TMR1ON	T1CON,0
#define TOUTPS3	T2CON,6
#define TOUTPS2	T2CON,5
#define TOUTPS1	T2CON,4
#define TOUTPS0	T2CON,3
#define TMR2ON	T2CON,2
#define T2CKPS1	T2CON,1
#define T2CKPS0	T2CON,0
#define SSPBUF7	SSPBUF,7
#define SSPBUF6	SSPBUF,6
#define SSPBUF5	SSPBUF,5
#define SSPBUF4	SSPBUF,4
#define SSPBUF3	SSPBUF,3
#define SSPBUF2	SSPBUF,2
#define SSPBUF1	SSPBUF,1
#define SSPBUF0	SSPBUF,0
#define WCOL	SSPCON,7
#define SSPOV	SSPCON,6
#define SSPEN	SSPCON,5
#define CKP	SSPCON,4
#define SSPM3	SSPCON,3
#define SSPM2	SSPCON,2
#define SSPM1	SSPCON,1
#define SSPM0	SSPCON,0
#define CCPR1L7	CCPR1L,7
#define CCPR1L6	CCPR1L,6
#define CCPR1L5	CCPR1L,5
#define CCPR1L4	CCPR1L,4
#define CCPR1L3	CCPR1L,3
#define CCPR1L2	CCPR1L,2
#define CCPR1L1	CCPR1L,1
#define CCPR1L0	CCPR1L,0
#define CCPR1H7	CCPR1H,7
#define CCPR1H6	CCPR1H,6
#define CCPR1H5	CCPR1H,5
#define CCPR1H4	CCPR1H,4
#define CCPR1H3	CCPR1H,3
#define CCPR1H2	CCPR1H,2
#define CCPR1H1	CCPR1H,1
#define CCPR1H0	CCPR1H,0
#define PWM1M1	CCP1CON,7
#define PWM1M0	CCP1CON,6
#define DC1B1	CCP1CON,5
#define DC1B0	CCP1CON,4
#define CCP1X	CCP1CON,5
#define CCP1Y	CCP1CON,4
#define CCP1M3	CCP1CON,3
#define CCP1M2	CCP1CON,2
#define CCP1M1	CCP1CON,1
#define CCP1M0	CCP1CON,0
#define SPEN	RCSTA,7
#define RX9	RCSTA,6
#define SREN	RCSTA,5
#define CREN	RCSTA,4
#define ADDEN	RCSTA,3
#define FERR	RCSTA,2
#define OERR	RCSTA,1
#define RX9D	RCSTA,0
#define CCP2X	CCP2CON,5
#define CCP2Y	CCP2CON,4
#define DC2B1	CCP2CON,5
#define DC2B0	CCP2CON,4
#define CCP2M3	CCP2CON,3
#define CCP2M2	CCP2CON,2
#define CCP2M1	CCP2CON,1
#define CCP2M0	CCP2CON,0
#define ADCS1	ADCON0,7
#define ADCS0	ADCON0,6
#define CHS2	ADCON0,5
#define CHS1	ADCON0,4
#define CHS0	ADCON0,3
#define ADGO	ADCON0,2
#define CHS3	ADCON0,1
#define ADON	ADCON0,0
#define ADRESH7	ADRESH,7
#define ADRESH6	ADRESH,6
#define ADRESH5	ADRESH,5
#define ADRESH4	ADRESH,4
#define ADRESH3	ADRESH,3
#define ADRESH2	ADRESH,2
#define ADRESH1	ADRESH,1
#define ADRESH0	ADRESH,0
#define bank1	OPTION,7
#define bank1	OPTION,6
#define bank1	OPTION,5
#define bank1	OPTION,4
#define bank1	OPTION,3
#define bank1	OPTION,2
#define bank1	OPTION,1
#define bank1	OPTION,0
#define bank1	TRISA,7
#define bank1	TRISA,6
#define bank1	TRISA,5
#define bank1	TRISA,4
#define bank1	TRISA,3
#define bank1	TRISA,2
#define bank1	TRISA,1
#define bank1	TRISA,0
#define bank1	TRISB,7
#define bank1	TRISB,6
#define bank1	TRISB,5
#define bank1	TRISB,4
#define bank1	TRISB,3
#define bank1	TRISB,2
#define bank1	TRISB,1
#define bank1	TRISB,0
#define bank1	TRISC,7
#define bank1	TRISC,6
#define bank1	TRISC,5
#define bank1	TRISC,4
#define bank1	TRISC,3
#define bank1	TRISC,2
#define bank1	TRISC,1
#define bank1	TRISC,0
#define bank1	TRISD,7
#define bank1	TRISD,6
#define bank1	TRISD,5
#define bank1	TRISD,4
#define bank1	TRISD,3
#define bank1	TRISD,2
#define bank1	TRISD,1
#define bank1	TRISD,0
#define bank1	TRISE,7
#define bank1	TRISE,6
#define bank1	TRISE,5
#define bank1	TRISE,4
#define bank1	TRISE,2
#define bank1	TRISE,1
#define bank1	TRISE,0
#define bank1	PIE1,7
#define bank1	PIE1,6
#define bank1	PIE1,5
#define bank1	PIE1,4
#define bank1	PIE1,3
#define bank1	PIE1,3
#define bank1	PIE1,2
#define bank1	PIE1,1
#define bank1	PIE1,0
#define bank1	PIE2,7
#define bank1	PIE2,3
#define bank1	PIE2,0
#define bank1	PCON,3
#define bank1	PCON,1
#define bank1	PCON,0
#define bank1	SSPCON2,7
#define bank1	SSPCON2,6
#define bank1	SSPCON2,5
#define bank1	SSPCON2,4
#define bank1	SSPCON2,3
#define bank1	SSPCON2,2
#define bank1	SSPCON2,1
#define bank1	SSPCON2,0
#define bank1	SSPSTAT,7
#define bank1	SSPSTAT,6
#define bank1	SSPSTAT,5
#define bank1	SSPSTAT,4
#define bank1	SSPSTAT,3
#define bank1	SSPSTAT,2
#define bank1	SSPSTAT,1
#define bank1	SSPSTAT,0
#define bank1	PR2,7
#define bank1	PR2,6
#define bank1	PR2,5
#define bank1	PR2,4
#define bank1	PR2,3
#define bank1	PR2,2
#define bank1	PR2,1
#define bank1	PR2,0
#define bank1	SSPADD,7
#define bank1	SSPADD,6
#define bank1	SSPADD,5
#define bank1	SSPADD,4
#define bank1	SSPADD,3
#define bank1	SSPADD,2
#define bank1	SSPADD,1
#define bank1	SSPADD,0
#define bank1	WPUB,7
#define bank1	WPUB,6
#define bank1	WPUB,5
#define bank1	WPUB,4
#define bank1	WPUB,3
#define bank1	WPUB,2
#define bank1	WPUB,1
#define bank1	WPUB,0
#define bank1	IOCB,7
#define bank1	IOCB,6
#define bank1	IOCB,5
#define bank1	IOCB,4
#define bank1	IOCB,3
#define bank1	IOCB,2
#define bank1	IOCB,1
#define bank1	IOCB,0
#define bank1	P1DEL,7
#define bank1	P1DEL,6
#define bank1	P1DEL,5
#define bank1	P1DEL,4
#define bank1	P1DEL,3
#define bank1	P1DEL,2
#define bank1	P1DEL,1
#define bank1	P1DEL,0
#define bank1	TXSTA,7
#define bank1	TXSTA,6
#define bank1	TXSTA,5
#define bank1	TXSTA,4
#define bank1	TXSTA,2
#define bank1	TXSTA,1
#define bank1	TXSTA,0
#define bank1	REFCON,7
#define bank1	REFCON,6
#define bank1	REFCON,5
#define bank1	REFCON,4
#define bank1	LVDCON,5
#define bank1	LVDCON,4
#define bank1	LVDCON,3
#define bank1	LVDCON,2
#define bank1	LVDCON,1
#define bank1	LVDCON,0
#define bank1	ANSEL,5
#define bank1	ANSEL,4
#define bank1	ANSEL,3
#define bank1	ANSEL,2
#define bank1	ANSEL,1
#define bank1	ANSEL,0
#define ADRESL7	ADRESL,7
#define ADRESL6	ADRESL,6
#define ADRESL5	ADRESL,5
#define ADRESL4	ADRESL,4
#define ADRESL3	ADRESL,3
#define ADRESL2	ADRESL,2
#define ADRESL1	ADRESL,1
#define ADRESL0	ADRESL,0
#define bank1	ADCON1,7
#define bank1	ADCON1,6
#define bank1	ADCON1,5
#define bank1	ADCON1,4
#define bank1	ADCON1,3
#define bank1	ADCON1,2
#define bank1	ADCON1,1
#define bank1	ADCON1,0
#define bank2	PMDATL,7
#define bank2	PMDATL,6
#define bank2	PMDATL,5
#define bank2	PMDATL,4
#define bank2	PMDATL,3
#define bank2	PMDATL,2
#define bank2	PMDATL,1
#define bank2	PMDATL,0
#define bank2	PMADRL,7
#define bank2	PMADRL,6
#define bank2	PMADRL,5
#define bank2	PMADRL,4
#define bank2	PMADRL,3
#define bank2	PMADRL,2
#define bank2	PMADRL,1
#define bank2	PMADRL,0
#define bank2	PMDATH,5
#define bank2	PMDATH,4
#define bank2	PMDATH,3
#define bank2	PMDATH,2
#define bank2	PMDATH,1
#define bank2	PMDATH,0
#define bank2	PMADRH,3
#define bank2	PMADRH,2
#define bank2	PMADRH,1
#define bank2	PMADRH,0
#define bank3	UIR,5
#define bank3	UIR,4
#define bank3	UIR,3
#define bank3	UIR,2
#define bank3	UIR,1
#define bank3	UIR,0
#define bank3	UIE,5
#define bank3	UIE,4
#define bank3	UIE,3
#define bank3	UIE,2
#define bank3	UIE,1
#define bank3	UIE,0
#define bank3	UEIR,7
#define bank3	UEIR,6
#define bank3	UEIR,5
#define bank3	UEIR,4
#define bank3	UEIR,3
#define bank3	UEIR,2
#define bank3	UEIR,1
#define bank3	UEIR,0
#define bank3	UEIE,7
#define bank3	UEIE,6
#define bank3	UEIE,5
#define bank3	UEIE,4
#define bank3	UEIE,3
#define bank3	UEIE,2
#define bank3	UEIE,1
#define bank3	UEIE,0
#define bank3	USTAT,4
#define bank3	USTAT,3
#define bank3	USTAT,2
#define bank3	UCTRL,5
#define bank3	UCTRL,4
#define bank3	UCTRL,3
#define bank3	UCTRL,2
#define bank3	UCTRL,1
#define bank3	UADDR,6
#define bank3	UADDR,5
#define bank3	UADDR,4
#define bank3	UADDR,3
#define bank3	UADDR,2
#define bank3	UADDR,1
#define bank3	UADDR,0
#define bank3	USWSTAT,7
#define bank3	USWSTAT,6
#define bank3	USWSTAT,5
#define bank3	USWSTAT,4
#define bank3	USWSTAT,3
#define bank3	USWSTAT,2
#define bank3	USWSTAT,1
#define bank3	USWSTAT,0
#define bank3	UEP0,3
#define bank3	UEP0,2
#define bank3	UEP0,1
#define bank3	UEP0,0
#define bank3	UEP1,3
#define bank3	UEP1,2
#define bank3	UEP1,1
#define bank3	UEP1,0
#define bank3	UEP2,3
#define bank3	UEP2,2
#define bank3	UEP2,1
#define bank3	UEP2,0
#define bank3	BD0OST,7
#define bank3	BD0OST,6
#define bank3	BD0OST,5
#define bank3	BD0OST,4
#define bank3	BD0OST,3
#define bank3	BD0OST,2
#define bank3	BD0IST,7
#define bank3	BD0IST,6
#define bank3	BD0IST,5
#define bank3	BD0IST,4
#define bank3	BD0IST,3
#define bank3	BD0IST,2
#define bank3	BD1OST,7
#define bank3	BD1OST,6
#define bank3	BD1OST,5
#define bank3	BD1OST,4
#define bank3	BD1OST,3
#define bank3	BD1OST,2
#define bank3	BD1IST,7
#define bank3	BD1IST,6
#define bank3	BD1IST,5
#define bank3	BD1IST,4
#define bank3	BD1IST,3
#define bank3	BD1IST,2
#define bank3	BD2OST,7
#define bank3	BD2OST,6
#define bank3	BD2OST,5
#define bank3	BD2OST,4
#define bank3	BD2OST,3
#define bank3	BD2OST,2
#define bank3	BD2IST,7
#define bank3	BD2IST,6
#define bank3	BD2IST,5
#define bank3	BD2IST,4
#define bank3	BD2IST,3
#define bank3	BD2IST,2
