home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / MKEY30.ZIP / MK.TXT < prev    next >
Encoding:
Text File  |  1999-12-31  |  78.3 KB  |  1,952 lines

  1.  
  2.  
  3.                ***  MASTER*KEY - Version 2.2  ***
  4.  
  5.  
  6.          COPYRIGHT, 1985, 1986, 1987 - LARRY G. GRIMES
  7.  
  8.                      ALL RIGHTS RESERVED.
  9.  
  10.  
  11.               NO PART OF THIS MANUAL OR SOFTWARE
  12.                MAY BE REPRODUCED OR TRANSMITTED
  13.                  IN ANY FORM OR BY ANY MEANS
  14.             WITHOUT WRITTEN PERMISSION OF THE AUTHOR.
  15.  
  16.  
  17.                           PUBLISHED BY:
  18.  
  19.                    SHARPE SYSTEMS CORPORATION
  20.                          2320 "E" Street
  21.                        La Verne, CA  91750
  22.                          (714) 596-0070
  23.  
  24.  
  25.  * * * * * * * * * * * *   CAUTION !   * * * * * * * * * * * * *
  26.  *                                                             *
  27.  *    REVIEW YOUR SOFTWARE LICENSE AGREEMENTS BEFORE USING     *
  28.  *    THESE PROGRAMS - Some product manufacturers specific-    *
  29.  *    ally forbid the alteration, disassembly, reverse-        *
  30.  *    assembly, or unassembly of their software. This          *
  31.  *    product was not intended to violate anyone's rights      *
  32.  *    or to assist anyone to infringe on the rights of         *
  33.  *    another to receive compensation for the effort, money,   *
  34.  *    and time consumed in the development and production      *
  35.  *    of software.                                             *
  36.  *                                                             *
  37.  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  * * * * * * * * * * * *   WARNING !   * * * * * * * * * * * * *
  44.  *                                                             *
  45.  *    THIS MANUAL AND SOFTWARE ARE PROTECTED BY UNITED         *
  46.  *    STATES COPYRIGHT LAW (Title 17 U.S. Code). THE UN-       *
  47.  *    AUTHORIZED REPRODUCTION AND/OR SALE OF THIS PRODUCT      *
  48.  *    MAY RESULT IN YOUR IMPRISONMENT OF UP TO ONE YEAR IN     *
  49.  *    A FEDERAL PENITENTIARY AND A FINE TO $10,000             *
  50.  *    (17 USC 506). COPYRIGHT INFRINGERS AND VIOLATORS ARE     *
  51.  *    ALSO SUBJECT TO CIVIL LIABILITY AND PUNITIVE DAMAGES.    *
  52.  *    BE AWARE OF THE CONSEQUENCES OF YOUR ACTIONS.            *
  53.  *                                                             *
  54.  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  55. .PA
  56.                    SOFTWARE LICENSE AGREEMENT:
  57.                    ---------------------------
  58.  
  59.      You are not given possession of this software. You only have a
  60. license for the non-exclusive use of the programs for as long as the
  61. copyright is in effect and valid. You are to treat this software as
  62. you would a book or any other copyrighted material. It is not possible
  63. for more than one person to read a book at the same time, likewise,
  64. this copy of software may not be used by more than one person on one
  65. computer at a time. You are not to give copies of the documentation or
  66. programs to anyone for any reason. This software is not to be used in
  67. a computer network, bulletin board, or any other form of general
  68. access.
  69.  
  70.      The purchase and use of this software package is evidence of the
  71. agreement to abide by the provisions of this agreement. It is against
  72. the law and in violation of United States Copyright to make copies of
  73. this documentation or copies of this software for other than backup
  74. purposes.
  75.  
  76.      This software is provided "AS IS" and includes NO WARRANTY,
  77. express or implied. The complete risk of its use rests with the person
  78. using it. The manufacturer, dealer, or representative is is in no way
  79. liable for any damages resulting from the use of this software, both
  80. direct and indirect. There is NO GUARANTEE of its accuracy,
  81. correctness, currentness, or reliability.
  82.  
  83.      This agreement and license is governed by the laws of the United
  84. States of America and the state of California.
  85.  
  86.  
  87.                         ACKNOWLEDGMENTS:
  88.                         ----------------
  89.  
  90.      MASTER*KEY is a trademark of Larry G. Grimes. IBM and PC-DOS are
  91. trademarks of the International Business Machines Corporation. MASM,
  92. Microsoft, Microsoft Basic, MS, and MS-DOS are trademarks of the
  93. Microsoft Corporation. Norton Utilities is a trademark of Peter
  94. Norton. UNIX is a trademark of Bell Laboratories.
  95. .PA
  96.                           INTRODUCTION:
  97.                           -------------
  98.  
  99.      MASTER*KEY is tool or a utility to enhance other tools and
  100. reference materials in understanding and programming your personal
  101. computer in assembly or machine language. It is not an editor or
  102. assembler. You must use other software tools for these functions.
  103.  
  104.      MASTER*KEY is an intelligent MS-DOS disassembler or reverse-
  105. assembler. It produces easily-readable self-documented assembly
  106. language source code files from machine language or object code that
  107. may be edited with any ASCII file text editor or word processor, then
  108. re-assembled using a debugger, assembler, or macro assembler and
  109. linked with other object modules if desired. It handles object code
  110. from the 8088, 8086, 8087, 80186, 80286, and 80287 processors. It
  111. decodes into MS-DOS 2.0, 2.1, 3.0, 3.1, and 3.2.
  112.  
  113.      MASTER*KEY includes an 8086 assembly language source code
  114. formatter & cross-reference generator. The formatter produces an easy-
  115. reading documented source listing identifying all ROM BIOS and DOS
  116. functions & interrupts. It serves as an object code optimizer by
  117. helping to identify stack areas, temporary storage, ASCII strings, and
  118. unnecessary code. The cross-reference identifies the number and
  119. location of all labels, symbols, functions, and interrupts. 8087,
  120. 80287, 80186, 80286 specific code is flagged, but not fully expanded
  121. and formatted. The source code produced can be immediately assembled
  122. with Microsoft's MASM 4.0 or less. The code is highly compatible with
  123. other assemblers using Intel's instructions.
  124.  
  125.  
  126.                   MINIMUM SYSTEM REQUIREMENTS:
  127.                   ----------------------------
  128.  
  129.      1.  An 8088/8086/80186/80286-Based Personal Computer
  130.             (close to IBM-compatibility)
  131.      2.  At least 256K RAM
  132.      3.  DOS 2.0, 2.1, 3.0, 3.1, OR 3.2
  133.      4.  At least one 360K DSDD Floppy Drive (IBM PC Format)
  134.             (a fixed or RAM disk is highly recommended)
  135. .PA
  136.           WHAT YOU SHOULD KNOW BEFORE USING MASTER*KEY:
  137.           ---------------------------------------------
  138.  
  139. 1.  To examine programs for compatibility or suitability.
  140.  
  141.     a.  Operation and use of an IBM PC or compatible computer and DOS.
  142.     b.  A basic understanding of the 8086 family object and source code.
  143.     c.  Familiarity with DOS & ROM BIOS functions & interrupts.
  144.  
  145. 2.  To make minor alterations.
  146.  
  147.     d.  The use of a debugger and executable program modifier such 
  148.         as Microsoft's DEBUG, SYMDEB, Peter Norton's Utilities, etc.
  149.  
  150. 3.  To completely re-assemble new programs.
  151.  
  152.     e.  An extensive knowledge of all the above.
  153.     f.  8086 assembly language programming, preferably with Microsoft's
  154.         MASM to 4.0.
  155. .PA
  156.                         GETTING STARTED:
  157.                         ----------------
  158.  
  159.      Copy the files from the original disk to a backup disk and a
  160. working floppy or hard disk and store the original for safekeeping.
  161. Always keep backups of everything. Refer to your DOS manual for
  162. procedures if necessary.
  163.  
  164.      Files included on the disk:
  165.  
  166.      1.  MK.EXE      MASTER*KEY Program.
  167.  
  168.                      The major disassembling program to allow you to
  169.                      view, print, or create a file of documented
  170.                      source code from machine language in different
  171.                      formats. To run, type in and press return:
  172.  
  173.                           MK filename.ext
  174.                           Example:  MK MK.EXE  will disassemble itself.
  175.  
  176.                      "filename" is any file, it would usually be an
  177.                      executable program with an extension of .COM or
  178.                      .EXE. The file may also be a device driver,
  179.                      overlay, or code fragment with no extension,
  180.                      .SYS, .BIN, .OVL, .OVR, .HEX, etc. Pressing the
  181.                      SPACE BAR will stop & restart the scrolling
  182.                      display. Pressing ANY OTHER key on a motionless
  183.                      display will invoke the Lotus-style command
  184.                      menus. Pressing the right & left cursor keys,
  185.                      space bar, home & end keys will browse through
  186.                      the choices. Pressing 'C' will continue the
  187.                      scrolling display. Pressing the selection number
  188.                      or RETURN after moving to a desired option will
  189.                      select the option.
  190.  
  191.      2.  MKX.EXE     MASTER*KEY Cross-Reference Program.
  192.  
  193.                      The program to print a cross-reference or produce
  194.                      a file with an extension of .XRF by hexadecimal
  195.                      location of a file with an extension of .DIS
  196.                      created ONLY by MK.EXE. To run, type in and press
  197.                      return:
  198.  
  199.                           MKX filename  (don't include extension)
  200.  
  201.                           Example:  MKX MK will create MK.XRF if
  202.                                     MK.DIS is valid.
  203.  
  204.      3.  MKDATA.EXE  MASTER*KEY Data-Reference Program.
  205.  
  206.                      The program to quickly create data statements
  207.                      in MASTER*KEY disassembled format. Locates
  208.                      most, but not always all ASCII data in
  209.                      ANY file. To run, type in and press return:
  210.  
  211.                           MKDATA filename.ext
  212.                           Example:  MKDATA MK.EXE will display on screen.
  213.                                     MKDATA MK.EXE >MK.DAT  will be
  214.                                        redirected to the file MK.DAT.
  215.  
  216.                      NOTE: MKDATA will accept command line arguments
  217.                      -B, -H, and -T the same as MK.EXE.
  218.  
  219.  
  220.      4.  README      Additional information included if necessary.
  221.  
  222.      5.  MK.TXT      MASTER*KEY Manual-on-the-disk.
  223.  
  224.      NOTE:           To DISPLAY the README, MK.TXT or any other of the
  225.                      ASCII files (DIS, XRF, DAT) type in and press
  226.                      return:
  227.  
  228.                           TYPE filename.ext
  229.  
  230.                      To PRINT the the ASCII files type in and press
  231.                      return:
  232.  
  233.                           TYPE filename.ext >PRN
  234.  
  235.                      ( >PRN redirects the output from the screen to
  236.                      printer).
  237.  
  238.  
  239.                         USING MASTER*KEY:
  240.                         -----------------
  241.  
  242.      To run MASTER*KEY, the program must be in the current directory
  243. or in a directory specified with the latest PATH command:
  244.  
  245.      EXAMPLE:  PATH=A:\DOS;B:\MK
  246.  
  247.      With this path command, if MASTER*KEY is not in the current
  248. directory, it will run from any DOS prompt if it is in A:\DOS or
  249. B:\MK. Refer to your DOS manual if you have any trouble understanding
  250. the environment path or the use of directories and subdirectories.
  251.  
  252.      Speed is increased dramatically if files are read from a RAM disk.
  253.  
  254.  
  255. MASTER*KEY'S INTERACTIVE MODE:
  256.  
  257.      MASTER*KEY offers a number of interactive commands. Commands are
  258. the instructions you give MASTER*KEY to perform a variety of different
  259. tasks, such as scrolling the documented source code of any executable
  260. program, finding all the terminating interrupts in a program to see
  261. why it seems to be quitting prematurely, or finding the references to
  262. a particular piece of data.
  263.  
  264.  
  265. COMMAND MENUS:
  266.  
  267.      Command menus are the method used by MASTER*KEY to present
  268. selection alternatives to the user. The command menus are very similar
  269. to those used by Lotus Corporation's 1-2-3 or Symphony.
  270.  
  271.      In interactive operation, to display the command menus, press the
  272. space bar to suspend the scrolling of the screen, then any other key
  273. (pressing the space bar again will continue scrolling). The currently
  274. available command choice is highlighted with a large cursor. Pressing
  275. the right & left cursor keys, space bar, home & end keys will browse
  276. through the choices. Pressing 'C' will continue the scrolling display.
  277. Pressing the selection number or RETURN after moving to a desired
  278. command will select the option.
  279.  
  280.  
  281. MASTER*KEY'S AUTOMATIC MODE & COMMAND LINE FLAGS:
  282.  
  283.            mk [infile] [-flags...]
  284.  
  285.      Command line flags allow automatic operation or setup from the
  286. DOS prompt or a DOS batch file. Such operation is only needed by the
  287. most experienced of programmers with massive fixed disk capacity,
  288. since a very large file can be created in such a short time. And such
  289. a file is relatively useless unless you're going to reassemble the
  290. entire file which will take a lot of work from the best of assembly
  291. language programmers. MASTER*KEY can do such work, but its strength
  292. is in its inter-active nature and the ability to abstract a small
  293. amount of important information from a potentially impossible-to-
  294. understand mass of source code.
  295.  
  296.      Anything in square brackets is optional, infile is not required,
  297. but if omitted MASTER*KEY will display an outline of command line
  298. options. If the program is continued, the infile will have to be
  299. entered from the main menu. This file is read from disk by
  300. sector as necessary. The file is not resident in RAM because of the
  301. memory requirements just to run MASTER*KEY. If you have 640K of RAM,
  302. or extended memory in your system, it's highly recommended you use a
  303. RAM disk (one in expanded memory is great!).
  304.  
  305.      If an output file name is specified on the command line, MASTER*
  306. KEY will work only in batch mode. If not, MASTER*KEY work only in the
  307. inter-active mode. In other words, to run MASTER*KEY automatically,
  308. you must use an output file name.
  309.  
  310.      If any of the file names or flags is incorrect, MASTER*KEY will
  311. terminate with an error message.
  312.  
  313.      EXAMPLE:   MK MK.EXE -B0A000 -E0B000 -L -OMK
  314.  
  315.      In the example, MASTER*KEY will automatically find branch
  316. addresses and disassemble itself into the disk file MK.DIS from
  317. program file offsets 0A000h to 0B000h and exit.
  318.  
  319.  
  320. COMMAND LINE FLAGS:
  321.  
  322.      -B<hex#>      Beginning Offset. Sets the offset to start disas-
  323.                    sembling, rather than the default 100h for .COM
  324.                    and the instruction pointer .EXE files. Can be
  325.                    up to 5 hexadecimal digits.
  326.  
  327.      -CC           Output ALL Code (similar to MS-DOS debug).
  328.  
  329.      -CD           Output ALL Data.
  330.  
  331.      -CI           Output Exceptions Only (funcs, int's, sgmt chgs).
  332.  
  333.      -CB           Output Branch Ref's Only.
  334.  
  335.      -CR           Output Data Ref's Only.
  336.  
  337.      -CO           Output Data Only.
  338.  
  339.      -E<hex#>      Ending Offset. Sets the offset to stop disas-
  340.                    sembling, rather than the default end of file.
  341.                    Can be up to 5 hexadecimal digits.
  342.  
  343.      -H<hex#>      Code origin or PSP Header Size. Changes the default
  344.                    PSP size of 100h for non-EXE files such as device
  345.                    drivers, code fragments, and programs loaded at
  346.                    static locations. You may use DEBUG to break a
  347.                    large file into several smaller files and use the
  348.                    code origin of each file to maintain correct
  349.                    addressing.
  350.  
  351.      -L            Load Branch Address Array. It is a good idea to use
  352.                    this flag if you need to reference all of the branch
  353.                    locations, since it takes some time to accomplish.
  354.  
  355.      -O<string>    Output File Name, to be use by the MASTER*KEY cross-
  356.                    reference, it must have the extension: .DIS.
  357.  
  358.      -Q<0-2>       Video BIOS selection (for Non-IBM Compatibles).
  359.                    0 = Write Screen Display directly to Video memory.
  360.                        Default & fastest. If your computer is not
  361.                        completely IBM video-graphics BIOS compatible,
  362.                        you may need to use Q1 or Q2.
  363.                    1 = Do not use Video BIOS (extremely slow).
  364.                        Screen output is totally software simulated.
  365.                    2 = Use Video BIOS, but remove snow (somewhat slower).
  366.                        The screen refresh is slowed down.
  367.  
  368.      -T<0-9>       Change Tab Spacing on output to file or printer.
  369.                    The default value is 8. Tab Characters are used to
  370.                    fill large blank areas on the listings and keep
  371.                    file sizes to a minimum. If your printer does not
  372.                    recognize tabs, the output will not be aligned
  373.                    properly. Also, your editor may have different
  374.                    spacing for tabs (C programmers tend to use 3 or
  375.                    5). The default value is 8.  An entry of -T or -T0
  376.                    will disable tab characters completely.  You MUST
  377.                    disable tabs with some non-IBM compatible printers.
  378.  
  379.      -V            If your computer doesn't seem to be Video Display
  380.                    compatible with MASTER*KEY, -V with no arguments
  381.                    will attempt to interpret the given display colors
  382.                    and attributes. If the result isn't satisfactory,
  383.                    use VA or VC. These arguments are for true IBM-
  384.                    compatibility (you may need to experiment with
  385.                    different combinations to achieve the desired
  386.                    display colors and attributes, also refer to your
  387.                    technical reference manual):
  388.  
  389.      MASTER*KEY IBM-PC Video Display Colors:
  390.  
  391.           Color   Hex Value
  392.  
  393.           Black      0h
  394.           Blue       1h
  395.           Green      2h
  396.           Cyan       3h
  397.           Red        4h
  398.           Magenta    5h
  399.           Yellow     6h
  400.           White      7h
  401.  
  402.      
  403.      MASTER*KEY IBM-PC Video Display Attributes
  404.  
  405.           Color Display:
  406.  
  407.           Attribute                Hex Value    Binary Mask
  408.  
  409.           Normal                      0h           0000b
  410.           Reverse                     1h           0001b
  411.           Bright                      2h           0010b
  412.           Reverse Bright              3h           0011b
  413.           Blink                       4h           0100b
  414.           Reverse Blink               5h           0101b
  415.           Bright Blink                6h           0110b
  416.           Reverse Bright Blink        7h           0111b
  417.  
  418.      Monochrome Display:
  419.  
  420.           Attribute                Hex Value    Binary Mask
  421.  
  422.           Normal                      0h           0000b
  423.           Reverse                     1h           0001b
  424.           Bright                      2h           0010b
  425.           Blink                       4h           0100b
  426.           Reverse Blink               5h           0101b
  427.           Bright Blink                6h           0110b
  428.           Reverse Bright Blink        7h           0111b
  429.           Underline                   8h           1000b
  430.           Underline Bright            Ah           1010b
  431.           Underline Blink             Ch           1100b
  432.           Underline Bright Blink      Eh           1110b
  433.  
  434.      -VA<2hex#'s>  Two hex digits for Display Attributes: 1-normal
  435.                    and 2-alternate (default: high-intensity).
  436.  
  437.      -VC<4#'s>     Four hex digits for Display & Border colors:
  438.                    1-foreground (text), 2-background, 3-alternate
  439.                    foreground (enhanced), and 4-border.
  440.  
  441.  
  442.                  MASTER*KEY RUN-TIME ERROR MESSAGES:
  443.                  -----------------------------------
  444.  
  445.      1.  Can't open input file.
  446.  
  447.          The input file was:
  448.          a.  Not on command line, ex: C:>MK INFILE.
  449.          b.  Not on drive, current directory, or path specified.
  450.              (full pathnames may be used to a total of 50 chars).
  451.  
  452.      2.  Can't open output file.
  453.  
  454.          a.  Not enough directory or disk space.
  455.          b.  Diskette write-protected.
  456.          c.  Existing file attribute may be "read-only".
  457.  
  458.      3.  Input file too large or Not enough memory.
  459.  
  460.          a. Separate the file into several small logical source code
  461.             modules to assemble into object code modules to be linked
  462.             into the final program. This is the way the program was
  463.             written in the first place.
  464.          b. Remove any memory-resident programs taking up needed RAM.
  465.  
  466.      4.  Invalid input file at line: XX.
  467.  
  468.          Cross-reference only. The file was not created by MASTER*KEY
  469.          or has been altered without MASTER*KEY.
  470.  
  471.      8.  Invalid word: XX at line#: YY.
  472.  
  473.          Cross-reference only. The file was not created by MASTER*KEY
  474.          or has been clobbered.
  475.  
  476.      9.  Command Line argument invalid: XX
  477.  
  478.          Correct & retype command line or batch file.
  479.  
  480.      10. Untrapped error : SyLongJmp (-XXX)
  481.  
  482.          General fatal error message. Usually caused at start for
  483.          lack of available memory for dynamic memory requirements.
  484.  
  485.  
  486.                       MASTER*KEY MENU MESSAGES:
  487.                       -------------------------
  488.  
  489. Main Menu:
  490.  
  491.      CONT, 1-OFFSET, 2-OUTPUT, 3-EXIT, 4-FILE INFO, 5-MISC, 6-INPUT, 
  492.          7-HELP
  493.  
  494.      C - Continue current display
  495.  
  496.          This selections returns to scrolling display or file output.
  497.  
  498.      1 - Change offset from beginning of file
  499.  
  500.          Allows entering or editing previously entered beginning and
  501.          ending offsets from beginning (code area for .EXE files) of
  502.          object file. The PSP header size is automatically added for
  503.          non-.EXE files if offset is less than header.
  504.  
  505.          -B and -E argument options on the command line.
  506.  
  507.      2 - Mixed,  All Code,  All Data,  File,  Printer,  Partial,  Window
  508.  
  509.          Output Menu Selections.
  510.  
  511.      3 - Return to DOS
  512.  
  513.          Leave MASTER*KEY permanently and return to the operating
  514.          system. When an output file is specified on the command line,
  515.          MASTER*KEY will automatically return to DOS when completed
  516.          (if not interrupted).
  517.  
  518.      4 - Display File Header Information
  519.  
  520.          Show file name, size, header size, segment info, etc.
  521.  
  522.      5 - Load Branch Addresses, Change Program Header Size,
  523.          Run External Program
  524.  
  525.          Miscellaneous Menu (operations not performed regularly)
  526.  
  527.      6 - Change input file. 
  528.  
  529.          Allows disassembling a new file with all new default parameters.
  530.  
  531.      7 - Help.
  532.  
  533.          Displays a menu map with list of current parameter settings.
  534.  
  535. Output Menu:
  536.  
  537.      CONT, 1-MIXED, 2-ALL CODE, 3-ALL DATA, 4-FILE, 5-PTR,
  538.          6-PARTIAL, 7-WINDOW
  539.  
  540.      C - Return to Main Menu
  541.  
  542.      1 - Change output to MASTER*KEY original mixed dissassembled
  543.          format
  544.  
  545.          Default MASTER*KEY output of combined code and data. A data
  546.          format, 'DB', is displayed if 8 consecutive printable
  547.          characters are found, or if a character is duplicated more
  548.          than 4 times, 'DUP(X)'. When displayed, this may not be data,
  549.          but coincidental code. You will often see 'phantom data'
  550.          hidden in your code. You can remove these references using
  551.          ALL CODE output.
  552.  
  553.      2 - Change output to all code (no data) format
  554.  
  555.          No DB's (except for indefinite opcodes, and syntax errors)
  556.          are displayed. This output will generally correspond with
  557.          output from MS-DOS Debug.
  558.  
  559.          -CC argument option on the command line.
  560.  
  561.      3 - Change output to all data (no code) format
  562.  
  563.          ALL object code is displayed in data format, DB. This is
  564.          useful for removing 'phantom code' from data areas, or
  565.          creating in-line assembly code for a program from an ASCII
  566.          file.
  567.  
  568.          -CD argument option on the command line.
  569.  
  570.      4 - Turn output in current format to disk file ON/OFF
  571.  
  572.          If not already writing to a disk file, MASTER*KEY will allow
  573.          entering or editing of a previously entered file name,
  574.          beginning and ending offsets. If already writing to a disk
  575.          file, selecting this menu option will close the current file
  576.          and return to the video display. Any valid file name can be
  577.          used for output, the MASTER*KEY cross-reference program must
  578.          have a file name with an extension of .DIS. If no extension
  579.          is indicated, this is automatically appended to the file
  580.          name. All output will be appended to this file until closed.
  581.  
  582.          NOTE: MASTER*KEY will APPEND the current output to an existing
  583.          file with no indication, so be careful with name selections.
  584.          After a file has been closed DO NOT use the same file name
  585.          unless you desire to APPEND the existing data to the file.
  586.          Use MISC MENU #3 option to execute DOS commands to copy,
  587.          delete, or rename your disassembled source files.
  588.  
  589.      5 - Turn output in current format to printer ON/OFF
  590.  
  591.          Toggles output to current printing device (PRN:). If your
  592.          printer is not IBM-compatible, does not recognize tab
  593.          characters, or the tab length is not 8, you will have to
  594.          change the tab setting from the command line when starting
  595.          MASTER*KEY. A -T will disable tabs completely and usually
  596.          solves formatting or alignment problems. Printed output is
  597.          not available from the command line.
  598.  
  599.      6 - Normal,  Int's,  Branch Ref's,  Data Ref's,  Data Only
  600.  
  601.          Partial Output Menu. MASTER*KEY's strongest points, the
  602.          ability to abstract specific documented information from a
  603.          mass of confusing object code. This is where you begin to
  604.          find your needle in the haystack.
  605.  
  606.      7 - Turn split screen ON/OFF
  607.  
  608.          Toggles the WINDOW function. The video display screen is
  609.          divided horizontally, providing two windows to view different
  610.          locations or formats of the same location. The top window is
  611.          static and cannot scroll.
  612.  
  613.          Looking at the same location in ALL CODE and ALL DATA at the
  614.          same time will help you separate real code from real data.
  615.          Looking at the actual data and references to it at the
  616.          same time can be extremely helpful. The same is true for
  617.          observing branch addresses.
  618.  
  619.  
  620. Partial Output Menu:
  621.  
  622.      CONT, 1-NORMAL, 2-INT'S, 3-BRANCH REF'S, 4-DATA REF'S, 5-DATA ONLY
  623.  
  624.      C - Return to Main Menu
  625.  
  626.      1 - Change output to MASTER*KEY original mixed disassembled
  627.          format
  628.  
  629.      2 - Change partial output to exceptions only (funcs, int's, sgmt
  630.          chgs)
  631.  
  632.          MASTER*KEY's strength, allows weeding out keypoints.
  633.  
  634.          -CI argument option on the command line.
  635.  
  636.      3 - Change partial output to branch references only
  637.  
  638.          Quickly find locations that call or branch to subroutines
  639.          and other important code areas.
  640.  
  641.          -CB argument option on the command line.
  642.  
  643.      4 - Change partial output to data references only
  644.  
  645.          Quickly find all references to a specific data item or items.
  646.  
  647.          -CR argument option on the command line.
  648.  
  649.      5 - Change partial output to data only (DB's - no code)
  650.  
  651.          Displays only data from MASTER*KEY's mixed format. It is
  652.          usually much quicker to disassemble large data areas
  653.          with MKDATA.EXE; use the option for patch areas only.
  654.  
  655.          -CO argument option on the command line.
  656.  
  657.  
  658. Miscellaneous Menu:
  659.  
  660.      CONT, 1-BRANCH ADDRS, 2-CHG HDR, 3-EXEC PGM, 4-CHG TABS
  661.  
  662.      C - Return to Main Menu
  663.  
  664.      1 - Search file for most branch addresses (may take some time)
  665.  
  666.          MASTER*KEY cannot label a branch-to location until it is
  667.          encountered. Some code deep into the program may branch
  668.          backwards toward the beginning. This option allows you to
  669.          automatically find most of the branch points quickly.
  670.          MASTER*KEY will remember these points as they are encountered
  671.          and it may take a very long time for a large program. This
  672.          function is not always needed.
  673.  
  674.          -L argument option on the command line.
  675.  
  676.      2 - Change Code Origin or PSP Header Size
  677.               (ex: 100h for .COM, 0h for .SYS)
  678.  
  679.          Allows changing the ORIGIN offset for output. The PSP
  680.          (Program Segment Prefix) is 256 bytes (100h), and is at the
  681.          beginning of every regularly executable program in memory.
  682.          The origin begins at 0h for .EXE programs since their code
  683.          segment begins at the end of the PSP. The data segment
  684.          usually begins at the beginning of the PSP, making a 100h
  685.          difference in references and actual locations of data items.
  686.          The origin can be any hexadecimal number from 0h to FFFFEh.
  687.          You may use different code origins for segmenting large files
  688.          into several source code modules to be assembled separately
  689.          and linked together later.
  690.  
  691.          Since .COM programs only have one segment, their origin is
  692.          100h, the end of the PSP. All segment references in these
  693.          programs are to the beginning of the PSP.
  694.  
  695.          Device drivers are executable programs but must have an
  696.          origin of 0h since they don't use a PSP. You can change the
  697.          origin for code fragments if you are splitting a program into
  698.          several different files. This is an excellent idea since a
  699.          source file can get very large, very quickly.
  700.  
  701.          -H argument option on the command line.
  702.  
  703.      3 - Execute DOS Command or other Program from MASTER*KEY
  704.  
  705.          Allows leaving MASTER*KEY resident and temporarily executing
  706.          a DOS command to change directories, a path, copy, delete, or
  707.          rename a file. You may also execute a completely different
  708.          program without having to restart MASTER*KEY, such as your
  709.          text editor or Debug, if you have enough memory, you can
  710.          even run another copy of MASTER*KEY in another portion of
  711.          RAM with another file without losing your current parameters.
  712.  
  713.      4 - Remove Tab Characters from Output or Change Tab Length.
  714.  
  715.          -T argument option on the command line.
  716.  
  717.  
  718.                 DETERMINING OFFSETS & BRANCH LABELS:
  719.                 ------------------------------------
  720.  
  721.      The offsets used by MASTER*KEY are 5-byte REAL ADDRESSES created
  722. by adding the 4-digit, 2-byte code segment multiplied by 16 to the
  723. 4-digit, 2-byte offset:
  724.  
  725.      CODE SEGMENT:       1000h * 16(10h)  =  10000h
  726.      OFFSET:             1000h            +   1000h
  727.                                           ---------
  728.      REAL ADDRESS:                        =  11000h
  729.      BRANCH LABEL:                        = H11000
  730.  
  731.      EXAMPLE:            H00100: JMP    H00105
  732.                                  NOP
  733.                                  NOP
  734.                          H00105: RET
  735.  
  736.  
  737. INDEFINITE FUNCTIONS:
  738.  
  739.      If a function or interrupt is unclear to MASTER*KEY, it is
  740. indicated with:
  741.  
  742.                       ;INDEF_FUNC
  743.  
  744.      This is caused by a non-DOS interrupt, or the contents of
  745. the AH register may be unclear or variable. You will have to
  746. determine on your own the purpose of these interrupts.
  747.  
  748.      Subroutine calls are indicated with:
  749.  
  750.                        ; . . . . . . . . .
  751.  
  752.      This allows you to locate them easily and fill in the function
  753. for you own documentation if desired.
  754.  
  755.      Unconditional branches are indicated with:
  756.  
  757.              ;--------------------------------------
  758.  
  759.      This allows for easy reading of the formatted source file output,
  760. and possible data and non-branched code areas are indicated if there
  761. is no branch address label following the unconditional branch. Be careful,
  762. there may be a hidden reference or the branch may be word-aligned:
  763.  
  764.                     JMP    H01200
  765.             ;--------------------------------------
  766.                     NOP
  767.             H01100: MOV    AX,BX
  768.  
  769.      ***  CAUTION  ***
  770.  
  771.           A branch label may exist here, but may be a FAR label from
  772.      another object module. If this is the case, there may be up to 15
  773.      bytes of garbage after the previous unconditional branch may exist
  774.      before the branch address that may or may not be recognized by
  775.      MASTER*KEY. When disassembling always anticipate the unexpected,
  776.      and don't make dangerous assumptions.
  777.  
  778.      Areas of repetitive bytes are indicated in groups of 256 or
  779. less with:
  780.  
  781.                     DB     256 DUP(XXh)
  782.                     DB     22  DUP(XXh)
  783.  
  784.      MASTER*KEY does not directly interpret 8087, 80186, 80286,
  785. and 80287 instructions. Most are indicated in the source listing,
  786. and must be manually edited if necessary.
  787.  
  788.  
  789.                        HOW TO USE MASTER*KEY:
  790.                        ---------------------
  791.  
  792.      MASTER*KEY works somewhat similar to the MS-DOS DEBUG program's
  793. unassemble function. MASTER*KEY goes much further than to just be a
  794. disassembler. With selective partial output you can easily understand
  795. how an executable object code file or program actually operates.
  796.  
  797.  
  798.      The last thing you should do is create a complete source file right
  799. away. An object code program can easily become more than 20 times its
  800. original size when it is turned into source code. This complete source
  801. listing or file is almost as unmanageable as the program in the first
  802. place.
  803.  
  804.      Only an experienced assembly language programmer should even
  805. attempt to totally disassemble and reassemble a complete program. Very
  806. few programs, if any of any value, can easily be disassembled and
  807. reassembled without a great amount of re-editing. MASTER*KEY can
  808. create a source file, but much work will be required to get it running
  809. again. It is best to use Debug or some other utility to change the
  810. object code directly as long as you don't change the size of the
  811. program in any way. Changing the code size may destroy branch points
  812. and data locations. The major purpose of MASTER*KEY is to help you
  813. accomplish this purpose.
  814.  
  815.      The easiest way to convert discrepancies so a file will
  816. reassemble is to convert the necessary object code verbatim using
  817. DB's. Sometimes an area of code is actually data too difficult to
  818. discern. It may be a table or a collection of control codes. Changing
  819. the values may be disastrous.
  820.  
  821.      To disassemble ROM, or any area in memory, use DEBUG to
  822. create a file. MASTER*KEY will only work with disk files.
  823.  
  824.  
  825.                   HOW TO DISASSEMBLE A PROGRAM:
  826.                   -----------------------------
  827.  
  828.      Start with data. Run MKDATA.EXE to find the data areas and 
  829. locations. To find a program feature, it doesn't make much sense
  830. to disassemble the data areas.
  831.  
  832.      Create a file of functions and interrupts only. This will lead you
  833. to key areas by just using the cross-reference of this file. Since the
  834. cross-reference is by location, you really don't need a long listing
  835. of source code. Just use the cross-reference as a map to scroll through
  836. the file using MASTER*KEY in its interactive mode. Using the windows,
  837. mixed-mode, and partial output is much more effective and motivating
  838. than trying to decipher a source code listing on a stack of paper over
  839. an inch thick.
  840.  
  841.      MASTER*KEY's interrupt messages to pay careful attention to are:
  842.  
  843.      1-Create_Pgm_Sgmnt                 BAT-Chg_Disk_Status
  844.      1-DTA_Address                      BAT-Dev_Event_Wait
  845.      1-FAT_Any_Drive                    BAT-Dev_Prgm_Term
  846.      1-FAT_Current_Drive                BAT-Ini_HD_Prm_Tbls
  847.      1-Set_DTA                          BAT-Recalibrate_Dr
  848.      1-Set_Intrpt_Vector                BAT-Seek_to_Cyl
  849.      1-TERM_normally                    BAT-Set_Disk_Type
  850.      2-Allocate_Memory                  BAT-Set_Flg_Cmp_Int
  851.      2-Control_Break                    BAT-Switch_to_V_Mem
  852.      2-IO_Device_Control                BAT-System_Request
  853.      2-Interrupt_Vector                 Crit_Error_Address
  854.      2-Load_Execute_Prgm                Ctrl-Break_Address
  855.      2-Remove_Directory                 DIRECT_INPUT
  856.      2-Rename_File                      DIRECT_OUTPUT
  857.      2-Subpgrm_Rtn_Code                 Divide_by_Zero
  858.      2-TERM_Resident                    INDEF_FUNC
  859.      2-TERM_w_RtnCde                    INDEF_FUNC
  860.      3-Create_Temp_File                 INDEF_INSTR
  861.      3-Lock_Unlock_File                 INT_on_Overflow
  862.      3-PSP_Address                      Non-Maskable_INT
  863.      AbsoluteDisk_Write                 One_Byte_Interrupt
  864.      Absolute_Disk_Read                 RETURN_CODE
  865.      B-Clock_Count                      STACK_PTR_CHG
  866.      B-Control_to_BASIC                 SYNTAX_ERROR
  867.      B-Format_FD_Track                  Single_Step
  868.      B-Read_FD_Sectors                  TERMINATE_Resident
  869.      B-Set_Clock_Count                  TERM_normally
  870.      B-TERMINATE_REBOOT                 Terminate_Address
  871.      B-Write_FD_Sectors                 XS_SGMT_CHG
  872.      BAT-Alt_Disk_Reset                 XS_SGMT_OVRD
  873.  
  874.      The most important instructions to watch for are port operations,
  875. IN and OUT. When a program is using these, it is programming or
  876. interfacing directly with the hardware and bypassing the more
  877. compatible BIOS and DOS functions.
  878.  
  879.      There are three ways software uses hardware: directly, with BIOS,
  880. or with DOS functions. The tradeoff is speed vs. compatibility. The
  881. more DOS is used, the more compatible it is with various computers.
  882. But it is also slower, since the functions are more generic and have
  883. to handle a wider variety of input. Use of BIOS is faster, but much
  884. more hardware specific. Programming and going directly to the hardware
  885. is extremely fast, but completely hardware specific.
  886.  
  887.      The use of input and output ports is the most difficult to
  888. disassemble and understand. Start with the hardware the port is
  889. assigned to and go from there.
  890.  
  891.  
  892.    The Difference Between MASTER*KEY Output and Microsoft's MASM 4.0:
  893.    ------------------------------------------------------------------
  894.  
  895. TRANSLATING DISASSEMBLED FILES:
  896. -------------------------------
  897.  
  898.      Microsoft's MASM 4.0 has strong type checking and is somewhat
  899. unforgiving to older source code programs. Some assembly language
  900. programs found in magazines and journals will just not assemble
  901. without a great deal of modification. Every effort has been made to
  902. have MASTER*KEY code as compatible as possible, but there are always
  903. exceptions. It is a good rule of thumb to avoid future trouble by
  904. making your source program assemble exactly like the original object
  905. code program before doing any major modification (when completely
  906. reassembling the file).
  907.  
  908.      ***  CAUTION  ***
  909.  
  910.      Although some object code is valid, and will execute flawlessly
  911. with the Intel architecture, when disassembled and reassembled, its
  912. not the same. And unfortunately, this is very common. MASTER*KEY will
  913. label potential problems:
  914.  
  915.         ADD     AL,[BX+SI+00h]  ;ASM_Syntax_Error   ;00550 024000        
  916.  
  917.      is assembled and disassembled as (with a change and loss of code):
  918.  
  919.         ADD     AL,[BX+SI]                          ;00550 0200        
  920.  
  921.      Several opcodes have synonyms and usually should be translated
  922. verbatim (take a hard look at the code, its probably data):
  923.  
  924.         ADD     AL,AL                               ;00354 00C0
  925. ;MASM Translation:                                         02C0
  926.         DB      02h,0C0h
  927.         ADD     Byte Ptr [BX+SI],01h                ;004A7 820001
  928. ;MASM Translation:                                         800001
  929.         DB      82h,00h,01h
  930.         INC     AX                                  ;00AAD FFC0
  931. ;MASM Translation:                                         40
  932.         DB      0FFh,0C0h
  933.  
  934.  
  935.      The only way MASM can differentiate between NEAR and FAR
  936. returns is by including PROC FAR psuedo-ops in the source code. This
  937. will not work if NEAR and FAR returns are combined in the same object
  938. module. A lot of older programs have this problem. In DOS 1, a program
  939. could terminate with a FAR return to 0, with all other returns
  940. obviously being NEAR, since COM programs normally have only one segment.
  941.  
  942. ;       RET     0201h           ;RET_Far:0201h      ;00536 CA0102
  943. ;MASM error 10: Syntax error
  944.         DB      0CAh,01h,02h
  945.  
  946. ;       RET                     ;RET_Far            ;00539 CB
  947. ;MASM error 10: Syntax error
  948.         DB      0CBh
  949.  
  950. H00536  PROC     FAR
  951. ...
  952.         RET      0201h           ;RETURN_CODE        ;00536 CA0102
  953.         RET                                          ;00539 CB
  954. ...
  955. H00536  END      PROC
  956.  
  957.  
  958.      If 0Ah follows the Ascii-Adjust opcodes, just remove the
  959. operand. Anything other than 0Ah is a syntax error.
  960.  
  961. ;       AAM     0Ah                                 ;00547 D40A
  962. ;MASM error 1: Extra characters on line
  963.         AAM                                         ;00547 D40A
  964.  
  965. ;       AAD     0Ah                                 ;00549 D50A
  966. ;MASM error 1: Extra characters on line
  967.         AAD                                         ;00549 D50A
  968.  
  969. ;       AAM     00h                                 ;00547 D400
  970. ;MASM error 1: Extra characters on line
  971.         DB      0D4h,00h
  972.  
  973. ;       AAD     00h                                 ;00549 D500
  974. ;MASM error 1: Extra characters on line
  975.         DB      0D5h,00h
  976.  
  977.      Doubleword Jmps and Calls to a location outside of the current
  978. object module require an EXTRN pseudo-op before the ASSUME CS to define
  979. the external label. The label is prefixed with the code segment (CS:).
  980.  
  981.      When assembled, the LINK program will resolve the addresses if
  982. you have defined them in another source code module. For temporary
  983. fixes, the DB's are the best. If the label is not resolved before
  984. linking, the 9Ah CALL will be altered to 0CCh INT 3. Also the
  985. contents of the segment:offset bytes will be all zeros.
  986.  
  987.  
  988. ;       CALL    00403h:00201h   ; . . . . . . . . . ;004CF 9A01020304
  989. ;MASM error 38: Left operand must have segment
  990.         DB      9Ah,01h,02h,03h,04h
  991. ;       JMP     00403h:00201h                       ;00574 EA01020304
  992. ;MASM error 38: Left operand must have segment
  993.         DB      0EAh,01h,02h,03h,04h
  994.  
  995.  
  996. EXTRN   UNIQUE_LABEL:FAR
  997.  
  998. ASSUME  CS:CODE
  999.  
  1000. ;       CALL    00403h:00201h   ; . . . . . . . . . ;004CF 9A01020304
  1001. ;       JMP     00403h:00201h                       ;00574 EA01020304
  1002.         CALL    CS:UNIQUE_LABEL ; . . . . . . . . . ;004CF 9A01020304
  1003.         JMP     CS:UNIQUE_LABEL ; . . . . . . . . . ;00574 EA01020304
  1004.  
  1005.  
  1006.      The LOCK opcode is very seldom used (only for multiprocessing),
  1007. and must be disassembled by hand if valid.
  1008.  
  1009. ;       LOCK                                        ;0057E F0
  1010. ;MASM error 66: Must have opcode after prefix
  1011.         DB      0F0h
  1012. .PA
  1013.                   ASSEMBLY LANGUAGE REFERENCE:
  1014.                   ----------------------------
  1015.  
  1016. SEGMENT REGISTERS:
  1017.  
  1018.      CS   Code Segment
  1019.      DS   Data Segment
  1020.      SS   Stack Segment
  1021.      ES   Extra Segment
  1022.  
  1023.  
  1024. GENERAL REGISTERS:
  1025.  
  1026.      AX   Accumulator           AH - AL    (High & Low Bytes
  1027.      BX   Base                  BH - BL    of Word Registers)
  1028.      CX   Counter               CH - CL
  1029.      DX   Data                  DH - DL
  1030.  
  1031.      SP   Stack Pointer         (Stack Address)
  1032.      BP   Base Pointer          (Alternate Stack Address
  1033.                                         or Interior Stack Marker)
  1034.      SI   Source Index          (Implicit Address for String Ops)
  1035.      DI   Destination Index     (Implicit Address for String Ops)
  1036.      IP   Instruction Pointer   (Code Address)
  1037.  
  1038.  
  1039. FLAGS - Status and Control Flags Register
  1040.  
  1041.      FLAGS:  AF   Auxiliary Carry (for BCD Arithmetic)
  1042.              CF   Carry Flag
  1043.              DF   Direction Flag (Strings)
  1044.              IF   Interrupt Enable Flag
  1045.              OF   Overflow Flag (CF and SF)
  1046.              PF   Parity Flag
  1047.              SF   Sign Flag
  1048.              TF   Trap Flag (Single Step)
  1049.              ZF   Zero Flag
  1050.  
  1051.      FLAGS REGISTER BIT PATTERN (XX = NOT USED):
  1052.  
  1053.      15                    8                       0
  1054.      XX XX XX XX OF DF IF TF SF ZF XX AF XX PF XX CF
  1055.  
  1056.  
  1057.                         OPERAND SUMMARY:
  1058.                         ----------------
  1059.  
  1060. MULTI-BYTE INSTRUCTIONS:
  1061.  
  1062. Second Byte Bit Pattern:  mod XXX r/m
  1063.  
  1064.      mod  Displacement (immediate value alter index)
  1065.  
  1066.      00   No DISP (except if mod = 00 and r/m = 110 then
  1067.                    EA = Disp High:Disp Low)
  1068.      01   DISP = Disp Low Sign-extended to 16 bits, No Disp High
  1069.      10   DISP = Disp High:Disp Low
  1070.      11   r/m is treated as a "reg" field
  1071.  
  1072.           r/m    Operand Address
  1073.  
  1074.           000    [BX + SI + DISP]   ([expression] indicates the
  1075.           001    [BX + DI + DISP]   contents of the memory location
  1076.           010    [BP + SI + DISP]   pointed to by the expression
  1077.           011    [BP + DI + DISP]   rather than the location itself.
  1078.           100    [SI + DISP]
  1079.           101    [DI + DISP]
  1080.           110    [BP + DISP]
  1081.           111    [BX + DISP]
  1082.  
  1083.      DISP follows 2nd byte of instruction (before data if required).
  1084.  
  1085.      mod = 11, r/m "reg" field bit assignments:
  1086.  
  1087.           Word Operand   Byte Operand
  1088.  
  1089.           000  AX        000  AL
  1090.           001  CX        001  CL
  1091.           010  DX        010  DL
  1092.           011  BX        011  BL
  1093.           100  SP        100  AH
  1094.           101  BP        101  CH
  1095.           110  SI        110  DH
  1096.           111  DI        111  BH
  1097.  
  1098.  
  1099. SEGMENT OVERRIDE:
  1100.  
  1101.      Segment Override Prefix Bit Settings:  001 reg 110
  1102.  
  1103.           Segment Override "reg" field bit assignments:
  1104.  
  1105.           00   ES
  1106.           01   CS
  1107.           10   SS
  1108.           11   DS
  1109.  
  1110.           Register   Default    with Segment Override Prefix
  1111.  
  1112.           IP         CS:IP      No Segment Override
  1113.           SP         SS:SP      No Segment Override
  1114.           BP         SS:BP      (BP + DS), ES, or CS
  1115.           SI or DI   DS:XI      ES, SS, or CS (No String Ops)
  1116.           SI         DS:SI      ES, SS, or CS
  1117.           DI         ES:DI      No Segment Override
  1118.  
  1119.  
  1120. OPCODES IN ALPHABETICAL ORDER:
  1121.  
  1122.      Opcode    Description
  1123.      -----------------------------------------
  1124.      AAA       Adjust Result of ASCII Addition
  1125.      AAD       Adjust AX Register for Division
  1126.      AAM       Adjust Result of BCD Multiplication
  1127.      AAS       Adjust Result of ASCII Subtraction
  1128.      ADC       Integer Add with Carry
  1129.      ADD       Integer Add
  1130.      AND       Logical And
  1131.      CALL      Call a Subroutine
  1132.      CBW       Convert Byte to Word
  1133.      CLC       Clear Carry Flag Status
  1134.      CLD       Clear Direction Flag
  1135.      CLI       Clear Interrupt Enable Flag
  1136.      CMC       Complement Carry Flag Status
  1137.      CMP       Compare Two Operands
  1138.      CMPS      Compare Memory with Memory (String)
  1139.      CWD       Convert Word to Double Word
  1140.      DAA       Adjust AL after BCD Addition
  1141.      DAS       Adjust AL after BCD Subtraction
  1142.      DEC       Decrement Register or Memory by One
  1143.      DIV       Unsiged Division
  1144.      HLT       Halt the Processor
  1145.      IDIV      Signed Division
  1146.      IMUL      Signed Multiplication
  1147.      IN        Input Byte or Word from Port into AX
  1148.      INC       Increment Register or Memory by One
  1149.      INT       Software Interrupt
  1150.      INTO      Interrupt on Overflow
  1151.      IRET      Return from Interrupt Routine
  1152.      JA        Jump if Above
  1153.      JB        Jump if Below
  1154.      JBE       Jump if Below or Equal
  1155.      JCXC      Jump if CX = Zero
  1156.      JG        Jump if Greater
  1157.      JGE       Jump if Greater or Equal
  1158.      JL        Jump if Less Than
  1159.      JLE       Jump if Less Than or Equal
  1160.      JMP       Jump Unconditionally
  1161.      JNB       Jump if Not Below
  1162.      JNO       Jump if Not Overflow
  1163.      JNS       Jump if Not Sign
  1164.      JNZ       Jump if Not Zero
  1165.      JO        Jump if Overflow
  1166.      JPE       Jump if Parity Even
  1167.      JPO       Jump if Parity Odd
  1168.      JS        Jump if Sign
  1169.      JZ        Jump if Zero
  1170.      LAHF      Load AH from Low-order Byte of Flags Register
  1171.      LDS       Load Register and DS from Memory
  1172.      LEA       Load Effective Address
  1173.      LES       Load Register and ES from Memory
  1174.      LOCK      Assert Bus Lock Signal
  1175.      LODS      Load from Memory into Register (String)
  1176.      LOOP      Loop (Decrement CX and Jump on Condition)
  1177.      LOOPNZ    Loop while Not Zero
  1178.      LOOPZ     Loop while Zero
  1179.      MOV       Move
  1180.      MOVS      Move Memory to Memory (String)
  1181.      MOVSW     Move Word (String)
  1182.      MUL       Unsigned Multiplication
  1183.      NEG       Negate an Integer
  1184.      NOP       No Operation (NULL Byte)
  1185.      NOT       One's Complement of Register or Memory
  1186.      OR        Logical Inclusive Or
  1187.      OUT       Output Byte or Word to Port
  1188.      POP       Read a Word from Top of Stack
  1189.      POPF      Read Flags Register from Top of Stack
  1190.      PUSH      Write a Word to Top of Stack
  1191.      PUSHF     Copy Flags Register to Top of Stack
  1192.      RCL       Rotate Left Through Carry
  1193.      RCR       Rotate Right Through Carry
  1194.      REP       Repeat Next String Instruction
  1195.      RET       Return from Subroutine
  1196.      ROL       Rotate Left
  1197.      ROR       Rotate Right
  1198.      SAHF      Store AH into Flags Register
  1199.      SAR       Shift Arithmetic Right
  1200.      SBB       Subtract with Borrow (Using Two's Complement)
  1201.      SCASB     Scan Byte (String)
  1202.      SCASW     Scan Word (String)
  1203.      SHL       Logical Shift Left
  1204.      SHR       Logical Shift Right
  1205.      STC       Set Carry Flag
  1206.      STD       Set Direction Flag
  1207.      STI       Set Interrupt Enable Flag (Enable Interrupts)
  1208.      STOSB     Store Byte (String)
  1209.      STOSW     Store Word (String)
  1210.      SUB       Subtraction (Using Two's Complement)
  1211.      TEST      Logical Compare
  1212.      WAIT      Wait While TEST Pin Not Asserted
  1213.      XCHG      Swap Memory or Register with Register
  1214.      XLAT      Table Lookup Translation
  1215.      XOR       Logical Exclusive OR
  1216.  
  1217.  
  1218. OPCODES IN HEX ORDER (variable opcodes have two bytes):
  1219.  
  1220.      00  ADD     01  ADD     02  ADD     03  ADD
  1221.      04  ADD     05  ADD     06  PUSH    07  POP
  1222.      08  OR      09  OR      0A  OR      0B  OR
  1223.      0C  OR      0D  OR      0E  PUSH    0F  CTS
  1224.      10  ADC     11  ADC     12  ADC     13  ADC
  1225.      14  ADC     15  ADC     16  PUSH    17  POP
  1226.      18  SBB     19  SBB     1A  SBB     1B  SBB
  1227.      1C  SBB     1D  SBB     1E  PUSH    1F  POP
  1228.      20  AND     21  AND     22  AND     23  AND
  1229.      24  AND     25  AND     26  ADD     27  DAA
  1230.      28  SUB     29  SUB     2A  SUB     2B  SUB
  1231.      2C  SUB     2D  ???     2E  ADD     2F  DAS
  1232.      30  XOR     31  XOR     32  XOR     33  XOR
  1233.      34  XOR     35  XOR     36  ADD     37  AAA
  1234.      38  CMP     39  CMP     3A  CMP     3B  CMP
  1235.      3C  CMP     3D  CMP     3E  ADD     3F  AAS
  1236.      40  INC     41  INC     42  INC     43  INC
  1237.      44  INC     45  INC     46  INC     47  INC
  1238.      48  DEC     49  DEC     4A  DEC     4B  DEC
  1239.      4C  DEC     4D  DEC     4E  DEC     4F  DEC
  1240.      50  PUSH    51  PUSH    52  PUSH    53  PUSH
  1241.      54  PUSH    55  PUSH    56  PUSH    57  PUSH
  1242.      58  POP     59  POP     5A  POP     5B  POP
  1243.      5C  POP     5D  POP     5E  POP     5F  POP
  1244.      60  ???     61  ???     62  ???     63  ???
  1245.      64  ???     65  ???     66  ???     67  ???
  1246.      68  ???     69  ???     6A  ???     6B  ???
  1247.      6C  ???     6D  ???     6E  ???     6F  ???
  1248.      70  JO      71  JNO     72  JB      73  JNB
  1249.      74  JZ      75  JNZ     76  JBE     77  JA
  1250.      78  JPO     79  JNS     7A  JPE     7B  JPO
  1251.      7C  JL      7D  JGE     7E  JLE     7F  JG
  1252.  
  1253.      8000 - 8007   ADD        8008 - 800F   OR
  1254.      8010 - 8017   ADC        8018 - 801F   SBB
  1255.      8020 - 8027   AND        8028 - 802F   SUB
  1256.      8030 - 8037   XOR        8038 - 803F   CMP
  1257.      8040 - 8047   ADD        8048 - 804F   OR
  1258.      8050 - 8057   ADC        8058 - 805F   SBB
  1259.      8060 - 8067   AND        8068 - 806F   SUB
  1260.      8070 - 8077   XOR        8078 - 807F   CMP
  1261.      8080 - 8087   ADD        8088 - 808F   OR
  1262.      8090 - 8097   ADC        8098 - 809F   SBB
  1263.      80A0 - 80A7   AND        80A8 - 80AF   SUB
  1264.      80B0 - 80B7   XOR        80B8 - 80BF   CMP
  1265.      80C0 - 80C7   ADD        80C8 - 80CF   OR
  1266.      80D0 - 80D7   ADC        80D8 - 80DF   SBB
  1267.      80E0 - 80E7   AND        80E8 - 80EF   SUB
  1268.      80F0 - 80F7   XOR        80F8 - 80FF   CMP
  1269.  
  1270.      8100 - 8107   ADD        8108 - 810F   OR
  1271.      8110 - 8117   ADC        8118 - 811F   SBB
  1272.      8120 - 8127   AND        8128 - 812F   SUB
  1273.      8130 - 8137   XOR        8138 - 813F   CMP
  1274.      8140 - 8147   ADD        8148 - 814F   OR
  1275.      8150 - 8157   ADC        8158 - 815F   SBB
  1276.      8160 - 8167   AND        8168 - 816F   SUB
  1277.      8170 - 8177   XOR        8178 - 817F   CMP
  1278.      8180 - 8187   ADD        8188 - 818F   OR
  1279.      8190 - 8197   ADC        8198 - 819F   SBB
  1280.      81A0 - 81A7   AND        81A8 - 81AF   SUB
  1281.      81B0 - 81B7   XOR        81B8 - 81BF   CMP
  1282.      81C0 - 81C7   ADD        81C8 - 81CF   OR
  1283.      81D0 - 81D7   ADC        81D8 - 81DF   SBB
  1284.      81E0 - 81E7   AND        81E8 - 81EF   SUB
  1285.      81F0 - 81F7   XOR        81F8 - 81FF   CMP
  1286.  
  1287.      8200 - 8207   ADD        8208 - 820F   ???
  1288.      8210 - 8217   ADC        8218 - 821F   SBB
  1289.      8220 - 8227   ???        8228 - 822F   SUB
  1290.      8230 - 8237   ???        8238 - 823F   CMP
  1291.      8240 - 8247   ADD        8248 - 824F   ???
  1292.      8250 - 8257   ADC        8258 - 825F   SBB
  1293.      8260 - 8267   ???        8268 - 826F   SUB
  1294.      8270 - 8277   ???        8278 - 827F   CMP
  1295.      8280 - 8287   ADD        8288 - 828F   ???
  1296.      8290 - 8297   ADC        8298 - 829F   SBB
  1297.      82A0 - 82A7   ???        82A8 - 82AF   SUB
  1298.      82B0 - 82B7   ???        82B8 - 82BF   CMP
  1299.      82C0 - 82C7   ADD        82C8 - 82CF   ???
  1300.      82D0 - 82D7   ADC        82D8 - 82DF   SBB
  1301.      82E0 - 82E7   ???        82E8 - 82EF   SUB
  1302.      82F0 - 82F7   ???        82F8 - 82FF   CMP
  1303.  
  1304.      8300 - 8307   ADD        8308 - 830F   ???
  1305.      8310 - 8317   ADC        8318 - 831F   SBB
  1306.      8320 - 8327   ???        8328 - 832F   SUB
  1307.      8330 - 8337   ???        8338 - 833F   CMP
  1308.      8340 - 8347   ADD        8348 - 834F   ???
  1309.      8350 - 8357   ADC        8358 - 835F   SBB
  1310.      8360 - 8367   ???        8368 - 836F   SUB
  1311.      8370 - 8377   ???        8378 - 837F   CMP
  1312.      8380 - 8387   ADD        8388 - 838F   ???
  1313.      8390 - 8397   ADC        8398 - 839F   SBB
  1314.      83A0 - 83A7   ???        83A8 - 83AF   SUB
  1315.      83B0 - 83B7   ???        83B8 - 83BF   CMP
  1316.      83C0 - 83C7   ADD        83C8 - 83CF   ???
  1317.      83D0 - 83D7   ADC        83D8 - 83DF   SBB
  1318.      83E0 - 83E7   ???        83E8 - 83EF   SUB
  1319.      83F0 - 83F7   ???        83F8 - 83FF   CMP
  1320.  
  1321.      84  TEST    85  TEST    86  XCHG    87  XCHG
  1322.      88  MOV     89  MOV     8A  MOV     8B  MOV
  1323.      8C  MOV     8D  LEA     8E  MOV     8F  POP
  1324.      90  NOP     91  XCHG    92  XCHG    93  XCHG
  1325.      94  XCHG    95  XCHG    96  XCHG    97  XCHG
  1326.      98  CBW     99  CWD     9A  CALL    9B  WAIT
  1327.      9C  PUSHF   9D  POPF    9E  SAHF    9F  LAHF
  1328.      A0  MOV     A1  MOV     A2  MOV     A3  MOV
  1329.      A4  MOVSB   A5  MOVSW   A6  CMPSB   A7  CMPSW
  1330.      A8  TEST    A9  TEST    AA  STOSB   AB  STOSW
  1331.      AC  LODSB   AD  LODSW   AE  SCASB   AF  SCASW
  1332.      B0  MOV     B1  MOV     B2  MOV     B3  MOV
  1333.      B4  MOV     B5  MOV     B6  MOV     B7  MOV
  1334.      B8  MOV     B9  MOV     BA  MOV     BB  MOV
  1335.      BC  MOV     BD  MOV     BE  MOV     BF  MOV
  1336.      C0  ???     C1  ???     C2  RET     C3  RET
  1337.      C4  LES     C5  LDS     C6  MOV     C7  MOV
  1338.      C8  ENTER   C9  LEAVE   CA  RETF    CB  RETF
  1339.      CC  INT     CD  INT     CE  INTO    CF  IRET
  1340.  
  1341.      D000 - D007   ROL        D008 - D00F   ROR
  1342.      D010 - D017   RCL        D018 - D01F   RCR
  1343.      D020 - D027   SHL        D028 - D02F   SHR
  1344.      D030 - D037   ???        D038 - D03F   SAR
  1345.      D040 - D047   ROL        D048 - D04F   ROR
  1346.      D050 - D057   RCL        D058 - D05F   RCR
  1347.      D060 - D067   SHL        D068 - D06F   SHR
  1348.      D070 - D077   ???        D078 - D07F   SAR
  1349.      D080 - D087   ROL        D088 - D08F   ROR
  1350.      D090 - D097   RCL        D098 - D09F   RCR
  1351.      D0A0 - D0A7   SHL        D0A8 - D0AF   SHR
  1352.      D0B0 - D0B7   ???        D0B8 - D0BF   SAR
  1353.      D0C0 - D0C7   ROL        D0C8 - D0CF   ROR
  1354.      D0D0 - D0D7   RCL        D0D8 - D0DF   RCR
  1355.      D0E0 - D0E7   SHL        D0E8 - D0EF   SHR
  1356.      D0F0 - D0F7   ???        D0F8 - D0FF   SAR
  1357.  
  1358.      D100 - D107   ROL        D108 - D10F   ROR
  1359.      D110 - D117   RCL        D118 - D11F   RCR
  1360.      D120 - D127   SHL        D128 - D12F   SHR
  1361.      D130 - D137   ???        D138 - D13F   SAR
  1362.      D140 - D147   ROL        D148 - D14F   ROR
  1363.      D150 - D157   RCL        D158 - D15F   RCR
  1364.      D160 - D167   SHL        D168 - D16F   SHR
  1365.      D170 - D177   ???        D178 - D17F   SAR
  1366.      D180 - D187   ROL        D188 - D18F   ROR
  1367.      D190 - D197   RCL        D198 - D19F   RCR
  1368.      D1A0 - D1A7   SHL        D1A8 - D1AF   SHR
  1369.      D1B0 - D1B7   ???        D1B8 - D1BF   SAR
  1370.      D1C0 - D1C7   ROL        D1C8 - D1CF   ROR
  1371.      D1D1 - D1D7   RCL        D1D8 - D1DF   RCR
  1372.      D1E0 - D1E7   SHL        D1E8 - D1EF   SHR
  1373.      D1F0 - D1F7   ???        D1F8 - D1FF   SAR
  1374.  
  1375.      D200 - D207   ROL        D208 - D20F   ROR
  1376.      D210 - D217   RCL        D218 - D21F   RCR
  1377.      D220 - D227   SHL        D228 - D22F   SHR
  1378.      D230 - D237   ???        D238 - D23F   SAR
  1379.      D240 - D247   ROL        D248 - D24F   ROR
  1380.      D250 - D257   RCL        D258 - D25F   RCR
  1381.      D260 - D267   SHL        D268 - D26F   SHR
  1382.      D270 - D277   ???        D278 - D27F   SAR
  1383.      D280 - D287   ROL        D288 - D28F   ROR
  1384.      D290 - D297   RCL        D298 - D29F   RCR
  1385.      D2A0 - D2A7   SHL        D2A8 - D2AF   SHR
  1386.      D2B0 - D2B7   ???        D2B8 - D2BF   SAR
  1387.      D2C0 - D2C7   ROL        D2C8 - D2CF   ROR
  1388.      D2D2 - D2D7   RCL        D2D8 - D2DF   RCR
  1389.      D2E0 - D2E7   SHL        D2E8 - D2EF   SHR
  1390.      D2F0 - D2F7   ???        D2F8 - D2FF   SAR
  1391.  
  1392.      D300 - D307   ROL        D308 - D30F   ROR
  1393.      D310 - D317   RCL        D318 - D31F   RCR
  1394.      D320 - D327   SHL        D328 - D32F   SHR
  1395.      D330 - D337   ???        D338 - D33F   SAR
  1396.      D340 - D347   ROL        D348 - D34F   ROR
  1397.      D350 - D357   RCL        D358 - D35F   RCR
  1398.      D360 - D367   SHL        D368 - D36F   SHR
  1399.      D370 - D377   ???        D378 - D37F   SAR
  1400.      D380 - D387   ROL        D388 - D38F   ROR
  1401.      D390 - D397   RCL        D398 - D39F   RCR
  1402.      D3A0 - D3A7   SHL        D3A8 - D3AF   SHR
  1403.      D3B0 - D3B7   ???        D3B8 - D3BF   SAR
  1404.      D3C0 - D3C7   ROL        D3C8 - D3CF   ROR
  1405.      D3D3 - D3D7   RCL        D3D8 - D3DF   RCR
  1406.      D3E0 - D3E7   SHL        D3E8 - D3EF   SHR
  1407.      D3F0 - D3F7   ???        D3F8 - D0FF   SAR
  1408.  
  1409.      D4  AAM     D5  AAD     D6  ???     D7  XLAT
  1410.      D8  ???     D9  ???     DA  ???     DB  ???
  1411.      DC  ???     DD  ???     DE  ???     DF  ???
  1412.      E0  LOOPNZ  E1  LOOPZ   E2  LOOP    E3  JCXZ
  1413.      E4  IN      E5  IN      E6  OUT     E7  OUT
  1414.      E8  CALL    E9  JMP     EA  JMP     EB  JMP
  1415.      EC  IN      ED  IN      EE  OUT     EF  OUT
  1416.      F0  LOCK    F1  ???     F2  REPNZ   F3  REPZ
  1417.      F4  HLT     F5  CMC     F6  TEST    F7  TEST
  1418.      F8  CLC     F9  STC     FA  CLI     FB  STI
  1419.      FC  CLD     FD  STD
  1420.  
  1421.      FE00 - FE07   INC        FE08 - FE0F   DEC
  1422.      FE10 - FE17   ???        FE18 - FE1F   ???
  1423.      FE20 - FE27   ???        FE28 - FE2F   ???
  1424.      FE30 - FE37   ???        FE38 - FE3F   ???
  1425.      FE40 - FE47   INC        FE48 - FE4F   DEC
  1426.      FE50 - FE57   ???        FE58 - FE5F   ???
  1427.      FE60 - FE67   ???        FE68 - FE6F   ???
  1428.      FE70 - FE77   ???        FE78 - FE7F   ???
  1429.      FE80 - FE87   INC        FE88 - FE8F   DEC
  1430.      FE90 - FE97   ???        FE98 - FE9F   ???
  1431.      FEA0 - FEA7   ???        FEA8 - FEAF   ???
  1432.      FEB0 - FEB7   ???        FEB8 - FEBF   ???
  1433.      FEC0 - FEC7   INC        FEC8 - FECF   DEC
  1434.      FED0 - FED7   ???        FED8 - FEDF   ???
  1435.      FEE0 - FEE7   ???        FEE8 - FEEF   ???
  1436.      FEF0 - FEF7   ???        FEF8 - FEFF   ???
  1437.  
  1438.      FF00 - FF07   INC        FF08 - FF0F   DEC
  1439.      FF10 - FF17   CALL       FF18 - FF1F   ???
  1440.      FF20 - FF27   JMP        FF28 - FF2F   ???
  1441.      FF30 - FF37   PUSH       FF38 - FF3F   ???
  1442.      FF40 - FF47   INC        FF48 - FF4F   DEC
  1443.      FF50 - FF57   CALL       FF58 - FF5F   ???
  1444.      FF60 - FF67   JMP        FF68 - FF6F   ???
  1445.      FF70 - FF77   PUSH       FF78 - FF7F   ???
  1446.      FF80 - FF87   INC        FF88 - FF8F   DEC
  1447.      FF90 - FF97   CALL       FF98 - FF9F   ???
  1448.      FFA0 - FFA7   JMP        FFB0 - FFBF   PUSH
  1449.      FFB8 - FFB7   ???        FFC0 - FFCF   INC
  1450.      FFC8 - FFC7   DEC        FFC8 - FFCF   ???
  1451.      FFD0 - FFD7   CALL       FFD8 - FFDF   ???
  1452.      FFE0 - FFE7   JMP        FFE8 - FFEF   ???
  1453.      FFF0 - FFF7   PUSH       FFF8 - FFFF   ???
  1454. .PA
  1455.                         INPUT AND OUTPUT PORTS:
  1456.                         -----------------------
  1457.  
  1458.      Description                     PC/XT       AT          PCjr
  1459.  
  1460.      DMA Controller 1                000h-00Fh   000h-01Fh   ...
  1461.      Interrupt Controller 1          020h-021h   020h-03Fh   020h-027h
  1462.      Timer                           040h-043h   040h-05Fh   040h-047h
  1463.      PPI (Keyboard)                  060h-063h   ...         060h-067h
  1464.      AT Keyboard                     ...         060h-06Fh   ...
  1465.      DMA Page Register               080h-083h   080h-09Fh   ...
  1466.      NMI Mask Register               0Ah         070h-07Fh   0A0h-0A7h
  1467.      AT Interrupt Controller 2       ...         0A0h-0BFh   ...
  1468.      PCjr Sound Generator            ...         ...         0C0h-0C7h
  1469.      AT DMA Controller 2             ...         0C0h-0DFh   ...
  1470.      AT Clear/Reset 80287            ...         0F0h-0F1h   ...
  1471.      AT 80287 Math Coprocessor       ...         0F8h-0FFh   ...
  1472.      Joystick                        200h-20Fh   200h-207h   200h-207h
  1473.      PC/XT Expansion Unit            210h-217h   ...         ...
  1474.      AT Secondary Parallel Printer   ...         278h-27Fh   ...
  1475.      Primary Serial Port             3F8h-3FFh   3F8h-3FFh   2F8h-2FFh
  1476.      Secondary Serial Port           2F8h-2FFh   3F8h-3FFh   ...
  1477.      Prototype Card                  300h-31Fh   300h-31Fh   ...
  1478.      Fixed Disk                      320h-32Fh   1F0h-1F8h   ...
  1479.      Primary Parallel Printer        378h-37Fh   378h-37Fh   ...
  1480.      PC/XT SDLC (Mainframe Comm)     380h-38Fh   ...         ...
  1481.      AT Secondary Bisynch Comm       ...         380h-38Fh   ...
  1482.      AT Primary Bisynch Comm         ...         3A0h-3AFh   ...
  1483.      Monochrome Adapter/Printer      3B0h-3BFh   3B0h-3BFh   ...
  1484.      Color Graphics Adapter          3D0h-3DFh   3D0h-3DFh   ...
  1485.      Diskette Controller             3F0h-3F7h   3F0h-3F7h   0F0h-0FFh
  1486. .PA
  1487.                       INTERRUPT REFERENCE:
  1488.                       --------------------
  1489.  
  1490. BIOS SERVICES & FUNCTION INTERRUPTS:
  1491.  
  1492. INT 05h - BIOS Print Screen               
  1493.  
  1494.      Send Screen Image to Printer
  1495.  
  1496. INT 10h - BIOS Video Control
  1497.  
  1498.      AH = 00h              Set Video Mode
  1499.      AH = 01h              Set Cursor Size
  1500.      AH = 02h              Set Cursor Position
  1501.      AH = 03h              Read Cursor Position
  1502.      AH = 04h              Read Light Pen Position
  1503.      AH = 05h              Set Active Display Page
  1504.      AH = 05h   AL = 80h   Get Display Page Register
  1505.      AH = 05h   AL = 81h   Set CPU Display Page Register
  1506.      AH = 05h   AL = 82h   Set CRT Display Page Register
  1507.      AH = 05h   AL = 83H   Set CPU & CRT Display Page Register
  1508.      AH = 06h              Scroll Window Up
  1509.      AH = 07h              Scroll Window Down
  1510.      AH = 08h              Read Character and Attribute
  1511.      AH = 09h              Write Character and Attribute
  1512.      AH = 0Ah              Write Character
  1513.      AH = 0Bh              Set Color Palette
  1514.      AH = 0Ch              Write Pixel Dot
  1515.      AH = 0Dh              Read Pixel Dot
  1516.      AH = 0Eh              Write Character as TTY
  1517.      AH = 0Fh              Get Current Video Mode
  1518.      AH = 10h   AL = 00h   JR - Set One Palette Register
  1519.      AH = 10h   AL = 01h   JR - Set Border Register
  1520.      AH = 10h   AL = 02h   JR - Set All Palette Registers
  1521.      AH = 13h              AT - Write Character String
  1522.  
  1523. INT 11h - BIOS Equipment List
  1524.  
  1525.      Get List of Assigned Equipment
  1526.  
  1527. INT 12h - BIOS Memory Available
  1528.  
  1529.      Get Available Memory Size in K-Bytes
  1530.  
  1531. INT 13h - BIOS Disk Services
  1532.  
  1533.      AH = 00h              Reset Disk System
  1534.      AH = 01h              Get Disk Status
  1535.      AH = 02h              Read Disk Sectors
  1536.      AH = 03h              Write Disk Sectors
  1537.      AH = 04h              Verify Disk Sectors
  1538.      AH = 05h              Format Disk Track
  1539.      AH = 08h              AT - Get Current Drive Parameters
  1540.      AH = 09h              AT - Initialize Fixed-Disk Parameter Tables
  1541.      AH = 0Ah              AT - Read Long
  1542.      AH = 0Bh              AT - Write Long
  1543.      AH = 0Ch              AT - Seek to Cylinder
  1544.      AH = 0Dh              AT - Alternate Disk Reset
  1545.      AH = 10h              AT - Test for Drive Ready
  1546.      AH = 11h              AT - Recalibrate Drive
  1547.      AH = 14h              AT - Controller Diagnostics
  1548.      AH = 15h              AT - Get Disk Type
  1549.      AH = 16h              AT - Change of Disk Status
  1550.      AH = 17h              AT - Set Disk Type
  1551.  
  1552. INT 14h - BIOS Serial Port Control
  1553.  
  1554.      AH = 00h              Initialize Serial Port Parameters
  1555.      AH = 01h              Send One Character
  1556.      AH = 02h              Receive One Character
  1557.      AH = 03h              Get Serial Port Status
  1558.  
  1559. INT 15h - BIOS Cassette Control
  1560.  
  1561.      AH = 00h              Turn Cassette Motor ON
  1562.      AH = 01h              Turn Cassette Motor OFF
  1563.      AH = 02h              Read Data Blocks
  1564.      AH = 03h              Write Data Blocks
  1565.  
  1566. INT 15h - BIOS Device Control
  1567.  
  1568.      AH = 80h              AT - Device Open
  1569.      AH = 81h              AT - Device Close
  1570.      AH = 82h              AT - Device Program Termination
  1571.      AH = 83h              AT - Event Wait
  1572.  
  1573. INT 15h - BIOS Joystick Services
  1574.  
  1575.      AH = 84h              AT - Joystick Support
  1576.  
  1577. INT 15h - BIOS System Request
  1578.  
  1579.      AH = 85h              AT - System Request Key Pressed
  1580.  
  1581. INT 15h - BIOS Device Services
  1582.  
  1583.      AH = 86h              AT - Wait
  1584.      AH = 87h              AT - Move Memory Block
  1585.  
  1586. INT 15h - BIOS Memory Management
  1587.  
  1588.      AH = 88h              AT - Get Extended Memory Size
  1589.      AH = 89h              AT - Switch to Virtual Memory
  1590.  
  1591. INT 15h - BIOS Device Services
  1592.  
  1593.      AH = 90h              AT - Device Busy Loop
  1594.      AH = 91h              AT - Set Flag and Complex Interrupt
  1595.  
  1596. INT 16h - BIOS Keyboard Control
  1597.  
  1598.      AH = 00h              Read Next Keyboard Character
  1599.      AH = 01h              Report whether Character Ready
  1600.      AH = 02h              Get Shift Status
  1601.      AH = 03h   AL = 00h   JR - Reset Typematic
  1602.      AH = 03h   AL = 01h   JR - Increase Initial Delay
  1603.      AH = 03h   AL = 02h   JR - Increase Continuing Delays
  1604.      AH = 03h   AL = 03h   JR - Increase Both Delays
  1605.      AH = 03h   AL = 04h   JR - Turn Typematic OFF
  1606.      AH = 04h   AL = 00h   JR - Turn Click OFF
  1607.      AH = 04h   AL = 01h   JR - Turn Click ON
  1608.  
  1609. INT 17h - BIOS Printer Control
  1610.  
  1611.      AH = 00h              Send One Byte to Printer
  1612.      AH = 01h              Initialize Printer
  1613.      AH = 02h              Get Printer Status
  1614.  
  1615. INT 18h - BIOS BASIC            
  1616.  
  1617.      Switch Control to ROM BASIC
  1618.  
  1619. INT 19h - BIOS Bootstrap
  1620.  
  1621.      Reset Computer
  1622.  
  1623. INT 1Ah - BIOS Time Services
  1624.  
  1625.      AH = 00h              Read Current Clock Count
  1626.      AH = 01h              Set Current Clock Count
  1627.      AH = 02h              AT - Read Real Time Clock
  1628.      AH = 03h              AT - Set Real Time Clock
  1629.      AH = 04h              AT - Read Date from Real Time Clock
  1630.      AH = 05h              AT - Set Date in Real Time Clock
  1631.      AH = 06h              AT - Set Alarm
  1632.      AH = 07h              AT - Reset Alarm
  1633.  
  1634.  
  1635. DOS INTERRUPT FUNCTIONS:
  1636.  
  1637.      20h   Program Terminate, Come to Normal Ending
  1638.      21h   Major DOS Function Call
  1639.      22h   Terminate Address
  1640.      23h   Break Address
  1641.      24h   Critical Error Handler Address
  1642.      25h   Absolute Disk Read
  1643.      26h   Absolute Disk Write
  1644.      27h   Terminate Program, but Stay Resident
  1645.      2Fh   Print Spool Control (DOS 3.0+ Versions Only)
  1646.  
  1647.  
  1648. INT 21h - DOS FUNCTIONS
  1649.  
  1650.      AH = 00h   Program Normal Terminate
  1651.      AH = 01h   Keyboard Input with Echo
  1652.      AH = 02h   Display Output
  1653.      AH = 03h   Serial Port Input
  1654.      AH = 04h   Serial Port Output
  1655.      AH = 05h   Printer Output
  1656.      AH = 06h   Direct Keyboard or Display I/O
  1657.      AH = 07h   Direct Keyboard Input without Echo
  1658.      AH = 08h   Keyboard Input without Echo
  1659.      AH = 09h   Display String
  1660.      AH = 0Ah   Buffered Keyboard Input
  1661.      AH = 0Bh   Check Keyboard Input Status
  1662.      AH = 0Ch   Clear Keyboard and Do Function
  1663.      AH = 0Dh   Reset Disk
  1664.      AH = 0Eh   Select Current Drive
  1665.      AH = 0Fh   Open File
  1666.      AH = 10h   Close File
  1667.      AH = 11h   Search for First Matching Filename
  1668.      AH = 12h   Search for Next Matching Filename
  1669.      AH = 13h   Delete File
  1670.      AH = 14h   Read Sequential File Record
  1671.      AH = 15h   Write Sequential File Record
  1672.      AH = 16h   Create File
  1673.      AH = 17h   Rename File
  1674.      AH = 19h   Report Current Drive
  1675.      AH = 20h   Set Disk Transfer Area
  1676.      AH = 1Bh   Get FAT Information, Current Drive
  1677.      AH = 1Ch   Get FAT Information, Any Drive
  1678.      AH = 21h   Read Random File Record
  1679.      AH = 22h   Write Random File Record
  1680.      AH = 23h   Get File Size
  1681.      AH = 24h   Set Random Record Field
  1682.      AH = 25h   Set Interrupt Vector
  1683.      AH = 26h   Create Program Segment
  1684.      AH = 27h   Read Random File Records
  1685.      AH = 28h   Write Random File Records
  1686.      AH = 29h   Parse Filename
  1687.      AH = 2Ah   Get Date
  1688.      AH = 2Bh   Set Date
  1689.      AH = 2Ch   Get Time
  1690.      AH = 2Dh   Set Time
  1691.      AH = 2Eh   Set Disk Write Verification
  1692.      AH = 2Fh   Get DTA Address
  1693.      AH = 30h   Get DOS Version Number
  1694.      AH = 31h   KEEP: Advanced Terminate but Stay Resident
  1695.      AH = 33h   Get/Set Control Break
  1696.      AH = 35h   Get Interrupt Vector
  1697.      AH = 36h   Get Disk Free Space
  1698.      AH = 38h   Get Country-Dependent Information
  1699.      AH = 39h   MKDIR: Make Directory
  1700.      AH = 3Ah   RMDIR: Remove Directory
  1701.      AH = 3Bh   CHDIR: Change Current Directory
  1702.      AH = 3Ch   CREAT: Create File
  1703.      AH = 3Dh   Open File
  1704.      AH = 3Eh   Close File Handle
  1705.      AH = 3Fh   Read from File or Device
  1706.      AH = 40h   Write to File or Device
  1707.      AH = 41h   Delete File
  1708.      AH = 42h   Move File Pointer
  1709.      AH = 43h   CHMOD: Get/Set File Attributes
  1710.      AH = 44h   IOCTL: I/O Control for Device Drivers
  1711.      AH = 45h   DUP: Duplicate File Handle
  1712.      AH = 46h   CDUP: Force Handle Duplication
  1713.      AH = 47h   Get Current Directory
  1714.      AH = 48h   Allocate Memory
  1715.      AH = 49h   Free Allocated Memory Block
  1716.      AH = 4Ah   SETBLOCK: Modify Allocated Memory Block
  1717.      AH = 4Bh   EXEC: Load and Execute Subprogram
  1718.      AH = 4Ch   Terminate Process
  1719.      AH = 4Dh   Get Return Code of Subprogram
  1720.      AH = 4Eh   FIND FIRST: Start Filename Search
  1721.      AH = 4Fh   Continue Filename Search
  1722.      AH = 54h   Get Verify State
  1723.      AH = 56h   Rename File
  1724.      AH = 57h   Get/Set File Date and Time
  1725.      AH = 58h   Get/Set Memory Allocation Strategy
  1726.  
  1727.  
  1728. DOS 3.0 SPECIFIC FUNCTIONS FOR INTERRUPT 21h
  1729.  
  1730.      AH = 59h   Get Extended Error Code
  1731.      AH = 5Ah   Create Temporary File
  1732.      AH = 5Bh   Create New File
  1733.      AH = 5Ch   Lock/Unlock File Access
  1734.      AH = 62h   Get PSP Address
  1735. .PA
  1736.              BIOS-DOS PARAMETERS AND MEMORY LOCATIONS:
  1737.              -----------------------------------------
  1738.  
  1739. BIOS Disk Status Code Byte Returned in AL:
  1740.      
  1741.      01h = Bad Command
  1742.      02h = Address Mark Not Found
  1743.      03h = Write Attempted on Write-Protected Disk
  1744.      04h = Sector Not Found
  1745.      06h = Disk Removed
  1746.      08h = DMA Overrun
  1747.      09h = DMA Across 64K Boundary
  1748.      0Ah   Motor Startup Time
  1749.      10h = Bad CRC
  1750.      20h = Disk Controller Failed
  1751.      40h = Seek Failed
  1752.      80h = Disk Timed Out
  1753.  
  1754.  
  1755. BIOS Serial Port Success/Failure Code Bit Settings Returned in AH:
  1756.  
  1757.      0 = Data Ready
  1758.      1 = Overrun Error
  1759.      2 = Parity Error
  1760.      3 = Framing Error
  1761.      4 = Break Detected
  1762.      5 = Transmission Buffer Register Empty
  1763.      6 = Transmission Shift Register Empty
  1764.      7 = Port Timed-Out
  1765.  
  1766.  
  1767. BIOS Serial Port Modem Status Code Bit Settings Returned in AL:
  1768.  
  1769.      0 = Delta Clear to Send
  1770.      1 = Delta Set Ready
  1771.      2 = Trailing Edge Ring Detected
  1772.      3 = Change,receive Line Signal Detected
  1773.      4 = Clear to Send
  1774.      5 = Data Set Ready
  1775.      6 = Ring Detected
  1776.      7 = Receive Line Signal Detected
  1777.  
  1778.  
  1779. BIOS Printer Success/Failure Status Code Bit Settings Returned in AH:
  1780.  
  1781.      0 = Printer Timed Out
  1782.      1 = Unused
  1783.      2 = Unused
  1784.      3 = I/O Error
  1785.      4 = Selected
  1786.      5 = Out of Paper
  1787.      6 = Acknowledge
  1788.      7 = Not Busy
  1789.  
  1790.  
  1791. DOS DISK STATUS BYTE CODE BITS:
  1792.  
  1793.      0 = Invalid Disk Command
  1794.      1 = Disk Address Mark Not Found
  1795.      2 = Disk Sector Not Found: Damaged or Not Formatted
  1796.      3 = DMA Disk Error
  1797.      4 = CRC (Cyclical Redundancy Check) Failed
  1798.      5 = Disk Controller Chip Failed
  1799.      6 = Seek to Track Failed
  1800.      7 = Disk Timed-Out, Failed to Respond in Allotted Time
  1801.  
  1802.  
  1803. DISK BASE TABLE (10 bytes):
  1804.  
  1805.      00h   Specify Byte 1: Step Rate Time, Head Unload Time
  1806.      01h   Specify Byte 2: Head Load Time, DMA Mode
  1807.      02h   Wait Time Until Diskette Drive Motor Turned OFF
  1808.      03h   Bytes per Sector:
  1809.            0 = 128
  1810.            2 = 512
  1811.            3 = 1,024
  1812.      04h   Last Sector Number
  1813.      05h   Gap Length between Sectors for Read/Write
  1814.      06h   Data Length when Sector Length Not Specified
  1815.      07h   Gap Length between Sectors for Formatting
  1816.      08h   Data Value Stored in Formatted Sectors
  1817.      09h   Head Settle Time
  1818.  
  1819.  
  1820. ALLOCATED MEMORY BLOCKS:
  1821.  
  1822.      F0000h   Permanent ROM Area: ROM-BIOS, ROM BASIC, Boot Diagnostics
  1823.      E0000h   Cartridge ROM Area (PC JR)
  1824.      D0000h   Cartridge ROM Area (PC JR)
  1825.      C0000h   BIOS Extensions (XT Disk)
  1826.      B0000h   Conventional Display Memory (PC, XT, and AT)
  1827.      A0000h   Display Memory Expansion
  1828.      90000h   User RAM, to 640K
  1829.      80000h   User RAM, to 576K
  1830.      70000h   User RAM, to 512K
  1831.      60000h   User RAM, to 448K
  1832.      50000h   User RAM, to 384K
  1833.      40000h   User RAM, to 320K
  1834.      30000h   User RAM, to 256K
  1835.      20000h   User RAM, to 192K
  1836.      10000h   User RAM, to 128K:  Maximum Normally Allowed for PC JR
  1837.      00000h   User RAM, to  64K:  Used by Operating System Software
  1838.  
  1839.  
  1840. MAIN DOS INTERRUPT MEMORY LOCATIONS:
  1841.  
  1842.      00h - 00000h   Division by Zero
  1843.      01h - 00004h   Trace or Single-Step through Program (for Debugging)
  1844.      02h - 00008h   Non-Maskable Interrupt (Used by Hardware Debuggers)
  1845.      03h - 0000Ch   Set Break Points in Program (for Debugging)
  1846.      04h - 00010h   Arithmetic Overflow
  1847.      05h - 00014h   BIOS Print Screen Function Routine
  1848.      08h - 00020h   Hardware Clock Tick, for Real Time Interrupts
  1849.      09h - 00024h   Keyboard Input
  1850.      0Dh - 00034h   CRT Vertical Retrace, for Video Control
  1851.      0Eh - 00038h   Disk Attention Request
  1852.      0Fh - 0113Ch   Printer Control
  1853.      10h - 00040h   BIOS Video Display Functions
  1854.      11h - 00044h   BIOS Equipment List
  1855.      12h - 00048h   BIOS Memory Size
  1856.      13h - 0004Ch   BIOS Disk Functions
  1857.      14h - 00050h   BIOS Communications Functions
  1858.      15h - 00054h   BIOS Cassette Tape Functions
  1859.      16h - 00058h   BIOS Keyboard Functions
  1860.      17h - 0005Ch   BIOS Printer Functions
  1861.      18h - 00060h   ROM BASIC Language
  1862.      19h - 00064h   BIOS Computer Bootstrap (Reset) Routine
  1863.      1Ah - 00068h   BIOS Time and Date Functions
  1864.      1Bh - 0006Ch   BIOS Keyboard Control-Break
  1865.      1Ch - 00070h   Clock Tick
  1866.      1Dh - 00074h   Points to Table of Video Control Parameters
  1867.      1Eh - 00078h   Points to Disk Base Table
  1868.      1Fh - 0007Ch   Points to High Video Graphics Characters
  1869.      20h - 00080h   BIOS Program Terminate
  1870.      21h - 00084h   DOS Functions
  1871.      22h - 00088h   DOS Program-Terminate Custom Programmed Routine
  1872.      23h - 0008Ch   DOS Control-Break Custom Programmed Routine
  1873.      24h - 00090h   DOS Critical Error Custom Programmed Routine
  1874.      25h - 00094h   DOS Absolute Disk Read
  1875.      26h - 00098h   DOS Absolute Disk Write
  1876.      27h - 0009Ch   DOS Program Terminate, but Stay Resident
  1877.      44h - 00110h   Points to PC JR Low Video Graphics Characters
  1878.      48h - 00120h   PC JR Keyboard Translation
  1879.      49h - 00124h   Points to Translation Table for Keyboard Devices
  1880.  
  1881.  
  1882. MEMORY LOCATIONS OF BIOS & DOS PARAMETERS:
  1883.  
  1884.      00410h   (2-Byte Word)  Assigned Equipment List
  1885.      00413h   (2-Byte Word)  Usable Memory Size in K,
  1886.                              (BIOS Interrupt 12h Returns this Word)
  1887.      0041Ah   (2-Byte Word)  Beginning of BIOS Keyboard Buffer
  1888.      0041Ch   (2-Byte Word)  End of BIOS Keyboard Buffer
  1889.      00441h   (One Byte)     Disk Status Code
  1890.      00449h   (One Byte)  Current Video Mode
  1891.  
  1892.      0044Ah   (One 2-Byte Word)  Screen Width in Text Columns
  1893.      0044Eh   (One 2-Byte Word)  Screen Location Offset
  1894.      00450h   (Eight 2-Byte Words)  Cursor Locations for the 8
  1895.               Separate Video Pages.
  1896.      00462h   (One Byte) Current Display Page Number
  1897.      00504h   (One Byte) Mimic A Two-Disk System
  1898.               (for Systems with only One Disk Drive)
  1899.      00510h   (One 2-Byte Word) Default DS (Data Segment) Value
  1900. .PA
  1901.                           BIBLIOGRAPHY:
  1902.                           -------------
  1903.  
  1904.      (This is a suggested reference list and is by no means
  1905. meant to be comprehensive. There are many more books available
  1906. that are just as valuable).
  1907.  
  1908.  
  1909. Crayne, Charles A. and Girard, Dian, THE SERIOUS ASSEMBLER. NY:
  1910.      Simon and Schuster Trade Publishing Group, 1985. A nice in-
  1911.      expensive reference.
  1912.  
  1913. Dorner, Joe, ASSEMBLY LANGUAGE ROUTINES FOR THE IBM PC. NY:
  1914.      Brady Communications Company, Inc. (Simon & Schuster), 1985.
  1915.      A reference for writing assembly language subroutines for
  1916.      Basic programming.
  1917.  
  1918. Duncan, Ray, ADVANCED MS DOS. Redmond, WA: Microsoft Press, 1986.
  1919.      A thorough DOS reference.
  1920.  
  1921. IBM, DISK OPERATING SYSTEM (DOS 3.1) & MANUAL. Boca Raton, FL:
  1922.      International Business Machines Corporation, 1985.
  1923.  
  1924. IBM, DISK OPERATING SYSTEM TECHNICAL REFERENCE MANUAL (DOS 3.1).
  1925.      Boca Raton, FL: International Business Machines
  1926.      Corporation, 1985.
  1927.  
  1928. INTEL, 8086/8088/8087/80186/80188 PROGRAMMER'S POCKET REFERENCE
  1929.      GUIDE. Santa Clara, CA: Intel Corporation, 1982.
  1930.  
  1931. Kamin, Jonathan, MS DOS POWER USER'S GUIDE. Berkeley, CA: Sybex
  1932.      Inc., 1986. A good batch file programming reference.
  1933.  
  1934. Lafore, Robert, ASSEMBLY LANGUAGE PRIMER FOR THE IBM PC & XT.
  1935.      NY: The Waite Group (New American Library), 1984. An excellent
  1936.      tutorial on 8086 assembly language programming.
  1937.  
  1938. Microsoft, MICROSOFT MACRO ASSEMBLER & MANUAL. Bellevue, WA:
  1939.      Microsoft Corporation, 1984.
  1940.  
  1941. Morgan, Christopher L., BLUEBOOK OF ASSEMBLY ROUTINES FOR THE IBM
  1942.      PC & XT. NY: The Waite Group (New American Library), 1984. A
  1943.      reference of example routines in 8086 assembly language.
  1944.  
  1945. Norton, Peter, THE PETER NORTON PROGRAMMER'S GUIDE TO THE IBM PC.
  1946.      Bellevue, WA: Microsoft Press, 1985. An excellent reference to
  1947.      DOS and ROM BIOS functions and interrupts.
  1948.  
  1949. Norton, Peter, INSIDE THE IBM PC. NY: Brady Communications Company,
  1950.      Inc. (Simon & Schuster), 1985. Systems hardware/software
  1951.      reference.
  1952.