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

  1.  Microsoft  Macro Assembler - White Paper
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  ────────────────────────────────────────────────────────────────────────────
  11.                  Microsoft (R) Macro Assembler - White Paper
  12.  
  13.                                  Version 6.0
  14.  ────────────────────────────────────────────────────────────────────────────
  15.  
  16.  
  17.                For MS (R) OS/2 and MS-DOS (R) Operating Systems
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  Microsoft Corporation
  27.  
  28.  This technical overview is for informational purposes
  29.  only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.
  30.  
  31.  (C) Copyright Microsoft Corporation, 1991.
  32.  All rights reserved.
  33.  Printed in the United States of America.
  34.  
  35.  Microsoft, the Microsoft logo, MS, MS-DOS, and CodeView
  36.  are registered trademarks and Making it all make sense and
  37.  Windows are trademarks of Microsoft Corporation.
  38.  
  39.  U.S. Patent No. 4,955,066
  40.  
  41.  i486 is a trademark of Intel Corporation.
  42.  
  43.  IBM is a registered trademark of International Business
  44.  Machines Corporation.
  45.  
  46.  
  47.  
  48.  
  49.  Table of Contents
  50.  ────────────────────────────────────────────────────────────────────────────
  51.  
  52.  
  53.  
  54.  Product Overview
  55.  
  56.       Revolutionary New Assembler
  57.       Programmer's WorkBench
  58.       Integrated Documentation
  59.  
  60.  The MASM 6.0 Assembler
  61.  
  62.       Faster Assembly
  63.       Built-In Jump Extensions and Optimizations
  64.       Convenient Format for Procedures and Procedure Prototypes
  65.       Automatic Conversion of C Header Files to MASM Include Files
  66.       New Data Types
  67.       Enhanced Macro Capabilities
  68.       Easy-To-Use Decision and Loop Constructs
  69.       Expanded DOS and OS/2 Support
  70.       New 80486 and FLAT Model Support
  71.       Improved Support for Multiple-Module Programming
  72.       Complete BNF Language Definition
  73.  
  74.  Programmer's WorkBench
  75.  
  76.       Full-Featured Editor
  77.       Enhanced CodeView(R) Debugger
  78.       Powerful Source Browser
  79.       Information-Packed Online Reference System
  80.  
  81.  Integrated Documentation
  82.  
  83.       Microsoft Advisor Online Reference System
  84.       Installing and Using the Professional Development System
  85.       Microsoft Macro Assembler Programmer's Guide
  86.       Microsoft Macro Assembler Reference
  87.  
  88.  Conclusion
  89.  
  90.  
  91.  System Requirements
  92.  
  93.  
  94.  
  95.  
  96.  Product Overview
  97.  ────────────────────────────────────────────────────────────────────────────
  98.  
  99.  The Microsoft Macro Assembler has long been the industry standard for fast
  100.  and efficient assemblers. Writing assembly-language code, however, has been
  101.  slow and tedious work. The new features of the Microsoft Macro Assembler
  102.  version 6.0 Professional Development System (hereafter referred to as MASM
  103.  6.0) make it easy for you to be fast and efficient when you program. For the
  104.  first time, you get the convenience of high-level language coding as well as
  105.  the 50 to 300% performance boost that assembly language provides over
  106.  high-level language routines.
  107.  
  108.  Why? Because MASM 6.0 is not an evolutionary product that adds a few new
  109.  features. Instead it is a revolutionary new version of MASM that reduces
  110.  your coding time, simplifies code maintenance, and delivers exceptional
  111.  performance.
  112.  
  113.  
  114.  Revolutionary New Assembler
  115.  
  116.  Further details on these and other time-saving new features begin on page 5.
  117.  
  118.  
  119.  MASM 6.0 boosts your productivity by handling numerous repetitive
  120.  programming tasks for you, making other tasks easier, and providing many new
  121.  capabilities. For example, MASM 6.0
  122.  
  123.  
  124.    ■   Increases assembly speed, eliminates phase errors and unnecessary NOP
  125.        statements, and generates optimal code for jumps by using n-pass
  126.        assembly technology
  127.  
  128.    ■   Checks argument types and automatically generates the code to push
  129.        arguments when you use PROTO to define a procedure prototype and
  130.        INVOKE to call the procedure
  131.  
  132.    ■   Simplifies external symbol declaration and include-file development
  133.  
  134.    ■   Allows macro functions, macros with variable numbers of arguments, and
  135.        other powerful new macro capabilities
  136.  
  137.    ■   Increases the functionality of structures and types by allowing nested
  138.        structures, pointer types, and unions
  139.  
  140.    ■   Converts your C-language header files to MASM include files with the
  141.        H2INC utility
  142.  
  143.    ■   Introduces intuitive language constructs─.IF, .WHILE, and .REPEAT─that
  144.        automatically generate optimized instructions for run-time decisions
  145.        and loops
  146.  
  147.    ■   Generates DOS* or OS/2= module-initialization code automatically
  148.  
  149.    ■   Provides new extensions to simplified segment directives that make it
  150.        easier to set up complicated segment models
  151.  
  152.    ■   Implements the 80486 instruction set and supports flat model for
  153.        32-bit operating systems
  154.  
  155.    ■   Supports tiny memory model so you can produce .COM executable files
  156.  
  157.    ■   Automates assembling and linking with a one-step build process
  158.  
  159.    ■   Allows Windows programs to relocate code segments, since you can use
  160.        the new LROFFSET operator to generate a loader-resolved offset
  161.  
  162.    ■   Includes the Microsoft Advisor with online help for MASM and utilities
  163.  
  164.  
  165.     * DOS refers to the MS-DOS(R) and PC DOS operating systems.  = Herein
  166.  OS/2 refers to the operating system jointly developed by Microsoft and IBM.
  167.  
  168.  
  169.  
  170.  Programmer's WorkBench
  171.  
  172.  The Programmer's WorkBench (PWB) is a complete, self-contained development
  173.  environment. With PWB, you can write, edit, get help on, build, debug, and
  174.  execute your programs without ever leaving the environment. PWB provides
  175.  access to all your Microsoft utilities and compilers such as Microsoft C
  176.  version 6.0, Basic version 7.1, and COBOL version 4.0. See Figure 1.
  177.  
  178.  (This figure may be found in the printed book.)
  179.  
  180.  PWB includes the Source Browser for navigating through your program's code
  181.  and data structures. The powerful keyboard or mouse-driven editor has
  182.  extensive macro capabilities. And the Microsoft Advisor provides online
  183.  help. See page 11 for more about PWB.
  184.  
  185.  The Microsoft CodeView(R) window-oriented debugger, also accessible from
  186.  within PWB, can debug larger programs than before. You can also view several
  187.  source-code and memory locations simultaneously.
  188.  
  189.  
  190.  Integrated Documentation
  191.  
  192.  MASM 6.0 includes three manuals and online help.
  193.  
  194.  MASM 6.0 provides both online and printed documentation. The Microsoft
  195.  Advisor, the online reference system, contains information on how to use
  196.  MASM 6.0, PWB, CodeView, LINK, NMAKE, the editor, and all other utilities.
  197.  
  198.  For a quick start on using MASM 6.0 and PWB, read Installing and Using the
  199.  Microsoft Professional Development System. This manual shows how to install
  200.  the assembler, manage multiple-module projects with PWB, and access online
  201.  help.
  202.  
  203.  The documentation also includes a revised Programmer's Guide. This manual
  204.  illustrates all the new language features of MASM 6.0 and explains the
  205.  advanced features of CodeView, PWB, and other MASM 6.0 utilities.
  206.  
  207.  The Microsoft Macro Assembler Reference provides quick access to syntax and
  208.  command-line options for the assembler and utilities. See page 14 for more
  209.  information about MASM 6.0 documentation.
  210.  
  211.  
  212.  
  213.  The MASM 6.0 Assembler
  214.  ────────────────────────────────────────────────────────────────────────────
  215.  
  216.  The MASM 6.0 assembler increases your productivity in several ways. The
  217.  highlevel-language interface for procedures simplifies multiple-module,
  218.  mixed-language, and OS/2 programming. Macros are more straightforward to
  219.  write and maintain. Code-generating directives shorten programming time. And
  220.  new options maximize compatibility with MASM 5.1.
  221.  
  222.  MASM 6.0's new features are designed to be as intuitive as
  223.  high-level-language statements. With MASM 6.0, your code will be noticeably
  224.  easier to write, read, and maintain.
  225.  
  226.  
  227.  Faster Assembly
  228.  
  229.  More efficient assembling means greatly improved performance.
  230.  
  231.  MASM 6.0 eliminates phase errors and assembler-generated NOP statements by
  232.  using n-pass assembly and highly efficient memory-management techniques.
  233.  With n-pass assembly, the first pass is similar to that of traditional
  234.  assemblers. During this pass, however, MASM 6.0 keeps enough information on
  235.  each instruction so that, should any instruction change size on subsequent
  236.  passes, the assembler can make appropriate adjustments. Because this
  237.  algorithm allows instructions to shrink or grow, MASM 6.0 never generates
  238.  NOP statements or phase errors.
  239.  
  240.  MASM 6.0 continues passing over internal representations of code until every
  241.  instruction is of optimal length. As a result, it generates optimized code
  242.  for all instructions, including jumps. And because it references the source
  243.  files only once, it assembles two to three times faster than MASM 5.1.
  244.  
  245.  
  246.  Built-In Jump Extensions and Optimizations
  247.  
  248.  MASM 6.0 generates optimal encodings.
  249.  
  250.  Built-in "smart" jump extensions and optimizations simplify your
  251.  programming. You do not have to specify a distance operator to take
  252.  advantage of automatic optimization for unconditional jumps. The assembler
  253.  automatically determines the smallest encoding possible for the direct
  254.  unconditional jump. Additionally, MASM 6.0 optimizes far calls when the
  255.  destination is in the current segment by pushing the CS register and
  256.  generating a NEAR call. This is functionally equivalent, but is faster and
  257.  one byte smaller.
  258.  
  259.  MASM 6.0 also lengthens conditional jumps automatically. If the conditional
  260.  jump specifies or implicitly requires a distance other than SHORT, MASM
  261.  automatically generates the necessary comparison and unconditional jump to
  262.  the destination. You can control these optimizations with the OPTION
  263.  directive and with menu or command-line options.
  264.  
  265.  For example, the destination for this jump is more than 128 bytes away:
  266.  
  267.    mov     ax, cx
  268.            jz      skip
  269.            .
  270.            .            ; (More than 128 bytes of code here)
  271.            .
  272.    skip:
  273.  
  274.  Note the unconditional jump in the assembler-generated code:
  275.  
  276.    mov     ax, cx
  277.            jnz     temp$1
  278.            jmp     skip
  279.    temp$1:
  280.            .
  281.            .            ; (More than 128 bytes of code here)
  282.            .
  283.    skip:
  284.  
  285.  The listing file shows the generated instructions and the resulting warning
  286.  message:
  287.  
  288.    002C  8B C1             mov       ax, cx
  289.     002E  75 03 E9 00C0     jz        skip
  290.    jumptest.asm(63): warning A6003: conditional jump lengthened
  291.  
  292.  
  293.  Convenient Format for Procedures and Procedure Prototypes
  294.  
  295.  The new INVOKE and PROTO directives create a high-level interface for
  296.  procedures to simplify your MASM, OS/2, mixed-language, and Microsoft
  297.  Windows(tm) graphicalenvironment programming. The PROTO directive defines
  298.  procedure prototypes. Like C-language function prototypes, MASM prototypes
  299.  inform the assembler of types and numbers of arguments so the assembler can
  300.  check for errors in the procedure call. The INVOKE directive calls the
  301.  procedure, converting arguments to the expected type and pushing parameters
  302.  according to the correct calling conventions. The VARARG keyword allows a
  303.  variable number of arguments to be passed to the procedure (see Figure 2).
  304.  
  305.  (This figure may be found in the printed book.)
  306.  
  307.  In addition to the new directives for procedure prototypes and procedure
  308.  calls, MASM 6.0 provides new support for the customizing of setup and
  309.  teardown for procedure stack frames. You can write procedure prologue and
  310.  epilogue code for Windows programs or for other special calling conventions,
  311.  and call them repeatedly─as easily as you can call a macro.
  312.  
  313.  
  314.  Automatic Conversion of C Header Files to MASM Include Files
  315.  
  316.  H2INC helps port a program prototyped in C to MASM.
  317.  
  318.  The H2INC utility translates C header files into MASM-compatible include
  319.  files. Now you can more easily write programs that mix C code and MASM code
  320.  with global data structures. H2INC translates data declarations, function
  321.  prototypes, and simple #define directives, but not C statements that compile
  322.  into data or executable code.
  323.  
  324.  This example shows several C declarations and the MASM code that H2INC
  325.  produces:
  326.  
  327.  C Code                         H2INC Translation
  328.  ────────────────────────────────────────────────────────────────────────────
  329.  #define CORNERS 4              CORNERS EQU 4t
  330.  
  331.  int my_var;                    EXTERNDEF C my_var:SWORD
  332.  
  333.  struct tagName {               tagName  STRUCT 2t
  334.       int i;                    i                 SWORD   ?
  335.       };                        tagName  ENDS
  336.  
  337.  long pascal my_func3 (int x);  @proto_0 TYPEDEF PROTO PASCAL :SWORD
  338.                                 my_func3 PROTO @proto_0
  339.  
  340.  
  341.  Because MASM supports many new high-level data types, data-type information
  342.  is not lost when you translate C data to MASM, as the next section explains.
  343.  
  344.  
  345.  
  346.  New Data Types
  347.  
  348.  New MASM data types  resemble those in high-level languages.
  349.  
  350.  Now you can use high-level data types in assembly language. Types and
  351.  pointers can be defined with TYPEDEF in the same way they can be defined in
  352.  C. In addition, the CodeView debugger recognizes all MASM 6.0 data types, as
  353.  well as pointers and the type of data they point to.
  354.  
  355.  MASM 6.0 also supports signed types defined with SBYTE, SWORD, and SDWORD;
  356.  floating-point data types defined with REAL4, REAL8, and REAL10; and
  357.  binary-coded decimals defined with TBYTE. CodeView displays values of type
  358.  REAL4, REAL8, and REAL10 as floating-point numbers, not hexadecimal fields.
  359.  
  360.  
  361.  Enhanced syntax for defining and using structures, and implementing nested
  362.  structures and unions, mean these types closely mirror their C counterparts.
  363.  
  364.  
  365.  
  366.  Enhanced Macro Capabilities
  367.  
  368.  Macros are more straightforward to write and maintain.
  369.  
  370.  The new directives in MASM 6.0 make complex macros cleaner and easier to
  371.  write by accommodating variable numbers of arguments, macro functions,
  372.  definitions of text equates, and loop constructs:
  373.  
  374.  
  375.    ■   Variable, required, and default arguments. MASM 5.1 ignores extra
  376.        arguments passed to macros. MASM 6.0 provides the VARARG keyword for
  377.        simplifying macro calls by allowing a macro to process any number of
  378.        arguments. Specifying required or default arguments allows better
  379.        error checking.
  380.  
  381.    ■   Macro functions. At assembly time, macro functions can return a text
  382.        value using EXITM. Predefined macro string functions can concatenate
  383.        strings, return the size of a string, find a substring in a string, or
  384.        return the position of a substring within a string.
  385.  
  386.    ■   Text equates. The TEXTEQU directive for defining text macros allows
  387.        greater functionality and consistency than EQU provides. For example,
  388.        TEXTEQU can assign the value returned by a macro function to a text
  389.        equate.
  390.  
  391.    ■   Directives for loops in macros. Now there are more ways to implement
  392.        loops inside macros. Within a macro definition, WHILE repeats assembly
  393.        as long as a condition remains true. Other macro loop directives─FOR,
  394.        FORC, and REPEAT─also generate loops in macros.
  395.  
  396.  
  397.  This macro function takes one required argument and accepts a variable
  398.  number of arguments:
  399.  
  400.    @ArgI MACRO index:REQ, arglist:VARARG
  401.        LOCAL count, retstr
  402.        count = 0
  403.        FOR arg, <arglist>
  404.            count = count + 1
  405.            IF count EQ index
  406.                retstr TEXTEQU <arg>
  407.            ENDIF
  408.        ENDM
  409.        EXITM retstr
  410.    ENDM
  411.  
  412.  
  413.  Easy-To-Use Decision and Loop Constructs
  414.  
  415.  Code-generating directives shorten programming time.
  416.  
  417.  The high-level control structures new to MASM 6.0─.IF, .WHILE, and .REPEAT─
  418.  automatically generate MASM loop and compare instructions. These new
  419.  directives are similar to the if, while, and repeat statements of C or
  420.  Pascal. They make your assembly modules easy to code, read, and maintain.
  421.  You can also use the new .BREAK and .CONTINUE directives to interrupt loop
  422.  execution. See Figure 3.
  423.  
  424.  (This figure may be found in the printed book.)
  425.  
  426.  In the listing file, asterisks mark the automatically generated code:
  427.  
  428.    0017  B9 000A          mov    cx, 10
  429.                            .REPEAT
  430.     001A           *@C0001:
  431.     001A  B4 08            mov    ah, 08h
  432.     001C  CD 21            int    21h
  433.                            .BREAK .IF al == 13
  434.     001E  3C 0D    *       cmp    al, 00Dh
  435.     0020  74 10    *       je     @C0003
  436.                            .CONTINUE .IF (al < '0') || (al > '9')
  437.     0022  3C 30    *       cmp    al, '0'
  438.     0024  72 0A    *       jb     @C0002
  439.     0026  3C 39    *       cmp    al, '9'
  440.     0028  77 06    *       ja     @C0002
  441.  
  442.     002A  8A D0            mov     dl, al
  443.     002C  B4 02            mov     ah, 02h
  444.     002E  CD 21            int     21h
  445.                            .UNTILCXZ
  446.     0030           *@C0002:
  447.     0030  E2 E8    *        loop   @C0001
  448.     0032           *@C0003:
  449.  
  450.  
  451.  Expanded DOS and OS/2 Support
  452.  
  453.  You no longer have  to write repetitive module-initialization code.
  454.  
  455.  The new .STARTUP and .EXIT directives eliminate the need to write repetitive
  456.  module-initialization and exit code for DOS and OS/2 modules. If you specify
  457.  OS_DOS or OS_OS2 as your target operating system in the .MODEL statement,
  458.  the assembler automatically generates the appropriate code.
  459.  
  460.  Also new to MASM 6.0 is tiny-model support for producing .COM executables
  461.  under DOS. And for Windows programming, the LROFFSET operator generates a
  462.  loaderresolved offset to allow Windows to relocate code segments.
  463.  
  464.  
  465.  New 80486 and FLAT Model Support
  466.  
  467.  You can design code for the next generation of systems today.
  468.  
  469.  MASM 6.0 supports all the new i486 instructions. And for 32-bit operating
  470.  systems, the assembler provides flat memory model. Flat model provides four
  471.  gigabytes of linear addressing space, eliminating the need for segmentation
  472.  considerations when programming for 386-compatible operating systems.
  473.  
  474.  
  475.  Improved Support for Multiple-Module Programming
  476.  
  477.  One directive replaces PUBLIC and EXTRN.
  478.  
  479.  MASM 6.0 simplifies external declarations for shared data and procedures in
  480.  multiple-module and mixed-language programs. The new EXTERNDEF directive
  481.  declares procedures and symbols as both public and external. EXTERNDEF makes
  482.  it easy to maintain global definitions in include files shared by all source
  483.  modules within a project.
  484.  
  485.  
  486.  Complete BNF Language Definition
  487.  
  488.  The BNF clearly  defines MASM syntax.
  489.  
  490.  MASM 6.0 includes a complete language grammar in an augmented BNF format.
  491.  BNF stands for Backus-Naur Form, a standard format for language grammars.
  492.  You can use the BNF to determine the exact syntax for any language
  493.  component. The BNF grammar clearly defines recursive definitions and shows
  494.  all the available options for each language element.
  495.  
  496.  An excerpt from the grammar:
  497.  
  498. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  499.  ────────────────────────────────────────────────────────────────────────────
  500.  procDir                           procId PROC « pOptions » « <
  501.                                    macroArgList > »
  502.                                    « usesRegs » « procParmList »
  503.  
  504.  procId                            id
  505.  
  506.  ────────────────────────────────────────────────────────────────────────────
  507. 
  508.  id                                alpha
  509.                                    | id alpha
  510.                                    | id decdigit
  511.  
  512.  pOptions                          « distance » « langType » « oVisibility
  513.                                    »
  514.  
  515.  distance                          nearfar
  516.                                    | NEAR16 | NEAR32 | FAR16 | FAR32
  517.  
  518.  langType                          C | PASCAL | FORTRAN | BASIC
  519.                                    | SYSCALL | STDCALL
  520.  
  521.  oVisibility                       PUBLIC | PRIVATE | EXPORT
  522.  
  523.  macroArgList                      macroArg
  524.                                    | macroArgList , macroArg
  525.  
  526.  macroArg                          % constExpr
  527.  ────────────────────────────────────────────────────────────────────────────
  528. macroArg                          % constExpr
  529.                                    | % textMacroId
  530.                                    | % macroFuncId ( macroArgList )
  531.                                    | string
  532.                                    | arbitraryText
  533.                                    | < arbitraryText >
  534.  
  535.  usesRegs                          USES regList
  536.  
  537.  regList                           register
  538.                                    | regList register
  539.  
  540.  procParmList                      « « , « ;; » » parmList »
  541.                                    « « , « ;; » » parmId :VARARG»
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  Programmer's WorkBench
  548.  ────────────────────────────────────────────────────────────────────────────
  549.  
  550.  Now you can write, edit, build, debug, and run programs in one environment.
  551.  
  552.  
  553.  The PWB environment provides an intuitive interface and easy access to the
  554.  assembler, to your MASM 6.0 files, to utilities, to other Microsoft
  555.  compilers, and to online reference documentation. You can switch from
  556.  editing to debugging to looking up statement syntax by selecting a menu or
  557.  dialog-box item.
  558.  
  559.  With PWB 1.1, you select the main source language of your project from
  560.  languages you have installed under PWB. The main language you choose
  561.  determines the build options available. PWB then simplifies program
  562.  assembling and building by providing background assembly (under OS/2),
  563.  automatic makefile generation, and automatic dependency checking.
  564.  
  565.  Predefined defaults for build options include DOS executable files, Windows
  566.  applications, OS/2 Presentation Manager applications, and OS/2 dynamic-link
  567.  libraries (DLLs).
  568.  
  569.  Figure 4 shows how easily you can set MASM assembler options from within
  570.  PWB. Notice that you can select target options instead of typing a series of
  571.  command-line options.
  572.  
  573.  (This figure may be found in the printed book.)
  574.  
  575.  PWB minimizes editing and debugging time, as well as build time, by
  576.  incorporating an editor, debugger, source browser, and online reference
  577.  system.
  578.  
  579.  
  580.  Full-Featured Editor
  581.  
  582.  The PWB Editor is a full-featured programmer's editor with all the
  583.  capabilities that professionals expect:
  584.  
  585.  
  586.    ■   Multiple windows
  587.  
  588.    ■   Mouse and keyboard support
  589.  
  590.    ■   Fast file navigation and bookmarks
  591.  
  592.    ■   Convenient and powerful search capability
  593.  
  594.    ■   Multiple levels of Undo/Redo
  595.  
  596.    ■   Flexible configuration options
  597.  
  598.    ■   Recordable macros
  599.  
  600.  
  601.  You can select any of these editor functions from menus or with key
  602.  combinations. The Microsoft Advisor provides instructions for using the
  603.  editor.
  604.  
  605.  
  606.  Enhanced CodeView(R) Debugger
  607.  
  608.  In addition to its improved user interface, the CodeView debugger gives you
  609.  a dynamic record and replay feature for recreating debugging sessions. It
  610.  reduces debugging effort by providing complete access to pointers, arrays,
  611.  structures, and coprocessor status.
  612.  
  613.  CodeView adds other key improvements:
  614.  
  615.  
  616.    ■   Multiple source and memory windows
  617.  
  618.    ■   Improved debugging for DLLs and multithread programs
  619.  
  620.    ■   New capability for debugging .COM files under DOS
  621.  
  622.    ■   No restrictions on sizes of DOS programs for debugging under CodeView
  623.  
  624.  
  625.  A system with an 80286 or 80386 processor and at least 384K of extended
  626.  memory can now run CodeView in extended memory, using less than 12K of
  627.  conventional memory. CodeView also supports the LIM 4.0 Expanded Memory
  628.  Specification (EMS) and can use Virtual Control Program Interface (VCPI)
  629.  memory if it's available. VCPI is an applications programming interface
  630.  (API) provided by various drivers, including HIMEM.SYS, which is included
  631.  with MASM 6.0.
  632.  
  633.  
  634.  Powerful Source Browser
  635.  
  636.  MASM 6.0 includes the Source Browser made popular with the Microsoft C 6.0,
  637.  Basic 7.1, and COBOL 4.0 compilers. You can use the Browser to find any
  638.  symbol definition, find all references to that symbol, and see where
  639.  variables are used or from where functions are called. See Figure 5.
  640.  
  641.  (This figure may be found in the printed book.)
  642.  
  643.  With the Browser's View Relationship menu option, you can easily determine
  644.  information about a module such as which module calls it and what data it
  645.  uses.
  646.  
  647.  The Source Browser provides far more information about your program than the
  648.  CREF utility (available with previous versions of MASM) provides. And, as
  649.  you browse through the structure of your code, the Source Browser creates a
  650.  browse history. At the end of the process, you can see where you have been.
  651.  
  652.  
  653.  
  654.  Information-Packed Online Reference System
  655.  
  656.  All online help can be accessed from one location.
  657.  
  658.  The productivity benefits of detailed online documentation are now available
  659.  to MASM 6.0 users. In addition to extensive indexes and cross-references,
  660.  the Microsoft Advisor online reference system provides hypertext links
  661.  between related concepts. It includes information on all phases of project
  662.  development, from editing to using the OS/2 programming interface. The
  663.  Advisor is available either through PWB or from the command line with
  664.  QuickHelp.
  665.  
  666.  The Microsoft Advisor includes
  667.  
  668.  
  669.    ■   Information on using PWB's integrated development environment
  670.  
  671.    ■   Explanations of PWB dialog boxes and menu choices
  672.  
  673.    ■   How-to and quick-reference information for all installed languages and
  674.        utilities (see Figure 6)
  675.  
  676.    ■   Complete explanations of error messages for all utilities
  677.  
  678.  
  679.  (This figure may be found in the printed book.)
  680.  
  681.  The next section describes the online information available for the
  682.  assembler.
  683.  
  684.  You can add your own information to the online database using the HELPMAKE
  685.  utility included in MASM 6.0. Similarly, vendors who develop tools for
  686.  Microsoft language products can add the documentation for those tools to the
  687.  Advisor.
  688.  
  689.  
  690.  
  691.  Integrated Documentation
  692.  ────────────────────────────────────────────────────────────────────────────
  693.  
  694.  The MASM 6.0 documentation provides comprehensive information to get you
  695.  started, how-to information on all the tools, examples of the new language
  696.  features, and topical information for advanced users. The documentation set
  697.  includes three manuals and the online reference system, the Microsoft
  698.  Advisor.
  699.  
  700.  
  701.  Microsoft Advisor Online Reference System
  702.  
  703.  You can access the Microsoft Advisor from the PWB environment or from
  704.  QuickHelp using the command line. Figure 7 shows the Advisor table of
  705.  contents screen. In addition to the features listed on page 13, the Advisor
  706.  includes MASM-specific information such as
  707.  
  708.  
  709.    ■   Syntax and timing information for all instructions
  710.  
  711.    ■   Complete documentation for DOS and BIOS function calls
  712.  
  713.    ■   Sample code you can insert into your programs
  714.  
  715.    ■   Help on all error messages
  716.  
  717.  
  718.  Help is context-sensitive─you can look up any item by placing the cursor on
  719.  the word and pressing the F1 key or clicking a mouse button.
  720.  
  721.  (This figure may be found in the printed book.)
  722.  
  723.  
  724.  Installing and Using the Professional Development System
  725.  
  726.  Read Installing and Using the Professional Development System to get started
  727.  using MASM 6.0. This short book includes information on installing the
  728.  Professional Development System, configuring your system, using PWB and the
  729.  CodeView debugger, building multiple-module programs, and navigating through
  730.  the Advisor.
  731.  
  732.  
  733.  Microsoft Macro Assembler Programmer's Guide
  734.  
  735.  The Programmer's Guide is a complete guide to new MASM features.
  736.  
  737.  The Programmer's Guide provides the information you need to write
  738.  assemblylanguage programs for this new assembler. New language features are
  739.  discussed throughout the Programmer's Guide rather than in a separate update
  740.  manual.
  741.  
  742.  The Programmer's Guide shows how to use NMAKE, HELPMAKE, CodeView, and
  743.  H2INC. It also explains how to customize the PWB editor, develop OS/2 and
  744.  dual-mode applications, create dynamic-link libraries, write memory-resident
  745.  (TSR) software, and create mixed-language programs.
  746.  
  747.  Appendix A explains how to update MASM 5.1 code. Other appendixes cover the
  748.  BNF grammar, assembly listings, reserved words, error messages, and default
  749.  segment names. The glossary defines language and utility terminology.
  750.  
  751.  
  752.  Microsoft Macro Assembler Reference
  753.  
  754.  The popular Microsoft Macro Assembler Reference again furnishes complete
  755.  information on all MASM instructions (including those for the i486
  756.  processor) with syntax, timings, and encoding information. It also includes
  757.  a quick reference for directives, operators, predefined symbols, keycodes,
  758.  and command-line syntax for the assembler and all utilities. Figure 8 shows
  759.  an excerpt from the Reference containing information on BSF/BSR
  760.  instructions.
  761.  
  762.  (This figure may be found in the printed book.)
  763.  
  764.  
  765.  
  766.  Conclusion
  767.  ────────────────────────────────────────────────────────────────────────────
  768.  
  769.  MASM 6.0 can revolutionize your approach to assembly-language programming.
  770.  Never before has there been an assembler that decreases your programming
  771.  time and effort so significantly while enhancing your productivity and
  772.  providing faster assembly.
  773.  
  774.  Simplified programming means greater productivity.
  775.  
  776.  This new assembler simplifies assembly-language programming─from declaring
  777.  external symbols, writing procedure calls, and developing multilanguage
  778.  programs to coding macros, loops, and decision constructs.
  779.  
  780.  MASM 6.0 sets new standards in virtually every area important to the
  781.  professional developer who needs to write, debug, and maintain assembly
  782.  routines or modules. The full-featured editor, debugger, and source browser
  783.  of this multilanguage development system can significantly increase your
  784.  productivity.
  785.  
  786.  The improvements in speed and capability over previous versions of MASM are
  787.  substantial. The clear advantage in ease of use and increased productivity
  788.  makes MASM 6.0 the obvious choice for your assembly-language projects.
  789.  
  790.  
  791.  
  792.  System Requirements
  793.  ────────────────────────────────────────────────────────────────────────────
  794.  
  795.  Microsoft Macro Assembler version 6.0 requires the following configuration:
  796.  
  797.  
  798.  
  799.    ■   A personal computer running DOS version 3.0 or later or OS/2 version
  800.        1.1 or later.
  801.  
  802.    ■   640K (kilobytes) of available memory (RAM) for operating under DOS (1
  803.        megabyte of RAM is recommended).
  804.  
  805.    ■   3 megabytes of RAM for operating under OS/2 (4 megabytes are
  806.        recommended).
  807.  
  808.    ■   At least 384K of extended memory to debug large DOS programs.
  809.  
  810.    ■   One hard-disk drive with at least 4 megabytes of free space.
  811.        Installation of all files provided with MASM 6.0 requires
  812.        approximately 6.2 megabytes of disk space. The setup program checks to
  813.        see if there is enough space available, and also prompts you to decide
  814.        whether or not to install online help and sample code.
  815.  
  816.    ■   One floppy-disk drive. For OS/2, either a 1.2 megabyte, 5.25-inch
  817.        drive or a 720K, 3.5-inch drive. For DOS, either a 1.2 megabyte,
  818.        5.25-inch drive; a 360K, 5.25-inch drive; or a 720K, 3.5-inch drive.
  819.        (1.2 megabyte disks and 720K floppy disks are shipped in separate
  820.        boxes. 360K floppy disks are available on request.)
  821.  
  822.