?? 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<<" ";
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -