(* * * * * * * * * * * * * * * * * * *
 *
 * prog5-1.pas
 *
 * Test to see if XMS is present
 *
 * * * * * * * * * * * * * * * * * * *)


program prog5_1;


uses
    _Globals,
    _Xms;

var
    xms:            XMS_Xms;
    xmsHandlerAddr: SegOff_type absolute xmsHandler;


begin

    (*
     *  Print out the address of the XMS handler before it's
     *  initialized.
     *)
    writeln('Before initialization: XMS handler= 0x',
                hex(xmsHandlerAddr.Segment, 4),':0x',
                hex(xmsHandlerAddr.Offset, 4));

    (*
     *  Attempt to initialize XMS. If there is an error, report it.
     *)
    if not xms.init then begin
        writeln('XMS is present');
        end
    else begin
        writeln('XMS is not present');
        end;

    (*
     *  Now print out the address of the XMS handler after it's been
     *  initialized.
     *)
    writeln('After initialization: XMS handler= 0x',
                hex(xmsHandlerAddr.Segment, 4),':0x',
                hex(xmsHandlerAddr.Offset, 4));

end.

