您的位置 首页 技术

SDBC的特别寄存器(可位寻址的界说办法)

39;AT89X52BI39;用于52兼容MCU39;Const变量和Const变量在编译的时候运算完39;By万致远,sdbc39;定义可位寻址的数据类

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口界说完毕

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/xinpin/jishu/255397.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部