REG52.h就可以了,自己再增加幾個寄存器的定義就可以了,其實就是擴展RAM和看門狗。我一直是這么用516的,我的REG52.H:/**-----------------------------------------------------------------------------*Copyright(c)KEILELEKTRONIKGmbHandFranklinSoftware,Inc.,1987-1992*-----------------------------------------------------------------------------*/
/*8052ProcessorDeclarations*/
/*BYTERegisters*/
sfrP0=0x80;
sfrP1=0x90;
sfrP2=0xA0;
sfrP3=0xB0;
sfrP4=0xE8;/*W78E516*/
sfrCHPENR=0xf6;
sfrSFRAH=0xc5;
sfrSFRAL=0xc4;
sfrSFRFD=0xc6;
sfrSFRCN=0xc7;
sfrCHPCON=0xbf;
sbitP40=0xd8;
sbitP41=0xd9;
sbitP42=0xda;
sbitP43=0xdb;
sfrPSW=0xD0;
sfrACC=0xE0;
sfrB=0xF0;
sfrSP=0x81;
sfrDPL=0x82;
sfrDPH=0x83;
sfrPCON=0x87;
sfrTCON=0x88;
sfrTMOD=0x89;
sfrTL0=0x8A;
sfrTL1=0x8B;
sfrTH0=0x8C;
sfrTH1=0x8D;
sfrIE=0xA8;
sfrIP=0xB8;
sfrSCON=0x98;
sfrSBUF=0x99;/*8052Extensions*/
sfrT2CON=0xC8;
sfrRCAP2L=0xCA;
sfrRCAP2H=0xCB;
sfrTL2=0xCC;
sfrTH2=0xCD;/*BITRegisters*//*PSW*/
sbitCY=0xD7;
sbitAC=0xD6;
sbitF0=0xD5;
sbitRS1=0xD4;
sbitRS0=0xD3;
sbitOV=0xD2;
sbitP=0xD0;/*TCON*/
sbitTF1=0x8F;
sbitTR1=0x8E;
sbitTF0=0x8D;
sbitTR0=0x8C;
sbitIE1=0x8B;
sbitIT1=0x8A;
sbitIE0=0x89;
sbitIT0=0x88;/*IE*/
sbitEA=0xAF;
sbitES=0xAC;
sbitET1=0xAB;
sbitEX1=0xAA;
sbitET0=0xA9;
sbitEX0=0xA8;/*IP*/
sbitPS=0xBC;
sbitPT1=0xBB;
sbitPX1=0xBA;
sbitPT0=0xB9;
sbitPX0=0xB8;/*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