
# 1 "E:\PROJECT\应用方案\@应用相关文档整理\HS16F3211应用示范例程\HS16F3211_EEPROM\HS16F3211_EEPROM.c"

# 19 "C:\Users\Administrator\Desktop\HSIDE_V2.0.0.6_Beta2.0\include\hs16f3211.h"
volatile unsigned char INDF @ 0x000;




volatile unsigned char TMR0 @ 0x001;




volatile unsigned char PCL @ 0x002;




volatile unsigned char STATUS @ 0x003;

volatile bit CARRY @ ((unsigned)&STATUS*8)+0;
volatile bit C @ ((unsigned)&STATUS*8)+0;
volatile bit DC @ ((unsigned)&STATUS*8)+1;
volatile bit Z @ ((unsigned)&STATUS*8)+2;
volatile bit ZERO @ ((unsigned)&STATUS*8)+2;
volatile bit NPD @ ((unsigned)&STATUS*8)+3;
volatile bit nPD @ ((unsigned)&STATUS*8)+3;
volatile bit NTO @ ((unsigned)&STATUS*8)+4;
volatile bit nTO @ ((unsigned)&STATUS*8)+4;
volatile bit RP0 @ ((unsigned)&STATUS*8)+5;
volatile bit RP1 @ ((unsigned)&STATUS*8)+6;
volatile bit RST @ ((unsigned)&STATUS*8)+7;
volatile bit IRP @ ((unsigned)&STATUS*8)+7;


volatile unsigned char FSR @ 0x004;
volatile bit FSR_7 @ ((unsigned)&FSR*8)+7;



volatile unsigned char PORTA @ 0x005;
volatile unsigned char RA @ 0x005;
volatile unsigned char PA @ 0x005;

volatile bit FIOA0 @ ((unsigned)&PORTA*8)+0;
volatile bit FIOA1 @ ((unsigned)&PORTA*8)+1;
volatile bit FIOA2 @ ((unsigned)&PORTA*8)+2;
volatile bit FIOA3 @ ((unsigned)&PORTA*8)+3;
volatile bit FIOA4 @ ((unsigned)&PORTA*8)+4;
volatile bit FIOA5 @ ((unsigned)&PORTA*8)+5;
volatile bit FIOA6 @ ((unsigned)&PORTA*8)+6;
volatile bit FIOA7 @ ((unsigned)&PORTA*8)+7;

volatile bit IOA0 @ ((unsigned)&PORTA*8)+0;
volatile bit IOA1 @ ((unsigned)&PORTA*8)+1;
volatile bit IOA2 @ ((unsigned)&PORTA*8)+2;
volatile bit IOA3 @ ((unsigned)&PORTA*8)+3;
volatile bit IOA4 @ ((unsigned)&PORTA*8)+4;
volatile bit IOA5 @ ((unsigned)&PORTA*8)+5;
volatile bit IOA6 @ ((unsigned)&PORTA*8)+6;
volatile bit IOA7 @ ((unsigned)&PORTA*8)+7;

volatile bit FRA0 @ ((unsigned)&PORTA*8)+0;
volatile bit FRA1 @ ((unsigned)&PORTA*8)+1;
volatile bit FRA2 @ ((unsigned)&PORTA*8)+2;
volatile bit FRA3 @ ((unsigned)&PORTA*8)+3;
volatile bit FRA4 @ ((unsigned)&PORTA*8)+4;
volatile bit FRA5 @ ((unsigned)&PORTA*8)+5;
volatile bit FRA6 @ ((unsigned)&PORTA*8)+6;
volatile bit FRA7 @ ((unsigned)&PORTA*8)+7;

volatile bit RA0 @ ((unsigned)&PORTA*8)+0;
volatile bit RA1 @ ((unsigned)&PORTA*8)+1;
volatile bit RA2 @ ((unsigned)&PORTA*8)+2;
volatile bit RA3 @ ((unsigned)&PORTA*8)+3;
volatile bit RA4 @ ((unsigned)&PORTA*8)+4;
volatile bit RA5 @ ((unsigned)&PORTA*8)+5;
volatile bit RA6 @ ((unsigned)&PORTA*8)+6;
volatile bit RA7 @ ((unsigned)&PORTA*8)+7;

