[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
MSDos                    Calls MS-DOS System Functions

 MSDos(var Parm : Registers);                                            [TP]

    Calls the MS-DOS function handler. The appropriate routine information
    (function number, parameters, etc.) should be stored in the register
    fields before you call MSDos.

            Parm    Special record of type Registers

          Notes:    Registers is a specific record data type that you must
                    define in your program. It takes the following format:

                  type
                    Registers = record
                      case Boolean of
                        False : (AX,BX,CX,DX,BP,DI,SI,DS,ES,Flags : Integer);
                        True  : (AL,AH,BL,BH,CL,CH,DL,DH          : Integer)
                    end;

                    You can then access a specific register, say BP, with
                    the expression Parm.BP. The appropriate registers
                    should be initialized before you call MsDos. After the
                    procedure MsDos is completed, the Registers record
                    will have the correct values in its fields.

  -------------------------------- Example ---------------------------------

           procedure GetDate(var DayOfWeek,Month,Day,Year : Integer);

             type
               Registers = record
                 ...
               end;

             var
               Regs : Registers;

             begin
               with Regs do begin
                 AH = $2A;          { 2Ah is the 'Get Date' function }

                 MSDos(Regs);

                 DayOfWeek := AL;   { Save the date }
                 Month     := DH;
                 Day       := DL;
                 Year      := CX;
               end
             end;                   { of proc GetDate }

See Also: Intr
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson