Application Examples
’ successfully mapped into Physical Page ’,
Physical_Page);
Writeln;
{-----------------------------------------------------------}
{ Get the expanded memory page frame address.
}
{-----------------------------------------------------------}
Error_Code := Get_Page_Frame_Base_Address
(Page_Frame_Base_Address);
If Error_Code <> STATUS_OK then
Error (’EMM test program unable to get the base page’
+ ’ Frame Address.’,
Error_Code);
Writeln (’The base address of the EMM page frame is = ’
+ Hex_String (Page_Frame_Base_Address));
Writeln;
{-----------------------------------------------------------}
{ Write a test pattern to expanded memory.
}
{-----------------------------------------------------------}
For Offset := 0 to 16382 do
Begin
Mem[Page_Frame_Base_Address:Offset mod 256;
end;
{-----------------------------------------------------------}
{ Make sure that what is in EMM memory is what was just
}
{ written.
}
{-----------------------------------------------------------}
Writeln (’Testing EMM memory.’);
Offset := 1
Verify := True;
while (Offset <= 16382) and (Verify = True) do
Begin
If Mem[Page_Frame_Base_Address: Offset] <> Offsey mod 256
then
Verify := False;
Offset := Succ (Offset);
end;
{ while (Offset <= 16382) and (Verify = True) }
{-----------------------------------------------------------}
{ If what is read does not match what was written,
}
{ an error occurred.
}
{-----------------------------------------------------------}
If not Verify then
Error (’What was written to EMM memory was not found during
+ ’memory verification test.’,
0);
Writeln (’EMM memory test successful.’);
Writeln;
{-----------------------------------------------------------}
{ Return the expanded memory pages given to us back to the
}
{ EMM memory pool before terminating our test program.
}
{-----------------------------------------------------------}
Error_Code := Deallocate_Expanded_Memory_Pages (Emm_Handle);
If Error_Code <> STATUS_OK then
Error (’EMM test program was unable to deallocate ’
4-20
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com