主题:(求助)高手过来看看~~
高手帮我看看~这是个发光二极管点亮和熄灭的程序.这个是Borland C编的,在win98里可以实现功能,在win2000里就不行啦,好像是outportb()这个函数用不了,能帮忙看看找个能在win2000里实现的函数吗?
#include <string.h>
#include <ctype.h>
#include <dos.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <stdarg.h>
#include <bios.h>
#include <time.h>
#include <conio.h>
#include <process.h>
#include <fcntl.h>
#define OUTPORT_BASE 0x283 /// address of ISA port ///
#define ESC 0x1b /* Define the escape key */
main()
{
unsigned char key_in=0;
outportb(OUTPORT_BASE,0xff); /// LED CLOSE ///
do
{
key_in=0;
if(kbhit()) key_in=getch();
if (key_in == ESC)
{
outportb(OUTPORT_BASE,0xff);
}
if (key_in == '1')
{
printf(" Led op.\n\n");
outportb(OUTPORT_BASE,0x00);
}
if (key_in == '0')
{
printf(" Led close.\n\n");
outportb(OUTPORT_BASE,0xff);
}
} while (key_in != ESC) ;
clrscr();
exit(0);
}
#include <string.h>
#include <ctype.h>
#include <dos.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <stdarg.h>
#include <bios.h>
#include <time.h>
#include <conio.h>
#include <process.h>
#include <fcntl.h>
#define OUTPORT_BASE 0x283 /// address of ISA port ///
#define ESC 0x1b /* Define the escape key */
main()
{
unsigned char key_in=0;
outportb(OUTPORT_BASE,0xff); /// LED CLOSE ///
do
{
key_in=0;
if(kbhit()) key_in=getch();
if (key_in == ESC)
{
outportb(OUTPORT_BASE,0xff);
}
if (key_in == '1')
{
printf(" Led op.\n\n");
outportb(OUTPORT_BASE,0x00);
}
if (key_in == '0')
{
printf(" Led close.\n\n");
outportb(OUTPORT_BASE,0xff);
}
} while (key_in != ESC) ;
clrscr();
exit(0);
}