?? pcis_int.cpp
字號(hào):
#include <stdio.h>
#include <conio.h>
#include <dos.h>
void main(void)
{
int bus, device, func, regindex;
union REGS regs, outregs;
unsigned long lo, hi, ovalue;
unsigned long BaseAddr;
clrscr();
func = 0;
regindex = 0;
for(bus=0; bus<5; bus++)
{
for(device=0; device<32; device++)
{
regs.h.bh = bus;
regs.h.bl = (device<<3) | (func & 0x07);
regindex = 0;
regs.x.di = regindex;
regs.x.ax = 0xB109;
int86(0x1A,®s,&outregs);
lo = outregs.x.cx;
regs.x.di = regindex + 2;
int86(0x1A,®s,&outregs);
hi = outregs.x.cx;
ovalue = hi*65536l+lo;
if (lo != 0xffff)
{
printf("\nBus = 0x%x\n", bus);
printf("Device = 0x%x\n", device);
printf("ID = %lx\n", ovalue);
for(BaseAddr=0; BaseAddr<=5; BaseAddr++)
{
regindex = 0x10 + BaseAddr*4;
regs.x.di = regindex;
int86(0x1A,®s,&outregs);
lo = outregs.x.cx;
regs.x.di = regindex + 2;
int86(0x1A,®s,&outregs);
hi = outregs.x.cx;
ovalue = hi*65536l+lo;
printf("Base%d: Low = 0x%x\tHi = 0x%x\n", BaseAddr, lo, hi);
}
regindex = 0x3c;
regs.x.di = regindex;
int86(0x1A,®s,&outregs);
lo = outregs.x.cx;
printf("IRQ# = %d\n", lo & 0xff);
getch();
}
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -