2.2dem 0-255
/*
xuat ra cong A cac gia tri tang dan tu 0 den 255, 0.5s 1 lan.
*/
#include "stdafx.h"
#include<conio.h>
#include<stdio.h>
#include<dos.h>
#include<PCIXP.h>
void main()
{
int i=0;
int add=Get_Addr("PCI_8255");
outportb(add+3, 0x80); // Tu dieu khien cho phep cac cong o che do ra
for(i=0; i<=255; i++)
{
outportb(add,i); // Xuat ra cong A
Sleep(500);
}
getch();
}
Bạn đang đọc truyện trên: TruyenTop.Vip