[j]) DIGITAL RESEARCH

[j]) DIGITAL RESEARCH
Multiuser/Multitasking Operating System
PROGRAMMERS UTILITIES GUIDE
[j]) DIGITAL
[email protected]
PROGRAMMER'S UTILITIES GUIDE
FOR CONCURRENT™ DOS 86 EXPANDED MEMORY (XM)
First Edition November 1986
1065-2043-001
COPYRIGHT
COPYflght
be
any
© 1986
Dlgllal Research
Ali flghls reserved
No pari of Ihls publica lIOn m
reproduced. fransrnllteu. transcribed, stored In a retrieval system, or translated in
language
or
computer
language,
mechanical, magnetic. optical, chemical
In
any
form
or
by
any
means,
electron
manual, or otherWise, wllhout the prior wrltt
permiSSion of Digital Research, 60 Garden COll't, Bo' DR I, Monte'ey, Caldornla 93942
DISCLAIMER
DIGITAL RESEARCH MAKES NO REPRESENTATIONS OR WARRANTIES WITH RESPECT T
THE CONTENTS HEREOF AND SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES (
MERCHANTABILITY OR FITNESS FOR ANY P,\RTICULAR PURPOSE
Further, Digit
Research Inc reserves Ihe flghl 10 reVise Ihl> publicallon and to make changes fro
time to time in the con lent hereof wllhout obllgallon of Digital Research Inc to noti
any person of such reVISton or chanues
NOTICE TO USER
This manual should nOI be conslruerl as any representalion vr warranty with respecl t
the sotlware named herein
Occasionally changes or variations exist in the soflwar
thai are not reflecled in the mdnual
Genc,aliy, if such changes or variations ar
known to eXist and 10 affeci Ihe product sign,f'canlly, a release nole or README DO
file accompanies the manual and distflbullon dlSHsl
In Ihal event. be sure to read th
release nole or README DOC f"e before using Ihe produci
TRADEMARKS
Dlgilal Research, CP/M- 86, and the Digital Research logo are regislered trademarks 0
Digital Research Inc
Concurrent, and Concurrenl DOS 86, LlB-86, LlNK-86, MP/M- 8E
PL/I-86, RASM-86, SID- 286, and XREF-86 are trademarks of Digilal Research
We Mak
Computers Work is a ser\l1ce mark of DlglllIl Research Inc
Inlel is a reglstere l
MCS-86 IS a trademark of Inlel Corporation,
trademark of Inlel Corpo'alion
Foreword
The Progr_a.rnl'!l_err_J"LlJ.litJ~~ __ Guide for Concurrent T~__QQS 86 (cited as
the PrograI!1Dl.~.E':.LUtililles_Guide) assumes that you are familiar with
the Concurrent environment.
It also assumes that you are familiar
with the basic elements of 8086 and 80286 assembly language
programming.
The .e.r:Q.9.rarDJ!l~(~ __Utilities Guide describes the operation of the
following Concurrent DOS 86 native mode (CMD files) and PC DOS
mode (EXE files) utilities
RASM-86™
Assembler for 8086, 80186, and 80286 assembly
language that produces relocatable code in the
Intel® Object Module Format.
XREF-86™
Utility used with RASM-86 to produce a cross
reference listing of the symbols used in a program.
LlNK-86™
Linkage editor that combines relocatable object
modules and libraries to create executable files.
LlB-86™
Utility that creates and maintains libraries of object
modules for use with LlNK-86
SID-86™
Symbolic Instruction Debugger
debug object module code.
used
to
test
and
The operation of the native mode and PC DOS mode versions of each
utility are nearly identical
any specific differences are clearly
documented. Since Concurrent DOS 86 supports both its native mode
operating system calls, and PC DOS system calls, it is imperative that
you notinterrnix the two modes in an executable module. That is, a
PC DOS program (.EXE file) should not contain any calls to Concurrent
DOS 86 native mode system calls Likewise, a program written for the
native mode (.CMD file) should not contain any PC DOS system calls.
iii
Typographical Conventions
This guide uses the following notation to describe commands:
command
parameter (option]
A command is any of the commands described in this guide.
A
parameter can be a filename, an address location, or any specifier that
is particular to the command.
Optional items, such as command
options or additional filenames, appear inside square brackets.
Words joined by an underscore
field.
U represent a single command item or
Examples of specific usage of a command are preceded by an A>
prompt, and the user's input appears in bold print. For example:
A>rasm86 test
illustates a specific usage of the RASM86 command.
Characters used to represent values or variables in a command or
instruction syntax may also appear in bold print in the text in which
they are described.
iv
Contents
The RASM-86 Assembler
1.1 Introduction
. . . .. ... . .
1.2 RASM-86 Operation
.......... . . . .
1.3 RASM-86 Command Syntax. . . . . . . . . . .
1.3.1 RASM-86 Run-Time Parameters. . .
1.3.2 RASM-86 Command Line Examples.
1.4 Stopping RASM-86. .
.
.
.
.
.
.
.
.
..
..
. .
. .
..
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1-1
1-1
1-1
1-2
1-4
1-6
2.1 Introduction ....
2.2 RASM-86 Character Set
2.3 Tokens and Separators.
2.4 Delimiters .... .
2.5 Constants ..... .
2.5.1 Numeric Constants.
2.5.2 Character String Constants ..
2.6 Identifiers ..... .
2.6.1 Keyword Identifiers.
2.6.2 Symbol Identifiers.
2.6.3 Example Identifiers
........... .
. .............. .
2.7 Operators.......
. ..... .
2.7.1 Arithmetic Operators.
. .... .
2.7.2 Logical Operators.
2.7.3 Relational Operators.
. ............. .
. ........ .
2.7.4 Segment Override Operator. .
2.7.5 Variable Manipulation Operators ....... .
2.7.6 Variable Creation Operators.
. .... .
2.7.7 Operator Precedence.
2.8 Expressions
2-1
2-1
2-2
2 Elements of RASM-86 Assembly Language
v
2-2
2-3
2 4
2-5
2-6
2-6
L
2-8
2-W
2-10
2-12
2-14
2-14
2-15
2-16
2-17
2-18
2-20
Contents
2.9 Statements .......... , . . . . . . . . . . . . . . . . . . . . . . . . .
2.9.1 Instruction Statements . . . . . . . . . . . . . . . . . . . . ..
2.9.2 Directive Statements. . . . . . . . . . . . . . . . . . . . . . ..
2-21
2-21
2-22
3 RASM-86 Directives
3.1 Introduction...................................
3.2 Assembler Directive Syntax.' " . . . . . . . . . . . . . . . . . . . . . .
3.3 Segment Control Directives . . . . . . . . . . . . . . . . . . . . . . .
3.3.1 The 8086/80286 Segmented Architecture. . . . . . . .
3.3.2 CSEG, DSEG, ESEG, and SSEG Directives. . . . . . . . .
3.3.3 GROUP Directive. . . . . . . . . . . . . . . . . . . . . . . . . ..
3.4 linkage Control Directives. . . . . . . . . . . . . . . . . . . . . . . .
3.4.1 END Directive. . . . . . . . . . . . . . . . . . . . . . . . . . . ..
3.4.2 NAME Directive.
. ...... " . " ..... , ..... "
3.4.3 PUBLIC Directive, , .. , , . , , , , , , , , . , , .. , .... ,.
3,4,4 EXTRN Directive
3.5 Conditional Assembly Directives, , , , , , , , . , .. , . . . . . ..
3.5,1 IF, ELSE, and ENDIF Directives. , , . , . , , , . , . , . . ..
3,6 Symbol Definition Directive. , , . , , , , , , , , . , , , . , .... "
3.6.1 EOU Directive, ... , , .. , . , . , , . , ... , ........ ,
3,7 Data and Memory Directives, , , . , , . , , ...... , , . , , . "
3.7.1 DB Directive .. , . , , , , , , .. , , . , , , .. , , , .. , . . ..
3.7.2 OW Directive ... , . , , , , .. , , , , , , , ... , ... , , . "
3.7.3 DO Directive. , ... , , , . , . , , , , .... , . , , ... , .. ,
3,7.4 RS Directive. , , .... , , . , . , , .. , .... , , , . , .. ,.
3.7.5 RB Directive, .... , .. , . . . . . . . . . . . . . . . . . . . ..
3.7.6 RW Directive ..... , . . . . . . . . . . . . . . . . . . . . . . ..
3.7.7 RD Directive. . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
3.B Output listing Control Directives , ..... , , . . . . . . . . . ..
3.B.1 EJECT Directive. . . . . . . . . . . . . . . . . . . . . . . . . . ..
3.8.2 NOIFLIST IIFLIST Directives ... , .. , , . . . . . . . . . . ..
3.8.3 NOLIST and LIST Directives .. , . , . . . . . . . . . . . . . ,
3.8.4 PAGESIZE Directive. . . . . ..
. .. ,.. . . . . . . . . ..
3.8.5 PAGEWIDTH Directive .......... , .. , . . . . . . . ..
3.8.6 SIMFORM Directive, . , .... , .... , . . . . . . . . . . ..
3.~.?
J:tTLE Directive ......... , . . . . . . . . . . . . . . . . . .
vi
3-1
3-1
3-2
3-2
3-3
3-8
3-8
3-9
3-9
3-9
3-10
3-10
3-11
3-12
3-12
3-13
3-13
3-14
3-14
3-15
3-15
3-15
3-16
3-16
3-16
3-17
3-17
3-17
3-17
3-17
3-18
Contents
3-18
3-18
3-18
3-19
3-19
3-20
3.9
8087 Control Directives
3.9.1 HARD8087 Directive
3.9.2 AUT08087 Directive
3.10 Miscellaneous Directives.
3.10.1 INCLUDE Directive
3.10.2 ORG Directive.
4 RASM-86 Instruction Set
4.1
4.2
4.3
Introduction
RASM-86 Instruction Set Summary
Instruction-definition Tables.
4.3.1 Symbol Conventions
4.3.2 Flag Registers
4.3.3 8086 Data Transfer Instructions.
4.3.4 8086 Arithmetic. Logical. and Shift Instructions.
4.3.5 8086 String Instructions
. . .. . .
4.3.6 8086 Control Transfer Instructions
. . . . . . . . .
4.3.7 8086 Processor Control Instructions
4.3.8 8087 Instruction Set
4.3.9 Additional 186 and 286 Instructions
4.3.10 Additional 286 Instructions
4-1
4-1
4-10
4-10
4-12
4-12
4-15
4-24
4-27
4-32
4-34
4-45
4-46
5 RASM-86 Code-macro Facilities
5.1
5.2
5.3
Introduction ....
Invoking Code-macros.
Defining Code-macros ..
5.3.1 Formal Parameter List.
5.3.2 Code-macro Directives.
5.3.3 Example Code-Macro Definitions.
Vii
5-1
5-1
5-2
5-2
5-4
5-10
Contents
6 XREF-86 Cross-Reference Utility
6-1
6-1
6.1 Introduction ........... .
6.2 XREF-86 Command Syntax.
7 LlNK-86 Linkage Editor
7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
7.9
7.10
7.11
7.12
Introduction................. . . . . . . . . . . . . . . . .
LlNK-86 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LlNK-86 Command Syntax . . . . . . . . . . . . . . . . . . . . . . . .
Stopp'ing L1NK-86 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LlNK-86 Command Options . . . . . . . . . . . . . . . . . . . . . . .
Command File Options . . . . . . . . . . . . . . . . . . . . . . . . . .
7.6.1 Command File Formats . . . . . . . . . . . . . . . . . . . . .
7.6.2 FILL I NOFILL . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.6.3 HARD8087 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.6.4 CODESHARED (Native-mode only) . . . . . . . . . . . . .
SYM File Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.7.1 LOCALS I NOLOCALS . . . .. . . . . . . . . . . . . . . . .
7.7.2 LlBSYMS I NOLIBSYMS ... .
MAP File Option . . . . . . . . . . . . . .
SEARCH Option . . . . . . . . . . . . . . .
Input File Options .......... .
1/0 Option ........ .
7.11.1 $C (Command) Option.
7.11,2 $L (Library) Option ...... , .
7.11.3 $M (Map) Option,.
7.11.4 $0 (Object) Option
7.11.5 SS Symbol Option ... .
. .... .
The Link Process.
7.12.1 Phase 1 - Collection
7.12,2 Phase 2 - Create Command File.
viii
.
.
.
.
.
.
.
.
.
.
.
.
7-1
7-1
7-2
7-3
7-4
7-7
7-7
7-10
7-10
7 -11
7 -11
7-11
7-11
7-12
7-13
7-13
7-14
7-15
7-15
7-16
7-16
7-16
7-17
7-18
7-23
Contents
8 LlB-86 Library Utility
8.1
8.2
8.3
8.4
8.5
8.6
Introduction..
. . . . . . . .. . ... ... . . .
LlB-86 Operation
. . . . . . . . .. . ... . ..
LlB-86 Command Syntax
............... . . . . . .
Stopping LlB-86 .
. . . . . . . . .. . . . ... ... . . ..
LlB-86 Command Options. . . . . . . . . . . . . . . . . . . . . . . . .
Creating and Updating Libraries. . . . . . . . . . . . . . . . . . . .
8.6.1 Creating a New Library. . . . . . . . . . . . . . . . . . . . . .
8.6.2 Adding to a Library. . . . . . . . . . . . . . . . . . . . . . . . .
8.6.3 Replacing a Module. . . . . . . . . . . . . . . . . . . . . . . . .
8.6.4 Deleting a Module ....... , . . . . . . . . . . . . . . . . .
8.6.5 Selecting a Module. . . . . . . . . . . . . . . . . . . . . . . . .
8.7 Displaying Library Information. . . .. . . . . . . . . . . . . . . .
8.7.1 Cross-reference File. . . . . . . . . . . . . . . . . . . . . . . .
8.7.2 Library Module Map. . . . . . . . . . . . . . . . . . . . .
8.7.3 Partial Library Maps. .
. . . . . . . .. ... .. .
8.8 LlB-86 Commands on Disk. . . . .
. . .. . .. ... . .
8.9 Redirecting I/O.
. .. . .. . . . . . . . . . . . . .. .. . . . .
8-1
8-1
8-2
8-2
8-3
8-3
8-4
8-4
8-4
8-5
8-6
8-6
8-6
8-7
8-7
8-8
8-9
9 SID-86 Operation
9-1
9-1
9-2
9-3
9.1 Introduction ...
9.2 Typographical Conventions.
9.3 Starting SI0-86.
9.4 Exiting SID-86
10 S10-86 Expressions
10.1
10.2
10.3
10.4
10.5
10.6
10.7
10.8
Introduction
Literal Hexadecimal Numbers ..
Literal Decimal Numbers.
Literal Character Values ..
Register Values ...
Stack References
Symbolic References.
Qualified Symbols.
IX
10-1
10-1
10-2
10-2
10-3
10-4
10-5
10-6
Contents
10.9' Expression Operators ..... .
10.10 Sample Symbolic Expressions.
10-7
10-8
11 SID-86 Commands
11.1
11.2
11.3
11.4
11-1
Command Structure
11-1
Specifying an Address
...................... .
Line Editing Functions.
. . . . . . . . . . . . . . . . . 11-2
11-2
S10-86 Commands.
. ..................... .
11.4.1 A (Assemble) Command . . . . . . . . . . . . . . . . . . . . 11-2
11.4.2 B (Block Compare) Command . . . . . . . . . . . . . . . . 11-3
. . . . . . . . . . 11-4
11.4.3 0 (Display) Command
11.4.4 E (Load Program, Symbols for Execution) Command 11-6
11.4.5 F (Fill) Command.
. ..... . 11-8
11-9
...... .
11.4.6 G (Go) Command
11-10
11.4.7 H (Hexadecimal Math) Command.
11-12
11.4.8 I (Input Command Tali) Command . . . . . . . .
11-13
11.4.9 L (List) Command
11-15
11.4.10 M (fvlove) Command
11-15
11.4.11 P (Permanent Breakpoint) ComnlClnd
11-17
11.4.12 QI, QO (Querv 110) Command
11-18
11.4.13 R (Read) Command
11- 19
11.4.14 S (Set) Command
1120
11.4.15 SR (Search for String) Command.
11·-21
11.4.16 T (Trace) Command
11-24
11.4.17 U Command
11- 2 5
11.4.18 V (Value) Command
11-25
11.4.19 W (Write) Command
11 - 26
11.4.20 X (Examine CPU State) Camman
11- 28
11.421 Z (PrJnt 8087/80287 Registers) Command.
1129
11.4.22 I (List ComrnalHJS) Command ....
11-29
11.4.23 17 (List Commands Format) Command.
11-30
11.4.24 : (Define r"lauo) command.
11-30
11.4.25 = (Use Macro) Cornmane!
Contents
12 Default Segment Values
12-1
12-1
12-2
12.1 Introduction
12.2 Type-1 Segment Value.
12.3 Type-2 Segment Value.
13 Assembly Language Syntax for A and L Commands
13.1
Assembly Language Exceptions . . . . . . . . . . . . . . .
1a-1
14 SID-86 Sample Session
14.1
A
14-1
Introduction
A-l
RASM-86 Example Source File
B Mnemonic Differences from the Intel Assembler. . . . . . . ..
B-1
C Reserved Words. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
C-l
D Code-Macro Definition Syntax. . . . . . . . . . . . . . . . . . . . . ..
D-1
E RASM-86 Error Messages. . . . . . . . . . . . . . . . . . . . . .
E-1
F XREF-86 Error Messages . . . . . . . . . . . . .
F-1
G L1NK-86 Error Messages.
G-l
H L1B-86 Error Messages.
H-1
1-1
I SID-86 Error Messages
Figures
7-1 Combining Segments . tilth the Public Combine Type.
7-2 Combining Segments with the Common Combine Type.
7-3 Combining Segments with Stack Combination.
7-4 Paragraph Alignment.
7-5 The Effect of Grouping Segments
XI
7-19
7-19
7-20
7-21
7-22
Contents
Tables
1-1 RASM-86 Run-time Parameters.
2-1 Separators and Delimiters.
2-2 Radix Indicators for Constants.
2-3 String Constant Examples.
2-4 Register Keywords ..
2-5 RASM-86 Operator Summary ..... .
2-6 Precedence of Operations in RASM-86
3-1 Def~u~tSegment Names
3-2 Default Align Types.
3-3 Default Class Name for Segments.
4-1 RASM-86 Instruction Summary
4-2 Operand Type Symbols
4-3 Flag Register Symbols.
4-4 8086 Data Transfer Instructions.
4-5 Effects of Arithmetic Instructions on Flags.
4-6 8086 Arithmetic Instructions
4-7 8086 Logical and Shift Instructions
4-8 8086 String Instructions
4-9 8086 Prefix Instructions.
4-10 8086 Control Transfer Instructions
4-11 8086 Processor Control Instructions
4-12 8087 Data Transfer Instructions.
4-13 8087 Arithmetic Instructions
4-14 8087 Comparison Instructions
4-15 8087 Transcendental Instructions
4-16 8087 Constant Instructions
4-17 8087 Processor Control Instructions
4-18 Additional 186 and 286 Instructions
4-19 Additional 286 Instructions
5-1 Code-macro Operand Specifiers
5-2 Code-macro Operand Modifiers.
7-1 LINK-86 Command Options
7-2 Command File Option Parameters
7-3 Default Values for Command File Options and Parameters
7-4 LlNK-86 Usage of Class Names.
Xli
1-2
2-2
2-4
2-5
2-7
2-10
2-19
3-4
3-5
3-7
4-2
4-10
4-12
4-13
4-16
4-17
4-20
4-25
4-27
4-28
4-33
4-36
4-38
4-43
4-44
4-44
4-45
4-46
4-46
5-3
5-4
7-5
7-8
7-10
7-24
Content<;
8-1 LlB-86 Filetypes ...
8-2 LlB-86 Command Line Options.
11-1 Flag Name Abbreviations.
11-2 SID-86 Command Summary.
12-1 SID-86 Default Segment Values.
B-1 RASM-86/Intel Mnemonic Differences.
. .... .
B-2 Memory Operands for 8087 Instruction
.....
C-1 Reserved Words. . . . . . . . . . . . . .
.
E-1 RASM-86 Non-recoverable Errors. . . . . . . . . . . ..
E-2 RASM-86 Diagnostic Error Messages ....... .
F-1 XREF-86 Error Messages.
. ..........
G-1 LlNK-86 Error Messages
...............
H-1 LlB-86 Error Messages
..................
1-1 SID-86 Error Messages.
. .......... .
xiii
8-1
8-3
11-27
11-31
.
.... .
..
.
.
.
12-3
B-1
B-2
C-1
E-1
E-3
F-1
G-1
H-1
1-1
SECTION 1
The RASM-86 Assembler
1.1
Introduction
This section describes RASM-86 operation and its command syntax.
Sections 2 through 5 detail the characteristics and uses of the
RASM-86 components. A sample RASM-86 source file is provided in
Appendix A.
1.2 RASM-86 Operation
The RASM-86 assembler converts source files containing 8086, 8087,
80186, 80286, and 80287 instructions into machine language object
files. RASM-86 processes an assembly language source file in three
passes and can produce three output files from one source file. The
three files have the same filename as the source file. For example, if
the name of the source file is BIOS88.A86, RASM-86 produces the files
BIOS88.0BJ, BIOS88.LST, and BIOS88.SYM.
The LST list file contains the assembly language listing with any error
messages. The OBJ object file contains the object code in Intel 8086
and 80286 relocatable object format. The SYM symbol file lists any
user-defined symbols.
1.3 RASM-86 Command Syntax
Invoke RASM-86 with the following command form:
RASM86 [d:]tilename[.typ} [$ run-time parameters]
where filename is the name of the source file.
any. valid filename of 1 to 8 characters.
The filename can be
The d: is an optional drive specification denoting the source file's
location. The drive specification is not needed if the source is on the
current drive.
1-1
1,3 RASM-86 Command Syntax
Programmer's Utilities Guide
The typ is the optional filetype, which can be any valid filetype of I to
3 characters. If no filetype is specified, filetype A86 is assumed. The
run-time parameters are described below in Section 1,3,1,
1.3.1 RASM-86 Run-Time Parameters
The dollar sign character, $, denotes an optional string of run-time
parameters.
A run-time parameter is fol/owed by a device or file
specification.
Table 1-1 contains a summary of the RASM-86 run-time parameters,
described in detail in the following sections,
Table 1-1.
Parameter
A
IFILENAME
L
o
NC
P
S
186
286
RASM-86 Run-time Parameters
Specifies
Source file device
Include filename into assembly
at beginning of module
Local symbols in object file
Object file device
No case conversion
List file device
Symbol file device
Permit 186 opcodes
Permit 286 opcodes
Valid Arguments
A, S, C, ", P
o
A,,, P, Z
A '" P, X, Y, Z
A ,,' P, X, Y, Z
All run-time parameters are optional, and you can enter them in the
command line in any order. Enter the dollar sign only once at the
beginning of the parameter string. Spaces can separate parameters,
but are not required.
However, no space is permitted between a
parameter and its device name,
1-2
Programmer's Utilities Guide
1.3 RASM-86 Command Syntax
If you specify an invalid parameter in the parameter list. RASM-86
displays
SYNTAX ERROR
and echoes the command tail up to the point where the error occurs,
then prints a question mark. (Appendix E contains the complete list of
RASM-86 error messages.)
A, 0, P, and S Parameters
These run-time parameters associate a filetype with a device. The file
parameters: A 0, p, and S specify the type of file. Each of these
parameters is followed by a device specifier: A - P, X, Y, Z. For
example:
$ AA
specifies the source file on drive A.
The A, 0, P, and S parameters have the following definitions
°
A
P
S
specifies
specifies
specifies
specifies
the
the
the
the
Source File
Object File
List File
Symbol File
A device name must follow each of these parameters.
defined as follows:
The devices are
A-P Specify disk drives A through P, respectively.
specifies the user console, CON:
Y
specifies the list device, LST:
Z
suppresses output, NUL
X
If you direct the output to the console, you can temporarily stop the
display by typing CTRL-S, then restart it by typing CTRL-Q.
IFILENAME Parameter
If a filename is preceded by an upper case I. RASM-86 includes the
contents of the file at the beginning of the module being assembled.
If no filename extension is specified. RASM-86 assumes an extension
of A86.
1-3
1.3 RASM-86 Command Syntax
Programmer's Utilities Guide
L Parameter
The L parameter directs RASM-86 to include local symbols in the
object file so that they appear in the SYM file created by LlNK-86.
Otherwise, only public symbols appear in the SYM file. You can use
the SYM file with the Symbolic Instruction Debugger, SID-86 TM, to
simplify program debugging.
NC Parameter
The NC parameter directs RAS~.;1-86 to distinquish between uppercase
and lowercase in symbol names
Thus. when you specify the NC
parameter, the symbols ABC and abc are treated as two unique
symbols.
If the NC parameter is not specified. RASM-86 would
consider ABC and abc to be the same symbol.
This parameter is
useful when writing programs to be linked with other programs whose
symbols might contain lowercase characters, such as "c".
186 and 286 Parameters
The 186 parameter specifies that 80186 apcodes are to be assembled.
The 286 parameter specifies that 80286 opcades are to be assembled.
1.3.2 RASM-86 Com m and Line Examples
The following are some examples of valid RASM-86 commands
Command Line
Result
A>rasm86 io
Assembles file 10.A86 and produces 100BJ, 10 LST,
and 10SYM, all on the default drive.
A>rasm86 io.asm$ ad sz
Assembles file 10ASM on drive 0 and produces
10.LST and 100BJ Su[!presses the symbol file.
A>rasm86 io $ py
SX
Assembles file 10.A86, produces 100BJ, and sends
listing directly to printer. Also outputs symbols on
console.
1-4
Programmer's Utilities Guide
Command Line
1.3 RASM-86 Command SYl1tax
Result
A>rasm86 io $ Ifirst
Assembles file IO.A86 with the contents of the file,
firsta86, appearing at the beginning' of-tile-module.
Then produces IOOBJ, IO.LST, and IO.SYM, a" on the
default drive.
A>rasm86
10
$
10
Includes local symbols in IOOBJ.
Once you invoke RASM-86, it displays a sign-on message and then
attempts to open the source file
If the file does not exist on the
designated drive or does not have the correct filetype, RASM-86
displays
NO FILE
and stops processing
By default, RASM-86 creates the output files on the current disk drive.
However, you can redirect the output files by using the optional
parameters, or by a drive specification In the source filename. In the
latter case, RASM-86 directs the output files to the drive specified in
the source filename.
When the assembly is complete RASM-86 displays the message
END OF ASSEMBLY. NUMBER OF ERRORS
n
USE FACTOR ppOlo
where n represents the number of errors encountered during
assembly.
The Use Factor indicates how much of the available
Symbol Table space was actui:llly used during the assembly. The Use
Factor is expressed as a decimal percentage ranging from 0 to 99.
1-5
1.4 Stopping RASM-86
Programmer's Utilities Guide
1.4 Stopping RASM-86
You can
pressing
pressing
RASM-86
halt both the native mode and PC DOS mode assembler by
Ctrl-C. You can also stop the native-mode assembler, by
any key on the console keyboard. When you press a key,
responds:
STOP RASM-86 (YIN)?
If you type Y, RASM-86 immediately stops processing, and returns
control to the operating system. Type N to resume processing.
End of Section 1
1-6
SEcr:ON 2
Elements of RASM-86
Assembly Language
2.1
Introduction
This section describes the following elements of RASM-86 assembly
language:
•
•
•
•
•
•
•
•
RASM-86 Character Set
Tokens and Separators
Delimiters
Constants
Identifiers
Operators
Expressions
Statements
2.2 RASM-86 Character Set
RASM-86 recognizes a subset of the ASCII character set.
Valid
RASM-86 characters are the letters A through Z (both uppercase and
lowercase) and the numerals 0-9.
Valid special characters are:
+ -
* / = ( ) [ ]
$ ?
Valid nonprinting characters are:
space, tab, carriage return, and line-feed
Usually RASM-86 treats lowercase letters as uppercase, except within
strings. You can use the NC parameter described in Section 1.3.1 to
make RASM-86 distinguish between lower and upper case.
Only
alphanumerics, special characters, and spaces can appear in a string.
2-1
2.3 Tokens and Separators
Programmer's Utilities Guide
2.3 Tokens and Separators
A token is the smallest meaningful unit of a RASM-86 source program,
much as a word is the smallest meaningful unit of a sentence.
Adjacent tokens within the source are commonly separated by a blank
character or space. Any sequence of spaces can appear wherever a
single space is allowed.
RASM-86 recognizes horizontal tabs as
separators and interprets them as spaces. RASM-86 expands tabs to
spaces
fti'e'list file. The tab stops are at each eighth column.
in
2.4 Delimiters
Delimiters mark the end of a token and add special meaning to the
instruction; separators merely mark the end of a token.
When a
delimiter is present, separators need not be used. However, using
separators after delimiters can make your program easier to read.
Table 2-1 describes RASM-86 separators and delimiters. Some
delimiters are also operators. Operators are described in Section 2.7.
Table 2-1.
Character
Name
Separators and Delimiters
Use
20H
space
separator
09H
tab
legal in source files, expanded in
list til e s
CR
carriage return
terminates source lines
LF
line-feed
legal after CR; if in source lines. it
is interpreted as a space
semicolon
starts comment field
colon
identifies a label; used in segment
override specification
2-2
Programmer's Utilities Guide
2.4 Oelimhers
Table 2-1. (continued)
Character
Name
Use
period
forms variables from numbers
$
dollar sign
notation for present value of
location
counter;
legal,
but
ignored in identifiers or numbers
+
plus
arithmetic operator for addition
minus
arithmetic
subtraction
operator
for
*
asterisk
arithmetic
multiplication
operator
for
/
slash
arithmetic operator for division
@
at sign
legal in identifiers
underscore
legal in identifiers
exclamation point
logically terminates a statement,
allowing multiple statements on a
single source line
apostrophe
delimits string constants
2.5 Constants
A constant is a value known at assembly time that does not change
while the assembled program is running. A constant can be either a
numeric value or a character string.
2-3
2.5 Constants
Programmer's Utilities Guide
2.5.1 .N.u~~ric Constants
A numeric constant is a 16-bit integer value expressed in one of
several bases. The base, called the radix of the constant, is denoted
by a trailing radix indicator. Table 2-2 shows the radix indicators.
Table 2-2.
Indicator
8
Radix Indicators for Constants
Constant Type
binary
octal
octal
decimal
hexadecimal
0
Q
0
H
Base
2
8
8
10
16
RASM-86 assumes that any numeric constant not terminating with a
radix indicator is a decimal constant.
Radix indicators can be
uppercase or lowercase.
A constant is thus a sequence of digits followed by an optional radix
indicator, where the digits are in the range for the radix.
Binary
constants must be composed of zeros and ones. Octal digits range
from a to 7; decimal digits range from 0 to 9. Hexadecimal constants
contain decimal digits and the hexadecimal digits A (100), B (110), C
(120), 0 (130), E (140). and F (150).
The leading character of a
hexadecimal constant must be a decimal digit so RASM-86 cannot
confuse a hex constant with an identifier.
The following are valid
numeric constants:
1234
1234H
33770
2-4
1234D
OFFEH
OFE3H
1100B
33770
1234d
1111000011110000B
13 77 2Q
Offffh
Programmer's Utilities Guide
2.5 Constants
2.5.2 Character String Constants
A character string constant is a string of ASCII characters delimited by
apostrophes. All RASM-86 instructions allowing numeric constants as
arguments accept only one- or two-character constants as valid
arguments. All instructions treat a one-character string as an 8-bit
number, and a two-character string as a 16-bit number. The value of
the second character is in the low-order byte, and the value of the
first character is in the high-order byte.
The numeric value of a character is its ASCII code. RASM-86 does not
translate case in character strings. so you can use both uppercase and
lowercase letters.
Note that RASM-86 allows only alphanumerics,
special characters, and spaces in character strings.
A DB directive is the only RASM-86 statement that can contain strings
longer than two characters (see Section 3.7.1). The string cannot
exceed 255 bytes. If you want to include an apostrophe in the string,
you must enter it twice.
RASM-86 interprets two apostrophes
together as a single apostrophe. Table 2-3 shows valid character
strings and how they appear after processing.
Table 2-3.
String in source text
String Constant Examples
As processed by RASM-86
'a'
a
'Ab"Cd'
'I like CP/M'
Ab'Cd
I like CP/M
'ONLY UPPER CASE'
'only lower case'
ONLY UPPER CASE
only lower case
2-5
2.6 Identifiers
Programmer's Utilities Guide
2.6 Identifiers
The following rules apply to all identifiers
• Identifiers can be up to 80 characters long
• The first character must be alphabetic or one of these special
characters: 7, @, or
• Any subsequent characters can be either alphabetic, numeric, or
one of these special characters ?, @, _' or S RASM-86 ignores
the special character S in identifiers, so that you can use it to
improve readability in long identifiers
For example, RASM-86
treats the identifier interruptSflag as interruptflag.
There are two types of identifiers
Keywords
Symbols
Keywords have predefined meanings
identifiers you define yourself.
2.6.1
to
RASM-86.
Symbols
are
Keyword Identifiers
Keywords are reserved for use by RASM-86; you cannot define an
identifier identical to a keyword Appendix C lists the keywords.
RASM-86 recognizes five types of keywords
•
•
•
•
•
instructions
directives
operators
registers
predefined numbers
Section 4 defines the 8086, 8087, 80186, 80286, and 80287 instruction
mnemonic keywords and the actions they initiate; Section 3 discusses
RASI\I-86 directives, and Section 2 7 defines operators. Table 2-4 lists
the RASM-86 keywords that identify the processor registers.
2-6
Programmer's Utilities Guide
2.6 Identifiers
Three keywords, BYTE, WORD, and DWORD, are predefined numbers,
The values of these numbers are 1, 2, and 4, respectively. RASM-86
also associates a Type attribute with each of these numbers.
The
keyword's Type attribute is equal to the keyword's numeric value
Table 2-4.
Register
Symbol
AH
BH
CH
DH
AL
BL
CL
DL
AX
BX
CX
OX
BP
SP
SI
01
CS
OS
SS
ES
ST
STO
ST1
STl
Size
(bytes)
Numeric
Value
Register Keywords
Meaning
10
10
10
100 B
111 B
101 B
110 B
000 B
011 B
001 B
010 B
000 B
011 B
001 B
010 B
101 B
100 B
110 B
111 B
01 B
11 B
10 B
00 B
000 B
000 B
00 1 B
Accumulator High Byte
Base Register High Byte
Count Register High Byte
Data Register High Byte
Accumulator Low Byte
Base Register Low Byte
Count Register Low Byte
Data Register Low Byte
Accumulator (full word)
Base Register (full word)
Count Register (full word)
Data Register (full word)
Base Pointer
Stack Pointer
Source Index
Destination Index
Code Segment Register
Data Segment Register
Stack Segment Register
Extra Segment Register
8087 stack top register
8087 stack top register
8087 stack top - 1 is stack top
10
11 1 B
8087 stack top - 7 is stack top
1
2
2
2
2
2
2
2
2
2
2
2
2
2-7
2.6 Identifiers
Programmer's Utilities Guide
2.6.2 Symbol Identifiers
A symbol is a user-defined identifier with attributes specifying the kind
of information the symbol represents.
Symbols fall into three
categories:
• variables
• labels
• numbers
Variables
Variables identify data stored at a particular location in memory.
variables have the following three attributes:
All
Segment
tells which segment was being assembled when the
variable was defined.
Offset
tells how many bytes are between the beginning of
the segment and the location of this variable.
Type
tells how many bytes of data are manipulated when
this variable is referenced.
A segment can be a code segment, a data segment, a stack segment,
or an extra segment depending on its contents and the register
containing its starting address (see "Segment Control Directives" in
Section 3.3). The segment's starting address is a number between 0
and OFFFFH (65,5350). This number indicates the paragraph in memory
to which the current segment is assigned, either when the program is
assembled, linked, or loaded.
The offset of a variable is the address of the variable relative to the
starting address of the segment.
The offset can be any number
between 0 and OFFFFH.
A variable has one of the fol/owing type attributes:
BYTE
WORD
DWORD
2-8
one-byte variable
two-byte variable
four-byte variable
Programmer's Utilities Guide
2.6 Identifiers
The data definition directives: DB, OW, and ~O, define a variable as one
of these three types (see Section 3).
For example, the variable,
my_variable, is defined when it appears as the name for a data
definition directive:
my_variable db 0
You can also define a variable as the name for an EOU directive
referencing another variable, as shown in the following example:
another_variable equ my_variable
Labels
Labels identify locations in memory containing instruction statements.
They are referenced with jumps or calls.
All labels have two
attributes, segment and offset.
Label segment and offset attributes are essentially the same as
variable segment and offset attributes. A label is defined when it
precedes an instruction. A colon separates the label from instruction.
For example,
my_'abel:
add aX,bx
A label can also appear as the name for an EOU directive referencing
another label. For example,
another_'abe'
equ
my_'abel
Numbers
You can also define numbers as symbols. RASM-86 treats a number
symbol as though you have explicitly coded the number it represents.
For example,
number)ive
equ 5
mov al,Number five
is' equivalent to the following:
mov
al,5
Section 2.7 describes operators and their effects on numbers and
number symbols.
2-9
2.6 Identifiers
Programmer's Utilities Guide
2.6.3 Example Identifiers
The following are valid identifiers:
NOLIST
WORD
AH
Mean streets
crashed
variable number 1234567890
2.7 Operators
This section describes the available RASM-86 operators.
RASM-86
operators define the operations forming the values used in the final
assembly instruction.
RASM-86 operators fall into the following categories:
•
•
•
•
•
•
arithmetic
logical
relational
segl1)~nt_ override
variable manipulation
variable creation
Table 2-5 summarizes the available RASM-86 operators and
number of the section where each operator is explained in detail.
Table 2-5.
Operator
+
*
/
2-10
t
RASM-86 Operator Summary
Description
addition or unary positive
subtraction or unary negative
multiplication
unsigned division
Section
2.7.1
2.7.1
2.7.1
2.7.1
Programmer's Utilities Guide
2.7 Operators
Table 2-5. (Continued)
Operator
$
AND
EQ
GE
GT
LAST
LE
LENGTH
LT
MOD
NE
NOT
OFFSET
OR
PTR
seg:addr
SEG
SHR
SHL
TYPE
XOR
Description
create variable, assign offset
create label, offset = location counter
logical AND
Equal to
Greater than or equal to
Greater than
compare LENGTH of variable to 0
Less than or equal to
create number from variable length
Less than
return remainder of division
Not Equal to
logical NOT
create number from variable offset
logical OR
create variable or label, assign type
override segment register
create number from variable segment
shift right
shift left
create number from variable type
logical eXclusive OR
Section
2.7.6
2.7.6
2.7.2
2.7.3
2.7.3
2.7.3
2.7.5
2.7.3
2.7.5
2.7.3
2.7.1
2.7.3
2.7.2
2.7.5
2.7.2
2.7.6
2.7.4
2.7.5
2.7.1
2.7.1
2.7.5
2.7.2
The fol/owing sections define the RASM-86 operators in detail. Where
the syntax of the operator is illustrated, a and b represent two
. elements of the expression.
Unless otherwise specified, a and b
represent absolute numbers, such as numeric constants, whose value
is known at assembly-time. A relocatable number, on the other hand,
is a number whose value is unknown at assembly-time, because it can
For example, the offset. ot a
change during the linking process.
variable located in a segment that will be combined with some other
segments at link-time is a relocatable number.
2-11
2.7 Operators
2.7.1
Programmer's Utilities Guide
Arithmetic Operators
Addition and Subtraction
Addition -BAd -subtraction operators compute the arithmetic sum and
difference of two operands. The first operand (a) can be a variable,
label, an absolute number, or a relocatable number. For addition, the
second operand (b) must be a number. For subtraction, the second
operand can be a number, or it can be a variable or label in the same
segment as the first operand.
When a number is added to a variable or label, the result is a variable
or label with an offset whose numeric value is the second operand
plus the offset of the first operand. Subtraction from a variable or
label returns a variable or label whose offset is the first operand's
offset, decremented by the number specified in the second operand.
Syntax:
a
+ b
returns the sum of a and b. Where a is a variable,
label, absolute number, or relocatable number.
a - b
returns the difference of a and b. Where a and b
are
variables,
labels,
absolute
numbers,
or
relocatable numbers in the same segment.
Example:
0002
0005
OOOA FF
0008 2EA00800
OOOF 2E8AOEOFOO
0014 B303
2-12
count
displ
flag
equ
equ
db
offh
mov
mov
aI, flag+l
cl,flag+displ
m~\!
bl,displ-count
2
5
Programmer's Utilities Guide
2.7 Operators
Multiplication and Division
The multiplication and division operators *, I, MOD, SHL, and SHR
accept only numbers as operands,
* and / treat all operators as
unsigned numbers,
Syntax:
a * b
a / b
unsigned division of a and b
a MOD b
return remainder of a / b
a SHL b
returns the value resulting from shifting a to left by
the amount specified by b
a SHR b
returns the value resulting from shifting a to the
right by an the amount specified by b
unsigned multiplication of a and b
Example:
mav
mav
0016 BE5500
0019 B310
0050
buffersize
OOIB B8AOOO
equ
mav
si,256/3
bl,64/4
80
ax,buffersize * 2
Unary
Unary operators specify a number as either positive or negative,
RASM-86 unary operators accept both signed and unsigned numbers,
Syntax:
+
a
- a
gives a
gives
a-
a
2-13
2.7 Operators
Programmer's Utilities Guide
Example:
OOIE B123
0020 B007
0022 B2F4
mav
mav
mav
cl,+35
al,2--5
dl,-12
2.7.2 Logical Operators
Logical operators accept only numbers as operands.
Boolean logic operations AND, OR, XOR, and NOT.
They perform the
Syntax:
a XOR b
bit-by-bit logical EXCLUSIVE OR of a and b
a OR b
bit-by-bit logical OR of a and b
a AND b
bit-by-bit logical AND of a and b
NOT a
logical inverse of a: all as become 1s, 1s become
as. (a is a 16-bit number.)
Example:
OOFe
0080
0000 B180
0002 8003
mask
equ
signbit equ
mov
mov
Ofch
SOh
cI/mask and signbit
aI/not mask
2.7.3 Relational Operators
Relational operators treat all operands as unsigned numbers.
The
relational operators are EQ (equal), LT (less than), LE (less than or
equal), GT (greater than), GE (greater than or equal), and NE (not
equal).
Each operator compares two operands and returns all ones
(OFFFFH) if the specified relation is true, and all zeros if it is not
2-14
Programmer's Utilities Guide
2.7 Operators
Syntax:
In all of the operators below, a and b are unsigned numbers; or they
are labels, variables, or relocatable numbers defined in the same
segment.
a EQ b
returns OFFFFH if
a = b otherwise 0
a LT b
returns OFFFFH if
a < b, otherwise 0
a
returns OFFFFH if
a <= b, otherwise 0
a GT b
returns OFFFFH if
a > b, otherwise 0
a GE b
returns OFFFFH if
a >= b, otherwise 0
a
returns OFFFFH if
a < > b, otherwise 0
LE b
NE b
Example:
OOOA
0019
0004 B8FFFF
0007 B80000
2.7.4
1imitl
1 im it 2
equ
equ
10
25
mav
mav
ax,limit1 1t limit2
ax,limit1 gt limit2
Segment Override Operator
When manipulating variables, RASM-86 decides which segment
register to use. You can override this choice by specifying a different
register with the segment override operator.
In the syntax below, seg:addr represents the segment register (seg)
and the address of the expression (addr).
Syntax:
seg:addr
overrides segment register selected by assembler
seg can be CS. OS, SS, or ES
2-15
2.7 Operators
Programmer's Utilities Guide
Example:
0024 368B472D
0028 268BOE5BOO
002D 26A4
mov
mov
movs
ax,ss:wordbuffer[bx]
cx,es:array
byte ptr [di],es:[si]
2.7;5 Variable Manipulation Operators
A variable manipulator creates a number equal to one attribute of its
variable operand. SEG extracts the variable's segment value; OFFSET,
its offset value; TYPE, its type value (1, 2, or 4), and LENGTH, the
number of bytes associated with the variable. LAST compares the
variable's LENGTH with zero. If LENGTH is greater than zero, LAST
decrements LENGTH by one. If LENGTH equals zero, LAST leaves it
unchanged. Variable manipulators accept only variables as operators.
Syntax:
SEG a
creates a number whose value is the segment value
of the variable or label a.
OFFSET a
creates a number whose value is the offset value of
the variable or label a.
TYPE a
creates a number. If the variable a is of type BYTE,
WORD or DWORD, the value of the number created
is 1, 2, or 4, respectively.
LENGTH a
creates a number whose value is the length
attribute of the variable a. The length attribute is
the number of bytes associated with the variable.
LAST a
if LENGTH a > 0, then LAST a = LENGTH a - 1; if
LENGTH a = 0, then LAST a = 0.
2-16
Programmer's Utilities Guide
2.7 Operators
Example:
002D 000000000000 wordbuffer
0033 0102030405
buffer
dw
db
0,0,0
1,2,3,4,5
0038
003B
003E
0041
ax,
ax,
ax,
ax,
length buffer
last buffer
type buffer
type wordbuffer
B80500
B80400
B80100
B80200
mov
mov
mov
mov
2.7.6 Variable Creation Operators
Three RASM-86 operators are used to create variables.
PTR, period, and dollar sign operators described below.
These are the
The PTR operator creates a virtual variable or label valid Dnly- during
the execution of the instruction. PTR makes no changes to either of
its operands. The temporary symbol has the same Type attribute as
the left operator, and all other attributes of the right operator.
The period operator (.) creates a variable in the current Data Segment.
The new variable has a segment attribute equal to the current Data
Segment and an offset attribute equal to its operand.
The dollar sign operator ($) creates a label with an offset attribute
equal to the current value of the location counter. The label segment
value is the same as the current segment
This operator takes no
operand.
Syntax:
a PTR b
creates virtual variable or label with type of a and
attributes of b. a can be a BYTE, WORD, or DWORD;
b is the address of the expression.
'.a
creates variable with an offset attribute
Segment attribute is current data segment.
of
a.
2-17
2.7 Operators
$
Programmer's Utilities Guide
creates label with offset equal to current value of
location counter; segment attribute is current
segment.
Examples:
0044 C60705
0047 8A07
0049 FF04
mov
mov
inc
byte ptr [bx], 5
al,byte ptr [bx]
word ptr [si]
004B AlOOOO
004E 268BlE0040
mov
mov
bx, es: .4000h
0053 E9FDFF
0056 EBFE
0058 E9FD2F
jmp
jmps
jmp
ax,
.0
$
$
$+3000h
2.7.7 Operator Precedence
Expressions combine variables, labels, or numbers with operators.
RASM-86 allows several kinds of expressions (see Section 2.8). This
section defines the order that RASM-86 performs operations if more
than one operator appear in an expression.
RASM-86 evaluates expressions from left to right. but evaluates
operators with higher precedence before operators with lower
precedence. When two operators have equal precedence, RASM-86
evaluates the leftmost operator first.
Table 2-6 shows RASM-86
operators in order of increasing precedence
You can use parentheses to override the precedence rules. RASM-86
first evaluates the part of an expression enclosed in parentheses
If
you nest parentheses, RASM-86 evaluates the innermost expressions
first.
2-18
Programmer's Utilities Guide
2.7 Operators
For example,
15/3 + 18/9 = 5 + 2 = 7
15/(3 + 18/9) = 15/(3 + 2) = 15/5 = 3
(20*4) + ((27/9 - 4/2)) = (20*4)+(3-2)
=
80+1
=
81
Note that RASM-86 allows five levels of nested parentheses.
Table 2-6.
Order
Precedence of Operations in RASM-86
Operator Type
Operators
Logical
XOR, OR
2
Logical
AND
3
Logical
NOT
4
Relational
EO, LT, LE, GT, GE, NE
5
Addition/s u btracti on
+
6
M ultipl ica tion/d ivi s ion
* / MOD, SHL, SHR
7
Unary
+
8
Segment override
segment override:
9
Variable manipulators/creators
SEG, OFFSET, PTR, TYPE,
LENGTH, LAST
10
Parentheses/brackets
( )
11
Period and Dollar
-
-
[1
S
2-19
1.8 Expressions
Programmer's Utilities Guide
2.8 Expressions
RASM-86 allows address, numeric, and bracketed expressions.
An
address expression evaluates to a memory address and has three
components:
• segment value
• offset value
• type
Both variables and labels are address expressions.
An address
expression is not a number, but its components are numbers. You can
combine numbers with operators such as PTR to make an address
expression.
A numeric expression evaluates to a number.
or labels, only numbers and operands.
It contains no variables
Bracketed expressions specify base- and index-addressing modes.
The base registers are BX and BP, and the index registers are 01 and
SI. A bracketed expression can consist of a base register, an index
register, or both.
Use the + operator between a base register and an index register to
specify both base- and index-register addressing. For example,
mov
mov
mov
mov
variable[bx),O
ax,[bx+diJ
ax,[siJ
bl,[siJ
Since all of the above instructions are memory references, the current
OS Segment Selector is implied. The first instruction moves the value
of 0 hex into the word location specified by the sum of the base
register BX and the displacement VARIABLE. The second instruction
moves - tne- word found at the location specified by the sum of the
base register BX and the index register 01 into the location specified
by the word register AX. The third instruction moves the word found
at the location specified by index register SI into the location specified
by the word register AX. The last instruction moves the byte- found at
the location specified by the index register 51 into the location
specified by the byte register BL
2-20
Programmer's Utilities Guide
2.9 Statements
2.9 Statements
Statements can be instructions or directives.
RASM-86 translates
instructions into 8086 arid 80286 machine language instructions.
RASM-86 does not translate directives into machine code. Directives
tell RASM-86 to perform certain functions.
You must terminate each assembly language statement with 8 carriage
return (CR) and line-feed (LF), or exclamation point. RASM-86 treats
these as an end-ot-line. You tan write multiple assembly language
statements without comments on the same physical line and separate
them with exclamation points. Only the last statement on 8 line can
have a comment because the comment field extends to the physical
end of the line.
2.9.1 Instruction Statements
The following is the syntax for an instruction statement:
[label:] [prefix] mnemonic [operand(s)] [;comment]
The fields are defined as follows:
label
A symbol followed by a colon defines a label at the
current value of the location counter in the current
segment. This field is optional.
prefix
Certain machine instructions such as LOCK and REP
can prefix other instructions. This field is optional.
mrlemonic
A symbol defined as a machine instruction, either by
RASM-86 or by an EQU directive.
This field is
optional unless preceded by a prefix instruction. If
you omit this field, no operands can be present,
although the other fields can appear.
Section 4
describes the RASM-86 mnemonics.
operand(s)
An instruction mnemonic can require other symbols
to
represent
operands
to
the
instruction.
Instructions can have zero, one, or two operands.
2-21
2.9 Statements
comment
Programmer's Utilities Guide
Any semicolon appearing outside a character string
begins a comment.
A comment ends with a
carriage return.
This field is optional, but you
should
use
comments
to
facilitate
program
maintenance and debugging.
Section 3 describes the RASM-86 directives.
2.9.2 Directive Statements
The following is the syntax for a directive statement:
[name] directive operand(s) [;commentl
The fields are defined as follows:
name
Names are legal for CSEG, OSEG, ESEG, SSEG,
GROUP. DB, OW, ~O, RB, RW, RO, RS, and EQU
directives. The name is required for theEQU and
GROUP directives, but it is optional for the other
directives. Unlike the label field of an instruction,
the name field of a directive is never terminated
with a colon.
directive
One of the directive keywords defined in Section 3.
operand(s)
to
the
operands
for
instruction
Analogous
mnemonics. Some directives, such as DB and OW
operand;
others
have
speCial
allow
any
requirements.
comment
Exactly as defined
Section 2 9.1.
for
End of Section 2
.2-22
instruction
statements
in
SECTION 3
RASM-86 Directives
3.1
Introduction
RASM-86 directives control the assembly process by performing
functions such as assigning portions of code to logical segments,
requesting conditional assembly, defining data items, allocating
memory, specifying listing file format, and including source text from
external files.
RASM-86 directives are grouped into the following categories:
•
•
•
•
•
•
•
•
segment control
linkage control
conditional assembly
symbol definition
data definition and memory allocation
output listing control
8087 control
miscellaneous
3.2 Assembler Directive Syntax
The following is the general syntax for a directive statement:
[name]
directive
operand(s) [;comment]
The fields are defined as follows
name
Is a symbol that retains the value assigned by the
directive.
A name is required for the EOU and
GROUP directives, but it is optional for the other
directives.
Unlike the label field of an instruction,
the name field of a directive is never terminated
with a colon. Names can be used with the CSEG,
DSEG, ESEG, SSEG, GROUP, DB, DW, DD, RB, RW, RD,
RS, and EOU directives.
3-1
3.2 Assembler Directive Syntax
Programmer's Utilities Gui
directive
One of the directive keywords defined in Sectio
3.3 through 3.10.
operand(s)
Analogous
to
the
operands
for
instructic
mnemonics. Some directives, such as DB and 0'
allow
any
operand;
others
have
speci
requirements.
comment
Exactly as defined
Section 2.9.1.
for
instruction
statements
The following sections describe each RASM-86 directive.
for each directive follows each section heading.
i
The synta.
3.3 Segment Control Directives
This section describes the RASM-86 directives used to assign specific
attributes to segments. These attributes affect the way the segments
are handled during the link process. The available segment control
directives are:
CSEG
OSEG
ESEG
SSEG
GROUP
In order to utilize these directives, you must understand the
segmented architecture of the 8086 and 80286 processors.
The
following section summarizes the general characteristics of the
8086/80286 segmented architecture
3.3.1
The 8086/80286 Segmented Architecture
The address space of an 8086 or an 80286 processor can be
subdivided into an arbitrary number of units called segments. Each
segment is comprised of contiguous memory locations, up to 64k
bytes in length, making up logically independent and. seperately
addressable units.
3-2
Programmer's Utilities Guide
3.3 Segment Control Directives
Each segment must have a base address specifying its starting
location in the memory space.
Each segment base address must
begin on a paragraph boundary, a boundary divisible by 16.
Every location in the memory space has a physical address and a
logical address. A physical address is a value specifying a unique byte
location within the memory space.
A logical address is the
combination of a segment base value and an offset value. The offset
value is the address relative to the base of the segment. At run-time,
every memory reference is the combination of a segment base value
and an offset value that produces a physical address.
A physical
address can be contained in more than one logical segment.
The CPU can access four segments at a time. The base address of
each segment is contained in a segment register. The CS register'
points to the current code segment that contains instructions. The OS
register points to the current data segment usually containing program
variables. The SS register paints to the current stack segment where
stack operations such as temporary storage or parameter passing are
performed. The ES register points to the current Extra Segment that
typically also contains data.
RASM-86 segment directives allow you to divide your assembly
language source program into segments corresponding to the memory
segments where the resulting object code is loaded at run-time.
The size, type, and number of segments required by a program defines
which memory model the operating system should use to allocate
memory. Depending on which model you use, you can intermix all of
the code and data in a single 64K segment or you can have separate
Code and Data Segments, each up to 64K in length. The RASM-86
segment directives described below, allow you to create an arbitrary
number of Code, Data, StaCk, and Extra Segments to more fully use t~e
address space of the processor. You can have more than 64K of code
or data by using several segments and managing the segments with
the assembler directives.
3.3.2 CSEG, DSEG, ESEG, and SSEG Directives
Every instruction and variable in a program must be contained in a
segment. Segment directives allow you to specify the attributes of a
segment or a group of segments of the same type.
3-3
3.3 Segment Control Directives
Programmer's Utilities Guide
Create a segment and name it by using the segment directive syntax:
[seg_name] seg_ directive [align_type] [combine_type] ['class_name']
where seg_directive is one of the following:
CSEG
DSEG
ESEG
SSEG
(Code Segment)
(Data Segment)
(Extra Segment)
(Stack Segment)
The optional parameters are described below; note that class-name is
applicable only to native mode programs. Examples illustrating how
segment directives are used are provided at the end of this section.
seg_name
The segment name can be any valid RASM-86 identifier. If you do not
specify a segment name, RASM-86 supplies a default name, as shown
in Table 3-1.
Table 3-1.
Default Segment Names
Segment Directive
Default Segment Name
CSEG
DSEG
ESEG
SSEG
CODE
DATA
EXTRA
STACK
Once you use a segment directive, RASM-86 assigns statements to the
specified segment until it encounters another segment directive.
RASM-86 combines all segments with the same segment name even if
they are not contiguous in the source code.
3-4
Programmer's Utilities Guide
3.3 Segment Control Directives
align_type
The align type allows you to specify to the linkage editor a particular
boundary for the segment.
The linkage editor uses this alignment
information when combining segments to produce an executable file.
You can specify one of four different align types:
•
•
•
o
BYTE (byte alignment)
WORD (word alignment)
PARA (paragraph alignment)
PAGE (page alignment)
If you specify an align type, it must be with the first definition of the
segment.
You can omit the align type on subsequent segment
directives that name the same segment, but you cannot change the
original value. If you do not specify an align type, RASM-86 supplies a
default value based on the type of segment directive used. Table 3-2
shows the default values.
Table 3-2.
Default Align Types
Segment Directive
Default Align Type
CSEG
DSEG
ESEG
SSEG
BYTE
WORD
WORD
WORD
BYTE alignment means that the
following the previous segment
segment begins at the next byte
WORD alignment means that the segment begins on an even
boundary. An even boundary is a hexadecimal address ending in 0, 2,
4, 6, 8, A, C, or E. In certain cases, WORD alignment can increase
execution speed because the CPU takes only one memory cycle when
accessing word-length variables within a segment aligned on an even
boundary. Two cycles are needed if the boundary is odd.
3-5
3.3 Segment Control Directives
Programmer's Utilities Guide
PARA (paragraph) alignment means that the segment begins on a
paragraph boundary, that is, an address whose four low-order bits are
zero.
PAGE alignment means that the segment begins on a page boundary,
an address whose low order byte is zero.
combine_type
The combine type determines how the linkage editor can combine the
segment with other segments with the same segment name. You can
specify one of five different combine types:
•
•
•
•
•
PUBLIC
COMMON
STACK
LOCAL
nnnn (absolute segment)
If you specify a combine type, it must be in the first segment directive
for that segment type. You can omit the combine type on subsequent
segment directives for the same segment type, but you cannot change
the original combine type.
If you do not specify a combine type,
RASM-86 supplies the PUBLIC combine type by default; except for
SSEG, which uses the STACK combine type by default.
The RASM-86 combine types are defined as follows:
PUBLIC
means that the linkage editor can combine the
segment with other segments having the same
name. All such segments with combine type PUBLIC
are concatenated in the order they are encountered
by the linkage editor, with gaps, if any, determined
by the align type of the segment.
COMMON
means that the segment shares identical memory
locations with other segments of the same name.
Offsets inside a COMMON segment are absolute
unless the segment is contained in a GROUP (see
"Group Directive" in this section).
3-6
Programmer's Utilities Guide
3.3 Segment Control Directives
STACK
is similar to PUBLIC, in that the storage allocated for
STACK segments is the sum of the STACK segments
from
each
module.
However,
instead
of
concatenating segments with the same name, the
linkage editor overlays STACK segments against
high memory, because stacks grow downward from
high addresses to low addresses when the program
runs.
LOCAL
means that the segment is local to the program
being assembled, and the linkage editor will na.t
combine it with any other segments.
ABSOLUTE SEGMENT
causes RASM-86 to determine the load-time
position of the segment during assembly, rather
than allowing its position to be determined by the
linkage editor, or at load time.
class_name (native-mode only)
The class name can be any valid RASM-86 identifier. The class name
identifies segments to be placed in the same section of the CMD file
created by L1NK-86. Unless overridden by a GROUP directive or an
explicit command in the L1NK-86 command line, L1NK-86 places
segments into the CMD file it creates as shown in Table 3-3.
Table 3-3.
Default Class Name for Segments
Segment Directive
Default Class Name
Section of CMD file
CSEG
DSEG
ESEG
SSEG
CODE
DATA
EXTRA
STACK
CODE
DATA
EXTRA
STACK
3-7
3.3 Segment Control Directives
Programmer's Utilities Guide
Examples:
The following are examples of segment directives:
CSEG
DSEG
CSEG
DATASEG
CODEl
XYZ
PAGE
DSEG
CSEG
DSEG
PARA
'DATA'
BYTE
WORD
The example RASM-86 source file
segment directives are used.
in
COMMON
Appendix A illustrates
how
3.3.3 GROUP Directive
group_name GROUP segment_name1, segment_name2, ...
The GROUP directive instructs RASM-86 to combine the named
segments into a collection called a group whose length can be up to
64K bytes. When segments are grouped together, L1NK-86 treats the
group as it would a single segment by making the offsets within the
segments -of a group relative to the beginning of the group rather than
to the b'eginning of the individual segments.
The order of the segment names in the directive is the order that
L1NK-86 arranges the segments in the executable file.
Use of groups can result in more efficient code, because a number of
segments can be addressed from a single segment register without
having to change the contents of the segment register.
See Section 7.12 for more information on the grouping and other link
processes.
3.4 Linkage Control Directives
Linkage control directives modify the link process.
linkage control directives are:
3-8
The
available
Programmer's Utilities Guide
3.4 Linkage Control Directives
END
NAME
PUBLIC
EXTRN
3.4.1
END Directive
END [start label]
The END directive marks the end of a source file. RASM-86 ignores
any subsequent lines. The END directive is optional, and if omitted,
RASM-86 processes the source file until it finds an end-ot-file
character (lAH).
The optional start label serves two purposes.
First it defines the
current module as the main program. When LlNK-86 links modules
together, only one can be a main program.
Second, start label
indicates where the program is to start executing after it is loaded. It
start label is omitted, program execution begins at the beginning of
the first CSEG from the files linked.
3.4.2 NAME Directive
NAME
module name
The NAME directive assigns a name to the object module generated by
RASM-86. The module name can be any valid identifier based on the
guidelines described in Section 2.6. If you do not specify a module
name with the NAME directive, RASM-86 assigns the source filename
to the object module. Both LlNK-86 and LlB-86 use NAME directives
to identify object modules.
3.4.3
PUBLIC Directive
PUBLIC name
L name,
.. ]
The PUBLIC directive instructs RASM-86 that the names defined as
PUBLIC can be referenced by other programs linked together. Each
name must be a label, variable, or a number defined within the
program being assembled.
3-9
3.4 Linkage Control Directives
Programmer's Utilities Guide
3.4.4 EXTRN Directive
EXTRN
The EXTRN directive tells RASM-86 that each external id can be
referenced in the program being assembled but is defined in some
other program. The external id consists of two parts: a symbol and a
type.
The external id uses the form:
symbol:type
where "symbol" is a variable, label, or number and "type" is one of the
following:
• Variables: BYTE, WORD, or DWORD
• Labels: NEAR or FAR
• Numbers: ABS
For example,
EXTRN
FCB:BYTE,BUFFER:WORD,INIT:FAR,MAX:ABS
RASM-86 determines the Segment attribute of external variables and
labels from the segment containing the EXTRN directive.
Thus, an
EXTRN directive for a given symbol must appear within the same
segment as the module in which the symbol is defined.
3.5 Conditional Assembly Directives
Conditional assembly directives are used to set up conditions
The available conditional
controlling the instruction sequence.
assembly directives are:
IF
ELSE
ENDIF
3-10
Programmer's Utilities Guide
3.5.1
3.5 Conditional Assembly Directives
IF,ELSE, and ENDIF Directives
IF
numeric expression
source line 1
source line 2
source line n
ELSE
alternate source line 1
alternate source line 2
alternate source line n
ENDIF
The IF and ENDIF directives allow you to conditionally include or
exclude a group of source lines from the assembly. The optional ELSE
directive allows you to specify an alternative set of source lines. You
can use these conditional directives to assemble several different
versions of a single source program. You can nest IF directives to five
levels.
When RASM-86 encounters an IF directive, it evaluates the numeric
expression following the IF keyword. You must define ali elements in
the numeric expression before you use them in the IF directive. If the
value of the expression is nonzero, then RASM-86 assembles source
line 1 through source line n. If the value of the expression is zero,
then RASM-86 lists all the lines, but does not assemble them.
If the value of the expression is zero, and you specify an ELSE
directive between the IF and ENDIF directives, RASM-86 assembles
alternative source lines 1 through alternative source lines n.
3-11
3.6 Symbol Definition Directive
Programmer's Utilities Guide
3.6 Symbol Definition Directive
The available symbol definition directive is:
EOU
3.6.1
eau
Directive
symbol_name EOU
symbol_name EOU
symbol name EOU
symbol=name EOU
numeric_expression
address_expression
register
instruction mnemonic
The EOU (equate) directive assigns values and attributes to userdefined symbols. Do not put a colon after the symbol name. Once
you define a symbol, you cannot redefine the symbol with a
subsequent EOU or another directive.
You must also define any
elements used in numeric expressions or an address expression before
using the EOU directive.
The first form of the EOU directive assigns a numeric value to the
symbol. The second form assigns a memory address. The third form
assigns a new name to an 8086 or 80286 register. The fourth form
defines a new instruction (sub)set.
The following are examples of
these four EOU forms.
0005
0033
0001
0050 8BC3
3-12
FIVE
EQU
NEXT
EQU
COUNTER EQU
MOVVV
EQU
MOVVV
2*2+1
BUFFER
CX
MOV
AX/BX
Programmer's Utilities Guide
3.7 Data and Memory Directives
3.7 Data and Memory Directives
Data definition and memory allocation directives define the storage
format used for a specified expression or constant. The available data
definition and memory allocation directives are:
DB
OW
DO
RS
RB
RW
RD
3.7.1
DB Directive
[symbol] DB numeric expression Lnumeric expression ... ]
[symbol] DB string_constant Lstring_constant...]
The DB directive defines initialized storage areas in byte format.
RASM-86 evaluates numeric expressions to 8-bit values and
sequentially places them in the object file.
RASM-86 places string
constants in the object file according to the rules defined in Section
2.5.2. Note that RASM-86 does not perform translation from lower- to
uppercase within strings.
The 08 directive is the only RASM-86 statement that accepts a string
constant longer than two bytes. You can add multiple expressions or
constants, separated by commas, to the definition if it does not exceed
the physical line length.
Use an optional symbol to reference the defined data area throughout
the program. The symbol has four attributes:
•
•
•
•
segment
offset
type
length
The segment and offset attributes determine the symbol's memory
reference; the type attribute specifies single bytes, and the length
attribute tells the number of bytes reserved.
3-13
3.7 Data and Memory Directives
Programmer's Utilities Guide
The following listing shows· examples
resulting hexadecimal values:
of
DB
directives
and
the
005F 43502F4D2073 TEXT
797374656DOO
006B E1
AA
006e 0102030405
X
DB
'CP/M system',O
DB
DB
'a' + 80H
1,2,3,4,5
0071 B90COO
MOV
CX,LENGTH TEXT
3.7.2 OW Directive
[symbol]
[symbol]
OW numeric expression Lnumeric expression ... ]
OW string_constant Lstring_constant ... ]
The OW directive initializes two-byte words of storage.
The OW
directive initializes storage the same way as the DB directive, except
that each numeric expression, or string constant initializes two bytes
of memory with the low-order byte stored first. The OW directive
does not accept string constants longer than two characters.
The following are examples of OW directives
0074 0000
CNTR
0076 63C166C169C1 JMPTAB
007C 010002000300
040005000600
OW
OW
ow
o
SUBR1,SUBR2,SUBR3
1,2,3,4,5,6
3.7.3 DO Directive
[symbol)
DO address expression Laddress _expression]
The DO directive initializes four bytes of storage. DO follows the same
procedure as DB, except that the offset attribute of the address
expression is stored in the two lower bytes and the segment attribute
is stored in the two upper bytes. For example,
3-14
Programmer's Utilities Guide
3.7 Data and Memory Directives
CSEG
0000 6CC100006FC1 LONG JMPTAB
0000
0008 72C1000075C1
0000
DO
ROUTl,ROUT2
DD
ROUT3,ROUT4
3.7.4 RS Directive
[symbol] RS
numeric expression
-
The RS directive allocates storage in memory but does not initialize it.
The numeric expression gives the number of bytes to reserve. Note
that the RS directive just allocates memory without specifying byte,
word, or long attributes. For example,
0010
0060
4060
3.7.5
BUF
RS
RS
RS
80
4000H
1
RS Directive
[symbol] RS
numeric_expression
The RS directive allocates byte storage in memory without any
initialization. The RB directive is identical to the RS directive except
that it gives the byte attribute. For example,
4061
4161
C161
BUF
RB
RB
RB
48
4000H
1
3.7.6 RW Directive
[symbol) RW
numeric expression
Ttie RW directive allocates two-byte word storage in memory but does
not initialize it. The numeric expression gives the number of words to
be reserved. For example,
3-15
3.7 Data and Memory Directives
4061
4161
C161
Programmer's Utilities Guide
RW
RW
RW
BUFF
128
4000H
1
3.7.7 RD Directive
[svmbol] RD numeric_expression
The RD directive reserves a double word (four bytes) of storage but
does not initialize it. For example,
C163
C173
DWTAB
RD
RD
4
1
3.8 Output Listing Control Directives
Output listing control directives modify the list file format.
available output listing control directives are:
The
EJECT
IFUST
NOIFLIST
LIST
NOLIST
PAGESIZE
PAGEWIDTH
SIMFORM
TITLE
3.S.1
EJECT Directive
EJECT
The EJECT directive performs a page eject during printout. The EJECT
directive is printed on the first line of the next page.
3-16
Programmer's Utilities Guide
3.8 Output Listing Control Directives
3.8.2 NOIFLIST /IFLIST Directives
NOIFLIST
IFLIST
The NOIFLIST directive suppresses the printout of the contents of
conditional assembly blocks that are not assembled
The IFLIST
directive resumes printout of these blocks.
3.8.3 NOLIST and LIST Directives
NOLIST
LIST
The NOLIST directive suppresses the printout of lines following the
directive. The LIST directive restarts the listing.
3.8.4 PAGESIZE Directive
PAGESIZE
numeric_expression
The PAGESIZE directive defines the number of lines on each printout
page. The default page size is 66 lines.
3.8.5 PAGEWIDTH Directive
PAGEWIDTH
numeric_expression
The PAGEWIDTH directive defines the number of columns printed
across the page of the listing file.
The default page width is 120
unless the listing is routed directly to the console; then the default
page width is 79.
3.8.6 SIMFORM Directive
SIMFORM
The SIMFORM directive replaces a form-feed (FF) character in the list
file with the correct number of line-feeds (LF). Use this directive when
directing a list file to a printer unable to interpret the form-feed
character.
3-17
3.S Output listing Control Directives
Programmer's Utilities Guide
3.8.7 TITLE Directive
TITLE
string_constant
RASM-S6 prints the string constant defined by a TITLE directive
statement at the top of each printout page in the listing file. The title
character string can be up to 30 characters in length. For example,
TITLE
'CP/M monitor'
3.9 8087 Control Directives
An Intel S087 coprocessor is not available on all systems.
When
writing programs using 8087 opcodes, you can use the 8087 control
directives to instruct RASM-86 to either generate actual 8087 opcodes
or to emulate the 8087 routines in software.
The available 8087
control directives are:
HARD80S7
AUTOS087
3.9.1 HARD8087 Directive
HARD8087
When an SOS7 processor is available on your system and you do not
want to emulate the 8087 routines in software, you can use the
HARDSOS7 directive to instruct RASM-86 to generate 8087 opcodes.
Using this option saves about 16K bytes of space that would otherwise
be used by the emulation routines.
3.9.2 AUT08087 Directive
AUT08087
You can use the AUT08087 option to create programs that decide at
runtime whether or not to use the 8087 processor. AUT08087 is the
default option.
When you use this option, LlNK-86 includes in the
command file the 8087 emulation routines and a table of fixup records
that point to the 8087 opcodes
3-18
Programmer's Utilities Guide
3.9 8087 Control Directives
If you use the AUT08087 option and the system has an 8087, the 8087
fixup table is ignored and the space occupied by the emulation
routines is released to the program for heap space. If the system
does not have an 8087, the initialization routine replaces all the 8087
opcodes with interrupts that vector into the 8087 emulation routines.
Note that. in order to emulate 8087 routines, you must have a runtime
library from a Digital Reasearch high-level language, such as DR C or
CBASIC present on your disk and it must be specified on the LlNK-86
command line.
3.10 Miscellaneous Directives
Additional RASM-86 directives are:
INCLUDE
ORG
3.10.1
INCLUDE Directive
INCLUDE
filename
The INCLUDE directive includes another RASM-86 source file in the
source text. For example, to include the file EQUALS in your text. you
would enter:
INCLUDE
EQUALS.A86
You can use the INCLUDE directive when the source program is large
and resides in several files.
Note that you cannot nest INCLUDE
directives; a source file called by an INCLUDE directive cannot contain
another INCLUDE directive.
If the file named in the INCLUDE directive does not have a filetype,
RASM-86 assumes the filetype to be A86.
If you do not specify a
drive name with the file, RASM-86 uses the drive containing the
source file.
3-19
3.10 Miscellaneous Directives
Programmer's Utilities Guide
3.10.2 ORG Directive
ORG numeric_expression
The ORG directive sets the offset of the location counter in the current
segment to a value specified by the numeric expression. You must
define all elements of the expression before using the ORG directive,
and the expression must evaluate to an absolute number.
The offset specified by the numeric expression is relative to the offset
specified by the location counter within the segment at load-time.
Thus, if you use an ORG statement in a segment that the linkage
editor does not combine with other segments at link.-time, such as
LOCAL or absolute segments, then the numeric expression indicates
the actual offset within the segment.
If the segment is combined with others at link.-time, such as PUBLIC
segments, then numeric expression is not an absolute offset. It is
relative to the beginning address of the segment from the program
being assembled.
The
When using the ORG directive, never assume the align type.
desired align type should always be explicitly declared. For example, if
you use the command:
ORG 0
The segments must be aligned on a paragraph boundary. Therefore,
the PARAGRAPH align type must have been specifically declared,
End of Section 3
3-20
SECTION 4
RASM-86 Instruction Set
4.1
Introduction
The RASM-86 instruction set includes all 8086, 8087, 80186, and 80286
machine instructions. The general syntax for instruction statements is
described in Section 2.9. This section defines the specific syntax and
required operand types for each instruction without reference to labels
or comments. The instruction definitions are presented in tables for
easy reference.
For a more detailed description of each instruction, see the Intel
assembly language reference manual for the processor you are using.
For descriptions of the instruction bit patterns and operations, see the
Intel user's manual for the processor you are using.
The
instruction-definition
tables
present
RASM-86
instruction
statements as combinations of mnemonics and operands.
A
mnemonic is a symbolic representation for an instruction; its operands
are its required parameters. Instructions can take zero, one, or two
operands. When two operands are specified, the left operand is the
instruction's destination operand, and the two operands are_separated
by a comma.
4.2
RASM-86 Instruction Set Summary
Table 4-1 summarizes the complete RASM-86 instruction set in
alphabetical order. The following tables categorize these instructions
into functional groups in which each instruction is defined in detail.
4-1
4.2 RASM-86 Instruction Set Summary
Table 4-1.
Mnemonic
AAA
AAD
AAM
AAS
ADC
ADD
AND
ARPL
BOUND
CALL
CALLF
CBW
CLC
CLD
CLI
CMC
CMP
CMPS
CMPSB
CMPSW
CTS
CWO
DAA
DAS
DEC
DIV
ENTER
ESC
F2XMl
FABS
FADD
FADD32
FADD64
4-2
Programmer's Utilities Guide
RASM-86 Instruction Summary
Description
ASCII adjust for Addition
ASCII adjust for Division
ASCII adjust tor Multiplication
ASCII adjust tor Subtraction
Add with Carry
Add
And
Adjust Priviledge level
Check Array Index Against Bounds
Call (intra segment)
Call (inter segment)
Convert Byte to Word
Clear Carry
Clear Direction
Clear Interrupt
Complement Carry
Compare
Compare Byte or Word (of string)
Compare Byte (of string)
Compare Word (of string)
Clear Task Switched Flag
Convert Word to Double Word
Decimal Adjust for Addition
Decimal Adjust for Subtraction
Decrement
Divide
Procedure Entry
Escape
2x-l
Absolute Value
Add Real
Add Real, 32-bit
Add Real, 64-bit
Section
4.3.4
4.3.4
4.3.4
4.3.4
4.3.4
4.3.4
4.3.4
4.3.10
4.3.9
4.3.6
4.3.6
4.3.4
4.3.7
4.3.7
4.3.7
4.3.7
4.3.4
4.3.5
4.3.5
4.3.5
4.3.10
4.3.4
4.3.4
4.3.4
4.3.4
4.3.4
4.3.9
4.3.7
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
Programmer's Utilities Guide
4.2 RASM-85 Instruction Set Summary
Table 4-1.
Mnemonic
FADDP
FBLD
FBSTP
FCHS
FCLEX/FNCLEX
FCOM
FCOM32
FCOM54
FCOMP
FCOM32P
FCOM54P
FCOMPP
FDECSTP
FDISIIFNDISI
FDIV
FDIV32
FDIV64
FDIVR
FDIVR32
FDIVR64
FDIVRP
FDUP
FENIIFNENI
FFREE
FIADD16
FIADD32
FICOM16
FICOM32
FICOM16P
FICOM32P
FIQIV16
FIDIV32
FIDIVR16
(Continued)
Description
Add Real and Pop
Packed Decimal Load
Packed Decimal Store and Pop
Change Sign
Clear Exceptions
Compare Real
Compare Real, 32-bit
Compare Real, 54-bit
Compare Real and Pop
Compare Real and Pop, 32-bit
Compare Real and Pop, 54-bit
Compare Real and Pop Twice
Decrement Stack Pointer
Disable Interrupts
Divide Real
Divide Real, 32-bit
Divide Real, 64-bit
Divide Real Reversed
Divide Real Reversed, 32-bit
Divide Real Reversed, 64-bit
Divide Real Reversed and Pop
Duplicate Top of Stack
Enable Interrupts
Free Register
Integer Add, 16-bit
Integer Add, 32-bit
Integer Compare, 'i 6-bit
Integer Compare, 32-bit
Integer Compare and Pop, 16-bit
Integer Compare and Pop, 32-bit
Integer Divide, 16-bit
Integer Divide, 32-bit
Integer Divide Reversed, 16-bit
Section
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4-3
4.2 RASM-B6lnstruction Set Summary
Programmer's Utilities Guide
Table 4-1. (Continued)
Mnemonic
FIDIVR32
FILD16
FILD32
FILD64
FIMUL 16
FIMUL32
FINCSTP
FINIT/FNINIT
FIST16
FIST32
FIST16P
FIST32P
FIST64P
FISUB16
FISUB32
FISUBR16
FISUBR32
FlO
FlO32
FLD64
FlOBO
FlOCW
FlOENV
FlOZ
FLDl
FLDPI
FlOL2T
FlOL2E
FLDLG2
FLDLN2
FMUL
FMUL32
FMUL64
4-4
Description
Integer Divide Reversed, 32-bit
Integer Load, 16-bit
Integer Load, 32-bit
Integer Load, 64-bit
Integer Multiply, 16-bit
Integer Multiply, 32-bit
Increment Stack Pointer
Initialize Processor
Integer Store, 16-bit
Integer Store, 32-bit
Interger Store and Pop, 16-bit
Interger Store and Pop, 32-bit
Interger Store and Pop, 54-bit
Integer Subtract, 15-bit
Integer Subtract, 32-bit
Integer Subtract Reversed, 16-bit
Integer Subtract Reversed, 32-bit
Load Real
Load Real, 32-bit
Load Real, 64-bit
Load Real, BO-bit
Load Control Word
Load Environment
Load + 0.0
Load + 1.0
Load BO-bit value for pi.
Load 109210
Load log2e
Load 109102
Load 10ge2
Multiply Real
Multiply Real, 32-bit
Multiply Real, 54-bit
Section
4.3.B
4.3.B
4.3.B
4.3.B
4.3.B
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.B
4.3.8
4.3.8
4.3.8
4.3.B
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.B
4.3.8
4.3.B
4.3.8
4.3.B
4.3.8
4.3.B
4.3.8
4.3.8
4.3.8
Programmer's Utilities Guide
4.2 RASM-86 Instruction Set Summary
Table 4-1.
Mnemonic
FMULP
FNOP
FPATAN
FPOP
FPREM
FPTAN
FRNDINT
FRSTOR
FSAVE/FNSAVE
FSCALE
FST
FST32
FST64
FSTP
FST32P
FST64P
FSTENV/FNSTENV
FSTCW/FNSTCW
FSTSW/FNSTSW
FSQRT
FSUB
FSUB32
FSUB54
FSUBP
FSUBR
FSUBR32
FSUBR54
FSUBRP
FTST
FWAIT
FXAM
FXCH
FXCHG
(Continued)
Description
Multiply Real and Pop
No Operation
Partial Arctangent
same as FSTP STO
Partial Remainder
Partial Tangent
Round to Integer
Restore State
Save State
Scale
Store Real
Store Real, 32-bit
Store Real, 54-bit
Store Real and Pop
Store Real and Pop, 32-bit
Store Real and Pop, 64-bit
Store Environment
Store Control Word
Store Status Word
Square Root
Subtract Real
Subtract Real, 32-bit
Subtract Real, 54-bit
Subtract Real and Pop
Subtract Real Reversed
Subtract Real Reversed, 32-bit
Subtract Real Reversed, 54-bit
Subtract Real Reversed and Pop
Test
CPU Wait
Examine
Exchange Registers
same as FXCH STl
Section
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.3.8
4.38
4.3.8
4-5
4.2 RASM-86 Instruction Set Summary
Programmer's Utilities Guide
Table 4-1. (Continued)
Mnemonic
FXTRACT
FYL2X
FYL2XPl
HLT
IDIV
IMUL
IN
INC
INSB
INSW
INT
INTO
IRET
JA
JAE
JB
JBE
JC
JCXZ
JE
JG
JGE
JL
JLE
JMP
JMPF
JMPS
JNA
JNAE
JNB
JNBE
JNC
JNE
4-6
Description
Extract Exponent and Significand
* log2X
Y * log2(X + 1)
Halt
Integer Divide
Integer Multiply
Input Byte or Word
Increment
Input Byte from Port to String
Input Word from Port to String
Interrupt
Interrupt on Overflow
Interrupt Return
Jump on Above
Jump on Above or Equal
Jump on Below
Jump on Below or Equal
Jump on Carry
Jump on CX Zero
Jump on Equal
Jump on Greater
Jump on Greater or Equal
Jump on Less
Jump on Less or Equal
Jump (intra segment)
Jump (inter segment)
Jump (8 bit dispiacement)
Jump on Not Above
Jump on Not Above or Equal
Jump on Not Below
Jump on Not Below or Equal
Jump on Not Carry
Jump on Not Equal
Y
Section
4.3.8
4.3.8
4.3.8
4.3.7
4.3.4
4.3.4
4.3.3
4.3.4
4.3.9
4.3.9
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
Programmer's Utilities Guide
4.2 RASM-86 Instruction Set Summary
Table 4-1. (Continued)
Mnemonic
JNG
JNGE
JNL
JNLE
JNO
JNP
JNS
JNZ
JO
JP
JPE
JPO
JS
JZ
LAHF
LAR
LDS
LEA
LEAVE
LES
LGDT
LlDT
LLDT
LMSW
LOCK
LODS
LODSB
LODSW
LOOP
LOOPE
LOOPNE
LOOPNZ
LOOPZ
Description
Jump on Not Greater
Jump on Not Greater or Equal
Jump on Not Less
Jump on Not Less or Equal
Jump on Not Overflow
Jump on Not Parity
Jump on Not Sign
Jump on Not Zero
Jump on Overflow
Jump on Parity
Jump on Parity Even
Jump on Parity Odd
Jump on Sign
Jump on Zero
Load AH with Flags
Load Access Rights
Load Pointer into DS
Load Effective Address
High Level Procedure Exit
Load Pointer into ES
Load Global Descriptor Table Register
. Load Interrupt Descriptor Table Register
Load Local Descriptor Table Register
Load Machine Status Word
Lock Bus
Load Byte or Word (of string)
Load Byte (of string)
Load Word (of string)
Loop
Loop While Equal
Loop While Not Equal
Loop While Not Zero
Loop While Zero
Section
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4.3.3
4.3.10
4.3.3
4.3.3
4.3.9
4.3.3
4.3.10
4.3.10
4.3.10
4.3.10
4.3.7
4.3.5
4.3.5
4.3.5
4.3.6
4.3.6
4.3.6
4.3.6
4.3.6
4-7
4.2 RASM-86 Instruction Set Summary
Programmer's Utilities Guide
Table 4-1. (Continued)
Mnemonic
LSL
LTR
MOV
MOVS
MOVSB
MOVSW
MUL
NEG
NOP
NOT
OR
OUT
OUTSB
OUTSW
POP
POPA
POPF
PUSH
PUSHA
PUSHF
RCL
RCR
REP
REPE
REPNE
REPNZ
REPZ
RET
RETF
ROL.
ROR
SAHF
SAL
4-8
Description
Load Segment Limit
Load Task Register
Move
Move Byte or Word (of string)
Move Byte (of string)
Move Word (of string)
Multiply
Negate
No Operation
Not
Or
Output Byte or Word
Output Byte Pointer [sil to DX
Output Word Pointer [sil to DX
Pop
Pop all General Registers
Pop Flags
Push
Push all General Registers
Push Flags
Rotate through Carry Left
Rotate through Carry Right
Repeat
Repeat While Equal
Repeat While Not Equal
Repeat While Not Zero
Repeat While Zero
Return (intra segment)
Return (inter segment)
Rotate Left
Rotate Right
Store AH into Flags
: Shift Arithmetic Left
Section
4.3.10
4.3.10
4.3.3
4.3.5
4.3.5
4.3.5
4.3.4
4.3.4
4.3.7
4.3.4
4.3.4
4.3.3
4.3.9
4.3.9
4.3.3
4.3.9
4.3.3
4.3.3
4.3.9
4.3.3
4.3.4
4.3.4
4.3.5
4.3.5
4.3.5
4.3.5
4.3.5
4.3.6
4.3.6
4.3.4
4.3.4
4.3.3
4.3.4
Programmer's Utilities Guide
4.2 RASM-86 Instruction Set Summary
Table 4-1.
Mnemonic
SAR
SBB
SCAS
SCASB
SCASW
SGDT
SHL
SHR
SlOT
SLOT
SMSW
STC
STD
STI
STOS
STOSB
STOSW
STR
SUB
TEST
VERR
VERW
WAIT
XCHG
XLAT
XOR
(Continued)
Description
Shift Arithmetic Right
Subtract with Borrow
Scan )yte or Word (of string)
Scan Byte (of string)
Scan Word (of string)
Store Global Descriptor Table Register
Shift Left
Shift Right
Store Interrupt Descriptor Table Register
Store Local Descriptor Table Register
Store Machine Status Word
Set Carry
Set Direction
Set Interrupt
Store Byte or Word (of string)
Store Byte (of string)
Store Word (of string)
Store Task Register
Subtract
Test
Verify Read Access
Verify Write Access
Wait
Exchange
Translate
Exclusive Or
Section
4.3.4
4.3.4
4.3.5
4.3.5
4.3.5
4.3.10
4.3.4
4.3.4
4.3.10
4.3.10
4.3.10
4.3.7
4.3.7
4.3.7
4.3.5
4.3.5
4.3.5
4.3.10
4.3.4
4.3.4
4.3.10
4.3.10
4.3.7
4.3.3
4.3.3
4.3.4
4-9
4.3 Instruction-definition Tables
Programmer's Utilities Guide
4.3 lnstruction-definition Tables
4.3.1
Symbol Conventions
The instruction-definition tables organize RASM-86 instructions into
functional groups.
In each table, the instructions are listed
alphabetically. Table 4-2 shows the symbols used in the instructiondefinition tables to define operand types.
Table 4-2.
Symbol
4-10
Operand Type Symbols
Operand Type
numb
any numeric expression
numbS
any numeric expression that evaluates
to an a-bit number
acc
accumulator register, AX or AL
reg
any general purpose register
not a segment register
reg16
a 16-bit general purpose register
not a segment register
segreg
any segment register:
or ES
CS, OS, SS,
Programmer's Utilities Guide
Table 4-2.
Symbol
mem
4.3 Instruction-definition Tables
(Continued)
Operand Type
any address expression with or
without base- and/or indexaddressing modes, such as the
following:
variable
variable+3
variable[bx]
variable[SI]
variable[BX+SI]
[BX]
[BP+DI]
simpmem
any address expression without baseand index-addressing modes,
such as the following
variable
variable+4
memlreg
any expression symbolized by reg
or mem
memlreg 16
any expression symbolized by
memlreg, but must be 16 bits
label
any address exprassion that
evaluates to a label
labS
any label within +/- 12S
bytes distance from the
instruction
4-11
4.3 Instruction-definition Tables
Programmer's Utilities Guide
4.3.2 Flag Registers
The 8086 and 80286 CPUs have nine single-bit Flag registers that can
be displayed to reflect the state of the processor. You cannot access
these registers directly, but you can test them to determine the effects
of an executed instruction upon an operand or register. The effects of
instructions on Flag registers are also described in the instructiondefinition tables, using the symbols shown in Table 4-3 to represent
the nine Flag registers.
Table 4-3.
Flag Register Symbols
Symbol
AF
CF
DF
IF
OF
PF
SF
TF
ZF
Meaning
Auxiliary Carry Flag
Carry Flag
Direction Flag
Interrupt Enable Flag
Overflow Flag
Parity Flag
Sign Flag
Trap Flag
Zero Flag
4.3.3 8086 Data Transfer Instructions
There are_four classes of data transfer operations:
•
•
•
•
general purpose
accumulator specific
address-object
flag
Only SAHF and POPF affect flag settings. Note in Table 4-4 that if acc
= AL, a byte is transferred, but if ace = AX, a word is transferred
4-12
Programmer's Utilities Guide
Table 4-4.
Syntax
4.3 Instruction-definition Tables
8086 Data Transfer Instructions
Result
IN
acc,numbS
transfer data from input port
given by numbS (0-255) to
accumulator
IN
acc,oX
transfer data from input port
given by OX register (O-OFFFFH)
to accumulator
LAHF
transfer flags to the AH register
LOS
reg16,mem
transfer the segment par;t of the
memory address (oWORo·
variable) to the OS segment
register; transfer the offset part
to a general purpose 16-bit
register
LEA
reg 16,mem
tra nsfer the offset of the memory
address to a 16-bit register
LES
reg 16,mem
transfer the segment part of the
memory address to the ES
segment register; transfer the
offset part to a 16-bit general
purpose register
MOV
reg,mem/reg
move memory or register to
register
MOV
mem/reg.reg
move register to memory or
register
4-13
4.3 Instruction-definition Tables
Programmer's Utilities Guide
Table 4-4. (Continued)
Syntax
Result
MOV
memlreg,numb
move immediate data to memory
or register
MOV
segreg,memlreg 16
move memory or register to
segment register
MOV
memlreg 16,segreg
move segment register to
memory or register
OUT
numb8,acc
transfer data from accumulator to
output port (0-255) given by
numb8
OUT
OX,acc
transfer data from accumulator to
output port (O-OFFFFH) given by
OX register
POP
memlreg16
move top stack element to
memory or register
POP
segreg
move top stack element to
segment register; note that CS
segment register is not allowed
POPF
transfer top stack element to
flags
PUSH
memlreg16
move memory or register to top
stack element
PUSH
segreg
move segment register to top
stack element
4-14
Programmer's Utilities Guide
4.3 Instruction-definition Tables
Table 4-4. (Continued)
Syntax
Result
PUSHF
transfer flags to top stack
element
SAHF
transfer the AH register to flags
XCHG
reg,memlreg
exchange register and memory or
register
XCHG
memlreg,reg
exchange memory or register and
register
XLAT
memlreg
perform table lookup translation,
table given by memlreg, which is
always BX. Replaces AL with AL
offset from BX
4.3.4 8086 Arithmetic, Logical, and Shift Instructions
The 8086 and 80286 CPUs p'erform addition, subtraction, multiplication,
and division in several ways.
Both CPUs support' 8- - and- 16-bit
operations and also signed and unsigned arithmetic.
Six of the
operations
summarizes
4-6 defines
instructions.
nine flag bits are set or cleared by most arithmetic
to reflect the result of the operation.
Table 4-5
the effects of arithmetic instructions on flag bits. Table
arithmetic instructions. Table 4-7 defines logical and shift
4-15
4,3 Instruction-definition Tables
Table 4-5.
Flag Bit
Programmer's Utilities Guide
Effects of Arithmetic Instructions on Flags
Result
CF
is set if the operation results in a carry out of (from
addition) or a borrow into (from subtraction) the
high-order bit of the result; otherwise CF is cleared.
AF
is set if the operation results in a carry out of (from
addition) or a borrow into (from subtraction) the
low-order four bits of the result; otherwise AF is
cleared,
ZF
is set if the result of
otherwise ZF is cleared,
SF
is set if the result is negative,
PF
is set if the modulo 2 sum of the low-order eight
bits of the result of the operation is 0 (even parity);
otherwise PF is cleared (odd parity).
OF
is set if the operation results in an overflow; the
size of the result exceeds the capacity of its
destination,
4-16
the
operation
is
zero;
Programmer's Utilities Guide
Table 4-6.
Syntax
4.3 Instruction-definition Tables
8086 Arithmetic Instructions
Result
AM
adjust unpacked BCD (ASCII) for
addition - adjusts AL
AAD
adjust unpacked BCD (ASCII) for
division - adjusts AL
AAM
adjust unpacked BCD (ASCII) for
multiplication - adjusts AX
AAS
adjust unpacked BCD (ASCII) for
subtraction - adjusts AL
ADC
reg,memjreg
add (with carry) memory or
register to register
ADC
memjreg,reg
add (with carry) register to
memory or register
ADC
memjreg,numb
add (with carry) immediate data
to memory or register
ADD
reg,memjreg
add memory or register to
register
ADD
memjreg,reg
add register to memory or
register
ADD
memjreg,numb
add immediate data to memory or
register
CBW
convert byte in AL to word in AX
by sign extension
4-17
4.3 Instruction-definition Tables
Programmer's Utilities Guide
Table 4-6. (Continued)
Syntax
Result
CMP
reg,memlreg
compare memory or register with
register
CMP
memlreg,reg
compare register with memory or
register
CMP
memlreg,numb
compare data constant with
memory or register
CWO
convert word in AX to double
word in OX/AX by sign extension
OAA
decimal adjust for addition,
adjusts AL
OAS
decimal adjust for subtraction,
adjusts AL
DEC
memlreg
subtract 1 from memory or
register
OIV
memlreg
divide (unsigned) accumulator (AX
or AL) by memory or register. If
byte results, AL = quotient, AH =
remainder If word results, AX =
quotient. OX = remainder
IOlV
memlreg
divide (signed) accumulator (AX
or AL) by memory or register quotient and remainder stored as
in OIV
4-18
Programmer's Utilities Guide
Table 4-6.
Syntax
4.3 Instruction-definition Tables
(Continued)
Result
IMUL
memlreg
multiply (signed) memory or
register by accumulator (AX or
AL). If byte, results in AH, AL. If
word, results in DX, AX.
INC
mem/reg
add 1 to memory or register
MUL
memlreg
multiply (unsigned) memory or
register by accumulator (AX or
AL). Results stored as in IMUL.
NEG
memlreg
two's complement memory or
register
SBB
reg,mem/reg
subtract (with borrow) memory or
register from register
SBB
memlreg,reg
subtract (with borrow) register
from memory or register
SBB
memlreg,numb
subtract (with borrow) immediate
data from memory or register
SUB
reg,mem/reg
subtract memory or register from
register
SUB
memlreg,reg
subtract register from memory or
register
SUB
memlreg,numb
subtract data constant from
memory or register
4-19
4.3 Instruction-definition Tables
Table 4-7.
Syntax
Programmer's Utilities Guide
8086 Logical and Shift Instructions
Result
AND
reg,memlreg
perform bitwise logical AND of a
register and memory or register
AND
memlreg,reg
perform bitwise logical AND of
memory or register and register
AND
memlreg,numb
perform bitwise logical AND of
memory or register and data
constant
NOT
memlreg
form one's complement of
memory or register
OR
reg,memlreg
perform bitwise logical OR of a
register and memory or register
OR
memlreg,reg
perform bitwise logical OR of
memory or register and register
OR
memlreg,numb
perform bitwise logical OR of
memory or register and data
constant
RCL
memlreg,l
rotate memory or register 1 bit
left through carry flag
RCL
memlreg,CL
rota te me mory or reg i ste r I eft
through carry flag, number of bits
given by CL register
4-20
Programmer's Utilities Guide
Table 4-7.
Syntax
4.3 Instruction-definition Tables
(Continued)
Result
RCR
mem/reg,l
rotate memory or register 1 bit
right through carry flag
RCR
mem/reg,CL
rotate memory or register right
through carry flag, number of bits
given by CL register
ROL
memlreg,l
rotate memory or register 1 bi.!
left
ROL
mem/reg,CL
rotate memory or register left,
number of bits given by CL
register
ROR
mem/reg,l
rotate memory or register 1 bit
rig ht
ROR
mem/reg,CL
rotate memory or register right.
number of bits given by CL
register
SAL
mem/reg,l
shift memory or register
bit left,
shift in low-order zero bit
SAL
mem/reg,CL
shift memory or register left.
number of bits given by CL
register, shift in low-order zero
bits
4-21
4.3 Instruction-definition Tables
Programmer's Utilities Guide
Table 4-7. (Continued)
Syntax
Result
SAR
mem/reg,l
shift memory or register 1 bit
right shift in high-order bit equal
to the original high-order bit
SAR
mem/reg,CL
shift memory or register right
number of bits given by CL
register, shift in high-order bits
equal to the original high-order
bit
SHL
mem/reg,l
shift memory or register 1 bit left,
shift in low-order zero bit. Note
that SHL is a different mnemonic
for SAL.
SHL
mem/reg,CL
shift memory or register left,
number of bits given by CL
register, shift in low-order zero
bits. Note that SHL is a different
mnemonic for SAL.
SHR
mem/reg,l
shift memory or register 1 bit
right, shift in high-order zero bit
SHR
mem/reg,CL
shift memory or register right
number of bits given by CL
register, shift in high-order zero
bits
4-22
Programmer's Utilities Guide
Table 4-7.
Syntax
4.3 Instruction-definition Tables
(Continued)
Result
TEST
reg,memlreg
perform bitwise logical AND of a
register and memory or register set condition flags but do not
change destination.
TEST
memlreg,reg
perform bitwise logical AND of
memory or register and register set condition flags, but do not
change destination.
TEST
memlreg,numb
perform bitwise logical AND of
memory or register and data
constant - set condition flags but
do not change destination.
XOR
reg,mem/reg
perform bitwise logical exclusive
OR of a register and memory or
register
XOR
mem/reg.reg
perform bitwise logical exclusive
OR of memory or register and
register
XOR
memlreg,flumb
perform bitwise logical exclusive
OR of memory or register and
data constant
4-23
4.3 Instruction-definition Tables
Programmer's Utilities Guide
4.3.5 8086 String Instructions
String instructions take zero, one, or two operands.
The operands
specify only the operand type, determining whether the operation is on
bytes or words.
If there are two operands, the source operand is
addressed by the SI register and the destination operand is addressed
by the Dr register.
The 01 and SI registers are always used for
addressing.
Note that for string operations, destination operands
addressed by 01 must reside in the Extra Segment (ES) and source
operands addressed by SI must reside in the Data Segment (OS).
The source operand is normally addressed by the OS register.
However, you can designate a different register by using a segment
override. For example,
MOVS
WORD PTR[OI], CS:WORD PTR[SI]
writes the contents of the address at CS:[SI] into ES:[DI].
4-24
Programmer's Utilities Guide
Table 4-8.
Syntax
4.3 Instruction-detlnltlon I aOles
8086 String Instructions
Result
CMPS mem/reg,mem/reg
subtract source from destination,
affect flags, but do not return
result
CMPSB
an alternate mnemonic for CMPS
that assumes a byte operand
CMPSW
an alternate mnemonic for CMPS
that assumes a word operand
LODS mem/reg
transfer a byte or word from the
source operand to the
accumulator
LODSB
an alternate mnemonic for LODS
tl1at assumes a byte operand
LODSW
an alternate mnemonic for LODS
that assumes a word operand
MOVS memlreg,memlreg
move 1 byte (or word) from
source to destination
MOVSB
an alternate mnemonic for MOVS
that assumes a byte operand
MOVSW
an alternate mnemonic for MOVS
that assumes a word operand
4-25
4.3 Instruction-definition Tables
Programmer's Utilities Guide
Table 4-8. (Continued)
Syntax
Result
SCAS _memlreg
subtract destination operand from
accumulator (AX or AL), affect
flags, but do not return result
SCASB
an alternate mnemonic for SCAS
that assumes a byte operand
SCASW
an alternate mnemonic for SCAS
that assumes a word operand
STOS memlreg
transfer a byte or word from
accumulator to the destination
operand
STOSB
an alternate mnemonic for STOS
that assumes a byte operand
STOSW
an alternate mnemonic for STOS
that assumes a word operand
Table 4-9 defines prefixes for string instructions. A prefix repeats its
string instruction the number of times contained in the ex register,
which is decremented by 1 for each iteration.
Prefix mnemonics
precede the string instruction mnemonic in the statement line.
4-26
Programmer's Utilities Guide
Table 4-9.
4.3 Instruction-definition Tables
8086 Prefix Instructions
Syntax
Result
ex
REP
repeat until
register is zero
REPE
repeat until ex register is zero,
or zero flag (ZF) is not zero
REPNE
repeat until ex register is zero,
or zero flag (ZF) is zero
REPNZ
equal to REPNE
REPZ
equal to REPE
4.3.6 8086 Control Transfer Instructions
There are four classes of control transfer instructions:
•
•
•
•
calls, jumps, and returns
conditional jumps
iterational control
interrupts
All control transfer instructions cause program execution to continue
at some new location in memory, possibly in a new code segment.
The transfer can be absolute, or can depend upon a certain condition.
Table 4-10 defines control transfer instructions. In the definitions of
conditional jumps, above and below refer to the relationship between
unsigned values. Greater than and less than refer to the relationship
between signed values.
4-27
4.3 Instruction-definition Tables
Table 4-10.
Syntax
Programmer's Utilities Guide
8086 Control Transfer Instructions
Result
CALL
label
push the offset address of the
next instruction on the stack,
jump to the target label
CALL
memlreg 16
push the offset address of the
next instruction on the stack,
jump to location indicated by
contents of specified memory or
register
CALLF label
push CS segment register on the
stack, push the offset address of
the next instruction on the stack
(after CS), jump to the target
label
CALLF mem
push CS register on the stack,
push the offset address of the
next instruction on the stack,
jump to location indicated by
contents of specified double word
in memory
INT
push the flag registers (as in
PUSHF), clear TF and IF flags,
transfer control with an indirect
call through anyone of the 256
interrupt-vector elements - uses
three levels of stack
4-28
numb8
Programmer's Utilities Guide
Table 4-10.
Syntax
4.3 Instruction-definition Tables
(Continued)
Result
INTO
if OF (the overflow flag) is set,
push the flag registers (as in
PUSHF), clear TF and IF flags,
transfer control with an indirect
call through interrupt-vector
element 4 (location lOH). If the
OF flag is cleared, no operation
takes place
IRET
transfer control to the return
address saved by a previous
interrupt operation, restore saved
flag registers, as well as CS and
IP. Pops three levels of s'tack
JA
lab8
jump if "not below or equal" or
"above" ( (CF or ZF)=O )
JAE
lab8
jump if "not below" or "above or
equal" ( CF=O )
JB
lab8
jump if "below" or "not above or
equal" ( CF=l )
JBE
lab8T
jump if "below or equal" or "not
above" ((CF or ZF)=l )
JC
lab8
same as JB
JCXZ
lab8
jump to target label if CX register
is zero
JE
lab8
jump if "equal" or "zero" ( ZF= 1
4-29
4.3 Instruction-definition Tables
Programmer's Utilities Guide
Table 4- 10. (Continued)
Syntax
Result
JG
lab8
jump if "not less or equal" or
"greater" (((SF xor OF) or ZF)=O )
JGE
lab8
jump if "not less" or "greater or
equal" ((SF xor OF)=O )
JL
lab8
jump if "less" or "not greater or
equal" ((SF xor OF)=l )
JLE
lab8
jump if "less or equal" or "not
greater" (((SF xor OF) or ZF)=l )
JMP
label
jump to the target label
JMP
memlreg16
jump to location indicated by
contents of specified memory or
register
JMPF
label
jump to the target label possibly
in another code segment
JMPS labS
jump to the target label within
+/- 128 bytes from instruction
JNA
labS
same as JBE
JNAE
labS
same as JB
JNB
labS
s(lme as JAE
JNBE
labS
same as JA
JNC
labS
same as JNB
JNE
labS
jump if "not equal" or "not zero" (
ZF=O )
4-30
Programmer's Utilities Guide
Table 4-10.
Syntax
4.3 Instruction-definition Tables
(Continued)
Result
JNG
labS
same as JLE
JNGE
labS
same as JL
JNL
labS
same as JGE
JNLE
labS
same as JG
JNO
labS
jump if "not overflow" ( OF=O )
JNP
labS
jump if "not parity" or "parity odd"
( PF=O )
JNS
labS
jump if "not sign" ( SF=O )
JNZ
labS
same as JNE
JO
labS
jump if "overflow" ( OF=l
JP
lab8
jump if "parity" or "parity even" (
PF= 1 )
JPE
lab8
same as JP
JPO
lab8
same as JNP
JS
lab8
Jump if "sign" ( SF= 1 )
JZ
lab8
same as JE
LOOP
labS
decrement ex register by one,
jump to target label if ex is not
zero
LOOPE labB
decrement ex register by one,
jump to target label if ex is not
zero and the ZF flag is set - "Ioop
while zero" or "Ioop while equal"
4-31
4.3 Instruction-definition Tables
Programmer's Utilities Guide
Table 4-10. (Continued)
Syntax
Result
lOOPNE
lab8
decrement CX register by one,
jump to target label if CX is not
zero and ZF flag is cleared "loop while not zero" or "loop
while not equal"
lOOPNZ
lab8
same as LOOPNE
lOOPZ.lab8
same as LOOPE
RET
return to the address pushed by a
previous CALL instruction,
increment stack pointer by 2
RET
numb
return to the address pushed by a
previous CALLF instruction,
increment stack pointer by 4
RETF
RETF
return to the address pushed by a
previous CALL, increment stack
painter by 2+numb
numb
return to the address pushed by a
previous CALLF instruction,
increment stack pointer by
4+numb
4.3.7 8086 Processor Control Instructions
Processor control instructions manipulate the flag registers. Moreover,
some of these instructions synchronize the CPU with external
hardware.
4-32
Programmer's Utilities Guide
Table 4-11.
4.3 Instruction-definition Tables
8086 Processor Control Instructions
Syntax
Result
CLC
clear CF flag
CLD
clear DF flag, causing string
instructions to auto-increment
the operand registers
CLI
clear IF flag, disabling maskable
external interrupts
CMC
complement CF flag
ESC
numb8,mem/reg
do no operation other than
compute the effective address
and place it on the address bus
(ESC is used by the 8087 numeric
coprocessor) numb8 must be in
the range 0 - 63
HLT
cause 8086 processor to enter
halt state until an interrupt is
recognized
LOCK
PREFIX instruction, cause the
8086 processor to assert the buslock signal for the du.ration of the
operation caused by the following
instruction. The LOCK prefix
instruction can precede any other
instruction. Bus_lock prevents
coprocessors from gaining the
bus; this is useful for sharedresource semaphores
4-33
4.3 Instruction-definition Tables
Programmer's Utilities Guide
Table 4-11. (Continued)
Syntax
Result
NOP
no operation is performed
STC
set CF flag
STO
set
OF
flag,
causing
string
instructions to auto-decrement
the operand registers
STI
set IF flag, enabling
external interrupts
WAIT
cause the 8086 processor to
enter a wait state if the signal on
its TEST pin is not asserted
maskable
4.3.8 8087 Instruction Set
RASM-86 supports 8087 opcodes.
However, RASM-86 only allows
8087 opcodes in byte, word, and double word format. The form of the
RASM-86 instructions differ slightly from the Intel convention to
support 8087 instructions.
All 8087 memory reference instructons have two characters appended
to the end of the opcode name. The two characters represent the
number of bits referenced by the instruction. For example:
FADD64
byte ptr
my_var
This instruction assumes MY VAR contains 64 bits (8 bytes).
This
convention applies to all 8087 instructions referencing user memory,
except those that always reference the same number of bits, as is the
FSTCW instruction, for example.
4-34
4.3 Instruction-definition Tables
Programmer's Utilities Guide
Another difference between RASM-86 and the standard Intel
convention is that the number of bits referenced by the instruction is
placed before the "P" on instructions in which the stack is to be
popped. For example:
FSU880P
byte ptr
my_va r
;
sub
and
pop
temp
real
Many of the following 8087 operations are described in terms of the
stack registers: STO, ST1, .... STi (where "i" represents any register on
the stack). The stack register where the resulting value is stored is
also described for many operations. It is important to remember that
when a POP occurs at the end of an 8087 operation, the stack register
containing the value is decremented by 1.
For example, if, during an 8087 operation, the result is put in ST3 and
a POP occurs at the end of the operation, the result ends up in ST2.
4-35
4.3 Instruction-definition Tables
Table 4-12.
Syntax
Programmer's Utilities Guide
8087 Data Transfer Instructions
Result
Real Transfers
FLO
Load a number in IEEE floating point
format into 8087 top stack element STO
FL032
Load a number in IEEE 32-bit floating point
format into 8087 top stack element STO
FL064
Load a number in IEEE 64-bit floating point
format into 8087 top stack element STO
FL080
Load a number in IEEE 80-bit floating point
format into 8087 top stack element STO
FOUP
Duplicate top of stack (FLO STO)
FST
Store Real
FST32
Store Real (32-bit operands)
FST64
Store Real (64-bit operands)
FSTP
Store Real and Pop
FST32P
Store Real and Pop (32-bit operands)
FST64P
Store Real and Pop (54-bit operands)
FPOP
same as FSTP STO
FXCH
Exchange Registers
FXCHG
same as FXCH ST 1
4-36
Programmer's Utilities Guide
Table 4-12.
Syntax
4.3 Instruction-definition Tables
(Continued)
Result
Integer Transfers
FILD16
Integer Load (15-bit operands)
FILD32
Integer Load (32-bit operands)
FILD64
Integer Load (54-bit operands)
FIST16
Integer Store (16-bit operands)
FIST32
Integer Store (32-bit operands)
FISTl5P
Interger Store and Pop (16-bit operands)
FIST32P
Interger Store and Pop (32-bit operands)
FIST54P
Interger Store and Pop (54-bit operands)
Packed Decimal Transfers
FBLD
Packed Decimal (BCD) Load
FBSTP
Packed Decimal (BCD) Store 10 bytes
and Pop
4-37
4.3 Instruction-definition Tables
Table 4-13.
Syntax
Programmer's Utilities Guide
8087 Arithmetic Instructions
Operands
Result
Addition
FADD
Add Real STO to ST1, store result
in ST1 and Pop
FADD
STi,STO
Add Real STO to STi, store result
in STi
FADD32
mem
Add Real mem to STD, store
result in STO (32-bit operands)
FADD64
mem
Add Real mem to STD, store
result in STO (54-bit operands)
FADDP
STi,STD
Add Real STO to STi, store result
in STi and Pop
FIADD16
mem
Integer Add mem to STO, store
result in STO (16 bit-operands)
FIADD32
mem
Integer Add mem to STO, store
result in STO (32 bit-operands)
Subtraction
Subtract Real STO from ST1, store
result in ST1 and Pop
FSUB
FSUB
STi,STO
Subtract Real STO from STi, store
result In STi
FSUB
STO,STi
Subtract Real STi from STO, store
result in STO
4-38
Programmer's Utilities Guide
Table 4-13.
4.3 Instruction-definition Tables
(Continued)
Syntax
Operands
Result
FSUB32
mem
Subtract Real
store
result
operands)
mem from STO.
in
STO
(32-bit
FSUB64
mem
Subtract Real
store
result
ooerands)
mem from STO.
in
STO . (64-bit
FSUBP
STi.STO
Subtract Real STO from STi. store
result in STi and Pop
FISUB16
mem
Integer Subtract mem from STO.
store
result
in
STO
(16-bit
operands)
FISUB32
mem
Integer Subtract mem from STO.
store
result
in
STO
(32-bit
operands)
Subtract Real sn from STO. store
result in STl and Pop
FSUBR
FSUBR
STi.STO
Subtract Real STi from STO. store
result in STi
FSUBR
STO.STi
Subtract Real STO from STi. store
result in STO
FSUBR32
mem
Subtract Real
store
result
operands)
mem from STO.
in
STO
(32-bit
FSUBR64
mem
Subtract Real
store
result
operands)
mem . from STO.
in
STO
(64-bit
4-39
4.3 Instruction-definition Tables
Programmer's Utilities Guide
Table 4-13. (Continued)
Syntax
Operands
FSUBRP
STi,STO
Subtract Real STi from STO, store
result in STi and Pop
FISUBR16
mem
Integer Subtract STO from mem,
(15-bit
store
result
in
STO
operands)
FISUBR32
mem
Integer Subtract STD from mem,
(32-bit
store
re suit
in
STO
operands)
Result
Multiplication
FMUL
~jlultiply Real STl
by STO, store
result in STl and Pop
FMUl
STi,STD
Multiply Real
result in STi
STi
by
STO, store
FMUL
STO,STi
Multiply Real
result in STO
STO
by
STi,
FMUL32
mem
Multiply Real STO by mem, store
result in STO (32-bit operands)
FMUL64
mem
Multiply Real STO by mem, store
result in STO (54-bit operands)
FMULP
STi,STD
Multiply Real STi by
result In STI and Pop
FIMUL 15
mem
Integer r/lultlply STO by mem,
(15--bit
in
result
STO
store
operands)
----------------------
4-40
store
STO, store
Programmer's Utilities Guide
4.3 Instruction-definition Tables
Table 4-13. (Continued)
Syntax
Operands
FIMUL32
mem
Result
Integer Multiply. STQ .by mem,
store
result
in
STO
(32-bit
operands)
Division
FDIV
Divide Real ST1 by
result in ST1 and Pop
STO,
store
by
STO,
store
by
STi,
store
FDIV
STi,STO
Divide Real
result in STi
FDIV
STO,STi
Divide Real STO
result in STO
FDIV32
mem
Divide Real STO by mem, store
result in STO (32-bit operands)
FDIV64
mem
Divide Real STO by mem, store
result in STO (64-bit operands)
FDIVP
STi,STO
Divide Real STi by
result in STi and Pop
FIDIV16
mem
Integer Divide STO by mem, store
result in STO (16-bit operands)
FIDIV32
mem
Integer Divide STO by mem, store
result in STO (32-bit operands)
FDIVR
STi
STO,
store
Divide Real STO by
result in ST1 and Pop
ST1,
store
STi,
store
STO,
store
FDIVR
STi,STO
Divide Real
result in STi
FDIVR
STO,STi
Divide Real STi
result in STO
STO
by
by
4-41
4.3 Instruction-definition Tables
Programmer's Utilities Guide
Table 4-13. (Continued)
Syntax
Operands
FDIVR32
mem
Divide Real mem by STO, store
result in STO (32-bit operands)
FDIVR64
mem
Divide Real mem by STO: store
result in STO (54-bit operands)
FDIVRP
STi,STO
Divide Rea~ STi by
result in STi and Pop
FIDIVR16
mem
Integer Divide mem by STO, store
result in STO (16-bit operands)
FIDIVR32
mem
Integer Divide mem by STO, store
result in STO (32-bit operands)
Result
STO,
store
Other Operations
FSQRT
Square Root
FSCALE
Interpret sn as an integer and
add to exponent of STO
FPREM
Partial Remainder
FRNDINT
Round to Integer
.FXTRACT
Extract Exponent and Significand
FABS
Absolute Value
FCHS
CI1ange Sign
4-42
Programmer's Utilities Guide
Table 4- 14.
Syntax
Operands
FCOM
4.3 Instruction-definition Tables
8087 Comparison Instructions
Result
Compare Real STO and ST1
FCOM32
mem
Compare Real mem and STO (32bit operands)
FCOM64
mem
Compare Real mem and STO (64bit operands)
Compare Real STO and ST1 and
Pop
FCOMP
FCOM32P
mem
Compare Real mem and STO and
Pop (32-bit operands)
FCOM64P
mem
Compare Real mem and STO and
Pop (64-bit operands)
FCOMPP
Compare Real STO and ST1, then
Pop STO and ST1
FICOM16
mem
Integer Compare mem and STO
(16-bit operands)
FICOM32
mem
Integer Compare mem and STO
(32-bit operands)
FICOM16P
mem
Integer Compare mem and STO
And Pop (16-bit operands)
FICOM32P
mem
Integer Compare mem and STO
and Pop (32-bit operands)
FTST
Test STO by comparing it to zero
FXAM
Report STO as either positive or
negative
4-43
4.3 Instruction-definition Tables
Table 4-15.
8087 Transcendental Instructions
Syntax
Result
FPTAN
Partial Tangent
FPATAN
Partial Arctangent
F2XMl
2x-l
FYL2X
Y
*
loglX
FYL2XPl
Y
*
logl(X + 1)
Table 4-16.
4-44
Programmer's Utilities Guide
8087 Constant Instructions
Syntax
Result
FLOZ
Load + 0.0
FL01
Load + 1.0
FLOPI
Load aO-bit value for pi.
FLOL2T
Load log l 1a
FLOL2E
Load logle
FLOLG2
Load log 102
FLOLN2
Load loge2
Programmer's Utilities Guide
Table 4-17.
Syntax
4.3 Instruction-definition Tables
8087 Processor Control Instructions
Result
Operands
FINITIFNINIT
Initialize Processor
FDISIIFNDISI
Disable Interrupts
FENI/FNENI
Enable Interrupts
FLDCW
mem
Load Control Word
FSTCW/FNSTCW
mem
Store Control Word
FSTSW/FNSTSW
mem
Store Status Word
FCLEX/FNCLEX
Clear Exceptions
FSTENV/FNSTENV
mem
Store Environment
FLDENV
mem
Load Environment
FSAVE/FNSAVE
Save State
FRSTOR
Restore State
FINCSTP
Increment Stack Pointer
FDECSTP
Decrement Stack Pointer
FFREE
Free Register
FNOP
No Operation
FWAIT
CPU Wait
4.3.9 Additional 186 and 286 Instructions
The following Instructions are specific to both the 80186 and 80286
processors. In addition to the instructions below, other 80186 and
80286 instructions are the same as 8086 instructions except they allow
a rotate or shift. These instructions are: SAR, SAL, SHR. SHL, ROR, and
ROL.
4-45
4.3 Instruction-definition Tables
Table 4-18.
Programmer's Utilities Guide
Additional 186 and 286 Instructions
Syntax
Result
BOUND
Check Array Index Against Bounds
ENTER
Make Stack Frame for Procedure Parameters
INSB
Input Byte from Port to String
INSW
Input Word from Port to String
LEAVE
High Level Procedure Exit
OUTSB
Output Byte Pointer [sil to OX
OUTSW
Output Word Pointer [sil to OX
POPA
Pop all General Registers
PUSHA
Push all General Registers
4.3.10 Additional 286 Instructions
The following instructions are specific to the 80286 processor.
Table 4-19.
Syntax
Additional 286 Instructions
Result
CTS
Clear Task Switched Flag
ARPL
Adjust Priviledge level
LGDT
Load Global Descriptor Table Register
4-46
4.3 Instruction-definition Tables
Programmer's Utilities Guide
Table 4-19.
Syntax
(Continued)
Result
SGDT
Store Global Descriptor Table Register
lIDT
Load Interrupt Descriptor Table Register
SIDT
Store Interrupt Descriptor Table Register
LLDT
Load Local Descriptor Table Register
from Register/Memory
SLOT
Store Local Descriptor Table Register
to Register/Memory
LTR
Load Task Register from Register/Memor'y'
STR
Store Task Register to Register/Memory
LMSW
Load Machine Status Word from Register/Memory
SMSW
Store Machine Status Word
LAR
Load Access Rights from Register/Memory
LSL
Load Segment Limit from Register/Memory
ARPL
Adjust Required Privilege Level from
Register/Memory
VERR
Verify Read Access; Register/Memory
VERW
Verify Write Access
End of Section 4
4-47
SECTIONS
RASM-86 Code-Macro
Facilities
5.1
Introduction
RASM-86 allows you to define your own instructions using the Codemacro directive.
RASM-86 code-macros differ from traditional
assembly-language macros in the following ways:
• Tradilional assembly-language macros contain assembly-language
instructions, but a RASM-86 code-macro contains only codemacro directives.
• Traditional assembly-language macros are usually defined in the
Symbol Table, while RASM-86 code-macros are defined in the
assembler's internal Symbol Table.
• A traditional macro simplifies the repeated use of the same block
of instructions throughout a program, but a code-macro sends a
bit stream to the output file, and in effect, adds a new instruction
to the assembler.
5.2 Invoking Codtl-macros
RASM-86 treats a code-macro as an instruction, so you can invoke
code-macros by using them as instructions in your program.
The
following example shows how to invoke MYCODE, an instruction
defined by a code-macro.
MYCODE
PARM1,PARM2
Note that MYCODE accepts two operands as formal parameters. When
you def(ne MYCODE, RASM-86 classifies these two operands according
to type, size, and so forth.
5-1
5.3 Invoking Code-macros
Programmer's Utilities Guide
5.3 Defining Code-macros
A code-macro definition takes the general form:
CodeMacro name [formal parameter list
[ list of code-macro directives J
EndM
where name is any string of characters you select to represent the
code-macro. The optional formal parameter and code-macro directive
lists are described in the following sections.
Example code-macro
definitions are provided in Section 5.3.3
5.3.1 Formal Parameter List
When you define a code macro, you can specify one or more optional
formal parameter lists. The parameters specified in the formal
parameter list are used as placeholders to indicate where and how the
operands are to be used. The formal parameter list is created using
the following syntax:
formal name
specifier_letter [ modifier_letter] [ range]
formal name
You can specify any formal name to represent the formal parameters
in your list. RASM-86 replaces the formal_names with the names or
values supplied as operands when you invoke the code-macro.
specifier _letter
Every formal parameter must have a specifier letter to indicate what
type of operand is needed to match the formal parameter. Table 5-1
defines the eight possible specifier letters.
5-2
Programmer's Utilities Guide
Table 5-1.
Letter
5.3 Defining Code-macros
Code-macro Operand Specifiers
Operand Type
A
Accumulator register, AX or AL.
C
Code, a label expression only.
D
Data, a number used as an immediate value.
E
Effective address, either an M (memory address)
or an R (register).
M
Memory address. This can be either a variable
or a bracketed register expression.
R
General register only.
S
Segment register only.
X
Direct memory reference.
modifier letter
The optional modifier letter in a code-macro definition is a further
requirement on the operand.
The meaning of the modifier letter
depends on the type of the operand. For variables, the modifier
requires the operand be a certain type:
•
•
•
•
b for byte
w for word
d for double-word
sb for signed byte
For numbers, the modifiers require the number be a certain size: b for
-256 to 255 and w for other numbers. Table 5-2 summarizes codemacro modifiers.
5-3
5.3 Defining Code-macros
Table 5-2.
Programmer's Utilities Guide
Code-macro Operand Modifiers
Variables
Modifier
Numbers
Type
Modifier
Size
b
byte
b
-256 to 255
w
word
w
anything else
d
dword
sb
signed
byte
range
The optional range in a code-macro definition is specified within
parentheses by either one expression or two expressions separated by
a comma. The following are valid formats:
(numberb)
(register)
(numberb,numberb)
(num berb,register)
(reg i ste r,nu m berb)
(regi ster,register)
Numberb is an 8-bit number. not an address
5.3.2 Code-macro Directives
Code-macro directives define the bit pattern and make further
requirements on how the operand is to be treated.
Directives are
reserved words, and those that appear to duplicate assembly language
instructions have different meanings within a code-macro definition.
The following are legal code-macro directives
5-4
Programmer's Utilities Guide
SEGFIX
NOSEGFIX
MOORM
RELB
RELW
DB
5.3 Defining Code-macros
OW
DO
OBIT
IF
ELSE
ENOIF
These directives are unique to code-macros.
The code-macro
directives DB, OW, and DO that appear to duplicate the RASM-86
directives of the same names have different meanings in code-macro
context. These directives are discussed in greater detail in Section
3.7.1.
CodeMacro, EndM, and the code-macro directives are all reserved
words. The formal definition syntax for a code-macro is defined inBackus-Naur-like form in Appendix O.
SEGFIX
SEGFIX instructs RASM-86 to determine whether a segment-override
prefix byte is needed to access a given memory location. If so, it is'
outrut as the first byte of the instruction. If not RASM-86 takes no
action. SEGFIX has the following form:
SEGFIX formal name
The formal name is the name of a formal parameter representing the
memory address. Because it represents a memory address, the formal
parameter must have one of the specifiers E, M, or X.
NOSEGFIX
Use NOSEGFIX for operands in instructions that must use the ES
register for that operand. TtllS applies only to the destination operand
of these instructions: CMPS, MOVS, SCAS, STOS
NOSEGFIX has the
following form:
NOSEGFIX
segreg, form_name
The segreg is one of the segment registers ES, CS, SS, or OS, and
form_name is the name of the memory-address formal parameter that
must have a specifier E, M, or X 1IJo code is generated from this
directive, but an error check is performed.
5-5
5.3 Defining Code-macros
Programmer's Utilities Guide
The following is an example of NOSEGFIX in a code-macro directive:
CodeMacro MOVS si ptr:Ew,di ptr:Ew
NOSEGFIX
ES,di ptr
SEGFIX
si ptr
DB
OA5H
EndM
MODRM
This directive instructs RASM-86 to generate the MODRM byte
following the opcode byte in many of the 8086 and 80286 instructions.
The MODRM byte contains either the indexing type or the register
number to be used in the instruction. It also specifies which register
is to be used, or gives more information to specify an instruction.
The MODRM byte carries the information in three fields:
fields:
byte:
mod
reg
MODRM
The mod field occupies the two most significant bits of the byte, and
combines with the register memory field to form 32 possible values: 8
registers and 24 indexing modes.
The reg field occupies the three next bits following the mod field. It
specifies either a register number or three more bits of opcode
information.
The meaning of the reg field is determined by the
opcode byte.
The reg mem, or register memory, field occupies the last three bits of
the byte.
It specifies a register as the location of an operand, or
forms a part of the address-mode in combination with the mod field
described earlier.
For further information about 8086 and 80286 instructions and their bit
patterns, see the Intel assembly language programming manual and
the Intel user's manual for your processor.
5-6
Programmer's Utilities Guide
5.3 Defining Code-macros
MODRM has the forms:
MODRM form name,form name
MODRM NUMBER7,form_name
NUMBER7 is a value 0 to 7 inclusive, and form name is the name of a
formal parameter. The following examples show how MODRM is used
in a code-macro directive:
CodeMacro RCR dst:Ew,count:Rb(CL)
SEGFIX
dst
DB
OD3H
MODRM
3,dst
EndM
CodeMacro OR dst:Rw,src:Ew
SEGFIX
src
DB
OBH
MODRM
dst,src
EndM
RELB and RELW
These directives, used in IP-relative branch instructions, instruct
RASM-86 to generate a displacement between the end of the
instruction and the label supplied as an operand. RELB generates one
byte and RELW two bytes of displacement. The directives have the
following forms:
RELB form name
RELW form-name
The form name is the name of a formal parameter with a C (code)
specifier. -For example,
CodeMacro LOOP place:Cb
DB
OE2H
RELB
place
EndM
5-7
5.3 Defining Code-macros
Programmer's Utilities Guide
DB, OW and DO
These directives define a number, or a parameter as either a byte,
word, or double-word.
These directives differ from those occuring
outside code-macros.
The directives have the following forms:
DB form name I NUMBERB
OW form- name I NUMBERW
DO form -name
NUMBERB is a single-byte number, NUMBERW is a two-byte number,
and form_name is a name of a formal parameter. For example,
CodeMacro XOR dst:Ew,src:Db
SEGFIX
dst
DB
81H
MODRM
6,dst
DW
src
EndM
OBIT
This directive manipulates bits in combinations of a byte or less.
form is as follows:
The
OBIT field_description [,field_description)
The field_description has two forms:
number combination
number (form_name (rshift))
The number ranges from 1 to 16, and specifies the number of bits to
be set. The combination specifies the desired bit combination. The
total of all the numbers listed in the field descriptions must not
exceed 16.
The second form shown contains form name, a formal parameter name
that instructs the assembler to put a -certain number in the specified
position. This number normallv refers to the register specified in the
first line of the code-macro. The numbers used in this special case
for each register are the following
5-8
Programmer's Utilities Guide
AL:
CL:
DL:
BL:
AH:
CH:
DH:
BH:
AX:
CX:
OX:
BX:
5P:
BP:
51:
01:
E5:
C5:
55:
05:
5.3 Defining Code-macros
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0
1
2
3
The rshift, contained in the innermost parentheses, specifies a number
of right shifts. For example, 0 specifies no shift; 1 shifts right one bit;
2 shifts right two bits, and so on. The following definition uses this
form:
CodeMacro DEC dst:Rw
OBIT 5(9H},3(dst(O))
EndM
The first five bits of the byte have the value 9H. If the remaining bits
are zero, the hex value of the byte IS 48H If the instruction
DEC
DX
is assembled, and OX has a value of 2H, then 48H + 2H = 4AH, the final
value of the byte for execution.
If this sequence is present in the
defini~ion
DB ITS ( 9H) , 3 (ds t ( 1 ) )
then the register number is shifted right once, and the erroneous
result is 48H + 1H = 49H.
5-9
5.3 Defining Code-macros
Programmer's Utilities Guide
IF, ELSE, and ENDIF
The IF and ENDIF directives allow you to conditionally include or
exclude a group of source lines from the assembly. The optional ELSE
directive allows you to specify an alternative set of source lines.
These code-macro directive operate in the same manner as the
RASM-86 conditional assembly directives described in Section 3.5.1.
5.3.3 Example Code-Macro Definitions
In order to clearly distinguish specifiers from modifiers, the examples
in this section show specifiers in uppercase and modifiers in
lowercase.
CodeMacro IN dst:Aw,port:Rw(DX)
Defines a code-macro, named IN, specifying that the input port must
be identified by the OX register.
CodeMacro ROR dst:Ew,count:Rb(CL)
Defines a code-macro, named ROR, specifying that the CL register is
to contain the count of rotation.
CodeMacro ESC opcode:Db(O,63),adds:Eb
Defines a code
represented by the
range from a to
represented by the
address.
macro named ESC, specifying that the value
opcode parameter is to be immediate data, with a
63 bytes.
ESC also specifies that the value
adds parameter is a byte to be used as an effective
CodeMacro AAA
DB 37H
EndM
Defines a code macro, named AAA as the value 37H.
normal opcode value of the AAA instruction.)
CodeMacro NESC opcode:Db(O,63),src:Eb
SEGFIX src
DBIT 5(lBH),3(opcode(3))
MODRM opcode,src
EndM
5-10
(This is the
Programmer's Utilities Guide
5.3 Defining Code-macros
Defines a code macro, named NESC. The value represented by the
opcode parameter is defined as data, with a range from 0 to 63 bytes.
The value represented by the src parameter is defined as a byte to
represent either a memory address or a register.
The SEGFIX directive checks to see if src is in the current segment
(data segment) and, if not, to override with the correct segment.
The OBIT directive creates a byte. the upper five bits of this byte
contain 1BH; the lower 3 bits are derived from the value of opcode,
shifted right by 3.
The MODRM directive generates modrm bytes, based on the values of
the opcode and src parameters.
End of Section 5
5-11
SECTION 6
XREF-86 Cross-Reference
Utility
6.1
Introduction
XREF-86 is an assembly language cross-reference utility program that
creates a cross-reference file showing the use of symbols throughout
the program. XREF-86 accepts two input files created by RASM-86.
XREF-86 assumes these input files have filetypes of LST and SYM
respectively, and they both reside on the same disk drive. XREF-86
creates one output file with the filetype XRF.
6.2 XREF-86 Command Syntax
XRE~-86
is invoked using the command form:
XREF86 [drive:] filename
XREF-86 reads FILENAME.LST line by line, attaches a line number prefix
to each line, and writes each prefixed line to the output file,
FILENAME.XRF. During this process, XREF-86 scans each line for any
symbols existing in the file FILENAME SYM.
After
completing
this
copy
operation,
XREF-86
appends
to
FILENAME.XRF a cross-reference report listing all the line numbers
where each symbol in FILENAMESYM appears. XREF-86 flags with a #
character each line number reference where the referenced symbol is
the first token on the line
XREF-86 also lists the value of each symbol, as determined
RASM-86 and placed in the Symbol Table file, FILENAMESYM.
by
When you invoke XREF-86, you can include an optional DRIVE:
specification with the filename.
When you invoke XREF-86 with a
DRIVE: name preceding the FILENAME, XREF-86 searches for the input
files and create the output file on the specified drive. If DRIVE: is not
specified, XREF-86 associates the files with the default drive.
6-1
6.2 XREF-86 Command Syntax
Programmer's Utilities Guide
For example, to search for the file BIOS on the Drive C, enter:
xref86 c:bios
XREF-86 also allows you to direct the output file to the default list
device instead of to FILENAME.xRF. To redirect the output, add the
string $p to the command line. For example,
A>xref86 bios $p
End of Section 6
6-2
SECTION 7
LINK-a6 Linkage Editor
7.1
Introduction
LlNK-86 is the linkage editor that combines relocatable object files to
form either a native-mode (CMD) or PC DOS mode (EXE) command file
that runs under Concurrent DOS 86. The object files can be produced
by any 8086 or 80286 language translators that produce object files
usi!lg a compatible subset of the Intel 8086/80286 object module
format
7.2 LlNK-86 Operation
LlNK-86 accepts three types of files.
Object (OBJ) File
A language source file processed by the language
translator into the relocatable object code used by
the microprocessor. This type of file contains one
or more object modules.
Library (L86) File
An indexed library of commonly used object
modules
A library file is generated by the library
manager, LlB-86, in the processor's relocatable
object format.
Input (INP) File
A file consisting of filenames and options like a
command line entered from the console.
For. a
detailed explanation of the input file, see Section
7.10.
LlNK-86 produces the following types
Of
files:
Command (CMD or EXE) File
Contains executable code loadable by Concurrent
The filetype depends on which version of the linker
you use (native mode or PC DOS mode).
7-1
7.2 LlNK-86 Operation
Programmer's Utilities Guide
For simplicity, examples in this guide use the CMD filetype.
Symbol Table (SYM) File
Contains a list of symbols from the object files and
This file is suitable for use with
their offsets.
SID-86.
Line Number (UN) File
Contains line number symbols, which can be used
by SID-86 for debugging. This file is created only if
the compiler puts line number information into the
object files being linked.
Map (MAP) File
Contains segment information about the layout of
the command file.
During processing, LlNK-86 displays any unresolved symbols at the
console. Unresolved symbols are symbols referenced but not defined
in the files being linked. Such symbols must be resolved before the
program can run.
Upon completion of processing, LlNK-86 displays the size of each
section of the command file and the Use Factor, which is a decimal
percentage indicating the amount of available memory used by
LlNK-86.
See Section 7.12 for a complete explanation of the link process.
7.3 LINK-aS Command Syntax
You invoke LlNK-86 with a command of the form
LlNK86 [filespec =] filespec_' [,tilespec_2, .. ,filespec nl
where filespec is a Concurrent file specification, consisting of an
optional drive specification and a filename with optional filetype.
Note:
The PC
command line.
7-2
DOS version
does
not support path names
in the
Programmer's Utilities Guide
7.3 LlNK-86 Command Syntax
Each filespec can be followed by one or more of the comma'nd
options described in Section 7.5. If you enter a filename to the left of
the equal sign, LlNK-86 creates the output files with that name and the
appropriate filetypes.
For example, if the files PARTA, PARTS, and
PARTC are written in 8086 or 80286 assembly code, the command:
A>link86 myfile = parta,partb,partc
creates MYFILE.CMD and MYFILE.SYM. The files PARTA, PARTS, and
PARTC can be a combination of object files and library files. If no
filetype is specified, the linker assumes a filetype of OSJ.
If you do not specify an output filename, LlNK-86 creates the output
files using the first filename in the command line. For example, the
command
A> link86 parta,partb,partc
creates the files PARTA.CMD and PARTA.SYM. If you specify a library
file in your link command, do not enter the library file as the first file
in the command line.
Yc u can also instruct lINK-86 to read its command line from a file,
thus making it possible to store long or commonly used link
commands on disk (see Section 7.10).
The following are examples of L1NK-86 commands:
A> link86 myfile = parta,partb
A>link86 a:myfile.286 = parta,partb,transvec
A> link86 b:myfile.cmd = parta,partb
The available L1NK-86 command options are described in Section 75.
7.4
Stopping L1NK-86
To stop L1NK-86 during processing,
character, usually Control-C.
press
the
console
interrupt
7-3
7.5 LlNK-86 Command Options
Programmer's Utilities Guide
7.5 LlNK-86 Command Options
When you invoke L1NK-86, you can specify command options that
control the link operation.
When specifying command options, enclose them in square brackets
immediately following a filename.
A command option is specified
using the following command form:
A>link86 file[option]
For example, to specify the command option MAP for the file TESTl
and the NOLOCALS option for the file TEST2, enter:
A>link86 test1 (map],test2[nolocals]
You can use spaces to improve the readability of the command line,
and you can put more than one option in square brackets by
separating them with commas. For example:
A>link86 test1 [map, noloeals], test2 [locals]
specifies that the MAP and NOLOCALS options be used for the TEST1
file and the option LOCALS for the TEST2 file.
L1NK-86 command options are grouped into the following categories:
•
•
•
•
•
•
•
Command File Options
SYM file Options
LIN File Options
MAP File Options
L86 File Options
INPUT File Options
I/O File Options
Table 7-1 summarizes the available LlNK-86 command options. The
following sections describe the function and syntax in detail for each
command option.
7-4
Programmer's Utilities Guide
Table 7-1.
Option
7.5 L1NK-86 Command Options
LlNK-86 Command Options
Abbreviation
Meaning
CODE
C
controls contents of CODE
section of command file
DATA
D
controls contents of DATA
section of command file
EXTRA
E
controls contents of EXTRA
section of command file
STACK
ST
controls contents of STACK
section of command file
FILL
F
zero fill and include uninitialized
data in command file
NOFILL
NOF
do not include uninitialized data
in command file
HARD8087
HA
create a command file requiring
an 8087 coprocessor.
L1BSYMS
LI
include symbols from library files
in SYM file
NOLIBSYMS
NOLI
do not include symbols from
library files in SYM file
LOCALS
LO
include local symbols in SYM file
NOLOCALS
NOLO
do not include local symbols in
SYM file
LINES
LIN
create LIN file with line number
symbols
7-5
7.5 L1NK-a6 Command Options
Programmer's Utilities Guide
Table 7-1. (Continued)
Option
Abbreviation
Meaning
NOLINES
NOLIN
do not create LIN file
MAP
M
create a MAP file
SEARCH
S
search
library
and
referenced modules
link
read command line from disk file
INPUT
ECHO
only
ECHO
echo contents
console
Xl
controls contents of X 1 section of
CMD file
Xl
controls contents of X 1 section of
CMD file
Xl
controls contents of X 1 section of
CMD file
Xl
Xl
controls contents of X 1 section of
CMD file
CODESHARED*
CODES
mark group as shared in CMD file
header
NO PREFIX"
Nap
Do not generate prefix code
beginning of EXE file
Xl
* Native mode only
** PC DOS mode only
7-6
of
INP
file
on
at
Programmer's Utilities Guide
7.6 Command File Options
7.6 Command File Options
Most command file options can appear after any filename in the
command line. The only exception is the HARD8G87 option which if
used, must appear after the first filename.
7.6.1
Command File Formats
A native-mode command file consists of a 128-byte header record
followed by up to eight sections, each of which can be up to 64K in
length. These sections are called CODE, DATA. STACK. EXTRA, X1, X2,
X3, and X4. Each of these sections correspond to a LlNK-86 command
option of the same name. The header contains information such as
the length of each section of the command file, its minimum and
maximum memory requirements, and its load address.
Concurrent
uses this information to properly load the file.
A PC DOS mode command file contains two part: a header and an
executable code module. The header contains 28 bytes of control
information, if required.
The executable code module begins on a
sector boundary immediately following the header in the memory
image created by LlNK-86. PC DOS mode command files can contain
up to four sections, each of which can be up to 64K in length. Each of
these four sections (CODE, DATA. STACK, and EXTRA). correspond to a
L1NK-86 command option, which allows you to identify a section in a
command file. The parameters described below allow you to alter the
information in that section.
File Section Option Parameters
Each of the options identifying the command file sections must be
followed by one or more parameters enclosed in square brackets.
LlNK-86 option parameters are specified using the form:
link86 file [option [parameter] ]
Table
7-2
shows
the
file
section
abbreviations. and their meanings.
option
parameters.
their
7-7
7.6 Command File Options
Table 7-2.
Programmer's Utilities Guide
Command File Option Parameters
Parame.ter
Abbreviation
GROUP
G
groups to be included in
command file section
CLASS
C
classes to be included in
command file section
SEGMENT
S
segments to be included in
command file section
ABSOLUTE
AS
absolute load address for
command file section
ADDITIONAL
AD
additional memory allocation for
the command file section
MAXIMUM
M
maximum memory allocation for
command file section
ORIGIN
0
origin of first segment in
command file section
Meaning
GROUP,CLASS, SEGMENT
The GROUP, CLASS, and SEGMENT parameters each contain a list of
groups, classes, or segments that you want LINK-86 to put into the
indicated section of the command file. For example, the command
A>link86 test [code [segment [codeL code2J. group [xyzlJ]
instructs LlNK-86 to put the segments CODE 1, CODE2, and alt the
segments in group XYZ into the CODE section of the file TEST.CMD (or
TEST.EXE)
7-8
Programmer's Utilities Guide
7.6 Command File Options
ABSOLUTE, ADDITIONAL, MAXIMUM
The ABSOLUTE, ADDITIONAL, and MAXIMUM parameters tell LlNK-86
the values to put in the command file header.
These parameters
override the default values normally used by LlNK-86.
Table 7-3
shows the default values.
Each parameter is a hexadecimal number enclosed in square brackets.
The ABSOLUTE parameter indicates the absolute paragraph address
where the operating system loads the indicated section of the
command file at runtime. A paragraph consists of 16 bytes.
The ADDITIONAL parameter indicates the amount of additional memory,
in paragraphs, required by the indicated section of the command file.
The program can use this memory for Symbol Tables or I/O buffers at
runtime.
The MAXIMUM parameter indicates the maximum amount of memory
needed by the indicated section of the command file.
For example, the command
A>link86 test [data [add [100], max [1000]], code [abs[40]]]
creates the
information:
file
TESTCMD
whose
header
contains
the
following
• The DATA section requires at least lOOH paragraphs in addition to
the data inthe command file.
• The DATA section can use up to lOaOH paragraphs of memory.
• The CODE section must load at absolute paragraph address 40H.
ORIGIN
The ORIGIN parameter is a hexadeci m al va I u e that ind icates the byte
offset where the indicated section of the command file should begin.
LlNK-86 assumes a default ORIGIN value of 0 for each section except
the DATA section, which has a default value of lOOH to reserve space
for the Base Page in a native-mode program or the Program Segment
Prefix (PSP) in a PC DOS mode program
Table 7-3 summarizes the default values for each of the command
options and parameters.
7-9
7.6 Command File Options
Programmer's Utilities Guide
Table 7-3.
Default Values
for Command File Options and Parameters
OPTION
GROUP
CLASS
CODE
DATA
STACK
EXTRA
X1
X2
X3
X4
CGROUP
DGROUP
CODE
DATA
STACK
EXTRA
Xl
X2
X3
X4
SEGMENT
CODE
DATA
STACK
EXTRA
Xl
X2
X3
X4
ABS
a
a
a
0
a
a
a
a
ADD
a
a
0
a
a
a
a
a
MAX
ORG
a
a
1000H'
100H
0
0
a**
0"
a
a
a
a
a
a
..
a
a"
* If there is a DGROUP; otherwise OH.
** Native-mode only
7.6.~
FILL / NOFILL
The FILL and NOFILL options tell LlNK-86 what to do with any
uninitialized data at the end of a section of the command file. The
FILL option, which is active by default, directs LlNK-86 to include this
uninitialized data in the command file and fill it with zeros.
The
NOFILL option directs LlNK-86 to omit the uninitialized data from the
command file. Note that these options apply only to uninitialized data
at the end of a section of the command file. Uninitialized data that is
not at the end of a section is always zero filled and included in the
command file.
7.6.3
HARD8087
You must use the HARD8087 option if the program contains 8087
instructions. There are no 8087 software emulation routines provided
with LlNK-86. A program that contains 8087 instructions must always
run on a system with an 8087 coprocessor
7-10
Programmer's Utilities Guide
7.6 Command File Options
7.6.4 CODESHARED (Native-mode only)
The CODESHARED option marks the group in the CMD file header with
a group descriptor type 09H (shared code). The default code group
descriptor is 01H (non-shared code).
7.7 SYM File Options
The following command options affect the contents of the SYM file
created by L1NK-86:
•
•
•
•
LOCALS
NOLOCALS
L1BSYMS
NOLIBSYMS
These options must appear in the command line after the specific file
or files to which they applV. When you specify one of these options, it
remains in effect until you specify another. Therefore, if a command
line contains two options, the leftmost option affects all of the
specified files until the second option is encountered, which affects all
of the remaining files specified on the command line.
7.7.1
LOCALS I NOLOCALS
The LOCALS option directs LlNK-86 to include local symbols in the
SYM file if they are present in the object files being linked.
The
NO LOCALS option directs LlNK-86 to ignore local symbols in the
object files. The default is LOCALS. For example, the command
A>link86 test1 [nolocals). test2 [locals], test3
creates a SYM file containing local
TEST30BJ, but not from TESTlOBJ
symbols from
TEST2.0BJ
and
7.?2 lIBSYMS I NOllBSYMS
The L1BSYMS option directs LlNK-86 to include in the SYM file any
symbols coming from a library searched during the link operation. The
NOLIBSYMS option directs LINK-86 not to include those symbols in the
SYM file.
7 -11
7.7 SYM File Options
Programmer's Utilities Guide
Typically, such a library search involves the runtime subroutine library
of a high-level language such as C. Because the symbols in such a
library are usually of no interest to the programmer, the default is
NOLIBSYMS.
7.8 MAP File Option
The MAP option directs L1NK-86 to create a MAP file containing
information about the segments in the command file. The amount of
information L1NK-86 puts into the MAP file is controlled by the
following optional parameters
OBJMAP
L86MAP
ALL
NOOBJMAP
NOL86MAP
NOCOMMON
These parameters are enclosed in brackets following the MAP option.
The OBJMAP parameter directs L1NK-86 to put segment information
about OBJ files into the MAP file.
The NOOBJMAP parameter
suppresses this information.
Similarly, the L86MAP switch directs
L1NK-86 to put segment information from L86 files into the MAP file.
The ALL
The NOL86MAP parameter suppresses this information.
parameter directs' L1NK-86 to put all the information into the MAP file.
The NOCOMMON parameter suppresses all common segments from
the MAP file.
Once you instruct LINK-86 to create a MAP file, you can change the
parameters to the MAP option at different points in the command line.
For example, the command
A> link86 finance [ma p [a II]J.screen.186,gra ph.186[map[ nol86ma p 1]
directs L1NK-86 to create a map file containing segment information
from
FINANCE.OBJ
and
SCREEN.L86;
segment
information
for
GRAPH.L86 is suppressed by the NOl86MAP option
If you specify the MAP option with
OBJMAP and NOL86MAP as defaults.
7-12
no parameters, L1NK-86
uses
Programmer's Utilities Guide
7.9 SEARCH Option
7.9 SEARCH Option
The SEARCH option directs LlNK-86 to search the preceding library and
include in the command file only those modules satisfying external
references from other modules. Note that L1NK-86 does not search
L86 files automatically. If you do not use the SEARCH option after a
library file name, LINK-86 includes all the modules in the library file
when creating the command file. For example, the command
A>link86 testl, test2, math.IS6 [search]
creates the native-mode file TEST1.CMD by combining the object files
TESTl.OBJ, TEST2.0BJ, and any modules from MATH.L86 referenced
directly or indirectly from TEST1.OBJ or TEST2.0BJ.
The modules in the library file do not have to be in any special order.
L1NK-86 makes multiple passes through the library index when
attempting to resolve references from other modules.
L1NK-86 automatically uses the SEARCH option when linking compilerrequested libraries.
7.10 Input File Options
The following command options determine how L1NK-86 uses the input
file:
INPUT
ECHO
The INPUT option directs L1NK-86 to obtain further command line input
from the indicated file. Other files can appear in the command line
before the input file. but the input file must be the last filename on the
command line. When LINK-86 encounters the INPUT option, It stops
scanning the command line, entered from the console
Note that you
cannot nest command input files.
That is, a command input fiie
canr.lOt contain the input option
The input file consists of filenames and options Just like a command
line entered from the console
An Input file can contain up to 2048
characters, including spaces
For example, the file TEST.INP might
include the lines
7-13
7.11 1/0 Option
Programmer's Utilities Guide
MEMTEST=TEST1,TEST2,TEST3,
IOLlB.L86[S],MATH.L82[S 1,
TEST4,TEST5[LOCALS]
To direct LlNK-86 to use this file for input, enter the command
A>link86 test[input]
If no file type is specified for an input file, LlNK-86 assumes INP.
The ECHO option causes LlNK-86 to display the contents of the INP
file on th.e ~onsole as it is read.
7.11
1/0 Option
The $ option controls the source and destination
LlNK-86. The general form of the $ option is
devices
under
$Tdrive
where T is a file type and drive is a single-letter drive specifier.
File Types
LlNK-86 recognizes five file types
C - Command File (CMD or EXE)
L - Library File (L86)
M - Map File (MAP)
o - Object File (OBJ or L86)
S - Symbol File (SYM)
Drive Specifications
The drive specifier can be a letter in the range A through P,
corresponding to one of sixteen 10~Jlcal drives Alternatively, it can be
one of the following special characters
, -14
Programmer's Utilities Guide
xY Z -
7.11 I/O Option
Console
Printer
No Output
When you use the $ option, you cannot separate the Tdrive 1:haracter
pair with commas. You must use a comma to set off any $ options
from other options.
For example, the three command lines shown
below are equivalent:
A>link86 part1 [$sz,$od,$lb],part2
A>link86 part1 [$szodlb],part2
A>link86 part' [$sz od Ib],part2
The value of a $ option remains in effect until LlNK-86 encounters a
countermanding option as it processes the command line from left to
right.
7.11.1
$C (Command) Option
The $C option uses the form:
$Cdrive
LlNK-86 normally generates the command file on the same drive as
the first object file in the command line.
The $C option instructs
LlNK-86 to place the command file on the drive specified by the drive
character following the $C ($CZ suppresses the generation of a
command file).
7.11.2 $L (Library) Option
The $L option uses the form.
$Ldrive
LlNK-86 normally searches on the default drive for runtime subroutine
libraries linked automatically The $L option directs LlNK-86 to search
the specified drive for these library files,
7-15
7.11 I/O Option
Programmer's Utilities Guide
7.11.3 $M (Map) Option
The $M option uses the form:
$Mdrive
LlNK-86 normally generates the Map file on the same drive as
command file. The $M option instructs LlNK-86 to place the Map
on the drive specified by the drive character following the
Specify $MX to send the Map file to the console or $MY to send
MAP file to the printer.
the
file
$M.
the
7.11.4 $0 (Object) Option
The $0 option uses the form
$Odrive
LlNK-86 normally searches for the OBJ or L86 files that you specify in
the command line on the default drive, unless such files have explicit
drive prefixes. The $0 option allows you to specify the drive location
of multiple OBJ or L86 files without adding an explicit drive prefix to
each filename. For example, the command
A>link86 p[$odLq,r,s,t,u.186,b:v
tells LlNK-86 that all the object files except the last one are located on
drive D. Note that this does not apply to libraries linked automatically
(see Section 7.11.2).
7.11.5 $S Symbol Option
The $S option uses the form
$Sdrive
LlNK-86 normally generates Symbol files on the same drive as the
command file. The $S option directs LlNK-86 to place these files on
the drive specified by the drive character following the $S. Specifying
$SZ directs LlNK-86 not to generate the files.
7-1-6
Programmer's Utilities Guide
7.121/0 Option
7.12 The Link Process
The link process involves two distinct phases: collecting the segments
in the object files, and then positioning them in the command file.
The following terms are used in this section to describe how LlNK-86
processes object files and creates the command file.
Segment
A collection of code or data bytes whose length is
less than 64K. A segment is the smallest unit that
LlNK-86 manipulates.
Segment name
Any valid RASM-86 identifier. LlNK-86 combines all
segments with the same segment name from
separate object files.
Class name
Any valid RASM-86 identifier.
LlNK-86 uses the
class name to position the segment in the correct
section of the command file.
Align type
Indicates the type of boundary where the segm'ent
begins. The Align types are byte, word, paragraph
and page
Combine type
Determines how LlNK-86 combines segments with
the same name from different files into a single
segment The Combine types are: public, common,
stack, absolute, and local.
Group
A collection of segments with different names
grouped into a single segment.
By grouping
segments, you can combine library modules and
other modules of similiar type with your object file
modules into a single segment
By combining the
contents of individual segments into one large
segment. the painter need only be a 16-bit offset
into a single segment
This results in shorter and
faster code than addressing individual segments
with 32-bit pointers
7-17
7.12 The Link Process
Programmer's Utilities Guide
If your program is written in a high-level language,
automatically assigns the Segment name, Class name,
type, and Combine type.
If your program is written
language, refer to Section 3 for a description of how to
attributes.
7.12.1
the compiler
Group, Align
in assembly
assign these
Phase 1 - Collection
In Phase 1, LlNK-86 first collects all segments from the separate files
being linked, and then combines them into the output file according to
the combine type, align type, and group type specified in the object
module.
Combine Types
The combine type determines how the data and code segments of the
individual object files are combined together into segments in the final
executable file. There are 5 combine types:
•
•
•
•
•
Public
Common
Stack
local
nnnn (absolute segment)
When the Public Combine type is used, LlNK-86 combines segments by
. concatenating them together, leaving the appropriate space between
. the segments as indicated by the Align type (see below). Public is the
. most common Combine type, and RASM-86. as well as most highlevel language compilers, use it by default.
For example, suppose there are three object files: FILEA.OBJ, FILEB.OBJ,
and FILEC.OBJ, and each file defines a data segment, named Dataseg,
with the public combine type.
Figure 7-1 illustrates how LINK-86
combines this segment using the default combine type. public.
7-18
Programmer's Utilities Guide
Figure 7-1.
7.12 The Link Process
Dataseg (C)
150H
Dataseg (B)
200H
Dataseg (A)
100H
450H
Combining Segments with the Public Combine Type
Figure 7-2 illustrates the Common Combine type. Suppose the three
files: FILEA.OBJ, FILEB.OBJ, and FILEC.OBJ each contain a data segment
named Dataseg, with the Common Combine type, UNK-86 combines
these data segments so all parts of the segments from the separate
files being linked have the same low address in memory.
The
Common Combine type overlays the data or code from the various
object files, making it common to all of the linked routines in the
executable file. Note that this corresponds to a common block in highlevel languages,
Dataseg (A.B,C)
1
200H
!
Figure 7-2.
Combining Segments with the Common Combine Type
LlNK-86 combines segments with the Stack Combine type so the total
length of the resulting stack segment is the sum of the input stack
segments, including any Intersegment gaps specified by the align type,
7-19
7.12 The link Process
Programmer's Utilities Guide
For example, suppose the three files FILEA.OBJ, FILEB.OBJ, and
FILEC.OBJ each contain a segment named Stkseg with the Stack
Combine type.
Figure 7-3 illustrates how they are combined by
LlNK-86.
SP Starts
Here
High
Stkseg (A)! (1 DOH)
Stkseg (C)
(150H)
Stkseg (8)
(200H)
450H
Low
SS:
Figure 7-3.
Combining Segments with Stack Combination
Segments with the local or absolute combine type cannot be
combined. L1NK-a6 displays an error message if the files being linked
contain multiple local segments with the same name.
Align Type
The Align type indicates on what type of boundary the segment
begins, and thus determines the amount of space L1NK-86 leaves
between segments of the same name. When you specify an align
type, you determine whether the base address of a segment is to start
on a byte, word, paragraph, or page boundary. Four align types can be
specified in L1NK-86:
•
•
•
•
Byte alignment (multiple of 1 byte)
Word alignment (multiple of 2 bytes)
Paragraph alignment (multiple of 16 bytes)
Page alignment (multiple of 256 bytes)
Byte alignment produces the most compact code. When segments are
byte aligned, no gap is left between the segments
7-20
Programmer's Utilities Guide
7.12 The Link Process
If the segments are word aligned, LlNK-86 adds a one-byte gap, if
necessary, to ensure that the next part of the segment begins on a
word boundary.
Word is the default Align type for Data segments,
since the 8086 and 80286 processors perform faster memory accesses
for word-aligned data.
Word alignment is useful for saving space
when a large number of small segments are used. However, the offset
of the base of the segment may not be zero.
The gap between paragraph-aligned segments can be up to 15 bytes.
Paragraph alignment is used when the offset of the base of the
segment must be zero
Page-aligned segments have up to 255-byte gaps between them. Page
alignment is used when creating system applications where the code
or data must start on a page boundary.
Suppose the data segment. Dataseg, has the paragraph Align type and
has a length of 129H in FILEA, 10EH in FILEB, and 13AH in FILEC. As
shown, L1NK-86 combines the segments to ensure that each segment
begins on a pnrJgraph boundary.
Resulting dataseg is
37AH bytes long
GJ
13AH
240H
!
2H byte gap
I1J
130H
LIJ
7H byte gap
III
100HLlJ
Figure 7-4.
Paragraph Alignment
7-21
7. J2 The link Process
Programmer's Utilities Guide
LlNK-a6 does not align segments having an Absolute combine type
because these segments have their load-time memory location
determined at translation time.
Grouping
LlNK-a6 combines segments into groups.
When segments are
grouped, intersegment gaps are determined using the same Align
types as those used to combine segments. Figure 7-5 illustrates how
L1NK-a6 combines segments into groups.
N64F
N+4S.1 FF
Dataseg 3 (200H)
Dataseg 3 (VAR50U)
VARSO
..L.-J---l N+450
I - -_ _ _ _ _ _ _
1 - - - - - - - - - - - 4 - - - 1 NA50
N44F
N+ 1 034F
Dataseg 2
Dataseg 2 (350H)
1 - - - - - - - - - - - 1 N+ 100
NFF
Dataseg 1 (1 OOH)
' - -_ _ _ _ _ _ _ _ _-J NO
a. Segments Without Groups
Figure 7-5.
1 - - - - - - - - - 4 - - - 1 N 100
N:FF
Dataseg 1
' - - _ _ _ _ _ _ _........._ - J
NO
b. Segments Within A Group
The Effect of Grouping Segments
In Figure 7-5, N:O is the base address where the segments are loaded
at run-time (paragraph N, offset 0).
Figure 7-5a shows that each
segment not contained in a group begins at offset zero, and thus can
be up to 64K long. The offset of any given location, in this case the
variable VAR, is relative to the base of the segment. Thus, in order to
access VAR at run-time, the program must load a segment register
with the base address of the data segment Dataseg3 and point to an
offset of 50H.
7-22
Programmer's Utilities Guide
-------------_.. -_..._-----_ .._----------
7.12 The Link Process
In Figure 7-5b, the same segments are combined in a group_ The
offsets of the segments are now cumulative and thus cannot extend
past 64k-bytes (FFFFH). The offset of VAR is 500H relative to the base
of the group. At run-time, the program does not need to reload a
segment register to point to the base of Dataseg3, but can access VAR
directly by pointing to an offset of 500H.
7.12.2 Phase 2 - Create Command File
In Phase 2, LlNK-86 assigns each group and segment to a section of
the command file as follows:
1. LlNK-86 first processes any segments, groups or classes the user
placed in a specific section by means of the command line
options described in Section 7.5.
2. Segments belonging to the group
CODE section of the command file.
CGROUP are placed
in
the
3. Segments belonging to the group DGROUP are placed in the
DATA section of the command file. Note that the group names
CGROUP and DGROUP are automatically generated by PL/I-86,
CB86, and other high-level language compilers.
4. If there are any segments not processed according to (1), (2), and
(3), LlNK-86 places them in the command file according to their
class name, as shown in Table 7-3
This table also shows the
RASM-86 segment directives that produce the class names as
defaults.
5. Segments not processed by any of the above means are omitted
from the command file because LlNK-86 does not have sufficient
information to position them.
7-23
7.12 The Link Process
Table 7-4.
Class Name
Programmer's Utilities Guide
LlNK-86 Usage of Class Names
Command File Section Segment Directive
CODE
DATA
EXTRA
STACK
Xl'
CODE
DATA
EXTRA
STACK
Xl
X2*
X3*
X2
X3
X4
X4"
CSEG
DSEG
ESEG
SSEG
* Native-mode only. There is no segment directive in RASM-86
producing this class name as a default; you must supply it
explicitly.
See Appendix G for a list of LlNK-86 error messages.
End of Section 7
7-24
SECTION 8
LIB-86 Library Utility
8.1
Introduction
LlB-86 is a utility program for creating and maintaining library files
containing 8086 or 80286 object modules.
These modules can be
produced by any language translator that produces modules in Intel's
8086 or 80286 object module format.
You can use LlB-86 to create libraries, as well as append, replace,
select or delete modules from an existing library. You can also use
LlB-86 to obtain information about the contents of library files.
8.2 LlB-86 Operation
When you invoke L1B-86, it reads the indicated files and produces a
Library file, a Cross-reference file, or a Module map file as indicated
by the command line. When LlB-86 finishes processing, it displays the
Use Factor, a decimal number indicating the percent of available
memory LlB-86 uses during processing.
Table 8-1 shows the filetypes recognized by LlB-86.
Table 8-1.
Type
INP
L86
MAP
OBJ
XRF
LlB-86 Filetypes
Usage
Input Command File
Library File
Module Map File
Object File
Cross-reference File
8-1
8.3 LlB-8S Command Syntax
Programmer's Utilities Guide
8.3 L1B-86 Command Syntax
LlB-86 uses the command form:
LlS8S libraryfile
= file1
[options] file2, .... filen
LlB-8S creates a Library file with the filename given by LlBRARYFILE. If
you omit the filetype, LlB-86 creates the Library file with filetype L86.
LlB-86 reads the files specified by FILE 1 through FILEN and produces
the library file. If FILE1 through FILEN do not have a specified filetype,
LlB-86 assumes a default filetype of OBJ. The files to be included can
contain one or more modules; they can be OBJ or L86 files, or a
combination of the two.
Modules in a library need not be arranged in any particular order,
because LlNK-86 searches the library as many times as necessary to
resolve references. However, LlNK-86 runs much faster if the order of
modules in. the library is optimized.
To do this, remove as many
backward references as possible (modules which reference public
symbols declared in earlier modules in the library) so LlNK-86 can
search the library in a single pass.
Module names are assigned by language translators. The method for
assigning module names varies from translator to translator, but is
generally either the filename or the name of the main procedure.
8.4 Stopping lIB-86
With the native-mode version, you can press any console key to halt
Lie-aS, which then displays the message.
STOP LlB'-86 (YIN)?
If you type Y, LlB-8S immediately stops processing and returns control
to the operating system.
Typing N causes LlB-86 to resume
processing.
You can stop both the native-mode and PC DOS mode versions by
typing Ctrl-C.
8-2
Programmer's Utilities Guide
8.5 LlB-86 Command Options
8.5 LlB-86 Command Options
When you invoke LlB-86, you can specify optional parameters in the
command line controlling the operation
Table 8-2 shows the LlB-a6
command options.
You can abbreviate each option keyword by
truncating on the right, as long as you include enough characters to
prevent ambiguity. Thus, EXTERNALS can be abbreviated EXTERN, EXT,
EX, or simply, E. The following sub-sections describe the function of
each command uption.
Table 8-2.
Option
DELETE
EXTERNALS
ECHO
INPUT
MAP
MODULES
NOALPHA
PUBLICS
REPLACE
SEGMENTS
SELECT
XREF
LlB-86 Command Line Options
Purpose
Abbreviation
Delete a Module from a Library file
Show EXTERNALS in a Library file
Echo contents of INP file on console
Read commands from Input file
Create a Module Map
Show Modules in a Library file
Show Modules in order of occurrence
Show PUBLICS in a Library file
Replace a Module in a Library file
Show Segments in a Module
Select a Module from a Library file
Create a Cross-reference file
D
E
I
MA
MO
N
P
R
SEG
SEL
X
8.6 Creating and Updating Libraries
The following sections describe how you create new libraries and
update existing libraries.
8-3
8.6 Creating and Updating Libraries
Programmer's Utilities Guide
8.6.1 Creating a New Library
To create a new library, enter the name of the library, then an equal
sign followed by the list of the files you want to include, separated by
commas. For example,
=a,b,c
A>lib86 newlib.186 = a.obj,b.obj,c.obj
A>lib86 math = add,sub,mul,div
A>lib86 newlib
The first two examples are equivalent.
8.6.2 Adding to
a Library
To add a module or modules to an existing library, specify the library
name on both sides of the equal sign in the command line.
The
library name appears on the left of the equal sign as the name of the
library you are creating. The name also appears on the right of the
equal sign, with the names of the other file or files to be appended.
For exanple,
A>lib86 math
= math.186,sin,cos,tan
A>lib86 math
= sqrt,math.l86
8.6.3 Replacing a Module
lIB-86 allows you to replace one or more modules without rebuilding
the entire library from the individual object files. The command for
replacing a module or modules in a library has the general form:
LlB86 newlibrary = old library [ REPLACE [replace list] ]
where NEWLIBRARY is the name of the new library file you wish to
create; OLDLIBRARY is the name of the existing library file (that can be
the same as NEWLIBRARY) containing the module you want to replace;
and REPLACE LIST contains one or more module names of the form:
modulename = filename
For example, the command:
8-4
Programmer's Utilities Guide
8.6 Creating and Updating Libraries
A> lib86 math = math.186 [replace [sqrt=newsqrt] ]
directs LlB-86 to create a new file MATH.L86 using the existing
MATH.L86 as the source, replacing the module SORT with the file
NEWSQRT.OBJ. If the name of the module being replaced is the same
as the file replacing it, you need to enter the name only once. For
example, the command:
A>lib86 math = math.186 [replace [sqrt] ]
replaces the module SORT with the file SORT.OBJ in the Library file
MATH.L86.
You can effect multiple replaces in a single
commas to separate the names. For example,
command
by
using
A>lib86 new = math.186 [replace [sin=newsin,cos=newcos]
Note that you cannot use the command options DELETE and SELECT in
conjunction with REPLACE.
LlB-86 displays an error message if it cannot find any of the specified
modules or files. See Appendix H for a complete list of LlB-86 error
messages.
8.6.4
Deleting a Module
The comma nd for d eleti ng a mod u Ie or mod u les from a librar.y has the
general form:
LlB86 newlibrary
= oldlibrary
[ DELETE [module specifiers) )
where MODULE SPECIFIERS can contain either the names of single
modules, or a collection of modules, which are specified using the
name of the first and the last modules of the group, separated by a
hyphen. For example,
A>libS6 math = math.IS6 [delete [sqrt] )
A>lib86 math = math.186 [delete [add, sub, mul, div] ]
A> lib86 math = math.IS6 [delete [add - div] ].
You cannot use the command
conjunction with DELETE.
options
REPLACE
and
SELECT
in
8-5
.8.6 Creating and Updating Libraries
Programmer's Utilities Guide
LlB-86 displays an error message if it cannot find any of the specified
modules in the library (see Appendix H).
8.6.5 Selecting a Module
The command for selecting a module or modules from a library has
the general form:
LlBS6 newlibrary = oldlibrary [ SELECT [module specifiers] ]
where MODULE SPECIFIERS can contain either the names of single
modules, or groups of modules, which are specified using the name of
the first and the last modules of the group, separated by a hyphen.
For example,
A>lib86 arith = math.l86 [select [add, sub, mul, div] ]
A>lib86 arith = math.l86 [select [add - div] ]
You cannot use the command
conjunction with SELECT.
options
DELETE
and
REPLACE
in
LlB-B6 displays an error message if it cannot find any of the specified
modules in the library (see Appendix H).
8.7 Displaying Library Information
You can use LlB-86 to obtain information about the contents of a
library.
LlB-86 can produce two types of listing files: a Crossreference file and a Library Module Map.
Normally, LlB-86 creates
these listing files on the default drive, but you can route them directly
to the console or the printer by using the command options described
in Section 8:5.
8.7.1
Cross-reference File
You can create a file containing the Cross-reference listing of a library
with the command:
LlB86 libraryname [XREF]
LlB-86 .proGuces the file LlBRARYNAMEXRF on the default drive, or you
can redirect the listing to the console or the printer.
8-6
Programmer's Utilities Guide
8.7 Displaying Library Information
The Cross-reference file contains an alphabetized list of all Public,
External, and Segment name symbols encountered in the library.
Following each symbol is a list of the modules in which the symbol
occurs. LlB-86 marks the module or modules in which the symbol is
defined with a pound sign, #, after the module name. Segment names
are enclosed in slashes, as in /CODEI.
At the end of the crossreference listing, LIB-86 indicates the number of modules processed.
8.7.2
Library Module Map
You can create a Module Map of a library using the command:
L1B86 libraryname [MAP]
L1B-86 produces the file LlBRARYNAME.MAP on the default drive, or
you can redirect the listing to the console or the printer.
The Module Map contains an alphabetized list of the modules in the
Library file. Following each module name is a list of the segments in
the module and their lengths. The Module Map also includes a list of
the Public symbols defined in the module, and a list of the External
symbols referenced in the module.
At the end of the Module Map
listing, LlB-86 indicates the number of modules processed.
LlB-86 normally alphabetizes the names of the modules in the Module
Map listing
You can use the NOALPHA switch to produce a map
listing the modules in the order in which they occur in the library. For
example,
A>lib86 math.186 [map,noalpha]
8.7.3
Partial Library Maps
You can use LIB-86 to create partial library maps in two ways. First,
you can create a map with only module names, Segment names.
Public names, or External names using one of the commands:
L1B86
LI B86
LIB86
LlB86
libraryname
libra ryn a m e
libraryname
libraryname
[MODULES]
[SEG M ENTS)
[PUBLICS)
[EXTERNALS)
8-7
8-7 Displaying Library Information
Programmer's Utilities Guide
You can also combine the SELECT command with any of the mapproducing commands described above, or the XREF command.
For
example,
A>lib86 math.186 [map,noalpha,select [sin,cos,tan] ]
A>lib86 math.18G [xref,select [sin,cos,tan] ]
8.8 LlB-86 Commands on Disk
For convenience, lIB-86 allows you to put long or commonly used
LlB-86 command lines in a disk file. Then when you invoke LlB-86, a
single command line directs LlB-86 to read the rest of its command
line from a file. The file can contain any number of lines consisting of
the names of files to be processed and the appropriate LlB-86
command options. The last character in the file must be a normal
end-of-file character (lAH).
To direct LlB-86 to read commands from a disk file, use a command of
the general form:
UB86 filename [INPUT]
If FILENAME does not include a filetype, LIB-86 assumes filetype INP.
As an example, the file MATH.INP might contain the following:
MATH = ADD [$OC],SUB,MUL,DIV,
SIN,COS,TAN,
SQRT,LOG
Then the command:
A>lib86 math [input]
directs LlB-86 to read the file MATH.INP as its command line. You can
include other command options with INPUT, but no other filenames
can appear in the command line after the INP file. For example,
A>/ib8G math [input,xref,map]
The ECHO option causes LlB-86 to display the contents of the INP file
on the console as it is read.
8-8
Programmer's Utilities Guide
8.9
8.9 Redirecting I/O
Redirecting I/O
LlB-86 assumes that all the files it processes are on the default drive.
so you must specify the drive name for any file not on the default
drive.
LlB-86 creates the L86 file on the default drive unless you
specify a drive name. For example.
A>lib86 e:math
= math.186.d:sin.d:cos,d:tan
LlB-86 also creates the MAP and XRF files on the same drive as the
L86 file it creates. or the same drive as the first object file in the
command line if no library is created.
You can override the LlB-86 defaults by using the following command
options:
$M<drive> - MAP file destination drive
$0 < drive> - source OBJ or L86 file location
$X<drive> - XRF file destination drive
where <drive> is a drive name (A-P). For the MAP and XRF files.
<drive> can be X or Y. indicating console or printer output,
respectively. You can also put multiple I/O options after the dollar
sign. For example.
A>lib86 trig [map.xref,$ocmyxy]
= sin,cos.tan
The $0 switch remains in effect as LlB-86 processess the command
line from left to right. until it encounters a new $0 switch.
This
feature can be useful if you are creating a library from a number of
files. the first group of which is on one drive. and the remainder on
another drive. For example.
A>lib86 big lib = al [$ocLa2 .... a50 [$odl.aSl, ... al00
End of Section 8
8-9
SECTION 9
SID-86 Operation
9.1
Introduction
SID-86 is a symbolic debugger designed for use with the Concurrent
DOS 86 operating system, SID-86 features:
• Symbolic assembly and disassembly
• Expressions involving hexadecimal, decimal, ASCII, and symbolic
values
• Permanent breakpoints with pass counts
• Trace without call
To use 510-86, you should be familiar with the Intel 8088/8086/80286
microprocessor architecture, and Concurrent DOS 86 as described in
the Con.currenL_QQ~ __8_6S\L~H~!!l __ Q_l,!jg~ and the Concurrent DOS 86
Prog ra m D1 e~_ J~_YL(:t~,
9.2 Typographical Conventions
The following typographical conventions are used to illustrate SID-86's
command and output structures:
• Commands appear in UPPERCASE characters and their arguments
appear in lower case characters,
This convention is used to
distinguish the command from its arguments, Typically, you enter
all 510-86 command characters in lower case,
• When an example of a 510-86 command is given, user input is
displayed in bold print,
• Some of the examples of 510-86 output use horizontal andlor
vertical elipses (".,.) to illustrate the continuation of an output
pattern.
9-1
9.2 Typographical Conventions
Programmer's Utilities Guide
• A < ctrl > sign is used to illustrate the CONTROL (or CTRL) key on
your keyboard. For example, <ctrl>-O instructs you to press and
hold down the CONTROL key while you press the "0" key .
• [] are used to signify an optional parameter
9.3 Starting SID-86
You start SID-86 by entering a command in one of the following
forms:
SID
SID filespec [symfilespec]
The first form loads and executes SID-86. After displaying its sign-on
message and prompt character (#) 510-86 is ready to accept
commands.
In the second form, filespec specifies the name of the file to be
debugged.
If you do not enter a filetype, SID-86 assumes a CMO
filetype (in native mode) or an EXE filetype (in PC DOS mode).
Symfilespec specifies the optional symbol (SYM) file, with or without
file extension.
The following are examples of valid 510-86 command lines:
A>sid
Start 510-86
A>sid hello.cmd Start 510-86 and load the command file hello.cmd
as the debug process.
A>sid b:hello b:hello
Start S10-86 and load the command file, hello, along
with the symbol table file, hello.sym, from the B
drive.
9-2
Programmer's Utilities Guide
9.4 Exiting S10-86
9.4 Exiting S10-86
SID-86 does not automatically save any files upon exit. Therefore, to
save the modified version of your file, write the file to disk using the
W (write) Command described in Section 11.4.19 before exiting SI0-86.
You can exit SID-86 by typing Ctrl-C in response to the # prompt (see
Section 11.4.12). This returns control to the operating system.
End of Section 9
9-3
SECTION 10
SID-86 Expressions
10.1
Introduction
SID-86 can reference absolute machine addresses through expressions.
Expressions can use names from the program's SYM file, which is
created when the program is linked using LlNK-86. Expressions can
also be literal values in hexadecimal, decimal, or ASCII character string
form. You can combine these literal values with arithmetic operators
to provide access to subscripted and indirectly-addressed data or
program areas.
10.2
Literal Hexadecimal Numbers
SID-86 normally accepts and displays values in hexadecimal. Valid
hexadecimal digits consist of the decimal digits
through 9 and the
hexadecimal digits A, S, C, D. E, and F, which correspond to the
decimal values 10 through 15, respectively.
a
A literal hexadecimal number in SID-86 consists of one or more
contiguous hexadecimal digits.
If you type four digits, the leftmost
digit is most significant and the rightmost digit is least significant. If
the number contains more than four digits, the rightmost four are
recognized as significant, and the remaining leftmost digits are
discarded.
The following examples show the hexadecimal and the
decimal equivalents of the corresponding input values.
Input Value
HexarAcimal
Decimal
1
100
fffe
10000
38001
0001
0100
FFFE
0000
8001
1
256
65534
0
32769
10-1
10.3 Literal Decimal Numbers
Programmer's Utilities Guide
10.3 Literal Decimal Numbers
Enter decimal numbers by preceding the number with the # symbol.
The number following the # symbol must consist of one or more
decimal digits (0 through 9), with the most significant digit on the left
and the least significant digit on the right. Decimal values are padded
or truncated according to the rules of hexadecimal numbers when
converted to the equivalent hexadecimal value.
In the following examples, the input values on the left produce the
internal hexadecimal values on the right:
Input Value
Hexadecimal Value
#9
0009
#10
OOOA
#256
#65535
#65545
0100
FFFF
0009
10.4 Literal Character Values
510-86 accepts one or two printable ASCII characters enclosed in
apostrophes as literal values in expressions.
Characters remain as
typed within the apostrophes (that is, no case translation occurs). The
leftmost character is the most significant, and the rightmost character
is the least significant. Single character strings are padded on the left
with zeros. Strings having more than two characters are not allowed
in expressions, except in the S command, as described in Section
11.4.14.
Note that the enclosing apostrophes are
string, nor are they included in the
exception is when a pair of contiguous
single apostrophe and included in the
character (see examples below).
10-2
not included in the character
character count.
The only
apostrophes is reduced to a
string as a normal graphic
Programmer's Utilities Guide
10.4 Literal Character Values
In the following examples, the strings to the left produce the
hexadecimal values to the right.
Note that uppercase ASCII
alphabetics begin at the encoded hexadecimal value 41; lowercase
alphabetics begin at 61; a space is hexadecimal 20 and anap-ostrophe
is hexadecimal 27. #
Input String
'A'
'AB'
'aA'
, A'
'A'
Hexadecimal Value
0041
4142
6141
0027
2727
2041
4120
10.5 Register Values
You can use the contents of a debug program's register set by
specifying a register name wherever a 16-bit number is valid. For
example, if you know that at a certain point in the program the BX
register points to a data area you want to see, the command
OOS:BX
displays the desired area of memory. If the current default address
segment' is OS, you can display the desired area of memory by
entering an index register:
OBX
Note that when assembling instructions using the A command, register
names are treated differently than in other expressions. In particular, a
register name in an assembly language statement entered in the A
(Assemble) command refers to the name of a register, and not its
contents.
10-3
10.6 Stack References
Programmer's Utilities Guide
10.6 Stack References
Elements in the stack can be included in expressions. A caret sign (")
refers to the 16-bit value at the top of the stack, pointed to by the SS
and SP registers {SS:SP} in the user's CPU state. A sequence of n
carets refers to the nth 16-bit value on the stack. For example, a
command having the form:
command"
uses the value stored at the top of the stack as its parameter. If two
carets are given. the second value stored on the stack is used; three
carets specifies the third value on the stack. and so on.
For example. if you wish to display the value located on the top of the
stack. you could enter:
OSS:"
If the address of a segment and the address of a particular offset
within that segment are both stored on the stack, carets can be used
to spe~ify a complete address. For example, if the third value on the
stack is used as a segment address and the first value on the stack is
used as the offset within that segment you can display the complete
address using the following command:
0""
":1'\
You can use a stack reference to set a breakpoint on return from a
subroutine, even though the actual value is not known.
For example. when calif pushes the current code segment address {CS}
onto the stack, followed by the address of the next program
instruction {IP}, the command
G, 1'\
.
1'\.1'\
transfers control to the program and sets breakpoints at the address
contained in the CS and IP registers. This command is the same as:
G,CS:IP
10-4
Programmer's Utilities Guide
, 0.7 Symbolic References
10.7 Svmbolic References
If a symbol table is present during debugging, you can reference
values associated with symbols using the following three symbol
reference forms:
.s
@s
=s
where s represents a sequence of 1 to 31
symbol in the table.
characters matching a
The .s form gives the 32-bit value associated with the symbol s in the
symbol table. The @s form gives the 16-bit value contained in the
word locations pointed to by s. The =s form gives the 8-bit value at s
in memory.
For example, given the following excerpt from a SYM table with a
segment address of CBO:
0000
0000
0100
0102
Variables
Data
Gamma
Delta
and given the following memory values:
CBO:Ol00
CBO:0101
CBO:O 102
CBO:Ol03
contains
contains
contains
contains
02
3E
40
22
then the symbol references SilUII",l below on the left gives the
hexadecimal values shown on the right.
Recall that 16-bit 80286
memory values are stored with the least significant byte first.
Therefore, the word values at 0100 and 0102 are 3E02 and 2240,
respectively.
10-5
10.7 Symbolic References
SYMBOL REFERENCE
.GAMMA
.DELTA
@GAMMA
@DELTA
=GAMMA
=DELTA
Programmer's Utilities Guide
HEXADECIMAL VALUE
CBO:0100
CBO:0102
3E02
2240
0002
0040
10.8 Qualified Symbols
Duplicate symbols can occur in the symbol table due to separately
assembled or compiled modules that independently use the same
name for different subroutines or data areas.
Block structured
languages allow nested name definitions that are identical. but
nonconflicting. Thus, SID-86 allows reference to "qualified symbols"
that take the form:
S1/S2/ . . . /Sn
where S1 through Sn represent symbols present in the table during a
particular session.
SID-86 always searches the symbol table from the first to last symbol
in the order the symbols appear in the symbol file. For a qualified
symbol, SID-86 begins by matching the first 51 symbol, then searches
for a match with symbol 52, continuing until symbol Sn is matched If
this search and match procedure is not successful, SID-86 prints a 7
to the console. Suppose, for example, that part of the symbol table
has a segment address of 000 appearing 111 the symbol file as follOWS:
0100
A
0300 B
0200 A
3EOO C
20FO
A
0102 A
Then the unqualified and qualified symbol references shown below on
the left produce the hexadecimal values shown on the right.
10-6
10.8 Qualified Symbols
Programmer's Utilities Guide
Symbol Reference
Hexadecimal Value
000:0100
2004
000:0200
000:0102
005E
000:20FO
.A
@A
.A/A
.c/A/A
=C/A/A
.B/A/A
10.9 Expression Operators
Literal numbers, strings, and symbol references can be combined into
symbolic expressions using unary and binary "+" and "-" operators.
S10-86 evaluates the expression from left to right, producing a 32-bit
address at each step.
Overflow and underflow are ignored as the
evaluation proceeds.
The final value becomes the command
parameter, whose interpretation depends upon the particular command
letter preceding it.
When placed between two operands, the + indicates addition to the
previously accumulated value.
The sum becomes the new
accumulated value in the evaluation.
The - symbol causes $10-86 to subtract the literal number or symbol
reference from the 16-bit value accumulated thus far in the symbolic
expression. If the expression begins with a minus sign, then the initial
accumulated value is taken as zero. That is,
-x
is computed as
O-x
where x is any valid symbolic expression.
For example, the address
0700-100
is the same as the address
0600
10-7
10.9 Expression Operators
Programmer's Utilities Guide
In commands specifying a range of addresses (i.e., B, 0, L, F, M and Wi,
the ending address of the range can be indicated as an offset from the
starting address. To do this, you can precede the desired offset with a
plus sign. For example, the command
DFDOO,+#S12
displays the memory from offset address FOOO to FFOO.
not allow use of the unary plus operator at other times.
S10-86 does
10.10 Sample Symbolic Expressions
Frequently, the formulation of symbolic expressions is closely related
to the program structures in the program being tested. Suppose you
want to debug a sorting program containing the following data items:
LIST
Names the base of a table (or array) of byte values
to sort, assuming there are no more. than 255
elements, denoted by L1ST(O), LlST(l), ." , LlST(254}.
N
A byte variable that gives the actual number of
items in LIST, where the value of N is less than 256.
The items to sort are stored in L1ST(O) through
L1ST(N-l }.
The byte subscript that indicates the next item to
compare in the sorting process. L1ST(I) is the next
item to place in sequence, where I is in the range 0
through N-l.
Given these data areas, the command
0.LlST,+#254
displays the entire area reserved for sorting as follows:
L1ST(O), L1ST(l), ... , lIST(254)
10-8
Programmer's Utilities Guide
10.10 Sample Symbolic Expressions
The command
D.LlST,+=1
displays the LIST vector up to and including the next item to sort as
follows:
LlST{O), LlST{l), ... , LlST(I)
The command
D.LlST +=1, +0
displays only LlST(I).
Finally, the command
D.LlST,+=N-1
displays only the area of LIST holding active items to sort as follows:
LlST(O), LlST(l), ... , LlST(N-1)
End of Section 10
10-9
SECTION 11
SID-86 Commands
11.1 Command Structure
When 510-86 is ready to accept a command, it prompts you with a
pound sign (I), after which you can enter one of the commands
described in this section, or type a CTRL -c to end the debugging
session.
A valid 510-86 command can have up to 256 characters and must be
terminated with a carriage return. A 510-86 command can be followed
by one or more arguments.
The arguments can be symbolic
expressions, filenames, or other information, depending on the
command. Arguments are separated from each other by commas or
spaces. Several commands (0, a, N, P, 5, T, and U) can be preceded
by a minus sign.
The effect of the minus sign varies among
commands. See the commands in Section 11.4.25 for explanations of
the effects of the minus sign on each command.
11.2 Specifying an Address
Most 510-86 commands require one or more addresses as operands.
Enter an address as follows:
ssss:OOOO
where ssss represents an optional 16-bit segment number and 0000 is
a 16-bit offset. If you omit the segment value,· 510-86 uses a default
value appropriate to the command being executed, as described in
Section 11.4.4.
It is not possible to have a debugged process (read in by the E
command or command line) and a file (read in by the R command)
simultaneously resident in 510-86. (See Sections 11.4.4 and 11.4.13 for
descriptions of the E and R commands.)
11-1
11.4 510-86 Commands
Programmer's Utilities Guide
11.3 Line Editing Functions
When you enter a command, use standard Concurrent line-editing
functions to correct typing errors. These line-editing functions are:
CTRL-X
erase from beginning of line to cursor
CTRL-S
move cursor to left
CTRL-O
move cursor to right
S10-86 does not process the command line until you enter a carriage
return.
11.4 S10-86 Commands
This section describes each SID-86 command in alphabetic order.
Table 11-2 at the end of this chapter summarizes SID-86 commands.
11.4.1 A (Assemble) Command
The A command assembles
memory. It has the form:
8086/80286
mnemonics
directly
into
As
where s is the address where assembly begins. S10-86 responds to
the A command by displaying the address of the memory location
where assembly begi<1s.
At this point. you can enter assembly
language statements as described in Section 4. When you enter a
statement, S/0-86 converts it to binary, places the value(s) in memory,
and displays the address of the next available memory location. This
process continues until you press the carriage return without entering
any statement or after entering only a period.
5/0-86 responds to invalid statements by displaying the message:
Bad command or parameter; press? for help
and redisplaying the current assembly address.
11-2
Programmer's Utilities Guide
11.4 510-86 Commands
Note that wherever a numeric value is valid in an assembly language
statement, you can also enter an expression. There is one difference
between expressions in assembly language statements and those
appearing elsewhere in SI0-86: under the A command, references to
registers refer to the names of the registers, while elsewhere they
refer to the contents of the registers. When you use the A command,
you cannot reference the contents of a register in an expression.
The following is an example of the A command:
Assemble at offset 213 of the current default CS
value.
#a213
nnnn:0213 mov aX,#128
Set AX register to decimal 128.
n nnn:0216 push ax
Push AX register on stack.
nnnn:0217 call .procl
Call procedure whose address is the value of the
symbol PROC 1.
nnnn:021A test byte [.i/i], 80
Test the most significant bit of the byte whose
address is the value of the second occurrence of
the symbol I.
nnnn:021E jz .done
Jump if zero flag set to the location whose address
is the value of the symbol DONE.
nnnn:0220 .
11.4.2
stop assemble process.
B (Block Compare) Command
The B command compares and displays the difference between two
blocks of memory loaded by either an R command, E command, or
command line. The B command has the form:
Bs1,f1,s2
11-3
11.4 S10-86 Commands
Programmer's Utilities Guide
where s1 is the address of the start of the first block; 11 is the offset
address that specifies the last byte of the first block, and 52 is the
address of the start of the second block.
If the segment is not
specified in s2, the same value used for 51 is assumed.
S10-86 displays any differences in the two blocks in the form:
a 1 b 1 a2 b2
where the a1 and the a2 are the addresses in the blocks; b1 and b2
are the values at the indicated addresses.
If no differences are
displayed, the blocks are identical.
The following are examples of the 8 command:
#b40:0,111,60:0
Compare 512 (200H) bytes of memory starting at
40:0 and ending at 40: 1FF with the block of memory
starting at 60:0.
#bes:.array1,+1f,.array2
Compare a 256-byte array starting at offset ARRAY1
in the extra segment with ARRA Y2 in the extra
segment.
11.4.3 D (Display) Command
The 0 command displays the contents of memory as 8-bit or 16-bit
hexadecimal values and in ASCII characters. The D command has the
following forms:
1. 0
2. Os
3.0s,f
4. OW
5.0Ws
6.0Ws,f
7. -On
11-4
Programmer's Utilities Guide
11.4 S10-86 Commands
where s is the starting address of the display, and f is the ending
address.
If no segment value is given for f, then the segment
specified by s is assumed and the value of f is used as the offset
within that segment.
Memory is displayed on one or more lines.
Each line shows the
values of up to 16 memory locations. For the first three forms, the
display line appears as:
ssss:OOOO bb bb ... bb aa ... a
where ssss is the segment being displayed, and 0000 is the offset
within segment ssss. The bb's represent the 8-bit contents of the
memory locations in hexadecimal, and the a's represent the contents
of memory in ASCII.
A period represents any nonprintable ASCII
character.
Form 1 displays memory from the current display address for 12
display lines. Form 2 is similar to form 1, except the default display
address is changed to address s. Form 3 displays the memory block
between locations 5 and f. Forms 4,5 and 6 are identical to forms 1,2
and 3 except that the contents of memory are displayed as 16-bit
words, rather than 8-bit bytes, as follows:
ssss:OOOO wwww wwww ... wwww aaaa ... aa
where wwww represents a 16-bit word in hexadecimal.
You can use Ctrl-S and Ctrl-Q to control scrolling during a long
display. In native mode, you can stop the display by typing any key at
the console; in PC DOS mode, type Ctrl-Break.
The last address displayed becomes the default starting address for
the next display unless another starting address is specified.
By default, the D command displays 176 bytes of memory. Form 7
form changes the default number to n, which can be any number
between 0 and 65535.
If the number of bytes left in the debugged process is less than the
established default value, then only those bytes remaining in the
process are displayed
11-5
11.4 510-86 Commands
Programmer's Utilities Guide
T~ fol/owing are examples of the 0 command:
#dfOO,f23
Display memory bytes from offset FOOH through
F23H in the current data segment.
#d.array+=i,+#10
Display 10 bytes starting at location ARRAY (i).
#dwss:sp
Display the value at the top of stack in word format.
#d"
Display the value at the top of stack in byte format.
#dw#128,#255
Display memory words from offset 80H through FFH.
#-d10
Set the default number of bytes displayed to 16.
11.4.4 E (Load Program, Symbols for Execution) Command
The E command loads a file into memory so a subsequent G, T, or U
command can begin program execution. The E command can also
load a symbol table file. The E command has the following forms:
1. (-1 Efilespec
2. (-1 Efilespec symfilespec
3. E"'symfilespec(,symfilespec.]
4. E
Form 1 loads the command file specified by filespec. If you do not
enter a filetype for the file, 510-86 assumes either a CMD or EXE
filetype, depending on which version you are using. 510-86 alters the
contents of the CS, OS, ES, and IP registers according to the
information in the header of the file loaded.
When the file is
completely loaded, 510-86 displays the start and end addresses of
each segment in the file. You can use the V command to redisplay
this information later. See the V Command in Section 11.4.18.
Form 2 loads the command file specified by filespec as described
above, and then loads a symbol file as specified in symfilespec. The
default fil!3tvp.e for a symbol file is SYM. SID-86 displays the message:
SYMBOLS
Programmer's Utilities Guide
11.4 510-86 Commands
when it begins loading the symbol file
If 510-86 detects an invalid
hexadecimal digit or an invalid symbol name, it displays an error
message and stops loading the symbol file.' You can use the H
command to display the symbols loaded when the error occurred to
determine the exact location of the error in the SYM file. 64K bytes of
memory is available for symbol table storage.
The PC DOS version of 510-86 loads symbols at the top of memory,
and adjusts the memory word size in the Program Segment Prefix
accordingly.
Form 3 does not load a program but simply loads the specified
symbols files. The form E releases all memory being used for symbol
table files.
When using the PC DOS version, forms 1 and 2 have an optional parameter When LlNK-86 creates an object file, by default it inserts
some prefix code at the beginning of the file to set up the
environment in which the program runs.
SID-86 automatically
executes this prefix code.
You cam use the - parameter to direct
SID-86 not to execute the prefix code. You can then proceed to the
point where the prefix code transfers control to the main program
using the following commands
G,102
T
When loading a program file with the E command, SID-86 releases any
blocks of memory allocated by any previous E or R command or by
programs executed under SID-86. Therefore, only one file at a time
can be loaded for execution and that file should be loaded bei.)re any
symbol tables are read. 00 not load any symbol files after program
executiQn begins.
S10-86 issues an error messsage if a file does not exist or cannot be
successfully loaded in the available memory
The symbol table file is produced by LINK-86 in the format:
11-7
11.4 SID-86 Commands
nnnn
symbol1
nnnn
Programmer's Utilities Guide
symbol2
where nnnn is a four digit hexadecimal number, and spaces, tabs,
carriage returns, and line-feeds serve as delimiters between
hexadecimal. values and symbol names. Symbol names can be up to
31 characters in length.
The following are examples of the E command (in the native mode):
#etest
Load file TEST.CMD
#etest.cmd test.sym
Load file TEST.CMD and symbol table file TEST.SYM
#etest test io
Load file TEST.CMD and symbol table files TEST.SYM
and IO.SYM
11.4.5 f (Fill) Command
The F command fills an area of memory read into S10-86 using an E
command, or R command with a byte or word constant.
The F
command has the following forms:
1. FS,f,b
2. FWs,f,w
where s is a starting address of the block to be filled and f is the
address of the final byte of the block. If no segment value is specified
by f, then the segment value of 5 is used by default. Similarly, if no
segment value is specified by 5, then the current display address is
used by default.
Form 1 stores the 8-bit value b in locations s through f.
Form 2
stores the 16-bit value w in locations 5 through f in standard form,
the low eight bits first followed by the high eight bits
If s is greater than f, or the value b is greater than 255, S10-86
responds with the message:
11-8
Programmer's Utilities Guide
11.4 S10-86 Commands
Bad command or parameter; press? for help
The fol/owing are examples of the F command:
#f1 00, 13f,0
Fill memory at the current d~ault display segment
from offsets lOOH through 13FH with O.
#f.array,+255,ff
Fill the 256-byte block starting at ARRAY with the
constant FFH.
11.4.6 G (Go) Command
The G command transfers control to the program being tested and
optionally sets one or two breakpoints.
The G command has the
following forms:
1. G
2. G,b1
3. G,b1,b2
4. Gs
5. GS,b1
6. GS,b1,b2
7. -G (with all of the above forms)
where s is an address where program executiorl is to start and b1 and
b2 are addresses of breakpoints. If you do not supply a segment
value for any of these three addresses, the segment value defaults to
the contents of the CS register.
For forms 1,2, and 3, no starting address is specified, so S10-86 gives
the address from the CS and IP registers. Form 1 transfers control to
your program without setting any breakpoints. Forms 2 and 3 set one
and two breakpoints respectively before passing control to your
program. Forms 4,5 and 6 are identical to 1,2 and 3, except the CS
and IP registers are first set to s.
If you precede any form of the G command with a minus sign, the
intermediate permanent breakpoints set by the P command are not
displayed
11-9
11.4 SID-86 Commands
Programmer's Utilities Guide
Once SID-86 transfers control to the program under test, it executes in
real time until a breakpoint is encountered.
At this point SID-86
regains control,. clears the breakpoints set by the G command, and
displays the address where the executing program is interrupted. This
is done using the format:
*ssss:OOOO
.symbol
where ssss corresponds to the CS register, 0000 corresponds to the IP
register where the break occurs, and .symbol is the symbol whose
value is equal to 0000, if such a symbol exists. When a breakpoint
returns control to SID-86, the instruction at the breakpoint address has
not yet been executed.
The following are examples of the G command
#g
Begin program execution at address given by the CS
and IP registers with no breakpoints set.
#g.start •. error
Begin program execution at label START in the code
segment. setting a breakpoint at label ERROR.
#g •. error. "
Continue program execution address given by the
CS and IP registers, with breakpoints at label ERROR
and at the address at the top of the stack.
#-g.341
Begin execution with a breakpoint at offset 34FH to
the current . segment value of CS, suppressing
intermediate pass point display.
11.4.7 H (Hexadecimal Math) Command
The H command provides several useful arithmetic functions.
command has the following forms:
1. Ha,b
2. Ha
3. H
4. H .symbol
11-10
The H
11.4 SID-86 Commands
Programmer's Utilities Guide
Form 1 form computes the sum (ssss), difference {dddd}, product
(PPPPPPpp), and quotient (qqqq) with the remainder (rrrr) of two 16-bit
values. The results are displayed in hexadecimal notation as follows:
+ SSSS
-
dddd
* pppppppp / qqqq (rrrr)
Underflow and overflow are ignored in addition and subtraction.
Form 2 displays the value of the expression a in hexadecimal, decimal,
and ASCII (if the value has a graphic ASCII equivalent) in the following
format:
hhhh
#ddddd
'c'
Form 3 displays the symbols currently loaded in the SID-86 symbol
table. Each symbol is displayed in the following form:
nnnn
symbolname
You can stop the display by pressing any key at the console (in the
native mode version) or Ctrl-Break (in the PC DOS version).
Form 4 allows you to display the address where the specified symbol
is defined in the symbol table.
If the symbol is found in the symbol table, SID-86 responds:
ssss:OOOO #dddd 'c' .symbol
where SS55:0000 is the address, #dddd is the decimal equivalent of
0000, and c is the ASCII value of #dddd. If the symbol is not found,
SID-86 displays the message:
Bad command or parameter; press? for help
The H command uses 16-bit arithmetic with no overflow handling,
except for the product in form '1 Jbove. Without overflow handling,
the value:
ffff + 2
equals 1.
The following are examples of the H command:
#h
List all symbols
command(s).
and
values
loaded
with
the
E
11-11
11.4 SID-:89 c;orrmands
Programmer's Utilities Guide
#[email protected]
Show the word contents of the memory location at
INDEX in hexadecimal and decimal.
#h5c28,80
Show sum, difference,
5C28H and 80H.
product,
and
quotient
of
11.4.8 I (Input Command Tail) Command
In the native-mode version, the I command prepares a File Control
Block (FCB) and command tail buffer in SI~-86's Base Page and copies
this information into the Base Page of the last file loaded with the E
command.
In the PC DOS version, the I command prepares a Program Segment
Prefix (PSP) and copies this information into the PSP of the last file
loaded with the E command.
The I command has the form:
I<command tail>
where <command tail> is a character string that usually contains
one or more filenames. The first filename is parsed into the default
FCB at DOSCH. The optional second filename is parsed into the second
part of the default FCB at 006CH. The characters in the command tail
are also copied into the default command buffer at 0080H.
The
command tail's length is stored at 0080H, followed by the character
string terminated with a binary zero.
If a file has been loaded with the E command. S10-86 copies the FCB
and command buffer from the Base Page (or PSP) to the Base Page (or
PSP) of the loaded program
The location of SI~-86's PSP can be
obtained from the 16-bit value at location 06
The location of the
Base Page (or PSP) of a program loaded with the E command is the
value displayed for OS on completion of the program load
Examples (PC DOS
#ifile1.exe
11-12
ver~ion)
Set up a File Control Block at 05CH for FILE 1.EXE
and put the string "file 1.exe" in the buffer at SOH (in
the PSP of the last file loaded with the E command).
Programmer's Utilities Guide
11.4 SID-86 Commands
#ia:file1 b:file2 c:file3 $px .
Set up FCB's at 5CH and 6CH for the files A:FllE1
and B:FILE2, and copy the string following the i into
the buffer at 80H.
11.4.9 L (List) Command
The L command lists the contents of memory read into SID-86 using
the R command, the E command, or the command line in assembly
language. The L command has the following forms:
1. L
2. Ls
3. LS,f
4. -L (with all of the above forms)
where s is the address where the list starts and f is the address
where the list finishes. If no segment value is given for f, then the
segment value specified by s is assumed and the value of f is used as
the offset within that segment.
Each disassembled instruction takes the form:
label:
ssss:OOOO prefixes opcode operands .symbol. = memory value
where label is the symbol whose value is equal to the offset 0000, if
such a symbol exists; prefixes are segment override, locI<, and repeat
prefixes; opcode is the mnemonic for the instruction; operands Is a
field containing 0, 1, or 2 operands, as required by the instruction; and
.symbol is the symbol whose value is equal to the numeric operand, if
there is one and such a symbol exists. If the instruction references a
memory location, the L command displays the contents of the location
in the memory value field as a byte, word, or double word, as
indicated by the instruction.
Form 1 lists 12 disassembled instructions from the current list address.
Form 2 sets the list address to s and then lists 12 instructions. Form
3 form lists disassembled code from s through 1. If you precede any
of the L command forms with a minus sign, no symbolic information is
displayed (the labels and symbol fields are omitted).
11-13
11.4 510-86 Commands
Programmer's Utilities Guide
This speeds up the listing if many symbols are present and you have
no need to display them.
In all forms, the list address is set to the next unlisted location in
When SID-86 regains
preparation for a subsequent L command.
control from a program being tested (see G, T, and U commands), the
list address is set to the current value of the CS and IP registers.
You can control display scrolling with Ctrl-S and Ctrl-Q. In native
mode, you can stop the list by typing any key; in PC DOS mode, type
Ctrl-Break.
The syntax of the assembly language statements produced by the L
command is described in Section 5.
If the memory location being disassembled is not a valid 8086/80286
Instruction, 510-86 displays:
n=
nn
where nn is the hexadecimal value of the contents of the memory
location.
The following are examples of the L command:
#1
Disassemble 12 instructions from the current default
list address.
#-1
Disassemble 12 instructions, without symbols, from
the current default list address.
#1243c,244e
Disassemble
244EH.
#l.find,+20
Disassemble 20H bytes from the label FIND.
#'.err+3
Disassemble 12 lines of code from the label ERR
plus 3.
#l.err,.err1
Disassemble from label err to label err1.
11-14
instructions
from
243CH
through
Programmer's Utilities Guide
11.4 S10-86 Commands
11.4.10 M (Move) Command
The M command copies a block of data values read into S10-86 using
an E command, R command, or command line from one area of
memory to another. The M command has the form:
Ms,f,d
where s is the starting address of the block to be moved; f is the
offset of the final byte within the segment; and d is the address of the
first byte of the area to receive the data. If you do not specify the
segment in d, the M command uses the same value used for s.
Therefore, the data found between the sand f is copied to a location
starting at d.
The following are examples of the M command:
# m20:2400,+9,30: 100
Move 10 bytes from 20:2400 to 30:100.
# m.array,+#63,.array2
Move 64 bytes from ARRAY to ARRAY2.
11.4.11
P (Permanent Breakpoint) Command
The P command sets, clears, and displays "permanent" breakpoints.
The P command has the following forms
1. Pa,n
2. Pa
3. -Pa
4. -P
5. P
A permanent breakpoint remains in effect until you explicitly remove it,
as opposed to breakpoints set with the G command that must be
reentered with each G command
Pass points have associated pass
counts ranging from 1 to OFFFFH. The pass count indicates how many
times the instruction at the pass point executes before the control
returns to the console
510-86 can set up to 30 permanent
breakpoints at a time.
11-15
11.4 510-86 Commands
Programmer's Utilities Guide
Forms 1 and 2 are used to set pass points. Form 1 sets a pass point
at address a with a pass count of n, where a is the address of the
pass point, and n is the pass count from 1 to OFFFFH. If a pass point
is already active at a, the pass count is changed to n.
510-86
responds with a question mark if there are already 16 active pass
paints.
Form 2 sets a pass point at a with a pass count of 1. If a pass point
is already active at a, the pass count is changed to 1. If there are
already 16 active pass points, 510-86 responds with the message:
Bad command or parameter; press? for help
Forms 3 and 4 are used to clear pass points. Form 3 clears the pass
point at location a. 510-86 responds with a question mark if there is
no pass point set at a. Form 4 clears all the pass points.
Form 5 displays all the active pass points using the form:
nnnn SS55:0000 .symbol
where nnnn is the current pass count for the pass point; ssss:OOOO is
the segment and offset of the pass point location, and .symbol is the
symbolic name of the offset of the pass paint, if such a symbol exists.
When a pass point is encountered, S10-86 displays the permanent
breakpoint information in the form:
nnnn PASS
ssss:OOOO .symbol
where nnnn, 55SS:0000, and .symbol are as previously described.
Next, 510-86 displays the CPU state before the instruction at the
permanent breakpoint is executed.
S10-86 then executes the
instruction at the permanent breakpoint. If the pass count is greater
than 1, 510-86 decrements the pass count and transfers control back
to the program under test.
When the pass count reaches 1, SID-86 displays the break address
(that of the next instruction to be executed) in the following form:
*ssss:OOOO
.symbol
Once the pass count reaches 1, it remains at 1 until tt1e permanent
breakpoint is cleared or the pass count is changed with another P
command.
11-]6
Programmer's Utilities Guide
11.4 S10-86 Commands
You can suppress the intermediate pass point display with the -G
command (see the G Command in Section 11.4.6).
When the -G
command is used, only the final pass points (when the pass count = 1)
are displayed.
You can use permanent breakpoints in conjunction with breakpoints
set with the G command.
Normally, S10-86 does not display the segment registers at pass
points. You can use the Sand -S commands to enable and disable
the segment register display (see the S Command in Section 11.4.14).
The following are examples of the P command:
#p
Display active permanent breakpoints.
#p.error
Set permanent breakpoint at label ERROR.
#p.print,17
Set permanent breakpoint at label PRINT with count
of 17H.
#-p
Clear all permanent breakpoints.
#-p.error
Clear permanent breakpoint at label ERROR.
11.4.12 QI, QO (Query I/O) Command
The 01 and 00 commands allow access to any of the 65,536
input/output ports. The 01 command reads data from a port; the 00
command writes data to a port.
The 01 command has two forms.
Qln
QIWn
where n is the l6-bit port number. The first form displays the 8-bit
value read from port n. The second form displays the 16-bit value
read from port n.
The QO command has two forms:
QOn,v
QOWn,V
11-17
11.4 510-86 Commands
Programmer's Utilities Guide
where n is the 16-bit port number, and v is the value to output. The
first form writes the 8-bit value v to port n. If v is greater than 255,
510-86 responds with a question. The second form writes the 16-bit
value v to the P9rt n.
Examples
#qiw20
Displays the 16-bit value of input port 20H.
#qi1024
Displays the 8-bit value of input port 1024.
#qow20,ff7e
Sets the 16-bit output port number 20H to OFF7EH.
qo#1025,2
Sets the 8-bit output port number 1025 to 2.
11.4.13 R (Read) Command
The R command reads a file into a contiguous block of memory.
form is:
The
Rfilespec
where filespec is the name of the file you want to read. When you
use the R command, S10-86 automatically determines the memory
location into which the file is read
When you enter the R command after a process is loaded with the E
command, or from the command line during the debugging process,
the process being debugged is stopped.
Similarly, entering an E
command erases the buffered information formed by the R command.
When you enter the R command, S10-86 reads the file into memory,
computes, allocates, and displays the start and end addresses of the
block of memory occupied by the file. You can use the V command to
redisplay this information at a later time. S10-86 sets the default
display pointer for subsequent 0 commands to the start of the block
occupied by the file.
The R command does not free any memory previously allocated by
another R command. Therefore, you can read a number of files into
memory without them overlapping
When the R command is used,
files are concatenated together in memory in the same order in which
they were read in.
11-18
Programmer's Utilities Guide
11.4 S10-86 Commands
S10-86 issues an error message if the file does not exist or there is
not enough memory to load the file.
The following are examples of the R command:
#rbanner.exe
Read file BANNER.EXE into memory.
#rtest
Read file TEST into memory.
11.4.14 S (Set) Command
The S command changes the contents of bytes or words of memory
read into S10-86 with the E command, R command, or command line.
The forms are as follows:
1. Ss
2. SWs
3. S
4. -S
where s is the address where the change occurs.
S10-86 displays the memory address and its current contents on the
following line. In response to form 1, the display is:
ssss:OOOO bb
where bb is the contents of memory in byte format.
form 2, the display is
In response to
ssssOOOO wwww
where wwww is the contents of
n~Gmory
in word format.
You can choose to alter ttie memory location or to leave it unchanged.
If you enter a valid expression, the contents of the byte (or word) in
memory is replaced with the value of the expression. If you do not
enter a value, the contents of memory are unaffected and the contents
of the next address are displayed. In either case, S10-86 continues to
display successive memory addresses and values until you enter a
period on a line bv Itself or until SID-86 detects an invalid expression.
11-19
11.4 SID-86 Commands
Programmer's Utilities Guide
With form 1, you can enter a string of ASCII characters, beginning with
a quotation mark and ending with a carriage return. The characters
between the quotation mark and the carriage return are placed in
memory starting at the address displayed. No case conversion takes
place.
The next address displayed is the address following the
character string ..
SID-86 issues an error message if the value stored in memory cannot
be read back successfully, indicating faulty or nonexistent memory at
the location indicated.
Forms 3 and 4 control the display of the segment registers when the
CPU state is displayed with the T (Trace) command and at pass points.
Form 3 turns on the segment register display and form 4 turns it oU.
You can turn off the segment register display while debugging to
allow the CPU state display to fit on one line.
The following are examples of the S command.
#s.array+3
Begin set at ARRAY (3)
nnnn:1234 55 0
Set byte to O.
nnnn: 1235 55 'abc'
Set three bytes to a, b, c.
nnnn: 1238 55 #75
Set byte to decimal 75.
nnnn: 1239 55 .
Terminate set command.
#s
Ena.ble segment
state display.
#-s
Disable segment register display in CPU
state display.
register
display
in
CPU
11.4.15 SR (Search for String) Command
The SR command searches for a string of characters of values within
memory. The SR command has two forms
SRs,f,"string"
SRs,f,valueLvalue]
11-20
11.4
Programmer's Utilities Guide
where s is the starting address
finishing address to end searching.
to
begin
S10-86 Commands
searching. and f
is the
Form 1 searches for a string of 1 to 30 printable ASCII characters.
The "string" parameter specifies the string to search for. Note that
string can use either single (') or double (") quotes.
Form 2 searches for a numerical hex value between 0 and FFH (one
byte) in size.
The value parameter must be a hexadecimal number
within the range specified above (leading O's do not need to be
specified).
To search for a multiple byte (up to 16 bytes) pattern,
separate each byte value with a comma.
80th forms of the SR command can search for the same things, since
a numerical value also equals an ASCII value.
The following are examples of the SR command
# SR56:00,56:1 tf,OD,OA
search memory starting at 56:00 and ending at
56:1FF for a two-byte value consisting of OOh
(Carriage Return) and OAh (line feed).
#SR56:1 ff,56:dOff,"ABCD"
search memory starting at 56: 1FF and ending
56 dOff for the character string: ABCO.
at
#SR56:iff,56:dOff,41,42,43,44
search memory starting at 56: 1FF and ending at
56 dOff for a four-byte value consisting of 41 (A), 42
(8), 43 (C), and 44 (D).
11.4.16 T (Trace) Command
The T command traces program execution for 1 to OFFFFH program
steps. After each trace, 510-86 displays the current state of the CPU
and the next disassembled instruction to be executed. You must read
programs into 510-86 with the E command or command line. The T
command has the following forms
11-21
11.4 510-86 Commands
Programmer's Utilities Guide
1. T
2. Tn
3. TW
4. TWn
5. -T (with all of the above forms)
where n is the number of
control to the console. If
steps, 510-86 executes a
pressing any key (in native
program steps to execute before returning
you do not specify the number of program
single program step.
To stop the trace.
mode), or Ctrl-Break (in PC DOS mode)
A program step is generally a single instruction. with the following
exceptions:
• If a system interrupt instruction (either a native-mode BOOS or PC
DOS mode DOS interrupt) is traced. the entire function is treated
as one program step and executed in real time. This is because
510-86 makes its own function calls and the parts of Concurrent
are not reentrant.
• If the traced instruction is a MOV or POP whose destination is a
segment register, the CPU
executes the next instruction
immediately. This is due to a feature of the microprocessor that
disables interrupts, including the Trace Interrupt, for one
instruction after a MOV or POP loads a segment register. This
allows a sequence such as
MOV SS, STACKSEGMENT
MOV SP, STACKOFFSET
to be executed with no chance of an interrupt occurring between
the two instructions, at which time the stack is undefined. Such a
sequence of MOV or POP instructions, plus one instruction after
the sequence is considered one program step .
• If you use forms 3 or 4 and the traced instruction is a CALL.
CALLF, or INT, the entire called subroutine or interrupt handler
(and any subroutines called therein) is treated as one program
step and executes in real time.
11-22
Programmer's Utilities Guide
1 1.4 SIU-Clb commanas
After each program step is executed, SID-86 displays the current CPU
state, the next disassembled instruction to be executed, the symbo.ic
name of the instruction operand (if any), and the contents of the
memory location(s) referenced by the instruction (if appropriate). See
the X Command in Section 11.4.20 for a detailed description of the
CPU state display.
If a symbol has a value equal to the instruction pointer (IP), the symbol
name followed by a colon is displayed on the line preceding the CPU
state display. The segment registers are normally not displayed with
the T command, which allows the entire CPU state to .be displayed on
one line.
Use the S command, as described in Section 11.4.14, to
enable the segment register display.
With the segment register
display enabled, the display of the CPU state is identical to that of the
X command.
In all of the forms, control transfers to the program under test at the
address indicated by the CS and IP registers. If you do not specify the
number of program steps, as In form 1, one program step is executed.
Otherwise, S10-86 executes n program steps and displays the CPU
state before each step, as in form 2. You can stop a long trace before
n steps are executed by typing any character (in native mode) or CtrlBreak (in PC DOS mode)
After n steps are executed. S10-86 displays the address of the next
instruction to be executed. along with the symbolic value of the IP
register (if there is such a symbol) in the following form
*ssssOOOO
.symbol
Forms 3 and 4 trace execution without breaking for calls to
subroutines.
The entire subroutine called from the program being
traced is treated as a single program step and executed in real time.
This allows tracing at a high level of the program, ignoring subroutines
already debugged
If you precede the command with a minus sign, S10-86 omits symbolic
labels and symbolic operands from the CPU state display. This can
speed up the display by skipping the symbol table lookup when large
symbol tables are loaded.
When a single instruction is being traced, interrupts are disabled for
the duration of the instruction
11-23
11.4 SID-86 Commands
Programmer's Utilities Guide
This prevents SIO-86 from tracing through interrupt handlers when
debugging on systems in which interrupts occur frequently.
Atter a T command, S10-86 sets the list address used in the L
command at the address of the next instruction to be executed.
SID-86 also sets the default segment values to the CS and OS register
values.
The following are examples of the T command:
#t
Trace one program step.
#tffff
Trace 65535 steps.
#-t#500
Trace 500
disabled.
program
steps
with
symbolic
lookup
11.4.17 U Command
The U command, like the T command, is used to trace program
execution.
The U command functions in the same way as the T
command, except that the CPU state is displayed after the last set of
program steps have executed, rather than after every step.
The U command works only with programs loaded by the E command
or from the command line. The U command has the following forms:
1. U
2. Un
3. UW
4. UWn
5. -U (with all of the above forms)
where n is the number of instructions to execute before returning
control to the console. You can stop the U command before n steps
are executed by pressing any key (in native mode) or CUi-Break (in PC
DOS mode).
Forms 3 and 4 trace execution without calls to subroutines. The entire
subroutine called from the program being traced IS treated as a single
program step and executed in real time. This allows tracing at a high
level of the program, ignoring subroutines already debugged
11-24
Programmer's Utilities Guide
11.4 S10-86 Commands
Preceding any of the U command forms with a minus sign causes
This allows
the program to execute faster
S10-86 not to print any symbolic reference information.
The following are examples of the U command:
#u200
Trace without display 200H steps. ?r #-u200
Trace without display 200H steps, suppressing the
intermediate pass point display.
11.4.18 V (Value) Command
The V command displays information about the last file loaded with
the E or R commands, excluding symbol tables loaded with the E
command. The form is:
V
If you load the last file with the R command (or the E command in PC
DOS mode), the V command displays the start and end addresses of
the file. In native mode, if you read the last file with the E command,
the V command displays the start and length in bytes for the coc;le,
data, and heap segments.
If an R or E command have not have been used, S10-86 responds to
the V command with the message:
Bad command or parameter; press? for help
11.4.19 W (Write) Command
The W command writes the contents of a contiguous block of memory
to disk. This command requires you ·0 first use the R command to
read the data into S10-86 The W command has two forms:
Wfilespec
Wfilespec,s,f
where filespec is an optional path name and the name of the file you
want to receive the data. The sand f arguments are the first and last
addresses of the block to be written.
If you do not specify the
segment in f, S10-86 uses the same value used fo'r s.
11-25
11.4 SID-86 Commands
Programmer's Utilities Guide
When you use form 1, SID-86 assumes the first and last addresses
from the files read with an R command. This causes all of the files
read with the R command to be written. If no file is read with an R
command, SID-86 responds with the message:
Bad command or parameter; press? for help
Use form 1 for writing out files after patches are installed, assuming
the overall length of the file is unChanged.
Form 2 allows you to write the contents of a specific memory block.
The first address of the memory block is specified by s and the last
address of the memory block is specified by f.
If a file with the name specified in the W command already exists,
SID-86 deletes it before writing a new file.
The following are examples of the W command:
Hwtest.cmd
Write to the file TEST.CMD the contents of the
memory block read into by the most recent R
command.
Hwb:test.exe,40:0,3fff
Write the contents of the memory block 40:0
through 40:3FFF to the file TEST.EXE on drive B.
11.4.20 X (Examine CPU State) Command
The X command allows you to examine and alter the CPU state of the
program under test. The X command has the following forms:
1.X
2. Xr
3. Xf
where r is the name of one of the CPU registers and f is the
abbreviation of one of the CPU flags. The X form displays the CPU
state in the following format:
11-26
11.4 S10-86 Commands
Programmer's Utilities Guide
AX BX CX
---------xxxx xxxx xxxx
instruction
symbol name
SS
ES IP
xxxx xxxx xxxx
memory value
The nine hyphens at the beginning of the line indicate the state of the
nine CPU flags. Each position can be either a hyphen, indicating that
the corresponding flag is not set (0), or a single-character abbreviation
of the flag name, indicating that the flag is set (1). The abbreviations
of the flag names are shown in Table 11-2.
Table 11-1.
Flag Name Abbreviations
Character
Name
0
Overflow
Direction
Interrupt Enable
Trap
Sign
Zero
Auxiliary Carry
Parity
Carry
0
I
T
S
Z
A
P
C
instruction is the disassembled instruction at the next location to be
executed, which is indicated by the CS and IP registers. If the symbol
table contains a symbol whose value is equal to one of the operands
in instruction, the symbol name appears in the symbol name field,
p rece d ed by a period. If ins tru ct ion ref e re n ce s memory, th e co nte nt s
of the referen ced locati on(s) a p pear in the memory value field,
preceded by an equal sign. Either a byte, word, or double word value
is shown, depending on the instruction
In addition to displaying the
machine state, form 1 changes the values of the default segments
back to the CS and OS register values, and the default offset for the L
command to the IP register value.
11-27
11.4 S10-86 Commands
Programmer's Utilities Guide
Form 2 allows you to alter the registers in the CPU state of the
program being tested. The r following the X is the name of one of the
16-bit CPU registers. SID-86 responds by displaying the name of the
register followed by its current value. If you type a carriage return,
the value of the register does not change.
If you type a valid
expression, the contents of the register change to the value of the
expression. In either case, the next register is then displayed. This
process continues until you enter a period or an invalid expression, or
the last register is displayed.
Form 3 allows you to alter one of the flags in the CPU state of the
program being tested. SID-86 responds by displaying the name of the
flag followed by its current state. If you type a carriage return, the
state of the flag does not change. If you type a valid value, the state
of the flag . .changes to that value. You can examine or alter only one
flag with each Xf command. You set or reset flags by entering a value
of 1 or O.
The following are examples of the X command.
#xbp
BP=1000 2b64
SI=2000 #12345
CS=Q040 .
Change registers starting with BP.
Change BP to hex 2B64.
Change SI to decimal 12345.
Terminate X command.
11.4.21 Z (Print 8087/80287 Registers) Command
The Z command prints out the contents of 8087 and 80287 registers.
The form is:
z
The output generated by the Z command looks like the following:
11-28
Programmer's Utilities Guide
CW
037F
SW
4100
EECO
EECO
EECO
EECO
EECO
EECO
EECO
EECO
0
1
2
3
4
5
6
7
TW
FFFF
A6B6
A6B6
A6A6
A6B6
A6B6
A6B6
A6B6
A6B6
11.4 SID-86 Commands
IP
FFEF
B596
B55E
B5D6
B55E
B55E
B55E
B55E
B55E
OP
07FF
EBSA
EBSB
EBSA
EBSB
EBSB
EBSB
EBSB
EBSB
FFFF
0000
BAD5
BAD5
BAD5
BAD5
BAD5
BAD5
BAD5
BAD5
Where:
CW = Control Word Format
SW = Status Word Format (indicates physical register 0)
TW = Tag Word
IP = 8087 or 80287 Instruction Pointer
OP = Pointer for last operand fetched
An error message appears if no 8087 or 80287 processor is present
when the Z command is given.
11.4.22
? (List Commands) Command
The? command prints a list of available SID-86 commands, similar to
the list appearing in Table 1-1. The form is
?
11.4.23
?? (List Commands Format) Command
The ?? command prints a detailed command list that includes the
SIO-86 commands, and the available command options. The form is:
??
11-29
11.4 $10-86 Commands
Programmer's Utilities Guide
11.4.24 : (Define Macro) command
The: command defines or redefines a macro.
The form is:
:name
where name is the name of the macro.
message:
S10-86 responds with the
"Enter commands one to a line;
terminate with an empty line"
Enter the commands you want to execute immediately following the
message.
For example, if you wish to create a macro named "s" that, when
invoked, prints out the contents of the stack, you would define the
macro as follows:
#:5
dw ss:sp <cr>
<cr>
11.4.25
= (Use Macro) Command
The = command causes $10-86 to use a previously defined macro.
The forms are:
= name
The first form prints out the list of existing S10-86 macros and their
definitions (values).
The .second form executes the command associated with name
For example, to invoke the "s" macro defined in the example for the
command, enter:
#=5
and 'the contents of the stack will print.
11-30
Programmer's Utilities Guide
Table 11-2.
Command
A
B
o
E
F
G
H
I
L
M
P
Q
R
S
SR
T
U
V
W
X
Z
?
?7
11.4 S10-:86 Commands
S10-86 Command Summary
Action
enter assembly language statements
compare blocks of memory
display memory in hexadecimal and ASCII
load program and symbols for execution
fill memory block with a constant
begin execution with optional breakpoints
hexadecimal arithmetic
set up program arguments
list memory using 8086 mnemonics
move memory block
set, clear, display pass points
direct I/O request
read disk file into memory
set memory to new values
search for string within memory
trace program execution
untraced program monitoring.
show memory layout of disk file read
write contents of memory block to disk
examine and modify CPU state
dump 80287 register.
print list of SID commands
print list of SID commands with options
use a previously defined macro
define a macro
Erld of Section 11
11-31
SECTION 12
Default Segment values
12.1
Introduction
S10-86 has an internal mechanism that keeps track of the current
segment value, making segment specification optional when entering a
S10-86 command. S10-86 divides the command set into two types
according to which segment a command defaults if you do not specify
a segment value in the command line.
12.2 Type-1 Segment Value
The A (Assemble), L (List Mnemonics), P (Pass Points), and R (Read)
commands use the internal type-l segment value if you do not specify
a segment value in the command.
When started, S10-86 sets the type-l segment value to 0 and changes
it when one of the following actions is taken:
• When an E command loads a file, S10-86 sets the type-1 segment
value to the value of the CS:IP register.
• When an R command reads a file, S10-86 sets the type-l segment
value to the base segment where the file was read.
• When an X command changes the value of the CS:IP register,
S10-86 changes the type-l segment value to the new value of the
CS:IP register.
• When S10-86 regains control from a user program after a G, T, or
U command, it sets the type-l segment value to the value of the
CS:IP register.
• When an A or L command explicitly specifies a segment value,
S10-86 sets the type-l segment value to the segment value
specified.
12-1
12.3 Type-2 Segment Value
Programmer's Utilities Guide
12.3 Type-2 Segment Value
The 0 (Display), F (Fill), M (Move), S (Set), (and SR (Search) in native
mode) commands use the internal type-2 segment value if you do not
specify a segment value in the command.
When invoked, SID-86 sets the type-2 segment value
changes it when one of the following actions is taken:
to
a
and
• When an E command loads a file, SID-86 sets the type-2 segment
value to the value of the OS register.
• When an R command reads a file, S10-86 sets the type-2 segment
value to the base segment where the file was read.
• When a 0, F, M, S or SR command explicitly specifies a segment
value, SID-86 sets the type-2 segment value to the segment
value specified.
When evaluating programs with identical values in the CS and OS
registers, all SID-86 commands default to the same segment value
unless €.<plicitly overridden.
Table 13-1 summarizes the S10-86 default segment values.
12-2
Programmer's Utilities Guide
Table 12- 1.
Command
A
B
o
E
F
G
H
I
L
M
P
Q
R
S
SR
T
U
V
W
X
Y
Z
12.3 Type-2 Segment Value
SID-86 Default Segment Values
Default Segment Value
Current CS:IP of debugged process
Current display address
Current display address
No default values assumed
Current display address
Current CS:IP of debugged process
No default values assumed
No default values assumed
Current list address
Current display address
Current CS:IP of debugged process
No default values assumed
Default is beginning address of the file
Current display address
Current display address in native mode;
no default value assumed for PC ~OS. mode
Current CSIP of debugged process
Current CS.IP of debugged process
No default values assumed
Default is beginning address of the file
No default values assumed
No default values assumed
No default values assumed
No default values assumed
No default values assumed
End of Section 12
12-3
SECTION 13
Assembly Language Syntax
for A and L Commands
13.1
Assembly Language Exceptions
In general, the S10-86 A and L commands use standard 8086/80286
assembly language syntax. Several minor exceptions are listed below .
• Up to three prefixes (LOCK, repeat segment override) can appear
in one statement, but they all must precede the opcode of the
statement. Alternately, a prefix can appear on a line by itself .
• The distinction between byte and word string instructions is as
follows:
Byte
Word
LODSB
STOSB
SCASB
MOVSB
CMPSB
LODSW
STOSW
SCASW
MOVSW
CMPSW
• The mnemonics fo r near and far control transfer instructions are
as follows
Short
Normal
Far
JMPS
JMP
CALL
RET
JMPF
CALLF
RETF
13-1
13.1 Assembly Language Exceptions
Programmer's Utilities Guide
• If the operand of a CALLF or JMPF instruction is an absolute
address, you enter it in the form:
SS5S:0000
where
ssss is the segment and 0000 is the offset of the address .
• Operands that can refer to either a byte or word are ambiguous
and must be preceded either by the prefix "BYTE" or "WORD".
These prefixes can be abbreviated to "BY" and "WO".
For
example:
INC
BYTE [BP]
NOT
WORD [1234]
Failure to supply a necessary prefix results in an error message .
• Operands addressing memory directly are enclosed in square
brackets to distinguish them from immediate values. For example
ADD AX,5
;add 5 to register AX
ADO AX,[5] ;add contents of location 5 to AX
• The forms of register indirect memory operands are:
[pointer register]
[index register]
[pointer register + index register)
where the pointer registers are BX and BP, and the index registers
are SI and 01. Any of these forms can be preceded by a numeric
offset. For example:
ADO BX, [BP+Sr]
ADO BX,3[BP+Sr]
ADD BX,lD47[BP+Sr]
End of Section 13
13-2
SECTION 14
5/0-86 Sample Session
14.1
Introduction
The
following
sample
session
Illustrates
the
commands
procedures used to Interactively debug a simple program.
Begin the session by entering the following source file, TYP.A86.
assemble and link the sample file to create an executable file.
(j
i sD
1
fCb
eco
f
b(~
0 5
ay
t h
;:~
eo'~;
~'
cor-so'e
rJ
cal
<J C
CfT',p
a I • eo f
done
conout
j
get 1 :
~ne
r"t)ov
Z
cal
get c h r:
;.-:1,
;a"'-'
en u
done:
f-;:-.:::
.~),::::
274
eeu
C onOLi t c
lOOP:
,-l"
Then
AC!u
C P(>,'1 C
start;
r, t s
con'.: e
and
!
'.: C
jmps
lOOp
~'I
r
mov
dl.D
mov
cl.D
jmp
bdos
cmp
jc
bptr.Dsize
getl
ca I !
fi lbu;:
: rese t
:see
if
refi11
fL)f"',C'.:;
~e
on
need a
8uf~er
new buf;er full
from
f;~e
mov
mov
inc
bpt
r
;get ~e(t
; i~cre~e~t
from buffer
poin:e r
=ha~acter
buffer
ret
14-1
14,1 Introduction
Programmer's Utilities Guide
f; I buf : mov
ca I I
mov
ca I I
mov
ret
dX,offset
setdma
d',5ch
read
bPtr,O
open:
cl,openc
bdOs
al,Offh
setdma:
read:
conOut:
printm:
bdos:
mov
ca I I
cmp
jnz
ret
buffer
err
mov
CI •
jrnps
bdOS
mov
ca I I
cmp
jnz
ret
cl . reaClc
se~dmd:::
b80S
a 1 • CJ
err
mov
jmps
beDs
mov
jmps
bdOS
;nt
baosi
cl.conout-:
c 1,9
ret
err:
errOrm
bs;ze
buffer
bpU
mov
ca 1 I
jmp
dX,offset errorrr·
printm
done
dseg
org
IOOh
db
equ
rs
db
SOh
bsize
bs;ze
end
14-2
'ERROR' .Odh,Oah. '$'
14.1 Introduction
Programmer's Utilities GUide
Type symbol table file produced by RASM-86.
A> type typ.sym
0000 VARIABL.ES
0188 BPTR
01G8
0000 NUMBERS
ODED Boosr
OOOF OPENC
0080 8 SIZE
0814 '<EADe
J002 CO,'WUTC
OOIA S~TDMAC
OOIA EOF
005C FCB
0059 CC),~O,~.)T
00:9 GE-'-CMR
0048 5E-'-0\1t,
COl2 C:ONE
:::006 LOOP
::000 STAR'
0064 ERR
0041 OPEN
002F FIL8UF
0050 PRINTM
0000
0061
0023
004F
LABELS
BOOS
GETI
READ
3!.JF;::::
~
JIOO
EPQOR\,1
Try executing the program with the file TYP.A86 as data.
A>typ typ.a86
ERROR
The program doesn't '!v'ork correctly. so load the executable program
and symbol table file to find out why
A>sid86 typ.cmd typ.sym
SID-86 shows ttl8 start and end addresses of each segment from the
fil e
START
[,',,0
CS 06DA:0000 OGoA:OOGC
OS 06EI :0000 06~' :0'5"
SYM80LS
Display all the symbols that SID-86 loaded
#h
0000 VAP 1"BlES
0188 BPTR
0108 BUl=F[h'
0100 ERROR!.:
0000 NUMBERS
OOE·J 800S1
0088 BS!ZE
0002 CONOU"'C
OOIA EOF
005C FCB
OOOF OPU,C
14-3
14.1 Introduction
0014
001A
0000
0061
0059
0012
0064
002F
0023
0019
0006
0041
005D
004F
0048
0000
Programmer's Utilities Guide
REAOC
SETOMAC
LABELS
BOOS
CONOUT
DONE
ERR
FILBUF
GETI
GETCHR
LOOP
OPEN
PRINTM
READ
SETDMA
START
Disassemble the beginning of the code segment.
#1
START:
060A:0000
060A:0003
LOOP:
060A:0006
060A:0009
060A:0008
060A:0000
0604:0010
DONE:
060A:0012
060A:0014
060A:0016
GETCI-<R:
060A:0019
06DA:00IE
MOV
CAll
ox.oose .FC8
004' .0 P E~-I
CALL
CMP
JZ
CALL
JMPS
0019
Al . 'A
0012
0059
0006
MOV
MOV
JMP
Ol.OO
.1
CL,GO
. 'J t. M.'
CMP
...:8
006'
.GETCHR
.EO"
.OONE
.CONOU T
.'.....OOP
AP ! '" B ~ E S
I A BLE S
.9005
ByTE lJ1Ba;,BC
0023 .GE71
.B"~'<
Set up the default file control block at 5CH with the name of the file
to proce-ss:
#ityp.a86
Trace the first two instructions of the program.
#t2
DX
AX
ax
ex
--------- 0000 0000 0000 COCO
--------- 0000 0000 0080 D05e
14-4
: D
S:
D~
SP
S"
092C OO:JC eCeJ 0000 0000
092C 00:]0 C'J': 8 OGOO 0003
tlO\,1
~A
__
ox.OOSC .FC8
·::;04 : . OPE:,
14.1 Introduction
Programmer's Utilities Guide
*060A: 0041
. OPEN
SID-86 stops execution after two instructions, at the label OPEN.
Display the contents of the default feb, to make sure it's set up right.
"d.fcb.+ .. 35
06E 1 : 005C 00 54 59 50 20 20 20 20 20 41 38 36 00 00 00 00
06E 1: 006C 00 20 20 20 20 20 20 20 20 21.1 20 20 00 00 00 00
06E 1: 007C 00 00 00 00
The fcb looks ok.
# 1
OPEN:
060A:0041
060A:0043
060A:0046
060A:0048
060A:004A
SETDMA:
060A:004B
060A:0040
READ:
060A:004F
06DA:0051
060A:0054
060A:0056
060A:0058
.TVP
A86 ....
Disassemble the next few instructions.
MOV
CALL
CMP
JNZ
RET
CL.OF .OPENC
0061 .BOOS
AL.FF
0064 .~PR
MOV
JMPS
C L . : A . E'JF
0061 .BOCS
MOV
CALL
CMP
JNZ
RET
CL. 14 .RE"'CC
0061 .BOCS
AL.OO .Vo.R;AB~ES
0064 .ER=<
Continue program execution with a break point after the open function.
"9. 46
*4800:0046
Display tile CPU registers
AX
8X
ex
0000 COCO 09JO
CMP
SP
8P
51
Dr
CS
os
SS
E5.
IP
005'" 0000 0000 0000 4BOO 4BE4 38iA 48E4 0046
AL,FF
Registers look ok; trace a few more irlstructions.
"t2
AX
8X
s~
CX
OX
0000 COCO DOJO =CJ::;O C05,.j,
--1---0.-[ 0000 COCO GOOO ,r-r'"'r'I
Uuvu C05'"
*4800 rJ064
ERR
--1------
8;'>
'..J
\...J ,-,'~
coeD
SI
0:
: P
0000 CCJJO 0046 CMP
ooee CJOOO 0048 JNZ
AL.FF
0064 .ERR
14-5
Programmer's Utilities Guide
14.1 Introduction
The code shouldn't be getting to the ERR label - the jump instruction
seems to be of the wrong flavor.
It should be a JZ. Rather than
editing the source, just install a patch, which is easy because the new
instruction is the same length as the old one.
Read the file into
memory (including the header).
#rtyp.cmd
START
END
4C1B:0000 4C1B:02FF
The file' was read into memory starting at paragraph 4C 1B.
where the header is - the code starts 8 paragraphs later.
That is
#xcs
CS 4BOO 4clb+8
OS 4BE4 cs
SS 381A
The code starts in paragraph 4C23. Using that as the base for the L
command, all the symbol values will be correct.
#10
START
4C23:0000
4C23:0003
LOOP:
4C23:0006
4C23:0009
4C23:0008
4C23:0000
4C23:0010
DONE:
4C23:0012
4C23:0014
4C23:0016
GETCHR:
4C23:0019
4C23:001E
MOV
CALL
OX,005C .FeB
0041 . OPE,'"
CALL
CMP
JZ
CALL
JMPS
0019 .GETCHR
AL, 1 A .EOF
0012 .DONE
0059 .CONour
0006 .LOOP
MOV
MOV
JMP
OL,OO .VAR[ABLES
CL,OO .VARIABLES
0061 .BOOS
CMP
J8
BYTE [018BJ.60
0023 .GET1
Disassemble the OPEN routine.
#141
OPEN:
4C23:0041
4C23:0043
4C23:0046
4C23:0048
14-6
MOV
CALL
CMP
JNZ
CL,OF .OPENC
0061 . SDOS
AL,FF
0064 .ERR
.3;:>~R
Programmer's Utilities Guide
14.1 Introduction
4C23:004A RET
Assemble patch instruction .
.o'a48
4[23:0048 jz 0064
4C23:004A
Write the patched file back to disk. The start and end addresses need
not be included in the W command, since the overall length of the file
did not change
#wtyp.cmd
Reload the patched file and symbols.
command doesn't set up registers .
This is needed since the R
.o'etyp.cmd typ.sym
START
END
CS 4BOO:0000 4BOO:006F
OS 4BE4:0000 4BE4:018F
SYMBOLS
#ityp.a86
Execute the program with a break point at DONE ..
.0'9 .. done
ERROR
*4BDO:0012
.OONE
.o'Ac
Still not correct. Invoke SID-86 again, leaving off the file types, since
SID-86 uses the appropriate defaults
A>sid86 typ typ
START
END
CS 4BOO:0000 4BOO:006F
OS 4BE4:0000 4BE4:018F
SYMBOLS
Set up default file control block .
.o'ityp.a86
Disa ssemble start of code seg ment.
14-7
14.1 Introduction
#1
START
4BOO:0000
4BOO:0003
LOOP:
4BOO:0006
4800:0009
4800:0008
4800:0000
4800:0010
DONE:
4800:0012
4800:0014
4800:0016
GETCHR:
4800:0019
4BOO:00IE
Programmer's Utilities Guide
MOV
CALL
OX.005C .FCB
0041 .ODEN
CALL
CMP
JZ
CALL
JMPS
0019 .GETCHR
AL, 1A .EOF
0012 .DONE
0059 .CONOUT
0006 .LOOP
MOV
MOV
JMP
DL.OO .VARIABLES
CL.OO .VARIABLES
0061 .BJOS
CMP
JB
BYTE [0188].80 .BPTR
0023 .G"Tl
Trace without call, so $10-86 doesn't trace the OPEN routine, which
should be fixed.
#tw2
IP
AX
01
BX
JX
SP
8D
51
CX
0000 0000 0000 0000 005C acc,] 0000 oeoo 0000 MOV
--1------ 0000 0000 0000 005C 005C ooe :J JOOO 0000 0003 CALL
*4BOO:0006 .lOOP
--r------
DX.005C .FCB
0041 . OPEN
Disassemble next few instructions.
#1
LOOP:
4800:0006
4800:0009
4800:000B
4800:0000
4BOO:0010
DONE:
4800:0012
4BOO:0014
4800:0016
GETCHR:
4BOO:0019
4BOD:Q01E
4800:0020
GET 1 :
480D:0023
CALL
CMP
JZ
CALL
JMPS
0019 .GETCHR
AL. 1 A .EOF
0012 .OONE
0059 .CONOU:
0006 .LOOP
MOV
MOV
JMP
DL.OO ,VARIABLES
CL,OO .VARIABLES
006 1 .BDOS
CMP
JB
CAll
BYTE [0188],80 .8°-:-Q
0023 .GETI
002F .F1LBuF
MOV
BX,OIOB
.BUFFER
Tra,ce without call next three instructions, to see if this sequence is
working.
14-8
14.1 Introduction
Programmer's Utilities Guide
#tw3
OX
AX
6X
CX
SP
6P
SI
01
I P.
--I---A-C 0000 0000 0000 0000 005C 0000 0000 0000 0006 CALL
--1------ 00 EO 0108 0000 0000 005C 0000 0000 0000 0009 CMP
--I-S-A-C 0000 0108 0000 0000 005C 0000 0000 0000 0009 JZ
*4600:0000
0019 .GETCHR
AL.IA . EOF
0012 .DONE
GETCHR is returning a OOOH - something must be wrong there.
the E command to bring in a fresh copy of the program.
Use
#etyp typ
START
ENO
CS 4600:0000 46DO:006F
OS 48E4:0000 48E4:01SF
SYM60LS
Disassemble code segment.
#1
START
4600:0000
4600:0003
LOOP:
4600:0006
4600:0009
4800:0006
4600:0000
4600:0010
DONE:
4800:0012
4800:0014
4BOO:0016
GET(HR:
4600:0019
4BOO:00IE
MOV
CALL
OX.005C .FC8
0041 .OPEN
CALL
CMP
JZ
CALL
JMPS
0019 .GETCHR
AL . I A .EOF
0012 .00Ne:
0059 .CONOUT
0006 . '_OOP
MOv
MOV
JMP
OL.OO .VAR:A6LES
(L,OO .VARIA3'.ES
0061 .BOOS
(MP
JB
BYTE
0023
[01881.30
.GE-:-I
.B"TR
Disassemble GETCHR routine
#1
GETCHR:
4800:0019
4BOO:00IE
4BOO:0020
GET I:
4BOO:0023
4800:0026
4BOO:002A
480D:002E
.Bp-cR
CMP
JB
CALL
BYTE [018S].80
0023 .GETI
002 F .FIL8uF
MOV
MOV
INC
RET
8X.OIOS .BUFFEF<
AL,0108[8:<1 .BUFFER
BYTE [018S) .BPTR
14-9
14.1 Introduction
FILBUF:
4BDO:002F
4BOO: 0032
4BOO:0035
4BOO:0038
4BOO:003B
MOV
CALL
MOV
CALL
MOV
Programmer'S Utilities Guide
OX.Ol08 .8UFcEQ
004B .SETOMA
OX.OOSC .FCB
004F . READ
BVTE [0188].00 .BP-'
Trace first few instructions.
Note that
BPTR as is it being compared.
S10-86 shows the contents of
#t2
: p
AI<
BP
81<
cx elX
SP
s:
Dr
--j---4-C 0000 0000 0000 0000 OC5A 0000 0000 :JODO 0019
--:--z-p- 0000 0000 0000 0000 005A 0000 0000 ooco 801:;
·4BOO:0)020
(:~o
gv-=:
:~1e5
.JS
J023
. '~c-:-I
The compare worked ok; keep going.
#t
~ p
AX
9P
BX
cx ox
SP
s:
Dr
--l--Z-P- 0000 0000 0000 0000 oe5A 0000 JDCCl ':000 002') CALL.
·4800:002F .FIL8uF
See what FILBUF looks like.
.1
FIL8uF:
4800:002F
4800:0032
4BOO:0035
4600:0038
MOV
CALL
MOV
CALL
4~00:0038 MOV
4800:0040 RET
OPEN:
4800:0041 MOV
4BOO:0043 CALL
4800:0046 CMP
4BOO:0048 JZ
4800:0044 RET
SE-i)MA:
4BOO:0048 MOv
OX.0108 .6UFFE~
0048 .SETDMA
OX.OOSC .FCB
004F .READ
BVTE [01881.CO .BP-"
CL.OF .OPE~C
0061 .BOOS
AL.F~
0064 .EQq
C~.
: A .::OF
See what's in the buffer before the disk read takes place
IO.oufFe"
4BE4:0t08
4BE4:0t'd
4BE4:0t28
4BE4:0t38
14-10
00
00
00
00
00
'JO
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
GC
00
00
OC
0
0
0
0'
a
0
0
)0
;;C
0
a
JC
--
0
.3':
.BD~P
==C
Programmer's Utilities Guide
48E~
4eE~
14.1 Introduction
:1~2 DC u~
015E JO JO
V~
:0 DC CC
CO co 0: :C
DC :C
uu
~n
J::'
'v
U ' ...
..i"--
V'-
u~
VI..
DC
J(
~
BE':: .:'
aBE.:.
eE
2192
w
aD DC
cc c.::,
JO
CC GO C::
OC GO 00 OJ
OC :C DC GO CO CO
u~
Uw
co
~r
~r
CC
""w
:c
JCCCCOCOC:
~u
OC
00
00
O·J
:C 0: 0: co co c:
~c
~~
~r
CC CS CC 0: 00 CO n~
OC DC 0: DC CC CO 03
uV
Trace the FILBUF routine
1ft .... .:
--:--:-D-
JOO:
~G~_
coce
--:--=-~-
~~"~
=c~:
CCJ~
s:
02C: J258 JCJC
C1C2 ~:55 GOGe
C' J 0
01
WL~~
cc:c
GCGO OC2F
WVUV
0032
M~\'
DX,OIOS
CA~L
0048
-----:-;;C C 3 5 ~I.::.'
-----2-p- JOOJ ~r~~ Deco 0:5: ::53 C:OC Uvuv nr~- De38 :~_~
-----Z-D- JODO OC:2 ocee ecoc J253 CJOC eoce JOOO 0038 MJV
-----2-p- J8JC ~~~~ CDoe OCC: J:56 ceoc JCJJ 20:C OSAC R~-
8:J~=ER
.SETDM<
OX.CC5C
,Fee
DOAF
. REt.:J
BVTE
:01881,00
See what'S In the bufter after the read
JgE~
~lJ~
J9E-=-
: ~
'=
J5E~
~~~=
S~
~~[~
:'32
?C
=,
c-
~ ~
~::
35
,~
v~
52
65
Zr:,
bE)
6;::
c:J
~-
~~
5~
~~
~~
~~,
~~
,~6C
EC
~
SF
j~
3(
6:'
6:'
7S
73
e'
6~
"12
72
65
35 36 00 0' 35 20 ;0 20 20
~_
E~
79 ~~
Sf 2=
6'
6S E5 20
E' 6E :C ~,
,.... • _ i z. E 8 >; 5
:.-'/... ~c 63 9:' C9
6~
"C
ES 7" 75
7~
,,~
Looks like gooe! cJata In the butfer
OC
CC
C'J
\.-1.,.
......"
:0
.RAS~-86
ole
~~
for
DOS BE.
63
aisplay t~e :
53 o~te~ts of a~ AS
2 J C I: f; 1 eat the
65 ':onsc!e .... fctl.e
23 c~.5cn. e':i~.ecu.
u ...
See whats next
.:
.~
=:.: . 'J c: 2 ;.
";:3:.:
0:2;:
sa~
::ol""lcwr-re
: "I'C
v:.
14-1 1
,BPT~
=1
14.1 Introduction
4800,0036 CAL'4800,0038 MOV
rag rammer's Utilities Guide
.'<EAO
004F
BVTE 18188 1 ,0:
.9~'"
OPEN,
4600,0041 MOV
4800,0043 CALL
Cl.O'
006'
.OPNEC
.80CS
Trace the code getting the next character from the b uffe r
,t4
BX
AX
CX
DX
--'-- :-p- GOO: 0000 aDGe coco
-- --z-:>--;--:-p--: ------
oooe
oooe
oooe
SO
8"
5:
0~5"
J~C:'::'
·'::cc,:·
IP
,,'..., U'_
O~23
~C\
0106 0000 JOOO oos.&. aGee CCloe ::·[:00 OC2c 1101,
0108 oeoc ooeo 005A yo_
v'V'...'
ecce oeoo 002A !NC
0108 oooe 0000 005t. :JCOG ecce U',-,wU OC2= RET
8',,0'08
gJ::::E=<
.&.'..... 0108iB..::
.9LJFF~;; =5.0
eV":"E (O~85, .a;:>7~ ::.;:c
'480D,0009
It's getting the wrong data. because BX should have the contents of
BPTR in it, rather than the address of the buffer
Leave SID-86 and
edit the file (be sure to Include the fix that was patched earlier) After
editing. reassemble and rellnk
HAC
Try it again.
A> typ typ.a 8 6 fffffftttffflftft flf f I Iltfllf fflltfflff f ff It If Iff f flf I If I f f I ff II f f ffllff Iff II f
tftfffffffffffttfffflfffffffffffffllflflftfffff ffftff f Ilf If If ff: f f I I f II If I tftf
fttffttftfffftfftff ffftfffff f Wf ff I f II I fffff f I I I II I f I I f I I I I
Still no good.
A> sid86 typ typ
C5 490:,000: 4BOD,006"
os 4eE4:COCC
4BE4:0~6F
SVMS:i...S
I;
~
yc
.a8€
"START
4800, 0000 MOV
4900,0003 CAL:'"
Ox,oes:: .F:S
CG4£:
. 8 PE ~J
CAL~
OO~9
.GE"7'C'""'R
CMP
JZ
CALL
JMPS
Ai....
lOOP:
4800,QOOE
4800,0009
46DO,0008
4600:0000
48DO:OO1C
14-12
."
ES-=
OC'2 .JO~E
005e ,CONOU;
0006 ._OOp
Programmer's Utilities Guide
DONE:
4800: 0012
480D: 0014
4800 :001'0
GETCHR:
48UD :0019
4800: COlE
14.1
eel
.VA'1IAB~ES
c~.oo
,\/A,::(: A8l...::S
MOV
MOV
JMP
O=6~
.80GS
O'P
J8
8yTE
0';23
[0188: .80
D'~
,
Introductio~
.BPTR
.GEi __
Trace at the top level.
#t,...5
:,x
BX
ex
':= 000
oeoo
:)000
:::000 OOilO
:ooc:
ox
S"'
:JCCC
Dose
BP
IP
5r
DI
0000 0000 oDeD 0000 MOV
JO:, C cose 'JODO 0000 0000 0003 CALL
DX,005C .FCB
0044 .OPEN
- - r - - - ;.. - C C;ODC oI; Of) JO
JCCO coso 0000 0000 0000 0006 CALL
-= C(JC) 'JUCJO =(J \; Cl 'JOOO case :JOOO 0000 0000 0009 CMP
:
--I-S--PC i: 0 8 c) JOOO --,n'" n
DC'CG Dose JOOO 0000 eeoo C008 JZ
0019 .GETCHR
AL,1A .EOF
0012 .OONE
- - I - --;:----'-
LOOP:
\...
'4800:0000
Got the right data from GETCHR.
/11
4800:0000
4800:0010
DONE:
4800: 00' 2
4800: 00!4
480D: 00'6
GETCHR:
480D: 00!9
4800:0CIE
48UD:002D
GETL:
4BOO:0023
4800:0027
4800:0029
480D:002D
/I
CAL~
OJSC
JMPS
0:06
. CONOUT
.LOOP
MO\/
O~,
00
. VAR: AB'_ES
MeV
C~.CJO
.VAR:A8~ES
JMP
0~6~
OM"'
JB
CALL
0023.:JETI
MOV
MOV
MOV
INC
8,",.00 .vA~:AB~ES
A_.0108[8x; .BUF=ER
. BOOS
8n" [0'68: .80 .3P;R
0:;32.FIL3:.J"
8_.[0183J
BYTE
.BP~R
!0188;
.6PT"(
t
AX
B.X
-- I-S--PC 0000 0000
*GaDO:QO~C
,CQNOljT
ex
ox
JOOO DO 0
SP
Dose
SI
J0
J
~o
OJ
: P
OCOO COOO CALL
005C
. CONOUT
Itl
CGr-.lGU" :
:~80D:
OGSC
.1: B 0 8 : :] C 5 E
M'.JV
C~,C'2
.,) ,~J1 P S
0·:6,-:'
.CONOUTC
.3D(;S
14-13
14.1 Introduction
PRINTM:
4BOO:0060
4BOO:0062
BOOS:
4BOO:0064
4BOO:0066
ERR:
4BOO:0067
4BOO:006A
4BOO:0060
4BOO:0070
4BOO:0071
4BOO:0073
Programmer's Utilities Guide
MOV
JMPS
CL,Og
0064 .800S
INT
RET
EO
MOV
CALL
JMP
a 1 00 . ERRORM
0060 . PR I ",,~
0012 .DONE
??=
6F
ADD
ESC
10, [8FOO:
. BOOS:
Ox,
[BX·SIJ.A~
At this point, the data to output to the console should be in DL, but
it's not. Edit the file again, then reassemble and relink.
#"C
Now try one more time.
A>typ typ.a86
RASM-86 sample for Concurrent DOS 26
display the contents of an ASCI r "i I e at
feb
eof
bdosi
eonoute
opene
readc
setdmac
equ
equ
equ
equ
equ
equ
equ
20
26
start:
moY
ca I I
d<. fcb
open
loop:
ea I I
emp
jz
mov
ea I I
jmps
getchr
a 1 • eof
done
dl . a 1
eonout
loop
moy
d 1.0
mov
jmp
e I .0
bdos
done:
14-14
the canso I e
5Ch
lah
224
2
15
:prepare for
;reset
conout
func~;oll
Programmer's Utilities Guide
getchr:
ge t I :
cmp
bptr.osize
jc
cal
ge t 1
14.1 Introduction
:see if we need a
:new buffer full
fi IOuf
rnov
b I . bp t r
mov
OlOv
bh.O
:re"ill
al .bufferfox
bptr
inc
J
buffer from file
;get ne~t character from buffer
: increment buffer pointer
ret
f i I buf
open:
mov
ca I
mov
Ca I
mov
ret
dx ,cffset
I
d)o' • 5c
I
r,
reaCJ
bo t
r ,
J
C'T'P
cl,openc
bdos
a I . :J f f r.
j z
e r:-
mov
Ca I I
bLiffe,
setc r·la
ret
setdma:
mov
jmps
read:
cl,setdmac
bdos
ca I I
cmp
cl,readc
bdos
a I ,0
jnz
err
rnQv
ret
conout:
mQv
jmps
prlntm:
bdos:
cl,co n outc
bdos
jrnps
c I ,9
Odos
int
bdosi
mQv
ret
err:
mov
dX,:::ffset
ca
pr i ":'
1 '
jmp
er'-or'T'
T:
done
dseg
14-15
14.1 Introduction
errorm
bsize
buffer
bptr
db
eQu
rs
db
Programmer's Utilities Guide
'ERROR' .0dh.Oan.
80h
bsize
bsize
'$'
end
Seems to work now, Just out of curiosity, let's find out how many
characters are in the file by setting a pass point with a high count at
CONOUr,
A> sid86 typ typ
cs 4BOO:0000 4BOO:007F
os
4BE5:0000 48E5:018F
#ityp,a86
Hopefully there ae fewer than 65535 characters'
#p.conout.ffff
Begin execution, with a break point at DONE,
#9 •. done
FFFF PASS
--I-S--PC
FFFE PASS
--I-S--PC
FFFD PASS
--I----PFFFC PASS
--I---APFFF8 PASS
--I-S-A-C
FFFA PASS
--I---A-FFF9 PASS
--I---APFFF8 PASS
--I---APFFF7 PASS
--I----PFFF6 PASS
4800:005E ,CONour
0000 0000 0000 0000 005A OOCO 0000 0000 005E MOV
4800:005E ,CONCUr
100A 0001 0000 OOOA C05A 0000 0000 0000 005E ,'vlOV
4800:005E
1038 0002
4800:005E
1020 0003
4800:005E
1009 0004
4800:005E
1052 0005
4800:005E
1041 0006
4800:005E
1053 0007
4BDD:005E
1040 0008
4BDD:005E
1020 0009
FFF6 PASS 4BOO:005E
--I---AP- 1038 OOOA
Stop command? (YIN)
--1------
14-16
,CONOU 7
0000 0038
,CONOU'"
0000 002<]
,CONOU7
0000 0009
,CONOU'"
0000 0052
,CONOU T
COOO 0041
, CO~..)U'"
oooe 0053
,CONCU0000 0040
,CONOU T
0000 0020
,CONOU7
0000 0038
y
OOSA COOO COOO DOOO 005E \10 V
CL,02
,CONourc
CL,02
,CONourc
CL,02
,CONDUTC;
005A OOOC
ceca
DOOO 005E \olaV
CL,02
,CONDurc
:05A OCCO
eeoo
0000 005E MOV
CL,02
,CONourc
coco
CC~U
,~O'":'O
OOSE \olOV
CL,02
,CONOUTCR
C05A 0000
eeoc
0000 D05E .\10V
CL,02
,CONOUTCA
005A GOOe. cc',:·c' :OCO 005E \olOV
CL,02
, CO~WUTCS
::::05A
CO;;A
coc,~
so·= ~
_ v,-"j
J05:: \lDv
CL,02
.CONDurCM
:05A
:,]S,,]:]
CO,JC
:·00,) OC5E \olOV
CL,02
,CONOUTC-
·:05 :
·Joee
:':j
:<.
: 0·:.) C05= MOv
CL,02
, CO~WUT8
Programmer's Utilities Guide
14.1 Introduction
This is too messy. Using the -G command suppresses the display of
the CPU registers until the pass count is 1.
#-9 .. dore
display
feb
equ
eof
equ
bdos;
equ
conoutc equ
openc
equ
equ
readc
setdmac equ
the
contents
file
at
the
console
224
20
26
d'.feb
ope"
lOOp:
cai
cmp
geter:.
done:
ASCII
2
15
mov
cal
z
an
5eh
lah
start:
j
of
a I . eo f
done
mov
d I . a)
ca 1 1
conOvt
j'TlPS
1000
mov
d 1.0
,'r:Ov
CI •J
:prepare
: reset
;see
n ...:; ...
,~
for
conout
funct ion
neEd a
~e
:JuFfe'-
full
j c
f i
;] e
~ ~)
buffer
L
from
file
cnaracter
from
t I
.
I'lC
t);]t
.
'.:
-
~:; ~
;gPt
0e~t
'r:crer'ler-:t
buffer
buffer
oointer
ret
fill)l,..,f:
U1Qv
ca i
Set
r;10\1
d -.:
,j
IT
d
1
.5cr:
rea ,~~
r'10v
botr,C
ca
ret
14-17
Programmer's Utilities Guide
14.1 Introduction
open:
mov
ca 11
cmp
jz
ret
cl.openc
bdos
al.0ffh
err
setdma: mov
jmps
cl.setdmac
bdos
read:
c 1 • readC
bdos
a 1.0
err
mov
ca 11
cmp
jnz
ret
conout: mov
jmps
cl.conoutc
bdos
printm: mov
jmps
bdos
C 1.9
bdos:
;nt
ret
bdosi
err:
mov
ca 11
jmp
dx.offset errorm
printm
done
dseg
errorm
bs;ze
buffer
bptr
'ERROR' . Odh • Oan.
BOh
bsize
bsize
db
equ
rs
db
'$'
end
Reached the break point at DONE
-4BOD:0014
.DONE
Display the currently active pass points,
#p
FB67 Pass 4BDD:005E
,CONOUT
The pass count went from FFFF to FB67, so the difference is the
number of times CONOUT was called, or the number of characters in
14-18
Programmer's Utilities Guide
14.1 Introduction
the file. The H command performs the subtraction, and displays the
result in decimal.
#hffff-fb67
4800:0498
#1167
#
Thus, there are 1176 characters in the file.
#"C
End of Section 14
14-19
APPENDIX A
RASM-86 Example Source
File
This example RASM-86 source files is provided to illustrate some of
the characteristics unique to RASM-86,
RASM-86 Sample (for Concurrent DOS 86
display the contents of an ASCII
fcb
eof
bdosi
conoutc
openc
readc
setdmac
bsize
equ
equ
equ
equ
equ
equ
equ
equ
fi Ie at
the console
5Ch
lah
224
2
15
20
26
Bah
cseg
start:
mov
ca I
I
d x, f cb
open
ca I I
cmp
j z
ca I I
jmps
getchr
d I ,eof
done
conout
loop
dOne:
mov
mov
jmp
dl,O
cl,O
bdos
;reset
getchr:
cmp
bptr,bsize
;see if we need a
:new buffer full
jc
ca
getl
f i I buf
loop:
I I
:refill
function
buffer from file
A-1
A RASM-86 Example
getl:
mOil
mOil
mov
inc
Programmer's Utilities Guide
bX,offset buffer
si, bptr
;get next character from buffer
dl,byte ptriOx+si]
bptr
ret
f; I buf: mOil
ca I I
mOil
ca II
mOil
ret
open: .
dX,feb
read
bptr,O
.openc
C 1
ca I I
cmp
jz
ret
bdos
al,Offh
err
mOil
ca I I
cmp
jnz
ret
buffer
setdrna
mov
setdma: mOil
jmps
read:
dX,offset
cl,setdmac
bdos
cl,readc
bdos
a 1,0
err
conout: mOil
jmps
cl,conoutc
bdos
printm: mOil
jmps
cl,9
bdos
bdos:
int
ret
bdosi
err:
moY
ca II
jmp
dX,offset errorm
printm
done
A-2
Programmer's Utilities Guide
A RASM-86 Example
dseg
bptr
errorm
buffer
dw
db
rb
bs;ze
'ERROR' ,Odh,Oah, '$'
bs;ze
end
End of Appendix A
A-3
APPENDIX B
Mnemonic Differences from
the Intel Assembler
RASM-86 uses the same instruction mnemonics as the Intel 8086
assembler except for explicitly specifying far and short jumps, calls,
and returns. Table 8-1 shows the four differences:
Table 8-1.
RASM-86/Intel Mnemonic Differences
Mnemonic Function
Intra-segment
Inter-segment
Inter-segment
Inter-segment
short jump
jump:
return:
call:
RASM-86
JMPS
JMPF
RETF
CALLF
Intel
JMP SHORT
JMP
RET
CALL
RASM-86 also uses a different method than Intel for specifying the
size of memory operands for 8087 instructions. Intel associates the
size with the operand, RASM-86 places it in the instruction. Table 8-2
shows the differences:
8-1
8 Mnemonic Differences
Table 8-2.
Programmer's Utilities Guide
Memory Operands for 8087 Instruction
RASM-86
FLD32
FLD64
FLD80
FST32
FST64
FST80
FILD16
FILD32
FILD64
FIST16
FIST32
FIST64
Intel
FLO
FLO
FLO
FST
FST
FST
FILO
FILO
FILO
FIST
FIST
FIST
End of Appendix B
8-2
SYM 32
SYM 64
SYM 80
APPENDIXC
Reserved Words
Table C-1.
Reserved Words
Predefined Numbers
BYTE
Operators
WORD
oWORo
AND
EO
GE
GT
LAST
LE
LENGTH
LT
MOD
NE
NOT
OFFSET
OR
PTR
SEG
SHL
SHR
TYPE
XOR
ELSE
END
ENolF
EN OM
EOU
LIST
NAME
GROUP
HAR0808?
IF
IFLIST
INCLUDE
PUBLIC
RB
NOIFLIST
NOLIST
ORG
PAGESIZE
PAGEWloTH
SSEG
TITLE
MOoRM
NOSEGFIX
RELB
RELW
SEGFIX
CL
CS
CX
oH
01
oL
OS
OX
ES
SI
SP
SS
Assembler Directives
AUT08087
Ro
RS
RW
SIMFORM
OW
EJECT
CODE MACRO
ENoiF
DB
DO
oSEG
ESEG
EXTRN
Code-macro Directives
DB
OBIT
DO
OW
8086 Registers
AH
AL
AX
BH
BL
BP
BX
CH
C-l
C Reserved Words
Programmer's Utilities Guide
Table C-l. (Continued)
8087 Registers
ST
STO
ST4
STl
ST5
ST2
ST6
EXTRA
STACK
Default Segment Names
CODE
DATA
Segment Descriptors
BYTE
LOCAL
PARA
STACK
COMMON
PAGE
PUBLIC
WORD
External Descriptors
ASS
DWORD
NEAR
BYTE
FAR
WORD
Instruction Mnemonics - See Section 13
End of Appendix C
C-2
ST3
ST7
APPENDIX 0
Code-Macro Definition
Syntax
<code,"acro>
<name>
CODEMACRD <name> [<formaI5Iist>]
[<I ist$of$macro$directives>]
ENDM
IDENTIFIER
< forma I $ lis t >
< par ame t e r $d esc r > [ ( , < par ame t e r $ de 5 c r> )
<parameter$descr>
<specifier5Iette r >
<modifier$letter>
<form$name>:<specifier5Ietter>
<modifier5Ietter>[«range» ]
:= A
:=
C
b
M
E
D
R
S
x
Sb
d
.= <single$range>1 <douOle$range>
<range>
<single$range>
<double$range>
REGISTER
NUMBERB
.= NUMBERB,NUMBERB
NUMBERB.REGISTER
I REGISTER,REGISTER
REGISTER,NUMBERB
< lis t 50 f 5ma c r 0 5d ire c t i v e 5 >
<macro$directive>
«macro5di rect ive»
<macro$directive>
.=
<db>
<dw>
<nosegf
i)(:>
<re1w>
<dd>
<modrm>
<relb">
<db; r>
<db>
.= DB NUMBERB
08
<dw>
.= OW NUMBERW
DW <form$name>
<dd>
.=
<form$narne>
DO <form$name>
.=
<segfix>
<nosegfi.>
<rnodrm>
<segfix>
.=
SEGFIX <form$name>
::= NOSEG=IX
<"orm$name>
MODRM NUMBER7.<form$name>
MODRM <form5name>.<for~$name>
D-1
o Code-Macro
= REL8
<relb>
..
<relw>
::=
<dbit> ..
Programmer's Utilities Guide
Systax
<form$na~e>
RELW <form$name>
= D8IT
<fieldSdescr>
<form$name> ..
<field$descr>C.<field$descr»
::=
=
NUM8ER15
NUM8ERI5
NUMB::RB )
<form$name>
( NUMBERB ) )
IDENTIFIER
NUM8ER8 is 8-oits
NUMBERW is 16-bits
NUMBER7 are the va lues 0, I,.
NUM8ERI5 are the values 0, 1,.
,
7
15
End of Appendix D
0-2
APPENDIX E
RASM-86 E'rror Messages
RASM-86 displays two kinds of error messages:
• nonrecoverable errors
• diagnostics
Nonrecoverable errors occur when RASM-86 is unable to continue
assembling, Table E-l lists the non-recoverable errors RASM-86 can
encounter during assembly,
Table E-l.
Error Message
RASM-86 Non-recoverable Errors
Cause
NO FILE
RASM-86 cannot find the indicated
INCLUDE file on the indicated drive.
source
or
DISK FULL
There is not enough disk space for the output files.
You should either erase some unnecessary files or
get another disk with more room and run RASM-86
again,
DIRECTORY FULL
There is not enough directory space for the output
files.
You should either erase some unnecessary
files or get another disk with more directory space
and run RASM-86 again.
E-1
E RASM-86 Error Messages
Programmer's Utilities Guide
Table E-1. (Continued)
Error Message
Cause
DISK READ ERROR
RASM-86 cannot properly read a source or INCLUDE
file.
This is usually the result of an unexpected
end-ot-tile Correct the problem in your source tile.
CANNOT CLOSE
RASM-86 cannot close an output tile. You should
take appropriate action after checking to see if the
correct disk is in the drive and the disk is not writeprotected.
SYMBOL TABLE OVERFLOW
There is not enough memory for the Symbol Table.
Either reduce the length or number of symbols, or
reassemble on a system with more memory.
SYNTAX ERROR
A parameter in the command tail of the RASM-86
command was specified incorrectly
-_._- - - - - - - - _ .
Diagnostic messages report problems with the syntax and semantics
of the program being assembled When RASM-86 detects an error in
the source file, it places a numbered ASCII error message in the listing
file in front Of ttle line containing the error. If there is more than one
error in the line, only the first one is reported. Table E-2 shows the
RASM-86 diagnostic error messages by number and gives a brief
explanation of the error.
E-2
Programmer's Utilities Guide
Table E-2.
E HASM-86 Error Messages
RASM-86 Diagnostic Error Messages
Error Message
Cause
ERROR NO:
ILLEGAL FIRST ITEM
0
The first item on a source line is not a valid
identifier, directive, or mnemonic. For example,
1234H
ER1.OR NO:
1
MISSING PSEUDO INSTRUCTION
The first item on a source line is a valid identifier,
and the second item is not a valid directive that can
be preceded by an identifier. For example,
THIS IS A MISTAKE
ERROR NO:
2
ILLEGAL PSEUDO INSTRUCTION
Either a required identifier in front of a pseudo
instruction is missing, or an identifier appears
before a pseudo instruction that does not allow an
identifier.
ERROR NO:
3
DOUBLE DEFINED VARIABLE
An identifier used as the name of a variable is used
elsewhere in the program as the name of a variable
or label. For example,
X
DB
5
X
DB
123H
E-3
E RASM-86 Error Messages
Programmer's Utilities Guide
Table E-2. (Continued)
Error Message
Cause
ERROR NO: 4
DOUBLE DEFINED LABEL
An identifier used as a label is used elsewhere in
the program as a label or variable name
For
example.
ERROR NO:
5
LAB3:
MOV
BX,5
LAB3:
CALL
MOVE
UNDEFINED INSTRUCTION
The item following a label on a source line is not a
valid instruction. For example,
DONE:
ERROR NO:
6
BAD
INSTR
GARBAGE AT END OF LINE - IGNORED
Additional items were encountered on a line when
RASM-86 was expecting an end of line.
For
example.
ERROR NO: 7
NOLIST
4
MOV
AX,4
RET
OPERAND(S) MISMATCH INSTRUCTION
Either an instruction has the wrong number of
operands. or the types of the operands do not
match. For example.
MOV CX,1,2
X
DB 0
MOV AX,X
E-4
E RASM-86 Error Messages
Programmer's Utilities Guide
Table E-2.
(Continued)
Error Message
Cause
ERROR NO:
ILLEGAL INSTRUCTION OPERANDS
8
An instruction operand is improperly formed.
example,
For
MOV [BP+SP],1234
CALL BX+l
ERROR NO:
9
MISSING INSTRUCTION
A prefix on a source line' is not followed
instruction. For example,
by an
REPNZ
ERROR NO:
10
UNDEFINED ELEMENT OF EXPRESSION
An identifier used as an operand is not defined or
has been illegally forward referenced. For example,
JMP
A
B
MOV
ERROR NO:
11
X
EQU B
EQU 5
AL,B
ILLEGAL PSEUDO OPERAND
The operand in a directive is invalid.
For example,
X EQU OAGH
TITLE UNQUOTED STRING
ERROR NO:
12
NESTED IF ILLEGAL - IF IGNORED
The maximum nesting level for IF statements has
been exceeded.
E-5
E RASM-86 Error Messages
Table E-2.
Programmer's Utilities Guide
(Continued)
Error Message.
Cause
ERROR NO:
ILLEGAL IF OPERAND - IF IGNORED
13
Elthe'r the eipres~ion in an IF statement
n ;;111~ric, or i(icont,a Ins a fa rw a rd refere n c e.
ERROR NO:
14
15
not
NO MATCHING IF FOR ENDIF
An ENDIF statement was
matching IF statement
ERROR NO:
is
SYMBOL ILLEGALLY
NEGLECTED
encountered
FORWARD
without
a
REFERENCED
The
indicated
symbol
was
illegally
forward
referenced in an ORG, RS, EOU or IF statement.
ERROR NO:
16
DOUBLE
DEFINED
UNDEFINED
SYMBOL
TREATED
AS
The identifier used as the name of an EOU directive
is used as a name elsewhere in the program.
ERROR NO:
17
INSTRUCTION NOT IN CODE SEGMENT
An instruction appears in a segment other than a
CSEG.
ERROR NO:
18
FILE NAME SYNTAX ERROR
The filename in an INCLUDE directive is improperly
formed. For example,
INCLUDE FILE.A86X
ERROR NO:
19
NESTED INCI_UDE NOT ALLOWED
An INCLUDE directive was encountered within a file
already being included
E-6
Programmer's Utilities Guide
E RASM-86 Error Messages
Table E-2.
(Continued)
Error Message
Cause
ERROR NO:
ILLEGAL EXPRESSION ELEMENT
20
An expression is improperly formed.
For example,
X DB 12X
DW (4
ERROR NO:
21
* )
MISSING TYPE INFORMATION IN OPERAND(S)
Neither instruction operand contains sufficient type
information. For example,
MOV
ERROR NO:
22
[BX ] ,10
LABEL OUT OF RANGE
The label referred to in a call, jump, or loop
instruction is out of range. The label can be defined
in a segment other than the segment containing the
instruction. In the case of short instructions (JMPS,
conditional jumps, and loops), the label is more than
128 bytes from the location of the following
instruction.
ERROR NO:
23
MISSING SEGMENT INFORMATION IN OPERAND
The operand in a CALLF or JMPF instruction (or an
expression in a DO directive) does not contain
segment
information.
The
required
segm~nt
information can be supplied by including a numeric
field in the segment directive as shown:
CSEG
X:
1000H
JMPF
DD
x
X
E-7
E RASM-86 Error Messages
Table E-2.
Programmer's Utilities Guide
(Continued)
Error Message
Cause
ERROR NO: 24
ERROR IN CODEMACRO BUILDING
Either a code-macro contains invalid statements, or
a code-macro directive was encountered outside a
code-macro.
ERROR NO: 25
NO MATCHING IF FOR ELSE
An ELSE statement was
matching IF statement.
ERROR NO: 26
encountered
a
NO MATCHING ENDIF FOR IF
An IF statement was encountered
matching E~DIF statement.
ERROR NO: 27
without
without
a
"HARD808?" USED AFTER FLOATING INSTRUCTION
The HARD8087 directive cannot be specified after a
floating point instruction
ERROR NO:
28
ATTEMPT
TO
USE
WITHOUT SWITCH
1861286
INSTRUCTIONS
80186 or 80286 instructions were encountered and
the corresponding RASM-86 run-time parameter
(186 or 286) was not specified on the RASM-86
command line.
ERROR NO:
29
Command included not used in source file
The command defined in the file included, via the
INCLUDE command, in the RASM-86 source file is
not used by the source file.
End of Appendix E
E-8
APPENDIX F
XREF-86 Error Messages
During the course of operation, XREF-86 can display error messages.
Table F-l shows the error messages and a brief explanation of their
cause.
Table F-1.
Error Message
XREF-86 Error Messages
Meaning
CANNOT CLOSE
XREF-86 cannot close an output file. You should
take appropriate action after checking to see if the
correct disk is in the drive and the disk is not writeprotected
DIRECTORY FULL
There is not enough directory space for the output
files, You should either erase some unnecessary
files or get another disk with more directory space
and run XREF-86 again.
DISK FULL
There is not enough disk space for the output files.
You should either erase some unnecessary files or
get another disk with more room and run XREF-86
again.
NO FILE
XREF-86 cannot
indicated drive,
find
the
indicated
file
on
the
F-l
F XREF-86 Error Messages
Programmer's Utilities Guide
Table F-l. (Continued)
Error Message
Meaning
SYMBOL FILE ERROR
XREF-86 issues
invalid SYM file.
not terminated
causes this error
this message when it reads an
Specifically, a line in the SYM file
With a carriage return line-feed
message.
SYMBOL TABLE OVERFLOW
XREF-86 ran out of Symbol Table space.
Either
reduce the number or length of symbols in the
program, or rerun on a system with more memory.
LATER CP/M OR MP/M VERSION REQUIRED
XREF-86 requires
operating system.
a more
End of Appendix F
F-2
recent
version
of
the
APPENDIXG
LINK-8S Error Messages
During the course of operation, lINK-86 can display error messages.
The error messages and a brief explanation of their cause are listed
below.
Table G-l.
Message
LlNK-86 Error Messages
Meaning
ALIGN TYPE NOT IMPLEMENTED
The object file contains a segment align type not
implemented in LlNK-86.
CANNOT CLOSE
lINK-86 cannot close an output file. Check to see if
the correct disk is in the drive and the disk is not
write-protected or full.
CLASS NOT FOUND
The class name specified in the command line does
not appear in any of the files linked.
COMBINE TYPE NOT IMPLEMENTED
The object file contains a segment align type not
implemented in LlNK-86.
COMMAND TOO LONG
The total length of input to lINK-86, including the
input file, cannot exceed 2048 characters.
G-l
G LINK-aS Error Messages
Programmer's Utilities Guide
Table G-1. (Continued)
Message
Meaning
DIRECTORY FULL There is not enough directory space for the output
files.
You should either erase some unnecessary
files or get another disk with more directory space
and run LlNK-86 again.
DISK READ ERROR
LlNK-86 cannot properly read a source or object file.
This is usually the result of an unexpected end-offile character. Correct the problem in your source
file.
DISK WRITE ERROR
A file cannot
probably full
be
written
properly;
the
disk
is
FIXUP TYPE NOT IMPLEMENTED
The object file uses a fixup type not implemented in
LlNK-86.
Make sure the object file has not been
corrupted.
GROUP NOT FOUND
The group name specified in the command line does
not appear in any of the files linked.
GROUP OVER 64K
The group listed must be made smaller than 64k
before relinking.
Either delete segments from the
group, split it up into 2 or more groups or do not
use groups.
GROUP TYPE NOT IMPLEMENTED
LlNK-86 only supports segments as elements of a
group.
G-2
Programmer's Utilities Guide
Table G-1.
Message
G LlNK-86 Error Messages
(Continued)
Meaning
INVALID LIBRARY-REQUESTED SUFFIX
The command file suffix requested· by a library is
not supported.
Verify that the correct library is
being used
LlNK-86 ERROR 1 This error indicates an inconsistency in the LlNK-86
internal tables, and should never be emitted.
MULTIPLE DEFINITION
The indicated symbol is defined as PUBLIC in more
than one module.
Correct the problem in the
source file, and try again.
MORE THAN ONE MAIN PROGRAM
A program linked by LlNK-86 may have at most one
main program.
NO FILE
L1NK-86 cannot find the indicated source or object
file on the indicated drive.
OBJECT FILE ERROR
L1NK-86 detected an error in the object file. This is
caused by a translator error or by a bad disk file.
Try regenerating the file
RECORD TYPE NOT IMPLEMENTED
The
object file
contains
a record
type not
implemented in LINK-86. Make sure the object file
has not been corrupted by regenerating it and
linking again
SEGMENT OVER 64K
The segment listed after the error message has a
total length greater than 64k bytes.
Make the
segment smaller, or do not combine it with other
PUBLIC segments of the same name.
G-3
G LINK-aS Error Messages
Table G-1.
Message
Programmer's Utilities Guide
(Continued)
Meaning
SEGMENT CLASS ERROR
The class of a segment must be
STACK, EXTRA, Xl', X2", X3*, or X4".1
CODE,
DATA,
SEGMENT ATTRIBUTE ERROR
The Combine type of the indicated segment is not
the same as the type of the segment in a previously
linked file. Regenerate the object file after changing
the segment attributes as needed.
SEGMENT COMBINATION ERROR
An attempt is made to combine segments that
cannot be combined, such as LOCAL segments.
Change the segment attributes and relink.
SEGMENT NOT FOUND
The segment name specified in the command line
does not appear in any of the files linked.
SYMBOL TABLE OVERFLOW
LlNK-86 ran out of Symbol Table space.
Either
reduce the number or length of symbols in the
program, or relink on a system with more memory.
SYNTAX ERROR
1. native-mode only
G-4
LlNK-86 detected a syntax error in the command
line; the error is probably an improper filename or
an invalid command option.
LlNK-86 echoes the
command line up to the point where it found the
error. Retype the command line or edit the INP file.
Programmer's Utilities Guide
Table G-l.
Message
G LlNK-86 Error Messages
(continued)
Meaning
TARGET OUT OF RANGE
The target of a fixup cannot be reached from the
location of the fixup.
TOO MANY MODULES IN LIBRARY
The library contains more modules than LlNK-86 can
handle. Split the library up into 2 or more libraries
and relink.
TOO MANY MODULES LINKED FROM LIBRARY
A library may supply a maximum of 256 modules
during 1 execution of LlNK-86. Split the library up
into 2 or more smaller libraries.
UNDEFINED SYMBOLS
The symbols following this message are referenced
but not defined in any of the modules being linked.
VERSION 2 REQUIRED
LlNK-86 needs a version 2 or later file
because its uses random disk I/O functions
system
End of Appendix G
G-5
APPENDIX H
LIB-86 Error Messages
LlB-86 can produce the following error messages during processing.
With each message, LlB-86 displays additional information appropriate
to the error, such as the filename or module name, to help isolate the
location of the problem.
Table H-1.
Message
L1B-86 Error Messages
Meaning
CANNOT CLOSE
L1B-86 cannot close an output file. You should take
appropriate action after checking to see if the
correct disk is in the drive and the disk is not writeprotected.
DIRECTORY FULL
There is not enough directory space for the output
files.
You should either erase some unnecessary
files or get another disk with more directory space
and run L1B-86 again.
DISK FULL
There is not enough disk space for the output files.
You shou Id eithe r erase some unnecessary files or
get another disk with more room and run L1B-86
again.
H-1
H LlB-86 Error Messages
Programmer's Utilities Guide
Table H-l. (Continued)
Message
Meaning
DISK READ ERROR
LlB-86 cannot properly read a source or object file.
This is usually the result of an unexpected end-offile. Correct the problem in your source file.
INVALID COMMAND OPTION
LlB-86 encountered an unrecognized option in the
command line. Retype the command line or edit the
INP file.
MODULE NOT FOUND
The indicated module name. which appeared in a
REPLACE, SELECT. or DELETE switch. cannot be
found. Retype the command line or edit the INP file.
MULTIPLE DEFINITION
The indicated symbol is defined as PUBLIC in more
than one module
Correct the problem in the
source file, and try again.
NO FILE
LlB-86 cannot find the indicated file.
OBJECT FILE ERROR
LlB-86 detected an error in the object file. This is
caused by a translator error or a bad disk file. Try
regenerating the file.
RENAME ERROR
LlB-86 cannot rename a file
not write-protected.
H-2
Check !flat the disk is
Programmer's Utilities Guide
H LlB-a6 Error Messages
Table H-l. (Continued)
Message
Meaning
SYMBOL TABLE OVERFLOW
There is not enough memory for the Symbol Table.
Reduce the number of options in the command line
(MAP and XREF each use Symbol Table space), or
use a system with more memory.
SYNTAX ERROR
LlB-86 detected a syntax error in the command line,
probably due to an improper filename or an invalid
command option. LlB-86 echoes the command line
up to the point where it found the error. Retype the
command line or edit the INP file.
VERSION 2 REQUIRED
LlB-86 requires a version 2 file system or later.
End of Appendix H
H-3
APPENDIX I
SID-86 Error Messages
Table 1-1.
Error Message
510-86 Error Messages
Meaning
AMBIGUOUS OPERAND
An attempt was made to assemble a command with
an ambiguous operand. Precede the operand with
the iJrefix "BYTE" or "WORD".
BAD COMMAND OR PARAMETER; PRESS? FOR HELP
The command, or parameters for a command were
not entered correctly.
•
BAD FILE NAME
A filename in an E, R, or W command is incorrectly
specified.
BAD HEX DIGIT
A SYM file being loaded with an E command has an
invalid hexadecimal digit.
CANNOT CLOSE
The disk file written by a W command cannot be
closed.
DISK READ ERROR
The disk file specified in an R command CQuid not
be read properly.
1-1
I SID-86 Error Messages
Table 1-1.
Error Message
Programmer's Utilities Guide
(Continued)
Meaning
DISK WRITE ERROR
A disk write operation could not be successfully
performed during a W command, probably due to a
full disk.
EMPTY FILE
The file specified in an R command has length 0
INSUFFICIENT MEMORY
There is not enough memory
specified in an R or E command.
to
load
the
file
MACRO ALREADY EXISTS
An attempt was made to define a macro With a
name already in use
Verify defined macro names
with the = command
MACRO NAME NOT FOUND
An attempt was made to use a macro that has not
been defined
Verify defined macros with the =
command.
MACRO OVERFLOW ERROR
The macro definition
IS
too long.
MEMORY REQUEST DENIED
A request for memory during an R command could
not be fulfilled either because the maximum number
of memory locations has already been made, or the
memory at the specified address is not available.
Up to eight blocks of memory can be can be
allocated at a given time under Concurrent.
1-2
I $10-86 Error Messages
Programmer's Utilities Guide
Table 1-1.
Error Message
(Continued)
Meaning
NESTING MACROS NOT ALLOWED
CONTINUE ENTERING COMMANDS
Macro definitions cannot include macros; definition
ignored.
NO FILE
The file specified in an R or E command could not
be found on the disk
NO SPACE
There is no space in the directory for the file being
written by a W command.
PROGRAM TERMINATED NORMALLY (PC DOS ONLY)
The program running under SID-86 completed, or
was terminated by a Ctrl-Break.
SYMBOL LENGTH ERROR
A symbol in a SYrvl file being loaded with an E
command has more than thirty-one characters.
SYMBOL TABLE FULL
There is no more space in SID-86's symbol table.
1-3
I SID-86 Error Messages
Programmer's Utilities Guide
Table 1-1.
Error Message
(Continued)
Meaning
VERIFY ERROR AT 5:0
The value placed in memory by a Fill, Set, Move, or
Assemble command could not be
read back
correctly, indicating bad RAM, or attempting to write
to ROM or non-existent memory at the indicated
location.
End of Appendix I
/-4
Index
$ operator RASM-86, 2-11, 2-18
$C option LlNK-86, 7-15
$L option LlNK-86, 7-15
$M option LlNK-86, 7-16
$0 option LlNK-86, 7-16
$S option LlNK-86, 7-16
* operator RASM-86, 2-10, 2-13
+ operator RASM-B6, 2-10,
2-12,2-13
+ sign, 10-7
- operator RASM-86, 2-10,
2-12,2-13
- sign, 10-7
. operator RASM-86, 2-11, 2-17
/ operator RASM-86, 2-10, 2-13
186 parameter, 1-4
286 parameter, 1-4
80286 instruction mnemonic,
2-6
802B6 object module format,
7-1
80B6 Arithmetic Instructions,
4-17,4-18,4-19
BOB6 Control Transfer
Instructions, 4-27
B086 Data Transfer Instructions,
4-12, 4-14, 4-15
BOB6 instruction mnemonic, 2-6
BOB6 Logical and Shift
Instructions, 4-20, 4-21,
4-22, 4-23
BOB6 object module, 8-1
8086 Prefix Instructions, 4-26
8086 Processor Control
Instructions, 4-32
8086 Registers, C-1
8086 String Instructions, 4-25
8087 Arithmetic Instructions,
4-38
BOB7 comparison instructions,
4-43
B087 constant instructions, 4-44
8087 control directives, 3-18
B087 data transfer instructions,
4-36, 4-37
80B7 math coprocessor, 7-10
BOB7 processor control
instructions, 4-44
B087 Registers, C-2
8087 transcendental
instructions, 4-43
Command SI0-86, 11-30
=
Command SI0-86, 11-30
Index-1
? Command SID-86, 11-29
?? Command SID-86, 11-29
A
A command, 10-3, 11-2
A parameter, 1-3
AAA,4-17
AAD,4-17
AAM,4-17
AAS, 4-17
Absolute align type, 7-22
Absolute number, 2-11
Absolute paragraph address,
7-9
ABSOLUTE parameter, 7-7, 7-9
Absolute segment combine
type, 3-0, 3-7
ADC, 4-17
ADD,4-17
Adding to a library, 8-4
Addition and subtraction
operators, 2-12
Additional 186 and 286
instructions, 4-45
Additional 286 instructions,
4-46
ADDITIONAL parameter, 7-7, 7-9
Address conventions in
RASM-86, 3-3
Address expression, 2-20
Address expression
components: 2-20
Address memory directly, 13-2
AF,4-16
Align and combine attributes,
Index-2
7-18
Align attributes, 7-18
Align type, 3-5, 7-17, 7-22
Allocate storage, 3-15
Altering CPU state, 11-26
AND, 4-20
AND operator, 2-11, 2-14
Arithmetic functions, 11-10
Arithmetic instructions, 4-15
Arithmetic operators, 2-10, 2-12
ARPL, 4-46, 4-47
ASCII character set, 2-1
Assembler directives, 3-1, C-1
Assembling 80286 mnemonics,
11-2
Assembly-language macros, 5-1
Attributes of labels, 2-9
Attributes of variables, 2-8
AUT08087 directive, 3-18
AUT08087 option, 7-10
B
B Command, 11-3
Base address, 3-3
Base, or radix of a constant, 2-4
Base-addressing modes, 2-20
BOOS Interrupt instruction,
11-22
Between byte and word string
instructions, 13-1
Binary constants, 2-4
Binary delimiters, 10-7
Bit patterns, 4-1
Block structured languages,
10-6
BOUND, 4-45
Bracketed expression, 2-20
Breakpoints, 11-9, 11-15
BYTE align type, 3-5, 7-20
Byte alignment 3-5
BYTE attribute, 2-8
c
CALL, 4-27
CANNOT CLOSE error, E-2
Caret symbol, 10-4
CB86, 7-1, 7-23
CBW, 4-17
CF,4-16
Changing memory, 11-19
Character string, 2-5
Character string constant, 2-5
Character strings, 10-2
CLASS, 7-8
Class name, 3-7,7-17,7-18
CLASS parameter, 7-7
CLC, 4-32
CLD, 4-32
CLI, 4-32
CMC, 4-32
CMD file, 7-2, 11-6
CMP, 4-18
CMPS, 4-25
Code macro directives, 5-4
CODE option, 7-4, 7-7
CODE section, 7-23
Code segment, 2-8, 12-1
Code-macro definition syntax,
0-1
Code-macro directives, 5-1,
5-4, 5-8, C-1
Code-macro operand modifiers,
5-3
Code-macro operand specifiers,
5-2
Code-macros, 5-1
CODESHARED option, 7-11
Collecting segments, 7-18
Combine attributes, 7-18
Combine type, 3-6, 7-17
Combine type, COMMON, 3-6
Combine type, LOCAL, 3-6
Combine type, PUBLIC, 3-6
Combine type, STACK, 3-6
Command (CMD or 286) file,
7-17
Command (CMD) file, 7-2
Command (EXE) file, 7-2
Command file, 7-15
Command file header, 7-9
Command file option
parameters, 7-7
Command file options, 7-7
Command file section, 7-23
Command list, 11-29
Command tail, E-2
Comment field, 2-2, 2-21
Comments, 2-21
Common block, 7-19
COMMON combine type, 3-6,
7-19
Comparing memory blocks,
11-3
Conditional assembly, 3-11,
5-10
Conditional assembly directives,
3-1
Index-3
Console output, 1-3
Constants, 2-3
Control transfer instructions,
4-27
Copying data, 11-15
CPU flags, 11-26, 11-28
CPU state, 11-24, 11-26, 11-27
Creating a new library, 8-4
Creating an INPUT file, 7-13
Creating and updating libraries,
8-2
Creating libraries with LlB-86,
8-2
Creation of output files, 1-5
Cross-reference file, 6-1, 8-1,
8-6, 8-7
CS register, 3-3, 11-9
CSEG (code segment), 3-4
CTS. 4-46
Current cata segment. 3-3
Current code segment, 3-3
Current extra segment, 3-3
Current stack segment. 3-3
CWO,4-18
o
o Command, 11-4
DAA. 4-18
DAS.4-18
Data definition directives, 3-1
DATA option, 7-4. 7-7
DATA section, 7-23
Data segment. 2-8. 12-1
Data transfer, 4-12
Data transfer instructions, 4-12
Index-4
DB directive, 2-5, 2-8, 3-13, 5-4
DB, OW, and DO directives, 5-8
DBIT directive, 5-4, 5-8
DO directive, 2-8, 3-14, 5-4
DEC, 4-18
Decimal constant, 2-4
Default, 8-7, 8-9
Default align types, 3-5
Default class name, 3-7
Default drive, 6-1, 8-6
Default list device, 6-2
Default segment names, 3-4,
C-2
Default values, command
options, 7-9
Default values, command
parameters, 7-9
Define data area, 3-13
Defining code-macros, 5-2
Defining macros, 11-30
DELETE option, 8-3
Deleting a module, 8-5
Delimiters, 2-2, 11-8
Device name, 1-2
Device names, RASM-86, 1-3
Diagnostic error messages, E-2
Directive statement, 2-22, 3-1
Directive statement syntax,
2-22, 3-1
Directory, E-1
DIRECTORY FULL error, E-1
Disassembled instruction, 11-13
Disk drive names, 1-3
DISK FULL error, E-1
DISK READ ERROR, E-2
Displaying library information,
8-6
Displaying memory, 11-4
DIV, 4-18
Division operators, 2-13
Dollar-sign operator, 2-18
Drive specification, 1-1
OS register, 3-3
DSEG (data segment), 3-4
Dumping 8087180287 registers,
11-28
Duplicate symbols, 10-6
OW directive, 2-8, 3-14, 5-4
DWORD attribute, 2-8
Even boundary, 3-5
Examining CPU state, 11-26
EXE file, 7-2
Executing macros, 11-30
Executing program, 11-6
Expression Operators, 10-7
Expressio.ns, 2-18, 2-20, 10-1
External Descriptors, C-2
External name symbols, 8-6
External symbols, 8-7
EXTERNALS option, 8-3
EXTRA option, 7-4, 7-7
Extra segment. 2-8
EXTRN directive, 3-10
E
E Command, 11-6, 11-8, 11-25,
12-1
ECHO option, 7-6
Effects of Arithmetic
Instructions on Flags,
4-16
EJECT directive, 3-16
ELSE directive, 3-11, 5-4, 5-10
END directive, 3-9
End-of-file character (1AH), 3-9
End-of-line, 2-21
ENDIF directive, 3-11, 5-4, 5-10
ENTER, 4-45
EO operator, 2-11, 2-15
EOU directive, 3-12
Error message, 13-2
Error messages, 11-7, 11-9,
11-18,11-20
ES register, 3-3
ESC, 4-32
ESEG (extra segment), 3-4
F
F Command, 11-8
F2XM 1, 4-43
FABS, 4-42
FADD, 4-38
Far control transfer, 13-1
FBLD, 4-37
FBSTP, 4-37
FCHS, 4-42
FCLEX/FNCLEX, 4-44
FCOM, 4-43
FCOMP, 4-43
FCOMPP, 4-43
FDECSTP, 4-44
FDISlIFNDISI, 4-44
FOIV, 4-41
FDIVP, 4-41
FOIVR, 4-41
FOIVRP, 4-42
FOUP, 4-36
Index-5
FENI/FNENI, 4-44
FFREE, 4-44
FIADD16, 4-38
FICOM 16, 4-43
FICOM 16P, 4-43
FIDIV16, 4-41
FIDIVR 16, 4-42
FILD16, 4-37
File name extensions, 1-2
File section options, 7-7
Filetype, 1-1
FILL option, 7-4
Filling memory blocks, 11-8
FIMUL16, 4-40
FINCSTP, 4-44
FINIT IFNINIT, 4-44
FIST16, 4-37
FIST16P, 4-37
FISUB16,4-39
FISUBR 16, 4-40
Flag bits, 4-12, 4-15
Flag register symbols, 4-12
Flag registers, 4-12
FLD, 4-36
FL01,4-44
FLDCW, 4-44
FLDENV, 4-44
FLDL2E, 4-44
FLOL2T, 4-44
FLOLG2, 4-44
FLOLN2, 4-44
FLOPI, 4-44
FLDZ, 4-44
FMUL, 4-40
FMULP, 4-40
FNOP, 4-44
Formal parameters, 5-1
Index-6
Forward reference, E-6
FPATAN, 4-43
FPOP, 4-36
FPREM, 4-42
FPTAN, 4-43
FRNDINT, 4-42
FRSTOR, 4-44
FSAVE/FNSAVE, 4-44
FSCALE, 4-42
FSQRT,4-42
FST, 4-36
FSTCW/FNSTCW, 4-44
FSTENV/FNSTENV, 4-44
FSTSW/FNSTSW, 4-44
FSUB, 4-38
FSUBP, 4-39
FSUBR, 4-39
FSUBRP, 4-40
FTST, 4-43
FWAIT,4-44
FXAM, 4-43
FXCH, 4-36
FXCHG, 4-36
FXTRACT, 4-42
FYL2X, 4-43
FYL2XP 1, 4-43
G
G Command, 11-9, 11-15, 12-2
GE operator, 2-11, 2-15
GROUP, 7-8, 7-17
GROUP directive, 3-8
GROUP parameter, 7-7
Group type, 7-18
Group, CGROUP, 7-23
Group, DGROUP, 7-23
GT operator, 2-11, 2-15
H
H Command, 11-10
Halting RASM-86, 1-6
HARD8087 directive, 3-18
HARD8087 option, 7-4, 7-10
Hexadecimal constants, 2-4
HLT,4-32
I Command, 11-12
I/O buffers, 7-9
I/O option, 7-14
Identifiers, 2-2
IDIV, 4-18
IF directive, 3-11, 5-4, 5-10
Ifilename parameter, 1-3
IFLIST directive, 3-17
IMUL, 4-19
IN, 4-12
INC, 4-19
INCLUDE directive, 3-19, E-6
INCLUDE file, E-1
Index registers, 2-20
Index-addressing modes, 2-20
Indexed library, 7-1
Indirect memory operands, 13-2
Initialized storage, 3-13
INP files, 7-1
INP filetype, 8-1
Input command file, 8-1
Input file options, 7-13
INPUT option, 7-6, 7-13,8-3
INSB, 4-45
Instruction statement syntax,
2-21
INSW, 4-45
INT, 4-27
Intel 8086 relocatable object
format 1-1,7-1,8-1
Intermediate pass points, 11-9,
11-24
INTO, 4-29
Invalid hex digit, 11-7
Invalid statements, 11-2
Invalid symbol name, 11-7
Invoking LlNK-86, 7-2
Invoking RASM-86, 1-1
Invoking XREF-86, 6-1
IP register, 11-9
IRET, 4-29
J
JA, 4-29
JB, 4-29
JC, 4-29
JE, 4-29
JG, 4-30
JL, 4-30
JLE, 4-30
JMP, 4-30
JNA, 4-30
JNB, 4-30
JNC, 4-30
JNE, 4-30
JNG, 4-31
Index-7
JNL, 4-31
JNO, 4-31
JNP, 4-31
JNS, 4-31
JNZ, 4-31
JO,4-31
JP, 4-31
JS, 4-31
JZ, 4-31
K
Keyword identifiers, 2-10
Keywords, 2-6
L
L Command, 11-13
L parameter, 1-4
L86 file, 7-1, 8-1, 8-9
Label, 11-13
Label offset attributes, 2-9
Label ,segment attributes, 2-9
Label, out of range, E-7
Labels, 2-8, 2-9
LAHF,4-12
Language translators, 7-1
LAR, 4.-47
LAST operator, 2-11, 2-16
LDS,4-12
LE operator, 2-11, 2-15
LEA, 4-12
LEAVE, 4-45
LENGTH operator, 2-11, 2-16
LES, 4-12
Index-8
LOOT, 4-46
LIB error messages, H-1
LlB-86, 3-9, 7-1
LlB-86 command options, 8-3
LlB-86 commands on disk, 8-8
LlB-86 error message, 8-6
LlB-86 errors, Table H-1, H-1
LlB-86, adding to a library, 8-4
LlB-86, command line, 8-1
LlB-86, command option INPUT,
8-8
LlB-86, command option MAP,
8-7
LlB-86, command option XREF,
8-6
LIB-86, creating a crossreference file, 8-6
LlB-86, creating a Library
Module Map, 8-7
LlB-86, creating partial library
maps, 8-7
LlB-86, deleting a module, 8-5
LlB-86, displaying library
information, 8-6
LIB-86, error message, 8-5
LlB-86, halting processing, 8-2
LlB-86, invoking, 8-1
LlB-86, librarian utility, 8-1
LlB-86, redirecting liD, 8-9
LlB-86, replacing a module, 8-4
LlB-86, selecting a module, 8-6
LlB-86, use factor, 8-1
Libraries, 7-15
Library file (L86), 7-15
Library file, 8-1,8-2
Library module map, 8-6
LlBSYMS option, 7-4, 7-11
LlDT, 4-47
LIN file, 7-2
Line number (LIN) file, 7-2
Line-editing functions, 11-2
LINES option, 7-4
LINK 86,11-7
Link process, 7-17, 7-22
LlNK-86, 3-9, 7-1
LlNK-86 command line, 7-3,
7-13
LlNK-86 command options, 7-4
LlNK-86 errors, Table G-l, G-1
Linkage control directives, 3-1
Linkage editor, 3-5, 3-6, 3-8,
7-1
List address, 11-13
List device name, 1-3
LIST directive, 3-17
List files, 6-1
Listing command options, 11-29
Listing commands, 11-29
Listing file, 1-1, E-3
Listing memory contents, 11-13
Literal character values, 10-2
Literal decimal numbers, 10-2
Literal hexadecimal numbers,
10-1
LLDT, 4-47
LMSW, 4-47
Loading program file, 11-6
Loading the command file, 7-9
Local combine type, 3-6, 3-7,
7-22
Local symbols, 7-11
LOCALS option, 7-4, 7-11
Location counter, 2-18, 2-21,
3-20
Location pointer, 2-2
LOCK, 4-32
LODS, 4-25
Logical address, 3-3
Logical instructions, 4-15
Logical operators, 2-10, 2-14
LOOP, 4-31
LSL, 4-47
LST file, 6-1
LST files, 6-1
LT operator, 2-11,2-15
LTR, 4-47
M
M Command, 11-15
Machine state, 11-27
Macros, 11-30
Map (MAP) File, 7-1
Map file (MAP), 7-15
MAP file, 7-2, 7-12, 8-9
MAP filetype, 8-1
MAP option, 7-4, 7-6, 7-12. 8-3
Maximum length of a character
string, 2-5
MAXIMUM parameter, 7-7, 7-9
Memory address, 11-19
Memory allocation directives,
3-1
Memory execution, 3-3
Memory models, 3-3
Memory value, 11-13
Minus sign, 10-7
Mnemonic keywords, 2-6
Mnemonics, 4-1
MOD operator, 2-11, 2-13
Index-9
Modifiers, 5-3, 5-6
MODRM directive, 5-4, 5-6
Module map, 8-7
Module map file, 8-1, 8-6
MODULES option, 8-3
Modules, alphabetized list, 8-7
MOV,4-12,11-22
Moving data, 11-15
MOVS.4-25
MUL,4-19
Multiple replaces, 8-5
Multiplication operators, 2-13
N
NAME'directive, 3-9
Name field, 2-22, 3-1
NC parameter, 1-4
NE operator, 2-11, 2-15
Near control transfer, 13-1
NEG. 4-19
Nesting IF directives, 3-11
Nesting level, E-5
Nesting parentheses in
expressions, 2-19
NO FILE error, E-l
NOALPHA option, 8-3, 8-7
NOFILL option, 7-4
NOIFLIST directive, 3-17
NOLiBSYMS option, 7-4, 7-11
NOLINES option, 7-6
NOLIST directive, 3-17
NOLOCALS option, 7-4, 7-11
NO MAP option, 7-12
Nonprinting characters, 2-1
NOSEGFIX directive, 5-4, 5-5
Index-l0
NOT, 4-20
NOT operator, 2-11. 2-14
Number of errors message, 1-5
Number symbols, 2-9
Numbers. 2-9
Numeric constant. 2-4
Numeric constants, 2-4
Numeric expression, 2-20
o
o parameter, 1-3
OBJ files. 7-1
OBJ filetype, 8-1
Object file (OBJ or L86). 7-15
Object file, 1-1,7-16,8-1
Octal constant, 2-4
Odd boundary, 3-5
OF,4-16
Offset, 2-8, 10-8
Offset of a variable, 2-8
OFFSET operator, 2-11, 2-16
Offset value, 3-3
Offsets within a segment, 7-22
Offsets within a segment,
intersegment. 3-3
Opcode, 11-13
Operands, 4-1,11-13, E-4
Operator precedence, 2-18
Operators, 2-2, 2-6, 2-10, C-1
Operators in expressions, 10-7
Optional run-time parameters,
1-2
OR, 4-20
OR operator, 2-11, 2-14
Order of operations. 2-18
ORG directive, 3-20
ORIGIN parameter, 7-7, 7-9
OUT,4-14
Output files, 1-5, E-1
Output listing control directives,
3-1
OUTSB, 4-45
OUTSW, 4-45
Overflow, 10-7
Overlays, 7-1
Overriding LlNK-86 positioning,
7-24
Overriding operator precedence,
2-19
p
P Command, 11-15
P parameter, 1-3
PAGE align type, 3-5, 7-21
Page alignment, 3-5
PAGESIZE directive, 3-17
PAGEWIDTH directive, 3-17
PARA (paragraph), 3-6
PARA align type, 3-5, 3-6
PARAGRAPH align type, 3-20,
7-21
Paragraph alignment 3-5
Parameter list 1-2
Partial library maps, 8-7
Pass counts, 11-15
Pass points, 11-15, 11-16
Pass points and breakpointsdifference between,
11-15
Pass points clearing, 11-15,
11-16
Pass points displaying, 11-15,
11-16
Pass points with G, T, and U
commands, 11-16
Patches, 11-26
Patching a file, 9-3
Period operator, 2-11, 2-17,
2-18
PF,4-16
Physical address, 3-3
PL/I-86, 7-23
Plus sign, 10-7
POP, 4-14, 11-22
POPA, 4-45
POPF, 4-14
Positioning, 7-22
Pound sign, 11-1
Predefined numbers, 2-6, C-1
Prefix, 4-26
Prefixes, 11-13
Printer output, 1-3
Printing macro list, 11-30
Processor control instructions,
4-32
Program execution, 11-6
Pseudo instruction, E-3
PTR operator, 2-11, 2-17, 2-18
PUBLIC combine type, 3-6, 7-18
PUBLIC directive, 3-9
Public name symbols, 8-6
Public symbols, 8-7
Public symbols, defined in the
module, 8-7
PUBLICS option, 8-3
PUSH, 4-14
PUSHA, 4-45
Index-1
PUSHF,4-15
Q
QCommand,11-17
Qualified symbols, 10-6
R
R Command, 11-18, 11-25,
12-1, 12-2
Radix indicators, 2-4
Range specifiers, 5-4
RASM-86, 6-1
RASM-86 character set. 2-1
RASM-86 command examples,
1-4
RASM-86 command line, 1-2
RASM-86 command syntax, 1-1
RASM-86 delimiters, 2-2
RASM-86 device names, 1-3
RASM-86 directives, 2-6, 3-1
RASM-86 error messages, E-1
RASM-86 identifier, 7-17
RASM-86 identifiers, 2-6
RASM-86 instruction
mnemonics, B-1
RASM-86 instruction set. 4-1
RASM-86 nonrecoverable errors,
E-1
RASM-86 operators, 2-10
RASM-86 run-time parameters,
1-2
RASM-86 segment directives,
7-23
Index-12
RASM-86 separators, 2-2
RASM-86 tokens, 2-2
RASM-86, invalid parameter,
1-3
RASM-86, redirecting output,
1-5
RASM-86, use factor, 1-5
RB directive, 3-15
RCL, 4-20
RCR, 4-21
RD directive, 3-16
Reading command line from
disk file, 7-13
Reading files into memory,
11-18
Reading from disk file, 7-3
Reading LlB-86 commands from
disk file, 8-8
Redefining macros, 11-30
Redirecting 110, 8-9
Register keywords, 2-6
Register name, 10-3
Registers, 2-6, 11-6, 11-26
Relational operators, 2-10, 2-14
RELB and RELW directives, 5-7
RELB ,directive, 5-4
Relotatable number, 2-11
Relocatable object files, 7-1
RELW directive, 5-4
REP, 4-26
REPLACE option, 8-3
Replacing a module, 8-4
Reserved words, 5-5, C-1
RET, 4-32
ROL, 4-21
ROR, 4-21
RS directive, 3-15
Run-time options, 1-2
Run-time parameter, E-2
Run-time parameters, 1-2
RW directive, 3-15
5
S Command, 11-19
S parameter, 1-3
SAHF, 4-15
SAL, 4-21
SAR, 4-22
SBB, 4-19
SCAS, 4-26
Search and match procedure,
10-6
SEARCH option, 7-6, 7-13
Searching memory, 11-20
Section, 7-17
SEG operator, 2-11, 2-16
SEGFIX directive, 5-5
SEGIFX directive, 5-4
Segment. 2-8, 7-8, 7-17
Segment attribute, 2-8
Segment base address, 3-3
Segment base values, 3-2
Segment boundaries, 7-21
Segment control directives, 3-1,
3-2
Segment Descriptors, C-2
Segment directives, 3-3
Segment name, 3-4, 7-17, 7-18
Segment name symbols, 8-6,
8-7
Segment offset 7-12
Segment override, 2-2
Segment override operator,
2-11,2-15
Segment override operators,
2-10
Segment override prefix, 3-3
SEGMENT parameter, 7-7
Segment register, 3-8, 7-22
Segment registers, 3-3
Segment specification, 12-1
Segment starting address, 2-8
Segment-override prefix, 5-5
Segmented architecture, 3-2
SEGMENTS option, 8-3
SELECT option, 8-3
Selecting a module, 8-5
Setting breakpoints, 10-4
Setting pass points, 11-15
SF, 4-16
SGDT, 4-47
Shift instructions,,4-15
SHL, 4-22
SHL operator, 2-11, 2-13
SHR, 4-22
SHR operator, 2-11, 2-13
S10-86 Commands, 11-31
SID-86 Error Messages, 1-1
SlOT, 4-47
Sign-on message, 1-5
S:M8087 option, 7-10
SIMFORM directive, 3-17
SLOT, 4-47
SMSW, 4-47
Source file, 1-1, E-3
Special characters, 2-1
Specifiers, 5-2
Specifying 8087 operand size,
B-1
Index-13
SR Command, 11-20
SS register points, 3-3
SSEG (stack segment). 3-4
STACK combine type, 3-6, 3-7,
7-19
STACK option, 7-4, 7-7
Stack segment, 2-8
Statements, 2-21
STC, 4-34
STD, 4-34
STI, 4-34
Stopping LlB-86, 8-2
Stopping LlNK-86, 7-3
Stopping RASM-86, 1-6
STOS, 4-.26
STR, 4-47
String constant, 2-5
String instructions, 4-24
String length, 10-2
String operations, 4-24
SUB,4-19
Subroutine calls, 11-23
Suppressing RASM-86 output,
1-3
SYM file, 6-1, 7-2
SYM file options, 7-11
SYM files, 6-1
Symbol, 2-8, 3-12
Symbol attributes, 2-8
Symbol definition directives, 3-1
Symbol file (SYM), 7-15
Symbol file, 1-1,7-16
Symbol labels, 2-8
Symbol numbers, 2-8
SYMBOL TABLE OVERFLOW
error, E-2
Symbol table (SYM) file, 7-2
Index-14
Symbol table, 5-1, 10-5, E-2
Symbol table file, 6-1, 11-6
Symbol table file format, 11-7
Symbol table space, 7-9
Symbol variables, 2-8
Symbolic expressions, 10-7
Symbolic references, 10-5
Symbols, 11-13
SYNTAX ERROR, E-2
T
T Command, 11-21
TEST, 4-23
Testing flag registers, 4-11
TITLE directive, 3-18
Traced instruction, 11-22
Tracing program execution,
11-21,11-24
Transferring program control,
11-9
Type, 2-8
Type attribute, 2-6, 2-8
TYPE operator, 2-11, 2-16
Type-l segment value, 12-1
Type-2 segment value. 12-2
u
U Command, 11-24
Unary delimiters, 10-7
Unary operators. 2-13
Underflow, 10-7
Unresolved symbols, 7-2
Unsigned numbers, 2-14
Updating libraries with L1B-86,
8-2
Use factor, 7-1, 8-1
Use factor message, 1-5
Use factor, RASM-86, 1-5
User console name, 1-3
User-defined symbols, 2-10
User-defined symbols, 3-12
Using macros, 11-30
v
V command, 11-6, 11-25
Valid RASM-86 characters, 2-1
Variable creation operators,
2-10
Variable manipulation operators,
2-10
Variable manipulator, 2-16
Variable offset attributes, 2-9
Variable segment attributes, 2-9
VERR, 4-47
VERW, 4-47
X Command, 11-26, 12-1
Xl option, 7-7
X2 option, 7-7
X3 option, 7-7
X4 option, 7-7
XCHG, 4-15
XLAT,4-15
XOR, 4-23
XOR operator, 2-11, 2-14
XREF option, 8-3
XREF-86, 6-1
XREF-86 command syntax, 6-1
XREF-86 errors, Table F-1, F-1
XREF-86 output files, 6-1
XREF-86, command line, 6-1
XREF-86, cross-reference utility,
6-1
XREF-86, input files, 6-1
XREF-86, output file, 6-1
XRF file, 6-1, 8-9
XRF files, 6-1
XRF filetype, 8-1
y
w
W Command, 11-25
WAIT,4-34
WORD align type, 3-5, 7-20
Word alignment, 3-5
WORD attribute, 2-8
Writing memory to disk, 11-25
z
Z Command, 11-28
ZF,4-16
x
Index-15
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement