Application Examples
GET_UNALLOCATED_PAGE_COUNT= $42;
ALLOCATE_PAGES
= $43;
MAP_PAGES
= $44;
DEALLOCATE_PAGES
= $45;
GET_VERSION
= $46;
STATUS_OK
= 0;
{-----------------------------------------------------------}
{ Assume the application needs one EMM page.
}
{-----------------------------------------------------------}
APPLICATION_PAGE_COUNT
= 1;
Var
Regs: Registers;
Emm_Handle,
Page_Frame_Base_Address,
Pages_Needed,
Physical_Page,
Logical_Page,
Offset,
Error_Code,
Pages_EMM_Available,
Total_EMM_Pages,
Available_EMM_Pages: Integer;
Version_Number,
Pages_Number_String: ST3;
Verify: Boolean;
{-----------------------------------------------------------}
{ The function Hex_String converts an integer into a four
}
{ character hexadecimal number (string) with leading zeros. }
{-----------------------------------------------------------}
Function Hex_String (Number: Integer): ST5;
Function Hex_Char (Number: Integer): Char;
Begin
If Number < 10 then
Hex_Char := Char (48)
else
Hex_Char := Char (55);
end; { Function Hex_Char}
Var
S: ST5;
Begin
S := ’’;
S := Hex_Char ((Number shr 1) div 2048);
Number:=(((Number shr 1) mod 2048) shl 1)+(Number and 1);
S := S+Hex_Char (Number div 256);
Number := Number mod 256;
S := S+Hex_Char (Number div 16);
Number := Number mod 16;
S := S+Hex_Char (Number);
Hex_String := S+’h’;
end; { Function Hex_String}
4-13
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com