
#ifndef	_HTC_H_
#warning Header file c505.h included directly. Use #include <htc.h> instead.
#endif

/*header file for the SIEMENS C505 Microcontrollers
	C505_2R
	C505_L
	C505A_2R
	C505A_4R
	C505A_4E
	C505A_L
	C505C_2R
	C505C_L
	C505CA_2R
	C505CA_4R
	C505CA_4E
	C505CA_L
 */

#ifndef	__C505_H

#define	__C505_H
	
typedef struct {
	unsigned B7:1;	/* this is the most significant bit */
	unsigned B6:1;
	unsigned B5:1;
	unsigned B4:1;
	unsigned B3:1;
	unsigned B2:1;
	unsigned B1:1;
	unsigned B0:1;
}	SFR_BITS;

static volatile unsigned char		P0	@ 0x80;
static volatile unsigned char		SP	@ 0x81;
static volatile unsigned char		DPL	@ 0x82;
static volatile unsigned char		DPH	@ 0x83;
// 16 bit definition
static 		unsigned char		WDTREL	@ 0x86;
static 		unsigned char		PCON	@ 0x87;
static volatile	unsigned char		TCON	@ 0x88;
// SFR is in mapped region 
static 		unsigned char		PCON1	@ 0x88;
static 		unsigned char		TMOD	@ 0x89;
static volatile unsigned char		TL0	@ 0x8A;
static volatile unsigned char		TL1	@ 0x8B;
static volatile unsigned char		TH0	@ 0x8C;
static volatile unsigned char		TH1	@ 0x8D;
static volatile unsigned char		P1	@ 0x90;
// SFR is in mapped region 
static volatile unsigned char		P1ANA	@ 0x90;
static		unsigned char		XPAGE	@ 0x91;
static		unsigned char		DPSEL	@ 0x92;
static volatile	unsigned char		SCON	@ 0x98;
static volatile unsigned char		SBUF	@ 0x99;
static volatile unsigned char		P2	@ 0xA0;
static 		unsigned char		IEN0	@ 0xA8;
static 		unsigned char		IP0	@ 0xA9;
static		unsigned char		SRELL	@ 0xAA;
static volatile unsigned char		P3	@ 0xB0;
static volatile unsigned char		SYSCON	@ 0xB1;
static		unsigned char		IEN1	@ 0xB8;
static 		unsigned char		IP1	@ 0xB9;
static		unsigned char		SRELH	@ 0xBA;
static volatile	unsigned char		IRCON	@ 0xC0;
static		unsigned char		CCEN	@ 0xC1;
static volatile unsigned char		CCL1	@ 0xC2;
static volatile unsigned char		CCH1	@ 0xC3;
static volatile unsigned char		CCL2	@ 0xC4;
static volatile unsigned char		CCH2	@ 0xC5;
static volatile unsigned char		CCL3	@ 0xC6;
static volatile unsigned char		CCH3	@ 0xC7;
static volatile	unsigned char		T2CON	@ 0xC8;
static volatile unsigned char		CRCL	@ 0xCA;
static volatile unsigned char		CRCH	@ 0xCB;
static volatile unsigned char		TL2	@ 0xCC;
static volatile unsigned char		TH2	@ 0xCD;
static volatile unsigned char		PSW	@ 0xD0;
static volatile unsigned char		ADCON0	@ 0xD8;
#if defined(_C505) || defined(_C505C)
	static volatile unsigned char	ADDAT	@ 0xD9;
	static volatile unsigned char	ADST	@ 0xDA;
#endif
#if defined(_C505A) || defined(_C505CA)
	static volatile unsigned char	ADDATH	@ 0xD9;
	static volatile unsigned char	ADDATL	@ 0xDA;
#endif
static		unsigned char		ADCON1	@ 0xDC;
static volatile unsigned char		ACC	@ 0xE0;
static volatile unsigned char		P4	@ 0xE8;
static volatile unsigned char		B	@ 0xF0;
static		unsigned char		VR0	@ 0xFC;
static		unsigned char		VR1	@ 0xFD;
static		unsigned char		VR2	@ 0xFE;

#if defined(_C505C) || defined(_C505CA)
/*the following are CAN registers */
static volatile unsigned char		CR	@ 0xF700;
static volatile unsigned char		SR	@ 0xF701;
static volatile unsigned char		IR	@ 0xF702;
static volatile unsigned char		BTR0	@ 0xF704;
static volatile unsigned char		BTR1	@ 0xF705;
static volatile unsigned char		GMS0	@ 0xF706;
static volatile unsigned char		GMS1	@ 0xF707;
static volatile unsigned char		UGML0	@ 0xF708;
static volatile unsigned char		UGML1	@ 0xF709;
static volatile unsigned char		LGML0	@ 0xF70A;
static volatile unsigned char		LGML1	@ 0xF70B;
static volatile unsigned char		UMLM0	@ 0xF70C;
static volatile unsigned char		UMLM1	@ 0xF70D;
static volatile unsigned char		LMLM0	@ 0xF70E;
static volatile unsigned char		LMLM1	@ 0xF70F;

static volatile unsigned char		MCR1O	@ 0xF710;
static volatile unsigned char		MCR11	@ 0xF711;
static volatile unsigned char		UAR10	@ 0xF712;
static volatile unsigned char		UAR11	@ 0xF713;
static volatile unsigned char		LAR10	@ 0xF714;
static volatile unsigned char		LAR11	@ 0xF715;
static volatile unsigned char		MCFG1	@ 0xF716;
static volatile unsigned char		DB10	@ 0xF717;
static volatile unsigned char		DB11	@ 0xF718;
static volatile unsigned char		DB12	@ 0xF719;
static volatile unsigned char		DB13	@ 0xF71A;
static volatile unsigned char		DB14	@ 0xF71B;
static volatile unsigned char		DB15	@ 0xF71C;
static volatile unsigned char		DB16	@ 0xF71D;
static volatile unsigned char		DB17	@ 0xF71E;

static volatile unsigned char		MCR2O	@ 0xF720;
static volatile unsigned char		MCR21	@ 0xF721;
static volatile unsigned char		UAR20	@ 0xF722;
static volatile unsigned char		UAR21	@ 0xF723;
static volatile unsigned char		LAR20	@ 0xF724;
static volatile unsigned char		LAR21	@ 0xF725;
static volatile unsigned char		MCFG2	@ 0xF726;
static volatile unsigned char		DB20	@ 0xF727;
static volatile unsigned char		DB21	@ 0xF728;
static volatile unsigned char		DB22	@ 0xF729;
static volatile unsigned char		DB23	@ 0xF72A;
static volatile unsigned char		DB24	@ 0xF72B;
static volatile unsigned char		DB25	@ 0xF72C;
static volatile unsigned char		DB26	@ 0xF72D;
static volatile unsigned char		DB27	@ 0xF72E;

static volatile unsigned char		MCR3O	@ 0xF730;
static volatile unsigned char		MCR31	@ 0xF731;
static volatile unsigned char		UAR30	@ 0xF732;
static volatile unsigned char		UAR31	@ 0xF733;
static volatile unsigned char		LAR30	@ 0xF734;
static volatile unsigned char		LAR31	@ 0xF735;
static volatile unsigned char		MCFG3	@ 0xF736;
static volatile unsigned char		DB30	@ 0xF737;
static volatile unsigned char		DB31	@ 0xF738;
static volatile unsigned char		DB32	@ 0xF739;
static volatile unsigned char		DB33	@ 0xF73A;
static volatile unsigned char		DB34	@ 0xF73B;
static volatile unsigned char		DB35	@ 0xF733;
static volatile unsigned char		DB36	@ 0xF73D;
static volatile unsigned char		DB37	@ 0xF73E;

static volatile unsigned char		MCR4O	@ 0xF740;
static volatile unsigned char		MCR41	@ 0xF741;
static volatile unsigned char		UAR40	@ 0xF742;
static volatile unsigned char		UAR41	@ 0xF743;
static volatile unsigned char		LAR40	@ 0xF744;
static volatile unsigned char		LAR41	@ 0xF745;
static volatile unsigned char		MCFG4	@ 0xF746;
static volatile unsigned char		DB40	@ 0xF747;
static volatile unsigned char		DB41	@ 0xF748;
static volatile unsigned char		DB42	@ 0xF749;
static volatile unsigned char		DB43	@ 0xF74A;
static volatile unsigned char		DB44	@ 0xF74B;
static volatile unsigned char		DB45	@ 0xF74C;
static volatile unsigned char		DB46	@ 0xF74D;
static volatile unsigned char		DB47	@ 0xF74E;

static volatile unsigned char		MCR5O	@ 0xF750;
static volatile unsigned char		MCR51	@ 0xF751;
static volatile unsigned char		UAR50	@ 0xF752;
static volatile unsigned char		UAR51	@ 0xF753;
static volatile unsigned char		LAR50	@ 0xF754;
static volatile unsigned char		LAR51	@ 0xF755;
static volatile unsigned char		MCFG5	@ 0xF756;
static volatile unsigned char		DB50	@ 0xF757;
static volatile unsigned char		DB51	@ 0xF758;
static volatile unsigned char		DB52	@ 0xF759;
static volatile unsigned char		DB53	@ 0xF75A;
static volatile unsigned char		DB54	@ 0xF75B;
static volatile unsigned char		DB55	@ 0xF75C;
static volatile unsigned char		DB56	@ 0xF75D;
static volatile unsigned char		DB57	@ 0xF75E;

static volatile unsigned char		MCR6O	@ 0xF760;
static volatile unsigned char		MCR61	@ 0xF761;
static volatile unsigned char		UAR60	@ 0xF762;
static volatile unsigned char		UAR61	@ 0xF763;
static volatile unsigned char		LAR60	@ 0xF764;
static volatile unsigned char		LAR61	@ 0xF765;
static volatile unsigned char		MCFG6	@ 0xF766;
static volatile unsigned char		DB60	@ 0xF767;
static volatile unsigned char		DB61	@ 0xF768;
static volatile unsigned char		DB62	@ 0xF769;
static volatile unsigned char		DB63	@ 0xF76A;
static volatile unsigned char		DB64	@ 0xF76B;
static volatile unsigned char		DB65	@ 0xF76C;
static volatile unsigned char		DB66	@ 0xF76D;
static volatile unsigned char		DB67	@ 0xF76E;

static volatile unsigned char		MCR7O	@ 0xF770;
static volatile unsigned char		MCR71	@ 0xF771;
static volatile unsigned char		UAR70	@ 0xF772;
static volatile unsigned char		UAR71	@ 0xF773;
static volatile unsigned char		LAR70	@ 0xF774;
static volatile unsigned char		LAR71	@ 0xF775;
static volatile unsigned char		MCFG7	@ 0xF776;
static volatile unsigned char		DB70	@ 0xF777;
static volatile unsigned char		DB71	@ 0xF778;
static volatile unsigned char		DB72	@ 0xF779;
static volatile unsigned char		DB73	@ 0xF77A;
static volatile unsigned char		DB74	@ 0xF77B;
static volatile unsigned char		DB75	@ 0xF77C;
static volatile unsigned char		DB76	@ 0xF77D;
static volatile unsigned char		DB77	@ 0xF77E;

static volatile unsigned char		MCR8O	@ 0xF780;
static volatile unsigned char		MCR81	@ 0xF781;
static volatile unsigned char		UAR80	@ 0xF782;
static volatile unsigned char		UAR81	@ 0xF783;
static volatile unsigned char		LAR80	@ 0xF784;
static volatile unsigned char		LAR81	@ 0xF785;
static volatile unsigned char		MCFG8	@ 0xF786;
static volatile unsigned char		DB80	@ 0xF787;
static volatile unsigned char		DB81	@ 0xF788;
static volatile unsigned char		DB82	@ 0xF789;
static volatile unsigned char		DB83	@ 0xF78A;
static volatile unsigned char		DB84	@ 0xF78B;
static volatile unsigned char		DB85	@ 0xF78C;
static volatile unsigned char		DB86	@ 0xF78D;
static volatile unsigned char		DB87	@ 0xF78E;

static volatile unsigned char		MCR9O	@ 0xF790;
static volatile unsigned char		MCR91	@ 0xF791;
static volatile unsigned char		UAR90	@ 0xF792;
static volatile unsigned char		UAR91	@ 0xF793;
static volatile unsigned char		LAR90	@ 0xF794;
static volatile unsigned char		LAR91	@ 0xF795;
static volatile unsigned char		MCFG9	@ 0xF796;
static volatile unsigned char		DB90	@ 0xF797;
static volatile unsigned char		DB91	@ 0xF798;
static volatile unsigned char		DB92	@ 0xF799;
static volatile unsigned char		DB93	@ 0xF79A;
static volatile unsigned char		DB94	@ 0xF79B;
static volatile unsigned char		DB95	@ 0xF79C;
static volatile unsigned char		DB96	@ 0xF79D;
static volatile unsigned char		DB97	@ 0xF79E;

static volatile unsigned char		MCRAO	@ 0xF7A0;
static volatile unsigned char		MCRA1	@ 0xF7A1;
static volatile unsigned char		UARA0	@ 0xF7A2;
static volatile unsigned char		UARA1	@ 0xF7A3;
static volatile unsigned char		LARA0	@ 0xF7A4;
static volatile unsigned char		LARA1	@ 0xF7A5;
static volatile unsigned char		MCFGA	@ 0xF7A6;
static volatile unsigned char		DBA0	@ 0xF7A7;
static volatile unsigned char		DBA1	@ 0xF7A8;
static volatile unsigned char		DBA2	@ 0xF7A9;
static volatile unsigned char		DBA3	@ 0xF7AA;
static volatile unsigned char		DBA4	@ 0xF7AB;
static volatile unsigned char		DBA5	@ 0xF7AC;
static volatile unsigned char		DBA6	@ 0xF7AD;
static volatile unsigned char		DBA7	@ 0xF7AE;

static volatile unsigned char		MCRBO	@ 0xF7B0;
static volatile unsigned char		MCRB1	@ 0xF7B1;
static volatile unsigned char		UARB0	@ 0xF7B2;
static volatile unsigned char		UARB1	@ 0xF7B3;
static volatile unsigned char		LARB0	@ 0xF7B4;
static volatile unsigned char		LARB1	@ 0xF7B5;
static volatile unsigned char		MCFGB	@ 0xF7B6;
static volatile unsigned char		DBB0	@ 0xF7B7;
static volatile unsigned char		DBB1	@ 0xF7B8;
static volatile unsigned char		DBB2	@ 0xF7B9;
static volatile unsigned char		DBB3	@ 0xF7BA;
static volatile unsigned char		DBB4	@ 0xF7BB;
static volatile unsigned char		DBB5	@ 0xF7BC;
static volatile unsigned char		DBB6	@ 0xF7BD;
static volatile unsigned char		DBB7	@ 0xF7BE;

static volatile unsigned char		MCRCO	@ 0xF7C0;
static volatile unsigned char		MCRC1	@ 0xF7C1;
static volatile unsigned char		UARC0	@ 0xF7C2;
static volatile unsigned char		UARC1	@ 0xF7C3;
static volatile unsigned char		LARC0	@ 0xF7C4;
static volatile unsigned char		LARC1	@ 0xF7C5;
static volatile unsigned char		MCFGC	@ 0xF7C6;
static volatile unsigned char		DBC0	@ 0xF7C7;
static volatile unsigned char		DBC1	@ 0xF7C8;
static volatile unsigned char		DBC2	@ 0xF7C9;
static volatile unsigned char		DBC3	@ 0xF7CA;
static volatile unsigned char		DBC4	@ 0xF7CB;
static volatile unsigned char		DBC5	@ 0xF7CC;
static volatile unsigned char		DBC6	@ 0xF7CD;
static volatile unsigned char		DBC7	@ 0xF7CE;

static volatile unsigned char		MCRDO	@ 0xF7D0;
static volatile unsigned char		MCRD1	@ 0xF7D1;
static volatile unsigned char		UARD0	@ 0xF7D2;
static volatile unsigned char		UARD1	@ 0xF7D3;
static volatile unsigned char		LARD0	@ 0xF7D4;
static volatile unsigned char		LARD1	@ 0xF7D5;
static volatile unsigned char		MCFGD	@ 0xF7D6;
static volatile unsigned char		DBD0	@ 0xF7D7;
static volatile unsigned char		DBD1	@ 0xF7D8;
static volatile unsigned char		DBD2	@ 0xF7D9;
static volatile unsigned char		DBD3	@ 0xF7DA;
static volatile unsigned char		DBD4	@ 0xF7DB;
static volatile unsigned char		DBD5	@ 0xF7DC;
static volatile unsigned char		DBD6	@ 0xF7DD;
static volatile unsigned char		DBD7	@ 0xF7DE;