volatile bit FPA0 @ ((unsigned)&PORTA*8)+0;
volatile bit FPA1 @ ((unsigned)&PORTA*8)+1;
volatile bit FPA2 @ ((unsigned)&PORTA*8)+2;
volatile bit FPA3 @ ((unsigned)&PORTA*8)+3;
volatile bit FPA4 @ ((unsigned)&PORTA*8)+4;
volatile bit FPA5 @ ((unsigned)&PORTA*8)+5;
volatile bit FPA6 @ ((unsigned)&PORTA*8)+6;
volatile bit FPA7 @ ((unsigned)&PORTA*8)+7;

volatile bit PA0 @ ((unsigned)&PORTA*8)+0;
volatile bit PA1 @ ((unsigned)&PORTA*8)+1;
volatile bit PA2 @ ((unsigned)&PORTA*8)+2;
volatile bit PA3 @ ((unsigned)&PORTA*8)+3;
volatile bit PA4 @ ((unsigned)&PORTA*8)+4;
volatile bit PA5 @ ((unsigned)&PORTA*8)+5;
volatile bit PA6 @ ((unsigned)&PORTA*8)+6;
volatile bit PA7 @ ((unsigned)&PORTA*8)+7;



volatile unsigned char PORTB @ 0x006;
volatile unsigned char RB @ 0x006;
volatile unsigned char PB @ 0x006;

volatile bit FIOB0 @ ((unsigned)&PORTB*8)+0;
volatile bit FIOB1 @ ((unsigned)&PORTB*8)+1;
volatile bit FIOB2 @ ((unsigned)&PORTB*8)+2;
volatile bit FIOB3 @ ((unsigned)&PORTB*8)+3;
volatile bit FIOB4 @ ((unsigned)&PORTB*8)+4;
volatile bit FIOB5 @ ((unsigned)&PORTB*8)+5;
volatile bit FIOB6 @ ((unsigned)&PORTB*8)+6;
volatile bit FIOB7 @ ((unsigned)&PORTB*8)+7;

volatile bit IOB0 @ ((unsigned)&PORTB*8)+0;
volatile bit IOB1 @ ((unsigned)&PORTB*8)+1;
volatile bit IOB2 @ ((unsigned)&PORTB*8)+2;
volatile bit IOB3 @ ((unsigned)&PORTB*8)+3;
volatile bit IOB4 @ ((unsigned)&PORTB*8)+4;
volatile bit IOB5 @ ((unsigned)&PORTB*8)+5;
volatile bit IOB6 @ ((unsigned)&PORTB*8)+6;
volatile bit IOB7 @ ((unsigned)&PORTB*8)+7;

volatile bit FRB0 @ ((unsigned)&PORTB*8)+0;
volatile bit FRB1 @ ((unsigned)&PORTB*8)+1;
volatile bit FRB2 @ ((unsigned)&PORTB*8)+2;
volatile bit FRB3 @ ((unsigned)&PORTB*8)+3;
volatile bit FRB4 @ ((unsigned)&PORTB*8)+4;
volatile bit FRB5 @ ((unsigned)&PORTB*8)+5;
volatile bit FRB6 @ ((unsigned)&PORTB*8)+6;
volatile bit FRB7 @ ((unsigned)&PORTB*8)+7;

volatile bit RB0 @ ((unsigned)&PORTB*8)+0;
volatile bit RB1 @ ((unsigned)&PORTB*8)+1;
volatile bit RB2 @ ((unsigned)&PORTB*8)+2;
volatile bit RB3 @ ((unsigned)&PORTB*8)+3;
volatile bit RB4 @ ((unsigned)&PORTB*8)+4;
volatile bit RB5 @ ((unsigned)&PORTB*8)+5;
volatile bit RB6 @ ((unsigned)&PORTB*8)+6;
volatile bit RB7 @ ((unsigned)&PORTB*8)+7;

volatile bit FPB0 @ ((unsigned)&PORTB*8)+0;
volatile bit FPB1 @ ((unsigned)&PORTB*8)+1;
volatile bit FPB2 @ ((unsigned)&PORTB*8)+2;
volatile bit FPB3 @ ((unsigned)&PORTB*8)+3;
volatile bit FPB4 @ ((unsigned)&PORTB*8)+4;
volatile bit FPB5 @ ((unsigned)&PORTB*8)+5;
volatile bit FPB6 @ ((unsigned)&PORTB*8)+6;
volatile bit FPB7 @ ((unsigned)&PORTB*8)+7;

volatile bit PB0 @ ((unsigned)&PORTB*8)+0;
volatile bit PB1 @ ((unsigned)&PORTB*8)+1;
volatile bit PB2 @ ((unsigned)&PORTB*8)+2;
volatile bit PB3 @ ((unsigned)&PORTB*8)+3;
volatile bit PB4 @ ((unsigned)&PORTB*8)+4;
volatile bit PB5 @ ((unsigned)&PORTB*8)+5;
volatile bit PB6 @ ((unsigned)&PORTB*8)+6;
volatile bit PB7 @ ((unsigned)&PORTB*8)+7;


volatile unsigned char W_REG @ 0x007;


volatile unsigned char PCHBUF @ 0x00A;



volatile unsigned char INTEN @ 0x00B;

volatile bit FT0IE @ ((unsigned)&INTEN*8)+0;
volatile bit FPBIE @ ((unsigned)&INTEN*8)+1;
volatile bit FINTIE @ ((unsigned)&INTEN*8)+2;
volatile bit FTC0IE @ ((unsigned)&INTEN*8)+3;
volatile bit FTP0IE @ ((unsigned)&INTEN*8)+4;
volatile bit FINT1IE @ ((unsigned)&INTEN*8)+5;
volatile bit FGIE @ ((unsigned)&INTEN*8)+7;

volatile bit T0IE @ ((unsigned)&INTEN*8)+0;
volatile bit PBIE @ ((unsigned)&INTEN*8)+1;
volatile bit INTIE @ ((unsigned)&INTEN*8)+2;
volatile bit TC0IE @ ((unsigned)&INTEN*8)+3;
volatile bit TP0IE @ ((unsigned)&INTEN*8)+4;
volatile bit INT1IE @ ((unsigned)&INTEN*8)+5;
volatile bit GIE @ ((unsigned)&INTEN*8)+7;


volatile unsigned char INTFLAG @ 0x00C;

volatile bit FT0IF @ ((unsigned)&INTFLAG*8)+0;
volatile bit FPBIF @ ((unsigned)&INTFLAG*8)+1;
volatile bit FINTIF @ ((unsigned)&INTFLAG*8)+2;
volatile bit FTC0IF @ ((unsigned)&INTFLAG*8)+3;
volatile bit FTP0IF @ ((unsigned)&INTFLAG*8)+4;
volatile bit FINT1IF @ ((unsigned)&INTFLAG*8)+5;

volatile bit T0IF @ ((unsigned)&INTFLAG*8)+0;
volatile bit PBIF @ ((unsigned)&INTFLAG*8)+1;
volatile bit INTIF @ ((unsigned)&INTFLAG*8)+2;
volatile bit TC0IF @ ((unsigned)&INTFLAG*8)+3;
volatile bit TP0IF @ ((unsigned)&INTFLAG*8)+4;
volatile bit INT1IF @ ((unsigned)&INTFLAG*8)+5;


volatile unsigned char INTFLAG1 @ 0x0D;

volatile bit FTKINTF @ ((unsigned)&INTFLAG1*8)+0;
volatile bit FCOMINTF @ ((unsigned)&INTFLAG1*8)+1;

volatile bit TKINTF @ ((unsigned)&INTFLAG1*8)+0;
volatile bit COMINTF @ ((unsigned)&INTFLAG1*8)+1;



volatile unsigned char PDCON @ 0x00E;




volatile unsigned char ODCON @ 0x00F;

# 239
volatile unsigned char PHCON @ 0x010;



volatile unsigned char TC0L @ 0x011;



volatile unsigned char TC0M @ 0x012;

volatile bit FPWM0 @ ((unsigned)&TC0M*8)+0;
volatile bit FBUZ @ ((unsigned)&TC0M*8)+1;
volatile bit FT16SEL @ ((unsigned)&TC0M*8)+2;
volatile bit FTCCKS @ ((unsigned)&TC0M*8)+3;
volatile bit FTC0S0 @ ((unsigned)&TC0M*8)+4;
volatile bit FTC0S1 @ ((unsigned)&TC0M*8)+5;
volatile bit FTC0S2 @ ((unsigned)&TC0M*8)+6;
volatile bit FTC0TR @ ((unsigned)&TC0M*8)+7;

volatile bit PWM0 @ ((unsigned)&TC0M*8)+0;
volatile bit BUZ @ ((unsigned)&TC0M*8)+1;
volatile bit T16SEL @ ((unsigned)&TC0M*8)+2;
volatile bit TCCKS @ ((unsigned)&TC0M*8)+3;
volatile bit TC0S0 @ ((unsigned)&TC0M*8)+4;
volatile bit TC0S1 @ ((unsigned)&TC0M*8)+5;
volatile bit TC0S2 @ ((unsigned)&TC0M*8)+6;
volatile bit TC0TR @ ((unsigned)&TC0M*8)+7;


volatile unsigned char TC0R @ 0x013;



volatile unsigned char TC0H @ 0x014;




volatile unsigned char TC0D1 @ 0x015;




volatile unsigned char TC0D2 @ 0x016;




volatile unsigned char PWMCON @ 0x017;

volatile bit FPWM1EN @ ((unsigned)&PWMCON*8)+0;
volatile bit FPWM2EN @ ((unsigned)&PWMCON*8)+1;
volatile bit FPWM1S @ ((unsigned)&PWMCON*8)+2;
volatile bit FPWM2S @ ((unsigned)&PWMCON*8)+3;
volatile bit FPWM1XR0 @ ((unsigned)&PWMCON*8)+4;
volatile bit FPWM1XR1 @ ((unsigned)&PWMCON*8)+5;
volatile bit FPWM2XR0 @ ((unsigned)&PWMCON*8)+6;
volatile bit FPWM2XR1 @ ((unsigned)&PWMCON*8)+7;

volatile bit PWM1EN @ ((unsigned)&PWMCON*8)+0;
volatile bit PWM2EN @ ((unsigned)&PWMCON*8)+1;
volatile bit PWM1S @ ((unsigned)&PWMCON*8)+2;
volatile bit PWM2S @ ((unsigned)&PWMCON*8)+3;
volatile bit PWM1XR0 @ ((unsigned)&PWMCON*8)+4;
volatile bit PWM1XR1 @ ((unsigned)&PWMCON*8)+5;
volatile bit PWM2XR0 @ ((unsigned)&PWMCON*8)+6;
volatile bit PWM2XR1 @ ((unsigned)&PWMCON*8)+7;

# 318
volatile unsigned char OPTION_REG @ 0x081;


volatile bit FPS0 @ ((unsigned)&OPTION_REG*8)+0;
volatile bit FPS1 @ ((unsigned)&OPTION_REG*8)+1;
volatile bit FS2 @ ((unsigned)&OPTION_REG*8)+2;
volatile bit FSA @ ((unsigned)&OPTION_REG*8)+3;
volatile bit FT0SE @ ((unsigned)&OPTION_REG*8)+4;
volatile bit FT0CS @ ((unsigned)&OPTION_REG*8)+5;
volatile bit FINTEDG @ ((unsigned)&OPTION_REG*8)+6;
volatile bit FINTEDG1 @ ((unsigned)&OPTION_REG*8)+7;

volatile bit PS0 @ ((unsigned)&OPTION_REG*8)+0;
volatile bit PS1 @ ((unsigned)&OPTION_REG*8)+1;
volatile bit S2 @ ((unsigned)&OPTION_REG*8)+2;
volatile bit FSA @ ((unsigned)&OPTION_REG*8)+3;
volatile bit T0SE @ ((unsigned)&OPTION_REG*8)+4;
volatile bit T0CS @ ((unsigned)&OPTION_REG*8)+5;
volatile bit INTEDG @ ((unsigned)&OPTION_REG*8)+6;
volatile bit INTEDG1 @ ((unsigned)&OPTION_REG*8)+7;


volatile unsigned char TRISA @ 0x085;




volatile unsigned char TRISB @ 0x086;

# 352
volatile unsigned char INTEN1 @ 0x08D;

volatile bit FTKINTEN @ ((unsigned)&INTEN1*8)+0;
volatile bit FCOMINTEN @ ((unsigned)&INTEN1*8)+1;
volatile bit TKINTEN @ ((unsigned)&INTEN1*8)+0;
volatile bit COMINTEN @ ((unsigned)&INTEN1*8)+1;



volatile unsigned char CHIPCON @ 0x08E;
volatile unsigned char PCON @ 0x08E;

volatile bit FLVDTE @ ((unsigned)&PCON*8)+5;
volatile bit FEIS @ ((unsigned)&PCON*8)+6;
volatile bit FWDTE @ ((unsigned)&PCON*8)+7;

volatile bit LVDTE @ ((unsigned)&PCON*8)+5;
volatile bit EIS @ ((unsigned)&PCON*8)+6;
volatile bit WDTE @ ((unsigned)&PCON*8)+7;



volatile unsigned char WUCON @ 0x08F;

# 380
volatile unsigned char PAIC0 @ 0x090;



volatile unsigned char PBIC0 @ 0x091;



volatile unsigned char PAHCON @ 0x092;



volatile unsigned char PADCON @ 0x093;

volatile bit FPADC4 @ ((unsigned)&PADCON*8)+4;
volatile bit FPADC5 @ ((unsigned)&PADCON*8)+5;

volatile bit PADC4 @ ((unsigned)&PADCON*8)+4;
volatile bit PADC5 @ ((unsigned)&PADCON*8)+5;

# 404
volatile unsigned char OSCM @ 0x094;

volatile bit FCLKMD @ ((unsigned)&OSCM*8)+0;
volatile bit FSTPHX @ ((unsigned)&OSCM*8)+1;
volatile bit FXTSEL @ ((unsigned)&OSCM*8)+2;
volatile bit FSLCON @ ((unsigned)&OSCM*8)+3;
volatile bit FSLT0CON @ ((unsigned)&OSCM*8)+4;
volatile bit FGREENEN @ ((unsigned)&OSCM*8)+5;
volatile bit FWAKEMODE @ ((unsigned)&OSCM*8)+6;

volatile bit CLKMD @ ((unsigned)&OSCM*8)+0;
volatile bit STPHX @ ((unsigned)&OSCM*8)+1;
volatile bit XTSEL @ ((unsigned)&OSCM*8)+2;
volatile bit SLCON @ ((unsigned)&OSCM*8)+3;
volatile bit SLT0CON @ ((unsigned)&OSCM*8)+4;
volatile bit GREENEN @ ((unsigned)&OSCM*8)+5;
volatile bit WAKEMODE @ ((unsigned)&OSCM*8)+6;

# 426
volatile unsigned char EEADR @ 0x10D;
volatile unsigned char EEADRL @ 0x10D;



volatile unsigned char EEDATL @ 0x10E;



volatile unsigned char EEADRH @ 0x10F;



volatile unsigned char EECON @ 0x110;
volatile unsigned char EECON1 @ 0x110;

