最近,刚刚离职,又刚刚的入职。
又要试用期,又要重温一下过去写的的小工具,以前都是被主管逼着用汇编语言写,这一次自己想尝试一下用c语言写这些工具。
这次先从简单的写起,写一个可以访问ISA的,因为比较的简单,所以,还是蛮轻松的。
说到ISA,大家第一想得到的就是cmos吧,记得第一次用汇编语言写cmos的小工具,什么都不懂。
现在,自己学习的快一年了,感觉还是比较的慢。
好了,废话少说。
直接看code吧。
我用的是TC2.0编译的,熟悉吧:)
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
#include <conio.h>
int main()
{
int port1,port2;
int i,j;
unsigned char temp;
char ch;
window(1,1,80,25);
textbackground(BLUE);
textcolor(YELLOW);
clrscr();
printf("please input port1:0x");
scanf("%X",&port1);
printf("please input port2:0x");
scanf("%X",&port2);
while(!kbhit())
{
clrscr();
printf("Read value from ISA port 0x%X 0x%X:\n",port1,port2);