//--------------------------------------------------------------------------- #include #pragma hdrstop #include "Unit1.h" #include "stdio.h" #include "bcbio.h" #define outpoartb 0x200 //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent *Owner) : TForm(Owner) { int address[2]={0x203,0x243}; char port[3]={'c','b','a'}; int a[2]={0x0aa,0x55}; int code=0; int i,j,count; for (i=0;i<=1;i++) { outportb (address[i],0x80); printf("\n\n\n Test %d \n\n 8255-address= %x h",i+1,address[i]-3); printf("\n\n OUT IN OK/ERROR\n"); for (count=0;count<=1;count++) { for (j=1;j<=3;j++) outportb(address[i]-j,a[count]); for (j=1;j<=3;j++) { code = inportb (address[i]-j); printf("\n port %c %5x %7x",port[j-1],code,a[count]); if(code==a[count]) Label1->Caption="ok"; else Label1->Caption="fuck"; } } } } //---------------------------------------------------------------------------