static volatile unsigned char		MCREO	@ 0xF7E0;
static volatile unsigned char		MCRE1	@ 0xF7E1;
static volatile unsigned char		UARE0	@ 0xF7E2;
static volatile unsigned char		UARE1	@ 0xF7E3;
static volatile unsigned char		LARE0	@ 0xF7E4;
static volatile unsigned char		LARE1	@ 0xF7E5;
static volatile unsigned char		MCFGE	@ 0xF7E6;
static volatile unsigned char		DBE0	@ 0xF7E7;
static volatile unsigned char		DBE1	@ 0xF7E8;
static volatile unsigned char		DBE2	@ 0xF7E9;
static volatile unsigned char		DBE3	@ 0xF7EA;
static volatile unsigned char		DBE4	@ 0xF7EB;
static volatile unsigned char		DBE5	@ 0xF7EC;
static volatile unsigned char		DBE6	@ 0xF7ED;
static volatile unsigned char		DBE7	@ 0xF7EE;

static volatile unsigned char		MCRFO	@ 0xF7F0;
static volatile unsigned char		MCRF1	@ 0xF7F1;
static volatile unsigned char		UARF0	@ 0xF7F2;
static volatile unsigned char		UARF1	@ 0xF7F3;
static volatile unsigned char		LARF0	@ 0xF7F4;
static volatile unsigned char		LARF1	@ 0xF7F5;
static volatile unsigned char		MCFGF	@ 0xF7F6;
static volatile unsigned char		DBF0	@ 0xF7F7;
static volatile unsigned char		DBF1	@ 0xF7F8;
static volatile unsigned char		DBF2	@ 0xF7F9;
static volatile unsigned char		DBF3	@ 0xF7FA;
static volatile unsigned char		DBF4	@ 0xF7FB;
static volatile unsigned char		DBF5	@ 0xF7FC;
static volatile unsigned char		DBF6	@ 0xF7FD;
static volatile unsigned char		DBF7	@ 0xF7FE;
#endif

static volatile SFR_BITS	P0_BITS		@ 0x80;
static 		SFR_BITS	PCON_BITS	@ 0x87;
static volatile	SFR_BITS	TCON_BITS	@ 0x88;
// SFR is in mapped region 
static 		SFR_BITS	PCON1_BITS	@ 0x88;
static 		SFR_BITS	TMOD_BITS	@ 0x89;
static volatile SFR_BITS	P1_BITS		@ 0x90;
// SFR is in mapped region 
static volatile SFR_BITS	P1ANA_BITS	@ 0x90;
static		SFR_BITS	DPSEL_BITS	@ 0x92;
static volatile	SFR_BITS	SCON_BITS	@ 0x98;
static volatile SFR_BITS	P2_BITS		@ 0xA0;
static 		SFR_BITS	IEN0_BITS	@ 0xA8;
static 		SFR_BITS	IP0_BITS	@ 0xA9;
static volatile SFR_BITS	P3_BITS		@ 0xB0;
static volatile SFR_BITS	SYSCON_BITS	@ 0xB1;
static		SFR_BITS	IEN1_BITS	@ 0xB8;
static 		SFR_BITS	IP1_BITS	@ 0xB9;
static volatile	SFR_BITS	IRCON_BITS	@ 0xC0;
static		SFR_BITS	CCEN_BITS	@ 0xC1;
static volatile	SFR_BITS	T2CON_BITS	@ 0xC8;
static volatile SFR_BITS	PSW_BITS	@ 0xD0;
static volatile SFR_BITS	ADCON0_BITS	@ 0xD8;
static		SFR_BITS	ADCON1_BITS	@ 0xDC;
static volatile SFR_BITS	ACC_BITS	@ 0xE0;
static volatile SFR_BITS	P4_BITS		@ 0xE8;
static volatile SFR_BITS	B_BITS		@ 0xF0;

#if defined(_C505C) || defined(_C505CA)
/*the following relate to CAN registers */
static volatile SFR_BITS	CR_BITS		@ 0xF700;
static volatile SFR_BITS	SR_BITS		@ 0xF701;
static volatile SFR_BITS	BTR0_BITS	@ 0xF704;
static volatile SFR_BITS	BTR1_BITS	@ 0xF705;

static volatile SFR_BITS	MCR1O_BITS	@ 0xF710;
static volatile SFR_BITS	MCR11_BITS	@ 0xF711;
static volatile SFR_BITS	MCFG1_BITS	@ 0xF716;

static volatile SFR_BITS	MCR2O_BITS	@ 0xF720;
static volatile SFR_BITS	MCR21_BITS	@ 0xF721;
static volatile SFR_BITS	MCFG2_BITS	@ 0xF726;

static volatile SFR_BITS	MCR3O_BITS	@ 0xF730;
static volatile SFR_BITS	MCR31_BITS	@ 0xF731;
static volatile SFR_BITS	MCFG3_BITS	@ 0xF736;

static volatile SFR_BITS	MCR4O_BITS	@ 0xF740;
static volatile SFR_BITS	MCR41_BITS	@ 0xF741;
static volatile SFR_BITS	MCFG4_BITS	@ 0xF746;

static volatile SFR_BITS	MCR5O_BITS	@ 0xF750;
static volatile SFR_BITS	MCR51_BITS	@ 0xF751;
static volatile SFR_BITS	MCFG5_BITS	@ 0xF756;

static volatile SFR_BITS	MCR6O_BITS	@ 0xF760;
static volatile SFR_BITS	MCR61_BITS	@ 0xF761;
static volatile SFR_BITS	MCFG6_BITS	@ 0xF766;

static volatile SFR_BITS	MCR7O_BITS	@ 0xF770;
static volatile SFR_BITS	MCR71_BITS	@ 0xF771;
static volatile SFR_BITS	MCFG7_BITS	@ 0xF776;

static volatile SFR_BITS	MCR8O_BITS	@ 0xF780;
static volatile SFR_BITS	MCR81_BITS	@ 0xF781;
static volatile SFR_BITS	MCFG8_BITS	@ 0xF786;

static volatile SFR_BITS	MCR9O_BITS	@ 0xF790;
static volatile SFR_BITS	MCR91_BITS	@ 0xF791;
static volatile SFR_BITS	MCFG9_BITS	@ 0xF796;

static volatile SFR_BITS	MCRAO_BITS	@ 0xF7A0;
static volatile SFR_BITS	MCRA1_BITS	@ 0xF7A1;
static volatile SFR_BITS	MCFGA_BITS	@ 0xF7A6;

static volatile SFR_BITS	MCRBO_BITS	@ 0xF7B0;
static volatile SFR_BITS	MCRB1_BITS	@ 0xF7B1;
static volatile SFR_BITS	MCFGB_BITS	@ 0xF7B6;

static volatile SFR_BITS	MCRCO_BITS	@ 0xF7C0;
static volatile SFR_BITS	MCRC1_BITS	@ 0xF7C1;
static volatile SFR_BITS	MCFGC_BITS	@ 0xF7C6;

static volatile SFR_BITS	MCRDO_BITS	@ 0xF7D0;
static volatile SFR_BITS	MCRD1_BITS	@ 0xF7D1;
static volatile SFR_BITS	MCFGD_BITS	@ 0xF7D6;

static volatile SFR_BITS	MCREO_BITS	@ 0xF7E0;
static volatile SFR_BITS	MCRE1_BITS	@ 0xF7E1;
static volatile SFR_BITS	MCFGE_BITS	@ 0xF7E6;

static volatile SFR_BITS	MCRFO_BITS	@ 0xF7F0;
static volatile SFR_BITS	MCRF1_BITS	@ 0xF7F1;
static volatile SFR_BITS	MCFGF_BITS	@ 0xF7F6;
#endif

/*bit addressable locations*/
//Port 0 P0
static volatile bit	P00	@ 0x80;
static volatile bit	P01	@ 0x81;
static volatile bit	P02	@ 0x82;
static volatile bit	P03	@ 0x83;
static volatile bit	P04	@ 0x84;
static volatile bit	P05	@ 0x85;
static volatile bit	P06	@ 0x86;
static volatile bit	P07	@ 0x87;
// Alternate Functions
static volatile bit	AD0	@ 0x80;
static volatile bit	AD1	@ 0x81;
static volatile bit	AD2	@ 0x82;
static volatile bit	AD3	@ 0x83;
static volatile bit	AD4	@ 0x84;
static volatile bit	AD5	@ 0x85;
static volatile bit	AD6	@ 0x86;
static volatile bit	AD7	@ 0x87;

//Timer Control TCON
static 		bit	IT0	@ 0x88;
static volatile bit	IE0	@ 0x89;
static 		bit	IT1	@ 0x8A;
static volatile bit	IE1	@ 0x8B;
static 		bit	TR0	@ 0x8C;
static volatile bit	TF0	@ 0x8D;
static 		bit	TR1	@ 0x8E;
static volatile bit	TF1	@ 0x8F;

//Power Control 1 PCON1
//to access PCON1, RMAP (SYSCON.4) must be set
static volatile	bit	WS	@ 0x8C;
static volatile bit	EWPD	@ 0x8F;

//Port 1 P1
static volatile bit	P10	@ 0x90;
static volatile bit	P11	@ 0x91;
static volatile bit	P12	@ 0x92;
static volatile bit	P13	@ 0x93;
static volatile bit	P14	@ 0x94;
static volatile bit	P15	@ 0x95;
static volatile bit	P16	@ 0x96;
static volatile bit	P17	@ 0x97;
// Alternate Functions
static volatile bit	INT3	@ 0x90;
static volatile bit	INT4	@ 0x91;
static volatile bit	INT5	@ 0x92;
static volatile bit	INT6	@ 0x93;
static volatile bit	T2EX	@ 0x95;
static volatile bit	CLKOUT	@ 0x96;
static volatile bit	T2	@ 0x97;
static volatile bit	AN0	@ 0x90;
static volatile bit	AN1	@ 0x91;
static volatile bit	AN2	@ 0x92;
static volatile bit	AN3	@ 0x93;
static volatile bit	AN4	@ 0x94;
static volatile bit	AN5	@ 0x95;
static volatile bit	AN6	@ 0x96;
static volatile bit	AN7	@ 0x97;
static volatile bit	CC0	@ 0x90;
static volatile bit	CC1	@ 0x91;
static volatile bit	CC2	@ 0x92;
static volatile bit	CC3	@ 0x93;

//Port 1 Analog Input Select Register P1ANA
//to access P1ANA, RMAP (SYSCON.4) must be set
static volatile bit	EAN0	@ 0x90;
static volatile bit	EAN1	@ 0x91;
static volatile bit	EAN2	@ 0x92;
static volatile bit	EAN3	@ 0x93;
static volatile bit	EAN4	@ 0x94;
static volatile bit	EAN5	@ 0x95;
static volatile bit	EAN6	@ 0x96;
static volatile bit	EAN7	@ 0x97;

//Serial Control SCON
static volatile bit	RI	@ 0x98;
static volatile bit	TI	@ 0x99;
static volatile bit	RB8	@ 0x9A;
static 		bit	TB8	@ 0x9B;
static 		bit	REN	@ 0x9C;
static 		bit	SM2	@ 0x9D;
static 		bit	SM1	@ 0x9E;
static 		bit	SM0	@ 0x9F;

//Port 2 P2
static volatile bit	P20	@ 0xA0;
static volatile bit	P21	@ 0xA1;
static volatile bit	P22	@ 0xA2;
static volatile bit	P23	@ 0xA3;
static volatile bit	P24	@ 0xA4;
static volatile bit	P25	@ 0xA5;
static volatile bit	P26	@ 0xA6;
static volatile bit	P27	@ 0xA7;
// Alternate Functions
static volatile bit	A8	@ 0xA0;
static volatile bit	A9	@ 0xA1;
static volatile bit	A10	@ 0xA2;
static volatile bit	A11	@ 0xA3;
static volatile bit	A12	@ 0xA4;
static volatile bit	A13	@ 0xA5;
static volatile bit	A14	@ 0xA6;
static volatile bit	A15	@ 0xA7;

//Interrupt Enable IEN0
static		bit	EX0	@ 0xA8;
static		bit	ET0	@ 0xA9;
static		bit	EX1	@ 0xAA;
static		bit	ET1	@ 0xAB;
static 		bit	ES	@ 0xAC;
static 		bit	ET2	@ 0xAD;
static 		bit	WDT	@ 0xAE;
static 		bit	EA	@ 0xAF;

//Port 3 P3
static volatile bit	P30	@ 0xB0;
static volatile bit	P31	@ 0xB1;
static volatile bit	P32	@ 0xB2;
static volatile bit	P33	@ 0xB3;
static volatile bit	P34	@ 0xB4;
static volatile bit	P35	@ 0xB5;
static volatile bit	P36	@ 0xB6;
static volatile bit	P37	@ 0xB7;
// Alternate Functions
static volatile bit	RXD	@ 0xB0;
static volatile bit	TXD	@ 0xB1;
static volatile bit	INT0	@ 0xB2;
static volatile bit	INT1	@ 0xB3;
static volatile bit	T0	@ 0xB4;
static volatile bit	T1	@ 0xB5;
static volatile bit	WR	@ 0xB6;
static volatile bit	RD	@ 0xB7;

//Interrupt Enable 1 IEN1
static 		bit	EADC	@ 0xB8;
static 		bit	ECAN	@ 0xB9;
static 		bit	EX3	@ 0xBA;
static 		bit	EX4	@ 0xBB;
static 		bit	EX5	@ 0xBC;
static 		bit	EX6	@ 0xBD;
static 		bit	SWDT	@ 0xBE;
static 		bit	EXEN2	@ 0xBF;

//Interrupt Request Control Register IRCON
static volatile	bit	IADC	@ 0xC0;
static volatile	bit	SWI	@ 0xC1;
static volatile	bit	IEX3	@ 0xC2;
static volatile	bit	IEX4	@ 0xC3;
static volatile	bit	IEX5	@ 0xC4;
static volatile	bit	IEX6	@ 0xC5;
static volatile	bit	TF2	@ 0xC6;
static volatile	bit	EXF2	@ 0xC7;

//Timer 2 Control T2CON
static volatile	bit	T2I0	@ 0xC8;
static volatile	bit	T2I1	@ 0xC9;
static volatile	bit	T2CM	@ 0xCA;
static volatile	bit	T2R0	@ 0xCB;
static volatile	bit	T2R1	@ 0xCC;
static volatile	bit	I3FR	@ 0xCE;
static volatile	bit	T2PS	@ 0xCF;

//Program Status Word PSW
static volatile bit	P	@ 0xD0;
static volatile bit	F1	@ 0xD1;
static volatile bit	OV	@ 0xD2;
static 		bit	RS0	@ 0xD3;
static 		bit	RS1	@ 0xD4;
static volatile bit	F0	@ 0xD5;
static volatile bit	AC	@ 0xD6;
static volatile bit	CY	@ 0xD7;

//AD Control 0 ADCON0
static 		bit	MX0	@ 0xD8;
static 		bit	MX1	@ 0xD9;
static 		bit	MX2	@ 0xDA;
static volatile bit	ADM	@ 0xDB;
static volatile bit	BSY	@ 0xDC;
static volatile bit	CLK	@ 0xDE;
static volatile bit	BD	@ 0xDF;

//Accumulator ACC
static volatile bit	ACC0	@ 0xE0;
static volatile bit	ACC1	@ 0xE1;
static volatile bit	ACC2	@ 0xE2;
static volatile bit	ACC3	@ 0xE3;
static volatile bit	ACC4	@ 0xE4;
static volatile bit	ACC5	@ 0xE5;
static volatile bit	ACC6	@ 0xE6;
static volatile bit	ACC7	@ 0xE7;

//Port 4 P4
static volatile bit	P40	@ 0xE8;
static volatile bit	P41	@ 0xE9;
static volatile bit	P42	@ 0xEA;
static volatile bit	P43	@ 0xEB;
static volatile bit	P44	@ 0xEC;
static volatile bit	P45	@ 0xED;
static volatile bit	P46	@ 0xEE;
static volatile bit	P47	@ 0xEF;
// Alternate Functions
static volatile bit	TXDC	@ 0xE8;
static volatile bit	RXDC	@ 0xE9;

//B register
static volatile bit	B0	@ 0xF0;
static volatile bit	B1	@ 0xF1;
static volatile bit	B2	@ 0xF2;
static volatile bit	B3	@ 0xF3;
static volatile bit	B4	@ 0xF4;
static volatile bit	B5	@ 0xF5;
static volatile bit	B6	@ 0xF6;
static volatile bit	B7	@ 0xF7;

/*	Interrupt vectors */
#define	RESET	0
#define	EXTINT0	0x03
#define TIMER0	0x0B
#define	EXTINT1	0x13
#define	TIMER1	0x1B
#define	SERIAL	0x23
#define	TIMER2	0x2B
#define	ADC	0x43
#define	CAN	0x4B
#define	EXTINT3	0x53
#define	EXTINT4	0x5B
#define	EXTINT5	0x63
#define	EXTINT6	0x6B
#define	WUPD	0x7B

#endif
