@Uncategorized/Miscellaneous Topics
:help:?
^HelpPC Programmers Reference

^Please register this product by sending $25 (US) to:

    David Jurgens
    1550 Alton Darby Creek Road
    Columbus, OH  43228
    CompuServe 71270,2422


^Keys used for navigating through HelpPC

 Esc      Exit current screen or HelpPC
 End      Moves text or menu to the last line/item
 Home     Moves text or menu to the first line/item
 PgUp     Moves text or menu to page top or previous page
 PgDn     Moves text or menu to page bottom or next page
 F1       Switches from menu to prompting mode and vice versa
 Alt-P    Write current topic to printer
 Alt-W    Write topic to file HelpPC.DAT in the current directory
 Alt-X    Exit HelpPC and without clearing current screen


^Using HelpPC

 HelpPC has two modes of operation.  The first is the Prompted Mode
 where you specify the topic on the command line and HelpPC prompts
 you for topics until you exit.   The second is the Menu Mode which
 as its name implies is menu driven.  To use the Menu Mode just omit
 the topic from the command line.  You may switch between Menu mode
 and Prompted Mode with the F1 key.

^Examples of Command Line

% For information about:    Use the following:

 Installation:               HelpPC install
 Creating help files:        HelpPC helppc format
 Interrupts:                 HelpPC int #
     example:                HelpPC int 13
 Interrupt subfunction:      HelpPC int #,func
     example:                HelpPC int 21,4E
 C function usage:           HelpPC function
     examples:               HelpPC open
                             HelpPC is...
                             HelpPC str...
 Other topics:               HelpPC interrupt table
     examples:               HelpPC bios data area  or  HelpPC bda
                             HelpPC ansi codes

 All topics are treated as lower case

^Trademarks of Vendors Mentioned in HelpPC Databases

  PC/AT, PC-DOS, PC/XT and PS/2 are trademarks of International
   Business Machines Corporation
  Compaq is a registered trademark of Compaq Computer Corporation
  CompuServe is a registered trademark of CompuServe Incorporated
  DESQview is a trademark of Quarterdeck Office Systems
  Epson is a registered trademark of Seiko Epson Corporation
  HP is a registered trademark of Hewlett-Packard Company
  IBM is a registered trademark of International Business Machines Corp.
  Intel is a registered trademark of Intel Corporation
  LIM and EMS are trademarks of Lotus, Intel and Microsoft Corporations
  Maxtor is a trademark of Maxtor Corporation
  Microsoft is a registered trademark of Microsoft Corporation
  NEC is a registered trademark of NEC Electronics Incorported
  Tandy is a registered trademark of Tandy Corporation
  Turbo C is a registered trademark of Borland International Inc.
  Other brand and product names are trademarks or registered
   trademarks of their respective holders.

 - see   INSTALL   HELPPC FORMAT

