Application Examples
{---------------------------------------------------}
{ Get the number of currently unallocated pages and }
{ the total number of pages in the system from EMM. }
{ Load pseudo-registers prior to invoking EMM.
}
{
AH = get unallocated page count function.
}
{---------------------------------------------------}
AH := Get_Unallocated_Page_Count;
intr (EMM_INT, Regs);
{---------------------------------------------------}
{ Unload the pseudo-registers after invoking EMM.
}
{
BX = currently unallocated pages
}
{
DX = total pages in the system
}
{
AH = status
}
{---------------------------------------------------}
Pages_Available := BX;
Total_EMM_Pages := DX;
EMM_Pages_Available := AH;
end;
end; { EMM_Pages_Available }
{-----------------------------------------------------------}
{ This function requests the specified number of pages
}
{ from the EMM.
}
{-----------------------------------------------------------}
Function Allocate_Expanded_Memory_Pages
(Pages_Needed: Integer; Var Handle: Integer): Integer;
Var
Regs: Registers;
Begin
with Regs do
Begin
{---------------------------------------------------}
{ Allocate the specified number of pages from EMM.
}
{ Load pseudo-registers prior to invoking EMM.
}
{
AH = allocate pages function.
}
{
BX = number of pages to allocate.
}
{---------------------------------------------------}
AH := Allocate_Pages;
BX := Pages_Needed;
intr (EMM_INT,Regs);
{---------------------------------------------------}
{ Unload the pseudo-registers after invoking EMM.
}
{
DX = EMM handle
}
{
AH = status
}
{---------------------------------------------------}
Handle := DX;
Allocate_Expanded_Memory_Pages := AH;
end;
end; { Function Allocate_Expanded_Memory_Pages}
{
{-----------------------------------------------------------}
{ This function maps a logical page allocated by the
}
{ Allocate_Expanded_Memory_Pages function into one of
}
{ the four physical pages.
}
{-----------------------------------------------------------}
Function Map_Expanded_Memory_Pages
(Handle, Logical_Page, Physical_Page: Integer): Integer;
4-15
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com