Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  All DOS function calls are invoked by interrupt 21H (decimal 33).
  Individual functions are selected by placing the appropriate function
  number in the AH register.

  The interrupt 21H function calls in DOS version 1 are organized into the
  logical groups shown in Figure 16-1. In an effort to make this figure as
  clear as possible, we have organized and described these function calls in
  a slightly different manner than does the DOS technical reference manual.
  Figure 16-2 lists the individual function calls.

            Function
  Hex                Dec               Group
  --------------------------------------------------------------------------
  00H                0                 Nondevice function
  01H-0CH            1-12              Character device I/O
  0DH-24H            13-36             File management
  25H-26H            37-38             More nondevice functions
  27H-29H, 2EH       39-41, 46         More file management
  2AH-2DH            42-45             More nondevice functions
  --------------------------------------------------------------------------

  Figure 16-1.  The logical groups of DOS version 1 function calls.


        Function
  Hex            Dec            Description
  --------------------------------------------------------------------------
  00H             0             Terminate
  01H             1             Character Input with Echo
  02H             2             Character Output
  03H             3             Auxiliary Input
  04H             4             Auxiliary Output
  05H             5             Printer Output
  06H             6             Direct Character Input/Output
  07H             7             Direct Character Input Without Echo
  08H             8             Character Input Without Echo
  09H             9             String Output
  0AH            10             Buffered Keyboard Input
  0BH            11             Check Keyboard Status
  0CH            12             Flush Keyboard Buffer, Read Keyboard
  0DH            13             Flush Disk Buffers
  0EH            14             Select Disk Drive
  0FH            15             Open File
  10H            16             Close File
  11H            17             Find First Matching Directory Entry
  12H            18             Find Next Matching Directory Entry
  13H            19             Delete File
  14H            20             Sequential Read
  15H            21             Sequential Write
  16H            22             Create File
  17H            23             Rename File
  19H            25             Get Current Disk
  1AH            26             Set Disk Transfer Area
  1BH            27             Get Default Drive Information
  1CH            28             Get Specified Drive Information
  21H            33             Read Random Record
  22H            34             Write Random Record
  23H            35             Get File Size
  24H            36             Set FCB Random Record Field
  25H            37             Set Interrupt Vector
  26H            38             Create New Program Segment Prefix
  27H            39             Read Random Records
  28H            40             Write Random Records
  29H            41             Parse Filename
  2AH            42             Get Date
  2BH            43             Set Date
  2CH            44             Get Time
  2DH            45             Set Time
  2EH            46             Set Verify Flag
  --------------------------------------------------------------------------


  Figure 16-2.  DOS version 1 functions available through interrupt 21H.

  The design and organization of a few of these functions, particularly
  numbers 01H through 0CH, are screwball--to put it mildly. They are this
  way for historical reasons. Many details of DOS, and especially the
  details of DOS function calls, were designed to closely mimic the services
  provided by CP/M. This was an important and deliberate choice, made to
  make it much easier for 8-bit CP/M software to be converted to the 16-bit
  IBM PC and DOS. Although the creation of DOS provided a timely opportunity
  to break with and clean up the mistakes of the past, the real departure
  from the 8-bit tradition came with DOS version 2, as you will see in
  Chapter 17.

  The following pages describe the 42 original DOS function calls,
  universally used in all versions of DOS.

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