#ifndef __SN8P1829__H
#define __SN8P1829__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;
sbit	FRBNKS0 = 0x87:0;
sbit	FRBNKS1 = 0x87:1;
sbit	FRBNKS2 = 0x87:2;
sbit	FRBNKS3 = 0x87:3;
sfr	OPTION = 0x88;
sbit	FRTCM1 = 0x88:3;
sbit	FRTCM0 = 0x88:2;
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;
sbit	FBIAS = 0x89:2;
sbit	FP2SEG = 0x89:0;
#endif
sfr	PGIACKS = 0x92;
sfr	CPM = 0x95;
sbit	FCPSTS = 0x95:3;
sbit	FCPAUTO = 0x95:2;
sbit	FCPON = 0x95:1;
sbit	FCPRENB = 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	FOP2ENB = 0x9B:1;
sbit	FOP1ENB = 0x9B:0;
sfr	ADM = 0xB1;
sbit	FADENB = 0xB1:7;
sbit	FADS = 0xB1:6;
sbit	FEOC = 0xB1:5;
sbit	FGCHS = 0xB1:4;
sbit	FCHS1 = 0xB1:1;
sbit	FCHS0 = 0xB1:0;
sfr	ADB = 0xb2;
sfr	ADR = 0xb3;
sbit	FADCKS1 = 0xb3:6;
sbit	FADLEN = 0xb3:5;
sbit	FADCKS0 = 0xb3:4;
sbit	FADB3 = 0xb3:3;
sbit	FADB2 = 0xb3:2;
sbit	FADB1 = 0xb3:1;
sbit	FADB0 = 0xb3:0;
sfr	SIOM = 0xB4;
sbit	FSENB = 0xB4:7;
sbit	FSTART = 0xB4:6;
sbit	FSRATE1 = 0xB4:5;
sbit	FSRATE0 = 0xB4:4;
sbit	FSIG = 0xB4:3;
sbit	FSCKMD = 0xB4:2;
sbit	FSEDGE = 0xB4:1;
sbit	FTXRX = 0xB4:0;
sfr	SIOR = 0xB5;
sfr	SIOB = 0xB6;
sfr	PEDGE = 0xBF;
sbit	FPEDGEN = 0xBF:7;
sbit	FP00G0 = 0xBF:3;
sbit	FP00G1 = 0xBF:4;
sfr	P1W = 0xc0;
sbit	FP13W = 0xc0:3;
sbit	FP12W = 0xc0:2;
sbit	FP11W = 0xc0:1;
sbit	FP10W = 0xc0:0;
sfr	P1M = 0xC1;
sbit	FP13M = 0xC1:3;
sbit	FP12M = 0xC1:2;
sbit	FP11M = 0xC1:1;
sbit	FP10M = 0xC1:0;
sfr	P5M = 0xc5;
sbit	FP54M = 0xc5:4;
sbit	FP53M = 0xc5:3;
sbit	FP52M = 0xc5:2;
sbit	FP51M = 0xc5:1;
sbit	FP50M = 0xc5:0;
sfr	INTRQ = 0xc8;
sbit	FTC1IRQ = 0xc8:6;
sbit	FTC0IRQ = 0xc8:5;
sbit	FT0IRQ = 0xc8:4;
sbit	FSIOIRQ = 0xc8:3;
sbit	FP01IRQ = 0xc8:1;
sbit	FP00IRQ = 0xc8:0;
sfr	INTEN = 0xc9;
sbit	FTC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TC0CKS = 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	P0UR = 0xE0;
sbit	FP01R = 0xE0:1;
sbit	FP00R = 0xE0:0;
sfr	P1UR = 0xE1;
sbit	FP13R = 0xE1:3;
sbit	FP12R = 0xE1:2;
sbit	FP11R = 0xE1:1;
sbit	FP10R = 0xE1:0;
sfr	P2UR = 0xE2;
sbit	FP27R = 0xE2:7;
sbit	FP26R = 0xE2:6;
sbit	FP25R = 0xE2:5;
sbit	FP24R = 0xE2:4;
sbit	FP23R = 0xE2:3;
sbit	FP22R = 0xE2:2;
sbit	FP21R = 0xE2:1;
sbit	FP20R = 0xE2:0;
sfr	P5UR = 0xE5;
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	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
