HI all,
Can anybody tell me which programming language is this ...
init PCI; { Unit to communicate with chipsets }
interface
uses AMIBIOS, AsusBIOS;
Const
PCICfIdx = $CF8;
PCICfData = $CFC;
Var
NorthFunc, SouthFunc, LPCFunc: Word;
NorthPos,SouthPos,PMUPos,CurPCIROM,PCIROMBus,PCIROMDev,PCIROMFun,LPCBase: Byte;
CurrentChipset, CurrentPCICard: string;
WantToUseAMI, AMIUsed, ChipsetFound, ROMEnabled, PCIROMEnabled: Boolean;
WantToUseAsus, AsusUsed: Boolean;
PCIROMs: array[1..20] of
record
MaxSize : LongInt;
VenID, DevID : Word;
Bus, Pos : Byte;
end;
BIOSID: array[1..8] of Char; {v1.34}
Procedure OPortD( Prt : Word; Val : LongInt );
Function IPortD( Prt : Word ) : LongInt;
Function GetPCIRegD( Bus, Dev, Func, Reg : Byte ) : LongInt;
Procedure SetPCIRegD( Bus, Dev, Func, Reg : Byte; Value : LongInt );
Function LocatePIIX : {byte}Boolean; {v1.22 byte->boolean}
procedure GetBIOSID;
Procedure RomEnable( Map : boolean);
procedure ShadowDisable_Aladdin; {v1.31}
procedure ShadowRestore_Aladdin; {v1.31}
implementation
Uses Tools,Flash,Crt,DMI;
{ PortD[ x ] := y }
Procedure OPortD( Prt : Word; Val : LongInt ); Assembler;
Asm
DB 66H
MOV AX,WORD PTR Val
MOV DX,Prt
DB 66H
OUT DX,AX
End;
{ y := PortD[ x ] }
Function IPortD( Prt : Word ) : LongInt; Assembler;
Asm
MOV DX,Prt
DB 66H
IN AX,DX
DB 66H
MOV DX,AX
DB 66H
SHR DX,16
End;
{Read PCI configuration reg}
Function GetPCIRegD( Bus, Dev, Func, Reg : Byte ) : LongInt;
Begin
OPortD( PCICfIdx, $80000000 or
( LongInt( Bus ) shl 16 ) or
( ( LongInt( Dev ) and $1F ) shl 11 ) or
( ( LongInt( Func ) and $7 ) shl 8 ) or
( Reg and $FC ) );
GetPCIRegD := IPortD( PCICfData );
End;