volatile bit FREADEE @ ((unsigned)&EECON*8)+0;
volatile bit FPROGEE @ ((unsigned)&EECON*8)+1;
volatile bit FERASEEE @ ((unsigned)&EECON*8)+2;
volatile bit FERSALLEE @ ((unsigned)&EECON*8)+3;
volatile bit FTIMEEE @ ((unsigned)&EECON*8)+6;

volatile bit READEE @ ((unsigned)&EECON*8)+0;
volatile bit PROGEE @ ((unsigned)&EECON*8)+1;
volatile bit ERASEEE @ ((unsigned)&EECON*8)+2;
volatile bit ERSALLEE @ ((unsigned)&EECON*8)+3;
volatile bit TIMEEE @ ((unsigned)&EECON*8)+6;




volatile unsigned char PWM0EN @ 0x111;

volatile bit FPWM0_EN @ ((unsigned)&PWM0EN*8)+0;
volatile bit FPWM0_OEN @ ((unsigned)&PWM0EN*8)+1;
volatile bit FPWM01_OEN @ ((unsigned)&PWM0EN*8)+2;
volatile bit FPWM0M @ ((unsigned)&PWM0EN*8)+3;
volatile bit FPWM1_OEN @ ((unsigned)&PWM0EN*8)+4;
volatile bit FTP0SEL8 @ ((unsigned)&PWM0EN*8)+5;
volatile bit FTP0EN @ ((unsigned)&PWM0EN*8)+7;

volatile bit PWM0_EN @ ((unsigned)&PWM0EN*8)+0;
volatile bit PWM0_OEN @ ((unsigned)&PWM0EN*8)+1;
volatile bit PWM01_OEN @ ((unsigned)&PWM0EN*8)+2;
volatile bit PWM0M @ ((unsigned)&PWM0EN*8)+3;
volatile bit PWM1_OEN @ ((unsigned)&PWM0EN*8)+4;
volatile bit TP0SEL8 @ ((unsigned)&PWM0EN*8)+5;
volatile bit TP0EN @ ((unsigned)&PWM0EN*8)+7;


volatile unsigned char PWM0C @ 0x112;



volatile unsigned char PWM0TL @ 0x113;



volatile unsigned char PWM0TH @ 0x114;




volatile unsigned char PWM0PL @ 0x115;



volatile unsigned char PWM0PH @ 0x116;



volatile unsigned char PWM0DL @ 0x117;




volatile unsigned char PWM0DH @ 0x118;



volatile unsigned char PWM0DTL @ 0x119;



volatile unsigned char PWM0DTH @ 0x11A;



volatile unsigned char PWMPSCON @ 0x11B;



volatile unsigned char PWM1DL @ 0x011C;



volatile unsigned char PWM1DH @ 0x11D;

# 530
volatile unsigned char FLCON1 @ 0x18E;

volatile bit FREADL @ ((unsigned)&FLCON1*8)+0;
volatile bit FPROGL @ ((unsigned)&FLCON1*8)+1;
volatile bit FERASEL @ ((unsigned)&FLCON1*8)+2;
volatile bit FTIMEL @ ((unsigned)&FLCON1*8)+6;
volatile bit FCEFL @ ((unsigned)&FLCON1*8)+7;

volatile bit READL @ ((unsigned)&FLCON1*8)+0;
volatile bit PROGL @ ((unsigned)&FLCON1*8)+1;
volatile bit ERASEL @ ((unsigned)&FLCON1*8)+2;
volatile bit TIMEL @ ((unsigned)&FLCON1*8)+6;
volatile bit CEFL @ ((unsigned)&FLCON1*8)+7;


volatile unsigned char FLCON2 @ 0x18F;




volatile unsigned char FLADRH @ 0x190;




volatile unsigned char FLADRL @ 0x191;



volatile unsigned char FLDATH @ 0x192;




volatile unsigned char FLDATL @ 0x193;



volatile unsigned char FLEF @ 0x194;
volatile unsigned char FLerrf @ 0x194;



