实现io端口直接位定义操作的一个示例(An example of implementing IO port direct bit definition operation)

实现io端口直接位定义操作的一个示例(An example of implementing IO port direct bit definition operation)

ID:41243292

大小:42.50 KB

页数:15页

时间:2019-08-20

实现io端口直接位定义操作的一个示例(An example of implementing IO port direct bit definition operation)_第1页
实现io端口直接位定义操作的一个示例(An example of implementing IO port direct bit definition operation)_第2页
实现io端口直接位定义操作的一个示例(An example of implementing IO port direct bit definition operation)_第3页
实现io端口直接位定义操作的一个示例(An example of implementing IO port direct bit definition operation)_第4页
实现io端口直接位定义操作的一个示例(An example of implementing IO port direct bit definition operation)_第5页
资源描述:

《实现io端口直接位定义操作的一个示例(An example of implementing IO port direct bit definition operation)》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

1、实现io端口直接位定义操作的一个示例(AnexampleofimplementingIOportdirectbitdefinitionoperation)IAR-Csoftwarehasapowerfulsimulationfunction,buttheregisterdefinitionisverycumbersomeoperation,ASMcoderedundancyandcompiled,inordertosolvethisproblem,amethodofselfdefinedmoderatoroperationdefinition,beginnerscanre

2、fertothedefinition,andthismethodcanbeappliedtoallregisterbitoperationdefinition.Atotaloffourbitoperationsareimplemented,suchassetting--Set_Bit,clearing--Clr_Bit,takingreversebitCom_Bit,andtestingbitTest_Bit,Andeachbitoperationdefinitionneedsonlya3byteASMinstructionsequence,whichissimplean

3、ddirect//*****************************************************//P00bitoperationdefinition#defineSet_P00(P0=P0

4、0x1)#defineClr_P00(P0=P0&~0x1)#defineCom_P00(P0=P0^0x1)#defineTest_P00(P0&0x1)//P01bitoperationdefinition#defineSet_P01(P0=P0

5、0x2)#defineClr_P01(P0=P0&~0x2)#defineCom_P01(P0=P0^0x

6、2)#defineTest_P01(P0&0x2)//P02bitoperationdefinition#defineSet_P02(P0=P0

7、0x4)#defineClr_P02(P0=P0&~0x4)#defineCom_P02(P0=P0^0x4)#defineTest_P02(P0&0x4)//P03bitoperationdefinition#defineSet_P03(P0=P0

8、0x8)#defineClr_P03(P0=P0&~0x8)#defineCom_P03(P0=P0^0x8)#defineTest_P03(P0&0x8)//P04bitoper

9、ationdefinition#defineSet_P04(P0=P0

10、0x10)#defineClr_P04(P0=P0&~0x10)#defineCom_P04(P0=P0^0x10)#defineTest_P04(P0&0x10)//P05bitoperationdefinition#defineSet_P05(P0=P0

11、0x20)#defineClr_P05(P0=P0&~0x20)#defineCom_P05(P0=P0^0x20)#defineTest_P05(P0&0x20)//P06bitoperationdefinition#defineSet_P06

12、(P0=P0

13、0x40)#defineClr_P06(P0=P0&~0x40)#defineCom_P06(P0=P0^0x40)#defineTest_P06(P0&0x40)//P07bitoperationdefinition#defineSet_P07(P0=P0

14、0x80)#defineClr_P07(P0=P0&~0x80)#defineCom_P07(P0=P0^0x80)#defineTest_P07(P0&0x80)//*************************************//P1portoperationbitdefinition/

15、/P10bitoperationdefinition#defineSet_P10(P1=P1

16、0x1)#defineClr_P10(P1=P1&~0x1)#defineCom_P10(P1=P1^0x1)#defineTest_P10(P1&0x1)//P11bitoperationdefinition#defineSet_P11(P1=P1

17、0x2)#defineClr_P11(P1=P1&~0x2)#defineCom_P11(P1=P1^0x2)#defineTest_P11(P1&0x2)//P12bitoperati

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。