2.12hayvailon
// 2_12.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include <PCIXP.h>
#include <conio.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
unsigned int Freg;
int Base;
unsigned int Hesochia;
Base=Get_Addr("PCI_8255");
outportb(Base+11,0xB6);
printf("Nhap tan so: "); scanf("%d",&Freg);
do
{
Hesochia=1000000/Freg;
outportb(Base+10,Hesochia);
outportb(Base+10,Hesochia>>8);
if(getch()=='t') Freg+=100;
else if(getch()=='g') Freg=Freg-100;
}while(kbhit()!=1);
return 0;
}
Bạn đang đọc truyện trên: Truyen247.Pro