Application Examples
{-----------------------------------------------------------}
{ The function Emm_Installed checks to see if the
}
{ EMM is loaded in memory.
It does this by looking
}
{ for the string ’EMMXXXX0’, which should be located
}
{ at 10 bytes from the beginning of the code segment
}
{ the EMM interrupt, 67h, points to.
}
{-----------------------------------------------------------}
Function Emm_Installed: Boolean;
Var
Emm_Device_Name
: string[8];
Int_67_Device_Name
: string[8];
Position
: integer;
Regs
: registers;
Begin
Int_67_Device_Name := ’’;
Emm_Device_Name
:= ’EMMXXXX0’;
with regs do
Begin
{---------------------------------------------------}
{ Get the code segment interrupt 67h points to
}
{ the EMM interrupt by using DOS function 35h.
}
{ (get interrupt vector)
}
{---------------------------------------------------}
AH := $35;
AL := EMM_INT;
Intr (DOS_int,Regs);
{---------------------------------------------------}
{ The ES pseudo-register contains the segment
}
{ address pointed to by interrupt 67h.
Create an
}
{ eight character string from the eight successive
}
{ bytes at address ES:$000A (10 bytes from ES).
}
{---------------------------------------------------}
For Position := 0 to 7 do
Int_67_Device_Name :=
Int_67_DeviChr (mem[ES:P$0A]);
Emm_Installed := True;
{---------------------------------------------------}
{ If the string is the EMM manager signature,
}
{ ’EMMXXXX0’, then EMM is installed and ready
}
{ for use.
If not, then EMM is not present.
}
{---------------------------------------------------}
If Int_67_Device_Name <> Emm_Device_Name
then Emm_Installed := False;
end; { with Regs do}
end;
{ Function Emm_Installed }
{-----------------------------------------------------------}
{ This function returns the total number of EMM pages
}
{ present in the system, and the number of EMM pages
}
{ that are available.
}
{-----------------------------------------------------------}
Function EMM_Pages_Available
(Var Total_EMM_Pages, Pages_Available: Integer): Integer;
Var
Regs: Registers;
Begin
with Regs do
Begin
4-14
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com