AT89X52.BI
用于52兼容MCUConst 变量和 Const 变量在编译的时分运算完By 万致远,sdbc 界说可位寻址的数据类型Type SFR_BIT_ADim SFR_BIT_A As sfr 界说字节地址sfr,假如Type里有和Type名相同的变量,则编译器将把它当作默许变量比方说这个type里边有SFR_BIT_A,那么外部给这个类定位地址,事实上是给这个变量定位地址比方Dim P0 As SFR_BIT_A at &H80,那么P0=0便是相当于MOV #80H,0.然后规划假如需求数字变量名,需求在前面加$,可是假如在类外/类型外引证,则不需求,with句子也需求相似P0.0=1。With P0 .$0=1 End With相同在type内的地址声明将在编译时被固定处理,相似声明P0在0x80,那么$0~$7固定为0x80~0x87Dim $0 As sbit at &SFR_BIT_ADim $1 As sbit at &SFR_BIT_A+1Dim $2 As sbit at &SFR_BIT_A+2Dim $3 As sbit at &SFR_BIT_A+3Dim $4 As sbit at &SFR_BIT_A+4Dim $5 As sbit at &SFR_BIT_A+5Dim $6 As sbit at &SFR_BIT_A+6Dim $7 As sbit at &SFR_BIT_A+7End TypeIO口界说Dim P0 As SFR_BIT_A at &H80声明P0在0x80方位Dim P1 As SFR_BIT_A at &H90声明P1在0x90方位Dim P2 As SFR_BIT_A at &HA0声明P2在0xA0方位Dim P3 As SFR_BIT_A at &HB0声明P3在0xB0方位IO口界说完毕