⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.~cpp

📁 该程序用来测试89C51与IDE硬盘的接口
💻 ~CPP
字号:
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

 //---------------------------------------------------------------------------
int __fastcall _outp(unsigned short int port, unsigned char val)
{
asm     mov     dx, port
asm     mov     al, val
asm     out     dx, al
asm     xor     ah, ah
		return (_AX);
}
//---------------------------------------------------------------------------
int __fastcall _inp(unsigned short int port)
{
asm     mov     dx,port
asm     in      al,dx
asm     xor     ah,ah
        return _AX;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
        _outp(0x37a,0x0f);
        _outp(0x378,0x00);
}
//---------------------------------------------------------------------------


void __fastcall TForm1::Button2Click(TObject *Sender)
{
    _outp(0x37a,0x0f);
        _outp(0x378,0xf0);
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button3Click(TObject *Sender)
{
 _outp(0x37a,0x0f);
        _outp(0x378,0x0f);
}
//---------------------------------------------------------------------------


void __fastcall TForm1::Button4Click(TObject *Sender)
{
     _outp(0x37a,0x0f);
 this->Edit1->Text=_inp(0x378);
}
//---------------------------------------------------------------------------


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -