Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ masm(CP) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

a.out(FP)

cc(CP)

ld(CP)


 masm(CP)                       6 January 1993                       masm(CP)


 Name

    masm - invokes the assembler

 Syntax

    masm [options] sourcefile

 Description

    masm is the Microsoft 8086/286/386 assembler.  It reads and assembles
    8086/80286/80386 assembly language instructions from sourcefile to create
    a linkable object file sourcefile.o, or an executable program a.out.  The
    extension .s for input filenames is recommended but not required.

    masm accepts the following options:

    -a        Put the assembled output segments in alphabetical order before
              copying them to the object file.

    -c        Output cross-reference data for each assembled file to
              filename.crf.

    -d        Adds a pass 1 listing to the assembly listing filename.lst.

    -Dsym[=value]
              If the optional =value is present, the symbol sym is defined to
              be value. The value should not contain blanks, commas, or semi-
              colons. If =value is not present, sym is defined as a null
              TEXTMACRO.

    -e        Generates floating point code to emulate the 8087 or 80287 co-
              processor.  Programs created with this option must be linked
              with an appropriate math library before being executed.

    -h        Lists command-line syntax and all valid assembler options.

    -Ipath    Defines the path appended to the -I flag as the search path for
              #include files.  Up to 10 #include paths are allowed in one
              invocation of masm.

    -l[listfile]
              Creates an assembly listing file with the same base name as the
              sourcefile but with a .lst extension.  If the listfile argument
              was given, the listing file is called listfile.  The file lists
              the source instructions, the assembled (binary) code for each
              instruction and any assembly errors.  If filename is ``-,'' the
              listing is written to standard output.

    -Ml       Leave case of symbols alone. This is the default behavior.

    -Mu       Disable case sensitivity: upper case is treated as being ident-
              ical to lower case.

    -Mx       Preserve lower case letters in public and external names only
              when copying these names to the object file.  For all other
              purposes, masm converts lower case to upper case.

    -n        Suppress symbol tables in the listing files.  The -l option
              must also be used for this option to take effect.

    -oobjfile Copies the assembled instructions to the file named objfile.
              This file can be linked to form an executable file only if no
              errors occurred during the assembly.  This option overrides the
              default object file name.

    -p        Check for pure code.

    -r        Do not generate floating point code to emulate 8087 or 80287
              coprocessor.

    -s        Write segments in source-code order (this is the default).

    -t        Suppress messages for successful assembly.

    -v        Prints verbose error statistics on console.  The default
              behavior is to display only error counts.

    -w[012]   Set error-display level, where:

                           0   No error messages
                           1   Serious error messages (default)
                           2   Advisory error messages


    -x-       Prevent error messages from being written to the screen.

    -X        Copies to the assembly listing all statements forming the body
              of an IF directive whose expression (or condition) evaluates to
              false.

    -Zd       Put line-number information in the object file.

    -Zi       Put symbolic and line-number information in the object file.

    -z        Display source line for each error message (default).

 Files

    /bin/masm

 Notes

    The default options are -Ml and -e which enable case sensitivity and
    allow emulation of a floating point processor.  The following options are
    flags, with default settings as indicated:

    Flag   Default   Meaning of TRUE condition

     a     FALSE     Outputs segments alphabetically
     c     FALSE     Outputs cross reference data
     d     FALSE     Adds pass 1 listing to filename.lst
     e     TRUE      Floating Point emulation
     n     TRUE      Outputs symbols if -l selected
     p     FALSE     Do not check for pure code
     r     TRUE      Real 8087 instead of emulated format
     s     TRUE      Write segments in source code order
     t     TRUE      Suppress error messages for successful assembly
     v     FALSE     Prints verbose error statistics
     X     FALSE     Toggle setting of conditional flag
     z     TRUE      Display source line for each error message


 Return value

    The masm exit codes have the following meanings:

    Code   Meaning

     0     No error
     1     Argument error
     2     Unable to open input file
     3     Unable to open listing file
     4     Unable to open object file
     5     Unable to open cross reference file
     6     Unable to open include file
     7     Assembly errors.  If fatal, the object file is deleted.
     8     Memory allocation error
     9     Real number input not allowed in this version.
     10    Unable to define symbol from command line
     11    Assembler interrupted


 See also

    a.out(FP), cc(CP), ld(CP)
    Macro Assembler User's Guide

 Standards conformance

    masm is a value-added extension of AT&T System V provided by the Santa
    Cruz Operation.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026