volatile unsigned char TKC0 @ 0x195;

volatile bit FTKPS_0 @ ((unsigned)&TKC0*8)+0;
volatile bit FTKPS_1 @ ((unsigned)&TKC0*8)+1;
volatile bit FTKPS_2 @ ((unsigned)&TKC0*8)+2;
volatile bit FTKPS_3 @ ((unsigned)&TKC0*8)+3;
volatile bit FCVS @ ((unsigned)&TKC0*8)+4;
volatile bit FTKST @ ((unsigned)&TKC0*8)+6;
volatile bit FTKEN @ ((unsigned)&TKC0*8)+7;

volatile bit TKPS_0 @ ((unsigned)&TKC0*8)+0;
volatile bit TKPS_1 @ ((unsigned)&TKC0*8)+1;
volatile bit TKPS_2 @ ((unsigned)&TKC0*8)+2;
volatile bit TKPS_3 @ ((unsigned)&TKC0*8)+3;
volatile bit CVS @ ((unsigned)&TKC0*8)+4;
volatile bit TKST @ ((unsigned)&TKC0*8)+6;
volatile bit TKEN @ ((unsigned)&TKC0*8)+7;



volatile unsigned char TK16DH @ 0x196;



volatile unsigned char TK16DL @ 0x197;



volatile unsigned char TKC1 @ 0x198;

volatile bit FDCTS_0 @ ((unsigned)&TKC1*8)+0;
volatile bit FDCTS_1 @ ((unsigned)&TKC1*8)+1;
volatile bit FCCFLT_0 @ ((unsigned)&TKC1*8)+4;
volatile bit FCCFLT_1 @ ((unsigned)&TKC1*8)+5;
volatile bit FCCFLT_2 @ ((unsigned)&TKC1*8)+6;

volatile bit DCTS_0 @ ((unsigned)&TKC1*8)+0;
volatile bit DCTS_1 @ ((unsigned)&TKC1*8)+1;
volatile bit CCFLT_0 @ ((unsigned)&TKC1*8)+4;
volatile bit CCFLT_1 @ ((unsigned)&TKC1*8)+5;
volatile bit CCFLT_2 @ ((unsigned)&TKC1*8)+6;


volatile unsigned char TKC2 @ 0x199;



volatile unsigned char TKC3 @ 0x19A;

volatile bit FCVREFS_0 @ ((unsigned)&TKC3*8)+0;
volatile bit FCVREFS_1 @ ((unsigned)&TKC3*8)+1;
volatile bit FCPVS_0 @ ((unsigned)&TKC3*8)+3;
volatile bit FCPVS_1 @ ((unsigned)&TKC3*8)+4;

volatile bit CVREFS_0 @ ((unsigned)&TKC3*8)+0;
volatile bit CVREFS_1 @ ((unsigned)&TKC3*8)+1;
volatile bit CPVS_0 @ ((unsigned)&TKC3*8)+3;
volatile bit CPVS_1 @ ((unsigned)&TKC3*8)+4;


volatile unsigned char TKSTA @ 0x19B;

volatile bit FSACMPO @ ((unsigned)&TKSTA*8)+1;
volatile bit FACMPO @ ((unsigned)&TKSTA*8)+2;
volatile bit FDCMPO @ ((unsigned)&TKSTA*8)+3;
volatile bit FTMOUT @ ((unsigned)&TKSTA*8)+7;

volatile bit SACMPO @ ((unsigned)&TKSTA*8)+1;
volatile bit ACMPO @ ((unsigned)&TKSTA*8)+2;
volatile bit DCMPO @ ((unsigned)&TKSTA*8)+3;
volatile bit TMOUT @ ((unsigned)&TKSTA*8)+7;



volatile unsigned char TKPDH @ 0x19C;



volatile unsigned char TKPDL @ 0x19D;



volatile unsigned char CMPCON @ 0x19E;

