📄 8255a_3.cpp
字号:
/* 8255a_3.cpp
HD 97413083 YGM
set number to 8255a and then read it into computer
and display every bit on screen
*/
#include "interfac.h"
#include "iostream.h"
#include "string.h"
P8255A p8255a3;
void main()
{
cout<<"press any key to start ! "<<endl;
getch();
p8255a3.SetCtrl(0x80); // 1000 000
int portb=p8255a3.ReadPort(P8255A_B);
for(int i=4;i<8;i++)
{ int abit=p8255a3.GetBit(portb,i);
cout<<"PB"<<i<<"="<<abit<<" ";
}
cout<<endl;
int port_c=p8255a3.ReadPort(P8255A_C);
for(i=0;i<8;i++)
{ int abit=p8255a3.GetBit(port_c,i);
cout<<"PC"<<i<<"="<<abit<<" ";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -