home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft_Programmers_Library.7z / MPL / masm / masminst.txt < prev    next >
Encoding:
Text File  |  2013-11-08  |  127.0 KB  |  3,327 lines

  1.  Microsoft  Macro Assembler - Installing and Using
  2.                      the Professional Development System
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  ────────────────────────────────────────────────────────────────────────────
  12.              Microsoft (R) Macro Assembler - Installing and Using
  13.                      the Professional Development System
  14.  
  15.                                  Version 6.0
  16.  ────────────────────────────────────────────────────────────────────────────
  17.  
  18.  
  19.                 For MS(R) OS/2 and MS-DOS(R) Operating Systems
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  Microsoft Corporation
  29.  
  30.  Information in this document is subject to change without notice and does
  31.  not represent a commitment on the part of Microsoft Corporation. The
  32.  software described in this document is furnished under a license agreement
  33.  or nondisclosure agreement. The software may be used or copied only in
  34.  accordance with the terms of the agreement. It is against the law to copy
  35.  the software on any medium except as specifically allowed in the license or
  36.  nondisclosure agreement. No part of this manual may be reproduced or
  37.  transmitted in any form or by any means, electronic or mechanical, including
  38.  photocopying and recording, for any purpose without the express written
  39.  permission of Microsoft.
  40.  RESTRICTED RIGHTS: Use, duplication, or disclosure by the U.S. Government is
  41.  subject to restrictions as set forth in subparagraph (c)(1)(ii) of the
  42.  Rights in Technical Data and Computer Software clause at DFARS 252.227-7013
  43.  or subparagraphs (c)(1) and (2) of Commercial Computer Software
  44.  ─Restricted Rights at 48 CFR 52.227-19, as applicable.
  45.  Contractor/Manufacturer is Microsoft Corporation, One Microsoft Way,
  46.  Redmond, WA  98052-6399.
  47.  
  48.  
  49.  (C) Copyright Microsoft Corporation, 1991. All rights reserved.
  50.  
  51.  Printed in the United States of America.
  52.  
  53.  
  54.  Microsoft, MS, MS-DOS, CodeView, and XENIX are registered
  55.  trademarks and Windows, Windows/386, and
  56.  Making it all make sense are trademarks of Microsoft Corporation.
  57.  
  58.  U.S. Patent No. 4,955,066
  59.  
  60.  386-Max is a trademark of Qualitas, Inc.
  61.  
  62.  BRIEF is a registered trademark of UnderWare, Inc.
  63.  
  64.  IBM is a registered trademark of International Business
  65.  Machines Corporation.
  66.  
  67.  UNIX is a registered trademark of American Telephone
  68.  and Telegraph Company.
  69.  
  70.  Document No. LN06558-0291Document No.OEM D/O/P710-6Z
  71.  10 9 8 7 6 5 4 3 2 1
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  Chapter 1  The Professional Development System
  80.  
  81.       Before You Proceed
  82.              System Requirements
  83.              Package Contents
  84.       Features New to Version 6.0
  85.       Microsoft Programmer's WorkBench
  86.       Key to Document Conventions
  87.  
  88.  Chapter 2  Installing the Microsoft Macro Assembler
  89.  
  90.       Running SETUP
  91.       Supplying SETUP Information
  92.              Changing Your Response
  93.       Responding to the Prompts
  94.              Choosing the Host Operating System
  95.              Installing the Programmer's WorkBench (PWB)
  96.              Emulating BRIEF
  97.              Installing the New MASM.EXE Utility
  98.              Copying Documentation Files and Sample Programs
  99.              Copying the Microsoft Mouse Driver, MOUSE.COM
  100.              Choosing the Target Hard Disk
  101.              Choosing Bound, Real-Mode, and Protected-Mode Directories
  102.              Selecting File Directories
  103.              Reviewing and Changing Responses
  104.              Installing
  105.       Configuring Your System
  106.       Customizing the Programmer's WorkBench
  107.       Configuring Extended Memory for the CodeView Debugger
  108.  
  109.  Chapter 3  Using the Programmer's WorkBench
  110.  
  111.       Starting PWB
  112.              Specifying a Source File
  113.              Command-Line Options
  114.       Elements of the PWB Environment
  115.              Windows and Other Screen Elements
  116.              Menus
  117.              File Menu
  118.              Edit Menu
  119.              View Menu
  120.              Search Menu
  121.              Make Menu
  122.              Run Menu
  123.              Options Menu
  124.              Browse Menu
  125.              Help Menu
  126.              Getting Help
  127.       Using the Editor
  128.              Moving Around in a Text File
  129.              Customizing the Editor
  130.       Assembling and Linking
  131.              Building Programs in PWB
  132.       Debugging Programs
  133.              Using the Browser
  134.              Debugging with the CodeView Debugger
  135.              Running HELLO.EXE
  136.              Debugging HELLO.EXE
  137.       Getting More Details
  138.  
  139.  Chapter 4  Using the Online Reference System
  140.  
  141.       Structure of the Microsoft Advisor
  142.       Navigating through the Microsoft Advisor
  143.              Using the Help Menu
  144.              Using the F1 Key and the Mouse
  145.              Using Hyperlinks
  146.              Using Help Windows and Dialog Boxes
  147.              Accessing Different Types of Information
  148.              Specifying Temporary Help Files
  149.       Using QuickHelp
  150.              Entering and Exiting QuickHelp
  151.  
  152.  Index
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  Chapter 1  The Professional Development System
  159.  ────────────────────────────────────────────────────────────────────────────
  160.  
  161.  The Microsoft Macro Assembler Professional Development System is a
  162.  collection of tools designed to increase DOS and OS/2 programming
  163.  efficiency. The system offers
  164.  
  165.  
  166.    ■   The Microsoft Macro Assembler (MASM)
  167.  
  168.    ■   A customizable editor that can accept user extensions
  169.  
  170.    ■   A source-level, window-oriented debugger
  171.  
  172.    ■   A project-management ("make") utility
  173.  
  174.    ■   A source-level browser
  175.  
  176.    ■   A complete online reference system
  177.  
  178.  
  179.  The Programmer's WorkBench (PWB) integrates these tools, creating an
  180.  environment in which you can edit, assemble, link, and debug your programs.
  181.  
  182.  
  183.  This book is a general introduction to MASM. This chapter introduces some of
  184.  the features of the Professional Development System. Chapter 2 describes how
  185.  to install the Professional Development System. Chapter 3 introduces the
  186.  Programmer's WorkBench. Chapter 4 shows how to use the online reference
  187.  system─a complete reference to the Professional Development System and the
  188.  MASM language that is accessible both within PWB and at the OS/2 or DOS
  189.  command line.
  190.  
  191.  ────────────────────────────────────────────────────────────────────────────
  192.  NOTE
  193.  
  194.  Microsoft documentation uses the term "OS/2" to refer to the OS/2 systems─
  195.  Microsoft Operating System/2 (MS(R) OS/2) and IBM OS/2. Similarly, the term
  196.  "DOS" refers to both the MS-DOS and IBM Personal Computer DOS operating
  197.  systems. The name of a specific operating system is used when it is
  198.  necessary to note features that are unique to that system.
  199.  ────────────────────────────────────────────────────────────────────────────
  200.  
  201.  If you'd like further information about a topic as you read through this
  202.  book, you can consult
  203.  
  204.  
  205.    ■   The Microsoft Macro Assembler Programmer's Guide
  206.  
  207.    ■   The Microsoft Macro Assembler Reference
  208.  
  209.    ■   The online reference system (discussed in Chapter 4 of this book)
  210.  
  211.  
  212.  
  213.  Before You Proceed
  214.  
  215.  Before installing MASM, you should make sure that your computer meets
  216.  minimum system requirements and that your package is complete.
  217.  
  218.  
  219.  System Requirements
  220.  
  221.  MASM requires the following configuration:
  222.  
  223.  
  224.    ■   A personal computer running DOS version 3.0 or later or OS/2 version
  225.        1.1 or later.
  226.  
  227.    ■   640K (kilobytes) of available memory (RAM) for operating under DOS (1
  228.        megabyte of RAM is recommended).
  229.  
  230.    ■   3 megabytes of RAM for operating under OS/2 (4 megabytes are
  231.        recommended).
  232.  
  233.    ■   At least 384K of extended memory if you want to debug large DOS
  234.        programs.
  235.  
  236.    ■   A hard-disk drive with at least 4 megabytes of free space. (The actual
  237.        space required depends on the options you select.)
  238.  
  239.    ■   A floppy-disk drive.
  240.  
  241.  
  242.  Programs assembled with MASM version 6.0 run under DOS versions 2.1 and
  243.  later.
  244.  
  245.  
  246.  Package Contents
  247.  
  248.  Check your MASM package to see if everything is there. If any pieces are
  249.  missing, contact the retailer from whom you purchased the package.
  250.  
  251.  In the package, you should find the following items:
  252.  
  253.  
  254.    ■   Registration card. There are many advantages to being a registered
  255.        owner of MASM 6.0, including notification of future releases and
  256.        easier access to customer assistance. Please take the time to fill out
  257.        and mail the registration card now. (If you are already a registered
  258.        owner of an earlier version of MASM, a registration card is not
  259.        included with the update.)
  260.  
  261.    ■   Disks. The distribution disk labeled "Setup" contains the PACKING.LST
  262.        file, which lists the location and description of all disk files in
  263.        the MASM package. Disk files are compressed; the SETUP program
  264.        decompresses them as they are installed.
  265.  
  266.    ■   Installing and Using the Professional Development System. The book
  267.        you're reading. It explains how to install and start to use the
  268.        Professional Development System.
  269.  
  270.    ■   Programmer's Guide. This book describes MASM features and explains how
  271.        they work. It also shows how to write optimal MASM code.
  272.  
  273.    ■   Reference. This book describes assembler directives, operators, and
  274.        instructions, including timing and encoding data.
  275.  
  276.    ■   Product Assistance Request. If you need to contact Microsoft Product
  277.        Support, be sure to fill out this questionnaire (which is bound into
  278.        the Programmer's Guide) before calling.
  279.  
  280.    ■   Documentation Feedback Card. To help Microsoft improve its
  281.        documentation, this postage-paid survey mailer is included in the
  282.        Programmer's Guide. Please take the time to fill out the card with any
  283.        comments or suggestions.
  284.  
  285.  
  286.  
  287.  Features New to Version 6.0
  288.  
  289.  If you've used an earlier version of MASM, you'll find many new capabilities
  290.  in version 6.0, and you'll discover that you can perform familiar operations
  291.  more quickly:
  292.  
  293.  
  294.    ■   Speed up development with the integrated Programmer's WorkBench.
  295.  
  296.    ■   Build programs more easily with the new "make" facility (NMAKE) and
  297.        PWB's powerful project capabilities.
  298.  
  299.    ■   Track down program bugs and logic errors more quickly with the new
  300.        Microsoft CodeView(R) debugger version 3.12. With an 80286 or 80386
  301.        processor and 1 megabyte or more of RAM, you can debug a program up to
  302.        640K in size in real mode.
  303.  
  304.    ■   Access MASM language, assembler, linker, and utility documentation
  305.        with the Microsoft Advisor and QuickHelp online reference systems.
  306.  
  307.    ■   Cross-reference program procedures with the PWB Source Browser.
  308.  
  309.    ■   Create OS/2 applications with increased support for dynamic-link
  310.        libraries (DLLs), multiple threads, and improved debugging options.
  311.  
  312.    ■   Edit source code with PWB's mouse- and window-oriented editor.
  313.  
  314.  
  315.  For a detailed list of new language features, see Appendix A, "Differences
  316.  between MASM 6.0 and 5.1," in the Programmer's Guide.
  317.  
  318.  
  319.  Microsoft Programmer's WorkBench
  320.  
  321.  The Programmer's WorkBench can cut development time and increase your
  322.  productivity. Its integration allows you to edit, build, run, and debug a
  323.  program without ever leaving PWB. Its multiwindow display lets you edit
  324.  several files at once or access online help while still viewing your code.
  325.  Drop-down menus and mouse support let you perform most functions by clicking
  326.  the mouse on menu names or by pressing a few keys.
  327.  
  328.  The PWB editor is easy to configure and completely extensible. It combines
  329.  powerful features such as macros and regular-expression search capabilities
  330.  with the simplicity of a window-based application (see Figure 1.1).
  331.  
  332.  The Microsoft Advisor online reference system provides quick access to
  333.  information about MASM, PWB, CodeView, the assembler, linker, utilities, and
  334.  even the reference system itself. Figure 1.2 shows online information about
  335.  MASM's INC instruction.
  336.  
  337.  (This figure may be found in the printed book.)
  338.  
  339.  (This figure may be found in the printed book.)
  340.  
  341.  When you're ready to assemble the program, you don't need to remember the
  342.  full range of command-line assembler options. All options are conveniently
  343.  located in a PWB dialog box where they can be clicked on or off (see Figure
  344.  1.3). Setting options is simply a matter of using the mouse or keyboard to
  345.  set case, warning level, debug, or release options.
  346.  
  347.  (This figure may be found in the printed book.)
  348.  
  349.  PWB uses the powerful NMAKE tool to speed up development. NMAKE examines
  350.  each module of a program to determine whether changes have been made that
  351.  require the module to be reassembled. NMAKE then automatically assembles the
  352.  modules as necessary and links them. When you're ready to build your
  353.  program, you just select a single menu command to start the process. PWB
  354.  invokes NMAKE and builds an application, using the options you set.
  355.  
  356.  If warnings or errors occur during assembly or linking, PWB opens a window
  357.  with a full list of assembly or link errors (see Figure 1.4). You can then
  358.  consult the online reference system for comprehensive information about each
  359.  error.
  360.  
  361.  (This figure may be found in the printed book.)
  362.  
  363.  Once a program has been successfully built, you can run it from within PWB
  364.  to test it. If you need to make modifications, you can return directly to
  365.  PWB to make the changes.
  366.  
  367.  Another useful PWB feature is the Source Browser. With the Browser you can
  368.  examine your code and display information about procedure and variable
  369.  relationships (see Figure 1.5). This option is helpful for tracking program
  370.  flow and isolating bugs.
  371.  
  372.  For bugs that are more difficult to locate and understand, use PWB's Debug
  373.  Build option, then invoke the CodeView debugger directly from PWB. You can
  374.  step and trace through your code at the source level while examining
  375.  variables, registers, and memory (see Figure 1.6).
  376.  
  377.  (This figure may be found in the printed book.)
  378.  
  379.  Once you locate the bug, you can exit CodeView and return directly to PWB,
  380.  where you can fix the error. When the code is completely debugged, you can
  381.  build a final release program using PWB's Release Build option.
  382.  
  383.  (This figure may be found in the printed book.)
  384.  
  385.  
  386.  Key to Document Conventions
  387.  
  388.  This book uses the following document conventions:
  389.  
  390. ╓┌─────────────────┌─────────────────────────────────────────────────────────╖
  391.  Example           Description
  392.  ────────────────────────────────────────────────────────────────────────────
  393.  COPY TEST.ASM C:  Uppercase letters represent DOS commands and filenames.
  394.  
  395.  INVOKE            Boldface letters indicate standard features of the MASM
  396.                    language: keywords, operators, and standard library
  397.                    functions.
  398.  
  399.  expression        Words in italics indicate placeholders for information
  400.                    you must supply, such as a filename. Italics are also
  401.  Example           Description
  402.  ────────────────────────────────────────────────────────────────────────────
  403.                   you must supply, such as a filename. Italics are also
  404.                    occasionally used for emphasis in the text.
  405.  
  406.  ML /Zi HELLO.ASM  This typeface is used for example programs, program
  407.                    fragments, and the names of user-defined functions and
  408.                    variables. It also indicates user input and screen
  409.                    output.
  410.  
  411.  SHIFT             Small capital letters denote names of keys on the
  412.                    keyboard. A plus sign ( + ) indicates a combination of
  413.                    keys. For example, SHIFT+F5 tells you to hold down the
  414.                    SHIFT key while pressing the F5 key.
  415.  
  416.  "bookmark"        The first time a new term is defined, it is enclosed in
  417.                    quotation marks. Since some knowledge of programming is
  418.                    assumed, common terms such as memory or branch are not
  419.                    defined.
  420.  
  421.  Programmer's      The first time an acronym appears, it is spelled out.
  422.  Example           Description
  423.  ────────────────────────────────────────────────────────────────────────────
  424. Programmer's      The first time an acronym appears, it is spelled out.
  425.  WorkBench (PWB)
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  Chapter 2  Installing the Microsoft Macro Assembler
  435.  ────────────────────────────────────────────────────────────────────────────
  436.  
  437.  This chapter explains how to install the Microsoft Macro Assembler (MASM),
  438.  configure extended memory for use with the CodeView debugger, and customize
  439.  components of the Programmer's WorkBench.
  440.  
  441.  You must run the installation program (SETUP.EXE) to install MASM. The files
  442.  on the distribution disks are compressed; SETUP both uncompresses the files
  443.  and copies them to your hard disk. SETUP runs under both DOS and OS/2.
  444.  
  445.  Before running SETUP, back up the distribution disks and make sure you have
  446.  enough disk space (at least 4 megabytes, depending on the options you
  447.  choose) to install the Professional Development System.
  448.  
  449.  
  450.  Running SETUP
  451.  
  452.  Insert the disk with SETUP in the appropriate disk drive. Make that drive
  453.  the current drive. Type  SETUP  and press ENTER to begin installation.
  454.  
  455.  If you aren't sure how you want to set up MASM 6.0, the default responses to
  456.  SETUP's questions are usually a good starting point. (You can run SETUP
  457.  again at any time to install a different configuration.) Press ENTER to
  458.  proceed.
  459.  
  460.  From the Main Menu of SETUP (see Figure 2.1), you can
  461.  
  462.  
  463.    ■   Install the Microsoft Macro Assembler
  464.  
  465.    ■   Install the Macro Assembler using defaults
  466.  
  467.    ■   Run SETUP without installing any files
  468.  
  469.    ■   View important documentation notes (README.DOC)
  470.  
  471.    ■   View the packing list (PACKING.LST)
  472.  
  473.    ■   Copy a file from the distribution disks
  474.  
  475.    ■   Exit SETUP
  476.  
  477.        (This figure may be found in the printed book.)
  478.  "
  479.  
  480.  Install the Microsoft Macro Assembler" is highlighted as the default. If you
  481.  want a different function, use the UP and DOWN ARROW keys to highlight the
  482.  desired function; then press ENTER.
  483.  
  484.  The first time you run SETUP, press ENTER to begin installation. If you want
  485.  to become familiar with SETUP and its options, select the third menu item,
  486.  "Run SETUP without installing any files."
  487.  
  488.  The fifth menu item, "Copy a file from the distribution disks," allows you
  489.  to transfer specific files without having to go through the full
  490.  installation.
  491.  
  492.  To exit SETUP at any time, press CTRL+C. SETUP never erases files from the
  493.  distribution disks, so you can quit and start over as often as you need to.
  494.  
  495.  
  496.  
  497.  Supplying SETUP Information
  498.  
  499.  The SETUP screens following the Main Menu request information about your
  500.  operating system, hardware configuration, and directory paths. After you
  501.  have answered all the questions, SETUP begins transferring files to your
  502.  hard disk.
  503.  
  504.  Most questions (such as which operating system you're working under or
  505.  whether you use a mouse) have a limited number of specific responses. These
  506.  are listed in a box, with the default response highlighted. The following
  507.  sections provide information about individual SETUP questions.
  508.  
  509.  If you want to accept the default response, press ENTER. If not, use the UP
  510.  and DOWN ARROW keys to select a different response; then press ENTER. In
  511.  either case, pressing ENTER advances you to the next screen.
  512.  
  513.  The remaining questions prompt you for the directories in which the
  514.  assembler, linker, debugger, include files, and other files are to be
  515.  placed. SETUP suggests a default path, which you can accept by pressing
  516.  ENTER.
  517.  
  518.  If you don't want to use the default directory, use the BACKSPACE key to
  519.  erase it; then type in the directory you want. (You can also change the
  520.  hard-disk specification if you want to install MASM 6.0's components on
  521.  different drives.) Press ENTER to accept the directory and advance to the
  522.  next screen.
  523.  
  524.  If you specify a directory that does not exist, SETUP automatically creates
  525.  it for you. Therefore, be careful to enter the correct directory name.
  526.  
  527.  
  528.  Changing Your Response
  529.  
  530.  You can change responses as often as you like before pressing ENTER and
  531.  moving to the next screen. Don't worry if you make a mistake or change your
  532.  mind. The last screen of SETUP displays all the options you have selected;
  533.  you can change any of them before the installation actually begins.
  534.  
  535.  
  536.  Responding to the Prompts
  537.  
  538.  The SETUP questions are largely self-explanatory. The following sections
  539.  supply additional information that might be useful to you.
  540.  
  541.  
  542.  Choosing the Host Operating System
  543.  
  544.  There are two versions of MASM; one runs under DOS and the other under OS/2.
  545.  Select the versions for the operating systems you use. If you want to run
  546.  MASM under both DOS and OS/2, you can install both.
  547.  
  548.  MASM can create executable files for OS/2 or DOS, regardless of which
  549.  operating system the assembler runs under. Programs must be debugged and run
  550.  under the operating system they were written for.
  551.  
  552.  
  553.  Installing the Programmer's WorkBench (PWB)
  554.  
  555.  PWB integrates editing, assembling, linking, and debugging to speed program
  556.  development. You can customize the PWB editor to accommodate your own
  557.  working style and needs.
  558.  
  559.  Installing the Programmer's WorkBench is optional. You can call the
  560.  assembler and linker from the command line, and run CodeView and the other
  561.  tools separately.
  562.  
  563.  
  564.  Emulating BRIEF
  565.  
  566.  If you install PWB, you can choose to configure the PWB editor so that most
  567.  of its editing functions are assigned to the same keystrokes that the BRIEF
  568.  editor uses. If you decide not to configure PWB this way during
  569.  installation, you can add these (or other) customizations later.
  570.  
  571.  
  572.  Installing the New MASM.EXE Utility
  573.  
  574.  MASM version 6.0 now includes ML.EXE, which replaces MASM.EXE. The ML.EXE
  575.  utility both assembles and links, making the assembler's behavior identical
  576.  to that of Microsoft compilers (such as CL.EXE for C and FL.EXE for
  577.  FORTRAN). You can still assemble without linking by adding the /c option to
  578.  the ML.EXE command line.
  579.  
  580.  To simplify the transition from previous versions of MASM to MASM version
  581.  6.0, Microsoft has provided a special MASM.EXE utility. The new MASM.EXE is
  582.  not an assembler. It simply translates the old-style command line into the
  583.  new format and passes the command to ML.EXE.
  584.  
  585.  Since MASM.EXE also sets certain options, you may want to look at Appendix A
  586.  in the Programmer's Guide, "Differences between MASM 6.0 and 5.1," before
  587.  using MASM.EXE. This appendix lists all the new and changed features in MASM
  588.  6.0 and gives recommendations for updating existing code.
  589.  
  590.  
  591.  Copying Documentation Files and Sample Programs
  592.  
  593.  Having SETUP copy documentation files and sample programs to your hard disk
  594.  makes them available at any time. You can load them into PWB or a text
  595.  editor, or print them for convenient reading. You can also read the
  596.  documentation files from within SETUP by selecting the "View important
  597.  documentation notes" option from the function screen.
  598.  
  599.  Only the README.DOC and the PACKING.LST files can be copied directly from
  600.  the distribution disks without SETUP. From the Main Menu in SETUP, you can
  601.  also select the "Copy a file from the distribution disks" option. This
  602.  decompresses and copies files to the current directory.
  603.  
  604.  
  605.  Copying the Microsoft Mouse Driver, MOUSE.COM
  606.  
  607.  If you choose DOS as the host mode, you are asked if you want to copy the
  608.  most recent version of the Microsoft mouse driver, MOUSE.COM. (The mouse
  609.  interface is built into the OS/2 environment.) This driver is written for
  610.  the Microsoft Mouse, but it will work with any 100%-compatible mouse or
  611.  pointing device.
  612.  
  613.  If you currently use a Microsoft Mouse, you already have a mouse driver on
  614.  your hard disk. SETUP places the mouse driver in the directory for real-mode
  615.  files that you specify later. This directory is probably not the location of
  616.  your current mouse driver. If you want to use the new driver, be sure to
  617.  copy it to the appropriate directory after you leave SETUP.
  618.  
  619.  
  620.  Choosing the Target Hard Disk
  621.  
  622.  Specify the hard disk on which you want to install the Professional
  623.  Development System. It becomes the default drive for the directories SETUP
  624.  will suggest later on. However, if you want to install the Development
  625.  System components on more than one drive or partition, you can change the
  626.  drive designation in the suggested directories.
  627.  
  628.  
  629.  Choosing Bound, Real-Mode, and Protected-Mode Directories
  630.  
  631.  Some of the software supplied with the Professional Development System is
  632.  "bound," which means it runs under DOS or OS/2. However, five system
  633.  components come in two versions: one for DOS (or OS/2 real mode), the other
  634.  for protected mode for OS/2. These components are ML, PWB, NMAKE, QH, and
  635.  CodeView.
  636.  
  637.  If you set up for only one mode, it doesn't matter where you place these
  638.  components. However, ML, PWB, QH, and NMAKE use the same name for their
  639.  real- and protected-mode versions. If you set up for both real and protected
  640.  mode, you cannot place these components in the same directory, because you
  641.  cannot have two identically named files in the same directory.
  642.  
  643.  Therefore, SETUP requires that you select different directories for the
  644.  bound, real-mode, and protected-mode components. If you change SETUP default
  645.  directories, be sure you don't choose the same directory for both the real-
  646.  and protected-mode components.
  647.  
  648.  Note that if you have chosen to install only for DOS or OS/2 real mode, you
  649.  are not prompted for a protected-mode directory. Likewise, if you have
  650.  chosen to install only for OS/2 protected mode, you are not prompted for a
  651.  real-mode directory.
  652.  
  653.  
  654.  Selecting File Directories
  655.  
  656.  SETUP wants to know where to place help, include, initialization, and
  657.  library files (in OS/2). The corresponding environment variables in your
  658.  AUTOEXEC.BAT or STARTUP.CMD file should point to the correct directories.
  659.  This is explained in the section called "Configuring Your System," later in
  660.  this chapter.
  661.  
  662.  
  663.  Reviewing and Changing Responses
  664.  
  665.  The Status and Change screen is the last screen before SETUP actually begins
  666.  installation. This screen displays all your responses. If you are satisfied,
  667.  press ENTER to select the "No Changes" default, and installation will begin.
  668.  
  669.  
  670.  If you want to change a response, press the DOWN ARROW key to move the
  671.  highlight to the appropriate line; then press ENTER to display the screen
  672.  that controls this response. Change your response; then press ENTER again to
  673.  return to the status and change screen. Your new response for that option is
  674.  now displayed.
  675.  
  676.  You can repeat this process as often as you want. When all options are the
  677.  way you want them, select "No Changes" and press ENTER to begin
  678.  installation.
  679.  
  680.  
  681.  Installing
  682.  
  683.  SETUP checks to see if your system has adequate space available and then
  684.  prompts you for each distribution disk it requires. The only likely error is
  685.  inserting the wrong disk. If this occurs, SETUP prompts you for the correct
  686.  disk.
  687.  
  688.  
  689.  Configuring Your System
  690.  
  691.  At the end of installation, SETUP creates system-configuration files. These
  692.  are listed in Table 2.1, along with SETUP's default directories:
  693.  
  694.  Table 2.1  SETUP Configuration Files
  695.  
  696.  Operating System        Configuration Files  Default Directory
  697.  ────────────────────────────────────────────────────────────────────────────
  698.  DOS or OS/2 real mode   NEW-VARS.BAT,        C: \ MASM \ BIN
  699.                          NEW-CONF.SYS
  700.  
  701.                          TOOLS.PRE            C: \ MASM \ INIT
  702.  
  703.  OS/2 protected mode     NEW-VARS.CMD         C: \ MASM \ BINP
  704.  
  705.                          TOOLS.PRE            C: \ MASM \ INIT
  706.  
  707.  ────────────────────────────────────────────────────────────────────────────
  708.  
  709.  
  710.  If you add the contents of these files to your AUTOEXEC.BAT (or
  711.  STARTUP.CMD), CONFIG.SYS, and TOOLS.INI files, your system will be correctly
  712.  configured for MASM each time you start your computer. You can also run
  713.  NEW-VARS.BAT or NEW-VARS.CMD to set environment variables before you run
  714.  MASM.
  715.  
  716.  
  717.  Modifying AUTOEXEC.BAT or STARTUP.CMD
  718.  
  719.  The NEW-VARS.BAT and NEW-VARS.CMD files contain commands that set
  720.  environment variables. Insert these commands in the AUTOEXEC.BAT or
  721.  STARTUP.CMD file. All changes to environment variables are prefixed to the
  722.  current settings. Table 2.2 explains these variables.
  723.  
  724.  
  725.  Table 2.2  Environment Variables
  726.  
  727. ╓┌────────────────┌──────────────────────────────────────────────────────────╖
  728.  Variable         Description
  729.  ────────────────────────────────────────────────────────────────────────────
  730.  ASMEX            Location of assembly-language example files
  731.  HELPFILES        Location of help (.HLP) files
  732.  INCLUDE          Location of include (.INC) files
  733.  INIT             Location of initialization (.INI) files
  734.  MASM, ML         List of command-line options requested
  735.  PATH             Path to search for executable files
  736.  QH               Location of QuickHelp help (.HLP) files
  737.  Variable         Description
  738.  ────────────────────────────────────────────────────────────────────────────
  739. QH               Location of QuickHelp help (.HLP) files
  740.  TMP              Location of PWB/LINK temporary files
  741.  ────────────────────────────────────────────────────────────────────────────
  742.  
  743.  
  744.  The online reference system searches for help files in a specific sequence.
  745.  Therefore, do not modify the HELPFILES variable unless you are familiar with
  746.  the search sequence. Changing this path might make the online reference
  747.  system inaccessible.
  748.  
  749.  
  750.  Modifying CONFIG.SYS
  751.  
  752.  If the host operating mode is OS/2 real mode or DOS, check the values of
  753.  files  and  buffers  in CONFIG.SYS. The values in NEW-CONF.SYS are minimums;
  754.  the CONFIG.SYS values should be at least as large.
  755.  
  756.  Under OS/2, be sure the  LIBPATH  variable includes the directory of the
  757.  help system's dynamic-link library MSHELP.DLL. OS/2 users who want to use
  758.  CodeView must also include the statement  IOPL=YES.
  759.  
  760.  To use the extended memory features of CodeView under DOS, you must use the
  761.  HIMEM.SYS driver supplied with this product. Add  DEVICE=HIMEM.SYS  to
  762.  CONFIG.SYS. Be sure to specify HIMEM's full path. See the section later in
  763.  this chapter called "Configuring Extended Memory for CodeView" for
  764.  additional information.
  765.  
  766.  
  767.  Modifying TOOLS.INI
  768.  
  769.  The TOOLS.PRE file contains additional PWB configuration settings. Add the
  770.  contents of TOOLS.PRE to your existing TOOLS.INI file. If you don't already
  771.  have a TOOLS.INI file, rename TOOLS.PRE to TOOLS.INI.
  772.  
  773.  PWB looks for TOOLS.INI in the directory containing PWB. If you move
  774.  TOOLS.INI to another directory, specify its path in the  INIT  environment
  775.  variable in your AUTOEXEC.BAT or STARTUP.CMD file.
  776.  
  777.  The TOOLS.INI file controls many configuration options for MASM 6.0
  778.  utilities. These options let you customize the following:
  779.  
  780.  
  781.    ■   PWB
  782.  
  783.    ■   CodeView debugger
  784.  
  785.    ■   Microsoft Advisor online reference system
  786.  
  787.    ■   NMAKE utility
  788.  
  789.  
  790.  You can modify the TOOLS.INI settings with the PWB editor or any word
  791.  processor. These are some of the options you can change:
  792.  
  793.  
  794.    ■   Screen colors and the number of lines displayed by PWB
  795.  
  796.    ■   Macros for PWB
  797.  
  798.    ■   Key assignments for PWB
  799.  
  800.    ■   Default key settings for PWB
  801.  
  802.    ■   Location of help files used by the online reference system
  803.  
  804.    ■   Options for NMAKE
  805.  
  806.  
  807.  TOOLS.INI is described in the online reference system. See Chapter 14 of the
  808.  Programmer's Guide for more information about customizing PWB.
  809.  
  810.  
  811.  Customizing the Programmer's WorkBench
  812.  
  813.  There are other ways to customize PWB besides editing the TOOLS.INI file.
  814.  For example, you can control a variety of editor functions and options from
  815.  within PWB with the Editor Settings command from the Options menu.
  816.  
  817.  For more information about customizing the Programmer's WorkBench, see
  818.  Chapter 3 in this manual, and Chapter 14 of the Programmer's Guide,
  819.  "Custom-izing the Microsoft Programmer's WorkBench." For more information
  820.  about customizing NMAKE and other utilities, see the online reference system
  821.  or the Programmer's Guide.
  822.  
  823.  
  824.  Configuring Extended Memory for the CodeView Debugger
  825.  
  826.  Extended memory is the memory above the first megabyte that an 80286, 80386,
  827.  or 80486 can access in protected mode. (Extended memory is not the same as
  828.  expanded memory. Expanded memory is bank-switched memory that overcomes the
  829.  640K RAM limit of machines with 8086/8088 processors.)
  830.  
  831.  To use the extended memory features of the CodeView debugger under DOS, you
  832.  must first add  DEVICE=HIMEM.SYS  (with HIMEM's full pathname) to the
  833.  CONFIG.SYS file, then reboot. The NEW-CONF.SYS file created by SETUP
  834.  contains a sample HIMEM entry.
  835.  
  836.  ────────────────────────────────────────────────────────────────────────────
  837.  NOTE
  838.  HIMEM.SYS implements the XMS 2.x standard. The complete XMS source and
  839.  specification are available from the Microsoft Information Center.
  840.  ────────────────────────────────────────────────────────────────────────────
  841.  
  842.  There are several additional factors to consider when using extended memory
  843.  with CodeView under DOS or Windows:
  844.  
  845.  
  846.    ■   CodeView needs at least 384K of extended memory. If you add memory to
  847.        your computer, be sure to configure at least 384K of it as extended
  848.        memory.
  849.  
  850.    ■   Older versions of HIMEM.SYS may not work properly with this product.
  851.        Use the version of HIMEM.SYS on the MASM 6.0 distribution disks.
  852.  
  853.    ■   Other memory managers such as 386-Max or QEMM may conflict with
  854.        HIMEM.SYS. Don't install more than one memory manager.
  855.  
  856.    ■   Don't use HIMEM.SYS (or any other memory manager) with Windows/386.
  857.        Windows/386 allocates extended and expanded memory automatically.
  858.  
  859.    ■   If you run Windows 3.0 in 286-Protected mode, create a PIF for
  860.        CodeView and specify at least 384K of XMS (extended) memory.
  861.  
  862.    ■   Many RAM-disk and disk-cache programs are incompatible with HIMEM.SYS.
  863.        The RAMDRIVE and SMARTDRV programs supplied on the distribution disks
  864.        are HIMEM.SYS-compatible.
  865.  
  866.    ■   If you run TSRs, check their documentation to see if they are
  867.        compatible with HIMEM/XMS 2.x. If there is any question about
  868.        compatibility, manually install one TSR at a time.
  869.  
  870.  
  871.  SETUP places the HIMEM, RAMDRIVE, and SMARTDRV drivers in the C: \ MASM \
  872.  BIN directory or in the directory you have specified for real-mode
  873.  executable files.
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  Chapter 3  Using the Programmer's WorkBench
  881.  ────────────────────────────────────────────────────────────────────────────
  882.  
  883.  The Programmer's WorkBench (PWB) is a window-oriented programming
  884.  environment that incorporates a text editor, an assembler, a linker, a
  885.  debugger, a make utility, a source-code browser, and an online reference
  886.  system. It is an alternative to switching between command-line-based
  887.  programs: you can edit, assemble, link, and debug without leaving this
  888.  integrated environment. To demonstrate PWB's features, this chapter includes
  889.  a sample program that you can assemble, link, and debug.
  890.  
  891.  This chapter explains how to start PWB and then introduces the following PWB
  892.  elements:
  893.  
  894.  
  895.    ■   Windows and menus. You can quickly find the command you need using the
  896.        menus. The section "Using Windows and Menus" explains how to open and
  897.        close windows and how to navigate through the menus.
  898.  
  899.    ■   Programmer's editor. Features such as "bookmarks," macros, customized
  900.        key commands, and enhanced search capabilities decrease the amount of
  901.        time you spend writing code.
  902.  
  903.    ■   Integrated assembler and linker. You can assemble, link, and run a
  904.        program without leaving the editor. PWB's integrated environment and
  905.        projectmanagement facilities save you hours of development time.
  906.  
  907.    ■   Integrated browser and debugger. Using the Source Browser, you can
  908.        quickly find a data declaration or procedure definition in your source
  909.        code, as well as references to all procedures and variables in the
  910.        program. With the CodeView debugger, you can set breakpoints, examine
  911.        variables and machine registers, and step through execution of your
  912.        program one line at a time.
  913.  
  914.  
  915.  
  916.  Starting PWB
  917.  
  918.  To run PWB, type
  919.  
  920.    PWB
  921.  
  922.  at the command line. You can immediately begin entering source code in the
  923.  untitled window that appears. PWB maintains a history of the files you have
  924.  opened. The next time you run PWB, it opens the last file you worked on.
  925.  
  926.  
  927.  Specifying a Source File
  928.  
  929.  You can open an existing source file by specifying its name or pathname
  930.  after the PWB command. If PWB can't find the specified file, it asks if you
  931.  want to create a new file with that name. You can also open an existing
  932.  source file with the Open command from the File menu.
  933.  
  934.  
  935.  Command-Line Options
  936.  
  937.  PWB offers a number of command-line options that can configure PWB, position
  938.  the file at a bookmark, or perform user-selected functions automatically.
  939.  These are documented in the Reference and in the "Starting PWB" topic in
  940.  online help.
  941.  
  942.  
  943.  Elements of the PWB Environment
  944.  
  945.  This section introduces the PWB environment and describes how to control
  946.  windows and choose commands from the menus. It also describes elements
  947.  within the PWB environment.
  948.  
  949.  You can enter PWB commands from the keyboard or with a Microsoft (or fully
  950.  compatible) Mouse. Unless the right mouse button is specifically mentioned,
  951.  "clicking" means to press and release the left mouse button once.
  952.  
  953.  
  954.  Windows and Other Screen Elements
  955.  
  956.  Figure 3.1 shows the components of a typical PWB screen. Some elements
  957.  provide information only. For example, if CAPS LOCK is on, the letter  C
  958.  appears in the lower-right corner of the screen. Other elements perform
  959.  actions triggered by a specific keystroke or mouse action. For example, if
  960.  you click the button in the upper-left corner of a window with the mouse,
  961.  the window closes.
  962.  
  963.  (This figure may be found in the printed book.)
  964.  
  965.  The parts of a PWB screen and their uses are listed in Table 3.1.
  966.  
  967.  Table 3.1  Parts of a PWB Screen
  968.  
  969. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  970.  Name                              Use
  971.  ────────────────────────────────────────────────────────────────────────────
  972.  Menu bar                          Lists names of available menus.
  973.  
  974.  Close button                      Closes window (appears only if more than
  975.                                    one window is
  976.                                    displayed).
  977.  
  978.  Title bar                         Shows name of file currently being
  979.                                    edited.
  980.  
  981.  Windows                           Contain source code or display
  982.                                    information associated with online help.
  983.  
  984.  Maximize button                   Enlarges or restores window to its
  985.                                    original size.
  986.  
  987.  Scroll bars                       Indicate cursor position in the current
  988.                                    file and allow cursor
  989.  Name                              Use
  990.  ────────────────────────────────────────────────────────────────────────────
  991.                                   file and allow cursor
  992.                                    movement.
  993.  
  994.  Reference bar                     Lists shortcut keystrokes (keyboard
  995.                                    users) and direct PWB commands (mouse
  996.                                    users); summarizes menu contents and
  997.                                    displays other information.
  998.  
  999.  File-type indicator               Tells type of file. ASM: MASM source
  1000.                                    code;  text:  any other user-created
  1001.                                    file;  pseudo:  file-like means of
  1002.                                    displaying data.
  1003.  
  1004.  Line and column indicators        Show current line and column of text
  1005.                                    cursor.
  1006.  
  1007.  Status indicators                 A : Meta prefix is set.
  1008.                                    B : Background assembly in OS/2.
  1009.                                    C : CAPS LOCK is on.
  1010.  Name                              Use
  1011.  ────────────────────────────────────────────────────────────────────────────
  1012.                                   C : CAPS LOCK is on.
  1013.                                    L : Carriage return isn't used to
  1014.                                    terminate a line.
  1015.                                    M : File has been modified.
  1016.                                    N : NUM LOCK is on.
  1017.                                    O : Overtype is on.
  1018.                                    R : File is set to Read Only status.
  1019.                                    T : File is temporary.
  1020.                                    X : A macro is being recorded.
  1021.  
  1022.  ────────────────────────────────────────────────────────────────────────────
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  Menus
  1028.  
  1029.  PWB commands are organized into menus whose names appear in the menu bar. A
  1030.  brief description of the selected menu appears in the reference bar. To get
  1031.  more information about a menu, select the menu and press F1, or point the
  1032.  mouse cursor at the menu name and click the right mouse button.
  1033.  
  1034.  PWB has the following menus:
  1035.  
  1036.  
  1037.  File Menu
  1038.  
  1039. ╓┌───────────────────────────────┌──────────┌────────────────────────────────╖
  1040.  ────────────────────────────────────────────────────────────────────────────
  1041.  (Please refer to the printed    New        Clears the Source window to
  1042.  book.)                                     start a new file
  1043.  
  1044.                                  Open       Loads an existing source file
  1045.  
  1046.                                  Merge      Merges one or more files with
  1047.                                             the current file
  1048.  
  1049.                                  Next       Displays the next file in the
  1050.                                             file list specified at start-up
  1051.  
  1052.  ────────────────────────────────────────────────────────────────────────────
  1053. 
  1054.                                  Save       Saves the current file
  1055.  
  1056.                                  Save As    Saves the current file under a
  1057.                                             different name
  1058.  
  1059.                                  Save All   Saves all modified files
  1060.  
  1061.                                  Close      Closes the current file
  1062.  
  1063.                                  Print      Prints a selection or the
  1064.                                             current file
  1065.  
  1066.                                  DOS Shell  Temporarily exits to DOS or
  1067.                                             OS/2
  1068.  
  1069.                                  Exit       Leaves PWB
  1070.  
  1071.  
  1072.  
  1073.  At the bottom of the File menu, PWB displays a list of recently opened
  1074.  files. This helps you access the files you've been working with.
  1075.  
  1076.  
  1077.  Edit Menu
  1078.  
  1079. ╓┌────────────────────────────┌─────────────────┌────────────────────────────╖
  1080.  ────────────────────────────────────────────────────────────────────────────
  1081.  (Please refer to the         Undo              Reverses the effect of your
  1082.  printed book.)                                 recent edits
  1083.  
  1084.                               Redo              Reverses the effect of the
  1085.                                                 last Undo command
  1086.  
  1087.                               Repeat            Repeats your last edit
  1088.  
  1089.                               Cut               Deletes a selected block of
  1090.                                                 text from the active window
  1091.                                                 and copies it to the
  1092.                                                 clipboard
  1093.  
  1094.  ────────────────────────────────────────────────────────────────────────────
  1095. 
  1096.                               Paste             Inserts a selected block of
  1097.                                                 text from the clipboard
  1098.                                                 into the active window
  1099.  
  1100.                               Clear             Deletes selected text
  1101.                                                 without copying it to the
  1102.                                                 clipboard
  1103.  
  1104.                               Set Anchor        Saves the current cursor
  1105.                                                 position as a reference
  1106.                                                 point for text selection
  1107.  
  1108.                               Select to Anchor  Highlights text from the
  1109.                                                 previously set anchor to
  1110.                                                 the current cursor position
  1111.  
  1112.                               Box Mode          Toggles text selection mode
  1113.                                                 between box, line, and
  1114.                                                 stream modes
  1115.  ────────────────────────────────────────────────────────────────────────────
  1116.                                                stream modes
  1117.  
  1118.                               Read Only         Makes all files read-only
  1119.                                                 (to protect from accidental
  1120.                                                 modification)
  1121.  
  1122.                               Set Record        Defines a macro name and
  1123.                                                 its shortcut key
  1124.  
  1125.                               Record On         Records keystrokes for a
  1126.                                                 macro
  1127.  
  1128.                               Edit Macro        Edits a recorded macro
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  View Menu
  1134.  
  1135. ╓┌────────────────────────┌─────────────────┌────────────────────────────────╖
  1136.  ────────────────────────────────────────────────────────────────────────────
  1137.  (Please refer to the     Split Horizontal  Divides the active window
  1138.  printed book.)                             horizontally.
  1139.  
  1140.                           Split Vertical    Divides the active window
  1141.                                             vertically.
  1142.  
  1143.                           Size Window       Enlarges or shrinks the active
  1144.                                             window.
  1145.  
  1146.                           Maximize          Toggles between Maximize Window
  1147.                           Window            and Restore Window. (Maximize
  1148.                                             Window enlarges the active
  1149.                                             window, while Restore Window
  1150.                                             restores it to its original
  1151.                                             size.)
  1152.  
  1153.                           Close Window      Closes the active window.
  1154.  
  1155.                           Compile Results   Shows the result of the last
  1156.                                             compilation.
  1157.  ────────────────────────────────────────────────────────────────────────────
  1158.                                            compilation.
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  Search Menu
  1164.  
  1165. ╓┌────────────────────────────┌─────────────────┌────────────────────────────╖
  1166.  ────────────────────────────────────────────────────────────────────────────
  1167.  (Please refer to the         Find              Searches for the next
  1168.  printed book.)                                 occurrence of a text string
  1169.                                                 in the active window
  1170.  
  1171.                               Selected Text     Searches for the next
  1172.                                                 occurrence of the current
  1173.                                                 selection
  1174.  
  1175.                               Repeat Last Find  Repeats the search without
  1176.                                                 retyping the text string
  1177.  
  1178.  ────────────────────────────────────────────────────────────────────────────
  1179. 
  1180.                               Change            Searches for one text
  1181.                                                 string and replaces it with
  1182.                                                 another
  1183.  
  1184.                               For File          Searches for a file on disk
  1185.  
  1186.                               Next Error        Moves to the next build
  1187.                                                 error in source code
  1188.  
  1189.                               Previous Error    Moves to the previous build
  1190.                                                 error in source code
  1191.  
  1192.                               Set Error         Selects the error at the
  1193.                                                 cursor as the current error
  1194.                                                 (i.e., synchronizes active
  1195.                                                 window and error window)
  1196.  
  1197.                               Go to Mark        Moves the cursor to a
  1198.                                                 "bookmark" (a previously
  1199.  ────────────────────────────────────────────────────────────────────────────
  1200.                                                "bookmark" (a previously
  1201.                                                 specified position in a
  1202.                                                 file)
  1203.  
  1204.                               Define Mark       Creates a bookmark by
  1205.                                                 associating a name with a
  1206.                                                 position in a file
  1207.  
  1208.                               Set Mark File     Creates a file in which you
  1209.                                                 can save bookmarks or open
  1210.                                                 an existing bookmark file
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  Make Menu
  1216.  
  1217. ╓┌───────────────────────────┌───────────────────┌───────────────────────────╖
  1218.  ────────────────────────────────────────────────────────────────────────────
  1219.  (Please refer to the        Compile File        Compiles the current
  1220.  ────────────────────────────────────────────────────────────────────────────
  1221.  (Please refer to the        Compile File        Compiles the current
  1222.  printed book.)                                  source file
  1223.  
  1224.                              Build               Compiles and links all
  1225.                                                  modified files in a
  1226.                                                  multimodule program
  1227.  
  1228.                              Rebuild All         Compiles and links all
  1229.                                                  files (even those that
  1230.                                                  have not been modified)
  1231.  
  1232.                              Build Target        Builds a single target
  1233.                                                  from the program list or
  1234.                                                  non-PWB makefile
  1235.  
  1236.                              Set Program List    Creates or opens a program
  1237.                                                  list file, which defines
  1238.                                                  the components of a
  1239.                                                  multimodule program
  1240.  
  1241.  ────────────────────────────────────────────────────────────────────────────
  1242. 
  1243.                              Edit Program List   Changes the contents of a
  1244.                                                  program list
  1245.  
  1246.                              Clear Program List  Removes the current
  1247.                                                  program list from memory,
  1248.                                                  but does not change its
  1249.                                                  contents
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  Run Menu
  1255.  
  1256.  ────────────────────────────────────────────────────────────────────────────
  1257.  (Please refer to the     Execute         Runs the current program
  1258.  printed book.)
  1259.  
  1260.                           Command Line    Specifies commands that will be
  1261.                                           supplied to your program when you
  1262.                                           choose Execute or Debug from the
  1263.                                           Run menu
  1264.  
  1265.                           Debug           Invokes the Microsoft CodeView
  1266.                                           debugger
  1267.  
  1268.                           Run DOS         Performs any single DOS or OS/2
  1269.                           Command         task without exiting the
  1270.                                           environment
  1271.  
  1272.                           Customize Menu  Adds commands to the Run menu
  1273.  
  1274.  
  1275.  
  1276.  Options Menu
  1277.  
  1278. ╓┌────────────────────────────┌─────────────────┌────────────────────────────╖
  1279.  ────────────────────────────────────────────────────────────────────────────
  1280.  (Please refer to the         Environment       Specifies the paths to
  1281.  printed book.)                                 search for include files,
  1282.                                                 libraries, and online help
  1283.  ────────────────────────────────────────────────────────────────────────────
  1284.                                                libraries, and online help
  1285.  
  1286.                               Key Assignments   Assigns keystrokes that
  1287.                                                 invoke commands, macros,
  1288.                                                 and extension functions
  1289.  
  1290.                               Editor Settings   Changes the setting of any
  1291.                                                 editor switch
  1292.  
  1293.                               Build Options     Sets the main language,
  1294.                                                 determines what type of
  1295.                                                 program is built, specifies
  1296.                                                 whether the program is
  1297.                                                 built as a debug or release
  1298.                                                 version, and saves current
  1299.                                                 build options
  1300.  
  1301.                               Browse Options    Defines the way the PWB
  1302.                                                 Source Browser database is
  1303.                                                 built
  1304.  ────────────────────────────────────────────────────────────────────────────
  1305.                                                built
  1306.  
  1307.                               MASM Options      Sets compiler options for
  1308.                                                 your project
  1309.  
  1310.                               LINK Options      Sets linker options for
  1311.                                                 your project
  1312.  
  1313.                               NMAKE Options     Sets the command line for
  1314.                                                 NMAKE
  1315.  
  1316.                               CodeView Options  Controls how CodeView uses
  1317.                                                 memory, displays
  1318.                                                 information, and handles
  1319.                                                 display of output
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  Browse Menu
  1325.  
  1326. ╓┌───────────────────────────┌──────────────────┌────────────────────────────╖
  1327.  ────────────────────────────────────────────────────────────────────────────
  1328.  (Please refer to the        Goto Definition    Locates the definition of
  1329.  printed book.)                                 any program symbol in your
  1330.                                                 source code
  1331.  
  1332.                              Goto Reference     Locates the references to
  1333.                                                 any name in the source
  1334.                                                 database
  1335.  
  1336.                              View Relationship  Queries the PWB Source
  1337.                                                 Browser database
  1338.  
  1339.                              List References    Displays a list of
  1340.                                                 functions that call each
  1341.                                                 function and use each
  1342.                                                 variable, type, and macro
  1343.  
  1344.                              Call Tree          Views which functions call
  1345.                                                 other functions
  1346.  ────────────────────────────────────────────────────────────────────────────
  1347.                                                other functions
  1348.  
  1349.                              Outline            Displays a program outline
  1350.  
  1351.                              Next               Finds the next definition
  1352.                                                 or next reference
  1353.  
  1354.                              Previous           Finds the previous
  1355.                                                 definition or reference
  1356.  
  1357.                              Case Sensitive     Defines whether or not your
  1358.                                                 searches will be case
  1359.                                                 sensitive
  1360.  
  1361.                              Split Windows      Determines how the Browser
  1362.                                                 appears
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  Help Menu
  1368.  
  1369.  ────────────────────────────────────────────────────────────────────────────
  1370.  (Please refer to the printed   Index         Displays a list of indexes
  1371.  book.)                                       for the online
  1372.                                               reference
  1373.  
  1374.                                 Contents      Displays a table of contents
  1375.                                               for subjects covered by the
  1376.                                               online reference
  1377.  
  1378.                                 Topic         Displays information about
  1379.                                               the item or keyword on which
  1380.                                               the cursor is positioned
  1381.  
  1382.                                 Help on Help  Explains how to use the help
  1383.                                               system
  1384.  
  1385.                                 Next          Displays the next piece of
  1386.                                               information in the help
  1387.                                               system on the topic you
  1388.                                               looked at
  1389.  
  1390.  
  1391.  
  1392.  Choosing Menu Commands
  1393.  
  1394.  
  1395.  Keyboard
  1396.  
  1397.  
  1398.  To choose a command:
  1399.  
  1400.  
  1401.    1.  Press the ALT key to activate the menu bar.
  1402.  
  1403.    2.  Press the highlighted character in the menu name (such as F for File),
  1404.        or use the RIGHT and LEFT ARROW keys to select a menu. Press ENTER.
  1405.  
  1406.    3.  Press the highlighted character in the command name (such as S for
  1407.        Save in the File menu), or use the UP and DOWN ARROW keys to highlight
  1408.        the command and then press ENTER.
  1409.  
  1410.  
  1411.  
  1412.  Mouse
  1413.  
  1414.  
  1415.  To choose a command:
  1416.  
  1417.  
  1418.    1.  Open the menu by clicking the menu name.
  1419.  
  1420.    2.  Click the command.
  1421.  
  1422.  
  1423.  If you open a menu and then decide you don't want to issue a command, there
  1424.  are three ways to close the menu:
  1425.  
  1426.  
  1427.    ■   Press the ESC key.
  1428.  
  1429.    ■   Click the mouse outside the menu.
  1430.  
  1431.    ■   Press ALT twice.
  1432.  
  1433.  
  1434.  
  1435.  Using Shortcut Keys
  1436.  
  1437.  Some menu items are followed by the names of keys or key combinations. You
  1438.  can press these "shortcut keys" to execute these commands immediately,
  1439.  instead of selecting them from a menu.
  1440.  
  1441.  The reference bar at the bottom of the screen also displays commonly used
  1442.  shortcut keys. You can click any of these buttons to execute the indicated
  1443.  command. Many other shortcut keys have been assigned than are listed on
  1444.  menus. Assignments are also redefinable. See the Key Assignments option in
  1445.  the Options menu.
  1446.  
  1447.  
  1448.  Shaded Commands
  1449.  
  1450.  When a menu command is gray (rather than black), it is currently unavailable
  1451.  for use. For example, when PWB is first run and no programs have been
  1452.  assembled or linked, the Next Error and Previous Error commands in the
  1453.  Search menu are both disabled and are therefore shaded gray.
  1454.  
  1455.  
  1456.  Ellipses and Dialog Boxes
  1457.  
  1458.  A command followed by an ellipsis (...) needs more information before the
  1459.  command is executed. You enter this information in a dialog box that appears
  1460.  when you select the command. (A command not followed by an ellipsis executes
  1461.  immediately.) Figure 3.2 shows the dialog box opened by the Find command
  1462.  from the Search menu.
  1463.  
  1464.  (This figure may be found in the printed book.)
  1465.  
  1466.  Dialog boxes can contain any or all of the items in the following list.
  1467.  Press ALT and the item's highlighted letter, or the TAB or SHIFT+TAB keys to
  1468.  move among items in a dialog box. You can set dialog items from the keyboard
  1469.  or with the mouse.
  1470.  
  1471.  Item                   Description
  1472.  ────────────────────────────────────────────────────────────────────────────
  1473.  Option Buttons (∙)     Offer a list of choices; only one option can be
  1474.                         chosen. Use the ARROW keys to move between the
  1475.                         choices. In Figure 3.2, three option buttons set
  1476.                         the direction of the search (Forward, Backward,
  1477.                         Find All).
  1478.  
  1479.  Check Box [X]          A yes/no switch. If the box is empty, the option is
  1480.                         turned off. If it contains the letter X, the
  1481.                         feature is on. Press the SPACEBAR or use the UP and
  1482.                         DOWN ARROW keys to turn a check box on or off.
  1483.  
  1484.  Text Box [..........]  Accepts text that you type. In Figure 3.2, Find
  1485.                         Text requires you to type the text to search for.
  1486.  
  1487.  List Boxes             Certain dialog boxes display lists of information
  1488.                         (such as the contents of the current disk directory)
  1489.                         within a list box. If the number of items exceeds
  1490.                         the list box space, press the ARROW keys, PGUP/PGDN,
  1491.                         or click the scroll bar to move around the list.
  1492.  
  1493.  Command Buttons        Confirm the settings you have entered and which are
  1494.  < OK >                 now enclosed by angle brackets. The OK button uses
  1495.                         the current settings. The Cancel button exits the
  1496.                         dialog box and does not change the current settings.
  1497.                         If one of the command buttons is highlighted, press
  1498.                         ENTER to execute that command. Clicking a command
  1499.                         button also executes the command. If a button
  1500.                         contains an ellipsis, it indicates that another
  1501.                         dialog box will appear when the command is
  1502.                         selected.
  1503.  
  1504.  
  1505.  Dialog boxes usually contain shortcut keys. Shortcut keys are identified by
  1506.  highlighted letters.
  1507.  
  1508.  
  1509.  Getting Help
  1510.  
  1511.  PWB uses the Microsoft Advisor online reference system to provide
  1512.  information about PWB, the assembler, the linker, the CodeView debugger,
  1513.  other utilities, and topics relating to the MASM language. Information can
  1514.  be displayed at any time and at any point in PWB or CodeView. For a complete
  1515.  discussion of the online reference system, see Chapter 4.
  1516.  
  1517.  
  1518.  Menu Help
  1519.  
  1520.  To get information about a PWB menu command, choose the command with the
  1521.  ARROW keys, then press F1; or point the mouse cursor at the menu command and
  1522.  click the right mouse button. A help window appears with information about
  1523.  the command.
  1524.  
  1525.  
  1526.  Dialog-Box Help
  1527.  
  1528.  Many dialog boxes have a help button that provides additional information
  1529.  about the dialog box and its contents. To display the information, click the
  1530.  help button with the mouse or press F1.
  1531.  
  1532.  
  1533.  The Help Menu
  1534.  
  1535.  The commands in the Help menu can display a table of contents, an index of
  1536.  all help topics, and help on using the online reference system itself.
  1537.  
  1538.  The Contents command displays the contents of the entire reference system.
  1539.  Information is organized by topic, such as PWB, CodeView, the MASM language,
  1540.  and specific utilities. Click a topic to move to that topic's table of
  1541.  contents.
  1542.  
  1543.  The Index command displays every available item in the reference system,
  1544.  organized alphabetically. Select the first letter of the topic you want from
  1545.  the alphabet bar at the top of the screen. Then select the specific topic
  1546.  from the list that appears. Use PGUP, PGDN, and the ARROW keys to scroll
  1547.  through the topics.
  1548.  
  1549.  The Help on Help command provides a brief overview of how to navigate
  1550.  through the help system and invoke help on any topic.
  1551.  
  1552.  
  1553.  Using the Editor
  1554.  
  1555.  The program editor is an important part of the PWB environment. This section
  1556.  provides a brief overview of its major functions and assumes you are using
  1557.  the default key assignments. For a complete list of editor commands and
  1558.  functions, refer to the following online reference topics, available on the
  1559.  PWB Contents screen:
  1560.  
  1561.  
  1562.    ■   "Function Quick Reference"
  1563.  
  1564.    ■   "Using PWB Functions"
  1565.  
  1566.  
  1567.  
  1568.  Moving Around in a Text File
  1569.  
  1570.  Most of the cursor-control keys position the cursor and modify the display
  1571.  just as you would expect them to. The HOME, END, PGUP, PGDN, and ARROW keys
  1572.  behave as they do in most other text editors.
  1573.  
  1574.  If you click in the shaded area on either side of the scroll box in the
  1575.  scroll bar, you move the cursor one full window at a time. If you click the
  1576.  scroll-bar arrows, you move the cursor one row or column in the
  1577.  corresponding direction. If you click and drag the scroll box, you move the
  1578.  cursor to the corresponding relative position within the file.
  1579.  
  1580.  
  1581.  Defining a Block of Text
  1582.  
  1583.  One of the most common editing tasks is defining a block of text, usually
  1584.  before deleting, moving, or copying it.
  1585.  
  1586.  
  1587.  Keyboard
  1588.  
  1589.  
  1590.  To define a block of text:
  1591.  
  1592.  
  1593.    1.  Move the cursor to the beginning of the block.
  1594.  
  1595.    2.  Hold down the SHIFT key and use any cursor-movement key (ARROW, HOME,
  1596.        PGDN, and so on) to move to the end of the block.
  1597.  
  1598.  
  1599.  
  1600.  Mouse
  1601.  
  1602.  
  1603.  To define a block of text:
  1604.  
  1605.  
  1606.    1.  Click the first character at the beginning of the block. Continue
  1607.        pressing the left mouse button.
  1608.  
  1609.    2.  Drag the mouse to select the rest of the desired text. The block
  1610.        remains selected until you press a cursor movement key or click the
  1611.        mouse again.
  1612.  
  1613.  ────────────────────────────────────────────────────────────────────────────
  1614.  NOTE
  1615.  
  1616.  As long as a block is defined, anything you type deletes the defined block
  1617.  and inserts the typed characters.
  1618.  ────────────────────────────────────────────────────────────────────────────
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  As you move the cursor or mouse to define a block, you usually select all
  1624.  characters from the starting cursor position to the ending cursor position.
  1625.  This is called "stream mode" and is the default. The Edit menu offers three
  1626.  text-selection modes:
  1627.  
  1628.  
  1629.    ■   Stream mode selects all text from the starting cursor position to the
  1630.        ending cursor position (the default).
  1631.  
  1632.    ■   Box mode selects text from a rectangle whose opposite corners are the
  1633.        starting and ending cursor positions.
  1634.  
  1635.    ■   Line mode selects full lines of text from the line with the starting
  1636.        cursor position to the line with the ending cursor position.
  1637.  
  1638.  
  1639.  You can select a different mode from the Edit menu. The mode displayed in
  1640.  the menu is the next available text-selection mode (not the current mode).
  1641.  You can also move through the selection modes during text selection by
  1642.  clicking the right mouse button while you hold down the left mouse button.
  1643.  
  1644.  Once a block is defined, press DEL to erase it. You can also place the block
  1645.  in the clipboard buffer for later use. Press CTRL+INS to copy the block to
  1646.  the clipboard. Press SHIFT+DEL to copy the block to the clipboard and erase
  1647.  it from the screen. Press SHIFT+INS to insert the current contents of the
  1648.  clipboard at the cursor.
  1649.  
  1650.  
  1651.  Setting Bookmarks
  1652.  
  1653.  A "bookmark" is a permanent marker that lets you quickly return to a
  1654.  specific section of text. A bookmark stays with the text it marks, even if
  1655.  the text is moved.
  1656.  
  1657.  To set a bookmark, first position the cursor at the location you want to
  1658.  mark. Then select the Define Mark command from the Search menu.
  1659.  
  1660.  In the dialog box that appears, type the name you want to give the bookmark.
  1661.  (The source filename and the row and column are already entered.) Press
  1662.  ENTER to save the bookmark for the current session. To save a bookmark for
  1663.  later editing sessions, use the Add To Mark File option. The Set Mark File
  1664.  command from the Search menu reloads previously saved bookmarks.
  1665.  
  1666.  To move the cursor to a bookmark, choose the Go To Mark command from the
  1667.  Search menu. A list of all bookmarks is displayed. Select the bookmark from
  1668.  the list using the ARROW keys, or click the selected bookmark with the left
  1669.  mouse button. Press ENTER to go to the bookmark.
  1670.  
  1671.  
  1672.  Setting Anchors
  1673.  
  1674.  An "anchor" temporarily marks the beginning of selected text. It is most
  1675.  often used to define a block that extends beyond the current screen.
  1676.  
  1677.  To set an anchor, move the cursor to the desired location and choose the Set
  1678.  Anchor command from the Edit menu. Use the Select To Anchor command from the
  1679.  Edit menu to select all text between the current cursor position and the
  1680.  anchor. Only one anchor can be set at a time.
  1681.  
  1682.  
  1683.  Searching for and Changing Text
  1684.  
  1685.  You can search for a string of text using the Find command in the Search
  1686.  menu. Type the string you want to look for, then use the check boxes to set
  1687.  options such as wrap-around search and case sensitivity. The Files button
  1688.  allows you to specify a list of files to search through for the designated
  1689.  string.
  1690.  
  1691.  Once a string has been located, use the Repeat Last Find command in the
  1692.  Search menu (or press the shortcut key, F3) to move to the next occurrence
  1693.  of the string. If you specified several files to search, press SHIFT+F3 to
  1694.  move to the next file that contains that string.
  1695.  
  1696.  To modify several instances of a string in the source file, use the Change
  1697.  command in the Search menu. Enter the target string, the replacement string,
  1698.  and the search options.
  1699.  
  1700.  PWB also supports searching for and replacing text patterns using
  1701.  regular-expressions. You can use either the UNIX or Microsoft
  1702.  regular-expression syntax. For further information, see the online reference
  1703.  system.
  1704.  
  1705.  PWB can also search for selected text in files not currently loaded. Select
  1706.  the Files command in the Find dialog box. From the File List box, select the
  1707.  name of a file that you want to search. Then click the Add/Delete button to
  1708.  place it in the File(s) Selected box. Repeat this step for all the files you
  1709.  want to search.
  1710.  
  1711.  You can also enter a wildcard pattern in the File Name text box, and then
  1712.  use the Add Pattern button to place it in the File(s) Selected box. Press
  1713.  ENTER or click the OK button to begin the search. Use the Next Error and
  1714.  Previous Error commands to scan any text that is found.
  1715.  
  1716.  
  1717.  Creating Macros
  1718.  
  1719.  You can save blocks of text or frequently performed editing tasks as macros.
  1720.  Each macro is assigned a key combination that "plays back" the text or task.
  1721.  
  1722.  
  1723.  For example, if several programmers are working on a file and need to keep
  1724.  track of who made what changes, a macro can be used to insert a comment with
  1725.  the programmer's name.
  1726.  
  1727.  To create such a macro, use the Set Record command from the Edit menu to
  1728.  enter a macro name and its associated key combination. For this example,
  1729.  call the macro modname  and assign it to the key combination CTRL+J.
  1730.  
  1731.  Now choose the Record On command from the Edit menu. A bullet appears to the
  1732.  left of the menu command and an X appears in the status line, indicating
  1733.  that all keystrokes and menu commands are being recorded. Then type the
  1734.  following:
  1735.  
  1736.    ; j. courtney coded this
  1737.  
  1738.  To stop the recording, choose Record On again, which causes the bullet to
  1739.  disappear. This action associates all recorded actions with the previously
  1740.  selected macro name. Now, each time you press CTRL+J, the comment you typed
  1741.  is inserted at the cursor position.
  1742.  
  1743.  Macros are saved in the TOOLS.INI file when you save the <record>
  1744.  pseudofile. You can change or delete them by modifying the file. See the
  1745.  section "Customizing PWB" in the online reference system for additional
  1746.  information about macros.
  1747.  
  1748.  
  1749.  Customizing the Editor
  1750.  
  1751.  You can modify editor settings, assign keyboard commands, and emulate
  1752.  command sets from other editors to make the editor work the way you like.
  1753.  See the online reference system and Chapter 14, "Customizing the Microsoft
  1754.  Programmer's WorkBench," in the Programmer's Guide for complete details.
  1755.  
  1756.  
  1757.  Changing Editor Settings
  1758.  
  1759.  The PWB editor has a variety of settings you can customize, such as word
  1760.  wrap, color, and width of tab stops.
  1761.  
  1762.  View or modify the settings by choosing the Editor Settings command from the
  1763.  Options menu. The editor settings appear in a new window labeled "Current
  1764.  Assignments and Settings." The format is setting:value, where setting is the
  1765.  name of the setting, and value is a Boolean, numeric, or text value. You can
  1766.  learn about a setting by positioning the cursor on it and pressing F1.
  1767.  
  1768.  To change a setting, simply overtype the old value with a new one. The
  1769.  change does not take effect until you move the cursor to a different line.
  1770.  To save the changed assignments, press SHIFT+F2 (if the default keyboard
  1771.  assignments are in effect) or choose the Save command in the File menu. If
  1772.  you do not save, the assignments are temporary and last only for the
  1773.  duration of the PWB session.
  1774.  
  1775.  To return to your source file, press F2.
  1776.  
  1777.  
  1778.  Modifying Keyboard Assignments
  1779.  
  1780.  Most editor functions (such as delete, home, and copy) are already assigned
  1781.  a keystroke combination for direct execution. You can reassign these
  1782.  functions to different keystrokes by choosing the Key Assignments command in
  1783.  the Options menu.
  1784.  
  1785.  This command displays the current assignments on a screen labeled "Current
  1786.  Assignments and Settings." Function assignments appear in the format
  1787.  function:keyname. You can learn about a PWB function by positioning the
  1788.  cursor on the function name and pressing F1. Press PGDN to view a list of
  1789.  unassigned keys following the assignment list.
  1790.  
  1791.  To assign a new key to a function, replace keyname with the name of the new
  1792.  key. The change does not take effect until you move the cursor to a
  1793.  different line.
  1794.  
  1795.  When you move the cursor, the line with the new assignment is highlighted.
  1796.  To make the assignment permanent, save the file by pressing SHIFT+F2 or by
  1797.  choosing the Save command in the File menu. This updates the TOOLS.INI file,
  1798.  where changes to key assignments are stored.
  1799.  
  1800.  To remove a key assignment, assign the unassigned function to the key.
  1801.  
  1802.  
  1803.  Using Advanced Editor Features
  1804.  
  1805.  Most of the standard editing features in PWB are intuitive and easy to use.
  1806.  However, there are also many advanced editing options that allow you to
  1807.  customize and control the editor beyond simple menu commands.
  1808.  
  1809.  The PWB editor incorporates all of the powerful features found in the
  1810.  Microsoft Editor. You can set a variety of functions and switches to further
  1811.  customize the PWB editor and enhance its performance. A complete list of
  1812.  editor functions and settings is available in the online reference system.
  1813.  
  1814.  You can add new or altered functions and settings to the TOOLS.INI file so
  1815.  they are loaded when PWB starts, or you can enter them interactively while
  1816.  you are working in PWB.
  1817.  
  1818.  For example, to assign a key command interactively to the editor's curdate
  1819.  function, which enters the current date at the cursor, first press ALT+A.
  1820.  (The display  Arg[1]  appears at the left end of the reference bar to show
  1821.  that you have pressed ALT+A once.) Type the following into the argument
  1822.  dialog box (note that the dialog box does not appear until you have typed
  1823.  the first character):
  1824.  
  1825.    Curdate:SHIFT+CTRL+T
  1826.  
  1827.  Press ALT+= to assign the key to the function.
  1828.  
  1829.  Now when you press SHIFT+CTRL+T, the current date is inserted at the
  1830.  editor's cursor position.
  1831.  
  1832.  For detailed information about advanced PWB features, refer to the
  1833.  Programmer's Guide and the online reference system.
  1834.  
  1835.  
  1836.  Reconfiguring the Editor
  1837.  
  1838.  PWB includes the BRIEF.INI file with key assignments that emulate the BRIEF
  1839.  editor. To use these key assignments, add the contents of this file to
  1840.  TOOLS.INI. You can also simulate command sets from other editors using the
  1841.  customization techniques described earlier.
  1842.  
  1843.  
  1844.  Running Other Programs
  1845.  
  1846.  One of PWB's most powerful features is its ability to run other programs
  1847.  without exiting to the command line. The Customize Menu command in the Run
  1848.  menu lets you add any program to the Run menu, where you can execute it
  1849.  simply by clicking its name. You can also specify any keystroke to run it
  1850.  directly.
  1851.  
  1852.  After selecting Customize Menu, click the Add button in the Customize Menu
  1853.  dialog box that appears. The dialog box lets you type all the information
  1854.  PWB needs to successfully execute the program: its name, directory,
  1855.  command-line arguments, and so on. Note that you can give the program any
  1856.  name you like on the command line, and you can specify that the program run
  1857.  in the background.
  1858.  
  1859.  
  1860.  Assembling and Linking
  1861.  
  1862.  PWB can handle all the details of assembling and linking (building) a
  1863.  program for you. You first tell PWB which source files constitute the
  1864.  program. PWB then creates a "makefile," which specifies how these files are
  1865.  supposed to be assembled, compiled, and linked to create the final
  1866.  executable file. PWB already knows that .ASM files are to be assembled, .C
  1867.  files are to be compiled, and the resulting .OBJ files are to be linked, so
  1868.  it can handle simple projects automatically. Complex projects may require
  1869.  you to write your own makefile.
  1870.  
  1871.  Once the makefile is created, you build your project by selecting the Build
  1872.  command. The makefile also speeds the build process with multimodule
  1873.  programs, since only those source files that have changed from the last
  1874.  build are reassembled or recompiled.
  1875.  
  1876.  
  1877.  Building Programs in PWB
  1878.  
  1879.  This section shows how to build programs in the PWB environment. If you
  1880.  don't have a program of your own, you might want to use the following
  1881.  program:
  1882.  
  1883.    ;  HELLO.ASM defines a string and calls the procedure PutStr
  1884.    to
  1885.    ;  display the text. PutStr is in a separate module PUTSTR.ASM.
  1886.  
  1887.            .MODEL  small, c
  1888.  
  1889.    ; Tell assembler PutStr's argument type and how to call PutStr:
  1890.    PutStr  PROTO   pMsg:PTR BYTE
  1891.  
  1892.            .DOSSEG
  1893.            .STACK
  1894.  
  1895.            .DATA
  1896.    msg     BYTE    "Hello, world.", 13, 10, 0  ; Null-terminated string
  1897.  
  1898.            .CODE
  1899.            .STARTUP                  ; Initialize data and stack segments
  1900.  
  1901.            INVOKE  PutStr, ADDR msg  ; Call external procedure
  1902.  
  1903.            .EXIT   0                 ; Exit program
  1904.  
  1905.            END
  1906.  
  1907.  Note that there are new directives (such as .DOSSEG) and new constructs
  1908.  (such as INVOKE and PROTO) in this and the following procedure. MASM version
  1909.  6.0 has a number of new features to make assembly-language programming more
  1910.  like programming in a high-level language, while maintaining the compact,
  1911.  fast-executing code assembly language offers. These features are explained
  1912.  in detail in the online reference system and in the Programmer's Guide.
  1913.  
  1914.  
  1915.  Saving a Program
  1916.  
  1917.  To save a source file, select the File menu and choose either Save or Save
  1918.  As. If the file is new or you choose Save As, a dialog box prompts you for a
  1919.  filename (see Figure 3.3). If you choose Save with an existing file, PWB
  1920.  automatically saves the file under the name listed in the title bar of the
  1921.  Source window. To save a copy of a file under a different name, choose Save
  1922.  As. (The older version of the file, with its original name, is not deleted
  1923.  or modified.)
  1924.  
  1925.  (This figure may be found in the printed book.)
  1926.  
  1927.  Type in the name of the source file,  HELLO.ASM. Press ENTER or click the OK
  1928.  button to save the file with this name.
  1929.  
  1930.  
  1931.  Writing and Saving a Procedure
  1932.  
  1933.  HELLO.ASM calls the  PutStr  routine to display a message (in this case,
  1934.  Hello, world) on the screen. You could add this routine to the HELLO.ASM
  1935.  file; but because it's a procedure that could be used in other programs, you
  1936.  should put it in a separate file.
  1937.  
  1938.  Use the New command in the File menu to clear the screen. Type in the
  1939.  PutStr  routine that follows and save it in a file named PUTSTR.ASM:
  1940.  
  1941.    ;  PUTSTR.ASM contains a procedure PutStr, which displays a
  1942.    ;  null-terminated string on the screen.
  1943.  
  1944.            .MODEL  small, c
  1945.  
  1946.            .CODE                  ; Address of string (near or far
  1947.    PutStr  PROC    pMsg:PTR BYTE  ;  depending on model) is passed on
  1948.                                   ;  the stack
  1949.            mov     ah, 02h        ; Display character function
  1950.  
  1951.            mov     di, pMsg       ; Load address in DI
  1952.            mov     dl, [di]       ; Load each character through [DI]
  1953.  
  1954.            .WHILE  (dl)
  1955.            int     21h            ; DOS displays character
  1956.            inc     di             ; Point to next character
  1957.            mov     dl, [di]       ; Load each character through [DI]
  1958.            .ENDW
  1959.  
  1960.            ret
  1961.  
  1962.    PutStr  ENDP
  1963.  
  1964.            END
  1965.  
  1966.  
  1967.  Setting the Main Language and Build Options
  1968.  
  1969.  Before assembling the HELLO program, you must first specify the type of
  1970.  program you are building. Once you choose a main language and an initial
  1971.  build option, you can change its settings using the MASM Options command
  1972.  from the Options menu.
  1973.  
  1974.  
  1975.  To specify a main language and an initial build option:
  1976.  
  1977.  
  1978.    1.  Choose the Build Options command from the Options menu
  1979.  
  1980.    2.  Choose the Set Main Language button
  1981.  
  1982.    3.  Use the mouse or the ARROW keys to select "Assembler" from the list,
  1983.        and then press ENTER
  1984.  
  1985.    4.  Choose the Set Initial Build Options button
  1986.  
  1987.    5.  Use the mouse or the ARROW keys to select a build option from the
  1988.        list, and then press ENTER
  1989.  
  1990.  
  1991.  For the HELLO program, select the DOS EXE build option.
  1992.  
  1993.  
  1994.  Setting and Clearing the Program List
  1995.  
  1996.  Once you set the main language and initial build options, you need to set
  1997.  the program list. The Set Program List command in the Make menu tells PWB
  1998.  which makefile to use in building a program. It clears the current makefile
  1999.  setting, instructs PWB to use the makefile you have specified, and specifies
  2000.  which Browser (.BSC) file is associated with the current project.
  2001.  
  2002.  Choose the Set Program List command from the Make menu. In the dialog box
  2003.  that appears, type the main program's filename (HELLO), then press ENTER
  2004.  (see Figure 3.4). PWB automatically loads the .MAK file if it exists or asks
  2005.  you if you want to create it.
  2006.  
  2007.  (This figure may be found in the printed book.)
  2008.  
  2009.  If the makefile does not exist, PWB asks if you want to create a new
  2010.  makefile; answer Yes. The Edit Program List dialog box appears, listing all
  2011.  files in the current directory. Select the files you want to include in the
  2012.  project (in this example, HELLO.ASM and PUTSTR.ASM). It doesn't matter in
  2013.  which order the files appear.
  2014.  
  2015.  
  2016.  Keyboard
  2017.  
  2018.  
  2019.  To select the files:
  2020.  
  2021.  
  2022.    1.  Press TAB until the cursor is within the list box containing the
  2023.        directory of files (another box lists the directory names).
  2024.  
  2025.    2.  Use the ARROW keys to move to the HELLO.ASM file. Press ENTER to add
  2026.        the filename to the program list.
  2027.  
  2028.    3.  Repeat step 2 for PUTSTR.ASM.
  2029.  
  2030.    4.  Once both filenames appear in the program list, press TAB until the
  2031.        Save List command button is highlighted, and then press ENTER.
  2032.  
  2033.  
  2034.  
  2035.  Mouse
  2036.  
  2037.  
  2038.  To select the files:
  2039.  
  2040.  
  2041.    1.  Click HELLO.ASM once; then click the Add/Delete button (or just
  2042.        double-click HELLO.ASM).
  2043.  
  2044.    2.  Repeat step 1 for PUTSTR.ASM.
  2045.  
  2046.    3.  Once both filenames appear in the program list, click the Save List
  2047.        command button to save the makefile.
  2048.  
  2049.  
  2050.  PWB automatically creates a makefile appropriate for the files you selected.
  2051.  You can edit the .MAK text file to change or add additional commands.
  2052.  
  2053.  If you want to create a new program or instruct PWB to "forget" the current
  2054.  program, use the Clear Program List command in the Make menu. This action
  2055.  clears the current program-list setting. You can then specify a new program
  2056.  to build using the Set Program List command. You should always clear the
  2057.  program list before starting work on a different project.
  2058.  
  2059.  
  2060.  Assembling and Linking HELLO.ASM
  2061.  
  2062.  The MASM Options command in the Options menu lets you control a variety of
  2063.  assembly options (see Figure 3.5).
  2064.  
  2065.  (This figure may be found in the printed book.)
  2066.  
  2067.  From within the Macro Assembler Global Options dialog box, you can use the
  2068.  Set Debug Options and Set Release Options buttons to easily create debug and
  2069.  release versions of your program.
  2070.  
  2071.  The Set Debug Options button displays a dialog box where you can set
  2072.  parameters for activities like generating list files and debugging. These
  2073.  settings also apply to programs built with the Debug Build option, which you
  2074.  select from the dialog box displayed by the Build Options command. Use debug
  2075.  settings when you are developing and actively debugging your program. When
  2076.  the Release Build option is checked in the Build Options dialog box, the
  2077.  parameters specified in the Set Release Options dialog box apply.
  2078.  
  2079.  Similar debug and release options are also available for the linker with the
  2080.  LINK Options command in the Options menu (see Figure 3.6). You can display
  2081.  the options in both the Macro Assembler Global Options and LINK Options
  2082.  dialog boxes using Show Debug Options and Show Release Options buttons.
  2083.  
  2084.  (This figure may be found in the printed book.)
  2085.  
  2086.  The Set Release Options button in the Macro Assembler Global Options dialog
  2087.  box offers the same choices as Set Debug Options, but Set Release applies
  2088.  them to a final version of the program. Use these settings when your program
  2089.  is completely debugged and ready for release.
  2090.  
  2091.  Before building a program, make sure its name appears after the Compile File
  2092.  and Build commands in the Make menu. If the name does not appear after the
  2093.  Build command, choose the Set Program List command in the Make menu to set
  2094.  the makefile as the current project.
  2095.  
  2096.  To build the program, choose the Build command in the Make menu. If an
  2097.  assembly or link error occurs, the build terminates and the error appears in
  2098.  the Compile Results window. You can get information about unknown errors
  2099.  from the online reference system by selecting the error and pressing F1. In
  2100.  OS/2, you are notified of errors and asked if you want to see the assembly
  2101.  log. (If you want to view the assembly log when running PWB under DOS, you
  2102.  must select the Compile Results command from the View menu before starting
  2103.  assembly.)
  2104.  
  2105.  
  2106.  Running the Program
  2107.  
  2108.  After the program is built, PWB adds the name of the executable file to the
  2109.  Execute command in the Run menu. Choose Execute to run the program. When the
  2110.  program is complete, press any key to return to PWB.
  2111.  
  2112.  
  2113.  Debugging Programs
  2114.  
  2115.  PWB has a variety of resources available for debugging programs. They range
  2116.  from simple assemble-and-link error messages to sophisticated source
  2117.  browsing and source- or assembly-level debugging.
  2118.  
  2119.  When assembly errors occur, the cursor moves to the line that caused the
  2120.  first error; a brief description of the error appears in the reference bar.
  2121.  Use the Next Error and Previous Error commands in the Search menu to move
  2122.  the cursor to lines where other errors occurred.
  2123.  
  2124.  To see a complete list of errors, choose the Compile Results command from
  2125.  the View menu. Move the cursor into the Compile Results window and use the
  2126.  Set Error command in the Search menu to select the error under the cursor as
  2127.  the current error. This command synchronizes the source and error windows so
  2128.  the source-code line containing the error appears in the active window.
  2129.  
  2130.  Use the Microsoft Advisor to display online help about the error. In the
  2131.  Compile Results window, move the cursor to the error number and press F1, or
  2132.  click the number with either mouse key.
  2133.  
  2134.  PWB incorporates a source-code browser and interfaces with the CodeView
  2135.  debugger. The Browser displays information about function and data
  2136.  relationships. CodeView is a window-oriented symbolic debugger that lets you
  2137.  step through your code and examine variables and data as the program
  2138.  executes.
  2139.  
  2140.  
  2141.  Using the Browser
  2142.  
  2143.  The Browser can search a database of selected files to get a list of
  2144.  references and definitions, to build a call tree and outline, or to create a
  2145.  list of relationships among program symbols. You can examine this material
  2146.  to see how your program is structured. Figure 3.7 shows how  HELLO.ASM
  2147.  calls the  PutStr  procedure.
  2148.  
  2149.  (This figure may be found in the printed book.)
  2150.  
  2151.  The commands on the Browse menu are referred to collectively as the PWB
  2152.  Source Browser. Before using these commands, you must define the database
  2153.  the Source Browser is going to search.
  2154.  
  2155.  
  2156.  To define a database:
  2157.  
  2158.  
  2159.    1.  Generate a program list using the Set Program List command from the
  2160.        Make menu. The files contained in the program list make up the
  2161.        database.
  2162.  
  2163.    2.  Choose Browse Options in the Options menu. You must select the
  2164.        Generate Browse Information field in the dialog box to create the
  2165.        Source Browser database. The rest of the fields in this dialog box
  2166.        offer you choices of how to build the database; they are optional.
  2167.  
  2168.    3.  Build your program using the commands from the Make menu. When you
  2169.        build the program, a file with the same program-list root name and a
  2170.        .BSC (Browser Source Cache) extension is created. This file contains
  2171.        reference information used by the Browser.
  2172.  
  2173.  
  2174.  Once you have completed these steps, the following Browse menu commands are
  2175.  ready for you to use:
  2176.  
  2177.  
  2178.    ■   The Goto Definition command provides a list of symbols and variables
  2179.        that occur within include files and modules. You can immediately open
  2180.        the file at the line number where the definition of a symbol or
  2181.        variable appears by selecting the OK button.
  2182.  
  2183.    ■   The Goto Reference command displays a list of files and line numbers
  2184.        where symbols and variables have been referenced in include files and
  2185.        modules.
  2186.  
  2187.    ■   The View Relationships command provides detailed information about
  2188.        various portions of your program. You can examine functions, macros,
  2189.        types, and variables by their use, definition, or inclusion in include
  2190.        files and modules.
  2191.  
  2192.    ■   The List References command displays references to functions, macros,
  2193.        types, and variables. You can move the cursor to a reference and then
  2194.        use the Goto Definition or Goto Reference command to show occurrences
  2195.        of the reference.
  2196.  
  2197.    ■   The Call Tree command displays a tree structure of function calls
  2198.        within the program.
  2199.  
  2200.  
  2201.  For additional information about the Browser, refer to the online reference
  2202.  system.
  2203.  
  2204.  ────────────────────────────────────────────────────────────────────────────
  2205.  NOTE
  2206.  
  2207.  You can create a Browser information file with the ML (command-line)
  2208.  assembler using the /FR or /Fr option. This creates a .SBR file, which you
  2209.  must convert to a Browser-readable .BSC file with the PWBRMAKE.EXE utility.
  2210.  ────────────────────────────────────────────────────────────────────────────
  2211.  
  2212.  
  2213.  Debugging with the CodeView Debugger
  2214.  
  2215.  Once a program has been built, you can use the Microsoft CodeView debugger
  2216.  to step through the source code, displaying output, registers, and variables
  2217.  as each line is executed (see Figure 3.8). You can also set breakpoints and
  2218.  watchpoints to cause execution to pause at critical sections of code. From
  2219.  within CodeView, the Microsoft Advisor can provide online help about
  2220.  CodeView operation, options, and MASM keywords in the source code. Although
  2221.  you can call CodeView from the command line, PWB provides access to CodeView
  2222.  without exiting. See Chapter 15 in the Programmer's Guide for more
  2223.  information about using CodeView.
  2224.  
  2225.  ────────────────────────────────────────────────────────────────────────────
  2226.  NOTE
  2227.  
  2228.  CodeView version 3.12 is compatible with releases of OS/2 later than version
  2229.  1.0. If you have problems exiting CodeView, you have either an older version
  2230.  of OS/2 or the wrong version of the DOSCALLS.DLL file.
  2231.  
  2232.  If you use CodeView from the OS/2 DOS compatibility box, be sure the /S
  2233.  (Swap Screen in Buffers) option is set in the CodeView Options dialog box.
  2234.  If the option is not set, the mouse cursor is not displayed while you are
  2235.  debugging.
  2236.  ────────────────────────────────────────────────────────────────────────────
  2237.  
  2238.  (This figure may be found in the printed book.)
  2239.  
  2240.  
  2241.  Preparing a Debug Build
  2242.  
  2243.  It's easy to create a debug version of a program so it can be examined with
  2244.  CodeView.
  2245.  
  2246.  Choose MASM Options in the Options menu; then select the Set Debug Options
  2247.  button. This dialog box contains a variety of settings for a debug build.
  2248.  Although most of the options can be set to your preference, you must check
  2249.  the CodeView option under the Debug Information heading.
  2250.  
  2251.  The CodeView Options command in the PWB Options menu provides a variety of
  2252.  choices for configuring CodeView. These include two-monitor debugging,
  2253.  memory allocation, and selecting the number of lines on the screen. For now,
  2254.  use the default settings initially displayed.
  2255.  
  2256.  For the assembler to build a program containing the necessary CodeView
  2257.  information, you must check the Debug option, which is set in the dialog box
  2258.  displayed by the Build Options command in the Options menu. You must also
  2259.  select the CodeView option (which is on by default) in the Set Debug Options
  2260.  dialog box accessed from the MASM Options command in the Options menu.
  2261.  
  2262.  To demonstrate how CodeView works, set the debug options as listed above,
  2263.  then rebuild the HELLO.ASM program using the Rebuild All command in the Make
  2264.  menu.
  2265.  
  2266.  
  2267.  Examining the Program
  2268.  
  2269.  After your program has been built with the appropriate debug options, choose
  2270.  the Debug command from the Run menu. PWB immediately transfers control to
  2271.  CodeView, loading the current project as indicated in the program list.
  2272.  
  2273.  When you switch from PWB to CodeView, the program appears in the Source
  2274.  window. The Source command in the Options menu displays your program in one
  2275.  of the following ways:
  2276.  
  2277.  
  2278.    ■   As source code from your MASM source-code file. This is the default
  2279.        display.
  2280.  
  2281.    ■   As assembly language generated by CodeView disassembling the program's
  2282.        executable file.
  2283.  
  2284.    ■   As a mix of these two, with the disassembled code following the
  2285.        corresponding source code.
  2286.  
  2287.  
  2288.  The mixed-code option is especially useful when your program contains macros
  2289.  or directives that generate code; you can see how the assembler converted
  2290.  them into machine instructions.
  2291.  
  2292.  In addition to showing source code, commands in the View menu show windows
  2293.  displaying memory, registers, and local variables. All windows are similar
  2294.  to PWB windows; they can be scrolled, sized, and closed. You can have
  2295.  multiple windows on one screen, displaying a variety of information. A list
  2296.  of shortcut keys and buttons appears at the bottom of the screen.
  2297.  
  2298.  
  2299.  Setting Watch Expressions and Breakpoints
  2300.  
  2301.  A "watch expression" is a program variable that CodeView continually
  2302.  monitors. Watch expressions are displayed using the Watch command from the
  2303.  View menu. As the value of a variable changes, the value also changes in the
  2304.  watch window.
  2305.  
  2306.  To add a variable to the watch expression list, position the cursor anywhere
  2307.  within the variable and choose the Add Watch command from the Watch menu.
  2308.  You can also type the variable name in the dialog box. Remove watch
  2309.  expressions using the Delete Watch command from the Watch menu, or position
  2310.  the cursor on that expression's line in the Watch window and press CTRL+Y.
  2311.  
  2312.  To set a watch variable in the HELLO.ASM file, use the cursor to highlight
  2313.  the  pMsg  variable in the CodeView Source window. Then choose the Add Watch
  2314.  command from the Watch menu. The  pMsg  variable appears in the Expression
  2315.  text box. Press END to position the cursor at the end of the name, and then
  2316.  type ,s  (so that CodeView displays the data at this address as a string).
  2317.  Press ENTER or click the OK button to add this variable to the Watch window.
  2318.  The Watch window gives a "Watch Expression Not in Context" error until you
  2319.  trace into the  PutStr procedure.
  2320.  
  2321.  CodeView also incorporates a temporary watch option called Quick Watch.
  2322.  Highlight a variable in the Source window with the mouse or cursor. Choose
  2323.  the Quick Watch command from the Watch menu. A dialog box appears giving the
  2324.  current value of the variable. You can add any Quick Watch variable to the
  2325.  watch window using the Add Watch dialog box option.
  2326.  
  2327.  You can expand any structures or arrays that are set as watch expressions
  2328.  (identified with a + in the Watch window) to show individual elements.
  2329.  Position the cursor on the variable name and either double-click the left
  2330.  mouse button or press ENTER (see Figure 3.9).
  2331.  
  2332.  (This figure may be found in the printed book.)
  2333.  
  2334.  A "breakpoint" is an instruction that tells CodeView to interrupt execution
  2335.  at a certain location or when an expression becomes true.
  2336.  
  2337.  Use breakpoints to cause execution of the program to pause before an error
  2338.  occurs and to move quickly to a part of the program you want to trace. When
  2339.  CodeView stops at a breakpoint, you can single-step or trace through
  2340.  instructions until you find the problem.
  2341.  
  2342.  Set a breakpoint by positioning the cursor on the line at which you want the
  2343.  program to stop and then pressing F9. You can also choose the Set Breakpoint
  2344.  command from the Watch menu. A dialog box presents a series of options for
  2345.  setting types of breakpoints. You can modify or delete breakpoints using the
  2346.  Edit Breakpoints command from the Watch menu.
  2347.  
  2348.  Set a breakpoint in the HELLO.ASM file by moving the cursor in the CodeView
  2349.  Source window to the line that reads
  2350.  
  2351.    INVOKE  PutStr, ADDR msg
  2352.  
  2353.  From the Watch menu, choose the Set Breakpoint command. The number of the
  2354.  line the cursor appears on is displayed in the dialog box. Press ENTER or
  2355.  click the OK button to store the breakpoint. After the breakpoint has been
  2356.  set on a line, that line is highlighted.
  2357.  
  2358.  
  2359.  Running the Program Within CodeView
  2360.  
  2361.  CodeView offers several ways to run a program. You can let the program
  2362.  execute at full speed or view each line as it executes. Table 3.2 lists the
  2363.  CodeView run commands.
  2364.  
  2365.  Table 3.2  CodeView Run Commands
  2366.  
  2367.  Name   Use                                                             Key
  2368.  ────────────────────────────────────────────────────────────────────────────
  2369.  Go     Executes the program to the next breakpoint, error, or end of   F5
  2370.         the program
  2371.  
  2372.  Trace  Executes a single line                                          F8
  2373.  
  2374.  Step   Executes a single line, but doesn't trace into functions        F10
  2375.  
  2376.  ────────────────────────────────────────────────────────────────────────────
  2377.  
  2378.  
  2379.  Enter run commands by pressing the appropriate key or clicking the commands
  2380.  at the bottom of the screen. The Trace and Step commands highlight each line
  2381.  as it executes. The Go command simply executes (without highlighting) until
  2382.  the program stops at an error, a breakpoint, or the end. If you choose the
  2383.  Animate option for the Go command, CodeView highlights each line as it
  2384.  executes. To force execution to start at the beginning of the program, use
  2385.  the Restart command in the Run menu.
  2386.  
  2387.  You can either single-step through a program or use the Animate command in
  2388.  the Run menu to step through the program automatically, highlighting each
  2389.  line as it proceeds.
  2390.  
  2391.  If a program requires arguments to be passed from the command line, these
  2392.  arguments can be entered with the Set Runtime Arguments command from the Run
  2393.  menu.
  2394.  
  2395.  
  2396.  Running HELLO.EXE
  2397.  
  2398.  To look at some of the CodeView commands while running HELLO.EXE, make the
  2399.  Source window active by pressing F6 or by clicking its title bar. Then
  2400.  choose the Restart command from the Run menu. Restart clears memory and
  2401.  prepares the program to start execution at .STARTUP.
  2402.  
  2403.  Press F5 or choose the Go button at the bottom of the screen to start the
  2404.  program. The program executes until it reaches the breakpoint you set at the
  2405.  INVOKE directive.
  2406.  
  2407.  If you press F8 or the Trace button, CodeView executes and displays each
  2408.  statement of  PutStr. If you use F10 or the Step button, CodeView executes
  2409.  PutStr without showing each step.
  2410.  
  2411.  The variable  pMsg  is actually a pointer, so no value is displayed until
  2412.  you execute the  PutStr  procedure. As you step through  PutStr, the display
  2413.  switches to the output screen each time a character is written to the
  2414.  screen.
  2415.  
  2416.  Because  pMsg  is also a local variable, it appears in the Local window with
  2417.  all variables local to  PutStr. You can expand local data in the Local and
  2418.  Watch windows by double-clicking it.
  2419.  
  2420.  Press F10 to finish stepping through the program. A dialog box informs you
  2421.  that the program has completed execution normally. Press ENTER to clear the
  2422.  dialog box and complete your debugging session.
  2423.  
  2424.  
  2425.  Debugging HELLO.EXE
  2426.  
  2427.  To see how CodeView deals with a bug, add these statements at the end of the
  2428.  source code for this program:
  2429.  
  2430.    mov ax, 0FFh
  2431.            int 21h
  2432.  
  2433.  Set the appropriate debug options, rebuild the program, and return to
  2434.  CodeView.
  2435.  
  2436.  Use F8 (Trace command) to execute the program. An execution error occurs
  2437.  when the INT instruction is executed, because there is no interrupt function
  2438.  corresponding to 0FFh.
  2439.  
  2440.  
  2441.  Getting More Details
  2442.  
  2443.  PWB, the assembler, the linker, NMAKE, and CodeView have additional features
  2444.  and options beyond the scope of this introduction.
  2445.  
  2446.  Refer to the Programmer's Guide for information about PWB, NMAKE, CodeView,
  2447.  and other tools. Refer to the Reference for a quick reference to all
  2448.  commands and options for the applications included with MASM.
  2449.  
  2450.  You can access additional information about any component of the
  2451.  Professional Development System through the Microsoft Advisor online
  2452.  reference system. For a description of the online reference system, see
  2453.  Chapter 4 of this manual.
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  Chapter 4  Using the Online Reference System
  2461.  ────────────────────────────────────────────────────────────────────────────
  2462.  
  2463.  The Microsoft Macro Assembler (MASM) offers two types of online reference
  2464.  systems:
  2465.  
  2466.  
  2467.    ■   The Microsoft Advisor, accessible from within the Programmer's
  2468.        WorkBench (PWB) and CodeView environments
  2469.  
  2470.    ■   The QuickHelp program, accessed from the OS/2 or DOS command line
  2471.  
  2472.  
  2473.  Both reference systems provide the same information about important features
  2474.  of the Professional Development System, including language-specific
  2475.  information and information about utilities like the CodeView debugger and
  2476.  PWB.
  2477.  
  2478.  The first section of this chapter, "Structure of the Microsoft Advisor,"
  2479.  outlines the structure and contents of the online reference database. The
  2480.  second section, "Navigating the Microsoft Advisor," takes you on a quick
  2481.  tour of the system. The third section, "Using QuickHelp," explains how to
  2482.  use the QuickHelp program and how it differs from the Microsoft Advisor.
  2483.  
  2484.  
  2485.  Structure of the Microsoft Advisor
  2486.  
  2487.  The Microsoft Advisor displays a table of contents of all online reference
  2488.  files available with the Professional Development System. Choose the
  2489.  Contents command from the Help menu to display the table of contents. From
  2490.  the table of contents you can select any topic you want to know more about.
  2491.  Figure 4.1 shows the table of contents screen.
  2492.  
  2493.  (This figure may be found in the printed book.)
  2494.  
  2495.  The Microsoft Advisor also displays indexes for each online reference file.
  2496.  Choose the Index command from the Help menu to display the help topics, and
  2497.  then select the topic whose index you want to search. The alphabet bar at
  2498.  the top of the index screen allows direct access to a list of the index
  2499.  topics starting with the letter you select.
  2500.  
  2501.  
  2502.  Navigating through the Microsoft Advisor
  2503.  
  2504.  You request information about a topic in a window by positioning the cursor
  2505.  over it and pressing F1 or clicking the right mouse button once. The help
  2506.  system then searches through the help files for information about the topic.
  2507.  If it finds the topic, the help system displays information in the Help
  2508.  window. If help cannot be found for a particular word or symbol, a message
  2509.  informs you that no information is associated with the topic. Sometimes a
  2510.  topic with the same name occurs in several help files. In such cases, a
  2511.  dialog box is displayed in which you can select the context of the topic.
  2512.  
  2513.  
  2514.  Using the Help Menu
  2515.  
  2516.  The Help menu provides full access to the online reference system. All these
  2517.  commands display information in the Help window:
  2518.  
  2519.  Command                           Description
  2520.  ────────────────────────────────────────────────────────────────────────────
  2521.  Contents                          Displays a global contents screen of the
  2522.                                    topics in the help files.
  2523.  
  2524.  Index                             Displays a global index list and
  2525.                                    provides access to indexes for all
  2526.                                    components of the online reference
  2527.                                    system. (See Figure 4.2.)
  2528.  
  2529.  Topic:                            Provides information about the topic the
  2530.                                    cursor is currently on. If information
  2531.                                    about the topic is available, the
  2532.                                    topic's name is appended to the Topic:
  2533.                                    command. Otherwise, this menu option is
  2534.                                    grayed.
  2535.  
  2536.  Help on Help                      Displays information about using the
  2537.                                    online reference system itself.
  2538.  
  2539.  Next                              Locates the next occurrence of a topic
  2540.                                    name and displays the information
  2541.                                    associated with it. Use this command to
  2542.                                    get additional information about a topic
  2543.                                    that appears in more than one help file.
  2544.  
  2545.  
  2546.  (This figure may be found in the printed book.)
  2547.  
  2548.  
  2549.  Using the F1 Key and the Mouse
  2550.  
  2551.  The F1 key displays information about the MASM keyword or operator the
  2552.  cursor is positioned on. You can also use the F1 key to directly access
  2553.  information about the menu command currently highlighted or the PWB dialog
  2554.  box currently displayed.
  2555.  
  2556.  The mouse can perform the same function. Position the mouse cursor on the
  2557.  command, dialog box item, or keyword, and click the right mouse button.
  2558.  
  2559.  If the help system cannot find help for a particular word or symbol, a
  2560.  message tells you so. Sometimes a topic with the same name occurs in several
  2561.  help files. In such cases, a dialog box appears in which you can select the
  2562.  context of the topic.
  2563.  
  2564.  Figure 4.3 shows the help information for the Cut command from the Edit
  2565.  menu.
  2566.  
  2567.  (This figure may be found in the printed book.)
  2568.  
  2569.  
  2570.  Using Hyperlinks
  2571.  
  2572.  Hyperlinks are cross-references that connect related topic information.
  2573.  Hyperlinks can be marked explicitly, or they can be implicit.
  2574.  
  2575.  Hyperlinks marked with the < and > characters are called "buttons." You can
  2576.  move through the online reference system using these buttons. Press TAB to
  2577.  move the cursor to the next hyperlink button within the current Help window.
  2578.  SHIFT+TAB moves the cursor back to the previous button. Typing any letter
  2579.  moves the cursor to the next button that begins with the letter. Holding
  2580.  SHIFT down and typing a letter moves the cursor backward.
  2581.  
  2582.  The Microsoft Advisor also recognizes MASM keywords, constants defined by
  2583.  MASM, and similar identifiers as hyperlinks, but they are unmarked. These
  2584.  unmarked hyperlinks are recognized wherever they appear in the help text or
  2585.  in your source code. You cannot move to an unmarked hyperlink with the TAB
  2586.  key.
  2587.  
  2588.  You can access a hyperlink from the keyboard or with the mouse by doing one
  2589.  of the following:
  2590.  
  2591.  
  2592.    ■   Move the text cursor to the hyperlink and press F1
  2593.  
  2594.    ■   Position the mouse cursor over the hyperlink; then click the right
  2595.        mouse button or double-click the left mouse button
  2596.  
  2597.  
  2598.  You can also execute highlighted button hyperlinks by pressing ENTER or the
  2599.  SPACEBAR.
  2600.  
  2601.  Any of these actions displays information about the topic the cursor is
  2602.  positioned on. If the topic isn't a hyperlink, a message informs you that no
  2603.  information on the topic could be found.
  2604.  
  2605.  ────────────────────────────────────────────────────────────────────────────
  2606.  NOTE
  2607.  
  2608.  CodeView uses the right mouse button differently in the Source window.
  2609.  Clicking the right button in the Source window executes the program to the
  2610.  line the mouse was clicked on. However, once the Help window is displayed,
  2611.  clicking the right mouse button selects hyperlinks.
  2612.  ────────────────────────────────────────────────────────────────────────────
  2613.  
  2614.  
  2615.  Using Help Windows and Dialog Boxes
  2616.  
  2617.  The Microsoft Advisor displays information in windows or dialog boxes. Help
  2618.  windows and dialog boxes function the same as other windows and dialog boxes
  2619.  found in PWB and CodeView. For a description of windows and dialog boxes,
  2620.  refer to Chapter 3, "Using the Programmer's WorkBench."
  2621.  
  2622.  
  2623.  Using the Help Window
  2624.  
  2625.  The Help window displays tables of contents, indexes, and information about
  2626.  selected topics. Some screens of information are larger than the Help
  2627.  window; you can view information beyond the window borders with the scroll
  2628.  bars or the cursor-movement keys. The -- symbol marks the end of information
  2629.  in the Help window.
  2630.  
  2631.  Navigating with Hyperlink Buttons - At the top of the Help window is a row
  2632.  of buttons that is useful for moving through the reference system:
  2633.  
  2634.  Button                            Description
  2635.  ────────────────────────────────────────────────────────────────────────────
  2636.  <Up>                              Moves upward in the hierarchy of help
  2637.                                    screens. Since information is ordered
  2638.                                    from the general to the specific, this
  2639.                                    button takes you to more general
  2640.                                    information about the subject.
  2641.  
  2642.  <Contents>                        Displays the table of contents. This
  2643.                                    button always returns you to a known
  2644.                                    point in the online reference
  2645.                                    system.
  2646.  
  2647.  <Index>                           Displays the index list. Selecting an
  2648.                                    item from the list displays the index
  2649.                                    for that category.
  2650.  
  2651.  <Back>                            Moves to the last online reference
  2652.                                    screen you viewed.
  2653.  
  2654.  
  2655.  Frequently, screens about a particular topic are grouped together in a help
  2656.  file. Press CTRL+F1 to display information about the next topic in the help
  2657.  file.
  2658.  
  2659.  Viewing the Previous Help Screen - The Microsoft Advisor remembers the last
  2660.  20 help screens you've accessed. To return to a previous screen, use the
  2661.  <Back> button, or hold down the ALT key and press F1 as many times as
  2662.  necessary to return to the screen you want to see. The help screen that
  2663.  appears is active; you can ask for help on any of its hyperlinks or topics.
  2664.  
  2665.  You can always return to the global contents by pressing SHIFT+F1.
  2666.  
  2667.  Copying and Pasting Information - You can easily copy any text that appears
  2668.  in the Help window to another window. For example, to test an example
  2669.  program in the Help window, just copy it to the Source window and assemble
  2670.  it.
  2671.  
  2672.  
  2673.  Keyboard
  2674.  
  2675.  
  2676.  To copy and paste, follow these steps:
  2677.  
  2678.  
  2679.    1.  Move the cursor to the beginning of the text you want to select. Hold
  2680.        down the SHIFT key and move the cursor to the end of the desired text.
  2681.        The text is now highlighted.
  2682.  
  2683.    2.  Execute the Copy command: press ALT to activate the menus, E (Edit),
  2684.        then C (Copy). Note that the menu lists the shortcut command
  2685.        (CTRL+INS), which you can substitute for ALT+E, then C.
  2686.  
  2687.    3.  Press F6 to switch to another window. Position the cursor where you
  2688.        want to insert the text and execute the Paste command: ALT+E, then P;
  2689.        or use the SHIFT+INS shortcut. The text from the Help window is
  2690.        inserted at the current cursor position.
  2691.  
  2692.  
  2693.  
  2694.  Mouse
  2695.  
  2696.  
  2697.  To copy and paste, follow these steps:
  2698.  
  2699.  
  2700.    1.  Click the left mouse button and drag the cursor (hold down the button
  2701.        while moving the mouse) to select the text you want to copy.
  2702.  
  2703.    2.  Choose Copy from the Edit menu (or press CTRL+INS).
  2704.  
  2705.    3.  Move the mouse cursor to the location where you want to insert the
  2706.        text, and click once. Then choose Paste from the Edit menu. The text
  2707.        from the Help window is inserted at the current cursor position.
  2708.  
  2709.  
  2710.  Closing the Help Window - To close the active Help window and return to the
  2711.  Source window, do one of the following:
  2712.  
  2713.  
  2714.    ■   Press ESC
  2715.  
  2716.    ■   Click the Close button in the upper-left corner of the window with the
  2717.        left mouse button
  2718.  
  2719.  
  2720.  
  2721.  Using Help Dialog Boxes
  2722.  
  2723.  Help dialog boxes contain information about menu commands and their dialog
  2724.  boxes. A help dialog box differs from a Help window in that it is displayed
  2725.  over the Source window and any other open windows. You must close a help
  2726.  dialog box before you can execute menu commands. Clicking the Cancel button
  2727.  in the lower-right portion of the dialog box closes the help dialog box.
  2728.  
  2729.  To view information about any PWB dialog box, do one of the following:
  2730.  
  2731.  
  2732.    ■   Press F1
  2733.  
  2734.    ■   Click the help button in the dialog box with the left mouse button
  2735.  
  2736.  
  2737.  Either of these commands causes a help dialog box to appear. To close a help
  2738.  dialog box, do one of the following:
  2739.  
  2740.  
  2741.    ■   Press ESC
  2742.  
  2743.    ■   Click the Cancel button in the lower-right portion of the dialog box
  2744.        with the left mouse button
  2745.  
  2746.  
  2747.  
  2748.  Accessing Different Types of Information
  2749.  
  2750.  This section presents some ways to access the different types of information
  2751.  available within the online reference system.
  2752.  
  2753.  
  2754.  Keyword Information
  2755.  
  2756.  To get information about any keyword, operator, or symbolic constant, first
  2757.  display the appropriate index for the keyword. Then select the keyword's
  2758.  first letter from the index, scroll down the list of entries, and select the
  2759.  topic hyperlink. If you know the exact name of a keyword, it may be quicker
  2760.  to type it in the Source window and press F1.
  2761.  
  2762.  You can also view information about keywords using the arg command. Type the
  2763.  keyword in the arg command dialog box. Then press F1. If you have the arg
  2764.  function assigned to  alt+a, the following displays help about the ADC (add
  2765.  with carry) command:
  2766.  
  2767.    alt+a ADC F1
  2768.  
  2769.  Figure 4.4 shows the information screen that then appears.
  2770.  
  2771.  When information about a keyword is shown in the Help window, additional
  2772.  hyperlink buttons may be displayed:
  2773.  
  2774.  
  2775.    ■   <Detail> provides a detailed explanation of the keyword. When the
  2776.        information is displayed, the button changes to <Summary>. Click this
  2777.        button to return to the summarized information about the keyword.
  2778.  
  2779.    ■   <Example> displays MASM source code that provides an example of how
  2780.        the keyword is used.
  2781.  
  2782.    ■   <Key> explains symbols used in instruction encodings.
  2783.  
  2784.  
  2785.  (This figure may be found in the printed book.)
  2786.  
  2787.  
  2788.  Topical Information
  2789.  
  2790.  The online reference system is useful when you want an overview of available
  2791.  reference topics or when you have only a general idea of what information
  2792.  you need. Start with the global contents screen and select any hyperlinks
  2793.  that relate to the topic. Then move through the hyperlinks until you locate
  2794.  the information you need.
  2795.  
  2796.  
  2797.  Menu and Dialog-Box Information
  2798.  
  2799.  You can get information about any menu command or dialog box by pressing F1
  2800.  when the menu command is highlighted or when the dialog box is displayed.
  2801.  
  2802.  
  2803.  Error Information
  2804.  
  2805.  The Microsoft Advisor provides information about assembler and linker error
  2806.  messages.
  2807.  
  2808.  
  2809.  Keyboard
  2810.  
  2811.  
  2812.  To find the meaning of an error message:
  2813.  
  2814.  
  2815.    1.  Press F6 to move the cursor to the error window
  2816.  
  2817.    2.  Position the cursor on the error number and press F1
  2818.  
  2819.  
  2820.  
  2821.  Mouse
  2822.  
  2823.  
  2824.  To find the meaning of an error message:
  2825.  
  2826.  
  2827.    1.  Position the mouse cursor on the error number
  2828.  
  2829.    2.  Click the right mouse button
  2830.  
  2831.  
  2832.  To get help about error messages directly from the PWB Source window, type
  2833.  the arg command with the error number and its alphabetic prefix, and then
  2834.  press F1.
  2835.  
  2836.  
  2837.  Specifying Temporary Help Files
  2838.  
  2839.  You can instruct the Microsoft Advisor to search help files that you specify
  2840.  before searching the help files specified in the HELPFILES environment
  2841.  variable. For example, you may want to access the C help files first when
  2842.  writing a mixedlanguage program.
  2843.  
  2844.  Select the Environment command in the PWB Options menu. Type the path for
  2845.  the help files you want searched first in the text box that appears. These
  2846.  files are searched first only during your current session.
  2847.  
  2848.  
  2849.  Using QuickHelp
  2850.  
  2851.  QuickHelp is a separate utility that works like the Microsoft Advisor. It
  2852.  displays information in the same way and can access any Microsoft Advisor
  2853.  help file. Use QuickHelp if you use an editor other than PWB, or if you
  2854.  prefer to use command-line utilities. QuickHelp also supplies convenient
  2855.  access to help when you aren't running PWB.
  2856.  
  2857.  The following sections explain how to call QuickHelp from the command line.
  2858.  You can use these same command-line calls to access QuickHelp from within
  2859.  any program that lets you pass commands to DOS or OS/2.
  2860.  
  2861.  
  2862.  Entering and Exiting QuickHelp
  2863.  
  2864.  If you installed documentation files during SETUP, you can run QuickHelp by
  2865.  typing  QH  at the DOS or OS/2 command line. You can also specify the name
  2866.  of an application, such as
  2867.  
  2868.    QH LIB.EXE
  2869.  
  2870.  To get QuickHelp about the mov command, type
  2871.  
  2872.    QH mov
  2873.  
  2874.  If your editor supports macros, you can write a macro that reads the desired
  2875.  help topic from the editor's command line or from the text-entry window,
  2876.  then appends it to  QH  and passes the result to the operating system.
  2877.  
  2878.  QuickHelp can also display information about run-time errors. Type the error
  2879.  number with its alphabetic prefix after the QH command at the DOS or OS/2
  2880.  command line.
  2881.  
  2882.  To exit QuickHelp, choose the Exit command from the File menu.
  2883.  
  2884.  
  2885.  Using /HELP
  2886.  
  2887.  You can get immediate information about major components of MASM by using
  2888.  /HELP.
  2889.  
  2890.  For example, to learn about the LIB utility, type
  2891.  
  2892.    LIB /HELP
  2893.  
  2894.  QuickHelp immediately displays information about LIB.
  2895.  
  2896.  
  2897.  Specifying Help Files
  2898.  
  2899.  QuickHelp searches for .HLP files according to a few simple rules.
  2900.  Understanding these rules helps you quickly access only the .HLP files you
  2901.  want. The more specific the search, the faster QuickHelp starts.
  2902.  
  2903.  You tell QuickHelp which .HLP files to open by specifying files or
  2904.  directories on the command line or in environment variables. To save time,
  2905.  most programmers specify commonly used .HLP files in the HELPFILES or QH
  2906.  environment variables.
  2907.  
  2908.  You can specify either an entire directory or an individual file. If you
  2909.  specify a directory, QuickHelp opens every .HLP file in that directory.
  2910.  
  2911.  QuickHelp searches for .HLP files in the following order:
  2912.  
  2913.  
  2914.    1.  If you specify a .HLP file or directory on the command line, QuickHelp
  2915.        first searches that file or directory.
  2916.  
  2917.    2.  QuickHelp next searches for files and directories specified in the
  2918.        HELPFILES and QH environment variables.
  2919.  
  2920.    3.  If you do not specify any .HLP files on the command line, and
  2921.        QuickHelp cannot find any .HLP files in the HELPFILES and QH
  2922.        directories,  QuickHelp searches the following directories and
  2923.        environment variables in the order shown:
  2924.  
  2925.        c:\qh
  2926.              DPATH
  2927.              PATH
  2928.              BOOKSHELF  (OS/2 only)
  2929.  
  2930.  
  2931.  
  2932.  Note that QuickHelp does not search the current directory unless you specify
  2933.  that directory in one of the environment search paths.
  2934.  
  2935.  The List Database command from the File menu displays a list of currently
  2936.  open help files. To open additional help files
  2937.  
  2938.  
  2939.    ■   Choose the Open Database command from the File menu.
  2940.  
  2941.    ■   Type in the fully qualified pathname of the help file to be opened in
  2942.        the dialog box that appears. You can specify all help files in a
  2943.        directory by typing *.HLP.
  2944.  
  2945.    ■   Press ENTER or click the OK button with the left mouse button.
  2946.  
  2947.  
  2948.  To close an open help file
  2949.  
  2950.  
  2951.    ■   Choose the Close Database command from the File menu.
  2952.  
  2953.    ■   Use the mouse or keyboard to select the help file you want to close
  2954.        from the list of help files displayed in the menu.
  2955.  
  2956.  
  2957.  
  2958.  Displaying a Topic
  2959.  
  2960.  You can view information about a topic by using the Search command from the
  2961.  View menu. When topic information is displayed, it is shown in the same
  2962.  format as information presented by the Microsoft Advisor.
  2963.  
  2964.  
  2965.  To display a topic from any of the open help files:
  2966.  
  2967.  
  2968.    1.  Choose the Search command from the View menu.
  2969.  
  2970.    2.  Type in the topic you want information on in the Search dialog box
  2971.        (the search is not case-sensitive).
  2972.  
  2973.    3.  Press ENTER or click the OK button with the left mouse button.
  2974.  
  2975.  
  2976.  QuickHelp begins searching for the topic in the open help files. If the
  2977.  topic cannot be found, a dialog box informs you that the search failed. If
  2978.  the search is successful, information about the topic is displayed in the
  2979.  QuickHelp window.
  2980.  
  2981.  
  2982.  Navigating through the Topics
  2983.  
  2984.  A series of commands in the View menu allows you to display topics
  2985.  selectively. These commands include the following:
  2986.  
  2987.  Command                           Description
  2988.  ────────────────────────────────────────────────────────────────────────────
  2989.  View History                      Displays a list of all of the topics
  2990.                                    that have recently been displayed. To
  2991.                                    view a topic in the list, select it and
  2992.                                    click the right mouse button, or press
  2993.                                    ENTER.
  2994.  
  2995.  View Last                         Displays the last topic you looked at.
  2996.  
  2997.  View Back                         Moves backward one topic in the help
  2998.                                    file.
  2999.  
  3000.  View Next                         Displays the next topic in the help file.
  3001.  
  3002.  
  3003.  
  3004.  Using the QuickHelp Window
  3005.  
  3006.  The QuickHelp window (see Figure 4.5) is similar in function to the
  3007.  Microsoft Advisor Help window, described earlier in this chapter.
  3008.  Information that doesn't fully fit in a window can be scrolled, and
  3009.  hyperlinks are used to display additional information.
  3010.  
  3011.  (This figure may be found in the printed book.)
  3012.  
  3013.  
  3014.  Copying and Pasting in QuickHelp
  3015.  
  3016.  In order to transfer information, you must first specify a new file with the
  3017.  Rename Paste File command from the File menu. Once the file is specified,
  3018.  choose either the Current Window or the Current Topic command from the Paste
  3019.  menu to transfer the text to that file. Be sure to specify a new file when
  3020.  you paste, since QuickHelp overwrites text in an existing file.
  3021.  
  3022.  
  3023.  More About QuickHelp
  3024.  
  3025.  In addition to the features described above, QuickHelp has a variety of
  3026.  other options, such as changing the appearance of the Help window, searching
  3027.  for text within topics, and controlling the function of the right mouse
  3028.  button.
  3029.  
  3030.  To learn more about QuickHelp features, refer to the Reference for a list of
  3031.  QuickHelp options. For online information, make sure the QH.HLP file is
  3032.  loaded, then do one of the following:
  3033.  
  3034.  
  3035.    ■   Press F1 to view QuickHelp's online reference
  3036.  
  3037.    ■   Choose a menu command and press F1 or click the right mouse button to
  3038.        get information about the command
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  INDEX
  3045.  ──────────────────────────────────────────────────────────────────────────
  3046.  
  3047.  
  3048.  
  3049.  
  3050.      A
  3051.  Anchors in text files
  3052.  ASMEX environment variable
  3053.  Assembling and linking
  3054.    browser command-line options
  3055.    build options
  3056.    building programs
  3057.    debug build
  3058.    debug options
  3059.    program list
  3060.      clearing
  3061.      setting
  3062.    release options
  3063.    running programs
  3064.  AUTOEXEC.BAT, modifying
  3065.  
  3066.      B
  3067.  Bookmarks in text files
  3068.  Bound software
  3069.  Breakpoints, setting
  3070.  BRIEF.INI
  3071.  Browse menu
  3072.  Buffers parameter in CONFIG.SYS
  3073.  Build options, setting
  3074.  Buttons
  3075.    command
  3076.    hyperlink
  3077.    option
  3078.  
  3079.      C
  3080.  Check boxes
  3081.  CodeView
  3082.    breakpoints, setting
  3083.    configuring extended memory
  3084.    debug build
  3085.    DOS compatibility box
  3086.    examining programs in
  3087.    executing programs in
  3088.    generating information for
  3089.    mouse buttons, use of
  3090.    OS/2
  3091.    Quick Watch option
  3092.    run commands
  3093.    source window
  3094.    using
  3095.    watch expressions
  3096.  Command buttons
  3097.  Compiling Results command
  3098.  CONFIG.SYS, modifying
  3099.  Configuration files
  3100.  
  3101.      D
  3102.  Debug options
  3103.  Debugging
  3104.  Dialog boxes
  3105.    described
  3106.    online reference
  3107.  Directories
  3108.    bound mode
  3109.    protected mode
  3110.    real mode
  3111.  
  3112.      E
  3113.  Editor, PWB
  3114.    advanced features
  3115.    changing key assignments
  3116.    changing settings
  3117.    creating macros
  3118.    customizing
  3119.    defining blocks
  3120.    moving cursor in
  3121.    reconfiguring
  3122.    saving files
  3123.    searching and replacing
  3124.    setting anchors
  3125.    setting bookmarks
  3126.    text-selection modes
  3127.    writing and saving procedures
  3128.  Environment variables
  3129.  Errors, getting help on
  3130.  
  3131.      F
  3132.  F1 key
  3133.  Features, new
  3134.  Files parameter in CONFIG.SYS
  3135.  
  3136.      H
  3137.  Hard disk, choosing
  3138.  Help files
  3139.    specifying
  3140.  Help information
  3141.    copying and pasting in QuickHelp
  3142.    copying and pasting with Microsoft Advisor
  3143.  Help menu
  3144.    commands
  3145.    using
  3146.  /HELP
  3147.  HELPFILES environment variable
  3148.  HIMEM.SYS
  3149.  Hyperlinks
  3150.  
  3151.      I
  3152.  INCLUDE environment variable
  3153.  INIT environment variable
  3154.  Installing MASM
  3155.    mouse driver, copying
  3156.    operating system, choosing
  3157.    Programmer's WorkBench
  3158.  
  3159.      K
  3160.  Keyboard, changing assignments
  3161.  Keys, shortcut
  3162.  
  3163.      L
  3164.  LIBPATH environment variable
  3165.  Linking
  3166.  List boxes
  3167.  
  3168.      M
  3169.  Macros, creating
  3170.  Make menu
  3171.  Makefile
  3172.  MASM.EXE, installing
  3173.  Memory
  3174.    configuring extended
  3175.    required for MASM
  3176.  Menus
  3177.    Browse
  3178.    choosing commands
  3179.    closing
  3180.    Help
  3181.    Make
  3182.    Options
  3183.    shortcut keys
  3184.    View
  3185.    Watch
  3186.  ML.EXE
  3187.  Mouse support
  3188.  MSHELP.DLL
  3189.  
  3190.      N
  3191.  New features
  3192.  NEW-CONF.SYS
  3193.  NEW-VARS.BAT
  3194.  NEW-VARS.CMD
  3195.  Next Error command
  3196.  
  3197.      O
  3198.  Online reference system
  3199.    accessing
  3200.    closing the help window
  3201.    copying and pasting text
  3202.    dialog boxes
  3203.    error information
  3204.    Help menu
  3205.    hyperlinks
  3206.      Back button
  3207.      Contents
  3208.      defined
  3209.      Index button
  3210.      keyword information
  3211.      Up button
  3212.    keyword information
  3213.    menu information
  3214.    temporary file, specifying
  3215.    topical information
  3216.    using mouse in
  3217.    viewing previous help screen
  3218.  Operating systems
  3219.    choosing
  3220.    DOS
  3221.      defined
  3222.      selecting during setup
  3223.      setting up directories in
  3224.    OS/2
  3225.      defined
  3226.      selecting during setup
  3227.      setting up directories in
  3228.  Option buttons
  3229.  Options menu
  3230.  
  3231.      P
  3232.  PATH environment variable
  3233.  Previous Error command
  3234.  Procedures, writing and saving
  3235.  Program list
  3236.    clearing
  3237.    setting
  3238.  Programmer's WorkBench (PWB)
  3239.    accessing Browser from
  3240.    assembling programs in
  3241.    building programs in
  3242.    choosing menu commands
  3243.    customizing
  3244.    debugging in
  3245.    described
  3246.    Editor settings
  3247.    features
  3248.    getting help
  3249.    installing
  3250.    macros, writing
  3251.    menus
  3252.    screen, illustrated
  3253.    selecting text in
  3254.    setting options for
  3255.    source files, specifying
  3256.    startup options
  3257.    using
  3258.  Protected-mode directories
  3259.  
  3260.      Q
  3261.  QH environment variable
  3262.  QuickHelp
  3263.    /HELP
  3264.    copying and pasting
  3265.    described
  3266.    entering and exiting
  3267.    error information
  3268.    navigating through topics
  3269.    searching for topics
  3270.    specifying .HLP files
  3271.    using
  3272.    window
  3273.  
  3274.      R
  3275.  RAMDRIVE program
  3276.  Real-mode directories
  3277.  Release options
  3278.  Run menu
  3279.  
  3280.      S
  3281.  Saving files
  3282.  Searching and replacing
  3283.  Set Error command
  3284.  SETUP.EXE
  3285.    changing your response
  3286.    described
  3287.    file compression
  3288.    location on disks
  3289.    responding to prompts
  3290.    running
  3291.    system-configuration files
  3292.  Shortcut keys
  3293.  SMARTDRV program
  3294.  Source Browser
  3295.    commands
  3296.    defining databases
  3297.    generating information for
  3298.    PWBRMAKE.EXE
  3299.    using
  3300.  STARTUP.CMD, modifying
  3301.  System configuration
  3302.  System requirements
  3303.  
  3304.      T
  3305.  TEMP environment variable
  3306.  Text boxes
  3307.  Text selection
  3308.  TOOLS.INI
  3309.    macros saved in
  3310.    modifying
  3311.  TOOLS.PRE
  3312.  
  3313.      V
  3314.  View menu
  3315.  
  3316.      W
  3317.  Watch menu
  3318.  Windows, PWB
  3319.    components
  3320.    described
  3321.    help
  3322.      closing
  3323.      using
  3324.    QuickHelp, using
  3325.  Writing and saving procedures
  3326.  
  3327.