Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> msdos execute dos function calls pp 208</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 MSDOS                    Execute DOS Function Calls                  pp 208

 Syntax:  MsDos (Regs) ;

 Type:    Record

 Form:    Procedure

 Purpose: Execute MS DOS Int 21h function call.

 Notes:   The parameter to the call must be of type Record.  The record
          will contain either the 16 bit register group and flags, or
          the 8 bit register subset only.

          MsDos will set Regs according to the results of the call.


 ----------------------------------------------------------------------------


 Usage:
      TYPE
          RegType = Record
                    AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : Integer ;
                    End      ;
       VAR
          Regs    : RegType  ;   { Defined as RegType           }
          Hour    : Byte     ;   { Hour returned from DOS       }
          Min     : Byte     ;   { Minutes returned from DOS    }
          Sec     : Byte     ;   { Seconds returned from DOS    }
          Hund    : Byte     ;   { Hundredths returned from DOS }

       BEGIN
          With Regs Do
             Begin
             AX   := $2C00   ;   { Read timer function          }
             MsDos (Regs)    ;   { Call DOS                     }
             Hour := Hi (CX) ;   { Hour = CH                    }
             Min  := Lo (CX) ;   { Min  = CL                    }
             Sec  := Hi (DX) ;   { Sec  = DH                    }
             Hund := Lo (DX) ;   { Hund = DL                    }
             End             ;
       END.

See Also: Hi Inline Lo Swap With

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson