io.h

来自「printio.h 很好用的printport 源碼 趕快用八」· C头文件 代码 · 共 30 行

H
30
字号
#include <windows.h>
#include <time.h>

typedef void (WINAPI *PORTOUT) (short int Port, char Data);
typedef char (WINAPI *PORTIN) (short int Port);

PORTOUT PortOut;
PORTIN PortIn;
HMODULE hio;

void UnloadIODLL() {
	FreeLibrary(hio);
}

int LoadIODLL() {
	hio = LoadLibrary("io");
	if (hio == NULL) return 1;
	PortOut = (PORTOUT)GetProcAddress(hio, "PortOut");
	PortIn = (PORTIN)GetProcAddress(hio, "PortIn");
	atexit(UnloadIODLL);
	return 0;
}

void DelayNmS( unsigned char u8DelayTime)
{
    while ( clock() < u8DelayTime ) {
    }
}

// 

⌨️ 快捷键说明

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