- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
PCIS_INT.CPP
资源名称:PCIAccess.rar [点击查看]
上传用户:whzhdz
上传日期:2007-03-07
资源大小:6k
文件大小:1k
源码类别:
嵌入式/单片机编程
开发平台:
DOS
- #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%xn", bus);
- printf("Device = 0x%xn", device);
- printf("ID = %lxn", 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%xtHi = 0x%xn", BaseAddr, lo, hi);
- }
- regindex = 0x3c;
- regs.x.di = regindex;
- int86(0x1A,®s,&outregs);
- lo = outregs.x.cx;
- printf("IRQ# = %dn", lo & 0xff);
- getch();
- }
- }
- }
- }