#ifndef __SN8P1819A__H
#define __SN8P1819A__H

void _ClearWatchDogTimer(void);
void _ClrRAM(void);

#define NOP(X)  	__asm{	_NOP X }
#define LOG(X)  	__asm{	LOG CNameToAsmLabel(X) }
sfr	L = 0x80;
sfr	H = 0x81;
sfr	R = 0x82;
sfr	Z = 0x83;
sfr	Y = 0x84;
sfr	X = 0x85;
sfr	PFLAG = 0x86;
sbit	FNT0 = 0x86:7;
sbit	FNPD = 0x86:6;
sbit	FC = 0x86:2;
sbit	FDC = 0x86:1;
sbit	FZ = 0x86:0;
sfr	RBANK = 0x87;
sfr	OPTION = 0x88;
sbit	FRCLK = 0x88:0;
#if ICE_Mode == 1
sfr	LCDM1 = 0XCB;
sbit	FLCDBNK = 0XCB:5;
sbit	FLCDENB = 0XCB:3;
sfr	Dummy = 0X8F;
sbit	FP2SEG = 0X8F:0;
sbit	FBIAS = 0X8F:2;
#else
sfr	LCDM1 = 0x89;
sbit	FLCDBNK = 0x89:5;
sbit	FLCDENB = 0x89:3;
#endif
sfr	PGIACKS = 0x92;
sfr	CPM = 0x95;
sbit	FVCREG1 = 0x95:7;
sbit	FVCREG0 = 0x95:6;
sbit	FAREGENB = 0x95:0;
sfr	CPCKS = 0x96;
sfr	PGIAM = 0x9A;
sbit	FP2GS3 = 0x9A:7;
sbit	FP2GS2 = 0x9A:6;
sbit	FP2GS1 = 0x9A:5;
sbit	FP2GS0 = 0x9A:4;
sbit	FP1GS1 = 0x9A:2;
sbit	FP1GS0 = 0x9A:1;
sbit	FPGIAENB = 0x9A:0;
sfr	OPM = 0x9B;
sbit	FOP2UGB = 0x9B:3;
sbit	FOP1UGB = 0x9B:2;
sbit	FOP2ENB = 0x9B:1;
sbit	FOP1ENB = 0x9B:0;
sfr	P4CON = 0xae;
sfr	ADM = 0xB1;
sbit	FADENB = 0xB1:7;
sbit	FADS = 0xB1:6;
sbit	FEOC = 0xB1:5;
sbit	FGCHS = 0xB1:4;
sbit	FCHS2 = 0xB1:2;
sbit	FCHS1 = 0xB1:1;
sbit	FCHS0 = 0xB1:0;
sfr	ADB = 0xb2;
sfr	ADR = 0xb3;
sbit	FADCKS1 = 0xb3:6;
sbit	FADCKS0 = 0xb3:4;
sbit	FADB3 = 0xb3:3;
sbit	FADB2 = 0xb3:2;
sbit	FADB1 = 0xb3:1;
sbit	FADB0 = 0xb3:0;
sfr	CALIHRCH = 0xBC;
sbit	FCALSTART = 0xBC:7;
sbit	FTC1CALCKS = 0xBC:6;
sbit	FCALIHRCH2 = 0xBC:2;
sbit	FCALIHRCH1 = 0xBC:1;
sbit	FCALIHRCH0 = 0xBC:0;
sfr	CALIHRCL = 0xBD;
sbit	FCALIHRCL5 = 0xBD:5;
sbit	FCALIHRCL4 = 0xBD:4;
sbit	FCALIHRCL3 = 0xBD:3;
sbit	FCALIHRCL2 = 0xBD:2;
sbit	FCALIHRCL1 = 0xBD:1;
sbit	FCALIHRCL0 = 0xBD:0;
sfr	PEDGE = 0xBF;
sbit	FPEDGEN = 0xBF:7;
sbit	FP00G0 = 0xBF:3;
sbit	FP00G1 = 0xBF:4;
sfr	P1W = 0xc0;
sbit	FP15W = 0xc0:5;
sbit	FP14W = 0xc0:4;
sbit	FP13W = 0xc0:3;
sbit	FP12W = 0xc0:2;
sbit	FP11W = 0xc0:1;
sbit	FP10W = 0xc0:0;
sfr	P1M = 0xC1;
sbit	FP15M = 0xC1:5;
sbit	FP14M = 0xC1:4;
sbit	FP13M = 0xC1:3;
sbit	FP12M = 0xC1:2;
sbit	FP11M = 0xC1:1;
sbit	FP10M = 0xC1:0;
sfr	P4M = 0xc4;
sbit	FP43M = 0xc4:3;
sbit	FP42M = 0xc4:2;
sbit	FP41M = 0xc4:1;
sbit	FP40M = 0xc4:0;
sfr	P5M = 0xc5;
sbit	FP56M = 0xc5:6;
sbit	FP55M = 0xc5:5;
sbit	FP54M = 0xc5:4;
sbit	FP53M = 0xc5:3;
sbit	FP52M = 0xc5:2;
sbit	FP51M = 0xc5:1;
sbit	FP50M = 0xc5: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KS = 0xda:3;
sbit	FALOAD0 = 0xda:2;
sbit	FTC0OUT = 0xda:1;
sbit	FPWM0OUT = 0xda:0;
sfr	TC0C = 0xDB;
sfr	TC1M = 0xDC;
sbit	FTC1ENB = 0xDC:7;
sbit	FTC1RATE2 = 0xDC:6;
sbit	FTC1RATE1 = 0xDC:5;
sbit	FTC1RATE0 = 0xDC:4;
sbit	FTC1CKS = 0xDC:3;
sbit	FALOAD1 = 0xDC:2;
sbit	FTC1OUT = 0xDC:1;
sbit	FPWM1OUT = 0xDC:0;
sfr	TC1C = 0xDD;
sfr	TC1R = 0xDE;
sfr	STKP = 0xDF;
sbit	FGIE = 0xDF:7;
sbit	FSTKPB3 = 0xDF:3;
sbit	FSTKPB2 = 0xDF:2;
sbit	FSTKPB1 = 0xDF:1;
sbit	FSTKPB0 = 0xDF:0;
sfr	P1UR = 0xE1;
sbit	FP15R = 0xE1:5;
sbit	FP14R = 0xE1:4;
sbit	FP13R = 0xE1:3;
sbit	FP12R = 0xE1:2;
sbit	FP11R = 0xE1:1;
sbit	FP10R = 0xE1:0;
sfr	P4UR = 0xE4;
sbit	FP43R = 0xE4:3;
sbit	FP42R = 0xE4:2;
sbit	FP41R = 0xE4:1;
sbit	FP40R = 0xE4:0;
sfr	P5UR = 0xE5;
sbit	FP56R = 0xE5:6;
sbit	FP55R = 0xE5:5;
sbit	FP54R = 0xE5:4;
sbit	FP53R = 0xE5:3;
sbit	FP52R = 0xE5:2;
sbit	FP51R = 0xE5:1;
sbit	FP50R = 0xE5:0;
sfr	_HL = 0xE6;
sfr	DP0X = 0xE6;
sfr	_YZ = 0xE7;
sfr	DP1X = 0xE7;
sfr	P1OC = 0xe9;
sbit	FP10OC = 0xe9:0;
sbit	FP11OC = 0xe9:1;
sfr	STK7L = 0xf0;
sfr	STK7H = 0xf1;
sfr	STK6L = 0xf2;
sfr	STK6H = 0xf3;
sfr	STK5L = 0xf4;
sfr	STK5H = 0xf5;
sfr	STK4L = 0xf6;
sfr	STK4H = 0xf7;
sfr	STK3L = 0xf8;
sfr	STK3H = 0xf9;
sfr	STK2L = 0xfa;
sfr	STK2H = 0xfb;
sfr	STK1L = 0xfc;
sfr	STK1H = 0xfd;
sfr	STK0L = 0xfe;
sfr	STK0H = 0xff;
#if ICE_Mode == 1
sfr	P3M = 0xC3;
sbit	FP37M = 0xC3:7;
sbit	FP36M = 0xC3:6;
sbit	FP35M = 0xC3:5;
sbit	FP34M = 0xC3:4;
sbit	FP33M = 0xC3:3;
sbit	FP32M = 0xC3:2;
sbit	FP31M = 0xC3:1;
sbit	FP30M = 0xC3:0;
sfr	P3 = 0xD3;
sbit	FP37 = 0xD3:7;
sbit	FP36 = 0xD3:6;
sbit	FP35 = 0xD3:5;
sbit	FP34 = 0xD3:4;
sbit	FP33 = 0xD3:3;
sbit	FP32 = 0xD3:2;
sbit	FP31 = 0xD3:1;
sbit	FP30 = 0xD3:0;
sfr	P3UR = 0xE3;
sbit	FP37R = 0xE3:7;
sbit	FP36R = 0xE3:6;
sbit	FP35R = 0xE3:5;
sbit	FP34R = 0xE3:4;
sbit	FP33R = 0xE3:3;
sbit	FP32R = 0xE3:2;
sbit	FP31R = 0xE3:1;
sbit	FP30R = 0xE3:0;
#endif
#endif
