GC28 6514 9_OS_Assembler_Rel21_Jan74 9 OS Assembler Rel21 Jan74

GC28-6514-9_OS_Assembler_Rel21_Jan74 GC28-6514-9_OS_Assembler_Rel21_Jan74

User Manual: GC28-6514-9_OS_Assembler_Rel21_Jan74

Open the PDF directly: View PDF PDF.
Page Count: 173

DownloadGC28-6514-9_OS_Assembler_Rel21_Jan74 GC28-6514-9 OS Assembler Rel21 Jan74
Open PDF In BrowserView PDF
File No. 8360-21
Order No. GC28-6514-9

Systems Reference Library

OS Assembler Language
OS Release 21

This publication contains specifications
for the ~BM System/360 Operating System
Assembler Language (Leyels E and F) .
The assembler language is a symbolic
programming language used to write programs
for the IBM System/360. The language provides a convenient means for representing
the machine instructions and related data
necessary to program the IBM System/360.
The IBM Systelt1/360 Operating System Assembler Program processes the language and
provides auxiliary functions useful in the
preparation and documentation of a program,
and includes facilities for processing the
assembler macro language.
Part I of this publication describes the
assembler language.
Part II of this publication describes an
extension of the assembler language -- the
macro language
used to define macro
instructions.

PREFACE

This publication is a reference manual
for the programmer using the assembler
language and its features.
Part I of this publication presents
information common to all parts of the
language followed by specific information
concerning the symbolic machine instruction
codes and the assembler program functions
provided for t:he programmer I s use.
Part II
contains a description of the macro language and procedures for its use.
Appendixes A through J follow Part II.
Appendixes A through F are associated with
Parts I and II and present such items as a
summary chart for constants, instruction
listings, character set representations,
and other aids to programming. Appendix G
contains macro language summary charts, and
Appendix H is a sample program. Appendix I
is
a
features
comparison
chart
of
System/360 assemblers. Appendix J includes
samples of macro definitions.
Knowledge
of IBH System/360 machine
operations, particularly storage addressing,
data formats, and machine instruction
formats and functions, is prerequisite to
using this publication,
as is experience
with programming concepts and techniques or
completion of basic courses of instruction
in these areas.
IBM System/360 machine

operations are discussed in the publication
IBM System/360 Principles of Operation,
Order No. GA22-682l. The IBM System/370
machine operations are discussed in the
publication IBM System/370 Principles of
Operation, Order No. GA22-7000. Information
on program assembling, linkage editing,
executing, interpreting listings, and
assembler programming considerations is
provided in OS Assembler (F} Programmer's
Guide, Order No. GC26-3756.

The following publications are referred to
in this publication:
OS Introduction, Order No. GC28-6534
OS Utilities, Order No. GC28-6586
OS Loader and Linkage
Order No. GC28-6538

Edito~,

OS Supervisor Services and Macro
Instructions, Order No. GC28-6646
OS Data Management Macro Instructions,
Order No. GC26-3794
OS Data Management Services Guide,
Order No. GC26-3746

lenth Edition (January, 1974)
This is a reprint of GC28-6514-8 incorporating changes released in the following Technical
Newsletter:
GN33-8154 (dated April 30, 1973)
This Technical Newsletter is a part of release 21.7 of OS/MPT and OS/MVT.
This edition applies to release 21 of IBM System/360 Operating System and to all subsequent
releases until otherwise indicated in new editions or Technical Newsletters. Changes are continually
made to specifications herein; before using this publication in connection with the operation of
IBM systems, consult tJile IBM System/360 and System/370 Bibliography, Order No. GA22-6822,
for the editions that are applicable and current.
Requests for copies of IBM publications should be made to your IBM representative or to the IBM
branch office serving your locality.
A form is provided at the back of this publication for readers' comments. If the form has been
removed, comments may be addressed to IBM Nordic Laboratory, Product Communications,
Box 962, S-181 09 Lidingo 9, Sweden. Comments become the property of IBM.

©Copyright International Business Machines Corporation 1966, 1968, 1969, 1970, 1972, 1974

CONTENTS

PART 1 -- THE ASSEMBLER LANGUAGE
SECTION 1:
INTRODUCTION.
Compatibility • •

3
3

The Assembler Language • •
Machine Operation Codes.
Assembler Operation Codes • •
Macro Instructions •

3
3
3
3

The Assembler Program.
Basic Functions.

4
4

Programmer Aids.

4

Operating System Relationships •

5

SECTION 2:

7

GENERAL INFORMATION • •

AsseJ';:.)ler Language Coding Conventions. • 7
Coding Form. • • • •
7
Continuation Lines •
7
Statement Boundaries
8
Statement Format • •
• • •
8
Identification-Sequence Field.
9
Summary of Statement Format.
9
Character Set • • • • • • • • • • • 10
Assembler Language Structure •

• • 10

Terms and Expressions.
Terms . . • • • • •
Symbols. • • • •
Self-Defining Terms.
Location Counter Reference •
Literals • • • • • • • •
Symbol Length Attribute
Reference • • • • • • •
Terms in Parentheses.
Expressions • • • • • • • • •
Evaluation of Expressions. •
Absolute and Relocatable
Expressions • • • • • • • •

•
• •
•
•
•
•

• 15
• 16
• • 16
• 16
• 17

SECTION 3: ADDRESSING -- PROGRAM
SECTIONING AND LINKING. •

.19

Addressing • • • • . • • •
Addresses -- Explicit and Implied.
Base Register Instructions • • •
USING -- Use Base Address
Register. • • • • • • • • •
DROP -- Drop Base Register •
Programming with the USING
Instruction. • • •
Relative Addressing • • • •
•
Program Sectioning and Linking •
Control Sections • • • • • •
Control Section Location
Assignment • • • • • • •
First Control section • • •
START -- Start Assembly. •

10
10
10
12
14
14

• 19
• 19
• 19
• 19
• 20

• 21
• 21

• • 22
• 22
• 22

• 23
• • 23

iii

CSECT -- Identify Control
Section • • • • • • • • •
•
Unnamed Control Section. •
•
DSECT -- Identify Dummy Section. •
External Dummy Sections(Assemb1er F}.
DXD -- Define External Dummy
Section. • • • • • • • • • • • • • •
CXD - Cumulative Length External
Dummy Section. • • • • • • • • • • •
COM -- Define Blank Common Control
Section. • • • • • • • • • • •
Symbolic Linkages • • • • • • •
ENTRY -- Identify Entry-Point
Symbol • • • • • • • • • • • •
•
EXTRN -- Identify External Symbol • •
Addressing External Control
sections. • • • • • • • •
SECTION 4:

MACHINE-INSTRUCTIONS • •

23
24
24
25
25
25
26
26

27
27

28
29

Machine-Instruction Statements • •
Instruction Alignment and
Checking. • • • • • • • • •
Operand Fields and Subfields • •
Lengths -- Explicit and Implied

• 29
• 29
• 30

Machine-Instruction Mnemonic Codes •
Machine-Instruction Examples.
RR Format.
RX Format.
RS Format. • • • • • •
SI Format.
SS Format • • •

31
• 31
31
32
32
• 32
32

• 29

Extended Mnemonic Codes.

32

SECTION 5: ASSEMBLER INSTRUCTION
STATEMENTS. • • • • • • • • •

35

Symbol Definition Instruction. • •
EQU -- EQUATE SYMBOL. • • • •
Operation Code Definition Instruction.
OPSYN -- EQUATE OPERATION CODE . .
Data Definition Instructions • • • • •
DC -- DEFINE CONSTANT • • • • • • •
Operand Subfield 1: DUplication
Factor. • • • • • • •
Operand Subfield 2: Type. • •
Operand Subfield 3: Modifiers.
Operand Subfield 4: Constant •
DS -- Define Storage. • • • • • • •
Special Uses of the Duplication
Factor. • • • • • • • • •
CCW -- Define Channel Command Word.
0

•

• •

Listing Control Instructions . •
TITLE
Identify Assembly Output
EJECT
Start New Page
SPACE
Space Listing.
PRINT
Print Optional Data.

• 35
• 35
36

. 36
• 36
• 36
38
38
38
41

• 48
• 50
• 50
51
51
52
52
• 52

Program Control Instructions . . .
.53
ICTL -- Input Format Control . . . . . 53
ISEQ -- Input Sequence Checking . . . 54
PUNCH -- Punch a Card . . . . .
.54
REPRO -- Reproduce Following Card . . 55
ORG -- Set Location Counter . . . . . 55
LTORG -- Begin Literal Pool . . . . . 55
Special Addressing Consideration .56
Duplicate Literals . . . . . . . . 56
CNOP -- Conditional No Operation . . . 56
COpy -- Copy Predefined Source
Coding . . . . . . . . . .
• .57
. . . 58
END
End Assembly . . .

Inner Macro Instructions .

.

73

Levels of Macro Instructions

74

SECTION 9:
HOW TO WRITE CONDI'l'IONAL
ASSEMBLY INSTRUCTIONS .

75

SET Symbols . . . . . .
Defining SET Symbols .
Using Variable Symbols .

•
•

• •

• 75
• 75
• • 75

PART 2 -- THE MACRO LANGUAGE
SECTION 6:
INTRODUCTION TO THE MACRO
LANGUAGE.

.61

The Macro Instruction Statement.

.61

Attributes . . . . . . . . . .
Type Attribute (T').
... . .
Length (L'), Scaling (S'), and
Integer (I') Attributes.
.
Count Attribute (K')
•
Number Attribute (N I ) . • •
Assigning Attributes to Symbols . .

The Macro Definition

.61

Sequence Symbols .

.61

LCLA,LCLB,LCLC -- Define SET Symbols .

The Macro Library . .

·

System & Programmer Macro Definitions . . 62
System Macro Instructions.

.

.

.62

Varying the Generated Statements

.

.

.

Variable Symbols . . . . . . . . . . . . 62
Types of Variable Symbols..
.62
Assigning Values to Variable
Symbols . . . . . . . . . . . . .63
Global SET Symbols . .
....63

SETC -- Set Character . . .
Type Attribute . .
Character Expression .
Substring Notation .
Using SETC Symbols .

Organization of this Part of the
Publication
. . . ..
.

SETB -- Set Binary . . . . .
Evaluation of Logical
Expressions . . . .
Using SETB Symbols . .

SECTION 7:
HOW TO PREPARE MACRO
DEFINITIONS .
....

. . . 63
.

MACRO -- Macro Definition Header .

78
78
79
79

· 80

SETA -- Set Arithmetic .
Evaluation of Arithmetic
Expressions . . .
Using SETA Symbols .

.62

..

.

76
77

. 81

81
82
· 82
• 83
83
• • 83

.

84

· 85
· 86
•

• 87
87

.65
AIF

Conditiona+ Branch.

AGO

Unconditional Branch.

88

.65
•

•

•

• 89

•

• 89

.

. 90

MEND -- Macro Definition Trailer . . . . 65
Macro Instruction Prototype . .
Statement Format . . . .

·

.65
. 66

·

.66

Symbolic Parameters. .
Concatenating Symbolic
Parameters with Other
Characters or Other Symbolic
Parameters . .
Comments Statements.

.

.67

COpy Statements . . .

·

.

.

ACTR -- Conditional Assembly Loop
Counter . . . . . . . . . . .
ANOP -- Assembly No Operation.

Model Statements .

.

.

.

.

Conditional Assembly Elements.

.68
• .69

.71

Macro Instruction Operands .

·

.71

Statement Format .

• • • 72

Omitted Operands .

• .72
·

. 93

MEXIT

Macro Definition Exit

93

MNOTE

Request for Error Message

93

.69

·

.

• • • 90

SECTION 10: EXTENDED FEATURES OF THE
MACRO LANGUAGE. . . . . . . .

SECTION 8:
HOW TO WRITE MACRO
INSTRUCTIONS . . .

Operand Sublists .

.

Global and Local Variable Symbols.
Defining Local and Global SET
Symbols . .
Using Global and Local SET
Symbols . . . . . . . .
Subscripted SET Symbols . .

• 94
•

• 95
95

• • 97

SYSTEM VARIABLE SYMBOLS. . . .
. . . 98
&SYSNDX -- Macro Instruction
Index . . . . . . . . . . .
. 98

.72

iv

APPENDIX C:

&SYSECT -- Current Control
Section . . . . . . . . .
. 99
&SYSLIST -- Macro Instruction
Operand. . . . .
. . . . . 100
Keyword Macro Definitions And
Instructions . . . . . . . .
Keyword Prototype . . .
Keyword Macro Instruction.

MACHINE-INSTRUCTION FORMAT.119

APPENDIX D: MACHINE-INSTRUCTION
MNEMONIC OPERATION CODES . . . .

. . 100
.101
. . . 101

Mixed-Mode Macro Definitions and
Instructions . . • . • . . • . . . . . 103
Mixed-Mode Prototype . . . . . . 103
Mixed-Mode Macro Instruction • . 103

. . 121

APPENDIX E:

ASSEMBLER INSTRUCTIONS.

.131

APPENDIX F:

SUMMARY OF CONSTANTS.

.135

APPENDIX G:

MACRO LANGUAGE SUMMARY.

.137

APPENDIX H:

SAMPLE PROGRAM.

APPENDIX I: ASSEMBLER LANGUAGES-FEATURES COMPARISON CHART

.

.141
.145

Macro Definition Compatibility . • . . . 104
APPENDIX J:

APPENDIXES
APPENDIX A:

INDEX . .

CHARACTER CODES • . • . . . 107

APPENDIX B:
HEXADECIMAL-DECIMAL
NUMBER CONVERSION TABLE . . . . • . . . 113

V'

SAMPLE MACRO DEFINITIONS . . 149
.151

ILLUSTRATIONS

figures
Figure 2-1.
F'igure 2-2.
Figure 2-3.
F'igure 3-l.
Figure 4-1.
Figure 5-1.

7
Coding Form
Punched Card Form
8
Assembler Language
Structure--Machine and
Assembler Instructions.
.11
Multiple Base Register
.21
Assignment.
.33
Extended Mnemonic Codes
Type Codes for Constants. .38

Figure 5-2.
Figure 5-3.
Figure 5-4.
Figure 5-5.
Figure 5-6.

Bit-Length Specification
(Single Constant) . . . . .
Bit-Length Specification
(Multiple Constants) . . . .
Bit-Length Specification
(Multiple Operands) . . . .
Floating-Point External
Formats . . . .
....
CNOP Alignment. . . . . . .

39
40
40
45
57

Tables
'rable 4-1.

Address Specification
Details . . . . . . . . . • 30

Table 4-2.

vi

Details of Length Specifications in SS Instructions. 31

SUMMARY OF AMENDMENTS
FOR GC28-6514-8
OS RELEASE 21
USE OF DSECT SYMBOLS IN ADCONS

&SYSLIST

The use of DSECT symbols as absolute
expressions in adcons has been rewritten
for clarification.

An explanation of &SYSLIST(O) has been
added for completeness.
COMMENTS ON ASSEMBLER INSTRUCTIONS
A note has been added explaining why
certain assembler instructions (e.g.,LTORG)
are not flagged when an "operand" is
present.

HEXADECIMAL CONSTANTS AND SYNTAX RULES
Clarification of the syntax restriction
on the number of hexadecimal digits allowable per explicit hexadecimal constant
specification has been added.

POSITIONAL PARAMETERS
A note has been added explaining that
positional parameters cannot be changed
to keywords by substitution.

MACHINE-INSTRUCTION ON MNEMONIC
OPERATION CODES
MACRO SEQUENCE SYMBOLS
Erroneous instruction names, condition
code settings, and operand formats contained
in Appendix D have been corrected.

An explanatory note has been added distinguishing the "name field" of a macro
from the name field parameter.

CHARACTER CODE GRAPHICS

TITLE CHANGES

The EBCDIC printer graphics for the IBM
System/360 8-bit code have been added to
Appendix A.

Cross-references to OS publications
have been changed to reflect their new
titles.

vii

PART I -- THE ASSEMBLER LANGUAGE

SECTION 1: INTRODUCTION
SECTION 2: GENERAL INFORMATION
SECTION 3: ADDRESSING AND PROGRAM SECTIONING AND LINKING
SECTION 4: MACHINE INSTRUCTIONS
SECTION 5: ASSEMBLER INSTRUCTIONS

SECTION 1:

computer programs may be expressed in
machine language, i.e., language directly
interpreted by the computer, or in a symbolic language, which is much more mean1ngful to the programmer. The symbolic language, however, must be translated into
machine language before the computer can
execute the program.
This fUnction is
accomplished by a processing program.
Of the various symbolic programming languages, assembler languages are closest to
machine language in form and content.
The
assembler language discussed in this manual
is a symbolic programming language for the
IBM System/360. It enables the programmer
to use all IBM System/360 machine functions, as if he were coding in System/360
machine language.
The assembler program that processes the
language translates symbolic instructions
into machine-language instructions, assigns
storage locations" and perf orms auxiliary
functions necessary to produce an executable machine-language program.

INTRODUCTION

THE ASSEMBLER LANGUAGE
The basis of the assembler language is a
collection of mnemonic symbols which represent:
1.

System/360 machine-language
codes.

operation

2.

Operations (auxiliary functions) to be
performed by the assembler program.

The language is augmented by other symbols, supplied by the programmer, and used
to represent storage addresses or data.
Symbols are easier to remember and code
than their machine-language equivalents.
Use of symbols greatly reduces programming
effort and error.
The programmer may also create a type of
instruction called a macro instruction. A
mnemonic symbol, supplied by the programmer, serves as the operation code of the
instruction.

Machine Operation Codes

Compatibility
System/360 Operating System assemblers
process source programs written in the
Basic Programming Support/360 basic assembler language, the IBM 7090/7094 Support
Package for IBM System/360 assembler language, the Basic Programming Support Assembler (8K Tape) language, the Basic Operating System Assembler (8K Disk) language,
and the Disk and Tape Systems Assembler
language, with the following exceptions:
1.

The XFR assembler instruction is considered an invalid mnemonic operation
code by Operating System/360 assemblers.

2.

The assignment, size, and ordering of
literal pools may differ among the
assemblers.

Differences in the macro language for
System/360 assemblers are described in Section 10 of this publication.

The assembler language provides mnemonic
machine-instruction operation codes for all
machine ins'tructions in the IBM System/360
Universal Instruction Set and extended mnemonic operation codes for the conuitional
branch instruction.

Assembler Operation Codes
The assembler language also contains
mnemonic assembler-instruction
operation
codes, used to specify auxiliary functions
to be performed by the assembler.
These
are instructions to the assembler program
itself and, with a few exceptions, result
in the generation of no machine-language
code by the assembler program.

Macro Instructions
The assembler language enables the programmer
to
define
and
use
macro
instructions.
Section 1:

Introduction

3

Macro instruct~ons are represented by an
operation code which stands for a sequence
of machine and/or assembler instructions.
Macro instructions used in preparing an
assembler language source program fall into
two categories: system macro instructions,
provided by IBM, which relate the object
program to components of the operating
system; and macro instructions created by
the programmer specifically for use in the
program at hand, or for incorporation in a
library, available for future use.
Programmer-created
macro instructions
are used to simplify the writing of a
program and to ensure that a standard
sequence
of
instructions
is used to
accomplish
a
desired
function.
For
instance,
the logic of a program may
require the same instruction sequence to be
executed again and again. Rather than code
this entire sequence each time it is needed, the programmer
creates
a
macro
instruction to represent the sequence and
then, each time the sequence is needed, the
programmer
simply
codes
the
macro
instruction statement.
During assembly,
the sequence of instructions represented by
the macro instruction is inserted in the
object program ..
Part II of this publication discusses
the language and procedures for defining
and using macro instructions.

THE

ASSEMBLER PROGRAM

The assembler program, also referred to
as the "assembler," processes the source
statements
written
in
the
assembler
language.

Basic Functions
Processing involves the translation of
source statements into machine language,
the assignment of storage locations to
instructions and other elements of the
program, and t~he performance of the auxiliary assembler functions deSignated by the
programmer.
The output of the assembler
program is the object program, a machinelanguage translation of the source program.
The assembler furnishes a printed listing
of the source statements and object program
statements
and
additional
information
useful to the programmer in analyzing his
program,
such as error Indications. The
object program is in the format required by
the linkage editor component of Operating
Systerrv360.
(See the linkage editor publica·tion. )
4

The amount of main storage allocated to
the assembler for use during processing
determines the maximum number of certain
language elements that may be present in
the source program.

PROGRAMMER AIDS
The assembler provides auxiliary fUnctions that assist the programmer in checking and documenting programs, in controlling address assignment, in segmenting a
program, in data and symbol definition, in
generating macro instructions, and in controlling the assembler itself. Mnemonic
operation codes for these functions are
provided in the language.
Variety in Data Representation: Decimal,
binary, hexadecimal, or character representation of machine-language binary values
may be employed by the programmer in writing source statements. The prograrr@er selects the representation best suited to his
purpose.
Base Register Address Calculation: As discussed in IBM System/360: Principles of
Operation, the Systern/360 addressing scheme
requires the designation of a base register
(containing a base address value) and a
displacement value in specifying a storage
location. The assembler assumes the clerical burden of calculating storage addresses
in these terms for the symbolic addresses
used by the programmer.
The programmer
retains control of base register usage and
the values entered therein.
Relocatability:
The object programs produced by the assembler are in a format
enabling relocation from the originally
aSSigned storage area to any other suitable
area.
Sectioning and Linkin~ The assembler language and program provide facilities for
partitioning an assembly into one or more
parts called control sections.
Control
sections may be added or deleted when
loading the object program.
Because control sections do not have to be loaded
contiguously in storage, a sect.ioned program may be loaded and executed even though
a continuous block of storage large enough
to accommodate the entire program may not
be available.
The assembler allows symbols to
be
defined in one assembly and referred to in
another, thus effecting a link between

separately assembled programs. This permits reference to data and transfer of
control between programs. A discussion of
sectioning and linking is contained in
Section 3 under the heading, "Program Sectioning and Linking."

Program Listings: A listing of the source
program statements and the resulting object
program statements may be produced by the
assembler for each source program it assembles. The programmer can partly control
the form and content of the listing.

Error Indications: As a source
assembled, it is analyzed for
potential errors in the use of
bIer language. Detected errors
cated in the program listing.

program is
actual or
the assemare indi-

OPERATING SYSTEM RELATIONSHIPS
The assembler is a component of the IBM
System/360 Operating System and, as such,
functions under control of the operating
system. The operating system provides the
assembler with input/output, library, and
other
services needed in assembling a
source program.
In a like manner, the
object program produced by the assembler
will normally operate under control of the
operating system and depend on it for
input/output and other services.
In writing the source program, the programmer must
include statements requesting the desired
functions from the operating system. These
statements are discussed in the control
program services publication. The
OS Introduction publication provides further
information on operating system relationships.
Input/output considerations are discussed in
the data management publication.

Section 1:

Introduction

5

SECTION 2:

This section presents information about
assembler language coding conventions and
assembler source statement structure
addressing.

ASSEMBLF~

LANGUAGE CODING CONVENTIONS

This subsection discusses the general
coding conventions associated with use of
the aS~Jen:Ller languaqe.

A source program is a sequence of source
statements that are punched into cards. The
standard card form, IBM 6509 (shown in Figure
2-2), can be used for punching source statements. These statements may be written on
the standard coding form, GX28-6509 (shown
in Figure 2-1), provided by IBM. One line
of coding on the form is punched into one
card. The vertical columns on the form
correspond to card columns. Space is provided
on the form for program identification and
instructions to keypunch operators.
The body of the form (Figure 2-1) is
composed
of two fields:
tbE:! statement
field,
columns
1-71,
and
the
identification-sequence
field,
columns
73-80.
The identi f ication-scqllf~nce field

GENERAL INFOR1ViATION

is not part of a statement and is discussed
following
the
subsection
"Statement
Forwat."
The entries
(i.e., coding) composing a
statement occupy columnu 1-71 of a line
and, if needed, columns 16-71 of one or two
successivE contInuation lines.
continuation Lines
When it is necessary to continue a
statement on another line, the following
rules apply.
1. Write the statement up through column 71.
2. Enter a continuation character (not blank
and not part of the coding) in column 72
of the line.
3. Continue the statement in colwnn 16 of the
next line, leaving columns 1 through 15
blank.
4. If the statement is not finished before
column 71 of the second line, enter a
continuation character in column 72, and
continue in column 16 of the following line.
5. The statement has to be finished before
column 71 of the third line, because the
maximum number of continuation lines is two.
6. Macro instruction can be cdded on as many
lines as are needed.
These rules assume that normal source
statement boundaries are used (see"Statement Boundaries" below).

IBM Syslem 360 Assembler Codmg Form

Figure 2-1.

Codi.ng Form
Section 2:

General Information

7

5.

Statement Boundaries
Source statements are norroally contained
in columns 1-71 of statement lines and
columns 16-71 of any continuation lines.
Therefore, columns 1,
71,
and 16
are
referred to as the "begin," "end," and
"continue" columns, respectively.
(This
convention can be altered by use of the
Input
Format
Control (ICTL)
assembler
ins~ruction discussed later in this
publicatlon.
The continuation character
if
used, always immediately follows the :end"
column.

A description of the name, operation,
operand, and comments entries follows:
Name EntEY-: The name entry is a symbol
created by the programmer to identify a
statement. A name entry is usually optional.
The symbol must consist: of eight
characters or less, and be entered with the
first character appearing in the begin
column. The first character must be
alphabetic.
If the begin column is blank,
the assembler program assumes no name has
been entered. No blanks can appear in
the symbol.

Statement Format
Statements may consist of one to four
entries in the statement field.
They are,
from left to right: a name entry, an
operation entry, an operand entry,
and a
comments entry.
These entries musi
be
separated by one or more blanks
and must
be written in the order stated. '

Ope~3tio~ Ent~:

The operation entry is
the mnemonic operation code specifying the
machine operation, assembler, or macroinstruction
operation
desired.
An
operation entry is mandatory and cannot
appear in a continuation line.
It must
start at least one position to the right of
the begin column. Valid mnemonic operation
codes for machine and assembler operations
are contained in Appendixes D and E of this
publication. Valid operation codes consist
of five characters or fewer for machine or
assembler-instruction operation codes, and
eight
characters
or fewer for macroinstruction operation codes.
No blanks can
appear within the operation entry.

The coding form (Figure 2-1) is ruled to
provide an 8-character name
field,
a
5-character
operation
field
and
a
56-character operand and/or comm~nts field.
If desired, the programmer can disreqard
these . boundaries
and write the name,
operatlon, operand, and comment entries in
other positions,
subject to the following
rules:
1.

The entries must not extend beyond
statement boundaries within a line
(either the conventional boundaries
if no ICTL statement is given or as
designated by the programmer ~ia the
ICTL instru~tion).

2.

The
entries
must
be
in proper
sequence, as stated previously.

3.

The entries must be separated
or more blanks.

aDO

The nalre and operation entries must be
completed in the first line of the
statement, including at least
one
blank following the operation entry.

Operand Entries: Operand entries identify
and descrlbe data to be acted upon by the
instruction, by indicating such things as
storage locations, masks, storage-area
lengths, or types of data.

one

Depending on the needs of the instruction, one or more or no operands can be
written. Operands are required for all
machine instructions, but many assembler
instructions require no operand.

If used, a name entry must be written
starting in the begin column.

Operands must be separated by commas,
and no blanks can intervene between operands and the commas that separate them.

by

-_J

,,;:"' 1Io:,L~:7~'o,

1,

--,

coodo u,6-0 0 o~ofoo 00 oTo oo'~ 0;00000[0000 dio o-IlTc;o 0 uoOjC1Io jj lljo [) O~-~>I;r;For~ooo 00 10'00'00 ~O ort6r~"~"0
O;'ERA<-.C

' ,.

_

;;;;;;; ;1;:'t;';';';r;';~'I·'t"."I"I"IJ';';I';;";';';li"I''1";'I'I';';':':·I'i;'·;;J<;·I'j't,;;·;·'tll;";\";'i'l'';'I"I"II;";'I"I"I"I";'I"'I"t;II';';':'I";';':'I'31'I

2221122211i22212i222212222121222222212211222j22222i1222121.22222212112112212122222222221
,3333333 l,tll,'3 33331333333133-33 1!3] 3

uG.1J~,W

J U 3I ,] 3",3 3

]_"h] 3] ]13 JU 3i3]] 3 313 3 3 3] 3 3 3 3 3 J:J 3 333 3 3J 31

!4 4 4 4 4 4 4 4(4 4 4 4 4 41,14 4 4 t 44 4 4~11 _.I!.~~YSTF._tv1/~O___

i~

+~ 55!t~~~D~:D AS~EM_~ER_CA:D
IcG666566,'b666E,616606616666U6;6'!66666!6666616666~66&66jOI;666'166666166666,66666661&6666666!
T T
T
+
!
~
5 5 5 5 5 5 '1515 5 5 5 5

1

14144444144444444444444444444

5 55555
j

177777 7 7 71 7: 7 7 7 7 7:7\7 I 7 7

777

_

I 7 7 717 7 7 7 7i 7 7 7 7? 7 7 7

; B 8 8 8 8 8 8 8, 8i8 8 8 8 8:818 8 8 8 81'- 8 8 8 8i8 8 8 P 8;8 8 8 8 B!8

a 8 8 8:8

515555515555515555555555555551

7 7) li7 ! 7 11,7 7 11 TIll

8 8 8 8i8 8 8 8 8i8

1

ij

Ba8 8 b ,

1111117il1 7 11 7 7 71

8 8 8 8 8 88 8 8 8 8 alala 8 8 8 8 8 8 8

I~,;: ! ~: ~ :19;,~~:9·1~ s. ,9::~I,j ~ ~ .~~ 319 9 9 9 ~!9 9 9? 9i9 9 9 9 9.J 9 SJ~ 9 9:9 9 1.:4~9 9 ,:; 9 9',R~;S 9ill ',1~'9 9 ~!9 ~I9 ~89 S961}1~1
9 S!9 9 9 9 919 9 9 9 9 91~ 9 9 9 9 9 9 9 9
'~,f,~ ~I
'IL:: I~ I~): )~'~ ad

1

I

',." 1

.

Figure 2-2.
8

"6 I. 18

,UI, " , 1.7" J.

, .• q

Jell! ,I IJ 1

,j

I'J I!',.' t

4.";' 1

Punched Card Form

',0'."

',',ISC

61&3 ,_

&8 1-9 '"

'I

compared.
The comment entry reminds the
programmer that he is comparing "new sum"
to "old" with this instruction.

The first blank normally indicates the end
of the operand field.
The operands cannot contain embedded
blanks, except as follows:

r------T-----------T----------------------,

IName 1Operation I Operand
I
~------+-----------+----------------------~
ICOMP
NEW SUM TO OLD
L______ ICR
___________ 15,6
______________________
J1

If character representation is
used to specify a constant, a
literal, or immediate data in an
operand, the character string can
contain blanks, e.g., CIA D'.

~

Comment Entries: Comments are descriptive
items of information about the program that
are shown on the program listing. All 256
valid characters (see Character Set in this
section), including blanks can be used in
writing a comment. The entry can follow
the operand entry and must be separated
from it by a blank; each line of comment
entries cannot extend beyond the end
column (column 71).
An entire statement field can be used
for a comment by placing an asterisk in the
begin column. Extensive comment entries
can be written by using a series of lines
with an asterisk in the begin column of
each line or by using continuation lines.
Comment entries cannot fall between a
statement and its continuation line.
In statements where an optional operand
entry is omitted but a comment entry is
des1red, the absence of the operand entry
must be indicated by a comma preceded and
followed by one or more blanks, as follows:

r-------T----------T----------------------,

IName

IOperation IOperand

I

I END

1
~-------+----------+----------------------~

I.,

COMMENT

1

L_______ ~----------~----------------------J

For instructions that cannot contain an
operand entry, this comma is not needed.
Note: Macro prototype statements without
operands will not tolerate comments, even
if a comma is coded as shown above.
For information on rules for the operand
field of different assembler instructions,
refer to the table in Appendix E.
statement Example: The following example
illustrates the use of name, operation,
operand, and comment entries.
A compare
instruction has been named by the symbol
COMP; the operation entry (CR)
is the
mnemonic operation code for a register-toregister compare operation, and the two
operands
(5,6)
designate the two general
registers
whose
contents
are
to be

~

Identification-Sequence Field
The identification-sequence field of the
coding form
(columns 73-80)
is used to
enter program identification ana/or statement sequence characters.
The entry is
optional.
If the field, or a portion of
it, is used for progranl identification, the
identification is punched in the source
cards and reproduced in the printed listing
of the source program.
To aid in keeping source statements in
order, the programmer can number the cards
in this field.
These
characters
are
punched into their respective cards, and
during assembly the programmer may request
the assembler to verify this sequence by
use of the Input Sequence Checking (ISEQ)
assembler instruction. This instruction is
discussed in Section 5, under
Program
Control Instructions.

Summary of St.a.tement Format
The entries in a statement must always
be separated by at least one blank and must
be in the following order: name, operation,
operand(s), comment(s).
Every statement requires an operation
entry.
Name
and comment entries are
optional. Operand entries are required for
all machine instructions and most assembler
instructions.
The name and operation entries must be
completed in the first statement line,
including at least one blank following the
operation entry.
The name and operation entries must not
contain blanks. Operand entries must not
have blanks preceding or following the
commas that separate them.

Section 2:

General Information

9

A name entry must always
begin column.

start

in

If the column after the end column is
blank, the next line must start a new
statement.
If the column after the end
column is not blank, the following line
is treated as a continuation line.
All entries must be contained within the
designated begin, end, and continue column
boundaries.

Source statements are written using
following characters:
Letters

A through Z, and $,

o

#~

the

@

through 9

§.E§cial
Characters + -

,

=

•

* (

• /

t

• One or more operands composed of one or
more expressions, Which, in turn, are
composed of a term or an arithmetic
combination of terms.
Operands
of
machine
instructions
generally represent such things as storage
locations,
general registers,
immediate
data, or constant values.
Operands of
assembler instructions provide the information needed by the assembler program to
perform the designated operation.
Figure 2-3 depicts this structure.
Terms shown in Figure 2-3 are classed as
absolute or relocatable. Terms are absolute or relocatable,
depending on
the
effect of program relocation upon them.
Program relocation is the loading of the
object program into storage locations other
than those originally assigned by
the
assembler. A term is absolute if its value
does not change upon relocation.
A term is
relocatable if its value changes upon relocat.:.ion.

blank

These characters are represented by the
card-punch combinations and internal bit
configurations listed in Appendix A.
In
addition, any of the 256 punch combinations
may be designated anywhere that characters
may appear between paired apostrophes, in
comments, and in macro instruct:ion operands.

AS~EMBLER

An operand entry is:

the

LANGUAGE STRUCTURE

The basic structure of the language can
be stated as follows.
A source statement is composed of:
• A name entry (usually optional).

The following subsection "Terms
and
Expressions" discusses these items as outlined in Figure 2-3.

TEgMS

AND EXPRESSIONS

TEPJIIC

Every term represents a value.
This
value may be assigned by the assembler
(symbols, symbol length attribute, location
counter reference) or may be inherent in
the term
itself
(self-defining
term,
literal).
An arithmetic combination of terms is
reducea to a single value by the assembler.
The following material discusses each
type of term and the rules for its use.

• An operation entry (required).
• An operand entry (usually required).

Symbols

• Comments entry (optional).

A symbol is a character or combination of
characters used to represent locations or
arbitrary values.
Symbols, through their
use in name fields and in operands, provide
the programmer with an efficient way t.o
name and reference a program element.
ThEre are three types of symbols:

A name entry is:
• A symbol.
An operation entry is:
• A mnemonic operation code
a
machine,
assembler,
instruction ..

10

representing
or
macro-

1.
2.
3.

Ordinary symbols.
Variable symbols.
Sequence symbols.

Ordinary symbols, created by the programmer for use as a name entry and/or an
operand, must conform to these rules:

1.

characters may be letters, digits,
a conbination of the two.

The symbol must not consist of more
than
eight characters.
The first
character must be a letter. The other

Is a Symbol
which is an

2.

No special characters may be included
in a symbol.

3.

No blanks are allowed in a symbol.

One or more
Operands that
are composed
of an

Is a Mnemonic
Operation Code

I

I

1

Machine
Instruction

or

Assembler
Instruction

or

1

I

or

Macro
Instruction

I
Exp

or

Exp(Exp)

Exp

or

Exp(Exp, Exp)

Expressi on

.--------,1
Ordinary
Symbol
~
(AT or RT)

I

or
or

Arithmetic
Combination
of Terms

2
~

or
'--

Term

Variable
Symbol

2

which may be
anyone of
the following

Sequence
Symbol

I

I

A Symbol
e.g.,BETA
(AT or RT)

A Selfdefining
Term (AT)

I
A Location
Counter Reference i.e., *
(RT)

A Literal
e.g.,=F'1259'
(RT)

I

I

I

Symbol Length
Attribute Reference e.g.,

Other Symbol.
Attribute
References (A T)

~~~--

2

which may be
anyone of
the following

I
Decimal
e.g.,15

I
Hexadecimal
e.g.,X'C4'

I

AT=Absolute Term

I

I

Binary
e.g.,B'lOl'

Character
e.g.,C'AB9'

RT= Relocatable Term

1 May be generated by combination of variable symbols and assembler language characters. (Conditional assembly only)
2 Conditional assembly only.

Figure 2-3.

Assembler Language structure -- Machine and Assembler Instructions

Section 2:

General Information

11

In the following sections, the term
symbol refers to ordinary symbol.

The value of a symbol may not
tive and may not exceed 22tt-1.

The following are valid symbols:
READER
A23456
X4F2

LOOP2

$A1

S4

#56

The following symbols are
the reasons noted:
256B

invalid,

for

RECORDAREA2
BCD*34

(first
character
is
not
alphabetic)
(more than eight characters)
(contains d special character

IN AREA

(contains a blank)

-

*)

Variable symbols must begin with an
ampersand (&) followed by one to seven
letters and/or numbers, the first of which
must be a letter. Variable symbols are
used within the source program or macro
definition to allow different values to be
assigned to one symbol. A complete discussion of variable symbols appears in
~~ction 6.
Sequence symbols consist of a period (.)
followed by one to seven letters and/or
numbers, the first of which must be a letter.
Sequence symbols are used to indicate
the position of statements within the
source program or macro definition. Through
their use the programmer can vary the
sequence in which statements are processed
by the assembler program.
(See t:he complete
discussion in Section 6.)
NOTE: Sequence symbols and variable symbols
are used only for the macro language and
conditional assembly. Programmers who do
not use these f~atures need not be concerned
with these symbols.
lEFINING SYMBOLS: The assembler assigns a
'Talue to each symbol ,ppearing as a name
,~ntry
in a sourCL statement. The values
,1ssigned to symbols naming storage areas,
instructions, constants, and control sections are the addresses of the leftmost
bytes of the storage fields containing the
odmed items.
Since the addresses of these
items may change upon program relocation,
the symbols naming them are considered
relocat.a ble terms.
A symbol used as a name entry in the
Equate symbol (EQU)
assembler instruction
is assigned the value designated in the
operand entry of the instruction.
Since
the operand entry may represent a relocatabIe
value
or
an
absolute
(i.e.,
nonchanging) value, the symbol is considered a relocatable term or an absolute
term, depending upon the value it is equat(~d to.
12

nega-

A symbol is said to be defined when it
appears as the name of a source statement.
(A special case of symbol definition is
discussed in Section 3, under "Program
Sectioning and Linking.")

@B4

N

be

Symbol definition also involves
the
assignment of a
length attribute to the
symbol.
(The assembler maintains an internal table - the symbol table - in which the
values and attributes of symbols are kept.
When the assembler encounters a symbol in
an operand, it refers to the table for the
values associated with the symbol.)
The
length attribute of a symbol is the length,
in
bytes, of the storage field whose
address is represented by the symbol.
For
example,
a symbol naming an instruction
that occupies four bytes of storage has a
length attribute of 4. Note that there are
exceptions to this rule; for example, in
the case where a symbol has been defined by
an equate to location counter value (EQU *)
or to a self-defining term,
the length
attribute of the symbol is 1. These and
other
exceptions
are noted under the
instructions involved. The length attribute is never affected by a duplication
factor.
PREVIOUSLY DEFINED SYMBOL!:;: Scme instructions require that a symbol appearing in
the operand entry be previously defined.
This simply means that the symbol, before
its use in an operand, must have app2nre1
as a name entry in a prior state"''','~.
GENERAL RESTRICTIONS ON SY1V1BO~;i:_ '1 symOo.L
may be defined only once in an ~ssemDly.
That is, each symbol used as the name of a
statement must be unique within that assembly.
however, a symbol may be used in the
name field more than once as a control
section name (i.e., defined in the STA~T,
CSECT, or DSECT assembler statements described in Section 3) because the coding of
a control section may be suspended and then
resumed at any subsequent point,.
The CSECT
or DSECT statement that resumes the section
must be named by the same symbol that
initially named the section; thus,
the
symbol that nawes the section must be
repeated.
Such usage is not considered to
be duplication of a symbol definition.

Self-Defininq Terms
A self-defining term is one whose value
is
inherent in the term.
It is not
assigned a value by the assembler.
For
example, the decimal self-defining term 15 - represents a value of 15. The length
attribute of a self-defining term is always
1.

There are four types of self-defining
terms: decimal, hexadecimal,
binary,
and
character. Use of these terms is spoken of
as decimal, hexadecimal, binary, or character representation of the machine-language
binary value or bit configuration they
represent.
Self-defining terms are classed as absolute terms, since the values they represent
do not change upon program relocation.
USING SELF-DEFINING TERMS:
~~E::lf-defining
terms are the means of specifying machine
values or bit configurations without equating the values to symbols and using the
symbols.
Self-defining terms may be used to specify such program elements as imITlediate
data, masks,
registers, addresses,
and
address increments.
The type of term selected (decimal,
hexadecimal,
binary, or
character) will depend on what is being
specified.
The use of a self-defining term is quite
distinct from the use of data constants or
literals.
When a self-defining term is
used in a machine-instruction statement,
its value is assembled into the instruction.
When a data constant is referred to
or a literal is specified in the operand of
an instruction,
its address is assembled
into the instruction.
Self-defining terms
are always right-justified; truncation or
padding with zeros if necessary occurs on
the left.

eight-bit mask would consist of
decimal digits.
The maximuITI
hexadecimal term is X' FFFFFF'.

two hexavalue of a

The hexadecima 1 digits
patterns are as follows:

their

0- 0000
1- 0001
2- 0010
3- 0011

8- 1000

S- alOl

9- 1001
A- 1010
B- 1011

6- 0110
7- 0111

bit

C- 1100
D- 1101
E- 1110
F- 1111

A table for converting frow hexadecimal
representation to decimal representation is
provided in Appendix B.
Binary Self-Defin~Term: A binary selfdefining term is written as an unsigned
sequence
of
ls
and
as enclosed in
apostrophes and preceded by the letter D,
as follows:
B'10001101'. This term would
appear in storage as shown,
occupying one
byte.
A binary term may have up to 24 bits
represented.
Binary representation is used primarily
in designating bit patterns of masks or in
logical operations.
The following example illustrates
a
binary term used as a mask in a Test Under
Mask (TM)
instruction.
The contents of
GAMMA are to be tested, bit by bit, against
the pattern of bits represented by the
binary term.

r-------T-----------T---------------------,
IName

Decimal Self-Defining Term:
A
decimal
self-defining term is simply an unsigned
decimal number written as a sequence of
decimal digits.
High-order zeros may be
used (e.g., 007).
Limitations on the value
of the term depend on its use.
For example, a decimal term that designates a
general
register
should have a value
between a and 15; one that represents an
address should not exceed the size of
storage.
In any case, a decimal term may
not consist of more than eight digits, or
exceed 16,777,215 (2 24 -1). A decimal selfdefining term is assembled as its binary
equivalent.
Some examples of decimal selfdefining tenT'S are:
8,
147,
4092,
and
00021.

4- 0100

ano

I Operation

I operand

I

t-------+-----------+---------------------~

IALPHA
L
_______ LITM
___________ LIGA~MA,B'10101101'
_____________________ JI

Character Self-Defining Term: A character
self-defining term consists of one to three
characters enclosed by apostrophes.
It.
must be preceded by the letter C.
All
letters, decimal digits, and special characters may be used in a character term.
In
addition, any of the remainder of the 256
punch combinations may be designated in a
character self-defining term.
Examples of
character self-defining terms are as follows:
C'/'
C'ABC'

C'
(blank)
C'13'

Hexadecimal Self-defining Term: A hexadecimal self-defining term consists of one
to six hexadecimal digits enclosed by
apostrophes and preceded by the letter X:
X'C49' .

Because of the use of apostrophes in the
assembler language and ampersands in the
macro language as syntactic characters, the
following rule must be observed when using
these characters in a character term.

Each hexadecimal digit is assembled as
its four-bit binary equivalent. Thus, a
hexadecintal
term used to represent an

For each apostrophe or ampersand desired
in a character self-defining term, two
apostrophes or ampersands must be written.
For example, the character value A'# would

Section 2:

General Information

13

be written as rAI'N I , while an apostrophe
followed by a blank and another singl~
apostrophe would be written as I I I I I I
Each character in the character sequence
is assembled as its eight-bit code equivalent (see Appendix A). The two apostrophes
or ampersands that must be used to represent an apostr6phe or ampersand within
the character sequence are assembled as an
apostrophe or ampersand.

Location Counter Reference
The Location Counter: A location counter
is- used to a:3sign storage addresses to
progran. statements.
It is the assemblerls
equivalent of the instruction counter in
the computer. As each machine instruction
or data area is assembled, the location
counter is first adjusted to the proper
boundary for the item, if adjustment is
necessary, and then incremented by the
length of the assembled item.
Thus, it
always points to the next available location.
If the statement is named by a
symbol, the value attribute of the symbol
is the value of the location counter after
boundary adjustment, but before addition of
t:.he length.
Th~
assembler n~intains
a
location
counter for each control section of the
prograffi
and
manipulates each location
counter as previously described.
Source
statements for each section are assigned
addresses from the location counter for
that section.
The location counter for
each successively declared control section
assigns locations in consecutively higher
areas of storage. Thus, if a program has
multiple control sections, all statements
iJentified as belonging to the first control section will be assigned from the
location counter for section 1, the statements for the second contrel section will
be assigned from the location counter for
section 2, etc. This procedure is followed
whether the statements from different control sections are interspersed or written
in control section sequence.

The location counter setting can be
controlled by using the START and ORG
assembler instructions, which are described
in Sections 3 and 5. The counter affected
by either of these assembler instructions
is the counter for the control section in
which they appear. The maximum value for
the location counter is 224-1.
The programmer may refer to the current
value of the location counter at any place
in a program by using an asterisk as a term

l4

in an operand. The asterisk represents the
location of the first byte of currently
available storage (i.e., after any required
boundary adjustment). Using an asterisk as
the operand in a machine-instruction statement is the same as placing a symbol in the
name field of the statement and then using
that symbol as an operand of the statement.
Because a location counter is maintained
for each control section, a location counter reference deSignates the location counter for the section in which the reference
appears.
A reference to the location counter may
be made in a literal address constant
(i.e., the asterisk may be used in an
address
constant
specified in literal
form).
The address of the instruction
containing the literal is used for the
value of the location counter. A location
counter reference may not be used in a
statement which requires the use of a
predefined symbol, with the exception of
the EQU and ORG assembler instructions.
Literals
A literal term is one of three basic
ways to introduce data into a program. It
is simply a constant preceded by an equal
sign (=).
A literal represents data rather than a
reference to data.
The appearance of a
literal in a statement directs the assembler program to assemble the data specified
by the literal, store this data in a
"literal pool," and place the address ?f
the storage field containing the data 1n
the operand field of the assembled statement.
Literals provide a means of entering
constants (Buch as numbers for calculation,
addresses, indexing factors, or words or
phrases for printing out a message) into a
program by specifying the constant in the
operand of the instruction in which it is
used.
This is in contrast to using the DC
assembler instruction to enter the data
into the program and then using the name of
the DC instruction in the operand. Only
one
literal is allowed in a machineinstruction statement.
A literal term cannot be combined with
any other terms.
A literal cannot be used as the receiving field of an instruction that modifies
storage.
A literal cannot be specified in a shift
instruction or an I/O instruction (HIO, HDV,
TIO, SIO, SlOP).

When a literal is contained in an instruction, it cannot specify an explicit
base register or an explicit index register.
A literal cannot be specified in an address constant (see Section 5, DC--Define
Constant) .
The instruction coded below shows one
use of a literal.

r-------T-----------T---------------------,
IName

I Operation

IOperand

I

~-------+-----------+---------------------~

ILGAMMA
L
110,
=F' 274'
_______ I ___________
_____________________
JI
~

~

The statement GAMMA is a load instruction using a literal as the second operand.
When assembled,
the second operand of the
instruction will be the address at which
the value F'274' is stored.
NOTE: If a literal operand is a selfdefining term (X,C,B, or decimal) and the
equal sign (=) is omitted, the statement
may assemble without error (See "Using
Self-Defining Terms") .
In general, literals can be used wherever a storage address is permitted as an operand. They cannot, however, be used in
any assembler instruction that requires the
use of a previously defined symbol. Literals are considered relocatable, because the
address of the literal, rather than the
literal itself, will be assembled in the
statement that employs a literal.
The
assembler generates the literals, collects
them, and places them in a specific area of
storage, as explained in the subsection
"The Literal Pool." A literal is not to be
confused with the immediate data in an SI
instruction.
Immediate data is assembled
into the instruction.
Literal Format: The assembler requires a
description of the type of literal being
specified as well as the literal itself.
This descriptive information assists the
assembler in assembling the literal correctly.
The descriptive portion of the
literal must indicate the format of the
constant.
It may also specify the length
of the constant.

Some examples of literals are:
=A(BETA)
=F'1234'
=C'ABC'

The Literal Pool: The literals processed
by the assembler are collected and placed
in a special area called the literal pool,
and the location of the literal# rather
than the literal itself, is assembled in
the statement employing a literal.
The
positioning of the literal pool may be
controlled by the prograwner, if he so
desires.
Unless otherwise specified, the
literal pool is placed at the end of the
first control section.
The programmer may also specify that
multiple literal pools be created.
However, the sequence in which literals are
ordered within the pool is controlled by
the assembler.
Further information
on
positioning the literal pool(s) is in Section 5 under "LTORG--Begin Literal Pool."
Symbol Length Attribute Reference
The length attribute of a symbol may be
used as a term. Reference to the attribute
is made by coding L' followed by the
3ymbol, as in:
L'BETA
The length attribute of BETA will be
substituted for the term. The use of the
length attribute of a symbol defined with
a DC or DS with explicit length given by
an expression is invalid. The following
example illustrates the use of L'symbol
in moving a character constant into either
the high-order or low-order end of a
storage field.
For ease in following the example, the
length attributes of Al and B2 are mentioned. However, keep in mind that the
L'symbol term makes coding such as this
possible in situations where lengths are
unknown.

r-------T-----------V---------------------,
IName

The method of describing and specifying
a constant as a literal is nearly identical
to the method of specifying it in the
operand of a DC assembler instruction. The
major difference is that the literal must
start with an equal sign (=), which indicates to the assembler that a literal
follows.
The reader is referred to the
discussion of the DC assembler instruction
operand format 
J:ants -- E, D, _a~d L: A floating-point constant is written as a decimal number. As an option a decimal exponent may follow. The number may be an integer, a fraction, or a mixed number (i.e., one with integral and fractional portions). The format of the constant is as follows: SHORT FLOATING POINT NUMBER (E) o 7 8 31 LONG FLOATING POINT NUMBER (D) J 56 AIT FRACTION o 7 8 63 EXTENDED FLOATING POINT NUMBER (Ll HIGH ORDER HALF OF 112 BIT FRACTION 63 LOW ORDER HALF OF 112 BIT FRACTION 7 8 Figure 5-5. 1. 2. 63 Floating-Point External Formats The number is written as a signed or unsigned decimal value. The decimal point can be placed before, within, or after the number. If it is omitted, the number is assumed to be an integer. A positive sign is assumed if an unsigned number is specified. The exponent is optional. If specified, it is written immediately after the number as En, wbere n is an optionally signed decimal value specifying the exponent of the factor 10. If an unsigned exponent is specified, a plus sign is assumed. The range of the exponent is explained under "Exponent Modifier" above. The external format for a floating-point number has two parts: the portion containing the exponent, which is sometimes called the characteristic, followed by the portion containing the fraction, which is sometimes called the mantissa. Therefore, the number specified as a floating-point constant must be converted to a fraction before it can be translated into the proper format. Figure 5-5 shows the external format of the three types of floating-point constants. The type L constant resembles two contiguous type D constants. In the type L constant the sign of the second double word is the same as the sign of the first. The characteristic of the second double word is equal to the characteristic of the first minus 14, modulo 128. For information on use of the type I, constant see the OS Assembler (F) Programmer's Guide. For example, the constant 27.35E2 represents the number 27.35 times 10 to the 2nd. Represented as a fraction, it would be .2735 times 10 to the 4th, the exponent having been modified to reflect the shifting of the decimal point. The exponent may also be affected by the presence of an exponent modifier, as explained under "Operand Subfield 3: Modifiers." Thus, the exponent is also altered before being translated into machine format. In machine format a floating-point number also has two parts, the signed exponent and signed fraction. The quantity expressed by this number is the product of the fraction and the number 16 raised to the power of the exponent. The exponent is translated into its binary equivalent in excess 64 binary notation and the fraction is converted to a binary number. Scaling is performed if specified; if not, the fraction is normalized (leading hexadecimal zeros are removed). Rounding of the fraction is then performed according to the specified or implied length, and the number is stored in the proper field. The resulting number will not differ from the exact value by more than one in the last place. Within the portion of the floatingpoint field allocated to the fraction, the hexadecimal point is assumed to be to the left of the leftmost hexadecimal digit, Gnd the fraction occupies the leftmost portion of the f.ield. Negative fractions are carried in true representation, not in the twos complement form. section 5: Assembler Instruction Statements 45 An implied length of four bytes is assumed for a short (E) constant and eight bytes for a long (D) constant. An implied length of 16 bytes is assumed for an extended (L) constant. The constant is aligned at the proper word (E) or double word (D and L) boundary if a length is not specified. However, any length up to and including eight bytes (E and D) or 16 bytes (L) can be specified by a length modifier. In this case, no boundary alignment occurs. Any of the following statements could be used to specify 46.415 as a positive, full-word, floating-point constant; the last is a machine-instruction statement with a literal operand. Note that the last two constants contain an exponent modifier. r------T-----------T----------------------, IName IOperation IOperand I .------+-----------+----------------------~ I I I I I I DC IE' 46. 415 ' I IE'46415E-3' I IE'+464.15F.-1' I IF'+.46415E+2' I I EE2' .46415' I Il ______ LI AE 6 , =EF 2 ' • 4 6 41 5 ' ___________ I ______________________ JI IDC IDC IDC I DC ~ The following would each be generated as double-word floating-point constants. If zoned decimal format is specified (Z), each decimal digit is translated into one byte. Tne translation is done according to the character set shown in Appendix A. The rightmost byte contains the sign as well as the rightmost digit. For packed decimal format (P), each pair of decimal digits is translated into one byte. The rightmost digit and the sign are translated into the rightmost byte. The bit configuration for the digits is identical to the configurations for the hexadecimal digits 0-9 as shown in Section 3 under "Hexadecimal Self-Defining Value." For both packed and zoned decimals, a plus sign is translated into the hexadecimal digit C, and a minus sign into the digit D. If an even number of packed decimal digits is specified, one digit will be left unpaired because the rightmost digit is paired with the sign. Therefore, in the leftmost byte, the leftmost four bits will be set to zeros and the rightmost four bits will contain the odd (first) digit. If no length modifier is given, the implied length for either constant is the number of bytes the constant occupies (taking into account the format~ sign, and possible addition of zero bits for packed decimals). If a length modifier is given, the constant is handled as follows: r-------T-----------T---------------------, IName I Operation I Operand I 1. If the constant requires fewer bytes than the length specifies, the necessary number of bytes is added to the left. For zoned decimal format, the decimal digit zero is placed in each added byte. For packed decimals, the bits of each added byte are set to zero. 2. If the constant requires more bytes than the length specifies~ the necessary number of leftmost digits or pa1rs of digits is dropped, depending on which format is specified. .-------+-----------+---------------------~ FLO AT LI ___________ DC + 4 ' + 4 6 , - 3. 7 29 , + 473' JI lI _______ LIDE _____________________ Decimal Constants -- P and Z: A decimal constant is written as a signed or unsigned decimal value. If the sign is omit.ted, a plus sign is assumed. The decimal point may be written wherever desired or may be omitted. Scaling and exponent modifiers may not. be specified f or decimal constants. The maximum length of a decimal constant is 16 bytes. No word boundary alignment is perforll·ed. The placement of a decin',al point in the definition does not affect the assembly of the constdnt in any way, because, unlike fixed-point and floating-point constants, a decimal constant is not converted to its binary equivalent. The fact that a decimal constant is an integer, a fraction, or a mixed number is not pertinent to its generation. Furtherlliore, the decimal point is not assembled into the constant. The programmer may determine proper decimal point alignment either by defining his data so that the point is aligned or by selecting machine-instructions that will operate on the data properly (i.e., shift it for purposes of alignment). 46 Examples of decimal constant definitions follow. r------T-----------T----------------------, I Name I Operation I Operand I ~------+-----------+----------------------~ I I I I I DC I P , +1 . 25 ' I I Z ' - 543 I I IDC IZ'79.68' I I DC L 3 ' 79 • 68 ' ___________ LI P______________________ JI I DC L------~ The following statement specifies both packed and zoned decimal constants. The length modifier applies to each constant in the first operand (i.e., to each packed decimal constant). Note that a literal could not specify both operands. r----------T-----------T------------------, I Name I Operation I Operand I .----------+-----------+------------------~ I DECIMALS IDC IPL8'+25.8,-3874, I IL__________ I ___________ 1+2.3',Z'+80,-3.72'1 __________________ J ~ ~ The last example illustrates the use a packed decimal literal. of r------T-----------T----------------------, I Name I Operation I Operand I .------+-----------+----------------------~ I ______ L IUNPK , +25' ___________ I OUTAREA,=PL2 ______________________ JI ~ value of the expression may be 2 31 -1. The value is then truncated on the left, if necessary, to the specified or implied length of the field and assembled into the rightmost bits of the field. The implied length of an A-type constant is four bytes" and alignment is to a full-word boundary unless a length is specified, in which case no alignment will occur. The length that may be specified depends on the type of expression used for the constant; a length of .1 to 4 bytes may be used for an absolute expression, while a length of only 3 or 4 may be used for a relocatable or complex relocatable expression. ~ Address Constants: An address constant is a storage address that is translated into a constant. Address constants can be used for initializing base registers to facilitate the addressing of storage. Furthermore r they provide a means of communicating between control sections of a multisection program. However, storage addressing and control section communication are also dependent on the use of the USING assembler instruction and the loading of registers. Coding examples that illustrate these considerations are provided in Section 3 using "Programming with the USING Instruction." In the following examples, the field generated from the statement named ACON contains four constants, each of which occupies four bytes. Note that there is a location counter reference in one. The value of the location counter will be the ~ddress of the first byte allocated to the fourth constant. The second statement shows the same set of constants specified as literals (i.e., address constant literals) • ~----i------T-------------------------------) 1 1 Oper- 1 1 I 1 1 1 a tion 1L Operand 1L Name ____ J1_______ _______________________________ 11 1 I 1 An address constant, unlike other types of constants, is enclosed in parentheses. If two or more address constants are specified in an operand, they are separated by commas, and the entire sequence is enclosed by parentheses. There are five types of address constants: A, Y, S, Q and V. A relocatable address constant may not be specified with bit lengths. complex Relocatable Expressions: A complex relocatable expression can only be used to specify an A-type or Y-type address constant. These expressions contain two or more unpaired relocatable terms and/or negative relocatable terms in addition to any absolute or paired relocatable terms that may be present. A complex relocatable expression might consist of extern~l symbols and designate an address in an independent assembly that is to be linked and loaded with the assembly containing the address constant. A-Type Address Constant: This constant is specified as an absolute, relocatable, or complex relocatable expression. (Remember that an expression may be single term or multiterm.) The value of the expression is calculated to 32 bits as explained in Section 2 with one exception: the maximum 1 ACONI DC I I . I IA(I08,LOP,END-STRT,*+4096) : 1 I :I- ____ :- LM l4,7,=A(108,LOP,END-STRT,*+4096)1 ______ 1- __________ - - - __ - - - __ - - __ --_----.1 .~ Note: When the location counter reference occurs in a literal, as in the LM instruction above, the value of the location counter is the address of the first byte of the instruction. Y-Type Address constant: A Y-type address constant has much in conunon with the A-type constant. It too is specified as an absolute, relocatable, or complex relocatable expression. The value of the expression is also calculated to 32 bits as explained in Section 2. However, the maximum value of the expression may be only 2 15 -1. The value is then truncated, if necessary, to the specified or implied length of the field and assembled into the right-most bits of the field. The implied length of a y-type constant is two bytes, and alignment is to a half-word boundary unless a length is specified, in which case no alignment will occur. The maximum length of a Y-type address constant is two bytes. If length specification is used, a length of two bytes may be designated for a relocatable or complex expression and .1 to 2 bytes for an absolute expression. . ; . 1 ,.,) cr. .. ... Section 5: - 1. ~ ... .t: . .l. ,ltl .,. • I.' Assembler Instruction Statements 47 Warning: Specification of relocatable Ytype address constants should be avoided in programs destined to be executed on machines having more than 32,767 bytes of storage capacity. In any case Y-type relocatable address constants should not be used in programs to be executed under Operating System/360 control. Address Constant: The S-type address constant is used to store an address in base-displacement form. ~-Type The ways: constant may be specified in two 1. As an absolute or relocatable sion, e.g., S(BETA). expres- 2. As two absolute expressions, the first of which represents the displacement value and the second, the base register, e.g." S(400(13». The address value represented by the expression in (1) will be converted by the assembler into the proper base register and displacement value. An S-type constant is assembled as a half word and aligned on a half-word boundary. The leftmost four bits of the assembled constant represents the base register designation, the remaining 12 bits the displacement value. If length specification is used, only two bytes may be specified. S-type address constants may not be specified as literals. V~!YQe Address Constant: This constant is used to reserve storage for the address of an external symbol that is used for effecting branches to other programs. The constant may not be used for external data references within an overlay program. The constant is specified as one relocatable symbol, which need not be identified by an EXTRN statement. Whatever symbol is used is assumed to be an external symbol by virtue of the fact that it is supplied in a V-type address constant. To suppress the automatic library call mechanism of the linkage editor for a constant identified in a V-type address constant, the programmer can identify it in a WXTRN statement (Assembler F only). Note that specifying a symbol as the operand of a V-type constant does not constitute a definition of the symbol for this assembly. The implied length of a V-type address constant is four bytes, and boundary alignment is to a full word. A length modifier may be used to specify a length of either three or four bytes, in which case no such boundary alignment occurs. In the following example, 12 bytes will be reserved, because there are three symbols. The value of each assembled constant will be zero until the program is loaded. It must be emphasized that a Vtype address constant of length less than 4 can and will be processed by the Assembler but cannot be handled by the Linkage Editor. r--------T-----------T--------------------1 I Name ~-Type Address Constant (Assembler F only): This constant is used to reserve storage for the offset of an external dummy section. This offset is added to the address of the block of storage allocated t,o external dUmmy sections to access the desired section. The constant is specified as a relocatable symbol which has been previously defined in a DXD or DSECT statement. The implied length of a Q-type address constant is four bytes and boundary alignment is to a full word; a length of 1-4 bytes may be specified. No bit length specification is permitted in a Q-type constant. In the following example the constant VALUE has been previously defined in a DXD or DSECT statement. To access VALUE the value of A is added to the base address of the block of storage allocated for external dummy sections. Q-·type address constants may not be specified in literals. r--------T-----------T--------------------, I Name IOperation I Operand I ~--------+-----------+--------------------~ IA L ________ 48 IDC ___________ IQ(VALUE) ____________________ JI ~ ~ I Operation I Operand I ~--------+--------~--+--------------------~ I ________ VCONST L I DC (SORT, MERGE, CALC) ___________ I V ____________________ JI ~ ~ DS -- DEFINE STORAGE The DS instruction is used to reserve areas of storage and to assign names to those areas. The use of this instruction is the preferred way of symbolically defining storage for work areas, input/output areas, etc. The size of a storage area that can be reserved by using the DS instruction is limited only by the maximum value of the location counter. r----------T-----------T------------------, I Name I Operation I Operand I ~----------+-----------+------------------~ I Any sym- I DS lOne or more opI I bol or I I erands, separated I I blank I Iby commas,writI Iten in the forI I I I I Imat described in I Ithe following I I I IL__________ LI ___________ I __________________ text JI ~ The format of the DS operand is identical to that of the DC operand; exactly the same subfields are employed and are written in exactly the same sequence as they are in the DC operand. Although the formats are identical, there are two differences in the specification of subfields. They are: 1. 2. The specification of data (subfield 4) is optional in a DS operand, but it is mandatory in a DC operand. If the constant is specified, it must be valid. The maximum length that may be specified for character (C) and hexadecimal (X) field types is 65,535 bytes rather than 256 bytes. If a DS operand specifies a constant in subfield 4, and no length is specified in subfield 3, the assembler determines the length of the data and reserves the appropriate amount of storage. It does not assemble the constant. The ability to specify data and have the assembler calculate the storage area that would be required for such data is a convenience to the programmer. If he knows the general format of the data that will be placed in the storage area during program execution, all he needs to do is show it as the fourth subfield in a DS operand. The assembler then determines the correct amount of storage to be reserved, thus relieving the programmer of length considerations. If the DS instruction is named by a symbol, its value attribute is the location of the leftmost byte of the reserved aFea. The length attribute of the symbol is the length (implied or explicit) of the type of data specified. Should the DS have a series of operands, the length attribute for the symbol is developed from the first item in the first operand. Any positioning required for aligning the storage area to the proper type of boundary is done before the address value is determined. Bytes skipped for alignment are not set t.o zero. Each field type (e.g., hexadecimal, character, floating-point) is associated with certain characteristics (these are summarized in Appendix F). The associated characteristics will determine which fieldtype code the programmer selects for the DS operand and what other information he adds, notably a length specification or a duplication factor. For example, the E floating-point field and the F fixed-point field both have an implied length of four bytes. The leftmost byte is aligned to a full-word boundary. Thus, either code could be specified if it were desired to reserve four bytes of storage aligned to a full-word boundary. To obtain a length of eight bytes, one could specify either the E or F field type with a length modifier of eight. However, a duplication factor would have to be used to reserve a larger area, because the maximum length specification for either type is eight bytes. Note also t.hat specifying length would cancel any special boundary alignment. In contrast, packed and zoned decimal (P and Z), character (C), hexadecimal (X), and binary (B) fields have an implied length of one byte. Any of these codes, if used, would have to be accompanied by a length modifier, unless just one byte is to be reserved. Although no alignment occurs, the use of C and X field types permits greater latitude in length specifications, the maximum for either type being 65,535 bytes. (Note that this differs from the maximum for these types in a DC instruction.) Unless a field of one byte is desired, either the length must be specified for the C, X, P, Z, or B field types, or else the data must be specified (as the fourth subfield), so that the assembler can calculate the length. To define four la-byte fields and one lOa-byte field, the respective DS statements might be as follows: Section 5: Assembler Instruction Statements 49 r------T-----------T----------------------, IFIELD IDS 1 4 CL10 I lI AREA ______ LI DS ___________ LI CL100 ______________________ JI DEFINING FIELDS OF AN AREA: A DS instruction with a duplication factor of zero can be used to assign a name to an area of storage without actually reserving the area. Additional DS and/or DC instructions may then be used to reserve the area and assign names to fields within the area (and generate constants if DC is used). Although FIELD might have been specified as one 40-byte field, the preceding definition has thE~ advantage of providing FIELD with a length attribute of 10. This would be pertinent when using FIELD as an SS machine-instruction operand. For example, assume that SO-character records are to be read into an area for processing and that each record has the following format: Additional examples of OS statements are shown below: Positions Positions Positions Positions Positions I Name I Operation I Operand I ~------+-----------+----------------------~ r-----T---------T-------------------------, IName IOperationlOperand I ~-----+---------+-------------------------~ lONE IDS ICL80(one 80-byte field, I I I I length attribute of 80 I I TWO IDS 180C(80 one-byte fields, I I I I length attribute of one I ITHREEIDS 16F(six full words, length I I I I attribute of four) I I1i'OUR IDS ID(one double word, lengthl I I I attribute of eight) I IFIVE IDS 1 4H(four half-words, I I I I length attribute of I Il _____ LI _________ LI _________________________ two) JI Note: A DS statement causes the storage area to be reserved but not set to zeros. No assumption should be made as to the contents of the reserved area. 5-10 11-30 31-36 47-54 55-62 Payroll Number Employee Name Date Gross Wages Withholding Tax The following example illustrates how DS instructions might be used to assign a name to the record area, then define the fields of the area and allocate the storage for them. Note that the first statement names the entire area by defining the symbol RDAREAi the statement gives RDAREA a length attribute of 80 bytes, but does not reserve any storage. Simi larl y., the fifth statement names a six-byte area by defining the symbol DATE; the three subsequent statements actually define the fields of DATE and allocate storage for them. The second, ninth, and last statements are used for spacing purposes and, therefore, are not named. r-------T-----------T---------------------, IName I Operation I Operand I ~-------+-----------+---------------------i QEecial Uses of the Duplication Factor I9RCING ALIGNMENT: The location counter can be forced to a double-word, full-word, or half-word boundary by using the appropriate field type (e.g., D, F, or H) with a duplication factor of zero. This method may be used to obtain boundary alignment that. otherwise would not be provided. For example, the following statem€mts would set the location counter to the nE~xt double-word boundary and then reserVe storage space for a 128-byte field (whose l€~ftmost byte would be on a double-word boundary). r-----T-----------T-----------------------, IName IOperation I Operand I ~-----+-----------+-----------------------i I IDS 10D I lIAREA _____ LIDS ___________ LI CL128 _______________________ JI 50 IRDAREA IDS OCL80 I IDS CL4 IPAYNO IDS CL6 I NAME IDS CL20 I DATE IDS OCL6 I DAY IDS CL2 I MONTH IDS CL2 I YEAR IDS CL2 I IDS CL10 I GHOSS IDS CL8 IFEDTAX IDS CL8 Il _______ LIDS CL1S ___________ L ____________________ _ CCW -- DEFINE CHANNEL COMMAND WORD The CCW instruction provides a convenient way to define and generate an eightbyte channel command word aligned at a double-word boundary. CCW will cause any bytes skipped to be zeroed. The internal machine format of a channel corrmand word is shown in Table 5-1. Table 5-1. Channel Command Word r-----T-------T---------------------------, I Usage 1 32-35 0100 36-39 1000 IByte I Bits ~-----+-------+---------------------------~ I Command code I 8-31 I Data address 1 32-36 1 Flags 1 I 37-39 I Must be zero 1 16 40-47 I Set to zero I 17-8 48-63 I ___________________________ Count L_____ I _______ JI 11 12-4 15 I 0-7 1 I 1 I ~ If there is a symbol in the name field of the CCW instruction, it is assigned the address value of the leftmost byte of the channel command word. The length attribute of the symbol is 8. ~ format The statement is: of the CCW instruction r--------T---------T----------------------, IName I operation I Operand I ~--------+---------+----------------------~ IAny sym-ICcW IFour operands, 1 Ibo1 or 1 Iseparated by commas, 1 Ib1ank 1 Ispecifying the con1 I 1 Itents of the channel 1 I I I command word in 1 1 1 Ithe format 1 I I Idescribed in the 1 1L ________ I _________ Ifo1lowing text ______________________ J1 ~ ~ All four operands must appear. They are written, from left to right, as follows: LISTING CONTROL INSTRUCTIONS The listing control instructions are used to identify an assembly listing and assembly output cards, to provide blank lines in an assembly listing, and to designate how much detail is to be included in an assembly listing. In no case are instructions or constants generated in the object program. Listing control statements with the exception of PRINT are not printed in the listing. NOTE: TITLE, SPACE, and EJECT statements will not appear in the source listing unless the statement is continued onto another card. Then the first card of the statement is printed. However, any of these three types of statements, if generated as macro instruction expansion, will never be listed regardless of continuation. 1. An absolute expression that specifies the command code. This expression's value is right-justified in byte 1. 2. An expression specifying the data address. This value is treated as a 3-byte A-type constant. The value of this expression is in bytes 2-4. TITLE -- IDENTIFY ASSEMBLY OUTPUT An absolute expression that specifies the flags for bits 32-36 and zeros for bits 37-39. The value of this expression is right-justified in byte 5. (Byte 6 is set to zero.) The TITLE instruction enables the programmer to identify the assembly listing and assembly output cards. The format of the TITLE instruction statement is as follows: 3. 4. An absolute expression that specifies the count. The value of this expression is right-justified in bytes 7-8. The following statement: is an example of a CCW ~ r-----T-----------T-----------------------, IOperand I IName 10peration ~-----+-----------+-----------------------~ IL _____ ICCW ___________ 12,READAREA,X'48',80 _______________________ JI ~ r---------r----------r---------------------' I Name : Operation I Operand : ~----_----~----------l---------------------, I Special I TITLE : A sequence of char- I I sequenc~ ~ I acters, enclosed in : I or vari- I I apostrophes I I able sym-I I I I I I I bo1 or I I I ________ __________ L _____________________ I blank! I I ~ Note that the form of the third operand sets bits 37-39 to zero, as required. The bit pattern of this operand is as follows: ~L ~ The name field may contain a special symbol of from one to four alphabetic or numeric characters in any combination. The contents of the name field are punched into columns 73-76 of all the output cards for the program except those produced by the PUNCH and REPRO assembler instructions. Only the first TITLE statement in a program may have a special symbol or a variable symbol in the name field. The name field of all subsequent TITLE statements must contain either a sequence symbol or a blank. Section 5: Assembler Instruction Statements 51 The operand field may contain up to 100 characters enclosed in apostrophes. Special consideration must be given to representing apostrophes and ampersands as characters. Each single apostrophe or ampersand desired as a character in the constant must be represented by a pair of apostrophes or ampersands. Only one apostrophe or ampersand appears in storage. The contents of the operand field are printed at the top of each page of the assembly listing. A program may contain more than one statement. Each TITLE statement provides the heading for pages in t.he assembly listing that follow it, until another TITLE statement is encountered. Each TITLE statement causes the listing to be advanced to a new page (before the heading is printed). ,]~ITLE For example, if the following statement is the first TITLE statement to appear in a program: r------T-----------T----------------------, lName I Operation I Operand I ~------+-----------+----------------------i lIPGM1 ______ I TITLE 'FIRST HEADING' ___________ I ______________________ JI ~ ~ then PGM1 is punched into all of the output cards (columns 73-76) and this heading appears at the top of each subsequent page: PGMI FIRST HEADING. If the following statement occurs later in the same program: r------T~----------T----------------------, I Name I Operation I Operand I ~------+-----------+----------------------i IL______ I TITLE NEW HEADING' ___________ I'A ______________________ JI ~ ~ r---------r----------r--------------------, Name I Operation I Operand I I L---------L----------t--------------------~ I I Not used; should be II A seI EJECT I quence I : blank I I symbol I I I IL or blank JI___________ I ____________________ J I ________ II ~ If the line before the EJECT statement appears at the bottom of a page, the EJECT statement has no effect. Two EJECT statements may be used in succession to obtain a blank page. A TITLE instruction followed immediately by an EJECT instruction will produce a page with nothing but the operand entry (if any) of the TITLE instruction. Text following the EJECT instruction will begin at the top of the next page. SPACE -- SPACE LISTING The SPACE instruction is used to insert one or more blank lines in the listing. The format of the SPACE instruction statement is as follows: r---------r----------T--------------------, Name I Operation I Operand I I l _________ ~----------~--------------------~ : A se: SPACE I quence I : symbol I _________ I or blank IL __________ ~ : A decimal value I or blank : I I I ____________________ I I ~ ~ A decimal value is used to specify the number of blank lines to be inserted in the assembly listing. A blank operand causes one blank line to be inserted. If this value exceeds the number of lines remaining on the listing page, the statement will have the same effect as an EJECT statement. then, PGM1 is still punched into the output cards, but each following page begins with the heading: PGMI A NEW HEADING . .!'igte: The sequence number of the cards in the output deck is contained in columns 77-80. EJECT -- START NEW PAGE PRINT -- PRINT OPTIONAL DATA The PRINT instruction is used to control printing of the assembly listing. The format of the PRINT instruction statement is: r---------r----------T--------------------, The EJECT instruction causes the next line of the listing to appear at the top of a new page. This instruction provides a convenient way to separate routines in the p:rogram listing... The format of the EJECT instruction statement is as follows: 5:2 I Name I Operation I Operand I L _________ ~----------!--------------------~ : A seI PRINT lOne to three I I quence I I operands I I symbol : I : _________ IL or blank I __________ !I ____________________ I ~ ~ The one to three operands may include an operand from each of the following groups in any sequence: 1. 2. - A listing is printed. OFF - No listing is printed. GEN - All statements generated by macro-instructions are printed. NOGEN - Statements generated by macroinstructions are not printed with the exception of MNOTE which will print regardless of NOGEN. However, the macroinstruction itself will appear in the listing. Constants are printed out full in the listing. .------+---~-------+----------------------~ Il ______ I ___________ PRINT I ______________________ NODATA JI ~ ON DATA 3. r------T-----------T----------------------, IName I Operation IOperand I ~ is the last PRINT statement to appear before the DC statement; only eight bytes of zeros are printed in the assembly listing. Whenever an operand is omitted, it is assumed to be unchanged and continues according to its last specification. The hierarchy ments is: of 1. ON and OFF 2. GEN and NOGEN 3. DATA and NODATA print control state- in NODATA - Only the leftmost eight bytes are printed on the listing. A program may contain any number of PRINT statements. A PRINT statement controls the printing of the assembly listing until another PRINT statement is encountered. Each option remains in effect until the corresponding opposite option is specified. Until the first PRINT statement (if any) is encountered, the following is assumed: r------T-----------T----------------------, I Name I Operation I Operand I Thus with the following would be printed. statement nothing r------T-----------T----------------------, I Operation IOperand I I Name .------+-----------+----------------------~ I l ______ I ___________ PRINT IOFF, DATA, GEN ______________________ JI ~ PROGRAM CONTROL ~ INSTRUCT!Q~e ~------+-----------+----------------------~ lI ______ I ___________ PRINT I ______________________ OR, NODATA.,GEN JI ~ ~ For example, if the statement: r------T-----------T----------------------, I Operation I Operand I I Name ~------+-----------+----------------------~ Il ______ I DC 00' ___________ I XL256' ______________________ JI ~ appears in a are assembled. ~ The program control instructions are used to specify the end of an assembly, to set the location counter to a value or word boundary, to insert previously written coding in the program, to specify the placement of literals in storage, to check the sequence of input cards, to indicate statement format, and to punch a card. Except for the CNOP and COpy instructions, none of these assembler instructions generate instructions or constants in the object program. program" 256 bytes of zeros If the statement: r------T-----------T----------------------, I Operation I Operand I I Name ICTL -- INPUT FORMAT CONTROL ~------+-----------+----------------------~ Il ______ I PRINT DATA ___________ I ______________________ JI ~ ~ is the last PRINT statement to appear before the DC statement, all 256 bytes of zeros are printed in the assembly listing. However, if: The ICTL instruction allows the programmer to alter the normal format of his source program statements. The ICTL statement must precede all other statements in the source program and may be used only once. The format of the ICTL instruction statement is as follows: Section 5: Assembler Instruction Statements 53 r-------T-----------T---------------------, I Name I Operation I Operand I ~-------+-----------+-------~-------------~ IBlank IICTL Il~3.dec1mal self-de- I If1n1ng values of the I I I l _______ ~ ___________ ~!Qf~_E~~~2 ___________ J Operand b specifies the begin column of the source statement. It must always be specified, and must be within 1-40, inclusive. Operand e specifies the end column of the source statement. The end column, when specified, must be within 41-80, inclusive; when not specified, it is assumed 1:0 be 71. The end column must not be less than the begin column +5. The column after the end column is used to indicate whether the next card is a continuation card. Operand c specifies the continue column of the source statement. The continue column, when specified, must be within 2-40 and must be greater than b. If the continue column is not specified, or if column 80 is specified as the end column, the assembler assumes that there are no continuation cards, and all statements are contained on a single card. The operand forms b"c and h, are invalid. The operands 1 and r, respectively, specify the leftmost and rightmost columns of the field in'" the input cards to be checked. Operand r must be equal to or greater than operand 1. Columns to be checked must not be between the begin and end columns. Sequence checking begins with the first card following the ISEQ statement. Comparison of adjacent cards makes use of the eight-bit internal collating sequence. Each card checked must be higher than the preceding card. An ISEQ statement with a blank operand terminates the operation. (Note that this ISEQ statement is also sequence checked.) Checking may be resumed with another ISEQ statement. Sequence checking is only performed on statements contained in the source program. Statements inserted by the COpy assemblerinstruction or generated by a macroinstruction are not checked for sequence. Also macro-definitions in a macro library are not checked. PUNCH -- PUNCH A CARD If no ICTL statement is used in the source program~ the assembler assumes that 1, 71, and 16 are the begin, end, and continue columns, respectively. The next example designates the begin column as column 25. Since the end column is not specified, it is assumed to be column 71. No continuation cards are recognized because the continue column is not specified. r------T-----------T----------------------,1 I Name I Operation 1Operand ~------+-----------+----------------------i 1 ICTL 125 L ______ 1___________ ______________________ JI ~ r-------T-----------T---------------------, I Name IOperation IOperand I .-------+-----------+---------------------i I A se- I PUNCH 11 to 80 characters I 1 quence I f symbol I I enclosed in apos1trophes I: I 1 IL ~~ank _____ __1___ ______________________________ JI ~ ISEQ -- INPUT SEQUENCE CHECKING The ISEQ instruction is used to check the sequence of input cards. (A sequence error is considered serious, but the assembly is not terminated.) The format of the ISEQ instruction statement is as follows: r-----T----------T------------------------, IName IOperation IOperand 1 ~-----+----------+-------7----------------i I Blankl ISEQ 1~o . declInal self-deI 1 1f1n1ng values of the I I l _____ ~ ___________ ~fQ!UL!.L!1._Q!_!2!~!:!~ ______ J 54 The PUNCH assembler-instruction causes the data in the operand to be punched into a card. One PUNCH statement produces one punched card. As many PUNCH statements may be used as are necessary. The format is: Using character representation, the operand is written as a string of up to 80 characters enclosed in apos"trophes. All characters, including blank, are valid. The position immediately to the right of the left apostrophe is regarded as column one of the card to be punched. Substitution is performed for variable symbols in the operand. Special consideration must be given to representing apostrophes and ampersands as characters. Each apostrophe or ampersand desired as a character in the constant must be represented by a pair of apostrophes or ampersands. Only one apostrophe or ampersand appears in storage. PUNCH statements may occur anywhere within a program, except before macro definitions. They may occur within a macro definition but not between the end of a macro definition and the beginning of the next macro definition. If a PUNCH statement occurs before the first control section, the resultant card will precede all other cards in the object program card deck; otherwise the card will be punched in place. No sequence number or identification is punched in the card. REPRO -- REPRODUCE FOLLOWING CARD The REPRO assembler-instruction causes data on the followinq statement line to be punched into a card. The data is not processed; it is punched in a card, and no substitution is performed for variable symbols. No sequence number or identification is punched on the card. One REPRO instruction produces one punched card. The REPRO instruction may not appear before a macro definition. REPRO statements that occur before all statements composing the first or only control section will punch cards which precede all other cards of the object deck. The format is: r--------,-----------,--------------------, I Operation I Operand I I Name ~--------~-----------1--------------------~ I REPRO I Blank : I quence I I I I symbol I I I : or ____________________ blank: I____________________ JI ~ ~ I A se- The line to be reproduced may contain any combination of up to 80 valid characters. Characters may be entered starting in column 1 and continuing through col unm Column 1 of the line 80 of the line. corresponds to column 1 of the card to be punched. ORG -- SET LOCATION COUNTER The ORG instruction is setting of the location current control section. ORG instruction statement used to alter the counter for the The format of the is: r-------T-----------T---------------------, I Name I Operation I Operand I ~A-se~--+-----------+---------------------~ I IORG I quenbce I I sym 0 l I IA relocatable exI pression or blank I I I The location counter is set to the value of the expression in the operand. If the operand is omitted, the location counter is set to the next available (unused) location for that control section. An ORG statement cannot be used to specify a location below the beginning of the control section in which it appears. The following is invalid if it appears less than 500 bytes from the beginning of the current control section. r------T-----------T----------------------, IName I Operation I Operand I ~------+-----------+----------------------~ I I I I *-500 IL______ LIORG ___________ I ______________________ JI ~ If it is desired to reset the location counter to the next available byte in the current control section, the following statement would be used: r------T-----------T----------------------, IName I Operation IOperand I ~------+-----------+----------------------~ IL______ LIORG ___________ LI _______________ . ______ JI If previous ORG statements have reduced the location counter for the purpose of redefining a portion of the current control section, an ORG statement with an omitted operand can then be used to terminate the effects of such statements and restore the location counter to its highest setting: Note: Through use of the ORG statement two instructions may be given the same location counter values. In such a case the second instruction will not always eliminate the effects of the first instruction. Consider the following example: ADDR B DC A(LOC) ORG i'-4 DC C'BETA' In this example the value of B (BETA) will be destroyed by the relocation of ADDR during linkage editing. I I 1 l ~~ank _______ Il ___________ L ____________________ JI Any symbols in the expression must have been previously defined. The unpaired relocatable symbol must be defined in the same control section in which the ORG statement appears. LTORG -- BEGIN LITERAL POOL The LTORG instruction causes all literals since the previous LTORG (or start of the program) to be assembled at appropriate boundaries starting at the first doubleword boundary following the LTORG statement. If no literals follow the LTORG statement, alignment of the next instruction (which is not a LTORG instruction) will occur. Bytes skipped are not zeroed. The format of the LTORG instruction statement is: Section 5: Assembler Instruction Statements 55 r--------T-----------T--------------------, I Name I Operation I Operand I .--------+-----------+--------------------i I Symbol I LTORG I Not used I lor I blank lI ________ I I I ___________ I ____________________ JI ~ ~ The symbol represents the address of the first byte of the literal pool. It has a length attribute of 1. The literal pool is organized into four segments within which the literals are stored in order of appearance, dependent on the divisibility properties of their object lengths (dup factor times total explicit or implied length). The first segment contains all literals whose object length is a multiple of eight. Those remaining literals with lengths divisible by four are stored in the second segment. The third segment holds the remaining evenlength literals. Any literals left over have odd lengths and are stored in the fourth segment. Since each literal pool begins at a double-word boundary, this guarantees that all segment one literals are double-word, segment two full-word, and segment three half-word aligned, with no space wasted except, possibly, at the pool origin. Literals from the following statement are in the pool, in the segments indicated by the circled numbers, where ® means mUltiple of eight, etc., MVC SH LM IC .AD A(12) ,=3F'I' 3,=H'2' O,3,=2F'l,2' 2,=XLI'I' 2,=0'2' @ ®@ CD ® £p'ecial Addressing Consideration Any literals used after the last LTORG statement in a program are placed at the end of the first control section. If there are no LTORG statements in a program, all literals used in the program are placed at the end of the first control section. In these circumstances the programmer must ensure that the first control section is always addressable. This means that the base address register for the first control section should not be changed through usage in subsequent control sections. If the programmer does not wish to reserve a register for t.his purpose, he may place a L'rORG statement at the end of each control section thereby ensuring that all literals appearing in that section are addressable. 56 Duplicate Literals If duplicate literals occur within the range controlled by one LTORG statement, only one literal is stored. Literals are considered duplicates only if their specifications are identical. A literal will be stored, even if it appears to duplicate another literal, if it is an A-type address constant containing any reference to the location counter. The following examples illustrate how the assembler stores pairs of literals, if the placement of each pair is controlled by the same LTORG statement. X'FO' Both are stored CWO' XL3'O' Both are stored HL3'O' A (*+ 4) Both are stored A(*+4) X'FFFF' Identical; the first is stored X'FFFF' CNOP -- CONDITIONAL NO OPERATION The CNOP instruction allows the programmer to align an instruction at a specific half-word boundary. If any bytes must be skipped in order to align the instruction properly, the assembler ensures an unbroken instruction flow by generating no-operation instructions. This facility is useful in creating calling sequences consisting of a linkage to a subroutine followed by parameters such as channel command words The END instruction terminates the assembly of a program. It may also designate a point in the program or in a separately assembled program to which control may be transferred after the program is loaded. The END instruction must always be the last statement in the source program. A literal may not be used. If an external symbol is used in the expression, the value of the expression must be O. The format of the END instruction statement is as follows: r-------T-----------T---------------------, I Operation 1Operand I ~-------+-----------+---------------------i IBlank lEND IA relocatable ex1 Il _______ I ___________ 1 pression or blank _____________________ JI ~ 513 r-------T-----------T---------------------, IName IOperation lope.rand I ~-------+-----------+---------------------i I NAME ICSECT I I IDS ISOF 1 IAREA I BEGIN IBALR 12,0 1 I IUSING 1*,2 1 I I I END -- END ASSEMBLY I Name The operand specifies the point t~ whi~h control may be transferred when loadl.ng. 1S complete. This point is usually the fl.rst machine-instruction in the program, as shown in the following sequence. ~ I . I . I . I I I I I I 1L _______ LlEND BEGIN ___________ 1_____________________ J1 ~ NOTE: Editing errors in system macro definitions (macro definitions included in a macro library) are discovered when the macro definitions are read from the macro library. This occurs after the END statement has been read. They will therefore be flagged after the END statement. If the programmer does not know which of his system macros caused an error, it is necessary to punch all system macro definitions used in the program, including inner macro definitions, and insert them in the source program as programmer macro definitions, since programmer macro definitions are flagged in-line. To aid in debugging it is advisable to test all macro definitions as programmer macro definitions before incorporating them in the library as system macro definitions. PART II -- THE MACRO LANGUAGE SECTION 6: INTRODUCTION TO THE MACRO LANGUAGE SECTION 7: HOW TO PREPARE MACRO DEFINITIONS SECTION 8: HOW TO WRITE MACRO INSTRUCTIONS SECTION 9: HOW TO WRITE CONDITIONAL ASSEMBLY INSTRUCTIONS SECTION 10: EXTENDED FEATURES OF THE MACRO LANGUAGE SECTION 6: The Operating System/360 macro language is an extension of the Operating System/360 assembler language. It provides a convenient way to generate a desired sequence of assembler language statements many times in one or more programs. The macro-definition is written only once, and a single statement, a macro instruction statement, is written each time a programmer wants to generate the desired sequence of statements. This facility simplifies the coding of programs, reduces the chance of programming errors, and ensures that standard sequences of statements are used to accomplish desired functions. An additional facility, called conditional assembly, allows one to code statements which mayor may not be assembled, depending upon conditions evaluated at assembly time. These conditions are usually tests of values, which may be defined, set, changed, and tested during assembly. The conditional assembly facility may be used without using macro instruction statements. INTRODUCTION TO THE MACRO LANGUAGE THE MACRO DEFINITION macro definition is a set of A statements that provides the assemoler with: (1) the mnemonic operation code and the format of the macro instruction, and (2) the sequence of statements the assembler generates when the macro instruct.ion appears in the source program. Every macro definition consists of a macro definition header statement, a macro instruction prototype statement, one or more model statements, COpy statements, MEXIT, MNOTE, or conditional assembly instructions, and a macro definition trailer statement. The macro definition header and trailer statements indicate to the assembler the beginning and end of a macro definition. The macro instruction prototype statement specifies the mnemonic operation code and the type of the macro instruction. The model statements are used by the assembler to generate the assembler language statements that replace each occurrence of the macro instruction. The COpy statements may be used to copy model statements, MEXIT, MNOTE or conditional assembly instructions from a system library into a macro definition. THE MACRO INSTRUCTION STATEMENT A macro instruction statement (hereafter called a macro instruction) is a source program statement. The assembler generates a sequence of assembler language statements for each occurrence of the same macro instruction. The generated statements are then processed like any other assembler language statement. Macro instructions can be tested by placing them before the assembly cards of a test program. Three types of macro instructions may be written. They are positional, keyword, and mixed-mode macro instructions. Positional macro instructions permit the programmer to write the operands of a macro instruction in a fixed order. Keyword macro instructions permit the programmer to write the operands of a macro instruction in a variable order. Mixed-mode macro instructions permit the programmer to use the features of both positional and keyword macro instructions in the same macro instruction. The MEXIT instruction can be used to terminate processing of a macro definition. The MNOTE instruction can be used to generate an error message when the rules for writing a particular macro instruction are violated. The conditional assembly instructions may be used to vary the sequence of statements generated for each occurrence of a macro instruction. Conditional assembly instructions may also be used outside macro uefinitions, i.e., among the assembler language statements in the program. THE MACRO LIBRARY The same macro definition may be made available to more than one source program by placing the macro definition in the macro library. The macro library is a Section 6: Introduction to the Macro Language 61 collection of macro definitions that can be used by all the a ssenibler la rguage programs in an installation. Once a macro definition has been placed in the macro library it fl1ay be used by writing its corresponding macro instruction 1n a source program. Macro definitions must be in the systew IT'acro library under the same narr:e as the prototype. ThE procedure for placing macro definitions in the macro library is described in the utilities publication. VARYING THE GENERATED STATEN£N'rS Each time a macro instruction appears in the source program it is replaced by the sarre sequence of assembler language statements. Conditional assembly instructions, however, may be used to vary the number and format of the generated statements. SYSTEM AND PROGRAMMER MACRO DEFINITIONS ,A macro definition included in a source deck is called a programmer macro definition. One residinq in a macro library is called a system macro definition. There is no difference in function. If a programmer macro is included in a macro library it becomes a system macro definition, and if a system macro definition is punched and included in a source deck it becomes a programmer macro definition. System and programmer macros will be expanded the same, but syntax errors are handled differently. In programmer macros, error messages are attached to the statements in error. In system macros, however, error messages cannot be associated with the statement in error because these macros are located and edited after the entire source deck has been read. Therefore, the error messages are associated wi 1:h the END statement. VAlUABLE; SYfvlBOLS A variable symbol is a type of symbol that is assigned different values by either the prograrrw.er or the assembler. When the assemnler uses a macro definition to determine what statements are to replace d macro instruction, variable symbols in the model statements are replaced with the values assigned to them. By changing the values assigned to variable symbols the programmer can vary parts of the generated statements. A variable symbol is written as an followed by from one through seven letters and/or digits, the first of which must be a let.ter. E.lsewhere, two ampersands must be used to represent an ampersand. am~ersand Because of the difficulty of finding syntax errors in system macros, a macro definition should be run and "debugged" as a programmer macro before it is placed in a macro library. SYSTEM MACRO INSTRUCTIONS The macro instructions that correspond co macro definitions prepared by IBM -are called system macro instructions. System macro instructions are described in OS Sl~pervisor Services and Macro Instructions, and OS Data Management Macro Instructions. 62 Types of. variable~lbols There are three types of variable symboIs: symbolic pararr'eters, system variable symbols, and SET symbols. 7he SET symbols are further hroken down into SETA symbols, SETB symbols, and SETC symbols. The three types of variable symbols differ in the way they are assigned values. ORGANIZATION OF THIS PAR'I' OF THE PUBLICATION Assigning Values to Variable Symbols SymDolic parameters are assigned values by the programmer each time he writes a macro instruction. System variable symbols are assigned values by tbe assembler ~ach time it processes a macro instruction. Sections 7 and 8 describe the Dasie rules for preparing macro definitions and for writing macrc instructions. SET symbols are assigned values by the programrt:er by means of conditional assembly instructions. Section 9 describes the rules for writing conditional assembly instructions. Global SET Symbols The values assigned to SE~ syrr.bols in one macro definition may be used to vary the statements that appear in other macro definitions. All SET symbols used for this purpose must be defined by the programmer as global SET symbols. All other SET symbols (i.e., those which may be used to vary statements that appear in the same macro definition) must be defined by the programmer as local SET symbols. Local SET symbols and the other variable symbols (that is, symbolic paranleters and system variable symbols) are local variable symbols. Global SF.T symbols are global variable symbols. section 10 describes additional features of the macro language, including rules for defining global SET symbols, preparing keyword and mixed-mode macro definitions, and writing keyword and mixed-~ode macro instructions. Appendix G contains a reference suw.mary of the entire macro language. Examples of the features of the language appear throughout the remainder of the publication. These examples illustrate the use of particular features. HOWEver, they are not meant to show the full versatility of these features. Section 6: Introduction to the Macro Language 63 SECTION 7: A macro definition consists of: 1. A macro definition header statement. 2. A macro instruction ment. 3. 4. HOW TO PRFPARE MACRO DEFINITIONS definition and must be the last statement in every macro definition. The format of this statement is: prototype state- r-------T-----------T---------------------, I Name I Operation I Operand I ~-------+-----------+---------------------~ ~ero or more model statements, COpy statements, MEXIT, MNOTE, or conditional assembly instructions. I A se- I MEND I quence I I symbol I A tor Lblank _______IL___________IL____________________ I macro definition trailer statement. I Blank I I \ I I ~ Except for MEXIT, MNOTE, and conditional assembly instructions, this section of the MACRO INSTRUCTION PROTOTYPE publication describes all of the statements that may be used to prepare macro definitions. The macro instruction prototype stateConditional assembly instructions are ment (hereafter called the prototype described in Section 9. MEXIT and MNOTE statement) specifies the mnemonic operation instructions are described in Section 10. code and the format of all macro instructions that refer to the macro Macro definitions appearing in a source definition. It must be the second stateprogram must appear before all PUNCH and ment of every macro definition. The format REPRO statements and all staT_ements which of this statement is: pertain to the first control section. Specifically, only the listing control instructions (EJ.ECT, PRINT, SPACE, and r------------T----------T-----------------, TITLE), OPSYN, ICTL, and ISEQ instructions, \Name IOperation \Operand \ and comments statements can occur before ~------------+----------+-----------------~ the macro definitions. All but the ICTL \A symbolic \A symbol lOne or more sym- I and OPSYN instruction can appear between \parameter \ Ibolic parameters I macro definitions if there is more than lor blank \ I separated by com-\ IL ____________ \ __________ LImas, or blank one definition in the source program. _________________ J\ Conditional assembly, substitution, and sequence symbols cannot be used in front of or between macro definitions. The symbolic parameters are used in the macro definition to represent the name A macro-definition cannot appear within field and operands of the corresponding a macro definition and the maximum number macro instruction. A description of of continuation cards for a macro definition symbolic parameters appears under "Symbolic statement is two. Parameters" in this section. ~ACRO -- Iv'1ACRO DEFINITION HEADER The name field of the prototype statement may be blank, or it may contain a The macro definition header statement symbolic parameter. indicates the beginning of a macro definition. It must be the first statement The symbol in the operation field is the in every macro definit.ion. The format of mnemonic operation code that must appear in this statement is: all macro instructions that refer to this r-------T-----------T---------------------, macro definition. The mnemonic operation I Name I Operation I Operand I code must not be the Same as the mnemon1C ~-------+-----------+---------------------~ operation code of another macro definition IBlank MACRO I _____________________ Blank L _______ I ___________ JI in the source program or af a machine or assembler instruction as listed in Appendix MEND -- MACRO DEFINITION TRAILER G. ~ ~ ~ The macro definition trailer statement indicates the end of a macro definition. It-can appear only once within a macro The operand field may contain 0 to 200 symbolic parameters separated by commas. If there are no symbolic parameters, comments may not appear. Section 7: How to Prepare Macro Definitions 65 The following is an example of a prototype statement. r-------T-----------T---------------------, I Operation I Operand I I Name ~-------t-- I -&NAME l - -____ --------t---------------------i I ___________ lvlOVE I _____________________ &TO, &FROM JI ~ ~ r--------T-----T------------------------T-' IName IOper-IOperand Comments I I I lationl I NAME 1 I I IOP1 IOPERAND1,OPERAND2,OPERANIXI ' I D 3 THIS IS THE NORMAL IXI I ' STATEMENT FORMAT I I I I ~--------t-----t------------------------t-i ~--------t-----t------------------------t-~ INAME2 I I IOP2 I " ,OPERAND1, THIS IS THE ALIXI IOPERAND2,OPERAND3 TERNAIXI TE STATEMENT !o'ORMAT I I ~--------t-----t------------------------t-~ §'J::9-tement Format I NAME 3 IOP3 IOPERAND1, THIS IS A COMBIXI I I IOPERAND2,OPERAND3,OPERANIXI 'ID4,OPERAND5 INATION OF IXI I BOTH STATEMENT FORMATS I I lI ________ I _____ I ________________________ ~ The prototype statement may be written in a format different from that used for assembler language statements. The normal format is described in Part I of this publication. The alternate format described here allows the programmer to write an operand on each line, and allows the interspersing of operands and comments in the statement. In the alternate format, as in the normal format, the name and operation fields must appear on the first line of the statement, and at least one blank must follow the operation field on that line. Bo·th types of sta tement formats may be used in the same prototype statement. The rules for using the alternate statement format are: 1. If an operand is followed by a comma and a blank, and the column after the end column contains a nonblank character, the operand field may be continued on the next line starting in the continue column. More than one operand may appear on the same line. 2. comments may appear after the blank that indicates the end of an operand, up t.o and including the end column. 3. If the next line starts after the continue column, the information entered on the next line is considered comments, and the operand field is considered terminated. Any subsequent continuation lines are considered comments. The following examples illustrate: (1) the normal statement format, (2) the alternate statement format, and (3) a combination of both statement formats. 66 ~ ~_J MODEL STATEMENTS Model statements are the macro definition statements from which the desired sequences of assembler language statements are generated. Zero or more model statements may follow the prototype statement. A model statement consists of one to four fields. They are, from left to right, the name, operation, operand, and comments fields. The fields 1ft the model statement must correspond to the fields in the generated statement. It is not possible to generate blanks to separate statement fields. Model statement fields must follow the rules for paired apostrophes, ampersands, and blanks as macro instruction operands (see "Macro Instruction Operands" in Section 8). Though model statements must follow the normal continuation card conventions, statements generated from model statements may have more than two continuation lines. Substituted statements may not have blanks in any field except between paired apostrophes. They may not have leading blanks in the name field. Name Field The name field may be blank or it may contain an ordinary symbol, a variable symbol, or a sequence symbol. It may also contain an ordinary symbol concatenated with a variable symbol or a variable symbol concatenated with one or more other variable symbols. Variable symbols may not appear in the name field of ACTR, COPY, END, ICTL, ISEQ, or OPSYN statements. The characters * and .* may not be substituted for a variable symbol. Operation Fleld The operation field may contain a machine instruction, an assembler instruc- tion listed in Section 5 (except END, ICTL, ISEQ, OPSYN, or PRINT), a macro instruction, or variable symbol. It may also contain an ordinary symbol concatenated with a variable symbol or a variable symbol concatenated with one or more other variable symbols. A symbolic parameter consists of an ampersand followed by from one through seven letters and/or digits, the first of which must be a letter. Elsewhere, two ampersands must be used to represent an ampersand. Variable symbols may not be used to generate The programmer should the first four characters parameter. • Macro Instructions • Macro prototypes • The following instructions: ACTR AGO AIF ANOP COpy CSECT DSECT END GBLA GBLB GBLC ICTL ISEQ LCLA LCLB LCLC MACRO MEND The eters: following are valid symbolic param- &READER &A23456 &X4F2 MEXIT MNOTE OPSYN PRINT REPRO SETA SETB SETC START not use &SYS as of a symbolic &LOOP2 &N &$4 The following are invalid rameters: CARDAREA &256B &AREA2456 symbolic pa- (first character is not an ampersand) (first character after ampersand is not a letter) (more than seven characters after the ampersand) (contains a special character other than initial ampersand) (contains a special character, i.e.~ blank, other than initial ampersand) variable symbols may also be used outside of macro definitions to generate mnemonic operation codes with the preceding restrictions. &BCD%34 The use of COpy instructions is de~ scribed under "COpy Statements". Variable symbols in the line following a REPRO instruction, will not be replaced by their v~lues. Any symbolic paramet~rs in a model statement must appear ~n the prototype statement of the macro 'definition. &IN AREA The following is an example of a macro definition. Note that the symbolic parameters in the model statements appear in the prototype statement. Operand Field The operand field may contain ordinary symbols or variable symbols. However, variable symbols may not be used in the operand field of COpy, ICTL, ISEQ, or OPSYN instructions. Comments Field The co~ents field may contain any combination of characters. No sUbstitution is performed for variable symbols appearing in the comments field. Only gener~ed statements will be p~inted in the listing. SYMBOLIC PARAMETERS A symbolic parameter is a type of variable symbol that is assigned values by the programmer when he writes a macroinstruction. The programmer may vary st9tements that are generated for each occurrence of a macro instruction by varying the values assigned to symbolic parameters. r-------T-----------T------------, I Name I Operation I Operand I ~-------+-----------+------------~ Header 1 I MACRO 1 I Prototype I &NAME 1MOVE I&TO,&FROM I Model 1&NAME 1ST 12, SAVE I Model 1 IL 12, &FROM 1 Model liST 12,&TO 1 Model I IL I 2, SAVE I Trailer LI ______ I ___________ MEND I ____________ JI ~ ~ Symbolic parameters in model statements are replaced by the characters of the macro instruction that correspond to the symbolic parameters. In the following example the characters HERE, FIELDA, and FIELDB of the MOVE macro instruction correspond to the symbolic parameters &NAME, &TO, and &FROM., respectively, of the MOVE prototype statement. Section 7: How to Prepare Macro' Definitions 67 r------T-----------T---------------------I Name I Operation I Operand 1 .------t-----------+----------------------i I HERE I MOVE IFIELDA,FIELDB I L-----_L ___________ L ______________________ J Any occurrence of the symh?lic parame1:ers &NAME, &TO, and &FROM l.n a model statement will be replaced by the characters HERE, FIELDA, and FIELDB, respectively. If the preceding macro instruction were used in a source program, the following assembler language sta-tements would be generated: r------T-----------T----------------------, I Name I Operation IOperand I t------+-----------+----------------------i I HERE 1ST 12,SAVE I I 2, FIELDB I I IL 12, FIELDA I I I ST IL ______ LI ___________ L I ______________________ 2 , SAVE JI ~ The macro'definition, macro instruction, and generated statements in the following example illustrate these rules. r-----T---------T----------------,I IName IOperationlOperand Header .-----+---------+----------------~ I I MACRO Prototypel~NAMEIMOVE Model Model Model Model Trailer I~NAMEIST&TY I I I I IL&TY IST&TY IL&TY I MEND I I I&TY,&P,&TO,&FROMI 12,SAVEAREA I 12,&P&FROM I 12~&P&TO I 12,SAVEAREA I I I t-----+---------+----------------i IHERE IMOVE ID,FIELD,A,B I .-----+---------+----------------i GeneratedlHERE ISTD 12, SAVE AREA I Macro Generated I Generatedl ILD 12,FIELDB I ISTD 12,FIELDA I Generate~1L _____ ILD _________ L12,SAVEAREA ________________ JI ~ The example below illustrates another use of the MOVE macro instruction using operands different from those in the preceding example. r-------T-----------T------------, 1Name 1Operation I Operand I Macro .-------+-----------+------------i I LABEL I MOVE IIN,OUT 1 .-------+-----------+------------i Generated I LABEL 1ST 12,SAVE I Generated I IL 12,OUT I Generated I 1ST 12, IN I GeneratedlL _______ LIL ___________ L12,SAVE ____________ JI If a symbolic parameter appears in the comments field of a model stat.ement, it is not replaced by the corresponding characters of the macro instruction. Symbolic Parameters with O·ther Characters or· Other Symbol ic ~?ncatenating R..~rameters If a symbolic parameter. in a model statement is immediately preceded or followed by other characters or another symbolic parameter, the characters that correspond to the symbolic parameter are combined in the generated statement with the other characters or the characters that co:respond to. the other symbolic parameter. ThlS process 1.8 called concatenation. 68 The symbolic parameter &TY is used in each of the four model statements to vary the mnemonic operation code of each of the generated statements. The character D in the macro instruction corresponds to symbolic parameter &TY. Since &TY is preceded by other characters .AREA2456 (more than seven characters after period) .BCD%84 (contains a special character other than initial period) .IN AREA (contains a special character, i.e., blank, other than initial period) If a sequence symbol appears in the name field of a macro-instruction, and the corresponding prototype st.atement contains a symbolic parameter in the name field, the sequence symbol does not replace the symbolic parameter wherever it is used in the macro-definition. The rule. following example illustrates this r-------T-----------T-------------------, IName IOperation I I Operand ~-------+-----------+-------------------~ I I MACRO 1&NAME I MOVE 2 1&NAIviE 1ST IlL l i ST I IL I 1MEND I 1 &TO, &FROM 12, SAVEAREA 12, &FROM 12 ,&TO 12,SAVEAREA I 1 1 1 1 I 1 1 3 I.SYM IFIELDA,FIELDB I 1 All LCLA, LCLB, or LCLC instructions in a macro definition must appear immediately after the prototype statement and GBLA, GBLB or GBLC instructions. All LCLA, LCLB, or LCLC instructions outside macro definitions must appear after all macro definitions in the source program, after all GBLA, GBLB, and GBLC instructions outside macro definitions, before all conditional assembly instructions, and PUNCH and REPRO statements outside macro definitions, and before the first control section of the program. ~-------+-----------+-------------------~ I MOVE ~-------+-----------+-------------------~ 4 liST 12,SAVEAREA I IlL 12 , FIELDB I I 1ST 12, FIELDA I 1l _______ LI L lL ___________________ 2 , S AVEAREA ___________ J1 The symbolic parameter &NAME is used in the name field of the prototype statement (statement 1) and the first model statement (statement 2). In the macro-instruction (statement 3) a sequence symbol (.SYM) corresponds to the symbolic parameter &NAME. &NAME is not replaced by .SYM, and, therefore, the generated statement (statement 4) does not contain an entry in the name field. SETA -- SET ARITHMETIC The SETA instruction may be us~d to assign an arithmetic value to a SETA symbol. The format of this instruction is: r--------T-----------T--------------------, I Name IOperation IOperand 1 ~--------+-----------+--------------------~ IA SETA ISETA IAn arithmetic I Il ________ symbol L1___________ LI ____________________ expression J1 The expression in the operand field is evaluated as a Signed 32-bit arithmetic value which is assigned to the SETA symbol in the name field. The minimum and maximum allowable values of the expression are -2 31 and +2 31 -1, respectively. LCLA, LCLB, LCLC -- DEFINE LOCAL SET SYMBOLS The format of these instructions is: r-------T-----------T---------------------, 1Name 1Operation I Operand 1 ~-------+-----------+---------------------~ IBlank I 1LCLA, lOne or more variable 1 1symbols, that are I I LCLB, or I ILCLC Ito be used as SET I I I 1symbols, separated 1 commas Il _______ LI ___________ LIby _____________________ JI The LCLA, LCLB, and LCLC instructions are used to define and assign initial values to SETA, SETB, and SETC symbols, respectively. The SETA, SETB, and SETC symbols are assigned the initial values of 0, 0, and null character value, respectively. The programmer should not define any SET symbol whose first four characters are &SYS. Section 9: The expression may consist of one term or an arithmetic combination of terms. The terms that may be used alone or in combination with each other are self-defining terms, variable symbols, and the length, scaling, integer, count, and number attributes. Self-defining terms are described in Part I of this publication. Note: A SETC variable symbol may appear in a SETA expression only if the value of the SETC variable is one to eight decimal digits. The decimal digits will be converte~ to a positive arithmetic value. The arithmetic operators that may be used to combine the terms of an exp"ression are + (addition), - (subtraction), * (multiplication), and / (division). An expression may not contain two terms or two operators in succession, nor may it begin with an operator. The following are valid operand fieldS of SETA instructions: How to Write Conditional Assembly Instructions 81 &AREA+X' 2D' &BETA*10 L'&HERE+32 I'&N/25 &E,XIT-S' &ENTRY+l 29 The following are invalid operand fields of SETA instructions: &AREAX'C' &FIELD+-&DELTA*2 *+32 NAME/15 ~yaluation (two terms in succession) (two operators in succession) (begins with an operator) (begins with an operator; two operators in succession) (NAME is not a valid term) of Arithmetic EXQressions The procedure used to evaluate the arithmetic expression in the operand field of a SETA instruction is the same as that used to evaluate arithmetic expressions in assembler language statements. The only difference between the two types of arithmetic expressions is the terms that are allowed in each expression. The following evaluation The arithmetic value assigned to a SETA symbol is substituted for the SETA symbol when it is used in an arithmetic expression. If the SETA symbol is not used in an arithmetic expression, the arithmetic value is converted to an unsigned integer, with leading zeros removed. If the value is zero, it is converted to a single zero. The following example rule: term Each value. is given its numerical 2. The arithmetic operations are performed moving from left to right. However, multiplication and/or division are performed before addition and subtraction. value The computed result is the assigned to the SETA symbol in the name field. ~-------+-----------+-------------------i MACRO MOVE LCLA SETA SETA SETA SETA ST &NAME 4 &A &B &C &D &NAME 5 6 &TO,&FROM &A,&B,,&C,&D 10 12 &A-&B &A+&C 2,SAVEAREA 2,&FROM&C 2., &TO&D 2 6 SAVEAREA L ST L MEND ~-------+-----------+-------------------i I HERE 1MOVE IFIELDA,FIELDB , ~-------+-----------+-------------------i 'HERE 1ST 12,SAVEAREA , 12nFIELDB2 , I IL , 1ST 12, FIELDA8 , I lL SAVEAREA L _______ ___________ 12" ___________________ JI ~ The arithmetic expression in the operand field of a SETA instruction may contain one or more sequences of arithmetically combined terms that are enclosed in parentheses. A sequence of parenthesized terms may appear within another parenthesized sequence. Only five levels of parentheses are allowed and an expression may not consist of more than 16 terms. Parentheses required for sublist notation, substring notation, and subscript notation count toward this limit. this r-------T-----------T-------------------, I Operation 1Operand I 1 2 3 1. illustrates I Name procedure is u~:;ed: 3. The parenthesized portion or portions of an arithmetic expression are evaluated before the rest of the terms in the expression are evaluated. If a sequence of parenthesized terms appears within another parenthesized sequence, the innermost sequence is evaluated first. ~ The following are examples of SETA instruction operand fields that contain parenthesized sequences of terms. Statements 1 and 2 assign to the SETA symbols &A and &B the arithmetic values +10 and +12, respectively. Therefore, statement 3 assigns the SETA symbol &C the arithmetic value -2. When &C is used in statement 5, the arithmetic value -2 is converted to the unsigned integer 2. When &C is used in statement 4, however w the arithmetic value -2 is used. Therefore, &D is assigned the arithmetic value +8. When &D is used in statement 6, the arithmetic value +8 is converted to the unsigned integer 8. (I,'&HERE+32)*29 &AREA+X'2D'/(&EXIT-S'&ENTRY+l) &BETA*10*(I'&N/2S/(&EXIT-S'&ENTRY+l» The following example shows how the value assigned to a SETA symbol may be changed in a macro definition. 82 r-------T-----------T-------------------, I Operation I Operand , &NUMBER is the first symbolic parameter in the operand field of the prototype statement (statement 1). The corresponding characters, (A~B,C,D,E), of the macroinstruction (statement 4) are a sublist. Statement 2 assigns to &LAST the arithmetic value +5, which is equal to the number of operands in the sublist. Therefore, in statement 3, &NUMBER(&LAST) is replaced by the fifth operand of the sublist. I Name ~-------+-----------+-------------------~ 1 2 3 4 I I MACRO I &NAME I MOVE I I LCLA I&A I SETA I&NAME 1ST I IL I&A I SETA liST I IL I I MEND I I &TO, &FROM I &A 15 12 g SAVEAREA 12 ,&FROM&A 18 12,&TO&A 12., SAVEAREA I I I I I I I I I I I SETC -- SET CHARACTER ~-------+-----------+-------------------i I HERE I MOVE IFIELDA,FIELDB The SETC instruction is used to assign a character value to a SETC symbol. The format of this instruction is: I ~-------+-----------+-------------------i I HERE I I 1ST 12 ,SAVEAREA I IL 12, FIELDB5 I I ST I 2" FIELDA8 I IL_______ I ___________ L 12, SAVEAREA ___________________ JI ~ r---------T-----------T-------------------, I Name I Operation I Operand I ~ ~---------+-----------+-------------------~ Statement 1 assigns the arithmetic value +5 to SETA symbol &A. In statement 2, &A is converted to the unsigned integer 5. Statement 3 assigns the arithmetic value +8 to tA. In statement 4, therefore, &A is converted to the unsigned integer 8, instead of 5. A SETA symbol may be used with a symbolic parameter to refer to an operand in an operand sublist. If a SETA symbol is used for this purpose it must have been assigned a positive value. Any expression that may bE used in the operand field of a SETA instruction may be used to refer to an operand in an operand sublist" Sublists are described under "Operand Sublists." in Section 8 The following macro definition may be used to add the last operand in an operand sublist to the first operand in an operand sublist and store the result at the first operand. A sample macro-instruction and generated statements follow the macro definition. r------T-----------T--------------------, I Name I Operation I Operand I ~------+-----------+--------------------i I I MACRO I 1 1 IADDX I&NUMBER,® I I LCLA I &LAST 2 I&LAST ISETA IN'&NUMBER 1 I L l ®, &NUMBER(l) 3 I IA I ®, &NUMBER (&LAST) I ST I ®, &NUMBER(l) 1 I I MEND I I 1 1 I I 1 I I ~------+-----------+--------------------i 4 I IADDX I (A,B,C,D,E),3 I ~------+-----------+--------------------i IlL I3,A I 1 IA 1 3 ,E I 3 ,A 1L ______ 1ST ___________ 1 ____________________ JI ~ ~ Section 9: IA SETC I symbol ISETC lOne operand, of I I Ithe form described 1 1 L _________ I ___________ I bE~low ___________________ JI ~ ~ The operand field may consist of the type attribute, a character expression, a substring notation, or a concatenation of substring notations and character expressions. A SETA symbol may appear in the operand of a SETC statement. The result is the character representation of the decimal value, unsigned, with leading zeros removed. If the value is zero, one decimal zero is used. Type Attribute The character value assigned to a SETC symbol may be a type attribute. If the type attribute is used, it must appear alone in the operand field. The following example assigns to the SETC symbol &TYPE the letter that is the type attribute of the macro instruction operand that corresponds to the symbolic parameter &ABC. r-------T-----------T---------------------, IName I Operation 1operand 1 ~-------+-----------+---------------------i I&TYPE L _______ ISETC ___________ IT'&ABC _____________________ JI ~ ~ Character Expression A character expression consists of any combination of (up to 255) characters enclosed in apostrophes. The first eight characters in a character value enclosed in apostrophes in the operand field are assigned to the SETC symbol in the name field. The maximum size character value that can be assigned to a SETC symbol is eight characters. Evaluation of Character Expressions: The following statement assigns the character value AB%4 to the SETC symbol &ALPHA: How to Write Conditional Assembly Instructions 83 r--------T-----------T--------------------, I Name I Operation I Operand I ~--------+-----------+--------------------i IL________ r:ALPHA LI ___________ SETC AB%4' LI ____________________ JI The following statement character value HALF&& to the &AND. assigns the SETC symbol I More than one character expression may be concatenated into a single character expression by placing a period between the t€~rrninating apostrophe of one character expression and the opening apostrophe of the next character expression. For example, either of the following statements may be used to assign the character value ABCDEF to the SETC symbol &BETA. r-------T-----------T---------------------, I Name I Operation I Name I Operation I Operand I ~-------+-----------+---------------------i I&BETA ISETC I'ABCDEF ' I I&BETA L _______ LISETC ___________ LI'ABC'.'DEF' _____________________ JI Two apostrophes must be used to represent an apostrophe that is part of a character expression. The following statement assigns the character value L'SYMBOL to the SETC symbol &LENG'llH. r---------T----~------T-------------------, I Name I Operation I Operand I ~---------+-----------+-------------------i I&LENGTH L_________ LISETC ___________ LI'L"SYMBOL' ___________________ JI Variable symbols may be concatenated with other characters in the operand field of a SETC instruction according to the general rules for concatenating symbolic parameters with other characters (see Section 1). I I&AND l _______ LISETC ___________ LI'HALF&&' _____________________ JI §u~string r-------T-----------T---------------------, I Operand .-------+-----------+---------------------i Notation The character value assigned to a SETC symbol may be a substring character value. Substring character values permit the programmer to assign part of a character value to a SETC symbol. If the programmer wants to assign part of a character value to a SETC symbol, he must indicate to the assembler in the operand field of a SETC instruction: (1) the character value itself, and (2) the part of the character value he wants to assign to the SETC symbol. The combination of (1) and (2) in the operand field of a SETC instruction is called a substring notation. The character value that is assigned to the SETC symbol in the name field is called a substring character value. Substring notation consists of a character expression, immediately followed by two arithmetic expressions that are separated from each other by a comma and are enclosed lin parentheses. Each arithmetic expression may be any expression that is allowed in the operand field of a SETA instruction. IL________ &GAMMA_ SETC I &ALPHA.RS,]~' LI ___________ LI ____________________ JI The first expression indicates the first character in the character expression that is to be assigned to the SETC symbol in the name field. The second expression indicates the number of consecutive characters in the character expression (starting with the character indicated by the first expression) that are to be assigned to the SETC symbol. If a substring asks fur more characters than are in the character string only the characters in the string will be aSSigned. Two ampersands must be used to represent an ampersand that is not part of a variable symbol. Both ampersands become part of the character value aSSigned to the SETC symbol. They are not replaced by a single ampersand. The maximum size substring character value that can be assigned to a SETC symbol is eight characters. The maximum size character expression the substring character value can be chosen from is 255 characters. If a value greater than 8 is specified, the leftmost 8 characters will be used. If &ALPHA has been assigned the character value AB%4, the following statement may be used to assign the character value AB%4RST to the variable symbol &GA¥MA. r--------T-----------T--------------------, I Name I Operation I Operand I ~--------+-----------+--------------------i 84 The tions: ~---------+-----------+-----------------~ '&ALPHA' (2,5) 'AB%4'(&AREA+2,1) , &ALPHA. RST' (6, &A) 'ABC&GAM~A' (&A,&AREA+2) The following notations: • &BET A' r---------T-----------T-----------------, IName I Operation I Operand I following are valid substring nota- are 1 invalid substring 2 3 4 (4, 6) (blanks between character value and arithmetic expressions) IL"SYMBOL' (142-&XYZ) (only one arithmetic expression) 'AB%4&ALPHA' (8 &FIELD*2) (arithmetic expressions not separated by a comma) 'BETA'4,6 (arithmetic expressions not enclosed in parentheses) I I I I 1 I I I I 1 I MOVE IA,B I statement 1 assigns the character value FIELD to the SETC symbol &PREFIX. Therefore, &PREFIX is replaced by FIELD in statement 2. Statement 3 assigns the character value AREA to &PREFIX. Therefore, &PREFIX is replaced by AREA, instead of FIELD, in statement 4. ~---------+-----------+-----------------~ 1 I&TO,&FROM I&PREFIX I 'FIELD' 12,SAVEAREA 12, &PREFIX&FROM 12, &PREFIX&TO I 2, SJI.VEAREA 1 I I I I I I I 1 The following example illustrates the use of a substring notation as the operand field of a SETC instruction. r---------T-----------T-----------------, I Operation I Operand I IName ~---------+-----------+-----------------~ I I &NAME 1 1 I&PREFIX I&NAME 2 I I I I MACRO I MOVE I LCLC ISETC 1ST IL I ST IL 1 I&TO,&FROM I&PREFIX II&TO' (1,5) 12,SAVEAREA 12, &PREFIX&FROM I 2 , &TO 12,SAVEAREA I 1 I I I I I I I I MEND I I I HERE I MOVE I FIELDA, B I ~---------+-----------+-----------------~ ~---------+-----------+-----------------~ I HERE 1ST 12, SAVEAREA I IlL I 2, FIELDB I I 1ST 12, FIELDA I I _________ 4IL L ___________ 412,SAVEAREA _________________ JI I ~---------+-----------+-----------------~ I A, B I I&TO,&FROM I&PREFIX I I FIELD' 12,SAVEAREA 12, &PREFIX&FROM I 'AREA' 12,&PREFIX&TO 12,SAVEAREA 1 I HERE; 1ST 12, SAVEAREA I IlL I 2, FIELDS 1 I I ST I 2 , AREAA I IL_________ 4IL ___________ 412,SAVEAREA _________________ JI r---------T-----------T-----------------, I Name I Operation I Operand I I MOVE INEND I HERE For example, consider the following macro-definition, macro instruction, and generated statements. I HERE I I MOVE I I LCLC I &PREFIX I SETC I&NA~ffi 1ST 1 IL I&PREFIX ISETC liST I IL ~---------+-----------+-----------------~ The character value assigned to a SETC symbol is substituted for the SETC symbol when it is used in the name, operation, or operand field of a statement. I MACRO I MOVE I LCLC ISETC 1ST IL 1ST IL 1MEND I MACRO ~---------+-----------+-----------------~ Using SETC Symbols I I &NAME I 1 I&PREFIX I&NAME 2 I 3 I I 1 / I &NAME I ~---------+-----------+-----------------~ I HERE I ST 12, SAVEAREA I I IL 12,FIELDB I I 1ST /2,FIELDA 1 IL_________ 4I ___________ L SAVEAREA 412, _________________ JI Statement 1 assigns the substring character value FIELD (the first five characters corresponding to symbolic parameter &TO) to the SETC symbol &PREFIX. Therefore, FIELD replaces &PREFIX in statement 2. Statement 1 assigns the character value FIELD to the SETC symbol &PREFIX. In statements 2 and 3, &PREFIX is replaced by FIELD. The following example shows how the value assigned to a SETC symbol may be changed in a macro definition. Section 9: Note: An operand of a SETC symbol cannot be passed as a sublist to a macro instruction. Concatentating Substring Notations and Character Expressions: Substring notations may be concatenated with character expressions in the operand field of a SETC How to Write Conditional Assembly Instructions 85 instruction. If a substring no"tation follows a character expression, the two may be concatenated by placing a period between t.he terminating apostrophe of the character E~xpression and the opening apostrophe of the substring notation. For example" if &ALPHA has been assigned the character value AB%4, and &BETA has been assigned the character value ABCDEF, 1:hen the following statement assigns &GAMMA the character value AB%4BCD. r--------T---------T----------------------, I Name I Operation IOperand I ~--------+---------+----------------------i IA SETB ISETB IA 0 or a 1 enclosed orl I symbol I Inot enclosed in paren-I I I Itheses, or a logical I I I lexpression enclosed I Il ________ I_________ lin parentheses ______________________ JI ~ ~ ISETC (2,3)1J __________ I'&ALPHA·.'~BETA' _____________________ The operand field may contain a 0 or a 1 or a logical expression enclosed in parentheses. A logical expression is evaluated to determine if it is true or false; the SETB symbol in the name field is then aSSigned the binary value 1 or 0 corresponding to true or false, respectively. If a substring notation precedes a character expression or another substring notation, the two may be concatenated by writing the opening apostrophe of the second item immediately after the closing parenthesis of the substring notation. A logical expression consists of one term or a logical combination of terms. The terms that may be used alone or in combination with each other are arithmetic relations, character relations, and SETB symbols. The logical operators used to combine the terms of an expression are AND, OR, and NOT. r--------T----------T---------------------, IOperation IOperand I I Name ~--------+----------+---------------------i I&GAMMA L ________ ~ ~ The programmer may optionally place a period between the closing parenthesis of a substring notation and the opening apostrophe of the next item in the operand field. If &ALPHA has been assigned the character value AB%4, and &ABC has been assigned the character value 5RS, either of the following statements may be used to assign &WORD the character value AB%45RS. r------T---------T------------------------, I Operation IOperand I I Name ~------+---------+------------------------i I &WORD I SETC I' &ALPHA' (1,4) "&ABC' I I ______ &WORD I SETC &ALPHA' (1,4) II &ABC' (1,3) JI L _________ I' ________________________ ~ ~ If a SETC symbol is used in the operand field of a SETA instruction, the charact,er value aSSigned to the SETC symbol must be one to eight decimal digits. If a SETA symbol is used in the operand field of a SETC statement, the arithmetic value is converted to an unsigned integer ~Ti th leading zeros removed. If the value is zero, it is converted to a single zero. ~;ETB -- SET BINARY The SETB instruction may be used to assign the binary value 0 or 1 to a SETB symbol. The format of this instruction is: 86 An expre~sion may not contain two terms in succeSSlon. A logical expression may contain two operators in succession only if the first operator is either AND or OR and the second operator is NOT. A logical expression may begin with the operator NOT. It may not begin with the operators AND or OR. An arithmetic relation consists of two arithmetic expressions connected by a relational operator. A character relation consists of two character values connected by a relational operator. The relational operators are EQ (equal), NE (not equal), LT (less than), GT (greater than)" LE (less than or equal), and GE (greater than or equal) • Any expression that may be used in the operand field of a SETA instruction, may be used as an arithmetic expression in the operand field of a SETB instruction. Anything that may be used in the operand field of a SETC instruction may be used as a character value in the operand field of a SETB instruction. This includes substring and type attribute notations. The maximum size of the character values that can be compared is 255 characters. If the two character values are of unequal size, then the smaller one will always compare less than the larger one. The relational and logical operators must be immediately preceded and followed by at least one blank or other special character. Each relation mayor may not be enclosed in parentheses. If a relation is not enclosed in parentheses, it must be separated from the logical operators by at least one blank or other special character. (NOT (&B AND &AREA+X'2D' GT 29» (&B AND (T'&P12 EQ 'F' OR &B}) The following are valid operand fields of SETB instructions: The parenthesized portion or portions of a logical expression are evaluated before the rest of the terms in the expression are evaluated. If a sequence of parenthesized terms appears within another parenthesized sequence, the innermost sequence is evaluated first. Five levels of parentheses are permissible. 1 (&AREA+2 GT 29) ('AB%4' EQ '&ALPHA') (T'&ABC NE T'&XYZ) ( T' &P12 EQ 'F') (&AREA+2 GT 29 OR &B) (NOT &B AND &AREA+X'2D' GT 29) ( , &C' EQ' MB' ) Using SETB Symbols (0) The following are invalid operand fields of SETB instructions: &B (not enclosed in parentheses) (T'&P12 EQ 'F' &B) (two terms in succession) ('AB%4' EQ 'ALPHA' NOT &B) (the NOT operator must be preceded by AND or OR) (AND T' &P12 EQ 'F') (expression begins with AND) The logical value assigned to a SETB symbol is used for the SETB symbol appearlng ln the operand field of an AIF instruction or another SETB instruction. If a SETB symbol is used in the operand field of a SETA instruction, or in arithmetic relations in the operand fields of AIF and SETB instructions, the binary values 1 (true) and 0 (false) are converted to the arithmetic values +1 and +0, respectively. If a SETB symbol is used in the operand field of a SETC instruction, in character relations in the operand fields of AIF and SETB instructions, or in any other statement, the binary values 1 (true) and 0 (false), are converted to the character values 1 and 0, respectively. Evaluation of Logical Expressions The following procedure is used to evaluate a logical expresslon in the operand field of a SETB instruction: 1. 2. 3. The following example illustrates these rules. It is assumed that L'&TO EQ 4 is true, and S'&TO EQ 0 is false. r-------T-----------T-------------------, I Operation I Operand I I Name Each term (i.e., arithmetic relation, character relation, or SETB symbol) is evaluated and given its logical value (true or false). The logical operations are performed moving from left to right. However, NOTs are performed before ANDs, and ANDs are performed before ORs. The computed result is the value assigned to the SETB symbol in the name field. The logical expression in the operand field of a SETB instruction may contain one or more sequences of logically combined terms that are enclosed in parentheses. A sequence of parenthesized terms may appear within another parenthesized sequence. The following are examples of SETB instruction operand fields that contain parenthesized sequences of terms. Section 9: ~-------+-----------+-------------------~ &NAME 1 2 3 4 &Bl &B2 &Al &Cl lVJACRO MOVE LCLA LCLB LCLC SETB SETB SETA SETC ST L ST L MEND &TO,&FROM &Al &Bl,&B2 &Cl (L'&TO EQ 4) (S'&TO EQ O) &Bl '&B2' 2, SAVE AREA 2,&FROM&Al 2*&TO&C1 2*SAVEAREA ~-------+-----------+-------------------~ I HERE I MOVE IFIELDA,FIELDB I ~-------+-----------+-------------------~ I HERE I 1ST IL 12.,SAVEAREA I 2, FIELDBl I I liST 12,FIELDAO I IL _______ i I ___________ L SAVEAREA i 12., ___________________ JI How to Write Conditional Assembly Instructions 87 Because the operand field of statement 1 is true, &B1 is assigned the binary value 1. Therefore, the arithmetic value +1 is substituted for &B1 in statement 3. Because the operand field of sta-tement 2 is false, &B2 is assigned the binary value O. Therefore, the character value 0 is substituted for &B2 in statement 4. AlF -- CONDITIONAL BRANCH The AlF instruction is used to conditionally alter the sequence in which source program statements or macro~definition statements are processed by the assembler. The assembler assigns a maximum count of 4096 AIF and AGO branches that may be executed in the source progran. or in a macro-definition. When a macro-definition calls an inner macro-definition, the current value of the count is saved and a new count of 4096 is set up for the inner macro-definition. When processing in the inner definition is completed and a return is made to the higher definitionJ the saved count is restored. The format of this instruction is: r---------T---------T---------------------, I Name I Operation I Operand I .---------+---------+---------------------i IA seIAIF IA logical expression I Iquence I lenclosed in parenI Isymbol orl Itheses, immediately I I I followed by a I I blank symbol lI _________ I _________ Isequence _____________________ JI ~ ~ Any logical expression that may be used in the operand field of a SETB instruction may be used in the operand field of an AIF instruction. The sequence symbol in the operand field must immediately follow the closing parenthesis of the logical expression. The logical expression in the operand field is evaluated to determine if it is true or false. If the expression is true, the statement named by the sequence symbol in the operand field is the next statement processed by the assembler. If the expression is false, the next sequential statement is processed by the assembler. The sta-tement named symbol may precede or instruction. by the sequence follow the AIF If an AIF instruction is in a macrodefinition, then the sequence symbol in the operand field must appear in the name field of a statement in the definition. If an 88 AlF instruction appears outside macrodefinitions, then the sequence symbol in the operand field must appear in the name field of a statement outside macrodefinitions. The following are valid operand fields of AIF instructions: (&AREA+X'2D' GT 29) . READER (T'&PI2 EQ 'F') . THERE ('&FlELD3' EQ' '}.N03 The following are invalid operand fields of AIF instructions: (no sequence symbol) (T'&ABC NE T'&XYZ) (no logical expression) .X4F2 (T'&ABC NE T'&XYZ) .X4F2 (blanks between logical expression and sequence symbol) The following macro-definition may be used to generate the statements needed to move a full-~lord fixed-point number from one storage area to another. The statements will be generated only if the type attribute of both storage areas is the letter F. r-----T---------T----------------------, IName IOperationlOperand I .-----+---------+----------------------~ I I&N 1 I 2 I 3 I&N IMACRO I MOVE IAIF IAIF 1ST I I I&T,&F I I (T' &T NE T' &F) .END I I(T'&T NE 'F').END I 12,SAVEAREA I I IL 12, &F I l i ST 12,&T I I IL I 2, SAVEAREA I 4 LI.END _____ IMEND _________ I ______________________ JI ~ ~ The logical expression in the operand field of statement 1 has the value true if the type attributes of the two macroinstruction operands are not equal. If the type attributes are equal, the expression has the logical value false. Therefore, if the type attributes are not equal, statement 4 (the statement named by the sequence symbol .END) is the next statement processed by the assembler. If the type attributes are equal, statement 2 (the next sequential statement) is processed. The logical expression in the operand field of statement 2 has the value true if the type attribute of the first macroinstruction operand is not the letter F. If the type attribute is the letter F, the expression has the logical value false. Therefore, if the type attribute is not the letter F, statement 4 (the statement named by the sequence symbol .END) is the next statement processed by the assembler. If the type attribute is the letter F, statement 3 (the next sequential statement) is processed. The AGO instruction is used to unconditionally alter the sequence in which source program or macro-definition statements are processed by the assembler. The assembler assigns a maximum count of 4096 AIF and AGO branches that may be executed in the source program or in a macrodefinition. When a macro-definition calls an inner macro-definition, the current value of the count is saved and a new count of 4096 is set up for the inner macrodefinition. When processing in the inner definition is completed and a return is made to the higher definition, the saved count is restored. The format of this instructicn is: r----------T---------T--------------------, I Operation I Operand I I Name ~----------+---------+--------------------~ ~ ~ ~------+---------+----------------------~ 1 2 3 4 AGO -- UNCONDITIONAL BRANCH IA sequencelAGO Isymbol or I blank I ____ lI __________ r------T---------T----------------------, IName I Operation I Operand I IA sequence symbol I I I ____ I ____________________ JI I I MACRO I I I &NAME IHOVE I &T, &F I I I AIF I (T' &T EQ 'F'). FIRST I I I AGO I . END I I.FIRSTIAIF I(T'&T NE T'&F).END I I&NAME 1ST 12,SAVEAREA I I IL 12,&F I I 1ST 12, &T I I IL 12,SAVEAREA I MEND I ______________________ JI lI.END ______ I _________ ~ ~ Statement 1 is used to determine if the type attribute of the first macroinstruction operand is the letter F. If the type attribute is the letter F, statement 3 is the next statement processed by the assembler. If the type attribute is not the letter F, statement 2 is the next statement processed by the assembler. Statement 2 is used to indicate to the assembler that the next statement to be processed is statement 4 (the statement named by sequence symbol .END). ACTR -- CONDITIONAL ASSEMBLY LOOP COUNTER The ACTR instruction is used to assign a maximum count (different from the standard count of 4096) to the number of AGO and AIF branches executed within a macro-definition or within the source program. The format of this instruction is as follows: ~ r-------------T---------T-----------------, IOperationlOperand I IName ~-------------+---------+-----------------~ IBlank The statement named by the sequence symbol in the operand field is the next statement processed by the assembler. The s.tatement named symbol may precede or instruction. by the sequence follow the AGO If an AGO instruction is part of a macro-definition, then the sequence symbol in the operand field must appear in the name field of a statement that is in that definition. If an AGO instruction appears outside macro-definitions, then the sequence symbol in the operand field must appear 1n the name field of a statement outside macro-definitions. The following example illustrates the use of the AGO instruction. Section 9: lI_____________ IACTR IAny valid SETA I expression I _________ I _________________ JI ~ ~ This statement, which can only occur immediately after the global and local declarations, causes a counter to be set to the value in the operand field. The counter is checked for zero or a negative value: if it is not zero or negative, it is decremented by one each time an AGO or AIF branch is executed. If the count is zero before decrementing, the assembler will take one of two actions: 1. If processing is being performed inside a macro definition, the entire nest of macro definitions will be terminated and the next source statement will be processed. 2. If the source program is being processed, an END card will be generated. How to Write Conditional Assembly Instructions 89 An ACTR instruction in a macrodefinition affects only that definition; it has no effect on the number of AIF and AGO branches that way be executed in macrodefinitions called. ANOP -- ASSEMBLY NO OPERATION The ANOP instruction facilitates conditional and unconditional branching to statements named by symbols or variable symbols. Statement 1 is used to determine if the type attribute of the first macroinstruction operand is the letter F. If the type attribute is not the letter F, statement 2 is the next statement processed by the assembler. If the type attribute is the letter F, statement 4 should be processed next. However, since there is a variable symbol (&NAME) in the name field of statement 4, the required sequence symbol (.FTYPE) cannot be placed in the name field. Therefore, an ANOP instruction (statement 3) must be placed before statement 4. The format of this instruction is: r--------T-----------T--------------------, I~ame I Operation I Operand I ~--------+-----------+--------------------~ IA seIANOP IBlank I I quence I I I IL________ symbol LI ___________ LI ____________________ JI If the programmer wants to use an AIF or AGO instruction to branch to another statement, he must place a sequence symbol in the name field of the statement to which he wants to branch. However, if the programmer has already entered a symbol or variable symbol in the name field of that statement, he cannot place a sequence symbol in the name field. Instead, the programmer must place an ANOP instruction before the statement and then branch to the ANOP instruction. This has the same effect a:3 branching 1:0 the statement inunediately after the ANOP instruction. The following example illustrates the use of the ANOP instruction. r-------T----------T--------------------, IName IOperation IOperand I Then, if the type attribute of the first operand is the letter F, the next statement processed by the assembler is the statement named by sequence symbol .FTYPE. The value of &TYPE retains its initial null character value because the SETC instruction is not processed. Since .FTYPE names an ANOP instruction, the next statement processed by the assembler is statement L~, the statement following the ANOP instruction. CO~DITIONAL ASSEMBLY ELEMENTS The following chart summarizes the elements that can be used in each conditional assembly instruction. Each row in this chart indicates which elements can be used in a single conditional assembly instruction. Each column is used to indicate the conditional assembly instructions in which a particular element can be used. ~-------+----------+--------------------~ 1 I MACRO 1 I I&NAME I I 2 I & TYPE 3 I. FTYPI:: 4 I&NA~ffi I I I 1 I MOVE I LCLC lAIr' I SE']'C 1ANOP IST&TYPE 1L&']'YPE IST&TYPE 1L&TYPE I&T,&F I I &TYPE I I(T'&T EQ 'F').FTYPE I 1 E l l I 1 12,SAVEAREA 1 12, &F I 12,&T I 12, SAVEAREA I I 1L _______ L1__________ MEND LI ____________________ JI 90 The intersection of a column nnd a row indicates whether an element can be used in an instruction, and if so, in what fields of the instruction the element can be used. For example, the intersection of the first row and the first column of the chart indicates that symbolic parameters can be used in the operand field of SETA instructions. r---------------------------T-----------------------------T------, 1 Variable Symbols 1 1---------------------------1 1 1 SET Symbols 1 1 1 I Attributes 1 1 1 r--------------------t-----------------------------+------~ L' 1 s' 1 Io ' 1 K l i N ' IS. S. 1 r-------t------T------T------T------t----T----T----T----T----T----t------~ 1 1 S. p. 1 SETA 1 SETB 1 S ETC 1 T' 1 1 1 SETA 1 1 1 1 0 1 1 N, 1 1 I SETB 1 I 1 1 0 1 1 SETC I 1 1 I 0 1 1 AIF 1 1 I I 0 I I AGO I 1 I I I I I 1 1 I 1 I I I I I I I I I I I I 1 I I I ANOP I I I I I 1 I I I 1 I I I I I I 0 1 1 1 1 1 1 03 I 1 N,O 1 1 1 1 0 1 I I 0 1 I I N,O I 1 1 0 1 1 I 0 0 1 1 1 1 1 1 0 1 1 1 02 1 1 I 0 I 1 1 02 1 1 1 0 1 1 1 02 1 1 1 0 1 1 1 02 1 10 1 1 1 1 1 1 1 1 1 102 1 1 1 1 1 1 1 I I 1 1 I ~-------t------t------t------t------t----t----t----t----t----t----t------~ 1 1 1 0 1 1 1 0 I I 1 0 1 1 1 01 1 I 1 0 1 1 1 01 ~-------t------t------+------t------t----t----t----t----t----t----t------~ 1 1 1 1 1 1 I 1 I 1 I 1 1 1 I ~-------t------+------t------t------t----t----t----t----t----t----t------~ 1 1 1 02 1 1 I 02 1 2 1 I 0 I 1 I 1 2 I I 0 I N,O 1 1 1 1 1 1 I I 1 I I I IN, 0 1 I I I 1 I I I 1 I N I I 02 ~-------t------t------+------t------t----t----t----t----t----t----t------~ ~-------t------+------t------t------t----+----t----t----t----t----t------~ ~-------t------t------t---·---t------t----t----t----t----t----t----t------~ IL _______ ACTR 1______ 0 I ______ 0 1______ 0 I ______ 03 0 I ____ 0 I ____ 0 1____ 0 1____ 0 1______ JI L1____ L1____ ~ 1 I 1 1 3 2 ~ ~ ~ ~ Only in character relations Only in arithmetic relations Only if one to eight decimal digits ~ ~ ~ ~ I 1 1 I 1 1 1 1 Abbreviations 1 I N is Name L' is Length Attribute K' is Count Attribute 1 l O i s Operand S' is Scaling Attribute N' is Number Attribute 1 I S.P. is Symbolic II is Integer Attribute S.S. is Sequence Symbol 1 1L________________________________________________________________________ Parameter J1 Section 9: How to Write Conditional Assembly Instructions 91 SECTION 10: The extended features of the macro language allow the programmer to: 1. Terminate processing of a macro definition. 2. Generate error messages. 3. Define global SET symbols. 4. Define subscripted SET syrrbols. 5. Use system variable symbols. EXTENDED FEATURES OF THE MACRO LANGUAGE must be the last definition. MEND statement of every macro-definition, including those that contain one or more MEXIT instructions. The following example illustrates use of the MEXIT instruction. r-------T-----------T-------------------, IName I Operation I Operand I ~-------+-----------+-------------------~ I I I I&T,&F I 1 I IAIF I (T'&T EQ 'F').OK I 2 I I MEXIT I I 3 I. OK I ANOP I I I&N~lli 1ST 12,SAVEAREA I I IL 12, &F I liST 12,&T I I IL 12,SAVEAREA I IL_______ I ___________ MEND I ___________________ JI I&NA~£ 6. Prepare keyword and mixed-mode macro definitions and write keyword and mixed-mode macro instructions. 7. Use other System/360 macro definitions. the I MACRO I MOVE ~ ~ MEXIT -- MACRO DEFINITION EXIT The MEXIT instruction is used to indicate to the assembler that it should terminate processing of a macro-definition. The format of this instruction is: r------------T-----------T----------------, I Operation I Operand I I Name ~------------+-----------+----------------~ IA sequence IMEXIT I Blank I I symbol or I I I I ____________ blank I ___________ I ________________ JI L ~ Statement 1 is used to determine if the type attribute of the first macroinstruction operand is the letter F. If the type attribute is the letter F, the assembler processes the remainder of the macro-definition starting with statement 3. If the type attribute is not the letter F, the next statement processed by the assembler is statement 2. Statement 2 indicates to the assembler that it is to terminate processing of the macrodefinition. ~ The ~£XIT instruction may only be used in a macro-definition. If the assembler processes an MEXIT instruction that is in a macro-definition corresponding to an outer macroinstruction, the next statement processed by the assembler is the next statement outside macro-definitions. If the assembler processes an MEXIT instruction that is in a macro-definition corresponding to a second or third level macro-instruction, the next statement processed by the assembler is the next statement after the second or third level macroinstruction in the macro definition, respectively. MEXIT should not be confused with MEND. MEND indicates the end of a macroSection 10: MNOTE -- REQUEST FOR ERROR MESSAGE The MNOTE instruction may be used to request the assembler to generate an error message. The format of this instruction is: r----------T---------T--------------------, IName I Operation I Operand I ~----------+---------+--------------------~ IA sequencelMNOTE Isymbol , I Ivariable I I symbol or I Iblank I I I IA severity code, I I followed by I la comma, followed I Iby any combination I I of chara cters enI I closed in apostroI I __________ I _________ I ____________________ phes L JI ~ ~ Extended Features of the Macro Language 93 The operand of the MNOTE instruction may also be written using one of the following forms: r-----------------------------------------,I I Operand .-----------------------------------------i I severity-code, 'message' I I I ' message' I I Statement 1 is used to determine if the type attributes o~ both macro-instruction operands are the same. If they are, statement 2 is the next statement processed by the assembler. If they are not, statement 4 is the next statement processed by the assembler. Statement 4 causes an error message indicating the type attributes are not the same to be printed in the source program listing. 'message' L _________________________________________ J The ~NOTE instruction may only be used in a macro-definition. Variable symbols may be used t,o generate the MNo'rE mnemonic operation code" the severity code, and the message. The severity code may be a decimal integer from 0 through 255 or an asterisk. If it is omitted, 1 is assumed. The severity code indicates the severity of the error, a higher severity code indicating a more serious error. When MNOTE * the operand field comment. occurs, the statement in will be printed as a Two apostrophes must be used to rE:!present an apostrophe enclosed in apostrophes in the operand field of an MNOTE instruction. One apostrophe will be listed for each pair of apostrophes in the operand field. If any variable symbols are used in t,he operand field of an MNOTE instruction, they will be replaced by the values assigned to them. Two ampersands must be used to represent an ampersand that is not part of a variable symbol in the operand field of an MNOTE statement. One ampersand will be listed for each pair of ampersands in the operand field. The following example illustrates use of the MNO'1~E instruction. the r-----T---------T----------------------,I .-----+---------+----------------------i I MACRO IName IOperationlOperand I &NAME MOVE MNOTE AlF AIF ST L ST I 1 I 2 I 3 I &NAME I I I I 4 94 L I. Ml I 5 I. lw12 I _____ L &T,&F *,'MOVE MACRO GEN' (T'&T NE T'&F).M1 (T' &T NE 'FI). M2 2,SAVEAREA 2,&F 2,&T 2,SAVEAREA ~ MEXIT I TYPE NOT SAME" MNOTE MEXIT ITYPE NOT F' MNOTE MEND _________ ______________________ J ~ Statement 2 is used to determine if the type attribute of the first macroinstruction operand is the letter F. If the type attribute is the letter F, statement 3 is the next statement processed by the assembler. If the attribute is not the letter F, statement 5 is the next statement processed by the assembler. Statement 5 causes an error message indicating the type attribute is not F to be printed in the source program listing. GLOBAL AND LOCAL VARIABLE SYMBOLS The boIs: following are local variable sym- 1. Symbolic parameters. 2. Local SET symbols. 3. system variable symbols. Global SET symbols are the variable symbols. only global The GBLA, GBLB, and GBLC instructions define global SET symbols, just as the LeLA., LeLB, and LeLC instructions define the SET symbols described in Section 9. Hereinafter, SET symbols defined by LeLA, LeLB, and LCLC instructions will be called local SET symbols. Global SET symbols communicate values between statements in one or more macrodefinitions and statements outside macrodefinitions. However, local SET symbols communicate values between statements in the same macro-definition, or between statements outside macro-definitions. If a local SET symbol is defined in two or more macro-definitions, or in a macrodefinition and outside macro-definitions, the SET symbol is considered to be a different SET symbol in each case. However, a global SET symbol is the same SET symbol each place it is defined. A SET symbol must be defined as a global SET symbol in each macro-definition in which it is to be used as a global SET symbol. A SET symbol must be defined as a global SET definitions, global SET definitions. -symbol if it is symbol outside macroto be used as a outside macro- If the same SET symbol is defined as a global SET symbol in one or wore places, and as a local SET symbol elsewhere, it is considered the same symbol wherever it is defined as a global SET symbol, and a different symbol wherever it is defined as a local SET symbol. macro-definition. All GBLA, GBLB, and GBLC instructions outside macro-definitions must appear before all LeLA, LCLR, and LCLC instructions outside macro-definitions. Defining Local and Global SET Symbols Using Global and Local SET ~Y~_Qgl~ The following examples illustrate the use of global and local SET symbols. Each example consists of two parts. The first part is an assembler language source program. The second part shows the statements that would be generated by the assembler after it processed the statements in the source program. Local SET symbols are defined when they appear in the operand field of an LCLA, LCLB, or LCLC instruction. These instructions are discussed in Section 9 under "Defining SET Symbols." Example 1: This example illustrates how the same SET symbol can be used to communicate (1) values between statements in the same macro-definition, and (2) diffe:r"ent values between statements outside macrodefinitions. Global SET symbols are defined when they appear in the operand field of a GBLA, GBLB, or GBLC instruction. The format of these instructions is: r-------T-----------T-------------------, IName 1 ~------+---------+------------------------~ 2 3 I Operation I Operand IBlank IGBLA, I IGBLB, or I IGBLC IL-- ____ I _________ ~ I lOne or more variable I Isymbols that are to be I lused as SET symbols, I Iseparated by commas ________________________ JI &NAME &A 4 5 The programmer should not define any global SET symbols whose first four characters are &SYS. If a GBLA, GBLB, or GBLC instruction is part of a macro-definition, it must immediately follow the prototype statement, or another GBLA, GBLB, or GBLC instruction. GBLA, GBLB, and GBLC instructions outside macro-definitions must appear after all macro-definitions in the source program, before all conditional assembly instructions and PUNCH and REPRO statements outside macro-definitions, and before the first control section of the program. All GBLA, GBLB, and GBLC instructions in a macro-definition must appear before all LeLA, LCLB, and LCLC instructions in that Section 10: I &A 15, &A &A+l LCLA LOADA LR LOADA LR END FIRST ~ The GBLA, GBLB, and GBLC instructions define global SETA, SETB, and SETC symbols, respectively, and assign the same initial values as the corresponding types of local SET symbols. However, a global SET symbol is assigned an initial value by only the first GBLA, GBLB, or GBLC instruction processed in which the symbol appears. Subsequent GBLA, GBLB, or GBLC instructions processed by the assembler do not affect the value assigned to the SET sywbol. I Operand MACRO LOADA LCLA LR SETA MEND &NAME , r------T---------T------------------------, I Name I Operation .-------+-----------~-------------------~ 6 &A 15,&A 15,&A FIRST ~-------+-----------+-------------------~ IFIRST ILR I I LR I I LR I I LR I _______ lEND L ___________ ~ 115,0 I 115,0 I 115,0 I 115,0 I I ___________________ FIRST JI ~ &A is defined as a local SETA symbol in a macro definition (statement 1) and outside ~acro definitions (statement 4). &A is used twice within the macro definition (statements 2 and 3) and twice outside macro definitions (statements 5 and 6) • Since &A is a local SETA symbol in the macro definition and outside macro definitions, it is one SETA symbol in the macro definition, and another SETA symbol outside macro definitions. Therefore; statement 3 (which is in the macro definition) does not affect the value used for &A in statements 5 and 6 (which are outside macro definitions). Moreover, the use of LOADA between statements 5 and 6 will alter &A from its" previous value as a local symbol within that macro definition since the first act of the maGro definition is to LeLA &A to zero. Extended Features of the Macro Language 95 r-------T-----------T-------------------, I Operation I Operand 1 Example 2: This example illustrates how a SET symbol can be used to communicate values between statements that are part of a macro-definition and statements outside macro-definitions. r-------T-----------T-------------------, I Name I Operation I Operand I ~-------+-----------+-------------------~ &NAME 1 MACRO LOADA GBI~A &NAME &A 2 3 4 FIRST 5 6 LR SE'l'A MEND GBIA LOADA LR LOADA LR END &A 15" &A &A+l &A 15,&A 15, &A FIRST I Name .-------+-----------+-------------------~ I I &NAME 1 I 2 1&NAME 3 1&A I I I I 4 I 5 I 6 I &A I I I FIRST I I I I LOADA LOADB LOADA LOADB END FIRST I I Example 4: This example illustrates how a SET symbol can be used to communicate values between statements that are part of two different macro-definitions. Since &A is a global SETA symbol in the macro-definition and outside macrodefinitions, it is the same SETA symbol in both cases. Therefore, statement 3 (which is in the macro-definition) affects the value used for &A in statements 5 and 6 (which are outside macro-definitions). r-------T-----------T-------------------, I Name I Operation I Operand 1 .-------+-----------+-------------------~ &NAl'.IE 1 Example 3: This example illustrates how the same SET symbol can be used to communicate: (1) values between statements in one macro-definition~ and (2) different values between statements in a different macro-definition. 2 3 &A is defined as a local SETA symbol in two different macro-definitions (statements 1 and 4). &A is used twice within each macro-definition (statements 2, 3., 5, and 5 &NAME &A 4 96 &A 15,&A &A+l ILR 115,0 1 ILR 115,0 1 ILR 115,0 1 I ILR 115,0 1 IL.. ______ .LI END I FIRST ___________ .L ___________________ JI ILR 115,0 I ILR 115,1 I I LR 115,1 I I I LR 115" 2 I I _______ .LI END I FIRST L ___.________ .L, ____________________ JI Since &A is a local SETA symbol in each macro-definition, it is one SETA symbol in one macro-definition, and another SETA symbol in the other macro-definition. Therefore, statement 3 (which is in one macro-definition) does not affect the value used for &A in statement 5 (which is in the other macro-definition). Similarly" statement 6 does not affect the value used for &A in statement 2. MACRO LOADB LCLA LR SETA MEND IFIRST I FIRST I I 6) • &A 15,&A &A+l .-------+-----------+-------------------~ .-------+-----------+-------------------~ &A is defined as a global SETA symbol in a macro-definition (statement 1) and outside macro-definitions (statement 4). &A is used twice within the macro··defini tion (statements 2 and 3) and twice outside macro-definitions (statements 5 and 6). MACRO LOADA LeLA LR SETA MEND 6 &A FIRST MACRO LOADA GBLA LR SETA MEND &A 15,&A &A+l MACRO LOADB GBLA LR SETA MEND &A 15., &A &A+l LOADA LOADB LOADA LOADB END FIRST .-------+-----------+-------------------~ I FIRST ILR 115,0 I 115 I' 1 I I I LR I I LR 115 I' 2 I I I LR 115" 3 I IL_______.LlEND I ___________________ FIRST ___________ .L JI &A is defined as a global SETA symbol in two different macro-definitions (statements 1 and 4). &A is used twice within each macro-definition (statements 2, 3, 5 and 6) • Since &A is a global SETA symbol in each macro-definition, it is the same SETA symbol in each macro-definition. Therefore, statement 3 (which is in one macro-definition) affects the value used for &A in statement 5 (which is in the other macro-definition). Sirr~larly, statement 6 affects the value used for &A in statement 2. Example 5: This example illustrates how the same SET symbol can be used to comrounicate: (1) values between statements in two different macro-definitions, and (2) different values between statements outside macro-definitions. r-------T-----------T-------------------, I Name I Operation I Operand I ~-------+-----------+-------------------~ MACRO LOADA GBLA LR SETA MEND &NAME 1 2 3 &NArviE &A MACRO LOADB GBLA LR SETA MEND 4 5 6 &A LCLA LOAD A LOADB LR LOADA LOADB LR END 7 FIRST 8 9 Therefore, statement 3 (which is in one macro-definition) affects the value used for &A in statement 5 (which is in the other macro-definition), but it does not affect the value used for &A in statements 8 and 9 (which are outside macro-definitions). Similarly, statement 6 affects the value used for &A in statement 2, but it does not affect the value used for &A in statements 8 and 9. Subscripted SET Symbols Both global and local SET symbols may be defined as subscripted SET symbols. The local SET symbols defined in Section 9 were all nonsubscripted SET symbols. &A 15, &A &A+l subscripted SET symbols provide the programmer with a convenient way to use one SET symbol plus a subscript to refer to many arithmetic, binary, or character values. &A 15,&A &A+l A subscripted SET symbol consists of a SET symbol immediately followed by a subscript that is enclosed in parentheses. The subscript may be any arithmetic expression that is allowed in the operand field of a SETA statement. The subscript may not be 0 or negative. &A The following are valid subscripted symbols. SET 15,&A &READER (1 7) &A23456(&S4) &X4F2(25+&A2) 15,&A FIRST ~-------+-----------+-------------------~ I FIRST ILR 115,0 I I I LR 115,1 I I I LR 115,0 I I I LR 115,2 I I I LR 115,3 I 115,0 I I I LR Il _______ lEND FIRST ___________ I ___________________ JI ~ Since &A is a global SETA symbol in each macro-definition, it is the same SETA symbol in each macro-definition. However, since &A is a local SETA symbol outside macro-definitions, it is a different SETA symbol outside macro-definitions. ~ &A is defined as a global SETA symbol in two different macro-definitions (statements 1 and 4), but it is defined as a local SETA symbol outside macro-definitions (statement 7). &A is used twice within each macrodefinition and twice outside macrodefinitions (statements 2, 3, 5, 6, 8 and 9). Section 10: The following SET symbols. &X4F2 ( 25) &X4F2 (25) are invalid subscripted (no subscript) (no SET symbol) (subscript does not immediately follow SET symbol) Defining Subscripted SET Symbols: If the programmer wants to use a subscripted SET symbol, he must write in a GBLA, GBLB, GBLC, LCLA, LCLB, or LCLC instruction, a SET symbol immediately followed by a decimal integer enclosed in parentheses. The decimal integer, called a dimension, indicates the number of SET variables associated with the SET symbol. Every variable associated with a SET symbol is aSSigned an Extended Features of the Macro Language 97 initial value that is the same as the initial value assigned to the corresponding type of nonsubscripted SET symbol. If a subscripted SET symbol is defined as global, the same dimension must be used with the SET symbol each time it is defined as global. The maximum dimension that can be used with a SETA, SETB, or SETC symbol is 2500. A subscripted SET symbol may be used if the declaration was subscripted; a nonsubscripted SET symbol may be used only if the declaration had no subscript. ~nly The following statements dE~fine the global SET symbols &SBOX, &WBOX, and &PSW, and the local SET symbol &TSW. &SBOX has 50 arithmetic variables associated with it, &WBOX has 20 character variables, &PSW and &TSw each have 230 binary variables. r------T-----------T----------------------, I Operation I Operand I I Name ~------+-----------+----------------------~ IGBLA I &SBOX(SO) I I I GBLC I &WBOX (20) I I IGBLB I&PSW(230) I Il ______ I ___________ LCLB I&TSW(230) ______________________ JI I ~ ~ Usjng Subscripted SET Symbols: After the programmer ha!2; associated a number of SET variables with a SET symbol, he may assign values to each of the variables and use them in other statements. If the statements in the previous example were part of a macro-definition, (and &A was defined as a SETA symbol in the same definition), the following statements could be part of the same macro-definition. r----------T----------T-----------------, I Name IOperation IOperand I 1 2 3 4 5 ~----------+----------+-----------------~ I &A I SETA I5 I I SETB I (6 LT 2) I I &PSW ( &A) I &TSW( 9) I SETB t (&PSW (&A) ) I I IA 12,=F'&SBOX(4S)' I Il __________ ICLI 'Ij __________ IAREA,C'&WBOX(17) _________________ ~ ~ Statement 1 assigns the arithmetic value 5 1:0 the nonsubscripted SETA symbol &A. Statements 2 and 3 then assign the binary value 0 to subscripted SETB symbols &PSW(S) and &TSW(9), respectively. Statements 4 and 5 generate statements that add the value assigned to &SBOX(4S} to general register 2, and compare the value assigned to &WBOX(17) to the value stored at AREA, respectively. 98 SYSTEM VARIABLE SYMBOLS System variable symbols are local variable symbols that are assigned values automatically by the assembler. There are three system variable symbols: &SYSNDX, &SYSECT, and &SYSLIST. System variable symbols may be used in the name, operation and operand fields of statements in macrodefinitions, but not in statements outside macro-definitions. They may not be defined as symbolic parameters or SET symbols, nor may they be assigned values by SETA, SETB, and SETC instructions. &SYSNDX -- Macro Instruction Index The system variable symbol &SYSNDX may be concatenated with other characters to create unique names for statements generated from the same model statement. &SYSNDX is assigned the four-digit number 0001 for the first macro-instruction processed by the assembler, and it is incremented by one for each subsequent inner and outer macro instruction processed. If &SYSNDX is used in a model statement, SETC or MNOTE instruction, or a character relation in a SETB or AIF instruction, the value substituted for &SYSNDX is the fourdigit number of the macro-instruction being processed, including leading zeros. If &SYSNDX appears in arithmetic expressions (e.g., in the operand field of a SETA instruction), the value used for &SYSNDX is an arithmetic value. Throughout one use of a macrodefinition, the value of &SYSNDX may be considered a constant, independent of any inner macro-instruction in that definition. The example in the next column illustrates these rules. It is assumed that the first macro-instruction processed, OUTERI, is the 106th macro-instruction processed by the assembler. statement 7 is the 106th macroinstruction processed. Therefore, &SYSNDX is assigned the number 0106 for that macroinstruction. The number 0106 is substituted for &SYSNDX when it is used in statements 4 and 6. statement 4 is used to assign the character value 0106 to the SETC symbol &NDXNUM.. statement 6 is used to create the unique name B0106. r----------T-----------T----------------, I Name I Operation IOperand I ~----------+-----------+----------------~ 1 A&SYSNDX 2 3 &NAME 4 &NDXNUM &NAME 5 6 B&SYSNDX MACRO INNERl GBLC SR CR BE B MEND &NDXNUM 2,5 2,5 B&NDXNUM A&SYSNDX MACRO OUTERl GBLC SETC SR AR INNERl &NDXNUM • &SYSNDX' 2,,4 2,6 2,=F'1000' S MEND ~----------+-----------+----------------~ 7 I ALPHA 8 I BETA I OUTERl IOUTERl I I B0106 BETA A0109 L B010a __________ ~ AR SR CR BE B S SR AR SR CR BE B S ___________ ~ The system variable symbol &SYSECT may be used to represent the name of the control section in which a macroinstruction appears. For each inner and outer macro-instruction processed by the assembler, &SYSECT is assigned a value that is the name of the control section in which the macro-instruction appears. When &SYSECT is used in a macrodefinition., the value substituted for &SYSECT is the name of the last CSECT, occurs DSECT, or START statement that before the macro-instruction. If no named CSECT, DSECT, or START statements occur before a macro-instruction, &SYSECT is assigned a null character value for that macro-instruction. I I ~----------+-----------+----------------~ ALPHA SR 2,4 A0107 &SYSECT -- Current control Section 2,6 2,5 2,5 B0106 A0107 2,=F'lOOO' 2,4 2,6 2,,5 2,5 B0108 A0109 2,=F'lOOO' ________________ J statement 5 is the 107th macroinstruction processed. Therefore, &SYSNDX is assigned the number 0107 for that macroinstruction. The number 0107 is substituted for &SYSNDX when it is used in statements 1 and 3. The number 0106 is substituted for the global SETC symbol &NDXNUM in statement 2. statement a is the 108th ma,croinstruction processed. Therefore, each occurrence of &SYSNDX is replaced by the number 0108. For example, statement 6 is used to create the unique name B0108. When statement 5 is used to process the 108th macro-instruction, statement 5 becomes the 109th macro-instruction processed. Therefore, each occurrence of &SYSNDX is replaced by the number 0109. For example, statement 1 is used to create the unique name A0109. Section 10: CSECT or DSECT statements processed in a macro-definition affect the value for &SYSECT for any subsequent inner macroinstructions in that definition, and for any other outer and inner macroinstructions. Throughout the use of a macrodefinition, the value of &SYSECT may be consid~red a constant, independent of any CSECT or DSECT statements or inner macroinstructions in that definition. The rules. next example illustrates these Statement a is the last CSECT, DSECT, or START statement processed before statement 9 is processed. Therefore, &SYSECT is assigned the value MAINPROG for macroinstruction OUTERl in statement 9. MAINPROG is substituted for &SYSECT when it appears in statement 6. statement 3 is the last CSECT, DSECT, or START statement processed before statement 4 is processed. Therefore, &SYSECT is assigned the value CSOUTl for macroinstruction INNER in statement 4. CSOUTl is substituted for &SYSECT when it appears in statement 2. Statement 1 is used to generate a CSECT statement for statement 4. This is the last CSECT, DSECT, or START statement that appears before statement 5. Therefore, &SYSECT is assigned the value INA for macro-instruction INNER in statement 5. INA is substituted for &SYSECT when it appears in statement 2. Extended Features of the Macro Language 99 r----------T-----------T---------------, I Operation I Operand I •----------t-----------t---------------i MACRO I Name INNER CSECT DC MEND &INC SECT 1 2 A(&SYSECT) MACRO OUTERl CSECT DS INNER INNER DC MEND CSOUTl 3 &INCSECT 4 '5 6 7 If the value of subscript n is zero, then &SYSLIST(n) is assigned the value specified in the name field of the macro instruction, except when it is a sequence symbol. 100C INA INB A (&SYSECT) MACRO OUTER2 DC MEND AC&SYSECT) •----------t-----------t---------------~ ICSECT I I B IMAINPROG I 9 I 10 I IDS IOUTERl IOUTER2 1200C I I I I I IDS ICSECT IDS ICSECT IDC ICSECT IDC IDC IDC 1200C I 1100C I IACCSOUT1) I I I I I .----------t-----------t---------------i I MAINPROG I CSECT I I I ICSOUTl I I INA I IINB I I I l----------~ &SYSLIST(n) may be used to refer to the nth positional macro instruction operand • In addition, if the nth operand is a sublist, then &SYSLIST (n,m) may be used to refer to the mth operand in the sublist. where nand m may be any arithmetic expressions allowed in the operand field of a SETA statement. m may be equal to or greater than land n has a range of 1 to 200. The type g length, scaling, integer, and count attributes of &SYSLISTCn) and &SYSLIST{n,m) and the number attributes of &SYSLIST(n) and &SYSLIST may be used in conditional assembly instructions . N'&SYSLIST may be used to refer to the total number of positional operands in a macroinstruction statement. N'&SYSLIST(n) may be used to refer to the number of operands in a sublist. If the nth operand is omitted, N' is zero; if the nth operand is not a sublist, N' is one. The following procedure evaluate N'&SYSLIST: is used to I I 1. A sublist is considered to be one IA(INA) I ACMAINPROG) IACINB) I I I J 2. The count includes operands specifically omitted (by means of commas) . ___________ _______________ ~ opera~d. Examples: Statement 1 is used to generate a CSECT statement for statement 5. This is the last CSECT, DSECT, or START statement that appears before statement 10. Therefore, &SYSECT is assigned the valu(~ INB for macro instruction OUTER2 in statement 10. INE is substituted for &SYSECT when it appears in statement 7. &S_YSLIST -- Macro Instruction Operand N'&SYSLIST Macro Instruction MAC MAC MAC MAC MAC o Kl=DS ,Kl=DC FULL"F, ('1','2'),Kl=DC , Attributes are discussed under "Attributes." 1 4 2 o in Section 7 The system variable symbol &SYSLIST provides the programmer with an alternative to symbolic parameters for referring to positional macro instruction operands. KEYWORD &SYSLIST and symbolic parameters may be used in the same macro definition. Keyword macro definitions provide the programmer with an alternate way of preparing macro ·definitions. &SYSLIST(O) may be used to refer to a symbolic parameter in the macro instruction prototype. If the symbolic parameter is omitted in the macro instruction prototype, then &SYSLIST(O) would refer to a null character value. 100 ~ACRO A DEFINITIONS AND INSTRUCTIONS keyword macro· definition enables a to reduce the number of operands in each macro instruction that corresponds to the definition, and to write the operands in any order. progra~mer The macro instructions that correspond to the macro definitions described in Section 7 (hereinafter called positional macro instructions and positional macro definitions, respectively) require the operands to be written in the same order as the corresponding symbolic parameters in the operand field of the prototype statement. In a keyword macro definition, the programmer can assign standard values to any symbolic parameters that appear in the Section 10: Extended Features of the Macro Language 100.1 operand field of the prototype statement. The standard value assigned to a symbolic parameter is substituted for the symbolic parameter, if the programmer does not write anything in the operand field of the macro instruction to correspond to the symbolic parameter. When a keyword macro instruction is written, the programmer need only write one operand for each symbolic parameter whose value he wants to change. The following keyword prototype statement contains a symbolic parameter in the name field, and four operands in the operand field. ~he first two operands contain standard values. The mnemonic operation code is MOVE. r------T-----------T----------------------, I Name I Operation I Operand I ~------+-----------+----------------------~ I&N L _____ I MOVE ___________ I&R=2,&A=S,&T=,&F= ______________________ JI ~ Keyword macro definitions are prepared the same way as positional macro definitions, except that the prototype statement is written differently. The rules for preparing positional macrodefinitions are in Section 7. ~ Keyword Macro Instruction After a programmer has prepared a keyword macro definition he may use it by writing a keyword macro instruction. Keyword Prototype The format of this statement is: r------------T-----------T----------------, I Operation I Operand I The format instruction is: of a keyword macro I Name ~------------+-----------+----------------~ IA symbolic IA symbol lOne or more I I parameter I loperands of the I lor blank I Iform described I I I I below, separated I commas I ____________ I ___________ Iby L ________________ JI ~ ~ r---------T---------T---------------------, I Name IOperationlOperand I ~---------+---------+---------------------~ IA symbol, I Mnemonic IZero or more operands I Isequence loperationlof the form described I I code I below, separated by I I symbol, lor blank I _________ I commas L _________ _____________________ JI ~ Each operand must consist of a symbolic parameter, immediately followed by an equal sign and optionally followed by a standard value. This value must not include a keyword. A standard value that is operand must immediately follow sign. part of an the equal Anything that may be used as an operand in a macro instruction except variable symbols, may be used as a standard value in a keyword prototype statement. The rules for forming valid macro instruction operands are detailed in section 8. The following are valid type operands. keyword proto- &READER= &LOOP2=SYMBOL &S4==F'4096' The following are invalid keyword prototype operands. CARDAREA &TYPE &TWO =123 (no symbolic parameter) (no equal sign) (equal sign does not immediately follow symbolic parameter) &AREA= X'189A' (standard value does not immediately follow equal sign) Section 10: ~ Each operand consists of a keyword immediately followed by an equal sign and an optional value which may not include a keyword. A;nything that may be used as an operand in a positional macrc instruction may be used as a value in a keyword macro-instruction. The rules for forming valid positional macro instruction operands are detailed in Section 8. A keyword consists of one through seven letters and digits, the first of which must be a letter. The keyword part of each keyword macro instruction operand must correspond to one of the symbolic parameters that appears in the operand field of the keyword prototype statement. A keyword corresponds to a symbolic parameter if the characters of the keyword are identical to the characters of the symbolic parameter that follow the ampersand. The following are valid instruction operands. keyword macro LOOP2=SYMBOL S4==F' 4096' TO= Extended Features of the Macro Language 101 :- Na-m~ - -: - op-e;atio-n - : - oP"e-;;nd: The following are invalid keyword macroinstruction operands. &X4F2=0(2,3) CARDAREA=A+2 =(TO(S), (FROM» (keyword does not begin with a letter) (keyword is more than seven characters) (no keyword) The operands in a keyword macroinstruction may be written in any order. If an operand appeared in a keyword prototype stat.ement, a corresponding operand does not have to appear in the keyword macro-instruction. If an operand is omitted, the comma that would have separated i·t from the next operand need not be written. The following rules are used to replace the symbolic parameters in the statements of a keyword macro-definition. 1. If a symbolic parameter appE~ars in the name field of the prototype statement, and the name field of t:he macroinstruction contains a symbol, the symbolic parameter is replaced by the symbol. If the name field of the macro-instruction is blank or contains a sequence symbol, the symbolic parameter is replaced by a null character value. :- - - - - -1- - - - -,- - - I - - - ---""I 1 I : GBLC 2 : &VALUE 1 SETC 1 &VALUE 1 : ' A=FB' : 3 1,_____ IL ________ MAC I,_______ &VALUE II The following keyword macro-definition, keyword macro-instruction, and generated statements illustrate these rules. r-----T----------T----------------------, IName IOperation IOperand I .-----+----------+----------------------~ I 1 2 3 4 5 I MACRO I&N IMOVE I &N I ST I IL liST I IL I I MEND I I&R=2,&A=S,&T=,&F= I &R, &A I &R , &F I&R,&T I &R, &A I I I I I I I I .-----+----------+----------------------~ 6 IHERE IMOVE IT=FA,F=FB,A=THERE I .-----+----------+----------------------~ IHERE 1ST 12,THERE I IlL 12, FB 1 I 1ST 12, FA 1 1L_____ I L THERE __________ 12, ______________________ JI ~ ~ 2. If a symbolic parameter appears in the operand field of the prototype statement, and the macro-instruction contains a keyword that corresponds to the symbolic parameter, the value assigned to the keyword replaces the symbolic parameter. statement 1 assigns the standard values 2 and S to the symbolic parameters &R and &A, respectively. Statement 6 assigns the values FI~, FB, and THERE to the keywords T, F, and A, respectively. The symbol HERE is used in the name field of statement 6. 3. If a symbolic parameter was assigned a standard value by a prototype statement, and the macro-instruction does not contain a keyword that corresponds to the symbolic parameter, the standard value assigned to the symbolic parameter replaces the symbolic parameter. Otherwise, the symbolic parameter is rE~placed by a null character value. Since a symbolic parameter (&N) appears in the name field of the prototype statement (statement 1), and the corresponding characters (HERE) of the macro-instruction (statement 6) are a symbol, &N is replaced by HERE in statement 2. No~e 1: If a standard value is a selfdefining term the type attribute assigned to the standard value is the letter N. If a standard value is omitted the type attribute assigned to the standard value is the letter o. All other standard values are assigned the type attribute U. 2: Positional parameters cannot be changed to keywords by substitution. That isp in the following example, the expression A=FB, statement 2, will be treated as a positional operand consisting of a character string in the generation of the MAC macro· it will not be treated as a keyword A with the value FB. No~e 102 Since &T appears in the operand field, of statement 1, and statement 6 contains the keyword (T) that corresponds to &T, the value assigned to T (FA) replaces &T in statement 4. Similarly, FB and THERE replace &F and &A in statement 3 and in sta·tements 2 and 5, respectively. Note that the value assigned to &A in statement 6 is used instead of the value assigned to &A in statement 1. Since &R appears in the operand field of statement 1, and statement 6 does not contain a corresponding keyword., the value aSSigned to &R (2), replaces &R in statements 2, 3, 4, and 5. Operand Sublists: The value assigned to a keyword and the standard value assigned to a symbolic parameter may be an operand sublist. Anything that ~ay be used as an operand sublist in a positional macroinstruction may be used as a value in a keyword macro-instruction and as a standard value in a keyword prototype statement. The rules for forming valid operand sublists are detailed in Section 8 under "Operand Sublists." Keyword Inner Macro Instructions: Keyword and positional inner macro instructions may be used as model statements in either keyword or positional macro definitions. Mixed-mode macro definitions are prepared the same way as positional macro' definitions, except that the prototype statement is written differently. If &SYSLIST is used, it refers only to the positional operands in the macro instruction. Subscripting past the last positional parameter will yield an empty string and a type attribute of "0". The rules for preparing positional macro definitions are in Section 7. Mixed-Mode Prototype The format of this statement is: r---~-------T-----------T-----------------' I Operand I ~-----------+-----------+-----------------~ IA symbolic IA symbol lOne or more oper-I I parameter I lands of the form I lor blank I Idescribed below, I I I Iseparated by I lI ___________ I ___________ I _________________ commas JI ~ lI&N _______ I _________ MOVE I&TY,&P,&R,&TO=,&F= _______________________ JI ~ ~ Mixed-Mode Macro-Instruction The format of instruction is: ~ The operands must be valid operands of positional and keyword prototype statements. All the positional operands must precede the first keyword operand. The rules for forming positional operands are discussed in Section 7., under "Macro-Instruction Prototype." The rules for forming keyword operands are discussed above under "Keyword Prototype." mixed-mode macro- r---------T---------T---------------------, IOperationlOperand I IA symbol, I Mnemonic I Zero or more operands I Isequence loperationlof the form described I ,symbol, I code I below, separated by I blank I _________ I _____________________ commas llor _________ JI ~ The following sample mixed-mode prototype statement contains three pOSitional operands and two keyword operands. ~ The operand field consists of two parts. The first part corresponds to the positional prototype operands. This part of the operand field is written in the same way that the operand field of a positional macro-instruction is written. The rules for writing pOSitional macro-instructions are in Section 8. The second part of the operand field corresponds to the keyword prototype operands. This part of the operand field is written in the same way that the operand field of a keyword macro-instruction is written. The rules for writing keyword macro-instructions are described above under "Keyword Macro-Instruction." The following mixed-mode macrodefinition, mixed-mode macro-instruction, and generated statements illustrate these facilities. r------T---------T----------------------, IOperationl Operand , IName ~------+---------+----------------------~ I 1 I&N I&N I I , IMACRO IMOVE IST&TY IL&TY IST&TY IL&TY I I tTY,&P,&R,tTO=,tF= I &R,SAVE I tR,&P&F I &R,tP&TO ,&R,SAVE I I , I , , ~------+---------+----------------------~ 2 IHERE I MOVE ,H,,2,F=FB,TO=FA , ~------+---------+----------------------~ I HERE ISTH ,2,SAVE I I ILH I 2,FB I I ISTH ,2,FA I 2,SAVE lI ______ ILH _________ I ______________________ JI ~ Section 10: a ~---------+---------+---------------------~ Mixed-mode macro' definitions allow the programmer to use the features of keyword and positional macro definitions in the same macro definition. IOperation ~-------+---------+-----------------------~ IName MIXED-MODE MACRO DEFINITIONS AND INSTRUCTIONS I Name r-------T---------T-----------------------, I Name I Operation I Operand I ~ The prototype statement (statement 1) contains three positional operands (&TY,&P, and &R) and two keyword operands (&TO and Extended Features of the Macro Language 103 In the macro instruction (statement 2) the positional operands are written in the same order as the positional operands in the prototype statement (the second operand is omitted). The keyword operands are written in an order that is different from the order of keyword operands in the prototype statement. &F') • Mixed-mode inner macro instructions may be used as model statements in mixed-mode, keyword, and positional macro-definitions. Keyword and positional inner macroinstructions may be used as model statements in mixed-mode macro definitions. 104 MACRO DEFINITION COMPATIBILITY Macro definitions prepared for use with the other System/360 assemblers having macro language facilities may be used with the Operating System/360 assembler provided that all SET symbols are defined in an appropriate LCLB, GBLA, GBLB, or GBLC statement. The AIFB and AGOB instructions will be processed by the Operating System/360 assembler the same way that the AIF and AGO instructions are processed. AIFB and AGOB instructions will cause the count set up by the ACTR instructions to be decremented in exactly the same way as the AGO and AIF instructions. APPENDIXES APPENDIX A: CHARACTER CODES APPENDIX B: HEXADECIMAL-DECIMAL NUMBER CONVERSION TABLE APPENDIX C: MACHINE-INSTRUCTION FORMAT APPENDIX D: MACHINE-INSTRUCTION MNEMONIC OPERATION CODES APPENDIX E: ASSEMBLER INSTRUCTIONS APPENDIX F: SUMMARY OF CONSTANTS APPENDIX G: MACRO LANGUAGE SUMMARY APPENDIX H: SAMPLE PROGRAM APPENDIX I: ASSEMBLER LANGUAGES--FEATURES COMPARISON CHART APPENDIX J: SAMPLE MACRO DEFINITIONS APPENDIX A: CHARACTER CODES r------------T-----------------T---------T---------T-----------------, System/360 Character Set EBCDIC I I I I I I I 8-bit I Punch I I HexaI Printer I I Code I Combination I Decimal I Decimal I Graphics I ~------------+-----------------+---------+---------+-----------------i 00000000 12,0,9,8,1 0 00 00000001 12,9,1 1 01 00000010 12,9,2 2 02 00000011 12,9,3 3 03 00000100 12,9,4 4 04 00000101 12,9,5 5 05 00000110 12,9,6 6 06 00000111 12,9,7 7 07 00001000 12,9,8 8 08 00001001 12,9,8,1 9 09 00001010 12,9,8,2 10 OA 00001011 12,9,8,3 11 OB 00001100 12,9,8,4 12 OC 00001101 12,9,8,5 13 00 00001110 12,9,8,6 14 OE ~0001111 12,9,8,7 15 OF 00010000 12,11,9,8,1 16 10 00010001 11,9,1 17 11 00010010 11,9,2 18 12 00010011 11,9,3 19 13 00010100 11,9,4 20 14 00010101 11,9,5 21 15 00010110 11,9,6 22 16 00010111 11,9,7 23 iJ 00011000 11,9,8 24 18 00011001 11,9,8,1 25 19 00011010 11~9,8,2 26 1A 00011011 11,9,8~3 27 lB 00011100 11,9,8,4 28 1C 00011101 11,9~8,5 29 lD 00011110 11,9,8,6 30 1E 00011111 11,9,8,7 31 1F 00100000 11,0,9,8,1 32 20 00100001 0,9,1 33 21 00100010 0,9,2 34 22 00100011 0,9,3 35 23 00100100 0,9,4 36 24 00100101 0,9,5 37 25 00100110 0,9,6 38 26 00100111 0~9,7 39 27 00101000 0,9,8 40 28 00101001 0,9,8,1 41 29 00101010 0,9#8~2 42 2A 00101011 0,9,8,3 43 2B 00101100 0,9,8,4 44 2C 00101101 0,9,8,5 45 2D 00101110 0,9,8,6 46 2E 00101111 0,9,8,7 47 2F 00110000 12,11,0,9,8,1 48 30 00110001 9,1 49 31 00110010 9,2 50 32 ------------~-----------------~---------~---------~----------------- Appendix A: Character Codes 107 r------------T-----------------T---------T---------T------------------, Character Set I I I EBCDIC I I Systern/360 I I I 8-bit I I Code Punch I I Hexa- I Printer I combination I Decimal I Decimal I Graphics I ~-~----------+-----------------+---------+---------+-----------------~ 00110011 9,3 51 I 33 I 00110100 9,4 52 I 34 I 00110101 9,5 53 I 35 I 00110110 9,6 54 I 36 00110111 9,7 55 I 37 00111000 9~8 56 I 38 Ofrl11001 9,8,1 57 I 39 00111010 9,8,2 58 I 3A 00111011 9,8,3 59 I 3B 00111100 9,8,4 60 3C 00111101 9,8,5 61 3D 00111110 9,8,6 62 3E 00111111 9,8,7 63 3F (blank) 01000000 64 40 01000001 12,0,9,1 65 41 01P00010 12,0,9,2 66 42 01000011 12,0,9,3 67 43 01000100 12,0,9,4 68 44 01000101 12,0,9,5 69 45 01000110 12,0,9,6 70 46 01000111 12,0,9,7 71 47 01001000 12,0,9,8 72 48 01001001 12,8,1' 73 49 f (cent sign) 01001010 12,8,2 74 4A . (period) 01001011 12,8,3 75 4B 01001100 12,8,4 76 4C < ( 01001101 12,8,5 77 40 + 01001110 12,8,6 78 4E I (logical OR) 01001111 12,8,7 79 4F 01010000 12 80 5~ 01010001 12,11,9,1 81 51 01010010 12,11,9,2 82 52 01010011 12,11,9,3 83 53 01010100 12,11,9~4 84 54 01010101 12,11,9~5 85 55 01010110 12,11,9,6 86 56 01010111 12,11~9_7 87 57 01011000 12,11~9~8 88 58 01011001 11,8,1 89 59 01011010 11,8,2 90 5A 01011011 11,8,3 91 5B $ 01011100 11,8,4 92 5C • 01011101 11,8,5 93 50 01011110 11,8,6 94 5E 01011111 11,8,7 95 SF -, (logical NOT) 01100000 11 96 60 - (hyphen) 01100001 0,1 97 61 / 01100010 11,0,9,2 98 62 0'1100011 11,0,9,3 99 63 01100100 11,0,9,4 100 64 01100101 11,0,9,5 101 65 01100110 11~0#9#6 102 66 01100111 11,0,9,7 103 67 01101000 11,0,9,8 104 68 01101001 0,8,1 105 69 01101010 12,11 106 6A 01101011 0,8,3 107 6B , (comma) L. _____________________________ .l. _________ .l. _________ .l. _________________ JI , 108 r------------T-----------------T---------T---------T-----------------, I System/360 I Character Set I I I EBCDIC I Punch I I Hexa- I Pr~nter I combination I Decimal I Decimal I Graphics I ~------------+-----------------+---------+---------+-----------------~ 011011QO 0,8,4 108 6C i 01101101 0,8,5 109 6D (underscore) 01101110 0.8,6 110 6E > ? 01101111 0,8,7 111 6F 01110000 12,11.0 112 70 01110001 12.11.0,9,1 113 71 01110010 12,11,0,9,2 114 72 01110011 12,11,0,9,3 115 73 01110100 12,11,0,9,4 116 74 01110101 12,11,0,9,5 117 75 01110110 12,11,0,9,6 118 76 01110111 12,11,0,9,1 119 17 01111000 12,11,0,9,8 120 78 01111001 8,1 121 79 01111010 8,2 122 7A 01111011 8t 3 123 7B 01111100 8,4 124 1C , (apostrophe) 01111101 8,5 125 7D 01111110 8,6 126 1E = II 01111111 8,7 121 7F 10000000 12,0,8,1 128 80 a 10000001 12,0,1 129 81 b 10000010 12,0,2 130 82 c 10000011 12,0,3 131 83 d 10000100 12,0,4 132 84 e 10000101 12,0,5 133 85 f 10000110 12,0,6 134 86 g 10000111 12,0,7 135 87 h 10001000 12,0,8 136 88 i 10001001 12,0,9 131 89 10001010 12,0,8,2 138 8A 10001011 12,0,8,3 139 8B 10001100 12,0,8,4 140 8C 10001101 12,0,8,5 141 80 10001110 12,0,8,6 142 8E 10001111 12,0,8,1 143 8F 10010000 12,11,8,1 144 90 j 10010001 12,11,1 145 91 k 10010010 12,11,2 146 92 1 10010011 12,11,3 147 93 rn 10010100 12,11,4 148 94 n 10010101 12,11,5 149 95 o 10010110 12,11,6 150 96 p 10010111 12,11,1 151 91 q 10011000 12,11,8 152 98 r 10011001 12,11,9 153 99 10011010 12,11,8,2 154 9A 10011011 12,11,8,3 155 9B 10011100 12,11,8,4 156 9C 10011101 12,11,8,5 157 90 10011110 12,11,8,6 158 9E 10011111 12,11,8,7 159 9F 10100000 11,0,8,1 160 AO 10100001 11,0,1 161 Al 10100010 11,0,2 162 A2 s 10100011 11,0,3 163 A3 t 10100100 11,0,4 164 A4 u i 8-bit I Code I I ------------~----------------_~ _________ ~ _________ ~ _________________ J Appendix A: Character Codes 109 r------------T-----------------T-'--------T--------T------'----------, Character Set I I I EBCDIC I I Systern/360 I I I 8-bi t I Code I Punch Combination I I Hexa- I I Decimal I Decimal I Printer Graphics I I ~-,-----------+.-----------------+---------+---------+-----------------~ 10100101 10100110 10100111 10101000 10101001 10101010 10101011 10101100 10101101 10101110 10101111 10110000 10110001 10110010 10110011 10110100 10110101 11,0,5 11,0,6 11,0,1 11,0,8 11,0,9 11,0,8,2 11,0,8,3 11,0,8,4 11,0,8,5 11,0,8,6 11,0,8,7 12,11,0,8,1 12,11~O,l 12,11,0,2 12,11,0,3 12,11,0,4 12,11,0,5 12,11,0,6 12,11,0,1 12,11,0,8 12,11,0,9 12,11,0,8,2 12,11,0,8,3 1011~110 10110111 10111000 10111001 10111010 10111011 10111100 10111101 10111110 10111111 11000000 11000001 11000010 11000011 11000100 11000101 11000110 11000111 11001000 11001001 11001010 11001011 11001100 11001101 11001110 11001111 11010000 11010061 11010010 11010011 11010100 11010101 11010110 11010111 11011000 11011001 11011010 11011011 11011100 L ____________ 11011101 110 12~11,O#8,4 12,11,0,8,5 12,11,0,8,6 12,11,0,8,1 12,0 12,1 12,2 12,3 12,4 12,5 12,6 12,1 12,8 12,9 12,0,9,8,2 12,0,9,8,3 12,0,9.8,4 12,0,9#8,5 12,0,9,8,6 12,0,9,~,1 ~ 11,0 11,1 11,2 11,3 11,4 11,5 11,6 11,7 11,8 11,9 12,11,9,8,2 12,11,9.8,3 12,11,9,8,4 _________________ 12,11,9,8,5 ~ 165 166 161 168 169 110 111 112 113 114 115 116 171 178 119 180 181 182 183 184 185 186 181 188 189 190 191 192 193 194 195 196 191 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 211 218 219 220 _________ 221 ~ A5 A6 A1 A8 A9 AA AB AC AD AE AF BO B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF CO Cl C2 C3 C4 C5 C6 C1 C8 C9 CA CB CC CD CE CF DO D1 D2 D3 D4 D5 06 01 08 D9 OA DB DC _________ OD v w x Y z A B C D E F G H I J K L M N 0 P Q R ~ ________________ _ r------------T-----------------T---------T---------T-----------------, Character Set I I I EBCDIC I I System/360 I I I a-hit I Code I Punch I I Hexa- I Printer I Combination I Decimal I Decimal I Graphics I ~------------+-----------------+---------+---------+-----------------i I 11011110 12,11,9,8,6 222 DE I 11011111 12,11,9,8,1 223 OF I 11100000 0,8,2 224 EO • 11100001 11,0,9,1 225 E1 11100010 0,2 226 E2 S 11100011 0,3 221 E3 T 11100100 0,4 228 E4 U 11100101 0,5 229 E5 V 11100110 0,6 230 E6 w 11100111 0,1 231 E1 X 11101000 0,8 232 E8 Y 11101001 0,9 233 E9 Z 11101010 11,0,9,8,2 234 EA 11101011 11,0,9,8,3 235 EB 11101100 11,0,9~8,4 236 EC 11101101 11,0,9,8,5 231 ED 11101110 11,0~9,8,6 238 EE 11101111 11,0,9,8,1 239 EF 11110000 0 240 FO 0 11110001 1 241 Fl 1 11110010 2 242 F2 2 11110011 3 243 F3 3 11110100 4 244 F4 4 11110101 5 245 F5 5 11110110 6 246 F6 6 11110111 1 241 F1 1 1~111000 8 248 F8 8 11111001 9 249 F9 9 11111010 12,11,0,9,8.2 250 FA 11111011 12,11,0,9,8,3 251 FB 111'11100 12, 11 , 0 , 9 , 8 , 4 252 FC 11111101 12,11,0,9,8,5 253 FD 11111110 12,11,0,9,8,6 254 FE 11111111 12,11,0,9,8~1 255 FF ------------~-----------------~---------~---------~----------------- Special ¢ Gra~hic Charac.ters Cent Sign Period, Decimal Point Less-than Sign Left Parenthesis Plus Sign Vertical Bar, Logical OR Ampersand Exclamation Point Dollar Sign <( + I & I S * Asterisk ) Right Parenthesis ; Semicolon --, Logical NOT Minus Sign, Hyphen / Slosh , Comma % Percent Underscore - , : @ I = .. Colon Number Sign At Sign Prime, Apostrophe Equal Sign Quotation Mark - Type Bit Pattern Bit Positions 01 234567 PF % Control Character Special Graphic 00 00 0100 01 101100 R a Upper Case Lower Case Control Character, function not yet assigned 11 01 1001 10000001 Examples Greater-than Sign >? Question Mark 00 11 0000 Hole Pattern Zone Punches 1 Digit Punches 12 -9 - 4 0-8-4 I 11 - 9 I 12 -0 - 1 - I 12-11-0 -9 - 8 - 1 I I I Appendix A: Character Codes III APPENDIX B: HEXADECIMAL-DECIMAL NUMBER CONVERSION TABLE The table in this appendix provides for direct conversion numbers in these ranges: of decimal and hexadecimal r--------------T---------------, Hexadecimal I Decimal I I ~--------------+---------------i I I I l ______________ 000 to FFF ~ ______________ 0000 to 4095 J Decimal numbers (0000-4095) are given within the 5-part table. The first two characters (high-order) of hexadecimal numbers (OOO-FFF) are given in the lefthand column of the table; the third character (x) is arranged across the top of each part of the table. To find the decimal equivalent of the hexadecimal number OC9, look for OC in the left column, and across that row under the column for x = 9. The decimal number is 0201. To convert from decimal to hexadecimal, look up the decimal number within the table and read the hexadecimal number by a combination of the hex characters in the left column, and the value for x at the top of the column containing the decimal number. For example, the decimal number 123 has the hexadecimal equivalent of, 07Bi the decimal number 1478 has the hexadecimal equivalent of 5C6. For numbers outside the range of the table" add the following values to the table r--------------T-----------, Hexadecimal I Decimal I I ~--------------+-----------i 1000 4096 2000 8192 3000 12288 4000 16384 5000 20~80 6000 24576 7000 28672 8000 32768 9000 36864 AOOO 40960 BOOO 45056 COOO 49152 0000 53248 EOOO 57344 ______________ ___________ J FOOO 61440 ~ Appendix B: Hexadecimal-Decimal Number Conversion Table 113 0 'I 2 3 4 5. 6 7 8 9 A B C D E F OOx 01x 02x 03x 0000 0016 0032 0048 0001 0017 0033 0049 0002 0018 0034 0050 0003 0019 0035 0051 0004 0020 0036 0052 0005 0021 0037 0053 0006 0022 0038 0054 0007 0023 0039 0055 0008 0024 0040 0056 0009 0025 0041 0057 0010 0026 0042 0058 0011 0027 0043 0059 0012 0028 0044 0060 0013 0029 0045 0061 0014 0030 0046 0062 001~ 04x 05x 06x 07x 0064 0080 0096 0112 0065 0081 0097 0113 0066 0082 0098 0114 0067 0083 0099 0115 0068 0084 0100 0116 0069 0085 0101 0117 0070 0086 0102 0118 0071 0087 0103 0119 0072 0088 0104 0120 0073 0089 0105 0121 0074 0090 0106 0122 0075 0091 0107 0123 0076 0092 010.8 0124 0077 0093 0109 0125 0078 0094 0110 0126 007'1 08x 09x OAx OBx 0128 0144 0160 0176 0129 0145 0161 0117 0130 0146 0162 0178 0'131 0147 0163 0179 0132 0148 01611 0180 0133 0149 0165 0181 0134 0150 0166 0182 0135 0151 0167 0183 0136 0152 0168 0184 0137 0153 0169 0185 0138 0154 0170 0186 0139 0155 0171 0187 0140 0156 0172 0188 0141 0157 On3 0189 0142 0158 0174 0190 01113 015) 0175 0191 OCx ODx OEx OFx 0192 0208 0224 02160 0193 0209 0225 0241 0194 0210 0226 0242 0195 0211 0227 0243 0196 0212 0228 0244 0197 10213 0229 10245 0198 02111 0230 02116 0199 0215 0231 02117 0200 0216 0232 0248 0201 0217 0233 02169 0202 0218 02316 0250 0203 0219 0235 0251 0204 0220 0236 0252 0205 0221 0237 0253 0206 0222 0238 0254 0207 0223 0239 0255 lOx llx 12x 13x 0256 0272 0288 0304 0257 0273 0289 0305 0258 0274 10290 0306 0259 0275 0291 0307 0260 0276 0292 0308 0261 0277 0293 0309 0262 0278 0294 0310 0263 0279 0295 0311 0264 0280 0296 0312 0265 0281 0297 0313 10266 0282 0298 0314 0267 0283 0299 0315 0268 0284 0300 0316 0269 0285 0301 0317 0270 0286 0302 0318 0271 0287 0303 0319 14x 15x 16x 17x 0320 0336 0352 0368 0321 0337 0353 0369 0322 0338 0354 0370 0323 0339 10355 0371 0324 0340 0356 0372 0325 03111 0357 0373 0326 03112 0358 03711 0327 03113 0359 0375 0328 03411 0360 0376 0329 0345 0361 0377 0330 03116 0362 0378 0331 03117 0363 0379 0332 03168 0364 0380 0333 03119 0365 0381 0334 0350 0366 0382 0335 0351 0367 0383 18x I9x lAx '18x 0384 01100 01116 0432 0385 0401 011'17 01133 0386 0402 0418 01134 0387 0403 041!l 0435 0388 01104 0420 01636 0389 0405 10421 0437 0390 01106 01122 01138 0391 0407 0423 01139 0392 01108 04211 04110 0393 01109 0425 016161 0394 0410 01126 0442 0395 0411 01127 0443 0396 01112 01128 0444 0397 01113 0429 016165 0398 04111 0430 0446 0399 0415 01131 01647 lex 'lOx 1Ex 'IFx 0448 0464 0480 0496 0449 0465 0481 01197 01650 0466 0482 01698 0451 01167 0483 01699 0452 0468 0484 0500 0453 0469 01185 0501 0454 01170 0486 0502 0455 0471 0487 0503 0456 ?472 0488 05011 0457 0473 0489 0505 01658 0474 01190 0506 0"59 01175 01191 0507 01160 01176 0492 0508 0461 01177 0493 0509 0462 0478 0494 0510 04H 04!J5 0511 20x ,21x 22x :Ux 0512 0528 OS,.. 0560 0513 0529 051&5 0561 P5U 0530 05116 0562 0515 0531 05"'7 0563 0516 0532 0548 056" 0517 0533 OS" 0565 0518 053" 0550 0566 0519 0535 0551 0567 0520 0536 0552 0568 0521 0537 0553 0569 0522 0538 05516 0570 0523 0539 0555 0571 05216 0540 0556 0572 0525 05111 0557 0573 0526 0542 05711 0527 054) 0559 0575 2"x 25x 26x 27x 0576 0592 0601. 062" 0577 0593 0609 0625 0578 059" 0610 0626 0579 0595 0611 0627 0580 0596 0612 0628 0581 0597 0613 10629 0582 0598 06111 0630 0583 0599 0615 0631 05811 0600 0616 0632 0585 0601 0617 0633 0586 0602 0618 0634 0587 0603 0619 0635 0588 060" 0620 0636 0589 0605 0621 0637 0590 0606 0622 0638 0591 0607 0623 0639 llx 29x lAx JBx 0640 10656 0688 06'" 0657 0673 0689 06112 0658 067" 0690 06U 0659 0675 0691 06"0660 0676 0692 06"5 0661 0677 0693 0646 0662 0678 06911 06117 0663 0679 0695 0648 06616 0680 0696 0649 0665 0681 0697 0650 0666 0682 0698 0651 0667 0683 0699 0652 0668 068" 0700 0653 0669 0685 0701 065" 0670 0686 0702 Ob55 0671 0687 0703 2ex 2Dx 2Ex 2h 070" 0720 0736 0752 0705 0721 0737 0753 0706 10722 0738 075_ 0707 0723 0739 0755 0708 0724 07_0 0756 0709 0725 07'" 0757 0710 0726 07112 0758 0711 0727 07113 0759 0712 0728 074" 0760 0713 0729 07"5 0761 07111 0730 0746 0762 0715 0731 07117 0763 0716 0732 07168 07616 0717 0733 07169 0765 0718 07316 0750 0766 0719 0735 0751 0767 lOx 11x 12x 33x 0768 0784 0800 0816 0769 0785 0801 0817 0770 0786 0802 0818 0771 0787 0803 0819 0772 0788 080" 0820 0773 0789 0805 0821 077" 0790 0806 0822 0775 0791 0807 10823 0716 0792 0808 082" 0777 0793 0809 10825 0778 07916 0810 0826 0779 0795 0811 0827 0780 0796 0812 10828 0781 0797 0813 10829 0782 0798 08116 0830 0783 0799 0815 0831 lltx 35x 36x llx 0832 .on8 08611 0180 0833 08"9 086S 0881 1083" 0850 0866 0882 10835 0851 0867 0883 0836 0852 0868 088" 10837 10853 10869 0885 0831 1085" 0870 0886 0839 10855 0871 0887 08160 0856 0872 0888 0841 0857 0873 0889 10842 0858 10874 08910 08163 0859 0875 0891 084_ 0860 0876 0892 08165 0861 0877 0893 0846 0862 0878 0894 0847 0863 0819 0895 38x 39x 0896 0912 10928 109"" 0897 0913 10929 09.5 0898 109111 09310 0946 0899 10915 10931 109117 0900 0916 0932 09U 0901 10917 0933 09"9 0902 10918 1093" 09510 0903 10919 10935 10951 0904 09210 10936 10952 0905 10921 10937 0953 0906 0922 10938 1095" 0907 10923 10939 0955 0908 0924 0940 0956 0909 0925 10941 0957 0910 0926 09162 10958 09"3 0959 109610 10976 0992 10108 0961 10977 10993 11009 10962 10978 09911 110110 10963 0979 10995 11011 09'" 109810 10996 0965 10981 10997 11013 0966 10982 10998 0967 10983 0999 11015 10968 1098" 101010 101. 0969 10915 1001 1017 10970 0986 110102 1011 0971 10987 110103 1019 10972 10988 1010" 10210 10973 0989 11005 1021 1097. 0990 11006 1022 10975 0991 110107 11023 X .a r-- 3Ax 3Bx 3ex 3Dx 3Ex 3Fx 114 0672 1012 lIOn 05~8 0031 00u7 OOO~ 009~ 0111 0127 01!6~ 0911 0921 6 7 8 9 A B C D E F 101t5 1061 1077 1030 10 .. 6 1062 1078 1031 10117 1063 1079 1032 10"8 106 .. 1080 1033 1049 1065 1081 1034 1050 1066 1082 1035 1051 1067 1083 1036 1052 1068 108" 1037 1053 1069 10115 1038 105.. 1010 10b6 1039 1055 1071 1081 1092 1108 112" l11t0 1093 1109 1125 lnl 109 .. 1110 1126 1'''2 1095 1111 1127 1143 1096 1112 1128 1144 1097 1113 1129 1145 1098 1"" 1130 1, .. 6 1099 1115 1131 1, .. 7 1100 1116 1132 11118 1101 1111 1133 11119 1102 1118 1134 1150 1103 1119 1135 1151 1155 1171 1187 1203 1156 1172 1188 1204 1157 1173 1189 1205 1158 1174 1190 1206 1159 1175 1191 1201 1160 1176 1192 1208 1161 1117 1193 1209 1162 1178 119" 1210 1163 1119 1195 1211 116 .. 1180 1196 1212 1165 1181 1191 1213 1166 1182 1198 1214 1167 1183 1199 1215 1218 123 .. 1250 1266 1219 1235 1251 1267 1220 1236 1252 1268 1221 1237 1253 1269 1222 1238 1251t 1270 1223 1239 1255 1271 122" 12 .. 0 1256 1272 1225 12'" 1257 1273 1226 12"2 1258 1271t 1221 1243 1259 1275 1228 12 .. 4 1260 1276 1229 12 .. 5 1261 1277 1230 1246 1262 1218 1231 12'" 1263 1279 1281 1297 '313 1329 1282 1298 13111 1330 1283 1299 1315 1331 1281t 1300 1316 1332 1285 1301 1317 1333 1286 1302 1318 133 .. 1287 1303 1319 1335 1288 130_ 1320 1336 1289 1305 1321 1337 1290 1306 1322 1338 1291 1307 1323 1339 '292 1308 1324 13_0 1293 1309 1325 13111 ,294 1310 1326 1342 1295 1311 1327 13113 13 .. 1t 1360 1376 1392 131115 1361 1377 1393 13 .. 6 1362 1378 139. 13 .. 7 1363 1379 1395 13 .. 8 136_ 1380 1396 13 .. ' 1365 1381 1397 1350 1366 1382 1398 1351 1367 1383 1399 1352 1368 138_ , .. 00 1353 1369 1385 , .. 0, 135.. 1370 1386 , .. 02 1355 1371 1387 11103 1356 1357 1373 1389 , .. 05 1358 137_ 1390 , .. 06 1359 1375 1391 11107 11108 1112" l1t1110 ,.56 11109 '''25 11t1111 '''57 , .. ,0 11126 l1t1t2 11158 '5 It 11 ,.27 , .... 3 llt59 ''''2 "'28 lit l1li ,..60 111113 11129 1l1li5 l1t61 ,.,5 1431 ''''7 111163 ''''6 11132 lU8 ,..6 .. , .. 11 1433 1lilt 9 , .. 65 11118 lUll , .. 50 , .. 66 ,..,9 , .. 35 1451 11167 1420 11136 11152 , .. 68 11121 111 .. 6 11162 '453 11169 11122 11138 , .. 511 1470 11123 , .. 39 1455 11171 1It72 llt73 '1505 _89 ,.75 1491 1507 1523 llt76 '''92 1508 152" '_77 , .. 93 1509 1525 ,.78 l1t9. 1510 1526 ,.79 ,.95 1511 1527 '''80 , .. 96 1512 1528 ' .. 81 11197 1513 1529 '482 , .. 98 151 .. 1530 '''83 ''''9 1515 1531 ,.84 1500 1516 1532 , .. 85 1501 1511 1533 11186 1502 1518 153" '''87 1503 1519 1535 0 1 2 3 4 5 "Ox Il1x 1t2x "3x 102" 10 .. 0 1056 1072 1025 ,0 .. , 1057 1073 1026 10"2 1058 107 .. 1027 10 .. 3 1059 1075 1028 10.... 1060 1076 .... x 1t5x "6x 1t7x 1088 110 .. 1120 1136 1089 1105 1121 1131 1090 1106 1122 1138 1091 1101 1123 1139 "8x Ux IIIAx IIIBx 1152 1168 118 .. 1200 1153 1169 1185 1201 115 .. 1170 1186 1202 "Cx IIIDx ItBx IIIPx 1216 1232 12 .. 8 1264 1217 1233 12_9 1265 SOx 51x 52x 53x 1280 1296 1312 1328 5ltx 55x 56x 57x 58x x • 5'- SAx 58x 10~9 ,11130 .. ,.. 137~ 1388 , .. 011 lit 37 5Px 150. 1520 1521 '_711 , .. 90 1506 1522 60x 61x 62x 63x 1536 1552 1568 15811 1537 1553 1569 1585 1538 1554 1570 1586 1539 1555 1571 1587 1540 1556 1572 1588 1541 1557 1573 1589 1542 1558 15711 1590 1543 1559 1575 1591 15 .. 4 1560 1576 1592 1545 1561 1577 1593 1546 1562 1578 1594 1547 1563 1579 1595 1548 1564 1580 1596 1549 1565 1581 1591 1550 1566 1582 1598 1 ~51 1567 1583 1599 64x 65x 66x 67x 1600 1616 1632 1648 1601 1617 1633 1649 1602 ·1618 1634 1650 1603 1619 1635 1651 1604 1620 1636 1652 1605 1621 1637 1653 1606 1622 1638 1654 1607 1623 1639 1655 1608 1624 1640 1656 1609 1625 1641 1657 1610 1626 1642 1658 1611 1627 16113 1659- 1612 1628 1644 1660 1613 1629 1645 1661 1614 1630 1646 1662 1615 1631 1647 1663 68x 69x 6Ax 6Bx 1664 1680 1696 1112 1665 1681 1697 1713 1666 1682 1698 1714 1661 16"83 1699 1115 1668 1684 1700 1716 1669 1685 1101 1711 1670 1686 1102 1118 1671 1687 1703 1719 1672 1688 1704 1720 1673 1689 1105 1721 1674 1690 1706 1722 1675 1691 1107 1723 1616 1692 1108 1124 1677 1693 1109 1725 1618 1694 1710 1726 1679 1695 1111 1727 6Cx 6Dx 6Ex 6Fx 1128 1144 1160 1176 1729 1745 1761 1777 1730 1746 1762 1178 1731 1741 1763 1779 1732 1748 1764 1780 1733 17 .. 9 1765 1781 1734 1750 1766 1782 1735 1751 1767 1783 1136 1752 1168 1184 1131 1753 1769 1785 1738 1754 1170 1786 1739 1155 1111 1187 1740 1156 1712 1788 17111 1751 1113 1189 1742 1758 1714 1790 11113 1159 1775 1791 70x 71x 72'x 73x 1792 1808 1824 1840 1793 1809 1825 1841 1794 1810 1826 1842 1795 1811 1827 1843 179 6 1812 1828 1844 1797 1813 1829 1845 1798 1814 1830 1846 1799 1815 1831 18"7 1800 1816 1832 18 .. 8 1801 1811 1833 1849 1802 1818 1834 1850 1803 1819 1835 1851 1804 1820 1836 1852 1805 1821 1837 1853 1806 1822 1838 1854 1807 11123 1839 11155 74x 75x 76x 77x 1856 1872 1888 1904 1857 1873 1889 1905 1858 1874 1890 1906 1859 1875 1891 1907 1860 1876 1892 1908 1861 1877 1893 1909 1862 1878 1894 1910 1863 1879 1895 1911 1864 1880 1896 1912 1865 1881 1897 1913 1866 1882 1898 1914 1867 1883 1899 1915 1868 1884 1900 1916 1869 1885 1901 1911 1870 18d6 1902 1918 1811 1887 1903 1919 78x 79x 7Ax 78x 1920 1936 1952 1968 1921 1937 1953 1969 1922 1938 1954 1970 1923 1939 1955 1971 1924 1940 1956 1972 1925 1941 1957 1973 1926 1942 1958 1974 1927 1943 1959 1975 1928 1944 1960 1976 1929 1945 1961 1977 1930 1946 1962 1978 1931 1941 1963 1979 1932 1948 1964 1980 1933 1949 1965 1981 1934 1950 1966 1982 1935 1951 1967 1983 7Cx 7Dx 7Ex 7Px 198" 2000 2016 2032 1985 2001 2017 2033 1986 2002 2018 2034 1987 2003 2019 2035 1988 2004 2020 2036 1989 2005 2021 2037 1990 2006 2022 2038 1991 2007 2023 2039 1992 2008 202" 201110 1993 2009 2025 20'" 1994 2010 2026 2042 1995 2011 2027 20"3 1996 2012 2028 20 .. 4 1997 2013 2029 20.5 1998 2014 2030 20 .. 6 1999 2015 2031 2041 SCx SOx SEx U88 Appendix B: Hexadecimal-Decimal Number Conversion Table 115 x • " 20118 1 2 3 16 5 6 7 8 9 A B C D E F 205 .. 2010 2086 2102 2055 2071 2081 2103 2056 2012 2088 210 .. 2051 2013 2089 2105 2058 201 .. 2090 2106 2059 2075 2091 2101 2060 2016 2092 2108 2061 2011 2093 2109 2062 2018 2094 2110 2063 2019 2095 2111 20611 2080 2096 20 .. 9 2065 2081 2091 2050 2066 2082 2098 2051 2067 2083 2099 2052 2068 208" 2100 2053 2069 2085 2101 a.x 2112 2128 211616 2160 2113 2129 21lt5 2161 2114 2130 2146 2162 2115 2131 21161 2163 2116 2132 2148 21611 2111 2133 21 .. 9 2165 2118 2134 2150 2166 2119 2135 2151 2167 2120 2136 2152 2168 2121 2131 2153 2169 2122 2138 21516 2170 2123 2139 2155 2111 2124 2140 2156 2112 2125 2141 2157 2113 2126 21162 2158 21116 2121 2143 2159 2115 88x 89x 8Bx 2116 2192 2208 22216 2171 2193 2209 2225 2118 21916 2210 2226 2119 2195 2211 2227 2180 2196 2212 2228 2181 2197 2213 2229 2182 2198 221. 2230 2183 21" 2215 2231 2181t 2200 2216 2232 2185 2201 2211 2233 2186 2202 2218 223 .. 2181 2203 2219 2235 2188 2201t 2220 2236 2189 2205 2221 2237 2190 2206 2222 2238 2191 2201 2223 2239 ICx 8Dx 8Ex .rx 22160 2256 2272 2288 22 •.1 2251 2213 2289 22"2 2258 221" 2290 22U 2259 2215 2291 22 .... 2260 2276 2292 22 .. 5 2261 2277 2293 22116 2262 2218 22911 22U 2263 2219 2295 2248 2264 2280 2296 221t9 2265 2281 2297 2250 2266 2282 2298 2251 2261 2283 2299 2252 2268 22816 2300 2253 2269 2285 2301 2254 2270 2286 2302 2255 2211 2287 2303 90x 91x 92x 93x 230 .. 2320 2336 2352 2305 2321 2337 2353 2306 2322 2338 235 .. 2307 2323 2339 2355 2308 232" 23 .. 0 2356 2309 2325 23 .. , 2357 2310 2326 23 .. 2 2358 2311 2321 231t3 2359 2312 2328 2344 2360 2313 2329 23165 2361 23116 2330 23166 2362 2315 2331 23167 2363 2316 2332 2348 23616 2317 2333 2349 2365 2318 233 .. 2350 2366 2319 2335 2351 2361 '''x 95x fix t7x 2368 238 .. 2 .. 00 2 .. ,6 2369 2385 2.. 01 2.,17 2370 2386 2 .. 02 2",8 2371 2387 2403 2"" 2372 2388 2"0"· 2"20 2313 2389 2405 21621 2314 2390 2"06 2"22 2315 2391 2"07 2"23 2316 2392 2408 2112" 2377 2393 2409 2lt25 2318 2391t 2ltl0 2"26 2319 2395 21t" 2"21 2380 2396 2"'2 21128 2381 2397 2413 2"29 2382 2398 2414 2430 2383 2399 2"'5 21131 2"32 2U8 2U .. 2UO 2U3 21649 2U5 21181 243 .. 21150 21166 2"'2 21t35 2"51 2"67 2U7 2lt53 2469 2lt85 2U8 2lt5" 21170 21186 21139 21155 2.. 71 21187 2""0 2lt56 21172 21688 2ltlll 2 .. 51 2",3 2"89 2""2 21658 2111 .. 21190 211113 2459 21617 2491 24 .... 2460 2U6 21t92 2 .... 5 2lt61 21683 2U6 21t52 2 .. 68 2"8" 2..,3 2""6 21162 2.. 78 2"''' 21147 21663 21679 21695 trx 2 .. 96 2512 2528 25 .... 211197 2513 2529 251t5 21198 25111 2530 251t6 2,.,9 2515 2531 25.., 2500 2516 2532 25 ... 2501 2511 2533 25.., 2502 2518 25316 2550 2503 2519 2535 2551 250 .. 2520 2536 2552 2505 2521 2531 2553 2506 2522 2538 255 .. 2507 2523 2539 2555 2508 252" 25.. 0 2556 2509 2525 25111 2557 2510 2526 25lt2 2558 AOx A1x A2x A3x 2560 2576 2592 2608 2561 2577 2593 2609 2562 2578 259" 2610 2563 2519 2595 2611 25611 2580 2596 2612 2565 2581 2597 2613 2566 2582 2598 26111 2567 2.583 2599 2615 2568 2581t 2600 2616 2569 2585 2601 2611 2570 2586 2602 2618 2571 2587 2603 2619 2572 2588 260" 2620 2573 2589 2605 2621 25716 2590 2606 2622 2575 2591 2601 2623 A.. x A5x A6x A1x 262" 2640 2656 2672 2625 26'" 2657 2673 2626 26"2 2658 267 .. 2621 26U 2659 2615 2628 2611" 2660 2616 2629 26 .. 5 2661 2677 2630 26116 2662 2678 2631 26ft 7 2663 2619 2632 26 .. 8 266 .. 2680 2633 26.9 2665 2681 263 .. 2650 2666 2682 2635 2651 2667 2681 2636 2652 2668 26816 2637 2653 2669 2685 2638 26516 2670 2686 2639 2655 2b71 2687 A8x A9x 2688 270 .. 2720 2736 2689 2705 2721 2737 2690 2106 2722 2738 2691 2107 2723 2739 2692 2708 272" 27160 2693 2709 2725 2741 269" 2710 2726 27112 2695 2711 2127 27163 2696 2712 2728 211616 2697 2713 2729 27165 2698 271 .. 2730 27 .. 6 2699 2715 27312747 2180 2716 2732 27118 2701 2717 2733 27169 2702 2718 273 .. 2750 2703 2719 2735 2751 Arx 2752 2768 27816 2800 2753 2769 2785 2801 2754 2770 2786 2802 2755 2771 2761 2803 2756 2772 2788 2804 2757 2773 2789 "2805 2758 27716 2790 2806 2759 2775 2791 2807 2760 2776 2792 2808 2761 2777 2793 2809 2762 2778 279 .. 2810 2763 2779 2795 2811 276" 2780 2796 2812 '2765 2781 2797 2813 2766 2782 2798 281" 2767 2783 2799 2815 BOx B1x B2x B3x 2816 2832 28118 216. 281 7 2833 28"9 2865 2818 2831t 2850 2866 28'9 2835 2851 2867 2820 2836 2852 2868 2821 2837 2853 2869 2~22 2838 28516 2870 2823 2839 2855 2871 2824 28 .. 0 2856 2872 2825 2841 2857 2873 2826 2842 2858 287. 2827 28113 2859 2875 2828 28 .... 2860 2876 2829 2845 2861 2877 2830 28166 2862 2878 2831 28167 2863 2 £.79 Bllx B5x B6x B7x 2880 2896 2912 2928 2881 2897 2913 2929 2882 2898 29116 2930 2883 2899 2915 2931 288" 2900 2916 2932 2885 2901 2917 2933 2886 2902 2918 293" 2887 2903 2919 2935 2888 290. 2920 2936 2889 2905 2921 2937 2890 2906 2922 2938 2891 2907 2923 2939 2892 2908 29216 29.0 2893 2909 2925 29'" 2894 2910 2926 29162 2895 2911 2927 29163 .Bx 29 .... 2960 2976 2992 2945 2961 29"17 2993 29 .. 6 2962 2978 299" 29"7 2963 2979 2995 29168 2964 2980 2996 2'.9 2965 2981 2997 2950 2966 2982 2998 2951 2967 2983 2999 2952 2968 298. 3000 2953 2969 2985 3001 295 .. 2970 2986 3002 2955 2971 2987 3003 2956 2972 2988 30016 2957 2973 2989 3005 2958 2972990 3006 2959 2975 2991 3007 BCx BDx .Ex Ux 3008 3024 30 .. 0 3056 3009 3025 30'" 3010 3026 3042 3058 3011 3027 30 .. 3 3059 3012 3028 304 .. 3060 3013 3029 30 .. 5 3061 3014 3030 3046 3062 3015 3031 30167 3063 3016 3032 30"8 306. 3017 3033 30119 3065 3018 3034 3050 3066 3019 3035 3051 3067 3020 3036 3052 3068 3021 3037 3053 3069 302~. 3038 3054 3070 3023 3039 3055 3071 lOx 11x 82x 83x 85x 86x 81x SAx tax 99x 9Ax tax 9Cx fOx tb AAx ABx ACx ADx Ux _ex .9x &Ax 116 3057 21115 2511 2527 25163 2559 1 2 3 4 5 6 7 8 9 A B C D E F 3073 3089 3105 3121 3074 3090 3106 3122 3075 3091 3107 3123 3076 3092 3108 3124 3077 3093 3109 3125 3078 3094 3110 3126 3079 3095 3111 3127 3080 3096 3112 3128 3081 3097 3113 3129 3082 3098 3114 3130 3083 3099 3115 3131 3084 3100 3116 3132 juO;) 3088 3104 3120 3101 3117 3133 J086 3102 3118 3134 3087 3103 3119 3135 C4x C5x C6x C7'x 3136 1152 3168 3184 3137 3153 3169 3185 3138 3154 3170 3186 3139 3155 3171 3187 3140 3156 3172 3188 3141 3157 3173 3189 3142 3158 3174 3190 3143 3159 3175 3191 3144 3160 3176 3192 3145 3161 3177 3193 3146 3162 3178 3194 3147 3163 3179 3195 3148 3164 3180 3196 3149 3165 3181 3197 3150 3166 3182 3198 3151 3167 3183 3199 C8x C9x CAx CBx 3200 3216 3232 3248 3201 3217 3233 3249 3202 3218 3234 3250 3203 3219 3235 3251 3204 3220 3236 3252 3205 3221 3237 3253 3206 3222 3238 325_ 3207 3223 3239 3255 3208 322.. 3240 3256 3209 3225 32_' 3257 3210 3226 3242 3258 3211 3227 32 .. 3 3259 3212 3228 324_ 3260 3213 3229 3245 3261 3214 3230 32166 3262 3215 3231 32 .. 7 3263 CCx CDx CEx CFx 3264 3280 3296 3312 3265 3281 3297 3313 3266 3282 3298 33,.. 3267 3283 3299 3315 3268 3284 3300 3316 3269 3285 3301 3317 3270 3286 3302 3318 3271 3281 3303 3319 3272 3288 3320 3273 3289 3305 3321 327_ 3290 3306 3322 3275 3291 3307 3323 3276 3292 3308 3324 3277 3293 3309 3325 3278 3294 3310 3326 3279 3295 3311 3327 DOx Dlx D2x D3x 3328 3344 3360 3376 3329 3345 3361 3377 3330 3346 3362 3378 3331 3347 3363 3379 3332 33118 336_ 3380 3333 3349 3365 3381 3334 3350 3366 3382 3335 3351 3367 3383 3336 3352 3368 3384 3337 3353 3369 3385 3338 33516 3370 3386 3339 3355 3371 3387 33 .. 0 3356 3372 3388 3341 3357 3373 3389 3342 3358 3374 3390 33163 3359 3375 3391 D4x D5x D6x D7x 3392 3408 3112" 3UO 3393 3409 3425 31tltl 3394 3410 3426 3442 3395 3.. 11 3427 3U3 3396 31.,2 3428 3444 3397 3"'3 31t29 3445 3398 3 .. ". 3430 3446 3399 3_,5 31131 31t1t7 3400 3_,6 31132 31148 3401 3_17 3433 3449 3402 31.,8 31t34 345O 3403 31.,9 3"35 31t51 3404 3420 3436 3_52 3405 3421 3437 34·53 3406 3422 3438 3454 3407 3423 3439 3455 D8x D9x DAx DBx 3_56 3_72 3U8 3501t 3_57 3473 3489 3505 3458 3474 3490 3506 3459 3475 3491 3507 3UO 3476 3_92 3508 3461 3477 3.. 93 3509 31t62 31178 31t9_ 3510 3463 31t79 3495 3511 3464 3UO 3496 3512 3465 3481 3497 3513 3466 3482 3498 3514 3U7 3483 3499 3515 3U8 3484 3500 3516 3469 3485 3501 3517 3470 3486 3502 3518 3471 3487 3503 3519 DCx DDx DEx DFx 3520 3536 3552 3568 3521 3537 3553 3569 3522 3538 3554 3570 3523 3539 3555 3571 3521t 354O 1556 3572 3525 35.. , 3557 3573 3526 35_2 3558 357_ 3527 35113 3559 3575 3528 3544 3560 3576 3529 3545 3561 3577 3530 35U 3562 3578 3531 3547 3563 3579 3532 35168 3564 3580 3533 35 .. 9 3565 3581 3534 3550 3566 35112 3535 3551 3567 3583 EOx Elx E2x E3x )584 3600 3616 3632 3585 3601 3617 3633 3586 3602 3618 3634 3587 3603 3619 3635 3588 3604 3620 3636 3589 3605 3621 3637 3590 3606 3622 3638 3591 3607 3623 3639 3592 3608 3624 3640 3593 3609 3625 36ft 1 3594 3610 3626 3642 3595 3611 3627 3643 3596 3612 3628 36164 3597 3613 3629 3645 3598 3614 3630 36166 3599 3615 3631 3647 E4x E5x E6x E7x 3U8 366_ 3680 3696 3649 3665 3681 3.697 3650 3666 3682 3698 31»51 3667 3683 3699 3652 3668 3684 3700 3653 3669 3685 3701 3654 3670 3686 3702 3655 3671 3687 3703 3656 3672 3688 3704 3657 3673 3689 3705 3658 3674 3690 3706 3659 3675 3691 3707 3660 3676 3692 3708 3661 3677 3693 370Q 3662 3678 3694 1710 36&3 3679 3&95 3711 E8x E9x EAx EBx 3712 3728 3144 3760 3713 3729 3745 3761 3714 3730 3746 3762 3715 3731 3747 3763 3716 3732 3748 3764 3717 3733 3749 3765 3718 3734 3750 3766 3719 3735 3751 3767 3720 3736 3752 3768 3721 3737 3753 3169 3722 3738 3754 3770 3723 3739 3755 3771 37216 3140 3156 3772 3725 3141 3751 3773 37:" 3742 3758 3774 3727 3143 3759 3175 ECx £Ox EEx EFx 3776 3792 3808 3824 3777 3793 3809 3825 3778 3794 3810 3826 3779 3795 3811 3827 3780 3796 3812 3828 3781 3197 3813 3829 3782 3798 l814 3830 3783 31.99 3815 3831 378.. 3800 3816 3832 3785 3801 3817 3833 3786 3802 3818 3834 3787 3803 3819 3835 3788 3804 3820 3836 3789 3805 3821 3831 3790 3806 3822 3838 3191 31107 3823 31139 FOx Flx F2x F3x 3840 3856 3872 3888 3841 3857 3873 3889 3842 3858 3874 3890 3843 3859 3875 3891 3844 3860 3876 3892 3845 3861 3877 3893 3846 3862 3878 3894 3847 3863 3879 3895 3848 3864 3880 3896 3849 3865 3881 3897 3850 3866 3882 3898 3851 3867 3883 3899 3852 3868 3884 3900 3853 3869 3885 3901 3854 3810 38116 3902 38S5 3a71 3tHI1 3903 F4x F5x F6x F7x 3904 3820 3936 3952 3905 3921 3937 3953 3906 3922 3938 395.. 3907 3923 3939 3955 3908 3924 3940 3956 3909 3925 39ltl 3957 3910 3926 39"2 3958 3911 39.. 3 3959 3912 3928 39 .... 3960 3913 3929 3945 3961 3914 3930 3946 3962 3915 3931 39 .. 7 3963 3916 3932 391t8 3964 3917 3933 3949 3965 3918 3934 3950 3966 3919 3935 3951 3967 F8x F9x FAx FBx 3968 3984 _000 4016 3969 3985 4001 4017 3970 3986 4002 4018 3971 3987 4003 4019 3972 3988 16001t 16020 3973 3989 4005 4021 3974 3990 4006 16022 3975 3991 4007 4023 3976 3992 16008 4024 3977 3993 _009 4025 3978 3994 401O 4026 3979 3995 4011 4027 3980 3996 4012 4028 3981 3997 4013 4029 39&2 3998 .. 0116 4030 3983 3999 .. 015 4031 FCx FDx FEx FFx 4032 4048 4064 4080 4033 4049 4065 4081 .. 034 4050 4066 4082 4035 4051 4067 4083 4036 4052 4068 4084 4037 4053 4069 4085 4038 4054 16070 4086 4039 .. 055 4071 4087 404O .. 056 4072 4088 4041 4057 4073 4089 40"2 4058 4074 4090 16043 4059 4075 4091 4044 4060 4076 4092 4045 4061 4077 4093 4046 4062 4078 409_ 4047 4063 4079 4095 x COx Clx C2x C3x ° 3072 Appendix B: 3~27 330 .. Hexadecimal-Decimal Number Conversion Table 117 APPENDIX C: BASIC MACHINE FORMAT 8 4 Operation Code Rl 4 ASSEMBLER OPERAND FIELD FORMAT MACHINE-INSTRUCTION FORMAT APPLICABLE INSTRUCTIONS Rl,R2 All RR instructions except BCR,SPM, and SVC Ml,R2 BCR Rl SPM I (See Notes 1,6,8, and 9) SVC R2 RR 4 8 Operation Code Ml 4 R2 8 4 Operation Rl Code 8 Operation Code RX 8 I 4- 4 12 Rl,D2(X2,B2) X2 B2 D2 Rl,S2(X2) Rl,S2 4 4 12 X2 B2 D2 Ml,D2(X2,B2) Ml,D2(,B2) Ml,S2(X2) Ml,S2 (See Notes 1,6,8, and 9) 4 4 12 ~3 B2 D2 4 8 Operation Rl Code 4 4 12 B2 D2 4 8 Operation Rl Code 4 4 12 4 8 Operation Code Rl 4 8 Operation Code Ml 8 4 Operation Code Rl Rl,D~(,B2) -------- ---- All RX instructions except BC BC Rl,R3,D2(B2) Rl,R3,S2 BXH,BXLE,LM,STM,LCL,STCL Rl,D2(B2) Rl,S2 All shift instructions Rl,M3,D2(B2) Rl,M3,S2 (See Notes 1-3,7, 8,and 9) ICM,STCM,CLM RS M3" B2 D2 Appendix C: Machine-Instruction Format 119 ~-r--------------------------------~-------------------------,-"---------------------------------~ BASIC MACHINE FORMAT ASSEMBLER OPERAND FIELD FORMAT ~-+---------------------I-"--.----------""---- 8 8 Operation Code 12 4 12 Bl Dl(B1) ,12 Sl,I2 Dl APPLICABLE INSTRUCTIONS .----- All SI instructions except those listed for other SI formats S1 8 Operation Code '--------_..... J:bJ Dl (Bl) Sl (See Notes 2,3,6, 7,8 and 10) LPSW,SSM,TIO,TCH,TS ~-~---------------------------------+--------------------r-------'--------------------------~ l6~12 Two-byte Operation Code S Bl Dl Sl Dl (B1) (See Notes 2, 3,and 7) SCK,STCK,STIPD,SIOF,STIDC, SIO, IHO, HDV SCKC,STCKC,SPT,STPT,PTLB, RRB 1--------------------+-------,--------1"---'"----,------------8 4 4 12 4 Operatior Code Ll L2 Bl 4 12 Dl B2 D2 Dl(Ll,Bl) ,D2(L2,B2) Sl (Ll) ,S2 (L2) PACK,UNPK,MVO,AP, CP,DP,MP,SP,ZAP Dl(L,Bl) ,D2(B2) NC,OC,XC,CLC,MVC,MVN, MVZ,TR,TRT,ED,EDMK SS 8 Operation Code ope~ation 4 Code No~es 8 4 L Bl Dl B2 D2 4 4 4 12 Ll 13 Bl 12 4 12 TUl D~_~l~J Sl(L) ,52 Dl(Ll,Bl) ,D2(B2),n Sl(Ll),S2,I3 Sl, S2, 13 (See Notes 2,3,5,6, 7 and 10) SRP for Appendix C: 1. Rl, R2, and R3 are absolute expressions that specify general or floating-point registers. The general register numbers are 0 through 15; floating-point register numbers are 0, 2, 4, and 6. 2. Dl and D2 are absolute expressions that specify displacements. may be specified. 3. Bl and B2 are absolute expressions that specify base registers. o - 15. 4. X2 is an absolute expression that specifies an index register. o - 15. 5. L, Ll, and L2 are absolute expressions that specify field lengths. An L expression can specify a value of 1 - 256. Ll and L2 expressions can specify a value of 1 - 16. In all cases, the assembled value will be one less than the specified value. 6. I, 12, and 13 are absolute expre~sions that provide immediate data. and 12 may be 0 - 255. 'rhe value of 13 may be 0 - 9. 7. Sl and S2 are absolute or relocatable expressions that specify an address. S. RR, RS, and S1 instruction fields that are blank under BASIC MACHINE FORMAT are not examined during instruction execution. The fields are not written in the symbolic operand, but are assembled as binary zeros. 9. Ml and M3 specify a 4-bit mask. A value of 0 - 4095 Register numbers are Register numbers are The value of I 10. In IBM System/370 the SIO, HIO, HDV and SIOF operation codes occupy one byte and the low order bit of the second byte. In all other systems the HIO and SIO operation codes occupy only the first byte of the instruction. 120 Appendix D. Machine Instruction Mnemonic Operation Code. This appendix contains two tables of the mnemonic operation codes for all machine instructions that can be represented in assembler language, including extended mnemonic operation codes. The first table is in alphabetic order by instruction. The second table is in numeric order by operation code. In the first table is indicated: both the mnemonic and machine operation codes, explicit and implicit operand formats, program interruptions possible, and condition code set. The column headings in the first table and the information each column provides follow: Instruction: This column contains the name of the instruction associated with the mnemonic operation code. Mnemonic Operation Code: This column contains the mnemonic operation code for the machine instruction. This is written in the operation field when coding the instruction. Machine Operation Code: This column contains the hexadecimal equivalent of the actual machine operation code. The operation code will appear in this form in most storage dumps and when displayed on the system control panel. For extended mnemonics, this column also contains the mnemonic code of the instruction from which the extended mnemonic is derived. Operand Format: This column shows the symbolic format of the operand field in both explicit and implicit form. For both forms, R1, R2, and R3 indicate general registers in operands one, two, and three respectively. X2 indicates a general register used as an index register in the second operand. Instructions which require an index register ~2) but are not to be indexed are shown with a 0 replacing X2. L, L1, and L2 indicate lengths for either operand, operand one, or operand two respectively. M1 and ~3 indicate a 4-bit mask in operand one and three, respectively. 1, 12, and 13 indicate immediate da ta eight bi ts long (1 and 12) or four bits long (13) • For the explicit format, 01 and 02 indicate a displacement and B1 and B2 indicate a base register for operands one and two. For the implicit format, 01, E1, and 02, B2 are replaced by S1 and S2 which indicate a storage address in operands one and two. Type of Instruction: This column gives the basic machine format of the instruction ~, RX, SI, or SS). If an instruction is included in a special feature or is an extended mnemonic, this is also indicated. Program Interruptions Possible: This column indicates the possible program interruptions for this instruction. The abbreviations used are: A - Addressing, S - Specification, OV - OVerflow, P - Protection, Op - Operation (if feature is not installed), and Other - other interruptions which are listed. The type of overflow is indicated by: 0 Decimal, E - Exponent, or F - Fixed Point. Condition Code Set: The condition codes set as a resUlt of this instruction are indicated in this column. (See legend following the table.) Appendix D: Machine Instruction Mnemonic Operation Codes 121 r-- Instruction Add Add Add Decimal Add Ha Ifword Add Logical Mnemonic Operotion Code Machine Operation Code Operand Format Explicit Implicit A AR AP AH AL SA IA FA 4A 5E RI,D2(X2,B2) or RI, D2(,B2) RI,R2 DI (L I, BI), D2(L2, B2) RI, D2(X2, B2)or RI, D2(, B2) RI, D2(X2, B2)or RI, D2(, B2) Add Logical ALR IE RI,R2 Add Normalized, Extended AXR 36 RI,R2 Add Add Add Add Normal ized, Long Norma Iized, Long Normalized, Short Norma Iized, Short AD ADR AE AER 6A 2A 7A 3A RI, D2(X2, B2)or RI, D2(, B2) RI,R2 RI, D2(X2, B2)or RI, D2(, B2) RI,R2 Add Add Add Add And Unnormal ized, Long Unnormalized,Long Un normal ized, Short Unnormol ized, Short Logical AW AWR AU AUR N 6E 2E 7E 3E 54 RI, D2(X2,B2)or RI, D2(,B2) RI,R2 RI, D2(X2, B2)or RI, D2(, B2) RI,R2 RI, D2(X2, B2)or RI, D2(, B2) And Logical And Logical And Logical Immediate NC NR NI D4 14 94 DI (L, BI), D2(B2) RI,R2 DI (BI ),12 SI(L), S2 or 51, S2 Branch and link Branch and Link BAL BAlR 45 05 RI,D2(X2,B2)ar RI,D2(,B2) RI, R2 RI,S2(X2)or R1, S2 Branch Branch Branch Branch Branch BC BCR BCT BCTR BE 47 07 46 06 47(BC 8) M I, D2(X2, B2) or M I, D2(, B2) MI,R2 RI,D2(X2, B2)or RI, D2(,B2) RI, R2 D2(X2, B2) or D2(, B2) MI,52(X2)or MI,S2 52(X2) or 52 Branch on High BH 47(BC 2) D2(X2, B2) or D2(, B2) 52(X2) or 52 Branch in Index High Branch on Index low or Equal Bmnch on low BXH BXlE Bl 86 87 47(BC 4) . RI, R3, D2(B2) RI,R3,D2(B2) D2(X2, B2) or D2(, B2) RI,R3,52 RI,R3,52 52(X2) or 52 Branch if Mixed BM 47(BC 4) D2(X2,B2)or D2(,B2) 52(X2) or 52 on on on on on Condition Condition Count Count Equal RI, S2(X2) or RI,52 SI (L I), S2(L2) or 51, S2 RI, S2 (X2 lor R1,52 RI, 52(X2)or R1,52 RI, S2(X2)or R1,52 RI,S2(X2)orR 1,52 RI,52(X2)or R1,52 RI, 52 (X2)or R1,52 RI, S2(X2)or R1,52 51,12 RI,52(X2)or R1,52 Branch on Minus BM 47(BC 4) D2(X2, B2) or D2(, B2) 52(X2) or 52 Branch on Not Equal BNE 47(BC 7) D2(X2, B2) or D2(, B2) 52(X2) or 52 Branch on Not High BNH 47(BC 13) D2(X2,B2)or 02(,B2) 52(X2) or 52 Branch on Not low BNl 47(BC 11) 02(X2,B2) or 02(, B2) 52(X2) or 52 BI"clnch on Not Minus BNM 47(BC 11) D2(X2,B2)or 02(,B2) 52(X2) or 52 BrClnch on Not Ones BNO 47(BC 14) D2(X2, B2) or 02(, B2) 52(X2) or 52 Branch on Not Plus BNP 47(BC 13) 02(X2, B2) or 02(, B2) 52(X2) or 52 Branch on Not Zeros BNZ 47(BC 7) 02(X2,B2)or 02(,B2) 52(X2) or 52 Branch if Ones BO 47(BC 1) D2(X2, B2) or 02(, B2) 52(X2) or 52 Branch on Overflow BO 47(BC I) 02(X2, B2) or 02(, B2) S2(X2) or 52 Branch on Plus BP 47(BC 2) 02(X2, B2) or 02(, B2) 52(X2) or 52 Branch if Zeros BZ 47(BC 8) 02(X2, B2) or D2(, B2) 52(X2) or 52 Branch on Zero BZ 47(BC 8) D2(X2, B2) or 02(, B2) 52(X2) or 52 Branch Unconditional Branch Uncondi tiona I B BR 47(BC 15) Q7(BCR IS) 02(X2, B2) or 02(, B2) R2 52(X2) or 52 Compare Compore Compare Compare Compare C CR CP CH CL 59 19 F9 49 55 RI,D2(X2,B2)or RI,02(,B2) RI,R2 DI (l 1, Bl), D2(L2, B2) Rl , D2(X2, B2}or RI, D2(, B2) R1, D2(X2, B2)or RI, D2(, B2) RI, 52(X2 or RI ,52 CLC D5 Dl (L, Bl), D2(B2) 5l(L), S2 or 51 ,52 Algebraic Algebraic Dec ima I Halfword Logical Compare Logical .-----~.----.-.-----.- 122 . 51 (l 1), 52(L2)0 r 51, S2 Rl, S2(X2)or RI ,52 Rl, 52(X2)or Rl ,52 ------------- Type of Instruction Instruction Progrom Interruption Possible A S OvP Op Other Add Add Add Decimal Add Ha Ifword Add Logical RX RR SS, Dec imo I RX RX Add Logical RR Add Add Add Add Add Normalized, Extended Normalized,Long Norma Iized, Long Normalized, Short Normalized, Short RR,Floating Pt. RX, Floating Pt. RR, Floating Pt. RX,Floating Pt. RR, Floating Pt. x E x x E x E x x E x E x x x x x Add Add Add Add And Unnormalized,Long Unnormalized, Long UI~normalized, Short Unnormalized, Short Logical RX,Floating Pt. RR, Floating Pt. RX,Floating Pt. RR, Floating Pt. RX x x E x E x x E x E x x x x x x And Logical And Logical And Logical Immediate SS RR SI x x x x Branch and Link Branch and link x x F F x o x x x F x x Condition Code Set 01 10 00 II Overflow Overflow Overflow Overflow Sum 0 Sum=O Sum=O Data Sum=O Sum"'O Sum=O@ SumO Sum >0 Sum>O Sum >0 Sum'" oCD Sum='O@ Sum'" 0(8) Sum= B,C B,C B,C B,C B,C R R R R R L L L L L M M M M M C C C C R R R R J L L L L K M M M M J J J K K K RX RR N N N N N N N N RX RR RX RR RX,Ext. Mnemonic N N N N N N N N N N N N N N N N N N N N RX, Ext .Mnemonic N N N N Branch on Index High RS Branch on Index Low or Equal RS Branch on Low RX, Ext.Mnemonic N N N N N N N N N N N N Branch if Mixed RX, Ext.Mnemonic N N N N Branch on Minus RX, Ext.Mnemonic N N N N Branch on Not Equal RX, Ext. Mnemonic N N N N Branch on Not High RX, Ext.Mnemonic N N N N Branch on Not Low RX, Ext.Mnemonic N N N N Branch on Not Minus RX, Ext.Mnemonic N N N N Branch on Not Ones RX, Ext.Mnemonic N N N N Branch on Not Plus RX, Ext .Mnemonic N N N N Branch on Not Zeros RX, Ext.Mnemonic N N N N Branch if Ones RX, Ext .Mnemonic N N N N Branch on Overflow RX, Ext .Mnemonic N N N N Branch on PI us RX, Ext .Mnemonic N N N N Branch if Zeros RX, Ext. Mnemonic N N N N Branch on Zera RX, Ext.Mnemonic N N N N Branch Unconditional Branch Unconditional RX, Ext.Mnemonic RR, Ext .Mnemonic N N N N N N N N Compare Compare Compare Compare Compare RX RR S5, Decimal RX RX x x x x Z AA AA AA AA AA BB BB BB BB BB SS x Z AA BB Branch Branch Branc:' Branch Branch on on on on on Condition Condition Count Count Equal Branch on High Algebraic Algebraic Decimal Halfword Logical Compare Logical x x x x x x Z Z Data Z Z oCD Sum 0 CD CD Appendix D: Machine Instruction Mnemonic Operation Codes 123 Instruction compare logical Compare logical Characters under M ask Mnemonic Operation Code ClR ClM Machine Operation Code Operand Format Implicit Expl icit 15 BD RI,R2 RI, M3, D2(B2) RI,M3,52 C ompare logical Immediate CLI ClCl CD CDR 95 OF 69 29 DI (B1), 12 RI, R2 51,12 Compere lagical long Compare, long Compare, long RI, D2(X2, B2)or RI, D2(, B2) RI,R2 RI,52(X2)or RI,52 C ompare,5hort Campare,5hort C onvert to Binary C.onvert to Dec imal CE CER CVB CVD D DR DP DD DDR 79 39 4F 4E 5D ID FD 6D 2D RI, D2(X2, B2)or RI, D2(, B2) RI,R2 RI, D2(X2, B2)or RI, D2(, B2) RI, D2(X2, B2)or RI, D2(, B2) RI, D2(X2, B2) or RI, D2(, B2) RI,R2 DI, (l I, BI), D2(l2, B2) RI ,D2(X2, B2),or RI, D2(, B2) RI,R2 RI, 52(X2)or RI, 52 DE DER ED EDMK 7D 3D DE DF RI,D2(X2,B2)or RI,D2(,B2) RI,R2 DI (l, BI), D2(B2) DI (l, BI), D2(B2) RI,52(X2) or RI,52 51(l),52 51(l),52 or 51,52 or 51,52 X 57 RI, D2(X2, B2) or RI, D2(, B2) RI, 52(X2) or RI, 52 Exclusive Or Exclusive Or Exclusivp Or Immediate Execute H alve, long XC XR XI EX HDR D7 17 97 44 24 DI (l, BI), D2(B2) RI,R2 DI (BI), 12 RI, D2(X2, B2) or RI, D2(, B2) RI,R2 51(l),52 or 51,52 51,12 RI,52(X2) RI,52 Halve,5hort HER HDV 34 I 9EOI 9EOOI 43 RI,R2 D1,BI D ivide D ivide D ivide Decimal D ivide, long D ivide, long D ivide, Short D ivide, 5hort Ed it Edit and Mark xclusive Or Halt Device RI, 52(X2)or RI ,52 RI, 52(X2)or RI ,52 RI, 52(X2) or RI, 52 51(ll),52(l2)or 51,52 RI,52(X2) or RI ,52 51 D1 (BI) RI,D2(X2,B2) or RI,D2(,B2) RI,52(X2) BF RI,M3, D2(B2) RI,M3,52 15K l 09 58 RI,R2 RI, D2(X2, B2) or RI, D2(, B2) RI,52(X2) or RI ,52 lR lA lTR lTDR lTER 18 41 12 22 32 RI,R2 RI, D2(X2, B2) or RI, D2(, B2) Rl,R2 RI,R2 RI,R2 RI,52(X2) or RI ,52 Lood Complement Load Complement, long l oad Complement, 5hort lCR lCDR lCER 13 23 33 Rl,R2 RI,R2 Rl,R2 Loed Control oad Ha Ifword oad, Long lCn lH lD B7 48 68 Rl, R3, D2(B2) R1, D2(X2, B2) or Rl, D2(, B2) RI, D2(X2, B2) or RI, D2(, B2) lDR LM lNR LNDR lNER 28 98 II 21 31 RI,R2 R1, R3, 02(B2) RI,R2 Rl,R2 Rl,R2 LPR LPDR LPER LPSW 10 20 30 82 Rl,R2 RI,R2 RI ,R2 DI(BI) lRA lRDR BI 25 RI,D2(X2,B2) or RI,D2(,B2) RI, R2 LRER 35 RI, R2 lE lER MC MVC MVI 78 38 AF D2 92 RI, D2(X2, B2) or RI, D2(, B2) RI,R2 DI(BI),12 DI (l, BI), 02(B2) DI (BI), 12 Halt I/O In sert In sert nder In sert Load lo ad lo ad Lo ad Lo ad Load Character Characters Mask 5torage Key Address and Test and Test, long and Test, Short oad, Long oad Multiple oad Negative oad Negative, Long oad Negative, Short l oad l oad Load l oad Positive Positive, Long Positive, 5hort PSW oed Real Address ood Rounded, Extended to long l cad Rounded, Long to Short Load, Short l oad, Short M onitor Call M ove Characters M ove Immediate ---- 124 HIO IC ICM Rl, R3, 52 Rl,52(X2) R I, 52(X2) or RI, 52 or Rl ,52 or Rl, 52 RI, R3, 52 51 RI,S2(X2) or Rl,S2 RI, S2(X2) or RI, S2 51,12 SI(l), S2 51,12 or 51,52 I See Note I at end of this appendix Type of Instruction Instruction Program Interruptions Possible A P Op Other Condition Code Set spv 00 01 10 Z XX AA yy BB ZZ Z AA BB Z AA BB 11 Compare Logical Compare Logical Characters under Mask Compare Logical Immediate RR RS x x SI x Compare Logical Long RR x x Compare, Long Compare, Long RX,Floating Pt. RR, Floating Pt. x x x x x x Z Z AA AA BB BB Compare, Short Compare, Short Convert to Binary Convert to Dec imal Divide Divide Divide Decimal Divide, Long Divide, Long RX, Floating Pt. RR, Floating Pt. RX RX RX RR SS, Decimal RX,Floating Pt. RR, Floating Pt. x x x x x x x x x x x x x x x x E x E x x x x x F F D,Data B,E B,E Z Z N N N N N N N AA AA N N N N N N N BB BB N N N N N N N N N N N N N N Divide, Short Divide, Short Edit Edit and Mark RX, Floating Pt. RR, Floating Pt. SS, Decimal SS, Decimal x x E x E x x x x x x x x B,E B, E Data Data N N S S N N T T N N N N J K x x x x Data,F Exclusive Or RX x x Exclusive Or Exclusive Or Exclusive Or Immediate Execute Halve, Long SS RR SI RX RR, Floating Pt. x x x x x x x Halve, Short Halt Device Halt I/O Insert Character Insert Characters under Mask Insert Storage Key Load RR, Floating Pt. S S RX RS x x RR RX x x x x Load Load Load Load Load RR RX RR RR, Floating Pt. RR, Floating Pt. x x Load Complement Load Complement, Long Load Complement, Short Load Control Load Halfword Load, Long RR RR, Floating Pt. RR, Floati ng Pt. RS RX RX, Floating.Pt. x x x x x x x x Load, Long Load Multiple Load Negative Load Negative, Long Load Negative, Short RR, Floating Pt. RS RR RR, Floating Pt. RR, Floating Pt. Load Load Load Load Positive Positive, Long Positive, Short Ps-N RR RR, Floating Pt. RR, Floating Pt. SI x x x x x x Load Real Address Load Rounded, Extended to Long Load Rounded, Long to Short Load, Short Load, Short Monitor Call Move Characters Move Immediate RX RR, Floating Pt. x x x E x x Address and Test and Test, Long and Test, Short RR,Floating Pt. RX, Floating Pt. RR, Floating Pt. SI SS SI G x x x A A x x )J: A x x F x x x x A x x x x x x x x x x x x x x x x E UU N AAL GG N SS N N N N N N N N N N J R R N N L L L N N M M M N N P R R N N N L L L N N N M M M N N N 0 N N N N N J N N L L L N N N N M M M 0 L L J R R N KK N A QQ QQ QQ QQ A AAV N AAU N AAP N AAO N N N N N N N N N N N N N N N N N N N N N N N N N x x x N N CC CC N TT N AAM DD N R x x x J K K J K J (May be set by this instruction) N N N R F U U GA Appendix D: Machine Instruction Mnemonic Operation Codes 125 -- ,---- Instruction 1"---------------- Mnemonic Machine Operation Operation ---Code .. -.--- f--_~()d~ ___ Operand Format ~-. Move long Move Numerics Move with Offset MVCL MVN MVO OE Dl F1 Rl,R2 D 1(l, B1), D2(B2) D 1(ll, B1), D2(l2, B2) Move Zones Multiply Multiply Multiply Decimal Multiply Extended Multiply Halfword MVZ M MR MP MXR MH D3 5C lC FC 26 4C Dl(l,B1),D2(B2) Rl,D2(X2,B2)or Rl,D2(,B2) Rl,R2 D 1(ll, B1), D2(l2, B2) Rl,R2 Rl,D2(X2,B2)or Rl,D2(,B2) Multiply, long Multiply, long Multiply, long to Extended Multiply, long to Extended Multiply, Short Multiply, Short No Operation No Operation Or logical Or logical Or logical Or Logical Immediate Pack MD MDR MXD 6C 2C 67 Rl,D2(X2,B2)0I" Rl,D2(,B2) Rl,R2 Rl,D2(X2,B2)or Rl,D2(,B2) MXDR 27 Rl,R2 ME MER NOP NOPR 0 OC OR 01 PACK 7C 3C 47(BC 0) 07(BC 0) 56 D6 16 96 F2 Implicit Explicit 51 (l), 52 or SI,S2 5 l(ll), S2(l2) or SI,S2 Sl(l), 52 Rl,S2( X2) or S 1, S2 or Rl,S2 Sl(Ll), S2(l2) or SI,S2 Rl,S2( X2) orRl,S2 Rl,S2( X2) orRl,S2 Rl,S2( X2) or Rl,S2 R1SS2( X2) or Rl,S2 S2(X2) or 52 Rl,S2( X2) SI (l), 52 or Rl,S2 or 51,52 Rl,D2(X2,B2)or Rl,D2(,B2) Rl,R2 D2(X2, B2) or D2(, B2) R2 Rl, D2(X2, B2) or Rl, D2(, B2) D 1(l, B1), D2(B2) Rl,R2 Dl(B1),12 D 1(ll, B1), D2(l2, B2) 51,12 S1 (l1), S2(l2) or 51,52 Purge Translation lookaside Buffer Read Direct Reset Reference Bit Set Clock Set Clock Comparator Set CPU Timer PHB B20D - - RDD RRB SCK SCKC SPT 85 B213 B204 B206 B208 Dl (Bl), 12 Dl (Bl) Dl (Bl) Dl (Bl) D 1(B 1) SI,12 51 SI 51 SI Set Program Mask Set Storage Key Set System Mask Shift and Round Decimal Shift left Double Algebraic SPM SSK SSM SRP SlDA 04 08 80 FO 8F Rl Rl,R2 D 1(B 1) D 1(ll, B1), D2(B2), 13 Rl, D2(B2) SI S 1(Ll), 52,13 or SI,S2,13 Rl,S2 Shift Shift Shift Shift Shift SlDL SlA Sll SRDA SRDl 8D 8B 89 8E 8C Rl, D2(B2) Rl, D2(B2) Rl, D2(B2) Rl, D2(B2) Rl, D2(B2) Rl,S2 Rl,S2 Rl,S2 Rl,S2 Rl,S2 Shift Right Single Algebraic Shift Right Single logical SRA SRl 8A 88 Rl, D2(B2) Rl, D2(B2) Rl,S2 Rl,S2 Start I/O Start I/O Fast Release 510 SIOF 9COO: 9COI Dl (B 1) D 1(B 1) 51 51 Store Store Channel ID Store Character ST STIDC STC 50 B203 42 Rl,D2(X2,B2)or Rl,D2(,B2) D 1(B 1) Rl,D2(X2,B2)or Rl,D2(,B2) Rl,S2( X2) or Rl,S2 SI Rl,D2(X2) or Rl,S2 Store Mask Store Store Store Characters under STCM BE RI ,M3, D2(B2) Rl,M3, 52 Clock Clock Comparator Control STCK STCKC STCTl B205 B207 B6 D1(B 1) Dl(Bl) Rl,R3,D2(B2) SI SI Rl, R3, 52 Store Store Store Store Store Store CPU ID CPU Timer Halfword long Multiple Short STIDP STPT STH STD STM STE B202 B209 40 60 90 70 Dl (Bl) Dl (Bl) RI, D2(X2, B2) or Rl, D2 (, B2) RI, D2(X2, B2) RI , R2, D2(B2) RI,D2(X2,B2)or Rl,D2(,B2) SI SI Rl,S2( X2) Rl,S2( X2) Rl, R2, 52 Rl,S2( X2) Store Then AND System Mask Store Then OR System Mask Subtract STNSM STOSM 5 AC AD 5B D 1(B 1), 12 D 1(B 1),12 RI, D2(X2) or Rl, D2(X2, B2) 51,12 51,12 Rl, S2( X2) Subtract Subtract Subtract Subtract Subtract SR SP SH Sl SlR lB FB 4B 5F IF Rl, R2 Dl (ll, B1), D2(l2, B2) Rl,D2(X2,B2)or Rl,D2(,B2) RI,D2(X2,B2)or Rl,D2(,B2) Rl, R2 S 1(Ll), S2(l2)or 51,52 Rl,S2( X2) orRl,S2 Rl,S2( X2) orRl,S2 126 left Double logical left Single Algebraic left Single logical Right Double Algebraic Right Double logical Decimal Ha If word logical logical orRl,S2 or Rl,S2 or Rl,S2 orRl,S2 1See Note 2 at end of this appendix Type of Instruction Instruction Program InternJptions Possible A 5 Ov P Op Other Condition Code 5et 00 10 11 Move Long Move Numerics Move with Offset RR 55 55 x x x x x x x x AAA N N AAB N N AAC N N AAD N N Move Zones Multiply Multiply Multiply Decimal Multiply Extended Multiply Halfword 55 RX RR 55, Dec;imal RR,Floating Pt. RX x x x x x x x E x x x x x x Data B N N N N N N N N N N N N N N N N N N N N N N N N Multiply, Long Multiply, Long Multiply, Long! Extended Multiply, Long! Extended Multiply, Short Multiply, Short No Operation No Operation Or Logical Or Logical Or Logical Or Logical Immediate Pack RX, Floating Pt. RR, Floating Pt. RX, Floating Pt. x x E x E x x E x x x x B B B N N N N N N N N N N N N x E x B N N N N x x E x E x x B B N N N N J J J J N N N N N K K K K N N N N N N N N N N N x A N N N N x x x x x x x x x A A A A A N AAQ AAE N N N AAR AAF N N N AAS N N N AAT AAG N N x A A RR N N J J RR N N L L RR N N M M RR N N 0 0 N J N J N N L N L N N M N M N N 0 N J N L N M N N A A MM MM CC CC EE EE KK KK A RR, Floating Pt. RX, Floating Pt. RR,Flooting Pt. RX, Ext. Mnemonic RR, Ext .Mnemonic RX 55 RR 51 55 x x x x x x x x Purge Translation Lookaside Buffer Read Direct Reset Reference Bit Set Clock Set Clock Comparator Set CPU Timer 51 5 5 5 S x x x x x x 5et Program Mask Set Storage Key Set System Mask Shift Left Double Algebraic Sh ift and Round Dec ima I RR RR SI RS SS x x x x F x D Sh ift Shift Shift Shift Shift 5 x Left Double Logical RS RS Left Single Algebraic RS Left Single Logical Right Double Algebraic RS Right Double Logical RS x x Data x F x x 01 N Shift Right Single Algebraic Sh ift Right 5 ingle Logical RS RS Start I/O Start I/O Fast Release S S Store Store Channel ID Store Character RX S RX x x x x x N AAH N N CC N N AAI N N KK N Store Mask Store Store Store Characters under RS x x x N N N N Clock Clock Comparator Control S S RS x x x x x x x x x x x AAJ N N AAK N N AAN N N AAG N N Store Store Store Store Store Store CPU ID CPU Timer Ha If word Long Multiple Short S S RX RX,Flooting Pt. RS RX, Floating Pt. x x x x x x x x x x x x A A N N N N N N N N N N N N N N N N N N N N N N N N A A N N V N N X N N Y N N 0 V V V X X X W,H W,H x x x x x x x Store Then AND System Mask SI Store Then OR System Mask SI RX Subtract x x x x F Subtract Subtract Subtract Subtract Subtract F x D x x F x x Decimal Ha If word Logical Logical RR SS, Decimal RX RX RR x x A A x x x x x x x x Appendix D: DOlo Y y Y V,I V,I - 0 0 0 W,I W,I --.-~- Machine-Instruction Mnemonic Operation Codes 127 Instruction 128 Mnemonic Machine Operation Operation Code Code Operand Format Implicit Explicit Subtract Normalized, Extended Subtract Normalized, Long 5ubtract Normalized, Long 5ubtract Normalized, Short 5ubtract Nom1alized, 5hort Subtract Unnormalized, Long SXR 37 R1,R2 SD 5DR 5E 5ER 5W 6B 2B 7B 3B 6F Rl,D2(X2,B2)ar Rl,D2(,B2) Rl,R2 RI,D2(X2,B2)or Rl,D2(,B2) Rl,R2 RI,02(X2,B2)or Rl,D2(,B2) 5ubtract Unnorma Iized, Long 5ubtract Unnormalized, Short Subtract Unnormalized, 5hort Supervisor Call Test and Set SWR 5U SUR SVC T5 2F 7F 3F OA 93 RI,R2 RI,D2(X2,B2)or Rl,02(,B2) Rl,R2 DI(Bl) SI Test Channel Test I/O Test Under Mask Translate Translate and Test TCH TlO TM TR TRT 9F 90 91 DC DD DI(Bl) DI(BI) D I(B 1), 12 D I(L, BI), D2(B2) D I (L, B1), D2(B2) 51 SI 51,12 S I(L), 52 51 (L), 52 Unpack Write Direct Zero and Add Decimal UNPK WRD ZAP F3 84 F8 D 1(L1, BI), 02(L2, B2) DI(BI),12 DI (L I,B I), D2(L2, B2) SI(L1),52(L2)or 51,S2 51,12 SI(L1), 52(L2)or 51,52 Rl,S2(X2) or RI,S2 Rl, S2(X2) or RI, 52 RI, S2(X2) or RI,52 RI, S2(X2) or RI,52 I or 51,52 or 5 1,52 Program Interruptions Possible Type of Instruction Instruction A S Ov P Op Subtract Normalized, Extended Subtract Normalized, Long Subtract Normal ized, Long Subtract Normalized, Short Subtract Normalized, Short Subtract Unnormalized, Long RR,Floating Pt. Subtract Unnormalized, Long Subtract Unnormalized, Short Subtract Unnormalized, Short Supervisor Call Test and Set RR,Floating Pt. RX,Floating Pt. RR, Floating Pt. RR SI Test Channel Test I/O Test Under Mask Translate Translate and Test SI SI SI SS SS x x x Unpack Write Direct Zero and Add Decimal SS SI SS,Decimal x x x RX,Floating RR, Floating RX, Floating RR, Floating RX,Floating Pt. Pt. Pt. Pt. Pt. x x x x Condition Code Set 01 00 Other 10 11 x E x B,C R L M x x x x x E E B,C B,C B,C B,C C R R E E x x x x x L L L L L M M M M M Q Q Q Q Q x x x E E E x x x C C C R R L L L N M M M N Q Q Q E x R R N SS x A A x x D x R R x x A Data N TT JJ II LL UU N PP CC VV N NN N N N N L J ,- FF EE HH KK N WW N 00 N N M N N 0 -- Program Interruptions Possible Under Ov: HH D = Decimal E = Exponent F = Fixed Point II JJ KK LL MM Under Other: A B C D E F G GA Condition Code Set H I J K L M N o P Q R S T U V W X Y Z AA BB CC DD EE FF GG Privileged Operation Exponent Underflow Significance Decimal Divide Floating Point Divide Fixed Point Divide Execute Monitoring NN 00 PP QQ RR SS TT No Carry Carry Result = 0 Result is Not Equal to Zero Resul t is Less Than Zero Result is Greater Than Zero Not Changed Overflow Result Exponent Underflows Result Exponent Overflows Result Fraction = 0 Result Field Equals Zero Result Field is Less Than Zero Result Field is Greater Than Zero Difference = 0 Difference is Not Equal to Zero Difference is Less Than Zero Difference is Greater Than Zero First Operand Equals Second Operand First Operand is Less Than Second Operand First Operand is Greater Than Second Operand CSW Stored Channel and Subchannel not Working Channel or Subchannel Busy Channel Operating in Burst Mode Burst Operation Terminated Appendix D: UU VV WW XX yy ZZ AAA AAB MC AAD AAE AAF AAG AAH AAI AAJ MK AAL AAM AAN AAO AAP AAQ AAR MS AAT AAU AAV Channel Not Operational Interruption Pending in Channel Channel Available Not Operational Available I/O Operation Initiated and Channel Proceeding With its Execution Nonzero Function Byte Found Before the First Operand Field is Exhausted Last Function Byte is Nonzero All Function Bytes Are Zero Set According to Bits 34 and 35 of the New PSW Loaded Set According to Bits 2 and 3 of the Register Specified by Rl Leftmost Bit of Byte Specified = 0 Leftmost Bit of Byte Specified = 1 Selected Bits Are All Zeros; Mask is All Zeros Selected Bits Are Mixed (::<:eros and ones) Selected Bits Are All Ones Selected bytes are equal, or mask is zero Selected field of first operand is low Selected field of first operand is high First-operand and second-operand counts are equal First operand count is lower First operand count is higher No movement because of destructive overlap Clock value set Clock value secure Clock not operational Channel ID correctly stored Channel activi ty prohibited during I D Clack value is valid Clock value not necessarily valid Channel working with another device Subchannel busy or interruption pending Clock in error state Segment- or Page-Table Length Violation Page-Table Entry Invalid (I-Bit One) Reference Bit Zero, Change Bit Zero Reference Bit Zero, Change Bit One Reference Bit One, Change Bit Zero Reference Bit One, Change Bit One Segment Table Entry Invalid (I-Bit One) Translation Available Machine-Instruction Mnemonic Operation Codes 129 ~---------------.-----------------------------------------------------------------------------------------, RR Format Operation Name Mnemonic Remarks Code ---------------4~--------------------------------------+_---------------------~--------------------~ 00 01 02 03 Set Program Mask Branch and Link Branch on Count Branch on Condition Set Storage Key Insert Storage Key Supervisor Call SPM BALR BCTR BCR SSK ISK SVC OE OF Move Long Compare Logical Long MVCL CLCL 10 11 12 13 14 15 16 17 18 19 lA IB lC ID IE IF Load Positive Load Negative Load and Test Load Complement AND Compare Logical OR Exclusive OR Load Compare Add Subtract Multiply Divide Add Logical Subtract Logical LPR LNR L'I'R LCR NR CLR OR 20 Load Positive (Long) Load Negative (Long) Load and Test (Long) Load Complement (Long) Halve (Long) Load Rounded (Extended to Long) Multiply (Extended) Multiply (Long to Extended) Load (Long) Compare (Long) Add Normalized (Long) Subtract Normalized Multiply (Long) Divide (Long) Add Unnormalized (Long) Subtract Unnormalized (Long) 04 05 06 07 08 09 01'\ DB OC 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F :30 31 32 33 34 35 36 37 38 130 Load Positive (Short) Load Negative (Short) Load and Test (Short) Load Complement (Short) Halve (Short) Load Rounded (Long or Short) Add Normalized (Extended) Subtract Normalized (Extended) Load (Short) XR LR CR AR SR MR DR ALE SLE I,PDR LNDR LTDR LCDR HDE Li<.Lm ~·lXE ~"1XD;( LDR CDR AOR SOR MOR ODR Afli7R SWR LPER LNER LTER LCER HER loRER AXR SXR r,j;R RR Format Operation Name Hnemonic Remarks Code ~------------~--------------------------------------------1-----------~--~f-----------------------~ 39 3A 3B 3C 3D 3E 3F Compare (Short) Add Normalized (Short) Subtract Normalized (Short) Multiply (Short) Divide (Short) Add Unnormalized (Short) Subtract Unnormalized (Short) CER i\.ER SER DER AUR SUR Store halfword Load Address Store Character Insert Character Execute Branch and Link Branch on Count Branch on Condition Load Halfword Compare Halfword Add Halfword Subtract Halfword Multiply Halfword STH LA STC IC EX BAL BCT BC LH CH AH SH MH Convert to Decimal Convert to Binary CVD CVB Store ST AND Compare Logical OR Exclusive OR Load Compare Add Subtract Multiply Divide Add Logical Subtract Logical N l:vlER RX Format 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4E 4F 50 51 52 53 54 55 56 57 58 59 SA 5B 5C 52 5 ~~ 5F 60 61 62 63 Store CL o X L C A S M o AL SL STD (Long) 64 65 66 67 68 69 6A 6B 6C 60 6E 6F Multiply (Long to Extended) Load (Long) Compare (Long) Add Normalized (Long) Subtract Normalized (Long) Multiply (Long) Divide (Long) Add Unnormalized (Long) Subtract Unnormalized (Long) Appendix 0: MXD LD CD AD SO MD DO AW SW Machine-Instruction Mnemonic Operation Codes 130.1 RX Format r-.- Operation Name Mnemonic Store (Short) STE Load (Short) Compare (Short) Add Normalized (Short) Subtract Normalized (Short) Multiply (Short) Divide (Short) Add Unnormalizecl (Short) Subtract Unnormalized (Short) LE CE AE SE ME DE 1\.U SU Remarks Code 1-- 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F !-- RS,SI, and S Format 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F AO Al A2 A3 A4 AS A6 130.2 Set System Mask --- Load PSW Diagnose Write Direct Read Direct Branch on Index High Branch on Index Low or Equal Shift Right Single Logical Shift Left Single Logical Shift Right Single Shift Left Sinqle Shift Right Double Logical Shift Left Double Logical Shift Right Double Shift Left Double SSM LPSW WRD RDD BXH BXLF SRL SLL SRi'. SLA SRDL SLDL SRDA SLD1\. Store Multiple Test under Mask Move (Immediate) Test and Set AND (Immediate) Compare Loqical (Immedi a t(~) OR (Immediate) Exclusive OR (Immediate) Load Multiple S'I'M TM MVI TS NI CLI Start I/O, Start I/O Fast Release Test I/O Halt I/O, Halt Device Test Channel SIO,SIOF TIO HIO,HDV TCH 01 XI LM See i'Jote 2 See Note 1 RS,SI, and S Format Operation Code Name Mnemonic Remarks A7 A8 A9 AA AB AC AD AE AF BO Bl B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF Store Then AND System Mask Store Then OR System Mask STNSM STOSM Monitor Call MC Load Real Address LRA (First byte of two-byte operation codes) Store Control Load Control STCTL LCTL Compare Logical Characters under Mask Store Characters under Mask Insert Characters under Mask CLM STCM ICM Move Numerics Move (Characters) Move Zones AND (Characters) Compare Logical (Characters) OR (Characters) Exclusive OR (Characters) MVN MVC MVZ NC CLC OC XC Translate TR • SS Format CO Cl C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF DO Dl D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC Appendix D: Machine-Instruction Mnemonic Operation Codes 130.3 • SS Format' Operation Name Hnemonic Translate and Test Edit Edit and Mark TRT ED EDMK Shift and Round Decimal Move with Offset Pack Unpack SRP MVO PACK UNPK Zero and Add Decimal Compare Decimal Add Decimal Subtract Decimal Multiply Decimal Divide Decimal ZAP CP AP SP MP DP Remarks Code DD DE DF EO El E2 E3 E4 E5 E6 E7 W8 E9 EA EB EC ED EE EF FO FI F2 F3 F4 F5 F6 F7 Fa F9 FA FB FC FD FE FF NOTES 1. Under the System/370 architecture, the machine operations for Halt Device and Halt I/O are as follows: ~OOI 1110 XXXX XXXoJ Halt I/O HIO [001 1110 XXXX XXXII Halt Device HDV (X denotes an iqnored bit position) 130.4 2. Under the Systemv370 architecture, the machine operations for Start I/O and Start I/O Fast Release are as follows: 1001 1100 xxx x XXXO Start 1/0 SIO 1001 1100 XXXX XXX1 Start I/O Fast Release SlOP (X denotes an ignored bit position) Operation Code B202 B203 B204 B205 B206 B207 8208 8209 820D B213 Mnemonj.c Name Store CPU 1D Store Channel ID Set Clock Store Clock Set Clock Comparator Store Clock Comparator Set CPU Timer Store CPU Timer Purge Translation Lookaside Buffer Reset Reference Bit STIDP ST1DC SCK STCK SCKC STCKC SPT STPT PTLB RRB Appendix D: Machine-Instruction Mnemonic Operation Codes 130.5 APPENDIX E: ASSEMBLER INSTRUCTIONS r---------T--------------------------------T--------------------------------------------, Name Entry I Operand Entry I I Operation I ~---------+--------------------------------+--------------------------------------------~ I ACTR IMust not be present IAn arithmetic SETA expression I ~---------+--------------------------------+--------------------------------------------~ I AGO IA sequence symbol or not presentlA sequence symbol I ~---------+--------------------------------+--------------------------------------------~ IAIF IA sequence symbol or not presentlA logical expression enclosed in parenthe-I I I Ises, immediately followed by a sequence I I I I symbol I ~---------+--------------------------------+--------------------------------------------~ I ANOP I A sequence symbol IWill be taken as a remark I ~---------+--------------------------------+--------------------------------------------~ ICCW IAny symbol or not present IFour operands, separated by commas I ~---------+--------------------------------+--------------------------------------------~ ICNOP I IA sequence symbol or not presentlTwo absolute I comma expressions, separated I by al I ~---------+--------------------------------+---------------------------------------------~ ICOM IA sequence symbol or not presentlWill be taken as a remark I ~---------+--------------------------------+--------------------------------------------4 I COpy I Must not be present I A symbol I ~---------+--------------------------------+--------------------------------------------~ ICSECT IAny symbol or not present IWill be taken as a remark I ~---------+--------------------------------+--------------------------------------------~ I CXD * I Any symbol or not present I Will be taken as a remark I ~---------+--------------------------------+--------------------------------------------~ IDC IAny symbol or not present lOne or more operands, separated by commas I ~---------+--------------------------------+--------------------------------------------~ I DROP IA sequence symbol or not presentlOne to sixteen absolute expressions, sepa-I I I I rated by commas I ~---------+--------------------------------+--------------------------------------------~ IDS IAny symbol or not present lOne or more operands, separated by commas I ~-.--------+--------------------------------+--------------------------------------------~ I DSECT I A variable symbol or an IWill be taken as a remark I I I ordinary symbol I I ~---------+--------------------------------+--------------------------------------------4 I DXD * I A symbol lOne or more operands, separated by commas I ~---------+--------------------------------+--------------------------------------------~ I EJECT IA sequence symbol or not presentlWill be taken as a remark I ~---------+--------------------------------+--------------------------------------------~ 'I END I A sequence symbol I A relocatable expression I I lor not present lor not present I ~---------+--------------------------------+--------------------------------~-----------i I ENTRY IA sequence symbol or not present lOne or more relocatable symbols, separated I I I I by commas I ~---------+--------------------------------+--------------------------------------------4 IEQU I A variable symbol or an IAn absolute or relocatable expression I I I ordinary symbol I I ~---------+--------------------------------+--------------------------------------------i I EXTRN IA sequence symbol or not present lOne or more relocatable symbols, separated I I I Iby commas I ~---------+--------------------------------+--------------------------------------------~ IGBLA IMust not be present lOne or more variable symbols that are to bel I I lused as SET symbols, separated by commas 2 I ~---------+--------------------------------+--------------------------------------------~ IGBLB IMust not be present lOne or more variable symbols that are to bel I I lused as SET symbols, separated by commas 2 I ~---------+--------------------------------+--------------------------------------------~ IGBLC IMust not be present lOne or more variable symbols that are to bel I I lused as SET symbols, separated by commas 2 I ~---------+--------------------------------+--------------------------------------------4 lICTL lMust not be present lOne to three decimal values, separated byl I 1 I commas I ~---------~--------------------------------~--------------------------------------------i 1* Assembler F only I IL ___________________________________________________________________ ..JI Appendix E: Assembler Instructions 131 r-------r----------------------Operation I I ,L _______ Entry IL _______________________ Name Entry I I : LCLB : Must not be present I I r I r: T -----------------------------, I I I _____________________________ Operand Entry JI ~ I I • '- !.S~~ ____ L ~~s~ _ O! _b~ _p_r~s_e~~ _________ 1 _ rr:w:, _d:~l:.m~~ ~~l~=s-, _ ~ep~r~~e.? _ ~y_ ~ .?~~~ -{ : LeLA : Must not be present lOne or more variable symbols that are to , " I be used as SET symbols, separated by I L _ _ _ _ _ _ _ L _ _ _ _ _ _ _______ .__________ .1 _ ~0.!!ll!!a_s ~ _______________________ .J ' One or more variable symbols that are to : be used as SET symbols, separated by commas 2 , --------------------------------------------------------------, : LCLC : Must not be present. : One or more variable symbols separated , I L _______ ,_ ._____________ .__________ .L _by_ ~o~a_s ~ _____________________ -' L _______ L _______________________ , LTORG 'Any symbol or not present , MACRO 1 '.Must not be present J' ' _________ Will be taken ___________________ as a remark ~ ' ~ Will be taken as a remark I ~-------~-----------------------~---------~-------------------~ , MEND1 I :________ MEXIT1 I I MNOTE 1 A sequence symbol or not present' Will be taken as a remark , --------------------------------T-----------------------------1 A sequence symbol or not present, Will be taken as a remark L _____________________________________________________ _ I I . ' , A sequence symbol, a var1able A severity code, followed by a comma, I symbol or not present , followed by any combination of characters, ,________ L _____________ ... _________ ..! _ «:.n~!.o~!:~.!-~ ~~o~~r_oEI:.e~ ____________ ~ I I, OPSYN* II I An or d'1nary symb 0 1 I ' · · · · co d e, an I Ah mac 1ne 1nstruct10n mnemon1C : I I extended mnemonic code, or an operation , code defined by a previous OPSYN instruc-, tion I r-----------------------,-----------------------------~ A machine or extended mnemonic operation code I I , ,Blank I I , I I r-------r-----------------------,-----------------------------. ORG , A sequence symbol or not present A relocatable expression or not present I r-------r-----------------------,-----------------------------. I PRINT A sequence symbol or not present lone to three operands I i I PUNCH - - -'-A- ;eq~e~~e- ~ymb~l-~; ;;t- pr~;;nt , - On~ - t-o-e-ighty - c-h~;a~te~; ~~;l~;ed - i~- L _______ IL I I REPRO I I SETA I _______________________ 1I A sequence symbol or not present L _______ L _______________________ A SETA symbol I _____________________________ J apostrophes Will be taken as a remark ~--------------------- I - - -: ________ JI An arithmetic expression I ~-------r-----------------------~-----------------------------~ I SETB A SETB symbol f I , I I A 0 or a 1, or logical expression enclosed in parentheses I I r-------r-----------------------~-----------------------------~ I SETC A SETC symbol I I I I , I A type attribute, a character expression, a substring notation, or a concatenation of character expressions and substring notations I I I ~-------~-----------------------+-----------------------------~ I SPACE I I A, sequence symbol or not present, I I A decimal self-defining term or not present I I ~-------r-----------------------~-----------------------------~ I START I Any symbol or not present I A self-defining term or not present r -' - - - - - -,- - - - - - - - - - - - - - - - - - - - - - - - T - - - - - - - - - - - - - -' - - - - - - - - - - - - - - - , I I TITLE3 I A special symbol (0 to 4 charlOne to 100 characters, enclosed in I I I acters), a sequence symbol, a apostrophes I I I variable symbol, or not I I I present I I r-------r-----------------------,-----------------------------~ I USING I A sequence symbol or not present I An absolute or relocatable expression I i IL I I followed by 1 to 16 absolute expres_______ LI _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ I _sions, _ _ _ _ _separated _ _ _ _ _ _ _by _ _commas ______________ ~ I I I ' ~ I : WXTRN : A sequence symbol or not present lOne or more relocatable symbols, sepa: : : rated by commas I : : ~---------------------------------------------------------------------------------------~ 1 May only be used as part of a macro-definition. 2SET symbols may be defined as subscripted SET symbols. 3See Section 5 for the description of the name entry. *Assembler F only. I LI _____________________________________________________________ J 132 I : ~SSEMBLER STATEMENTS r---------------------------T-----------"------------------T-----------------------------, I INSTRUCTION I I !\.lAM.F: EHTRY I OPERAND ENTRY .---------------------------+-----~-----------------------+-----------------------------~ IModel Statements 3 I I I I I .. IAn ordinary symbol, variable I symbol, sequence variable I symbol, a cOnlnination of Ivariable symbols and other Icharacters that is equivalent Ito a symbol, or not present I I IAny combination of charlaeters (includinq variable I symbols) I I I I I I I .---------------------------+-----------------------------+-----------------------------~ IPrototype Statement 1 I I I I I I I IA symbolic parameter or Inot present I I I I I I IZero or more operands that I lare symbolic parameters, sep-I larated by commas, followed byl Izero or more operands I I (separated by commas) of thel Iform symbolic parameter, I lequal sign, optional standardl Ivalue I .---------------------------+-----------------------------+-----------------------------~ I Macro-Instruction IStatement 1 I I I I IAn ordinary symbol, a IZero or more positional Ivariable symbol, a sequence loperands separated by commas, I symbol, a combination of Ifollowed by zero o~ more Ivariable symbols and other Ikeyword operands (separated Icharacters that is equivalent I by commas) of the form Ito a symbol,2 or not present I keyword, equal sign, value 2 I I I I I I .---------------------------+-----------------------------+------------------------------~ IAssembler Language IStatement 3 .. I I I I lI ___________________________ IAn ordinary symbol, a varIAny combination of characters I liable symbol, a sequence I (including variable symbols) I I I I symbol, a combination lof variable symbols and I I lother characters that is I I lequivalent to a symbol, I I lor not present J _____________________________ JI _____________________________ ~ ~ May only be used as part of a macro definition. Variable symbols appearing in a macro instruction are replaced by their values before the macro instruction is processed. 3 Variable symbols may be used to generate assembler language mnemonic operation codes as listed in Section 5, except ACTR, COPY, END, ICTL, CSECT, DSECT, ISEQ, PRINT, REPRO, and START. Variable symbols may not be used in the name and operand entries of the following instructions: COPY, END, ICTL, and ISEQ. Variable symbols may not be used in the name entry of the AcrR instruction . .. No substitution for variables in the line following a REPRO statement is performed. 5 When the name field of a macro instruction contains a sequence symbol, the sequence symbol is not passed as a name field parameter. It only 1 ~ ______ ~::_~::~~~~_~:_~_~~::~~::_~::~~~_:::~~:_:~~_~~~~~:~~~~~_~::~~b!!_~ ________________ J Appendix E: Assembler Instructions 133 APPENDIX F: SUMMARY OF CONSTANTS r------T---------T--------T--------T--------------T---------T---------T--------T---------, I I 1 I 1 1 NUMBER 1 1 1 1 1 1 1 1 1 1 LENGTH 1 1 1 SPECIFIED I RANGE 1 BY I IMPLIED 1 1 MODII LENGTH 1 ALIGN- I FIER I TYPE 1 (BYTES) 1 MENT 1 OF CON- I r 1 STANTS 1 RANGE 1 RANGE 1 PER 1 FOR EX- 1 FOR I OPERAND I PONENTS r SCALE 1 TRUN- 1 1 CATION/ I I PADDING I 1 SIDE r ~------+---------+--------+--------+--------------+---------+---------+--------+---------~ I C , I as I needed 1 byte I 1.1 to I characters 1 256 (1) I lone 1 I " " 1 right , I ~------+---------+--------+--------+--------------+---------+---------+--------+---------i I X ,as I byte 1.1 to I hexadecimal l o n e , I I left I , I needed I I 256 (1) I digits I I I I I ~------+---------+--------+--------+--------------+---------+---------+--------+---------i "B 'as , b y t e , .1 to I binary lone, , I left , , 'needed I ,256 I digits , , , , , ~------+---------+--------+--------+--------------+---------+---------+--------+---------i IF' 4 , 1 I word 1 ,.1 to 1 8 I decimal I digits 'multi1 pIe I -85 to , +75 I -187 tol left 1 +346 1 (4) I , ~------+---------+--------+--------+--------------+---------+---------+--------+---------i ,H I ,2 1 half I I word ,.1 to ,8 1 decimal I digits 1 multiI pIe ,-85 to I +75 1 -187 ,+346 1 left (4) 1 I I ~------+---------+--------+--------+--------------+---------+---------+--------+---------i 1E I 1 I 4 1 1.1 to I 8 I decimal I digits 1 pIe I -85 to I +75 I I , , , I word I 8 1 digits , pIe I +15 I 0-14, , I word I multi- ,0-14 Irig~t (4)1 .------+---------+--------+--------+--------------+---------+---------+--------+---------i I D I 8 1 double 1 .1 to I decimal 'multi- r -85 to r I right (4)1 ~------+---------+--------+--------+--------------+---------t---------7--------t---------~ (3)116 'double 1. 1 to I word 1 16 I decimal , digits I -85 to 10-28 Iright (4)1 I I I ~------4_--------+_-------+------- ... -----------.-... --------... ----------f------..... -t--------'1 I P I as I byte 1·1 to I decimal I multi- , I I left , I 'needed I , 16 I digits I pIe, I , I 'L , 1 I multi- I pIe I +75 ~------+---------+--------+--------+--------------+---------+---------+--------+---------i Z 'as I byte 1.1 to I decimal 'multi- I I ,left, 1 1 needed , , 16 , digits I pIe I , I I I .------+---------+--------+--------+--------------+---------+---------+--------+---------i 1A ,4 1 word 1'.1 to 'any I multi- , 1 I left I I 1 , 4 (2) I expressio~ 1 pIe 1 1 1 , ~------+---------+--------+--------+--------------+-----~---+---------+--------+---------i I Q(3) 14 1 word ,1-4 I ~yrnbol narn- ,mult1- I I I left I I I I , I 1ng a DXD I pIe 1 I I I , •______ +---------+--------+--------+-Q.-P~~~l-----+---------+---------+--------+---------i I 4 I word I 3 or 1 relocatable 1 multi- , 1 I left , I V , I , , I I , 1 I 1 , I I 1 1 I I word, I I I , I , , 1 I I 4 1 symb()l I pIe, I , , 1 I I I I , I I I 1 I 1 I I I I , I , I .------+---------+--------+--------+--------------+---------+---------+--------+---------i 1S I 2 ,half I 2 only lone absolute 1 multi- 1 , 1 , 1 1 1 I or relocatab-, pIe Ie expression, or two absol-I ute express- I , ions: , 1 exp (exp) , , , , , ~------+---------+--------+--------+--------------+---------+---------+--------+---------i ,y ,2 ,half 1. 1 to I any I multi- I I 1 left , 1 , 1 word 1 2 (2) 1 expression 1 pIe, 1 1 , .------~---------~--------~--------~--------------~---------~---------~--------L---------i 1 (1) In a DS assembler instruction C and X type constants may have length specification 1 I to 65535. 1 I (2) Bit length specification permitted with absolute expressions only. Relocatable A- , 1 type constants, 3 or 4 bytes only~ relocatable y-type constants, 2 bytes only. I I (3) Assembler F only. I I (4) Errurs will be flagged if significant bits are truncated or if the value specified I L___ :~~~~_~:.~~~:.~~~d_~~_t~=_~m~~~e..?_:.e~~~_~~_t..?~_~~~t~~t_= ____________________ J Appendix F: Summary of constants 135 MACRO LANGUAGE SUMMARY APPENDIX G: The four charts in this appendix summarize the macro language described in Part II of this publication. Chart 1 indicates which macro language elements may be used in the name and operand entries of each statement. Chart 2 is a summary of the expressions that may be used in macro-instruction statements. Chart 3 is a summary of the attributes that may be used in each expression. Chart 4 is a summary of the variable symbols that may be used in each expression. Variabl. Symbol. ~--------------r----------------------------------------~ Global SET Symbols local SET Symbols System Variable Symbols Attributes ~----r-----.-----r-----_r---r------.----_r------,,-----.------~------r---~·-,------,---~----.----~ Statement Symbolic Parameter SETA SETC SETB SETA SETB SETe r-------~------~----~------~------r_---_r------- MACRO t-------+------t------f-----+------- - - - - - .-.Pratotype Statement -.-~--- &SYSNDX &SYSEeT &SYSLIST Type ------ - ---+-----1----- length Scaling Integer _. ,.-....- - - -.------t-----t----.- -----~.-.- Name Operand - t-------+-----t-----f'-----,-r---- ..- + - - - -f -----+-- - . - - - l - - , - - f - - - t - - - . - . - + - - - - t - - --.. ~--~.GBlA Operand --.---- GBtB .--.- -.-.- GBle Operand lClA -'--f----- ._. Operand --- - -. t·· Operand Name Operation Operand Name Operation Operand Nome Operation Operand Name Operation Operand Nome Operation Operand Nome Operation Operand t------+------t-----+---_I_-'---~-'--_+-'----- SETA Operan; Name Operand Operand 3 Operand 9 Operan~ Operanct6 Nome Operand Ope",nd Operand 7 OperandS SETe -- Nome Operation Operand Name Operation Operand Operand9 Operand c---- -.-+-----+--- Operand 3 Operan~ 6 Operand Operand4 Operand6 Operand 4 Name Operand Operand Operand Operand ~---- Operand 6 Operand 6 Nome Operand Name Operand Operand 7 OperandS Operon; Operand 6 Operand 6 Operand Operand 6 Operand r------~-----t__----~------t----- Operand 6 Operand Operand Operand Operand OperandS OperandS --- - _. - - -' .. -- ----+------+ Operand 6 Operand 4 Operand 4 Operand 6 --c··-- .--- ---...----+----_+------ Operand - ---,--+-.--4~-.---f---.-- t-----t----+---+----+----t-----r------t----r---Operand 6 Nam. Nome Nome Operation Operation Operand Operand Name Operand t------r------t-----~------+_ - . .- OperandS _. -.--.- OperandS Operand - OperandS OperandS .. OperandS -' .._. --... - - - - - f - - . - - .. - - - - . - . OperandS OperandS ~------- OperandS -, t-----+_------lr-----_+------+_----_1r-----t----+------i~ Operanct2 Operand 3 Operand Operand 2 Operand 3 Operand Operanct2 --.. -.--- f-'--'-- 1-.-----:- -----.-Opertond Operon; t - - - - + _ - - - - - l r - - - _ + - - - - t - - - - - - l t - - - - - - t - - - - + . - - - - ------ --. -- ..... Operand f-----I-.----- - - - -- Operand -.- -- ---- Operand Operand roo -.~ -. Name ... ~.- -Name MEXIT t-----+_----lr---_+-----t-----it----t--.,----- -----Operand Operand Operand Operand Operand Operand Operand MEND -----t------+-----~---~-.---- Operand Operand Name Operand Name Operand Name Operand Name Operand Nome Operand - . .- -----+-----+------- Name Operand Name Operand Name Operand Name Operand Name Operand Name Operand t-----+_--_1~---_+----+_--_1~----_I_----+_---- Assembler language Statement t-------~ ____ Name Operation Operand ____ ~~ ~ Name Operation Operand ______ Name Operation Operand __ ~_'_ Nome Operation Operand ____ ~~ Name Operation Operand __ _L~ f-.-....-.-- -f-- .-- r-'- . - -.- Name -. -.~.- Name Name Operand t------+_--_1~---_+----+_---_1~---_I_------+_----~~------+_--_+-----r______- Name Operand -----_r-----I------4~---. Name Operand - - - - - t - - - - f - - - - +------+-.-. -- -- Outer Mocra 1. 2. 3. 04. S. 6. 7. S. 9. Name Operand f-· .- Operand ANOP Inner Mocra --- Name Operand AGO MNOTE ....- .- - - - - -----,+-----_.. _.-1---_.- lelC ACTR .... . ---+------1-------- - - - - - f - - - - - - - ----r-------f----.- .--. -. ....- lClB AIF - -- -.--- t-----+-----t-----+------_I_----~--_+----+_----~---_1~--+_------r__--- SETB ... Operand r-----~----~--~---~- Model Statement _. --,..__ _. ~----- Operand r-----~---t__--~---~---t__--_r---+----t------ Sequence Symbol Number Count Name Operand Name Operand .. ~_'__~L__. ___ ~ ______ •.. ~.- .- .. - ... - . - --Name Name Operand ---- f---r--'-- Nome Operotion Operand - ~._._~ - _ _ _ _ _L ___ Nome .- Variable symbols in macro-instructions are replaced by their valves before processing. Only if value i••elf-defining term. Converted to arithmetic +1 or -!{). Only in character relations. Only in arithmetic relations. Only in arithmetic or character relation •• Converted to unsigned number. Converted to character 1 or O. Only if one to eight decimal digih. Chart 1. Macro Language Elements Appendix G: Macro Language Summary 137 Chart 2. Conditional Assembly Expressions r-------------T-------------------------T---------------------------T-------------------, I Expression I Arithmetic Expressions I Character Expressions I Logical Expressions I .-------------+-------------------------+---------------------------t-------------------i May 1. Self-defining terms 1. Any combination of 11. SETB symbols contain 2. Length, scaling, integer, count, and number attributes 3. SETA and SETB symbols 4. SETC symbols whose value is 1-8 decimal digits 5. Symbolic parameters if the corresponding operand is a selfdefining term 6. &SYSLIST(n) if the corresponding operand is a self-defining term 7. &SYSLIST(n,m) if the corresponding operand is a self-defining term 8. &SYSNDX ~ characters enclosed 12. in apostrophes I 2. Any variable symbol 13. enclosed in apostrophes I I Arithmetic relations!. Character relations 2 3. A concatenation of I variable symbols and I other characters I enclosed in apostrophes 4. A request for a type attribute •.-.------------t------------------------- +------ --------------------t -------------------i I Operators I are ; . I +,-,*, and / I pa rentheses penni tted I concatenation, with alAND, OR, and NOT I period (.) I parentheses per- I I I I I I mi t ted 1 I of values I I 11 (true) I I used in 1 2. Arithmetic relations I 3. Subscripted St~T I symbols I 4. &SYSLIST I 5. Substring notation I 6. sublist notation I 2. Character relations 2 12. AIF operands 1 .-------------t-------------------------+---------------------------t-------------------i I Range I -2 to +2 -1 I 0 through 255 characters 10 (false) or I 31 31 .-------------+-------------------------+---------------------------t-------------------i I May be I 1. SETA operands I 1. SETC operands 11. SETB operands I 3 I I I I I I 1 I I I I I I I I I I I 1 I .-------------~-------------------------~---------------------------~-------------------~ I An arithmetic relation consists of two arithmetic exptessions related by thel operators GT, LT, EQ, NE, GE, or LE. 1 I 2 A character relation consists of two character expressions related by the operator I I GT, LT, EQ, NE, GE, or LE. The type attribute notation and the substring notation I may also be used in charact.er relations. The maximum size of the character I I I expressions that can be compared is 255 characters. If the two character I I expressions are of unequal size, then the smaller one will always compare less thanl I the larger. I IL_____________________________________________________ 3 Maximum of eight characters will be assigned. ------------------------- _________ JI 1 I 138 Chart 3. Attributes * r-----------T----------T----------------------T-----------------------T-----------------, I Attribute I Notation IMay be used with: IMay be used only if IMay be used in I ' I 'type attribute i s : , I I ~-----------+----------+----------------------+-----------------------+-----------------~ I Type ,T' ISymbols outside I (May always be used) 11. SETC operand I I I ,macro definitions; , I fields I I I I symbolic parameters, , 12. Character I I , I &SYSLIST'( n), and I I relations I I &SYSLIST (n, m) inside I I , I , I I I macro ·definitions I I I ~-----------+----------+----------------------+-----------------------+-----------------~ I Length I L' I Symbols outside I Any letter except I Arithmetic I , I lmacro definitions; IM,N,O,T, and U I expressions I , I I symbolic parameters, I I I I I I I I I &SYSLIST(n), and I I I I I &SYSLIST(n, m) inside I I I I macro definitions I , I .-----------+----------+----------------------+-----------------------+-----------------~ I Scaling I S' ISymbols outside I H,F,G,D,E,L,K,P, I Arithmetic I , , lmacro definitions; , and Z ,expressions I t I I symbolic parameters, , I I I I I , , I &SYSLIST(n), and , , I &SYSLIST(n,m) inside , , I , , I macrodefini tions , , I .-----------+----------+----------------------+-----------------------+-----------------~ ,Integer I I' ISymbols outside I H,F,G,D,E,L,K,P, I Arithmetic I , I I macro· -definitions; I and Z I expressions I , I ,symbolic parameters, , , I , I ,'SYSLIST(n), and , I I I I , &SYSLIST (n, m) inside I I I , , 'macro ·definitions I I I .-----------+----------+-------~--------------+-----------------------+-----------------~ I Count I K' ISymbolic parameters IAny letter I Arithmetic I I I expressions I , I I corresponding to I I I , , I macro instruction , , ,operands, &SYSLIST I I I , , I(n), and &SYSLIST(n,m)I I I I I I inside macro I I I I I I definitions I I I .-----------+----------+----------------------+-----------------------+-----------------~ I Number I N' ISymbolic parameters, IAny letter ,Arithmetic I I , I'SYSLIST, a n d , I expressions I , , ,&SYSLIST(n) inside , I I def ini tions , _________________ JI ,L ___________ L, __________ L'IDilcro ______________________ L, _______________________ L • NOTE: There are definite restrictions in the use of these attributes. Section 9. Appendix G: Refer to text, Macro Language Summary 139 Chart 4. Variable Symbols r--------------T-------------T-----------------T--------------T-------------------------, IVar.iable IDefined by: I Initialized, IValue changed be used in: I I symbol I I~.ay lor set to: I by: I I .--------------+-------------+-----------------+--------------+-------------------------~ I Symbolic 1 I parameter I I I Prototype I statement I I I Corresponding I 1l34 SAMP1l35 SAMPL 136 SAMP1l37 SAMP1l38 SAMP1l39 SAMP1l40 SAMP1l41 SAMP1l42 SAHP1l43 SAMP1l44 SAMP1l45 SAMPLl46 SAMP1l47 SAMPLl4S SAMP1l49 SAMP1l50 SAMP1l51 SAMPl152 SAMP1l53 SAMP1l54 SAMPLl55 SAMP1l56 SAMP1l57 SAMPLl58 SAMPLl59 SAMP1l60 SAMPLl61 SAMPl162 SAMP1l63 SAMP1l64 SAHP1l65 SAMP1l66 SAHPLl67 SAMP1l68 SAMPl169 SAMP1l70 SAHPLl71 SAMP1l72 SAMPll73 SAHPLl74 SAMPLl75 SAMPl176 SAMPll17 SAMPl178 SAMP1l79 SAMPL1S0 SAHP1l81 SAMPLl82 SAMP1l83 SAMPLl84 SAMPl185 SAMPLl86 SAMPlUn SAMP1l88 SAMPLlS9 Appendix H: Sample Program 143 APPENDIX I: ASSEMBLER LANGUAGES--FEATURES COMPARISON CHART Features not shown below are common to all assemblers. In the chart: Dash Not a II owed. = As defined in Operating System/360 Assembler Language Manual. X Feature Basic Progromming Support/36O: Basic Assembler 7090/7094 Support Package Assembler BPS 8K Tape, BOS 8K Disk Assemblers DOS/TOS Assembler 05/360 Assembler No. of Continuation Cards/Statement (exclusive of macro-instructions) 0 0 1 1 2 Input Character Code EBCDIC BCD & EBCDIC EBCDIC EBCDIC EBCDIC Maximum Characters per symbol 6 6 8 8 8 Character self-defining terms 1 Char. only X X X X Binary self-defining terms ---- X X X X X X X X X Extended mnemonics - X X X X Maximum Location Counter value 2 16 _1 224_1 224_1 224_1 224_1 Multiple Control Sections per assembly - -- X X X ELEMENTS: Length attribute reference Literals - EXPRESSIONS: Operators + -* + -*/ + -*/ + -*/ + -*/ Number of terms 3 16 3 16 16 Levels of parentheses --- --- 1 5 5 X X X ---- --- --- X X X2 X - - Except Address Consts. X X --- - ---- -- X2 X X X X X X X X X Complex relocatability ASSEMBLER INSTRUCTIONS: DC and OS Expressions allowed as modifiers Multiple operands Multiple constants in an operand Bit length specifications Scale modifier Exponent Modifier DC types Except B, P, Z V, Y, S, L Except B, V, L Except L X2 DC dupl ication factor Except A X Except S X 1Assembler F only 2DOS 14K D Assembler only Appendix I: Assembler Languages--Features Comparison Chart 145 -Feature -DC duplication factor of zero Basic Programming Support/360: Basic Assembler 7CfJO/7CfJ4 Support Package Assembler - - -- Except H, E, D X f--- DS types f--- DS length modi fer Only C, H, F, D DOS/TOS Assembler OS/360 Assembler - --- ~- DC length modifier BPS 8K Tope, BOS 8K Disk Assemblers --------Only C, X X X X Except l X2 X Except S -- X f--- H, F, D Only C Only C X X X 256 256 256 65,535 65,535 - .- - - X X X - .- - - - X X -- X X X X X X X ._--X X X X X X X X X X X X X X X 6 operands X X 5 operands X X ~- DS maximum length modifier f--- DS constant subfield permitted -COpy -CSECT -- - DSECT -- --- ISEQ - .- - - LTORG - -- -- PRINT -- - - TITLE - - X - - - - - 1 operand X ---- .- COM leTl 1 operand (lor 25 only) ---- -- - --- ~-- --- ---- - 1--- USING 2 operands (operand 1 relocatable only) 2-17 operands (operand 1 relocatable only} - 1--- 1 operand only X CCW operand 2 (re locatable only) X X X X ORG no bl(]nk operand no blank operand X X X 1 operand only 1 operand only 1 operand only X X I operand only (max 14) 1 operand only I operand only X X X2 Xl 2 decimal digits X X - X X X X X DROP --c---- f--- -ENTRY -- EXTRN WXTRN -CNOP PUNCH --- REPRO ----Macro Instructions -- -- 2 decimal digits 2 decimal digits _._--- - - .-- -- -- - - -- -- X X X - -- -- -- Xl X X X X X ~- OPSYN -- EQU --- 'Assembler F only 2 DOS Assembler 14KD only 146 - BPS 8K Tape, BOS 8K Disk Assemblers Macro Faci I ity Features Operand Subl ists Attributes of macro-instruction operands inside macro definitions and symbols used in conditional assembly instructions outside macro definitions. BOS 16K Disk/Tape Assembler ---- Subscripted SET symbols 05/360 Assembler X X X X X X 1 Maximum number of operands 49 100 Conditional assembly instructions outside macro definitions - - X X global SETA 16 * * global SETB 128 * * global SHC 16 * * local SETA 16 * * local SETB 128 * * local SETC 0 * * 200 Maximum number of SET symbols * The number of SET symbols permitted is variable, dependent upon available main storage. 1 Note: The maximum size of a character expression is 127 characters for the DOS/TOS Assembler D and 255 characters for the OS Assembler F. 1 200 for Assembler F Appendix I: Assembler Languages--Features Comparison 147 APPENDIX The macro definitions in this appendix are typical applications of the macro language and conditional assembly. Another macro definition is included in the sample program as part of Appendix H. SAMPLE MACRO DEFINITIONS Notice the use of the inner macro instruction (IHBERMAC) within SAVE for the purpose of generating MNOTE statements. Included with SAVE are some examples of the statements generated from it. MEMBER NAME SAVE MACRO SAVE £.REG,f.COOl:,£.[D LCLA £.A, &H,(.C LCLC &r:,&F,r.G,&H AIF I '!oREG' EQ to I.El AIF I'!.ID' .. E(J "I.NULLID AIF 1'& 10' EO '*' I.SPECID &A SETA IIK'(.ID+21/21*2+4 &NAME &A.IOol51 B dRANCH AROUND 10 &A SETA K'('IU All ((.~ I DC LEr-JGTH f1F IDENTIFI""R .CONT8 AIF I&A (IT 321.SPLITUP • CONT AA AIF I('A GT 81.8RAKDW~ &E SETC '(,10' 11>8+1,£.AI DC CL&A'&E' IDENTIFIER AGO .CONTA • BRAKOWN ANOP &E SETC '&10' 1&1:1+1,81 DC CL8'&E' IDENTIFIER &B SETA &8+8 &A SETA &<\-8 AGO .CO"lTAA .SPLITUP ANOP &E SETC '&IO'I&IH1,81 &f SETC '&10'1&8+1,81 &G SETC '& IO' ( &8+ 1 7,8 I &H SETC '&IO'(&B+25,61 DC Cl32'&E.&F.&G.&H~ IDENTIFIER &B SETA ('B+32 &A SETA &A-32 .corHB AGO .NUlllO ANOP &NAME OH OS AGO .CONTA .SPECIO AIF I'&NAME' EO "I.CSECTN tE SETC '&NAME' &A SETA 1 .CONTO AIF 1'&E'll,&AI EO 'U'I.LEAVE &A SETA &A+l AGO .CONTQ .LEAVE ANOP &8 SETA II&A+21121*2+4 f;NAHE £.8.10,151 B BRANCH !\ROUND ID DC All I £.AI DC CL&A'£.E' IDENTIFIER AGO .CO~TA .CSECTN AIF I'&SYSECT' EQ "1.E4 &E SETC '&SYSECT' &A SETA 1 AGO .CONTO .E4 IHBERHAC 78,360 CSECT NAI'E ~UlL .CONT A IT'®ll1 NE '1'1' I.E3 AIF AIF I'£.CODE' EQ 'T'I.CONTC AIF I'tCOOE' NE " I.E2 &A SETA ®lll*4+20 AIF I&A lE 75 I .CONTO tA SETA £.A-64 .CONTO AIF CN'® NE 21.CONTE STM ®lll,®I2I,&A.1131 ~AVE fl.EGISTERS MEXIT .CONTE AIF IN'® NE 1 I • E3 ST ®I 1 I ,&A. 113,01 SAVE REGISTER MEX IT .CONTC AIF 1 ® 11 I GE 14 OR ®C 11 LE 21.CONTF ST~ 14,15,121131 SAVE REGISTERS &A SETA ®lll*4+20 AIF IN'f.REG /\lE 21.COl'HG STH ®lll,tREGI21,&A.1131 SAVE REGI~TERS MEXIT AIF. .CONTC IN'® NE 11. E3 ST &REClll,&A.113,OI SAVE REGISTER HEXIT &NAME J: 00020000 00040000 00060001) 1)0080000 aOlOOOO!) 00120000 00140000 1)0160000 00180000 0020000-) 00220000 00240000 00260000 0028000<) 00300000 0032000) 00340000 00360000 00380000 00400000 00420000 00440000 00460000 004ClOOOO 00500000 00520000 00540000 00560000 OC580000 00600000 00620000 00640000 00660000 00680000 00700000 00720000 00740000 00760000 Ov780000 00800000 00820000 OUfl40000 008(0001) 0081:10000 00900000 009<'0000 00940000 00160000 0091:10000' 01000000 01020000 01040000 01000000 01080000 01100000 01120000 01140000 01160000 01180000 01200000 01220000 01240000 '01260000 01280000 01300000 01320000 01340000 01360000 01380000 01400000 01420000 01440000 Appendix J: Sample Macro Definitions 149 I"I'® ~E 21.CONTH AIF 14, &R E G 1 2 ) , 121 13) STM MOIT (~'® NE 11. E 3 AIF .CONTH 14. &R E G ( 1 ) • 121 13) STM MEXIT IHBERMAC 18,360 .fl HEXIT IHBERHAC 37,360,&CODE .E2 HEXIT IHBERMAC 36.360,&RlOG .1'3 MEND END OF DATA FOR SOS OR MEMBER .CONTF SAVE REGISTERS SAVE REGISTEP,S REG PARAM II'ISSING INVALID CODE SPECIFIED INVALID RI::GS. SPECIFIED 01460000 01480000 01500000 01520000 01540000 01560000 01580000 01600000 OJ62000J 01640000 01660000 01680000 SAMPLE SAVE MACRO INSTRUCTIONS FOGHORN FOGHORN SAVE OS STM (l~.12) OH 1~.12.12113) SAVE REGISTERS ........... SAVE OS (REGl~.REG121.T OM 12,... IHB002 INVALID FIRST OPERAND SPECIFIED-IREG1~,R ........... SAVMACRO SAVE SAVMACRO 8 Il~.121.T 1~CO.151 •• BRANCH AROUND 10 All(8) DC DC CL8'SAVMACRO' IDENTifiER STM 1~.12.121131 SAVE REGISTERS MEMBER NAME £NAME £NAME NOlt MACRO NOTE &DC8 AIF ('&UC8' EQ "I.EKR IHBINNRA &DCU l 1 5 , fl4 ( 0, 1 ) BALR 14,15 MEX IT .ERR ~fHBER IHBERMAC 6 MEND NAME POINT MACRO POINT &DCB,&LOC AIF !'f.DCIP EQ "I.ERRI i'&LOC' to "1.f::RR2 IHRINNRA &DC8,&LOC 15,8410, L) 3AL 14,4115,0) AIF .ERR2 IH8ERMAC 6 MEXIT I HBERMAC MEND MEMBER NAME CHECK ~OECij A!F ('&oECB' EQ "I.EI t:.oECR 810.11 15,5210,14) 14,15 fli:qNNRA L 1. ... L f\AlR .tl 1:50 OOOtsOOOO LUAU RTN AnORESS 00100000 LINK TO NOTE ROUTINF 00120000 00140000 1)0160000 00130000 ~OT~ 00020000 00040000 OOObOOOO 00080000 00100000 LOAD POINT RTN ADDRESS 00120000 LINK ro POINT ROUTJN[ 00140000 00160000 00180000 0020001)0 00220000 00240000 CHECK MACRO &NAME 00020000 00040000 00060000 MEX IT IHI:lERMAC 01,018 MEND 00020000 00040000 00060000 ouoeoooo piCK UP DCB AODRESS 00100000 LUAD CHECK RUUT. ACOR. 0012000') L1~K TO CHECK ROlJTI~1' 0014000J 00160000 00180000 00200000 INDEX Indexes to systems reference library manuals are consolidated in the publication OS Master Index to Reference Manuals, Order No. GC28-6644. For additional information about any sub ject below, refer to other publications listed for the same sub ject -i~ ~h~ -Mast;r Index. &SYS,restrictions on use 67,81,95 &SYSECT (see current control section name) &SYSLIST (see macro instruction operand) &SYSNDX (see macro instruction index) 7090/7094 Support Package Assembler 3,145 Absolute expressions 17,29 Absolute terms 10 ACTR instruction 89 Address constants 47-49 A-type 47 Complex relocatable expressions 47 Literals not allowed 15 Q-type 48 S-type 48 V-type 48 Y-type 47 Address specification 30 Addressing Dummy sections 25 Explicit 19 External control sections 28 Implied 19 Relative 21 AGO instruction 89 AIF instruction 88 Alignment, boundary CNOP instruction for 56 Machine instruction 29 Ampersands in Character expressions 83 Macro instruction operands 71 MNOTE instruction 94 Symbolic parameters 67 Variable symbols 62,140 ANOP instruction 90 Apostrophes Character expressions 84 Macro instruction operands 71 MNOTE instruction 94 Arithmetic expressions Arithmetic relations 86 Evaluation procedure 82 Invalid examples 82 Operand sublists 72 Operators allowed 81 Parenthesized terms evaluation 82 examples 82 SETA instruction 81 SETB instruction 86 Substring notation 84 Terms allowed 81 Valid examples 81 Arithmetic relations 86 Arithmetic variable 98 Assembler instructions Statement 35,133 Table 131 Assembler language Basic Programming Support 9,145 Comparison chart 145 Macro language, relation to 61 Statement forma~ 8,9 Structure 10,11 Assembler program Basic functions 4 Output 22 Assembly, terminating an 58 Assembly no operation (see ANOP instruction) Attributes How referred to 77 Inner macro instruction operands Notations 76 Operand sublists 76 outer macro instruction operands Summary chart 139 Symbols 76 Types 76 Use 76 (see also specific attributes) 76 76 Basic Programming Support Assembler 3,145 Base registers Address calculation 4,28,30 DROP instructions 20 Loading 20 19 USING instructions Begin column 8,53,54 Binary constant 43 13 Binary self-defining term Binary variable 98 Blanks Logical expressions 86 71 Macro instruction operands CCW instruction 50 51 Channel command word, defining Character codes 107 Character constant 42 Character expressions Ampersands 84 Apostrophes 84 86 Character relations Examples 84 Periods 84 SETB instructions 86 SETC instructions 83 Character relations 86 Character self-defining term 13 Character set 15,107 Character variable 98 CNOP instruction 56 coding form 7 8,53,54 Columns (begin, continue, end) COM instruction 27 72 Commas, macro instruction operands Comment Entry 9 Comment statements Example 69 69 Model statements Not generated 69 Comparison chart 145 Compatibility Assembler language 3 Macro definitions 104 47 Complex relocatable expressions Concatenation 83,85 Character expressions Defined 68 Index 151 Examples 68 Substring notations 85 Conditional assembly elements, summary charts of 90,138 Conditional assembly instructions How to write 75 Summary 75 Continue column 8,53,54 Use 75 (see also specific instructions) Conditional branch (see AIF instruction) Conditional branch instruction 32 Operand format 33 Constants (see also specific types) Defining (see DC instructions) Summary 135 continuation lines 7 Control dictionary 22 Control section location assignment 22 Control sections Blank common 27 CSECT instruction 23 Defined 22 First control section, properties of START instruction 23 Unnamed 24 COpy instruction 57 COPY statements in macro definitions Format 70 Model statements, contrasted 70 Operand field 70 Use 69 Count attribut.e Defined 79 Notation 79 Operand sublists 79 Use 78 Variable symbols 79 CSECT instruction Length attribute 23 Symbols 23 Current control section name (&SYSECT) Affected by CSECT,DSECT,START 99 Example 100 Use 99 CXD instruction 26 Data definition instructions 36 Channel command words 50 Constants 36 Storage 48 DC instruction 36 Constant operand subfield 41 Address constant (see Address constants) Binary constant 43 Character constant 42 Decimal constant 46 Fixed-point constant 43 Floating-point constant 44 Hexadecimal constant 42 Type codes for 38 Exponent modifier 41 Duplication factor operand subfield 152 23 Length modifier 39 Bit length specification 39 Modifiers operand subfield 38 Scale modifier 40 Type operand subfield 38 Decimal constants 46 Length, maximum 46 Length modifier 39 Packed 46 Zoned 46 Decimal field, integer attribute of 80 Decimal self-defining terms 12 Defining constants (see DC instruction) Defining storage (see DC instruction DS instruction) , Defining symbols 12 Dimension, subscripted SET symbols 97 Displacements 29 Double-shift instruction 29 DROP instruction 20,29 DS instruction 48-50 Defining areas 50 Forcing alignment 50 DSECT instruction 24 Dummy section location assignment 25 Duplication factor 38 Forcing alignment 50 DXD instruction 26 Effective address, length 30 EJECT instruction 52 End column 8,53,54 END instruction 58,66 ENTRY instruction 27,28 Entry point symbol, identification of 28 EQU instruction 35 Equal signs, as macro instruction operands 71 Error message (see MNOTE instruction) Error messages after END statement 58 Explicit addressing 19,30 Length 30 Exponent modifiers 41 Expressions 16 Absolute 17 Evaluation 16 Relocatable 17 Summary chart 138 Extended mnemonic codes 32 Operand format 33 External control section, addressing of 28.1 External dummy sections 26 External symbol, identification 28 EXTRN instruction 27,28 38 First control section 23 Fixed-point constants 44 Format 43 Positioning 44 Scaling 44 Values, minimum and maximum 44 Fixed-point field, integer attribute of Floating-point constant 44 Alignment 45 78 Format 45 Scale modifiers 45 Floating-point field, integer attribute of 78 Format control, input 53 GBLA instruction 95 GBLB instruction 95 GBLC instruction 95 General register zero, base register usage 20 Generated statements, examples of 68 Global SET symbols 63 Defining 95 Examples 96,97 Local SET symbols, compared 94 Use 94 Global variable symbols Types 94 (see also global SET symbols, subscripted SET symbols) Hexadecimal constants 42 Hexadecimal-decimal conversion chart 113-117 Hexadecimal self-defining terms 13 II (see integer attribute) ICTL instruction 53,66 Identification-sequence field 9 Identifying assembly output 51 Identifying blank common control section 26 Identifying dummy section 24 Implied addressing 30 Length 31 Implied length specification 31 Inner macro instruction Defined 73 Examples 74 Symbolic parameters 73 Instruction alignment 29 Integer attribute Decimal fields 78,80 Defined 78,79 Examples 79,80 Fixed-point fields 78,79 Floating-point fields 78,80 How to compute 79 Restrictions on use 78 Symbols 78 ISEQ instruction 54,66 KI (see count attribute) Keyword Defined 100 Keyword macro definitions 101 Keyword macro instruction 101 Symbolic parameter and 101 Keyword, inner macro instructions used in 102 Keyword macro definition Positional macro definitions, compared 101 Use 101 Keyword macro instruction Example 101 Format 101 Operand sublists 102 Operands Invalid examples 101 Valid examples 102 Keyword prototype statement E:xample 101 Format 101 Operands Invalid examples 101 Valid examples 101 101 Standard values LI (see length attribute) LCLA instruction 81 LCLB instruction 81 LCLC instruction 81 Length attribute Defined 15,78 Examples 78 Restrictions on use 76 Symbols 15,79 Length modifier 39 Bit-length specification 39 Length subfield 29 Lengths, explicit and implied 30 Library, copying coding from 57 Linkage symbols (see also ENTRY instruction, EXTERNAL .instruction) Entry point symbol 28 External symbol 28 Linkage editor, and use of 27-28.1 Listing, spacing 52 Listing control instructions 51 Literal pools 14,55 Literals 14 Character 15 DC instruction, used in 15 Definitions 37 Duplicate 56 Format 15 Literal pool, beginning (LTORG) 55 Literal pools, multiple 15 Local SET symbols Defining 95 Examples 95-97 Global SET symbols, compared 94 Local variable symbols Types 94 (see also local SET symbols and subscripted SET symbols) Location counter CSECT 22 Definition 14 DSECT 24 How to set ORG 55 START 23 42,47 Use in address constants Logical expressions Index 153 AIF instructions 88 86 Arithmetic relations Blanks 86 86 Character relations Evaluation 87 87 Invalid Examples 86 Logical operators Parenthesized terms Evaluation 87 Examples 87 86 Relation operators 86 SETB instructions Terms allowed 86 Valid examples 87 IJTORG instruction 55 Machine-instruction examples and format RR 29,31 RS 29,32 RX 29,32 S 29,32 SI 29,32 SS 29,32 Summary table 119 Machine-instruction mnemonic codes 31 Alphabetical listing 122 By duration code 129 Machine instructions 29 29 Alignment and checking Literals, limits on 14 Mnemonic operation codes 31 29 Operand fields and subfields Symbolic operands 31 MACRO Format 6 Use 65 Macro library defined 61 Macro definition Compatibili.ty 104 Defined 61 Error flagging 58 Example 67 Header 65 How to prepare 65 Keyword (see Keyword macro definition) Mixed-mode (see Mixed-mode macro definition) 65 Placement in source program Trailer 65 Use 61 Macro definition exit (see MEXIT instruction) Macro definition header statement (see MACRO) Macro definition trailer statement (see MEND) Macro instruction Defined 61 Example 67 Format 71 71 How to write Levels 74 71 Mnemonic operation code Name field 71 72 Omitted operands Examples 72 ~. -) 154 Operand field 71 72 Operand sUblists Operands Ampe.rsands 72 71 Apostrophes Blanks 72 Commas 72 71 Equal signs 71 Parentheses 71 Operation field 72 Statement format Types 61 Macro instruction index (&SYSNDX) Examples 99 Use 98 Macro instruction operand (&SYSLIST) Attributes 100 Use 100 (see also symbolic parameters) Macro instruction prototype statement (see prototype statement) Macro instruction statement (see macro instruction) Macro language Comparison chart 147 Extended features 93 61 Relation to assembler language Summary 91,137-140 MEND Format 65 MEXIT instruction, contrasted 93 Use 65 MEXIT instruction Example 93 Format 93 MEND, contrasted 93 Mixed-mode macro definitions Positional macro definitions, contrasted 103 Use 103 Mixed-mode macro instruction 103 Mixed-mode prototype statement 103 Mnemonic operation codes 29,31 Extended 32 Machine instruction 31 Macro instruction 65 MNOTE instruction Ampersands 94 Apostrophes 94 Error message 94 Examples 94 Format 93 Severity code 94 Model statements Comments field 67 Defined 66 Name field 66 Operand field 67 Operation field 66 N' (see Number attribute) NamA entry 8 Number attribute Defined 79 Examples 79 Operand sublist Alternate statement format 72 Defined 72 Examples 73 Operands Entries 8 Fields 29 Subfields 29,30 Symbolic 27,29,30 Operating system 5 Operation field 29 OPSYN instruction 35,36,66 ORG instruction 55 Outer macro instruction defined 73 71 Paired apostrophes 71 Paired parentheses Parentheses 82 Arithmetic expressions Logical expressions 87 Macro instruction operands 71 Operand fields and subfields 29 Paired 71 Period 84 Character expressions 69 Comments statements Concatenation 68 Sequence symbols 80 positional macro definition (see macro definition) positional macro instruction (see macro definition and macro instruction) Previously defined symbols 12 PRINT instruction 52,66 53 Program control instructions Program listing& 5 22 Program sectioning and linking Prototype statement Examples 66 Format 65 Keyword (see keyword prototype statement) Mixed-mode (see mixed-mode prototype statement) Name field 65 Operand field 65 Operation field 65 Statement format Alternate 66 Normal 66 Symbolic parameters 65 Pseudo Register (see DXD instruction) PUNCH instruction 54 Quotation marks (see Apostrophes) Quoted string 71 Relational operators 86 Relative addressing 21 Relocatability 4,10,11 Attributes 17 Program, general register zero Relocatable expressions 17,29 In USING instructions 20 20 Relocatable terms 10,11 Pairing of 17 In relocatable expressions REPRO instruction 55 RR machine instruction Format 31,119 Length attribute 29 RS machine instruction Address specification 30 Format 32,119 Length attribute 29 RX machine instruction Address specification 30 Format 32,119 Length attribute 29 17 S machine instruction format 29,32,120 S' (see scaling attribute) Sample program 141 Scale modifier Fixed-point constants 43 Floating-point constants 45 Scaling attribute Decimal fields 78 Defined 78 Examples 78 Fixed-point fields 78 Floating-point fields 78 Restrictions on use 78 Symbols 78 Self-defining terms 12 (see also specific terms) Sequence checking 54 Sequence symbols AGO instruction 89 AIF instruction 88 ANOP instruction 90 How to write 80 Invalid examples 80 Macro instruction 80 Valid examples 80 Set symbols Assigning values 75 Defining 75 75 Symbolic parameters, contrasted Use 75 (see also local SET synbols, global SET symbols, and subscripted SET symbols) SET variable 94 SETA instruction Examples 81-83 Format 81 Operand field 81,82 Evaluation procedure Operators allowed 81 Parenthesized terms 82 Terms allowed 81 Valid examples 82 Operand sublist 82 Examples 82 SETA symbol 82 Arithmetic relations 82 Assigning values to Defining 75,82 Use 82 SETB instruction Examples 86 Index 155 Format 86 Logical expressions 86 86 Arithmetic relations Blanks 87 86 Character relations Evaluation 87 86 Operators allowed Terms allowed 86 Operand field 84 87 Invalid examples 87 Valid examples SETB symbol 87 AIF instruction 75 Assigning values Defining 75 87 SETA instructions, use in 87 SETB instructions, use in 87 SETC instructions, use in SETC instruc1:ion 83 Character expressions Ampersands 84 Apostrophes 83,84 Periods 84 Concatenation 84 Character expressions Substring notation 84 Examples 83,85 Format 83 Operand field 83 Substring notations 84 Arithmetic expressions 84 Character expressions Invalid examples 85 Valid examples 85 Type attribute 83 Examples 83 SETC symbol 85 Assigning values Defining 75,85 SETA instruction, use in 86 93,94 Severity code in MNOTE instruction 131 machine instruction 30 Address specification Format 32,119 Length attribute 29 SPACE instruction 51 SS machine instruction 30 Address specification Format 32,119 29 Length attribute Length field 30 Standard value Attributes 102 101 Keyword prototype statement 8'rART ins truction Positioning 23 24 Unnamed control sections Statements 8,9 Boundaries 8 Examples 9 71 Macro instruction Prototype 65 Storage, defining (see DS instruction) Sublist (~ee Operand sublist) Subscripted SET symbols Defining 97,98 Examples 97 Dimension 98 156 Invalid examples 97 Subscript 95 Use 98 Examples 98 Valid examples 97 Substring notation Arithmetic expressions 84 Character expression 84 Invalid example 85 SETB instruction 86 SETC instruction 85 Valid examples 85 Symbol definition, EQU instruction for Symbolic linkages 27 Symbolic operand formats 31 Symbolic parameters Assigning values 67 Comments field 66 Concatenation 68 Defined 67 Exa~ples, invalid and valid 68 Prototype statement 65 (see also variable symbols) Symbols Defining 12 Length attributes 15,29 Length, maximum 12 Previously defined 12 Restrictions 12 Value attributes 29 System macro instructions defined 62 System variable symbols Assigned values by assembler 98 Defined 98 (see also specific system variable symbols) 12 T' (see type attribute) Terms Expressions composed of 10 In parentheses 16 Pairing of 16 TITLE instruction 51 Type attribute Defined 77 Literals 77 Macro instruction operands 77 SETB instruction 86 SETC instruction 83 Symbols 77 Unconditional branch (see AGO instruction) Unnamed control section 24 USING instruction 19 Variable symbols Assigning values 63 Defined 62 Summary chart 140 Types 62 Use 62 (see also specific variable symbols) V-type address constant 48 WXTRN instruction 28.1,48 XFR Instruction 3 y-type address constant 47 as Assembler Language READER'S COMMENT FORM GC28-6514-9 Your views about this publication may help improve its usefulness; this fonn will be sent to the author's department for appropriate action. Using this form to request system assistance or additional publications will delay response, however. For more direct handling of such request, please contact your IBM representative or the IBM Branch Office serving your locality. n c -l » r o Z Q o o -l -l m o C Z m Reply requested: Yes D No 0 Name: . _______________________ Job Title: Address: _ Zip Thank you for your cooperation. No postage stamp necessary if mailed in the U.S.A. (Elsewhere, an IBM office or representative will be happy to forward your comments.) GC28-6514-9 Your comments, please ... This manual is part of a library that serves as a reference source for systems analysts, programmers, and operators of IBM systems. Your comments on the other side of this form will be carefully reviewed by the persons responsible for writing and publishing this material. All comments and suggestions become the property of IBM. 0 C -I 0 :J:J "T1 0 r Fold Fold ...................................................................................................... 0 ~ r 0 z G) First Class Permit 40 Armonk New York !: z m 0 en :t:- V> V> CD 3 c- Business Reply Mail ~ No postage stamp necessary if mailed in the U.S.A. r Q) ::J c.c c::: Q) c.c CD Postage will be paid by: ." m International Business Machines Corporation Department 813 L 1133 Westchester Avenue White Plains, New York 10604 Z p en w en
Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.3
Linearized                      : No
XMP Toolkit                     : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37
Producer                        : Adobe Acrobat 9.13 Paper Capture Plug-in
Modify Date                     : 2009:09:03 23:34:34-07:00
Create Date                     : 2009:09:03 23:34:34-07:00
Metadata Date                   : 2009:09:03 23:34:34-07:00
Format                          : application/pdf
Document ID                     : uuid:22625150-9ec0-46a0-b64d-8155664ea1eb
Instance ID                     : uuid:f33b9082-8157-409d-b6aa-5a7e7a7a4cb9
Page Layout                     : SinglePage
Page Mode                       : UseOutlines
Page Count                      : 173
EXIF Metadata provided by EXIF.tools

Navigation menu