Application Examples
{-----------------------------------------------------------}
{ This function releases the EMM memory pages allocated to
}
{ us, back to the EMM memory pool.
}
{-----------------------------------------------------------}
Function Deallocate_Expanded_Memory_Pages
(Handle: Integer): Integer;
Var
Regs: Registers;
Begin
with Regs do
Begin
{---------------------------------------------------}
{ Deallocate the pages allocated to an EMM handle.
}
{ Load pseudo-registers prior to invoking EMM.
}
{
AH = deallocate pages function
}
{
DX = EMM handle
}
{---------------------------------------------------}
AH := DEALLOCATE_PAGES;
DX := EMM_Handle;
Intr (EMM_INT,Regs);
{---------------------------------------------------}
{ Unload the pseudo-registers after invoking EMM.
}
{
AH = status
}
{---------------------------------------------------}
Deallocate_Expanded_Memory_Pages := AH;
end; { with Regs do}
end;
{ Function Deallocate_Expanded_Memory_Pages}
{-----------------------------------------------------------}
{ This function returns the version number of the EMM as
}
{ a three-character string.
}
{-----------------------------------------------------------}
Function Get_Version_Number (Var Version_String: ST3):
Integer;
Var
Regs: Registers;
Integer_Part, Fractional_Part: Char;
Begin
with Regs do
Begin
{---------------------------------------------------}
{ Get the version of EMM.
}
{ Load pseudo-registers prior to invoking EMM.
}
{
AH = get EMM version function
}
{---------------------------------------------------}
AH := GET_VERSION;
Intr (EMM_INT,Regs);
{---------------------------------------------------}
{ If the version number returned was OK, then
}
{ convert it to a three-character string.
}
{---------------------------------------------------}
If AH=STATUS_OK then
Begin
4-17
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com