MLHA - PC - Programmering - Assembler - MASM 5.1

| Environment | Files | Command Line |

 

Environment

INCLUDE=   where MASM looks for include files (.INC)
=C:\MASM\INC
INIT=   where MAKE looks for TOOLS.INI
LIB=   where LINK looks for Library (.LIB) and object (.OBJ) files
=C:\MASM\LIB
LINK=   default options for LINK
=/CO
MASM=   default options for MASM
=/ZI
PATH=   set to include directory with MASM binaries
=C:\MASM\BIN;%PATH%
TMP=   where LINK places temporary files

 

En batchfil kan fx indeholde følgende:

SET LIB=C:\MASM\LIB;C:\MASM\LIB\BIN
SET INCLUDE=C:\MASM\INC
PATH C:\MASM\BIN;%PATH%

 

Files

Input:
Source files (.ASM, .INC)
Output:
Object file (.OBJ)
Listing (.LST)
Cross Reference (.CRF)

 

Command Line

MASM [options] source [,[objectfile][,[listing][,[crossref]]]][;]
options   may be placed anywhere in command line.
'/' or '-' may be used but not mixed (/V/Z or -V-Z).
space is optional.
/c Generate cross-reference
/h Help: Display Command-Line Options
/I<path> Search directory for include files
/v   Display extra source statistics
/z Display source line for each error message
/Zi Generate symbolic debug information for CodeView in .obj file
source .ASM assumed
objectfile Default: source.OBJ
listing Default: source.LST
NUL : no file, PRN : the printer
crossref Default: source.CRF - Cross-reference file in binary format
- must be converted to .REF ascii text with CREF.
NUL : no file, PRN : the printer.
; Selects defauls for file names and suppresses remaining file names.
If no semicolon is used, all commas are required.

Examples:

MASM
- prompts for file names.
- options may be added after any prompt separated from filenames with space.
- the rest of the commandline may be typed at any prompt.
Source filename [.ASM] : (required)
Object filename [source.OBJ] :
Source listing [NUL.LST] :
Cross-reference [NUL.CRF] :
MASM hello;
MASM hello,hello.obj;
MASM hello,,,;
MASM hello.asm, hello.obj, hello.lst, hello.crf
MASM hello,,list;
output: hello.obj, list.lst
MASM /ZI hello;
output: hello.obj with debug info
MASM /V /Z /ZI hello,,,;
output maximum debug info: hello.obj, hello.lst, hello.crf
MASM A:\hello;
output: hello.obj in current directory (not A:\)