ASM86 Assembler Summary |
|
http://leonardo.eeug.caltech.edu/~ee5x/tools/asm86.htm |
ASM86 assembles an assembly language source file generating an output object file. Listing files and error files may also be optionally generated. ASM86 takes as input the name (including extension) of an assembly language source file and generates an output object file (default extension .OBJ), a listing file (default extension .LST), and an error file (default to the console). All three output files are optional. The object file contains the relocatable object code which is used by the linker. The listing file contains the source code along with the generated object code and diagnostic information. The error file contains all lines which generated assembly-time errors.
ASM86 input_file controls
Example: ASM86 test.asm DB M1 EP
Control | Abbrev. | Description |
EJECT | EJ | start a new page in the output listing file (ignored
if NOPAGING
or NOLIST
is active) |
GEN | GE | include all source text, all macro calls, and all macro expansions in the output listing file |
NOGEN | NOGE | include all source text and macro calls in the output listing file |
GENONLY | GO | include all source text and macro expansions, but no macro calls in the output listing file |
INCLUDE | IC | read input from (include) the specified file |
LIST | LI | include subsequent lines in the output listing file |
NOLIST | NOLI | do not include subsequent lines in the output listing file |
SAVE | SA | save the current setting of the LIST and GEN
controls |
RESTORE | RS | restore the previous setting of the LIST and GEN
controls (SAVE s
and RESTORE s
may be nested) |
TITLE | TT | specifies the title to appear on subsequent page headers in the output listing file |
Note: General controls may be included in the assembly language file on lines with a '$' in column 1.
Control | Abbrev. | Description |
DATE | DA | ignored |
DEBUG | DB | include local symbol information in output object file for debugging |
NODEBUG | NODB | do not include local symbol information in output object file |
ERRORPRINT | EP | specifies file to send only lines with errors to, if no file is specified errors are sent to the console |
NOERRORPRINT | NOEP | do not generate an error file or report them to the console |
MACRO | MR | recognize and process macros in the input file |
NOMACRO | NOMR | do not recognize or process macros in the input file (normally causes assembly errors) |
MOD186 | M1 | recognize and use the 80186 instruction set |
OBJECT | OJ | specify that an object module is to be created and, optionally, give the name of that file |
NOOBJECT | NOOJ | no object module is to be created |
PAGELENGTH | PL | specify the number of lines per page in the output listing and error files |
PAGEWIDTH | PW | specify the number of characters per line in the output listing and error files |
PAGING | PI | specifies the output listing file is to be formatted into pages, each with a header |
NOPAGING | NOPI | specifies the output listing file is not formatted into pages, there is a single header at the start |
PR | specifies that the source listing is sent to the specified output file (or input.LST if none specified) | |
NOPRINT | NOPR | no output listing file is generated |
SYMBOLS | SB | specifies a symbol table listing is to be included in the output listing file |
NOSYMBOLS | NOSB | do not include the symbol table in the output listing file |
TYPE | TY | specifies that variable and symbol type information is to be included in the output object file (used for later type checking by CREF86 and LINK86) |
NOTYPE | NOTY | do not include type information in the output object file |
WORKFILES | WF | specifies where the temporary files generated by the assembler are to be kept |
XREF | XR | include a symbol cross-reference in the output listing file |
NOXREF | NOXR | do not include the symbol cross-reference in the output listing file |
Note: Primary controls may be included in the assembly language file on lines with a '$' in column 1 which appear before any other lines (blank, comment, or assembly code).
DATE(current date) | NODEBUG | NOERRORPRINT | MACRO |
OBJECT(input.OBJ) | PAGELENGTH(60) | PAGEWIDTH(120) | PAGING |
PRINT(input.LST) | NOSYMBOLS | NOTYPE | LIST |
WORDFILES(:WORK:, :WORK:) | NOXREF | GENONLY |
ASSUME |
|
ENDS |
|
GROUP | name
GROUP segname [,segname]
|
SEGMENT | name
SEGMENT [align] [combine] ['classname']
|
END | END [ label ]
|
ENDP | name
ENDP
|
EQU | name
EQU expression
|
EVEN | EVEN
|
EXTRN | EXTRN name : type
[, name : type ]
|
LABEL | name
LABEL type
|
NAME | NAME module_name
|
ORG | ORG addr
|
PROC | name
PROC type
|
PUBLIC | PUBLIC name
[, name ]
|
PURGE | PURGE name
[, name ]
|
$ | $
|
DB | [ label ]
DB initial_values
|
DW | [ label ]
DW initial_values
|
DD | [ label ]
DD initial_values
|
DQ | [ label ]
DQ initial_values
|
DT | [ label ]
DT initial_values
|
DUP | repeat_count
DUP ( value )
|
? | ?
|
RECORD | name
RECORD fieldname:size [,fieldname:size]
|
STRUC | name
STRUC
|
ENDS | name
ENDS
|
Operators may be used on constants or addresses to form expressions which can be used in the above directives. Note: these operators are for compile-time calculations, not run-time calculations. The list is arranged in order of precedence with operators between sections being of equal precedence (and evaluated left to right).
Operator | # Operands | Description |
---|---|---|
() <> [] . LENGTH SIZE WIDTH MASK |
1 n 1 1 1 1 1 1 |
parenthesized expression list of intial values for STRUC or RECORD memory addressing structure element or offset number of data units allocated to a variable number of data bytes allocated to a variable number of bits in a RECORD or RECORD
fieldbit mask for a RECORD
field |
PTR TYPE THIS SEG OFFSET |
1 1 1 1 1 |
syntax: type PTR ,
defines operand to point to typea value indicating the type of the operand the value of the current location segment number of operand's address offset within the segment of operand's address |
HIGH LOW |
1 1 |
high byte of its operand low byte of its operand |
* / MOD SHL SHR |
2 2 2 2 2 |
multiplication division remainder from division logical shift left logical shift right |
+ - |
1 1 |
positive sign (no effect) negation |
+ - |
2 2 |
addition subtraction |
EQ NE LT LE GT GE |
2 2 2 2 2 2 |
equal (result is -1 for true, 0 for false) not equal (result is -1 for true, 0 for false) less than (result is -1 for true, 0 for false) less than or equal (-1 for true, 0 for false) greater than (result is -1 for true, 0 for false) greater than or equal (-1 for true, 0 for false) |
NOT | 1 | logical negation (NOT) |
AND | 2 | logical conjuction (AND) |
OR XOR |
2 2 |
logical inclusive injuction (inclusive-OR) logical exclusive injuction (exclusive-OR) |
SHORT | 1 | label in a JMP instruction is within 127 bytes |
Name | Value (from TYPE) |
Description |
---|---|---|
BYTE | 1 | a byte |
WORD | 2 | a word (two bytes) |
DWORD | 4 | a double word (four bytes) |
QWORD | 8 | a quad word (eight bytes) |
TBYTE | 10 | a ten byte (floating point or BCD) value |
NEAR | 255 | an offset within the same segment |
FAR | 254 | an address consisting of segment and offset |
%EXIT | %EXIT
|
%IF | %IF ( expression )
THEN ( code1 ) ELSE ( code2 )
FI
|
%REPEAT | %REPEAT ( expression )
( code )
|
%WHILE | %WHILE ( expression )
( code )
|
%*DEFINE | %*DEFINE( macro_name )
( macro definition )
|
%*DEFINE | %*DEFINE( macro_name ( parameters ))
( definition )
|
%*DEFINE | %*DEFINE( macro_name )
LOCAL labels ( definition )
|
%' | %'comment'
|
%n | %n text
|
%() | %( text )
|
%METACHAR | %METACHAR( char )
|
%SET | %SET( symbol ,
expression )
|
%EQS | %EQS( string1 ,
string2 )
|
%EVAL | %EVAL( expression )
|
%GES | %GES( string1 ,
string2 )
|
%GTS | %GTS( string1 ,
string2 )
|
%LES | %LES( string1 ,
string2 )
|
%LTS | %LTS( string1 ,
string2 )
|
%NES | %NES( string1 ,
string2 )
|
%CI | %CI
|
%CO | %CO( char )
|
%IN | %IN
|
%LEN | %LEN( text )
|
%MATCH | %MATCH( ident1
delim ident2 )
( text )
|
%OUT | %OUT( text )
|
%SUBSTR | %SUBSTR( text ,
expression1 , expression2 )
|
copyright © 1997, Glen George. All rights reserved. Reproduction of all or part of this work is permitted for educational or research use only, provided that this copyright notice is included in any copy.