volatile bit FCOPOL @ ((unsigned)&CMPCON*8)+1;
volatile bit FCVEN @ ((unsigned)&CMPCON*8)+2;
volatile bit FCPEN @ ((unsigned)&CMPCON*8)+3;
volatile bit FCODEB @ ((unsigned)&CMPCON*8)+4;
volatile bit FFTCKS @ ((unsigned)&CMPCON*8)+5;
volatile bit FCMPIF @ ((unsigned)&CMPCON*8)+6;
volatile bit FCMPEN @ ((unsigned)&CMPCON*8)+7;

volatile bit COPOL @ ((unsigned)&CMPCON*8)+1;
volatile bit CVEN @ ((unsigned)&CMPCON*8)+2;
volatile bit CPEN @ ((unsigned)&CMPCON*8)+3;
volatile bit CODEB @ ((unsigned)&CMPCON*8)+4;
volatile bit FTCKS @ ((unsigned)&CMPCON*8)+5;
volatile bit CMPIF @ ((unsigned)&CMPCON*8)+6;
volatile bit CMPEN @ ((unsigned)&CMPCON*8)+7;


volatile unsigned char CMPM @ 0x19F;

volatile bit FVRS0 @ ((unsigned)&CMPM*8)+0;
volatile bit FVRS1 @ ((unsigned)&CMPM*8)+1;
volatile bit FVRS2 @ ((unsigned)&CMPM*8)+2;
volatile bit FVRS3 @ ((unsigned)&CMPM*8)+3;
volatile bit FXRVSEL @ ((unsigned)&CMPM*8)+4;
volatile bit FCPINS0 @ ((unsigned)&CMPM*8)+5;
volatile bit FCPINS1 @ ((unsigned)&CMPM*8)+6;

volatile bit VRS0 @ ((unsigned)&CMPM*8)+0;
volatile bit VRS1 @ ((unsigned)&CMPM*8)+1;
volatile bit VRS2 @ ((unsigned)&CMPM*8)+2;
volatile bit VRS3 @ ((unsigned)&CMPM*8)+3;
volatile bit XRVSEL @ ((unsigned)&CMPM*8)+4;
volatile bit CPINS0 @ ((unsigned)&CMPM*8)+5;
volatile bit CPINS1 @ ((unsigned)&CMPM*8)+6;

# 27 "E:\PROJECT\应用方案\@应用相关文档整理\HS16F3211应用示范例程\HS16F3211_EEPROM\HS16F3211_EEPROM.c"
void GPIO_Init(void)
{
OPTION_REG= 0b00000000;

# 36
PORTA = 0b00000000;
TRISA = 0b00000000;

PORTB = 0b00000000;
TRISB = 0b00000000;

}

# 49
void delay_ms(unsigned int x)
{
unsigned int m,n;
for(m=0;m<x;m++)
{
for(n=0;n<140;n++)
asm("clrwdt");
}
}

# 65
void EEPROM_Write_1Byte(unsigned char EEPROM_Addr,unsigned char EEPROM_Data)
{
EECON = 0x00;

# 77
FTIMEEE = 1;
EEADR = EEPROM_Addr;
asm("NOP");
FERASEEE = 1;
asm("NOP");
while(FERASEEE);
EEDATL = EEPROM_Data;
FPROGEE = 1;
while(FPROGEE);
delay_ms(5);

}

# 96
unsigned char EEPROM_Read_1Byte(unsigned char EEPROM_Addr)
{
unsigned char ReadEeprom_Data=0x00;
EECON = 0x00;

# 108
EEADR = EEPROM_Addr;
FREADEE = 1;
asm("NOP");
ReadEeprom_Data = EEDATL;
return ReadEeprom_Data;
}


void main(void)
{
asm("clrwdt");
GPIO_Init();
EEPROM_Write_1Byte(0X10,0X5A);
while(1)
{
asm("clrwdt");
if(EEPROM_Read_1Byte(0X10)==0X5A)
{
FPB0=~FPB0;
}
delay_ms(100);
}
}