:install:setup
^INSTALL/SETUP - HELPPC Installation

 Installation requires two steps.  First, simply uncompress the
 HelpPC archive file.   Second, issue the following command:

 SET HLP=d:dirname     (no blanks, except between "SET HLP")

 Where 'd:' is the drive and 'dirname' is the directory where the
 HelpPC.NDX and the .TXT files will reside (should be fully qualified,
 with or without the trailing backslash '\', see example below).
 HelpPC.COM can exist anywhere it can be accessed through the DOS
 command search path (PATH).  The "SET HLP=" command should be placed
 in the AUTOEXEC.BAT file to allow easy access to the database each
 time your PC is rebooted.   It is recommended that HelpPC.COM be
 renamed to something quick and comfortable to use, like  H.COM  or
 HELP.COM.


 As an example, if the files HelpPC.NDX and the .TXT files reside in
 a directory named  C:\HELPINFO  then use:

%SET HLP=C:\HELPINFO     or     SET HLP=C:\HELPINFO\

:helppc format
^HelpPC Text File Format

 HelpPC in its standard form can handle 2000 indexed topics and
 16 independent help files.  If you find you need a larger capacity,
 please contact me at one of the addresses below.  Each file must
 have its own title which will show up in the main menu.  Each topic
 following the file title (see below) will show up in the subtopic
 menu.  Also note that HelpPC will adjust the menu format based on
 the screen height and the number of items in the main menu.

 HelpPC text files are simple ASCII files that contain control codes
 in column one.   Each file must contain a title in the first line.
 The remainder of the file consists of keyed lines and help text.
 Each line must end with a CR/LF pair (standard DOS format) and
 shouldn't be longer than 70 characters.   Tabs are treated as
 physical data and are not handled logically.  The following is a
 list of keys:

 '@'  in column 1 indicates a file title which will appear in
      the main topic menu.  This must be the very first line
      in the file and has a maximum length of 40 characters
      (excluding the '@').
 ':'  in column 1 indicates a subtopic key.  Multiple keys separated
      by colons ':' can be entered on the same line.
 '#'  in column 1 indicates a highlighted title line (not centered)
 '^'  in column 1 indicates a centered highlighted title
 '<'  text that should not be shifted right
 ' '  in column 1 indicates a text line.  Text lines are shift
      right 7 characters when displayed.

 any other character in column 1 is invalid


 Use the BUILD command to index/reindex the default help text files.
 To add your own files to the index use the command:

%    BUILD [fname [file2 ...]]


%Limits of the HelpPC program

 Max items in main topic menu:          16
 Max items in subtopic menu:           512
 Max topics in index:                 2000
 Max size of topic text:             16384 bytes
 Max lines of text per topic:          512
 Max topic key length:                  20
 Max file title length:                 40
 No limit on file size


%Example help file:

 @This title appears in main menu
 :key1:key2:key3
 ^This line will show up centered and highlighted
 
 %This line will show up highlighted
 
  These lines are normal text.  All three topic keys will point to
  this same database entry.

:character codes:character set:ascii:ebcdic:extended ascii
^ASCII - EBCDIC - Character Codes and Character Sets

%                           Extended
%    Dec    Octal     Hex    ASCII    EBCDIC     ASCII
      0      000      00               NUL        NUL
      1      001      01               SOH        SOH
      2      002      02              STX        STX
      3      003      03              ETX        ETX
      4      004      04              PF         EOT
      5      005      05              HT         ENQ
      6      006      06              LC         ACK
      7      007      07              DEL        BEL
      8      010      08      ...                 BS
      9      011      09      ...                 HT
     10      012      0A      ...      SMM        LF
     11      013      0B              VT         VT
     12      014      0C              FF         FF
     13      015      0D      ...      CR         CR
     14      016      0E              SO         SO
     15      017      0F              SI         SI
     16      020      10              DLE        DLE
     17      021      11              DC1        DC1

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
     18      022      12              DC2        DC2
     19      023      13              TM         DC3
     20      024      14              RES        DC4
     21      025      15              NL         NAK
     22      026      16              BS         SYN
     23      027      17              IL         ETB
     24      030      18              CAN        CAN
     25      031      19              EM         EM
     26      032      1A      ...      CC         SUB
     27      033      1B              CU1        ESC
     28      034      1C              IFS        FS
     29      035      1D              IGS        GS
     30      036      1E              IRS        RS
     31      037      1F              IUS        US
     32      040      20               DS         SP
     33      041      21       !       SOS         !
     34      042      22       "       FS          "
     35      043      23       #                   #

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
     36      044      24       $       BYP         $
     37      045      25       %       LF          %
     38      046      26       &       ETB         &
     39      047      27       '       ESC         '
     40      050      28       (                   (
     41      051      29       )                   )
     42      052      2A       *       SM          *
     43      053      2B       +       CU2         +
     44      054      2C       ,                   ,
     45      055      2D       -       ENQ         -
     46      056      2E       .       ACK         .
     47      057      2F       /       BEL         /
     48      060      30       0                   0
     49      061      31       1                   1
     50      062      32       2       SYN         2
     51      063      33       3                   3
     52      064      34       4       PN          4
     53      065      35       5       RS          5
     54      066      36       6       UC          6

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
     55      067      37       7       EOT         7
     56      070      38       8                   8
     57      071      39       9                   9
     58      072      3A       :                   :
     59      073      3B       ;       CU3         ;
     60      074      3C       <       DC4         <
     61      075      3D       =       NAK         =
     62      076      3E       >                   >
     63      077      3F       ?       SUB         ?
     64      100      40       @       SP          @
     65      101      41       A                   A
     66      102      42       B                   B
     67      103      43       C                   C
     68      104      44       D                   D
     69      105      45       E                   E
     70      106      46       F                   F
     71      107      47       G                   G
     72      110      48       H                   H
     73      111      49       I                   I

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
     74      112      4A       J                  J
     75      113      4B       K        .          K
     76      114      4C       L        <          L
     77      115      4D       M        {          M
     78      116      4E       N        +          N
     79      117      4F       O        |          O
     80      120      50       P        &          P
     81      121      51       Q                   Q
     82      122      52       R                   R
     83      123      53       S                   S
     84      124      54       T                   T
     85      125      55       U                   U
     86      126      56       V                   V
     87      127      57       W                   W
     88      130      58       X                   X
     89      131      59       Y                   Y
     90      132      5A       Z        !          Z
     91      133      5B       [        $          [
     92      134      5C       \        *          \

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
     93      135      5D       ]        )          ]
     94      136      5E       ^        ;          ^
     95      137      5F       _                  _
     96      140      60       `                   `
     97      141      61       a        /          a
     98      142      62       b                   b
     99      143      63       c                   c
    100      144      64       d                   d
    101      145      65       e                   e
    102      146      66       f                   f
    103      147      67       g                   g
    104      150      68       h                   h
    105      151      69       i                   i
    106      152      6A       j                   j
    107      153      6B       k        ,          k
    108      154      6C       l        %          l
    109      155      6D       m        _          m
    110      156      6E       n        >          n
    111      157      6F       o        ?          o

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
    112      160      70       p                   p
    113      161      71       q                   q
    114      162      72       r                   r
    115      163      73       s                   s
    116      164      74       t                   t
    117      165      75       u                   u
    118      166      76       v                   v
    119      167      77       w                   w
    120      170      78       x                   x
    121      171      79       y                   y
    122      172      7A       z        :          z
    123      173      7B       {        #          {
    124      174      7C       |        @          |
    125      175      7D       }        '          }
    126      176      7E       ~        =          ~
    127      177      7F               "          
    128      200      80       
    129      201      81               a
    130      202      82               b

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
    131      203      83               c
    132      204      84               d
    133      205      85               e
    134      206      86               f
    135      207      87               g
    136      210      88               h
    137      211      89               i
    138      212      8A       
    139      213      8B       
    140      214      8C       
    141      215      8D       
    142      216      8E       
    143      217      8F       
    144      220      90       
    145      221      91               j
    146      222      92               k
    147      223      93               l
    148      224      94               m
    149      225      95               n

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
    150      226      96               o
    151      227      97               p
    152      230      98               q
    153      231      99               r
    154      232      9A       
    155      233      9B       
    156      234      9C       
    157      235      9D       
    158      236      9E       
    159      237      9F       
    160      240      A0       
    161      241      A1       
    162      242      A2               s
    163      243      A3               t
    164      244      A4               u
    165      245      A5               v
    166      246      A6               w
    167      247      A7               x
    168      250      A8               y

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
    169      251      A9               z
    170      252      AA       
    171      253      AB       
    172      254      AC       
    173      255      AD       
    174      256      AE       
    175      257      AF       
    176      260      B0       
    177      261      B1       
    178      262      B2       
    179      263      B3       
    180      264      B4       
    181      265      B5       
    182      266      B6       
    183      267      B7       
    184      270      B8       
    185      271      B9       
    186      272      BA       
    187      273      BB       

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
    188      274      BC       
    189      275      BD       
    190      276      BE       
    191      277      BF       
    192      300      C0       
    193      301      C1               A
    194      302      C2               B
    195      303      C3               C
    196      304      C4               D
    197      305      C5               E
    198      306      C6               F
    199      307      C7               G
    200      310      C8               H
    201      311      C9               I
    202      312      CA       
    203      313      CB       
    204      314      CC       
    205      315      CD       
    206      316      CE       

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
    207      317      CF       
    208      320      D0       
    209      321      D1               J
    210      322      D2               K
    211      323      D3               L
    212      324      D4               M
    213      325      D5               N
    214      326      D6               O
    215      327      D7               P
    216      330      D8               Q
    217      331      D9               R
    218      332      DA       
    219      333      DB       
    220      334      DC       
    221      335      DD       
    222      336      DE       
    223      337      DF       
    224      340      E0       
    225      341      E1       

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
    226      342      E2               S
    227      343      E3               T
    228      344      E4               U
    229      345      E5               V
    230      346      E6               W
    231      347      E7               X
    232      350      E8               Y
    233      351      E9               Z
    234      352      EA       
    235      353      EB       
    236      354      EC       
    237      355      ED       
    238      356      EE       
    239      357      EF       
    240      360      F0               0
    241      361      F1               1
    242      362      F2               2
    243      363      F3               3
    244      364      F4               4

%                           Extended
%   Dec     Octal     Hex    ASCII    EBCDIC     ASCII
    245      365      F5               5
    246      366      F6               6
    247      367      F7               7
    248      370      F8               8
    249      371      F9               9
    250      372      FA       
    251      373      FB       
    252      374      FC       
    253      375      FD       
    254      376      FE       
    255      377      FF

:ansi codes:ansi control codes
^ANSI.SYS and NANSI.SYS Functions  -  ANSI x3.64

 ESC[y,xH     Cursor position y,x
 ESC[nA       Cursor Up n lines
 ESC[nB       Cursor Down n lines
 ESC[nC       Cursor Forward n characters
 ESC[nD       Cursor Backward n characters
 ESC[y;xf     Cursor position y,x (less frequently used)
 ESC[y;xR     Cursor position report y,x
 ESC[6n       Device status report (cursor pos)(n is constant 'n')
 ESC[s        Save cursor position
 ESC[u        Restore cursor position
 ESC[2J       Erase display
 ESC[K        Erase to end of line
 ESC[nL       Inserts n blank lines at cursor line.   (NANSI)
 ESC[nM       Deletes n lines including cursor line.  (NANSI)
 ESC[n@       Inserts n blank chars at cursor.        (NANSI)
 ESC[nP       Deletes n chars including cursor char.  (NANSI)
 ESC[n;ny     Output char translate                   (NANSI)
              When first char is encountered in output request, it
              is replaced with the second char.  When no parameters
              are given, all chars are reset.
 ESC["str"p   Keyboard Key Reassignment. The first char of str gives
              the key to redefine; the rest of the string is the
              key's new value.  To specify unprintable chars, give
              the ASCII value of the char outside of quotes, as a
              normal parm.   IBM function keys are two byte strings.

              Ex:  ESC[0;";dir a:";13;p

              redefines F1 to have the value "dir a:" followed by CR.
              If no parameters given, all keys are reset to their
              default values.  Single or double quotes are valid.

 ESC[n;n;...nm  Set Graphics Rendition is used to set attributes as
   well as foreground and background colors.  If multiple parameters
   are used, they are executed in sequence, and the effects are
   cumulative. 'n' is one of the following attributes or colors:

   0  All attributes off       5  Blink
   1  Bold                     7  Reverse Video
   2  Dim                      8  Invisible
   4  Underline


%Foreground colors          Background colors

    30  Black                  40  Black
    31  Red                    41  Red
    32  Green                  42  Green
    33  Yellow                 43  Yellow
    34  Blue                   44  Blue
    35  Magenta                45  Magenta
    36  Cyan                   46  Cyan
    37  White                  47  White


 ESC[=nh     Set mode (see screen modes for n)
 ESC[=nl     Reset Mode (see screen modes for n)


^Screen modes are similar to those found in the IBM BIOS:

        0   text 40x25 Black & White
        1   text 40x25 Color
        2   text 80x25 Black & White
        3   text 80x25 Color
        4   320x200 4 bits/pixel
        5   320x200 1 bit/pixel
        6   640x200 1 bit/pixel
        7   cursor wrap
       13   320x200 4 bits/pixel (EGA)
       14   640x200 4 bits/pixel (EGA)
       16   640x350 4 bits/pixel (EGA)


 - for more information see ANSI document x3.64 or DOS manual

:byte ordering
^Byte Ordering of Different Computer Architectures


%                16 Bit       32 Bit          Floating
%Architecture    Integer      Format           Point

 MC68000           MSB          MSB             MSB
 Intel             LSB          LSB             LSB
 PDP-11            LSB       MSW...LSW       MSW...LSW
 VAX               LSB          LSB          MSW...LSW
 IBM 360/370       MSB          MSB             MSB


 MSB means Most Significant Byte first or a byte order of 3210
 LSB means Least Significant Byte first or a byte order of 0123
 MSW...LSW means a byte order of 3201 or 67452301


 See "Computer Language Magazine", April, 1987, P.J. Plauger for
 more information

:cold boot:post
^POST - Cold Boot / Power On Self Test Activities

 - power supply starts Clock Generator (8284) with Power
   Good signal on BUS
 - CPU reset line is pulsed resetting CPU
 - DS, ES, and SS are cleared to zero

%Cold and Warm Boot both execute the following sequence
 - CS:IP are set to FFFF:0000 (address of ROM POST code)
 - jump to CS:IP  (execute POST, Power On Self test)
 - interrupts are disabled
 - CPU flags are set, read/write/read test of CPU registers
 - checksum test of ROM BIOS
 - Initialize DMA (verify/init 8237 timer, begin DMA RAM refresh)
 - save reset flag then read/write test the first 32K of memory
 - Initialize the Programmable Interrupt Controller (8259)
   and set 8 major BIOS interrupt vectors (interrupts 10h-17h)
 - determine and set configuration information
 - initialize/test CRT controller & test video memory (unless 1234h
   found in reset word)
 - test 8259 Programmable Interrupt Controller
 - test Programmable Interrupt Timer (8253)
 - reset/enable keyboard, verify scan code (AAh), clear keyboard,
   check for stuck keys, setup interrupt vector lookup table
 - hardware interrupt vectors are set
 - test for expansion box, test additional RAM
 - read/write memory above 32K (unless 1234h found in reset word)
 - addresses C800:0 through F400:0 are scanned in 2Kb blocks in
   search of valid ROM.  If found, a far call to byte 3 of the ROM
   is executed.
 - test ROM cassette BASIC (checksum test)
 - test for installed diskette drives & FDC recalibration & seek
 - test printer and RS-232 ports.  store printer port addresses
   at 400h and RS-232 port addresses at 408h.  store printer
   time-out values at 478h and Serial time-out values at 47Ch.
 - NMI interrupts are enabled
 - perform INT 19 (bootstrap loader), pass control to boot record or
   cassette BASIC if no bootable disk found
 - WARM BOOT procedure is now executed

 - see  INT 19   WARM BOOT   DIAGNOSTIC CODES

:cpu
^CPU Characteristics / Determination

 8088,80188,V20  six byte prefetch queue, allows use of self
       modifying code to determine length of prefetch

 8086,80186,V30  four byte prefetch queue, allows use of self
       modifying code to determine length of prefetch

 8088,8086,80188,81086,v20,v30  Flag register bits 12
       through 15 cannot be cleared

 8088,8086 will shift left or right using all 8 bits of CL
       if CL = 33, register is guaranteed to be cleared

 80188,80186,80286,80386 will shift left or right using only
       lower 5 bits of CL.  If CL = 32, the shift will not occur

 80286,80386 earlier CPU's decremented SP before a PUSH SP,
       but 286+ pushes the value first then, decrements SP

 8088,8086 non-zero multiplication result clears zero flag

 V20,V30   non-zero multiplication result does not clear zero
       flag, set ZF before multiply, and test after, if it's
       still set, then it's a V20, V30

 80286 allows setting of bit 15 of the flags register

 80386 allows setting of bits 12 through 14 of flags register


 - source PC Tech Journal, "Chips In Transition", April 1986

:detecting:detection:determine
^Detecting ANSI.SYS

 Compare segment address of a DOS interrupt with the segment of the
 standard CON device.   If equal, then ANSI is not loaded.   If the
 segment address of CON is greater than the DOS interrupt, then ANSI
 is loaded or a TSR is handling the interrupt.

 - see INT 21,52 for info on CON device address


^Detecting DESQView

 1.  call INT 2F with AX = DE00h
 2.  if AL = FF on return DESQView is installed


^Detecting Disk Ready

 1.  use INT 13 function 4 (Verify Sector) to check ready for read
 2.  check for error in AH of:
     80h  Time out, or Not Ready
     AAh  Drive not ready
     00h  drive is ready for reading
     other value indicates drive is ready, but an error occurred
 3.  use INT 13,2 (Read Sector) followed by INT 13,3 (Write Sector)
     to check ready for read/write.   First read sector, test for
     ready;   write sector back, check for 03h (write protect) or
     any of the other BIOS disk errors

 - multiple attempts should be made to allow for disk motor startup
 - allows testing of drive ready bypassing DOS and critical error
 - see  INT 13,2   INT 13,3   INT 13,4  and  INT 13,STATUS


^Detecting Drive Existence

 1.  save current drive  (INT 21,19)
 2.  set current drive  (INT 21,E)
 3.  get current drive  (INT 21,19)
 4.  if current drive == drive requested
        then drive exists
        else drive doesn't exist
 5.  reset original drive  (INT 21,E)

 - no critical error is generated if invalid drive is selected


^Detecting EGA Video

 INT 10h, function 12h (in AL), subfunction 10h (in BL) will
 return BL = 10h if not an EGA since invalid functions requests
 return without register modification

 - see  INT 10,12h


^Detecting VGA Video

 INT 10h function 1Ah can be used to detect the presence of VGA.
 BL = 7  VGA with analog monochrome display
    = 8  VGA with analog color display

 - some enhanced EGA adapters will incorrectly identify as VGA
   when INT 10,1B is used

 - see  INT 10,1A


^Detecting Extended Keyboard BIOS

 1.  use INT 16,5 to stuff FFFF into the keyboard buffer
 2.  use INT 16,10 to read the keystrokes back
 3.  if the data stuffed into the keyboard is returned within 16
     extended reads, the BIOS handles the extended keyboard
 4.  byte at 40:96 is another method of detecting extended BIOS but
     is not reliable since some compatibles give false positives

 - see   INT 16,5    INT 16,10    BIOS DATA AREA   INT 9


^Detecting present of Expanded Memory Manager

 1.  attempt to open file/device 'EMMXXXX0' using INT 21h
     function 3Dh;  if successful continue, else no EMM
 2.  make sure EMMXXXX0 is a character device and not a disk file
     by using IOCTL function 0 (Get Device Info);  bit 7 of DX
     should be set for char device and clear for disk file
 3.  make sure Expanded Memory Manager is available using IOCTL
     function 7 (Get Output Status);   AL should be non-zero (FF)
     if Memory Manager is available, and zero if not available.
 4.  call INT 67,46  to get version information

 - see also   INT 21,3D   IOCTL,0   IOCTL,7   INT 67,46


^Detecting Existence of Mouse Driver

 1.  check INT 33 vector is not 0:0
 2.  check INT 33 vector does not point to an IRET
 3.  call INT 33,0 to reset the mouse and get installed state
 4.  call INT 33,24 to check version, type and IRQ


^Detecting Miscellaneous

 Boot drive;   see INT 21,33 (DOS 4.0+)

 CPU type;   see CPU

 Hardware configuration;   see INT 11

 Logical Drive Assignment;   see IOCTL,E

 Memory size, Base;   see INT 12

 Memory size, Extended;   see CMOS

 Micro Channel Bus on PS/2;   see INT 15,C0
 
 Network or Local Disk;   see IOCTL,9

 Network or Local File;   see IOCTL,A

 Parallel ports;   see  BIOS DATA AREA  locations 40:08-40:0F

 RAM Disk;   see  INT 21,32   and   MEDIA DESCRIPTOR

 Redirection on command line;   see  IOCTL,0

 Removable media;   INT 21,1B    INT 21,1C
                    MEDIA DESCRIPTOR BYTE   and   IOCTL,8

 Serial ports;   see BIOS DATA AREA  locations 40:00-40:07

 Single drive A: or B: selection;   see BIOS DATA AREA byte 50:04

 SUBST'ed drive;  see INT 21,32

 Video Screen Size in Columns;  see  INT 10,F

 Video Screen Size in Rows;  see  INT 10,11  subfunction 30h (EGA+)

 APPEND resident;   see INT 2F,0
 ASSIGN resident;   see INT 2F,0
 DOSSHELL resident;   see INT 2F,0
 NLSFUNC resident;   see INT 2F,0
 PRINT resident;   see INT 2F,0
 SHARE resident;   see INT 2F,0

:dbase files:dbf files
^dBASE - File Header Structure (dBASE II)

%Offset Size          Description

   00   byte    dBASE version number 02h=dBASE II
   01   word    number of data records in file
   03   byte    month of last update
   04   byte    day of last update
   05   byte    year of last update
   06   word    size of each data record
   08 512bytes  field descriptors  (see below)
  520   byte    0Dh if all 32 field descriptors used; otherwise 00h

 - dBASE II file header has a fixed size of 521 bytes


^DBASE - File header structure (DBASE III)

%Offset Size           Description

   00   byte      dBASE vers num 03h=dBASE III w/o .DBT
                  83h=dBASE III w .DBT
   01   byte      year of last update
   02   byte      month of last update
   03   byte      day of last update
   04   dword     long int number of data records in file
   08   word      header structure length
   10   word      data record length
   12 20bytes     version 1.0 reserved data space
 32-n 32bytes ea. field descriptors  (see below)
  n+1   byte      0dH field terminator.


 - unlike dBASE II, dBASE III has a variable length header


^dBASE - Field Descriptors

%dBASE II Field Descriptors (header contains 32 FDs)

%Offset Size              Description

   00  11bytes    null terminated field name string, 0Dh as first
                  byte indicates end of FDs
   11   byte      data type, Char/Num/Logical (C,N,L)
   12   byte      field length
   13   word      field data address, (set in memory)
   15   byte      number of decimal places


%dBASE III Field Descriptors (FD count varies):

%Offset Size           Description

   00  11bytes   null terminated field name string
   11   byte     data type, Char/Num/Logical/Date/Memo
   12   dword    long int field data address, (set in memory)
   16   byte     field length
   17   byte     number of decimal places
   18  14bytes   version 1.00 reserved data area

:file handles:default handles:handles
^DOS Default/Predefined File Handles

  0 - Standard Input Device - can be redirected (STDIN)
  1 - Standard Output Device - can be redirected (STDOUT)
  2 - Standard Error Device - can be redirected (STDERR)
  3 - Standard Auxiliary Device (STDAUX)
  4 - Standard Printer Device (STDPRN)


%See the following  INT 21h  Handle related function calls:

 INT 21,3C - Create file using handle
 INT 21,3D - Open file using handle
 INT 21,3E - Close file using handle
 INT 21,3F - Read file or device using handle
 INT 21,40 - Write file or device using handle
 INT 21,41 - Delete file
 INT 21,42 - Move file pointer using handle
 INT 21,43 - Change file mode
 INT 21,45 - Duplicate file handle
 INT 21,46 - Force duplicate file handle
 INT 21,56 - Rename file
 INT 21,57 - Get/set file date and time using handle
 INT 21,5A - Create temporary file (3.x+)
 INT 21,5B - Create new file (3.x+)
 INT 21,67 - Set handle count (3.3+)
 INT 21,68 - Flush buffer (3.3+)


 - STDIN, STDOUT and STDERR can be redirected
 - maximum number of files available to all DOS processes at one
   time is defined by the FILES=N statement of CONFIG.SYS
 - maximum number of files available to an application is N-3 where
   N is derived from the CONFIG.SYS FILES=N statement minus the
   count of handles used by other processes
 - INT 21,67 can be used to increase the number of file handles for
   an application to greater than 20;  the max handle count is
   still limited by the value of FILES= in CONFIG.SYS file
 - see   SFT   INT 21   INT 21,52   INT 21,67


:numeric ranges:data ranges:ranges
^Numeric Ranges for Data Elements


%     Size                  Range             Significant digits

  1 byte character         -128 to 127                 2
  2 byte integer        -32,768 to 32,767              4
  4 byte integer -2,147,483,648 to 2,147,483,647       9
  8 byte integer       -9x10e18 to 9x10e18            18
  4 byte real       8.43x10e-37 to 3.37x10e38        6-7
  8 byte real      4.19x10e-307 to 1.67x10e308      15-16
 10 byte real      3.4x10e-4932 to 1.2x10e4932        19
 10 byte packed dec     -99..99 to 99..99             18
:undocumented
^DOS Undocumented Interrupts, Functions and Structures

 INT 21,1F   Get pointer to current drive parameter table
 INT 21,32   Get pointer to drive parameter table
 INT 21,34   Get address to DOS critical flag (INDOS flag)
 INT 21,37   Get/set switch char
 INT 21,4B   EXEC/Load and execute (Function 1 undocumented)
 INT 21,50   Set current process id (DOS 2.x)
 INT 21,51   Get current process id (DOS 2.x)
 INT 21,52   Get pointer to DOS "INVARS"
 INT 21,53   Generate drive parameter table
 INT 21,55   Create new PSP
 INT 21,58   Get/set memory allocation strategy (DOS 3.x+)
 INT 21,5D   Critical error information (DOS 3.x+)
 INT 21,60   Get fully qualified file name (DOS 3.x+)
 INT 21,64   Set device driver look ahead  (DOS 3.3+)
 INT 21,69   Get/set disk serial number (DOS 4.0+)
 INT 21,F8   Set INT 21 OEM handler
 INT 28      DOS idle loop/scheduler
 INT 29      Fast character output
 INT 2E      Execute command using base level COMMAND.COM

 BCB         Batch Control Block
 DTA         Disk Transfer Area  (partially undocumented)
 MCB         Memory Control Block
 PSP         Program Segment Prefix Layout (partially undocumented)
 SFT         System File Table


 - the above items are undocumented with respect to IBM/Microsoft
   and should be not be used unless one fully understands the
   repercussions
 - several functions are version dependant and OEM specific

:warm boot:bootstrap:reboot
^Warm Boot / System Bootstrap

 - Ctrl-Alt-Delete results in a warm boot but only after part of the
   POST sequence has executed.  See  COLD BOOT  for more information.
 - ROM BIOS bootstrap loader (int 19) attempts Boot Record load
 - Drive A: is searched for a Boot Record, if no Boot Record is found
   the active partition of the first drive is searched.  If found, it
   is loaded into memory at 7C00:0 and given control.  If still not
   found Cassette BASIC is loaded (IBM only) or a prompt for a system
   diskette is displayed.
 - the boot record code checks that IBMBIO.COM and IBMDOS.COM (IO.SYS
   and DOS.SYS for MSDOS) exist and are the first two files.  These
   files must be contiguous and the first two directory entries.
 - boot record loads IBMBIO.COM
 - IBMBIO.COM initialization code loads IBMDOS.COM
    determines equipment status
    resets disk system
    initializes attached devices
    loads installable device drivers
    sets DOS relative interrupt vectors
    relocates IBMDOS.COM downward and begins its execution
 - IBMDOS.COM initializes its working tables
    initializes DOS interrupt vectors for ints 20h through 27h
    builds PSP for COMMAND.COM at lowest possible segment
    interrupt vectors for ints 0Fh through 3Fh are initialized
     (for DOS 3.1+)
    loads COMMAND.COM (or specified command interpreter) using the
     EXEC call.
 - AUTOEXEC.BAT is then loaded and executed

 - see   BOOT RECORD   INT 19   COLD BOOT
