Cray x1 Assembly
Cray x1 Assembly
Cray x1 Assembly
2001, 2003 Cray Inc. All Rights Reserved. This manual or parts thereof may not be reproduced in any form unless permitted by
contract or by written permission of Cray Inc.
Autotasking, CF77, Cray, Cray Ada, Cray Channels, Cray Chips, CraySoft, Cray Y-MP, Cray-1, CRInform, CRI/TurboKiva,
HSX, LibSci, MPP Apprentice, SSD, SuperCluster, UNICOS, UNICOS/mk, and X-MP EA are federally registered trademarks
and Because no workstation is an island, CCI, CCMT, CF90, CFT, CFT2, CFT77, ConCurrent Maintenance Tools, COS,
Cray Animation Theater, Cray APP, Cray C90, Cray C90D, Cray CF90, Cray C++ Compiling System, CrayDoc, Cray EL, Cray
Fortran Compiler, Cray J90, Cray J90se, Cray J916, Cray J932, CrayLink, Cray MTA, Cray MTA-2, Cray MTX, Cray NQS,
Cray/REELlibrarian, Cray S-MP, Cray SSD-T90, Cray SV1, Cray SV1ex, Cray SV2, Cray SX-5, Cray SX-6, Cray T90,
Cray T94, Cray T916, Cray T932, Cray T3D, Cray T3D MC, Cray T3D MCA, Cray T3D SC, Cray T3E, CrayTutor, Cray X1,
Cray X-MP, Cray XMS, Cray-2, CSIM, CVT, Delivering the power . . ., DGauss, Docview, EMDS, GigaRing, HEXAR, IOS,
ND Series Network Disk Array, Network Queuing Environment, Network Queuing Tools, OLNET, RQS, SEGLDR, SMARTE,
SUPERLINK, System Maintenance and Remote Testing Environment, Trusted UNICOS, UNICOS MAX, and UNICOS/mp
are trademarks of Cray Inc.
AIX and IBM are trademarks and RISC System/6000 is a product of International Business Machines Corporation. AXP and DEC
are trademarks of Digital Equipment Corporation. DynaText, DynaVerse, DynaWeb, and EBT are trademarks of Electronic Book
Technologies, Inc. HP and HP-UX are trademarks and HP 9000 is a product of Hewlett-Packard Company. IRIX, Mindshare, SGI,
and Silicon Graphics are trademarks of Silicon Graphics, Inc. Netscape and Netscape Navigator are trademarks of Netscape
Communications Corporation. NFS, Solaris, SPARC, Sun, and SunOS are trademarks of Sun Microsystems, Inc. Open Software
Foundation, OSF, and OSF/1 are trademarks of Open Software Foundation, Inc. UNIX is a registered trademark in the United States
and other countries, licensed exclusively through X/Open Company Limited.
The UNICOS, UNICOS/mk, and UNICOS/mp operating systems are derived from UNIX System V. These operating systems
are also based in part on the Fourth Berkeley Software Distribution (BSD) under license from The Regents of the University
of California.
Record of Revision
Version
Description
1.0
1.1
June 2003
Supports the Cray Assember 1.1 and Programming Environment 5.0 releases.
S231450
Contents
Page
Preface
xv
xv
xvi
Typographical Conventions
xvi
xvii
xviii
Ordering Documentation
Reader Comments
Introduction [1]
Capabilities
1
.
Related Publications
Floating-point
Addresses
Registers
Program Counter
10
Performance Counters
iii
Scalar Instructions
Immediate Loads
11
11
12
13
14
17
18
19
20
21
22
22
22
23
25
27
28
Summary of Rules
30
31
33
34
Program Control
34
Loader Linkage
34
Mode Control
35
Section Control
35
Message Control
35
Listing Control
36
36
36
37
Symbol Definition
Data Definition
Conditional Assembly
iv
S231450
Contents
Page
Micro Definition
Defined Sequences
File Control
37
39
40
41
.
41
41
42
Program
42
Sections
44
Examples
44
44
45
47
52
53
53
53
47
53
53
54
54
55
55
57
57
58
Cross-reference Listing
60
Diagnostic Messages
62
S231450
63
63
63
64
Macros
64
Opdefs
65
Opsyns
65
Micros
65
65
Linking
67
68
Label Field
68
Result Field
68
Operand Field
68
Comment Field
69
69
70
70
71
Unqualified Symbol
71
Qualified Symbols
72
Old Format
Case Sensitivity
Symbols
Symbol Qualification
Symbol Definition
73
Symbol Attributes
74
74
74
76
Type Attribute
Relative Attributes
Redefinable Attributes
Symbol Reference
Tags
76
76
Constants
78
78
Floating Constant
vi
S231450
Contents
Page
Integer Constant
80
Character Constants
82
82
83
84
84
Data Items
Literals
85
88
92
Location Counter
93
Origin Counter
93
93
Micros
Location Elements
Longword-bit-position Counter
Force Longword Boundary
Expressions
Operators
94
94
95
96
Restrictions
Statement Editing
96
97
99
Micro Substitution
Concatenate
.
Continuation
Comment
Operator Precedence
Append
99
99
99
100
100
103
103
104
BASE
104
BITW
106
BSS
107
S231450
vii
108
CMICRO
108
COMMENT
110
BSSZ
CON
111
DATA
112
DBSM
115
116
DECMIC
DMSG
118
DUP
119
ECHO
119
EDIT
120
EJECT
120
ELSE
121
END
122
124
ENDDUP
ENDIF
124
ENDM
124
125
ENDTEXT
ENTRY
126
ERRIF
126
ERROR
128
EXITM
129
EXT
129
131
FORMAT
IDENT
132
IFA
133
IFC
137
IFE
139
IFM
142
144
INCLUDE
viii
S231450
Contents
Page
LIST
147
LOC
150
LOCAL
151
MACRO
152
MICRO
152
MICSIZE
154
MLEVEL
154
155
156
156
OCTMIC
157
HEXMIC
158
MSG
NEXTDUP
NOMSG
OPDEF
160
OPSYN
160
ORG
161
162
163
165
Local Sections
172
Main Sections
173
173
173
Common Sections
174
174
176
OSINFO
QUAL
SECTION
Literals Section
176
Location Counter
176
176
177
177
Word-bit-position Counter
Force Word Boundary
SET
S231450
ix
SKIP
178
SPACE
179
STACK
180
START
180
181
181
STOPDUP
SUBTITLE
TEXT
182
TITLE
183
VWD
184
187
189
189
189
190
190
Jump Instructions
191
A Register Instructions
192
192
193
193
194
194
194
195
195
195
196
Prefetch Instructions
196
196
197
S231450
Contents
Page
198
198
199
199
200
200
200
201
201
202
203
203
204
205
205
206
207
208
209
210
211
211
213
215
216
216
Definition Format
217
Formal Parameters
218
219
221
Instruction Calls
xi
Macros (MACRO)
221
Macro Definition
222
Macro Calls
227
237
241
Opdef Calls
245
250
252
254
255
256
256
Duplication (DUP)
257
260
262
265
267
269
Glossary
275
Index
285
Figures
Figure 1.
Figure 2.
Figure 3.
Figure 4.
Figure 5.
Figure 6.
xii
43
58
59
61
87
87
S231450
Contents
Page
Figure 7.
Figure 8.
Figure 9.
Figure 10.
87
88
113
114
Tables
Table 1.
Cray X1 Registers
Table 2.
Table 3.
Quadrant Modifications
Table 4.
Table 5.
Table 6.
Table 7.
Integer Relations
12
12
13
14
16
Table 8.
17
Table 9.
18
19
20
.
.
Table 10.
Table 11.
Table 12.
21
Table 13.
22
Table 14.
23
Table 15.
Mask Operations
25
Table 16.
27
Table 17.
29
Table 18.
Table 19.
Character Set
S231450
31
269
xiii
Preface
This manual supports the Cray Assembler 1.1 release running on Cray X1
systems. This preface describes how to access Cray documentation and error
message explanations, interpret our typographical conventions, order Cray
documentation, and contact us about this document.
S231450
User commands
System calls
Library routines
File formats
Miscellaneous information
Administrator commands
xv
Use a web browser with the CrayDoc system to view, search, and print
individual man pages in HTML format.
Use Adobe Acrobat Reader with the CrayDoc system to view, search, and
print from collections of formatted man pages provided in PDF format.
If more than one topic appears on a page, the man page has one primary name
(grep, for example) and one or more secondary names (egrep, for example).
Access the ASCII or HTML man page using either name; for example:
Enter the command man grep or man egrep
Search in the CrayDoc system for grep or egrep
Typographical Conventions
The following conventions are used throughout this document:
xvi
Convention
Meaning
command
variable
Preface
[]
...
Ordering Documentation
To order software documentation, contact the Cray Software Distribution Center
in any of the following ways:
E-mail:
orderdsk@cray.com
Web:
http://www.cray.com/craydoc/
Click on the Cray Publications Order Form link.
Telephone (inside U.S., Canada):
18002842729 (BUG CRAY), then 6059100
Telephone (outside U.S., Canada):
Contact your Cray representative, or call +16516059100
Fax:
+16516059001
Mail:
Software Distribution Center
Cray Inc.
1340 Mendota Heights Road
Mendota Heights, MN 551201128
USA
S231450
xvii
Reader Comments
Contact us with any comments that will help us to improve the accuracy and
usability of this document. Be sure to include the title and number of the
document with your comments. We value your comments and will respond to
them promptly. Contact us in any of the following ways:
E-mail:
swpubs@cray.com
Telephone (inside U.S., Canada):
18009502729 (Cray Customer Support Center)
Telephone (outside U.S., Canada):
Contact your Cray representative, or call +17157264993 (Cray Customer
Support Center)
Mail:
Software Publications
Cray Inc.
1340 Mendota Heights Road
Mendota Heights, MN 551201128
USA
xviii
S231450
Introduction [1]
1.1 Capabilities
The primary capability of CAL is to express with symbolic machine instructions
the full Cray X1 instruction set. This manual does not describe the machine
instructions in detail but does give an overview of the instructions and lists the
instructions (Chapter 8, page 187). The Cray X1 instruction set is described in
detail in the System Programmer Reference for Cray X1 Systems.
In addition, CAL provides these capabilities:
The free-field source statement format of CAL lets you control the size and
location of source statement fields.
With some exceptions, you can enter source statements in uppercase,
lowercase, or mixed-case letters.
You can assign code or data segments to specific areas to control local and
common sections.
You can use preloaded data by defining data areas during assembly and
loading them with the program.
You can designate data in integer, floating-point, and character code notation.
You can control the content of the assembler listing.
You can define a character string in a program and substitute the string for
each occurrence of its micro name in the program by using micro coding.
You can define sequences of code in a program or in a library and substitute
the sequence for each occurrence of its macro name in the program by using
macro coding.
S231450
S231450
This chapter gives an overview of the Cray X1 system instruction set. The
Cray X1 system is an implementation of the Cray NV-1 instruction set
architecture. The full instruction set is listed in Chapter 8, page 187 and is
described in detail in the System Programmer Reference for Cray X1 Systems.
S231450
Interpretations of these types as C unsigned integers mod 232 and 264 are
supported in comparisons and implicitly in the hi(j*k) multiplication function.
The assembly language syntax uses the notations UW and UL for unsigned
comparisons.
Special instructions accelerate loads and stores of 8-bit and 16-bit integers from
64-bit Longword containers.
2.1.2 Floating-point
The Cray X1 system conforms to the IEEE-754 standard for floating-point
arithmetic with the exception of subnormal numbers.
The 32-bit single precision floating-point type S has this format:
Bit
2
31
Definition
Sign
230:223
Exponent
232:20
Definition
263
Sign
262:252
Exponent
251:20
S231450
Addresses must be strongly aligned except for the special unaligned (,ua) load
and store instructions. This means that instruction fetches and other 32-bit
references must have zero bits in the lowest order two bit positions and that
64-bit references must have three lowest order zero bits.
The highest order bit positions (63:48) of a user virtual address must be zero.
Distributed memory applications use bits 47:38 of the virtual address for a logical
node number.
Data caches are always coherent, but the instruction caches are not.
Self-modifying code must synchronize the instruction cache with an explicit
lsync,i instruction.
The Cray X1 system addresses memory in big-endian order. If a 64-bit Longword
is stored at aligned address x, a 32-bit load from x+0 will retrieve its upper order
32 bits and a 32-bit load from x+4 will retrieve its lower order 32 bits.
2.2 Registers
The Cray X1 processor has the following set of registers:
S231450
a0,...,a63
s0,...,s63
v0,...,v31
vl
m0,...,m7
Mask registers
vc
bmm
c0,...,c63
Control registers
Program counter
(no syntax)
Performance counters
In this manual, the term register refers to a specific register, such as a23, the term
register type refers to the letter or letters that identify the specific set of registers,
such as a for address registers, and register designator refers to the number that
specifies a register in that set, such as 23. CAL accepts either upper case or lower
case for the register type, so a23 and A23 are treated the same.
2.2.1 Address and Scalar Registers
There are 64 address and 64 scalar registers, each 64 bits in width. They constitute
computational way stations between memory and functional units in the
processor for serial regions of the program. They also serve vectorized code with
addresses, strides, and scalar values.
Registers a0 and s0 are unmodifiable zero values. Instructions that would write
to them discard their results and may ignore exceptions.
Both the address and scalar registers are general-purpose and support the
same memory reference instructions, immediate loads, integer functions, and
conditional branches. However, address registers must be used for:
Memory base addresses, offsets, and strides
Indirect jump destinations and return addresses
Vector element indexing
Vector Length computation with cvl()
Reading and writing vl and control registers
Receiving the results of the mask analysis instructions first(), last(),
and pop()
Supplying the stride for a vector scan() and cidx()
8-bit and 16-bit accesses
And scalar registers must be used for:
6
S231450
The vrip instruction declares that the contents of the vector registers need
no longer be maintained. It is used at the end of a vector sequence to avoid
expensive context switch times.
2.2.3 Vector Length Register
The maximum number of elements that a vector register can hold is not actually
specified by the architecture. It is only guaranteed to be a power of 2 and at least
64. It may vary between hardware implementations.
A vectors length is always a count of its elements, not its Bytes, Words, or
Longwords. A vector of 32-bit data cannot hold any more elements than a vector
of 64-bit data can.
The vector length register vl specifies the number of elements to be processed
by vector register operations. Once set, it is an implicit operand to every vector
register operation that follows.
Programs should use the cvl() function to compute legal and well-balanced
Vector Length values.
Vector Length can be set to zero.
2.2.4 Mask Registers
Each of the eight mask registers contains a bit corresponding to each vector
register element position. Since this may be larger than 64 bits, the instruction set
contains instructions that manipulate mask registers directly.
Masks are set with the results of vector comparison operations. They can then be
used to generate vector values with the scan() and cidx() functions. Masks
are also used to control vector instructions on a per-element basis. Only the first
four masks, m0:m3, can be used to control elemental vector operations. Values in
m4:m7 must be moved to m0:m3 for use in vector instructions.
By software convention, mask register m0 can be assumed to have every bit set.
2.2.5 Vector Carry Register
There is a single Vector Carry (vc) Register that is both an operand to and a
result of the 64-bit vector add with carry and subtract with borrow
instructions. Like the mask registers, it holds one bit for every vector register
element position.
S231450
S231450
Label
Result
Operand
Comment
The Label field is optional for machine instructions. It can contain an identifier
that must begin in column 1. The label is given the value of the instructions
byte address.
The Result field is always present. It typically contains the name of the
instructions result register and the type when necessary.
The Operand field is usually present. It typically contains a brief expression in
C-like syntax with registers and constant expressions.
A Comment can follow the instruction. Comments begin with a semicolon, which
is not part of the syntax for any instruction. A comment can also begin with
an asterisk (*) in column 1.
Example:
Label
Result
Operand
Comment
top
a1
a2+a3
In the instruction descriptions that follow, similar instructions are often combined
with a notation like:
ai,W or L
aj+ak or imm
aj+ak
aj+ak
aj+imm
aj+imm
Operators in CAL statements very closely follow the syntax, meaning, and
operator precedence rules of the C language. For details, see Section 6.9, page 94.
10
S231450
expression
expression
; Immediate load ai
; Immediate load si
However, because all Cray X1 system machine instructions are 32 bits wide, a
64-bit expression, depending on the bit pattern of the expression to be loaded,
cannot necessarily be loaded into a register using a single machine instruction.
To aid the programmer in loading a value of up to 64 bits into a register, the
assembler supports these immediate load statements that the assembler expands
into a sequence of one or more of the primitive 16-bit immediate load instructions
described below.
The hardware supports a set of primitive immediate load instructions, each
of which has a 16-bit expression (expr in the rest of this section) as part of
the instruction and each of which modifies 1, 2, 3 or 4 16-bit quadrants (or
Halfwords) of the result register.
For one set of primitives, one quadrant of the result register receives the 16-bit
value (expr) specified in the machine instruction, and 0, 1, 2, or 3 of the quadrants
containing the higher order bits may be filled with copies of the immediate
values uppermost bit for sign-extension; the remaining quadrants are set to zero.
In other words, no part of the old value in the register remains unchanged.
For another set of primitives, one quadrant of the result register receives the
16-bit value (expr) specified in the machine instruction, and 0, 1, 2, or 3 of the
quadrants containing the higher order bits may be filled with copies of the
immediate values uppermost bit for sign-extension; the remaining quadrants
are left unchanged. In other words, a new value is merged with part of the old
value in the register.
Which quadrants get modified and how they are modified depends on the
quadrant (or Halfword) specifiers a (for bits 63:48), b (for bits 47:32), c (for bits
31:16) and d (for bits 15:0). The assembler uses two factors:
The combination of specifiers (ab, abc, or abcd)
The field in which the specifier is located (result field or operand field)
to determine which of the other three quadrants are modified and how.
S231450
11
Operand
a(63:48)
b(47:32)
c(31:16)
d(15:0)
ai or si
expr:a
expr
ai or si
expr:b
expr
ai or si
expr:c
expr
ai or si
expr:d
expr
ai or si
expr:ab
sign
expr
ai or si
expr:abc
sign
sign
expr
ai or si
expr:abcd
sign
sign
sign
expr
ai or si:a
expr
expr
ai or si:b
expr
expr
ai or si:c
expr
expr
ai or si:d
expr
expr
ai or si:ab
expr
sign
expr
ai or si:abc
expr
sign
sign
expr
12
ai or si,type
[aj+expr]
ai or si,type
[aj+ak]
ai
[aj],ua
[aj+expr]
ai or si,type
[aj+ak]
ai or si,type
S231450
[aj]
ai,ua
pref
[aj+expr]
pref
[aj+ak]
Offset expressions (expr) and index values (ak) are always multiplied by the
data size before being added to the aj base address. A 32-bit memory reference
multiplies the offset by 4; a 64-bit reference multiplies the offset by 8. This means
that alignment can be checked solely from the low order 2 or 3 bits of the base
address aj. These bits are ignored for the unaligned (,ua) references and must be
zero for the others.
Like all other instructions that enter 32-bit data into the 64-bit address and scalar
registers, 32-bit loads sign-extend their results.
As a consequence of the Cray X1 system register numbering restriction
mentioned above, indexed references must not use aj and ak registers whose
register designators differ by exactly 32.
The constant offset values (expr) are signed twos complement 14-bit values
prior to being scaled (-8192...8191). The byte offset ranges are therefore
-32768...32767 for 32-bit references and -65536...65535 for 64-bit
references.
The data cache prefetch (pref) instructions cannot raise any memory exceptions.
Prefetches from bad addresses are therefore silently ignored.
2.4.3 Branches and Jumps
The Cray X1 system has six position-independent conditional branch instructions
and one indirect jump instruction:
S231450
bz
ai or si,displ
; Branch if == 0
bn
ai or si,displ
; Branch if != 0
blt
ai or si,displ
; Branch if < 0
ble
ai or si,displ
; Branch if <= 0
13
bgt
ai or si,displ
; Branch if > 0
bge
ai or si,displ
; Branch if >= 0
j,ai
aj,SR or RT
The conditional branches test all 64 bits of ai or si. 32-bit values will be correctly
interpreted if the usual sign extension convention is observed.
The conditional branch instructions identify their targets with a signed twos
complement 20-bit instruction displacement relative to the next instruction at
pc+4. The offset range for conditional branches is therefore:
-524287 ... 524288 instructions
-2097151 ... 2097152 bytes
14
ai,W or L
aj+ak or imm
; Addition
ai,W or L
aj-ak or imm
; Subtraction
ai,W or L
aj*ak
; Multiplication
ai,W or L
ak/aj
; Signed division
ai
hi(aj*ak)
S231450
ai
aj&ak or imm
; Bitwise AND
ai
aj|ak or imm
; Bitwise OR
ai
aj^ak or imm
; Bitwise XOR
ai
~aj&ak
ai
~aj^ak
; Bitwise Equivalence
ai,W or L
aj<<ak or imm
; Left shift
ai,W or L
aj>>ak or imm
ai
+aj>>ak or imm
ai,L or UL
aj<ak or imm
; Comparison
ai,W or L
lz(aj)
ai,W or L
pop(aj)
; Population count
ai
aj?ak:ai
ai
aj?ai:ak
ai
cvl(ak or imm)
S231450
15
If
ak < 0
ak
ak/2
MAXVL
ak > 2 MAXVL
aj< 1
a0<ak
16
ai
aj<ak
ai
ak<aj
ai,UL
ai<1
; aj <= ak
ai
ak<aj
; aj > ak
; aj < ak
S231450
ai
aj<ak
ai,UL
ai<1
; aj >= ak
sj+sk
; Addition
si,S or D
sj-k
; Subtraction
si,S or D
sj*sk
; Multiplication
si,S or D
sk/sj
; Division
si,S or D
abs(sj)
si,S or D
sqrt(sj)
; Square root
si,S or D
cpys(sj,sk)
si,S or D
sj==sk
si,S or D
sj!=sk
si,S or D
sj<sk
si,S or D
sj<=sk
si,S or D
sj?sk
si,t1
sj,t2
si,W or L
round(sj),S or D
si,W or L
trunc(sj),S or D
si,W or L
ceil(sj),S or D
si,W or L
floor(sj),S or D
S231450
17
vk
si
bmm(sk)
vi
bmm(vk),mm
The bmm vk instruction loads bits from the vector register vk into the bmm
register.
The si bmm(sk) instruction performs the basic bit matrix multiplication operation.
Each bit j of the 64-bit integer result si, counting from the highest order bit
position down to the lowest, is computed thus:
sij = pop(sk & bmmj) (mod 2)
S231450
bits set. When the bmm register is loaded such that exactly one bit is set in each
row and each column, it performs a bit permutation function such as a centrifuge.
The bit matrix multiplication can also be viewed as the matrix product (mod 2)
of a 1-by-64 row vector in sk and the 64-by-64 transpose of bmm. Within this
perspective, each 64-bit word loaded into bmm constitutes a column.
The vi bmm(vk),mm instruction is described in the Vector instructions section
(Section 2.5, page 22).
2.4.7 Byte and Halfword Access
The Cray X1 system instruction set supports direct memory references to 32-bit
and 64-bit data. The functions described in this section accelerate access to
8-bit (Byte) and 16-bit (Halfword) data. They manipulate only address register
operands.
extb(aj,ak)
ai
exth(aj,ak)
ai
mskb(aj,ak)
; Clear Byte in aj at ak
ai
mskh(aj,ak)
; Clear Halfword in aj at ak
ai
insb(aj,ak)
ai
insh(aj,ak)
All of these functions use the lowest order 2 or 3 bits of ak to identify a 16-bit
Halfword or 8-bit Byte or position in a 64-bit field in big-endian order. The 64-bit
field is assumed to hold the Longword containing the byte addressed by ak.
The functions listed above perform the following operations:
The ext() functions extract the indexed field, right-justified and
zero-extended to 64 bits.
The msk() functions clear the indexed field.
The ins() functions truncate the value of aj and shift it into the indexed
field.
To load an unsigned Byte from memory address a2, use:
S231450
19
a1
a1
[a2],ua
extb(a1,a2)
[a2],ua
mskb(a3,a2)
insb(a1,a2)
a3|a4
a3,ua
Note: This store sequence is not atomic with respect to stores into the same
64-bit Longword from other processors. Use the atomic aax operation (Section
2.4.8, page 20) when such conflicts are possible.
The 16-bit Halfword access functions are defined only for properly aligned
(even) ak addresses.
2.4.8 Scalar Atomic Memory Operations
There are three basic atomic memory operations. Two of them have variant forms
to be used when no result is necessary. The result of an atomic memory operation
is always the old Longword value from memory.
ai,aadd
ai
[aj],afadd,ak
[aj]
ai,aax,ak
ai
[aj],afax,ak
ai
[aj],acswap,ak
20
S231450
The general atomic logical operation can be used to synthesize more specific
useful operations:
ai value
ak value
AND x
OR x
x complement
XOR x
0 complement
Equivalence x
0 complement
x complement
(x OR y) complement
Atomic memory operations can be suffixed with ,NA to hint to the caches
that the Longword should not be allocated, or with ,EX to hint that the
Longword should be exclusively allocated. The default hint is ,NA. Cache
hints are ignored on atomic memory operations.
Atomic memory operations are not ordered with respect to other
memory references in the same processor, apart from those required by
register-to-register data dependences. They must be surrounded by gsync
instructions to ensure proper ordering.
2.4.9 Other Scalar Instructions
These nonprivileged scalar instructions do not fit neatly into any of the categories
above, and so they are described here for completeness:
S231450
syscall
expr
; System call
break
expr
; Debugging breakpoint
ai,W or L
sk
; Transfer sk to ai
si,W or L
ak
; Transfer ak to si
ai
ck
ci
ak
21
MAXVL; I++)
|| !mm[I])
undefined;
vj[I] op (sk or vk[I]);
22
vi,type
[aj,ak or imm],mm
; Strided load
vi,type
[aj,vk],mm
; Gather
[aj,ak or imm]
vi,type,mm
; Strided store
S231450
[aj,vk]
vi,type,mm
[aj,vk]
vi,type,mm ,ord
vj+sk or vk,mm
; Addition
vi,type
sk or vk-vj,mm
; Subtraction
vi,vc
vj+sk or vk,mm
vi,vc
sk or vk-vj,mm
vi,type
vj*sk or vk,mm
; Multiplication
vi
hi(vj*sk or vk),mm
vi,S or D
sk or vk/vk,mm
; Floating-point division
vi,W or L
vj&sk or vk,mm
; Bitwise AND
vi,W or L
vj|sk or vk,mm
; Bitwise OR
vi,W or L
vj^sk or vk,mm
; Bitwise XOR
vi,W or L
~vj&sk or vk,mm
S231450
23
vi,W or L
~vj^sk or vk,mm
; Bitwise Equivalence
vi,W or L
vj<<sk or vk,mm
vi,W or L
vj>>sk or vk,mm
vi,W or L
+vj>>sk or vk,mm
vi,W or L
lz(vj),mm
vi,W or L
pop(vj),mm
; Population count
vi
bmm(vk),mm
vi,S or D
abs(vj),mm
vi,S or D
sqrt(vj),mm
; Square root
vi,S or D
cpys(vj,vk),mm
vi,t1
vj,t2,mm
vi,W or L
round(vj),S or D,mm
vi,W or L
trunc(vj),S or D,mm
vi,W or L
ceil(vj),S or D,mm
vi,W or L
vi,W or L
mm?sk or vk:vj
; Merge
mi,type
vj==sk or vk,mm
mi,type
vj!=sk or vk,mm
mi,type
vj<sk or vk,mm
mi,type
vj<=sk or vk,mm
mi,type
vj>sk,mm
mi,type
vj>=sk or vk,mm
mi,S or D
vj?sk or vk,mm
24
S231450
S231450
mi
mj&mk
; Bitwise AND
mi
mj|mk
; Bitwise OR
mi
mj^mk
; Bitwise XOR
mi
~mj&mk
mi
~mj^mk
; Bitwise equivalence
mi
fill(ak)
ai
first(mk)
ai
last(mk)
ai
pop(mk)
25
vi
scan(ak,mj)
vi
cidx(ak,mj)
vi
cmprss(vk,mj)
; Compress vector
0t<n mj[t]
26
S231450
ak
ai
vl
ai or si,W or L
vk,aj or imm
; Read element
vi,aj or imm
ak or sk,W or L
; Write element
bmm
vk
vrip
S231450
27
This operation is not elemental because it does not operate under control of
a mask register. The vk register must therefore be completely defined up
to vl with 64-bit values.
The vrip instruction undefines all of the vector registers, the vector carry
register vc, and the mask registers, apart from m0. If the contents of the bmm
register are defined, they remain defined. Mask register m0 remains defined if
it still has all of its bits set; otherwise, it too becomes undefined.
The vrip instruction is used at the end of a sequence of vector instructions
to reduce the size of the processor state that must be saved and restored
when switching processor contexts, and also to release physical registers in
implementations that rename the vector registers.
ai
mk,aj or imm
mi,aj or imm
ak
28
S231450
aj
gsync
aj,cpu
gsync
aj,a
gsync
aj,r
msync
aj
msync
aj,p
msync
aj,v
; MSP ordering of all prior vector references before all later vector references
lsync
s,v
lsync
v,s
lsync
vr,s
lsync
v,v
lsync
vj,v
lsync
vj,v,el
lsync
fp
lsync
S231450
29
Both the gsync and msync instructions require an aj processor mask operand
that specifies a set of processors within the local MSP group of four. They
perform a local barrier operation that must be satisfied by all processors in the aj
mask with identical mask values before execution can proceed. The aj processor
mask is right-justified and the lowest-order bit position corresponds to processor
0 in the local group.
The conjunction of the barrier semantics with the memory ordering effects is
unfortunate. When no barrier is needed, a processor mask must be used that has
just the bit set that corresponds to the issuing processor.
Interprocessor memory reference ordering is also weakly guaranteed. The
architecture specifies only that the references of one processor will be seen in
the same order by others, and that once a store is visible to another processor,
it will be visible to all. (References to I/O space in system code by a single
processor are implicitly mutually ordered.)
30
S231450
aj
ai,L
aj|0
si
sj
si,L
sj|0
vi
vj
vi,L
vj|s0,m0
mi
mj
mi
mj|mj
ai
expr
ai
expr1:a1
ai:b
expr2
ai:c
expr3
ai:d
expr4
ai
expr1:a2
ai:b
expr2
ai:c
expr3
ai:d
expr4
symbol
ai
1
2
3
Translated Into
a.SP
a633
a.FP
a62
a.EA
a61
The assembler analyzes expr and tries to generate the minimum number of load immediate instructions.
If the symbol is relocatable, the assembler always generates four instructions and the loader fills in the values.
See Appendix A, page 265.
S231450
31
a.RA
a60
a.CI
a59
a.CSP
a58
a.CFP
a57
32
S231450
Pseudo instructions
Program control
Loader linkage
Mode control
Section control
Message control
Listing control
Symbol definition
Data definition
Conditional assembly
Micro definition
File control
INCLUDE
Defined sequences
S231450
33
Result
Operand
label
name
arguments
Comment
;comment
The fields are separated by white space. Depending on the pseudo instruction,
the label field may be required, optional, or ignored. The name in the Result
field is the name of the pseudo instruction. The name may be all uppercase or
all lowercase but not mixed case. No other subfield besides the name is in the
Result field. The arguments in the Operand field may be required, optional,
or ignored. Comments are optional.
Description
IDENT
END
COMMENT
34
Pseudo
Description
ENTRY
EXT
START
S231450
OSINFO
Description
BASE
QUAL
EDIT
FORMAT
Description
SECTION
STACK
ORG
LOC
BITW
BSS
ALIGN
S231450
Pseudo
Description
ERROR
ERRIF
MSG and
NOMSG
DMSG
Description
LIST
SPACE
EJECT
TITLE
SUBTITLE
TEXT
ENDTEXT
Description
SET
MICSIZE
DBSM
S231450
binary cannot be used within a section that does not allow instructions, data, or
both.
The data definition pseudo instructions are as follows:
Pseudo
Description
CON
BSSZ
DATA
VWD
Description
IFA
IFE
IFC
IFM
SKIP
ENDIF
ELSE
S231450
37
Pseudo
Description
CMICRO
MICRO
OCTMIC
DECMIC
HEXMIC
Description
$DATE
Current date: mm / dd / yy
$JDATE
$TIME
Time of day - hh : mm : ss
$MIC
$CNC
$QUAL
$CPU
$CMNT
$APP
<edited line>
38
S231450
In the following example, a micro called PFX is defined as the character string
ID. A reference to PFX is in the label field of a line.
"PFX"TAG
A1
S1
In the following example, before the line is interpreted, the assembler substitutes
the definition for PFX producing the following line:
IDTAG
A1
S1
The following example shows the use of the predefined micros, AREGSIZE
and PREGSIZE:
A
B
=
"AREGSIZE"
CON A
=
"PREGSIZE"
CON B
;
;
;
;
Size of the
Store value
Size of the
Store value
A registers.
in memory.
Program register.
in memory.
S231450
Pseudo
Description
MACRO
OPDEF
DUP
ECHO
ENDM
ENDDUP
STOPDUP
LOCAL
39
OPSYN
EXITM
40
S231450
41
within the global definition area. They are not known to the assembler after the
END pseudo instruction that terminates that program segment, and they are not
included in the cross-reference listing.
4.4 Program
The CAL program consists of one or more segments. Figure 1, page 43 illustrates
the organization of the CAL program.
42
S231450
Program
Segment - 1
Global definitions - 1
Program module - 1
Segment - 2
Global definitions - 2
Program module - 2
Segment - n
Global definitions - n
Program module - n
a12249
S231450
43
4.5 Sections
A CAL program module can be divided into blocks of memory called sections.
By dividing a module into sections, you can conveniently separate sequences
of code from data. As the assembly of a program progresses, you can explicitly
or implicitly assign code to specific sections or reserve areas of a section.
The assembler assigns locations in a section consecutively as it encounters
instructions or data destined for that particular memory section.
Use the main and literals sections for implicitly assigned code. The assembler
maintains a stack of section names assigned by the SECTION pseudo instruction.
All sections except stack sections are passed directly to the loader.
Sections can be local or common. A local section is available to the CAL program
module in which it resides. A common section is available to another CAL
program module.
To assign code explicitly to a section, use the SECTION pseudo instruction. For
more details, see Section 7.53, page 165.
4.6 Examples
This section includes examples that show the basic structure of CAL programs.
4.6.1 Example 1: Global and Local Definitions
The following example illustrates a CAL program and the definition and the use
of symbols in the context of segments and modules.
SYM1 = 1
SYM2 SET 2
%%SYM3 = 3
%%SYM4 SET 4
IDENT TEST1
S1 SYM1
S2 SYM2
S3 %%SYM3
S4 %%SYM4
END
SYM2 SET
44
;
;
;
;
;
;
;
;
;
;
;
Beginning of module 1
Register S1 gets 1
Register S2 gets 2
Register S3 gets 3
Register S4 gets 4
End of segment 1 and module TEST 1
; Beginning of segment 2
S231450
%%SYM3 =
5
IDENT TEST2
S1 SYM1
S2 SYM2
S3 %%SYM3
S4 %%SYM4
END
;
;
;
;
;
;
;
Global definitions
Beginning of module TEST 2
Register S1 gets 1
Register S2 gets 3
Register S3 gets 5
Error: not defined
End of segment 2 and module TEST 2
IDENT TEST3
S1 SYM1
S2 SYM2
S3 %%SYM3
END
;
;
;
;
;
SYM1
SYM2
STACK
=
QUAL
=
1
QNAME1
2
SNAME SECTION
MIXED
MLEVEL
SYM3
MLEVEL
ERROR
*
SECTION *
SYM4
S231450
QUAL
QNAME2
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
SYM5
SYM6
SYM7
SYM8
46
;
;
=
/QNAME1/SYM2 ;
;
;
QUAL
*
;
;
=
6
;
;
=
7
;
;
S231450
This chapter describes the as command and its options for invoking the CAL
assembler.
S231450
47
The as(1) command assembles the specified file. The following options, each
a separate argument, can appear in any order, but they must precede the file
argument:
-b bdflist
Reads the binary definition files specified by bdflist. bdflist can be
in one of the following forms:
List of files separated by a comma
List of files enclosed in double quotation marks and
separated by a comma and/or one or more spaces
The assembler first reads the default binary definition file,
unless suppressed by the -B option, and then reads the
files in the order specified in bdflist. For details on binary
definition files, see Section 5.3.2, page 54.
-B
Suppresses reading of the default binary definition file. The
default is to read the default binary definition file.
-c bdfile
Creates binary definition file bdfile. By default, the assembler
does not create a binary definition file. See Section 5.3.9, page 63.
-C cpu
Generates code for the specified CPU. By default, code is
generated for the CPU specified by the TARGET environment
variable. The -C option overrides the TARGET environment
variable. If neither the TARGET environment variable nor the
-C option are specified, the assembler generates code for a
generic Cray X1 system.
cpu can be in one of the following forms:
primary [,charc]
charc
48
S231450
-D micdef
Defines a globally defined constant micro mname, as follows:
micdef is mname[=[string]]
mname must be a valid identifier. If the = character is specified, it
must immediately follow mname. The string that immediately
follows the = character, if any, is associated with mname. If you
do not specify string, then mname will be associated with an
empty string.
If mname was defined as a micro by use of a binary definition
file, the mname specified on the command line overrides the
mname defined within the binary definition file; in that case, the
assembler issues a note-level diagnostic message.
-f
Enables new statement format (default).
-F
Enables old statement format.
-g symfile
Creates assembly output symbol file symfile. By default, the
assembler does not create an output symbol file.
-G
Forces all symbols to symfile. By default, unreferenced symbols
are excluded.
-h
Enables all list pseudo instructions, regardless of location field
name.
-H
Disables all list pseudos, regardless of location field name.
-i nlist
Restricts list pseudo processing to pseudos with location field
names that are in nlist.
S231450
49
-I options
Lists options; overrides the list pseudo instruction. Specifying
conflicting options is prohibited. Can be one or more options
in any order without intervening spaces.
50
-j
Enables editing. Editing is enabled by default.
-J
Disables editing. Editing is enabled by default.
-l lstfile
Writes source statement listing to lstfile. By default, the assembler
does not generate a diagnostic listing.
-L msgfile
Writes diagnostic message listing to msgfile. By default, the
assembler does not generate a diagnostic message listing.
-m mlevel
Sets the message level for diagnostic listing, diagnostic message
listing, and the standard error file. mlevel must be one of the
following:
comment, note, caution, warning, or error
S231450
51
-n number
Sets the maximum number of diagnostic messages inserted into
the listing files. Files used are the source listing, diagnostic
message listing, and the standard error file. number must be 0 or
greater; the default is 100.
-o objfile
The relocatable object file is objfile. By default, the relocatable
object file name is formed by removing the directory name,
if any, and the .s suffix, if any, from the input file and by
appending the .o suffix.
-U
Forces source code to be converted to uppercase. Quoted strings
are protected, as are embedded micros. Both new and old format
statement types are supported.
-V
Writes the assembler version to standard error.
-x
Assemble instructions in interactive input/output mode. In
this mode, the assembler takes as input from standard input a
symbolic machine instruction and writes to standard output the
32-bit hex form. This can be used as input to the debugger to
modify code being debugged.
Binary definition files are not processed. No instruction labels,
macros, opdefs or micros are allowed. The interactive session is
terminated by a ctrl-D.
file
Assembles the named file; all options must precede the file
argument.
52
S231450
53
The assembler makes two passes for each program segment. During the first
pass, specified binary definition files are read, each source statement in the
source file and included files is read, defined sequences (such as macros) are
expanded, and memory addresses are assigned. During the second pass, values
are substituted for the symbolic operands and addresses, any appropriate
diagnostic messages are written, listing files, if specified, are written, and if there
are no errors of ERROR or INTERNAL severity, an object file is generated. If
specified, a binary definition file is also generated.
5.3.1 Reading Source Files
The assembler takes one source file as the primary input for assembly. The source
file may contain more than one program segments. See Chapter 4, page 41.
5.3.2 Using Binary Definition Files
If one or more binary definition files is specified, the assembler reads the binary
definition files before reading the source file. The global definitions (symbols,
micros, macros, opdefs, and opsyns) in the binary definition file are then visible
to the assembler as it processes the source statements in the source file.
Note: System- and user-defined binary definition files are identical in all
respects. Both types of files are created and used in exactly the same manner.
In this manual, they are treated as separate entities to encourage you to define
binary definition files that meet your particular programming requirements.
You can create user-defined binary definition files by using either of the
following methods:
Copying the system-defined binary definition files and then modifying the
new file either by adding new definitions or by redefining existing definitions.
Disabling the recognition of system-defined binary definition files and
accumulating the defined sequences entirely from an assembler source
program.
You can specify more than one binary definition file with each assembly. If more
than one binary definition file is specified, the files are processed from left to
right in the order specified by the -b option.
Lines or sequences of code assembled and stored in a binary definition file, can
be accessed without reassembly. This means accessing a binary definition file
directly saves assembler time.
54
S231450
When binary definition files are read, they are checked for the following:
CPU compatibility
Multiple references to the same definition
5.3.2.1 CPU Compatibility Checking
The assembler permits access to any previously defined file with one restriction.
Binary definition files are marked with the CPU type for which they were
created. Binary definition files created on one Cray system is not necessarily
compatible with all Cray systems. If a binary definition file is not compatible
with the system you are using, the binary definition file is not accepted and the
following message is issued:
Incompatible version of binary definition file file
This check ensures that the machine on which the binary definition file was
created is compatible with the program trying to use it. Some CAL pseudo
instructions have restricted use based on hardware and software requirements.
The binary definition file compatibility check prevents the mixing of binary
definition files and ensures that hardware and software restrictions are not
violated.
5.3.2.2 Multiple References to a Definition
The assembler checks for multiple references to definition names for macros and
opsyns, location field names for symbols and micros, and syntax for opdefs.
The following subsections describe how multiple references to a definition are
resolved.
5.3.2.2.1 Symbols
If a symbol is defined in more than one binary definition file, the definitions are
compared. If the definitions are identical, the assembler disregards the duplicates
and makes one entry for the symbol from the binary definition files. If a symbol
is defined more than once and the definitions are not identical, the assembler
uses the last definition associated with the location field name and issues the
following diagnostic message:
Symbol name is redefined in file file
S231450
55
5.3.2.2.2 Macros
If a macro with the same name is defined in more than one binary definition file,
the definitions are compared. If the definitions associated with the macros
name are identical character by character, the assembler disregards the duplicate
definition and makes one entry for the macro from the binary definition files. If
the name of the macro is used more than once, and the definitions associated
with the name are not identical character by character, the assembler uses the
definition associated with the last reference to the name and issues the following
diagnostic message:
Macro name in filefile replaces previous definition
If a macro is defined with the same name as a pseudo instruction, the macro
replaces the pseudo instruction and the assembler issues the same message as
shown above.
5.3.2.2.3 Opdefs
If an opdef with the same syntax is defined in more than one binary definition
file, the definitions of the opdefs are compared. If the definitions of the two
opdefs are exactly the same, the assembler disregards the duplicate definition
and makes one entry for the opdef from the binary definition files. If the same
syntax appears more than once and the definitions are not exactly the same, the
syntax associated with the last reference to the opdef is used as its definition and
the assembler issues the following diagnostic message:
Opdef name in file file replaces previous definition
If an opdef is defined with the same syntax as a machine instruction, the opdef
replaces the machine instruction and the assembler issues the message shown
above.
5.3.2.2.4 Opsyn
If an opsyn with the same name is defined in more than one binary definition
file, the definitions are compared. If the definitions are identical, the assembler
disregards the duplicate definition and makes one entry for the opsyn from the
binary definition files. If the name for an opsyn is used more than once and the
definitions are not identical, the assembler uses the definition associated with the
last reference to the opsyn name and issues the following diagnostic message:
Opsyn name in file file replaces previous definition
56
S231450
If an opsyn is defined with the same name as a pseudo instruction, the opsyn
replaces the pseudo instruction and the assembler issues the message as shown
above. Pseudo instructions have an internal code that permits the assembler to
identify them when they are encountered. When an opsyn is used to redefine an
existing pseudo instruction, the assembler copies the predefined internal code of
that pseudo instruction and uses it for identification in the binary definition file.
5.3.2.2.5 Micros
If a micro with the same location field name is defined in more than one binary
definition file, the micro strings associated with the location field names are
compared. If the strings are identical, the assembler disregards the duplicate
definition and makes one entry for the micro from the binary definition files. If
the micro is used more than once and the strings associated with the micro names
are not exactly identical, the assembler uses the string associated with the last
reference to the micro name and issues the following diagnostic message:
Micro name in filefile replaces previous definition
S231450
57
Assembler version #
Title
Global page #
Subtitle
Local page #
58
S231450
Location address
Hex code
Line number
Source statement
or
Diagnostic message
Sequence field
a12246
The five columns of the source statement listing are described as follows:
The location address column contains the hex representation of the byte address
of the current statement.
The hex code column contains the hex representation of the current instruction
or numeric value.
If the numeric value is an address, the hex code has one of the following
suffixes:
+ (Relocation in program block)
C (Common section)
D (Dynamic section)
S (Stack section)
T (Task common)
Z (Zero common)
: (Immobile attribute)
X (External symbol)
None (Absolute address)
The results of several pseudo instructions can also appear in the hex code
column:
The hex value of symbols defined by the SET, MICSIZE, or = pseudo
instruction
The hex value of the number of bytes reserved by the BSS or BSSZ
pseudo instruction
S231450
59
The hex value of the number of bytes skipped as a result of the ALIGN
pseudo instruction
The hex value of the number of characters in a micro string defined by a
MICRO, OCTMIC, or DECMIC pseudo instruction
The line number column contains the line number of the source code.
The source statement column is 72 characters wide and holds columns 1
through 72 of each source statement.
The diagnostic column contains a diagnostic message immediately following
a statement that contains an error.
The sequence field column contains either an identifier or information taken
from columns 73 through 90 of the source line image (which may be empty).
It contains an identifier if the line is an expansion of a macro or opdef, or if
the line was edited.
5.3.5 Cross-reference Listing
The assembler generates a cross-reference listing in the format shown in Figure
4. The assembler lists symbols alphabetically and groups them by qualifier if
the QUAL pseudo instruction has declared qualifiers. If qualifiers were declared,
each new qualifier appears on a fresh page. The qualifier name appears on the
third line of the page header.
The cross-reference listing does not include unreferenced symbols that are
defined between TEXT and ENDTEXT pseudo instructions and it does not include
symbols of the form %%xxxxxx; x is zero or more identifier characters.
Note: The cross reference page header is nearly identical to the page header of
the assembler listing; the difference is that the string Symbol cross reference is
printed out in the middle field of the third line of the cross-reference listing.
60
S231450
Title
Subtitle
Assembler version #
Date and time
Value
Global page #
Local page #
Cray Inc. system
Symbol references
a12247
S231450
61
where line is the decimal representation of the line number that contains
the reference.
x represents the type of reference as follows:
A blank in this column means the symbol value is used at the specified
line.
D means the symbol is defined in the location field of an instruction or else
by a SET, =, or EXT pseudo instruction.
E means the symbol is an entry name.
F means the symbol is used in an expression on an IFE, IFA, or ERRIF
conditional pseudo instruction.
R means the symbol is used in an address expression in a memory read
instruction.
S means the symbol is used in an address expression in a memory store
instruction.
If a symbol is defined in text between TEXT and ENDTEXT pseudo instructions,
the cross-reference listing reports the associated TEXT name on the line below
the symbol reference.
If a symbol is defined in a binary definition file, the cross-reference listing reports
the associated file name on the line below the symbol reference.
5.3.6 Diagnostic Messages
The assembler generates diagnostic messages that provide user information
about the assembly. Diagnostic messages are classified by level of severity from
low to high, as follows:
Comment (statistical information)
Note (possible assembly problems)
Caution (definite user errors during assembly)
Warning (possible error such as truncation of a value)
Error (fatal assembly error, you should check the message and source code
carefully for possible mistakes)
62
S231450
63
64
S231450
5.3.9.3 Opdefs
The assembler accumulates opdefs (operation definitions) to be included in a new
binary definition file from all currently accessed binary definition files and from
all of the global parts of segments within a source program.
5.3.9.4 Opsyns
The assembler accumulates opsyns (operation synonyms) to be included in a new
binary definition file from all currently accessed binary definition files and from
all of the global parts of segments within a source program.
5.3.9.5 Micros
The assembler accumulates micros to be included in a new binary definition file
from all currently accessed binary definition files and from all of the global parts
of segments within source program. Only micros that cannot be redefined are
included in a binary definition file. A micro must be defined using the CMICRO
pseudo instruction to be included in a binary definition file.
5.4 Linking
To create an executable program containing one or more assembler-generated
object files, invoke the loader to link the object files with compiler- generated
object files and/or object files contained in libraries. The loader may be invoked
with commands ld(), cc(), or ftn().
S231450
65
This chapter describes in detail the format and syntax for source statements, the
components of source statements, and the attributes of symbols and expressions.
The assembly language capabilities described here and in Chapter 9, page 215
provide very powerful programming capabilities beyond simply specifying
symbolic machine instructions.
A CAL program is expressed in the form of source statements. CAL source
statements fall into five categories:
A symbolic machine instruction describes symbolically a Cray X1 machine
instruction.
A pseudo instruction controls the assembly process or results in generated
data but does not result in generated machine instructions.
A macro instruction represents a user-defined sequence of symbolic machine
instructions and/or pseudo instructions.
An opdef instruction represents a user-defined sequence of one or more
symbolic machine instructions and has the same syntax as a symbolic
machine instruction.
A comment allows for annotation of a program but does not result in any
generated machine instructions nor does it affect the assembly process.
The components of a statement are one or more of:
A symbol is an identifier that has a value and several attributes.
A tag is an identifier used in the label field of macros and other defined
sequences but does not have a value or attributes.
A mnemonic is an identifier that is a fixed part of a symbolic machine
instruction or pseudo instruction.
A constant is a character string that does not contain any operators and can
be evaluated to a fixed value at assembly time.
A data item specifies a numerical or character value in the operand field of the
DATA pseudo instruction and in literals.
A micro is an identifier that names a character string.
A location element represents the current value of the location counter.
S231450
67
Result
Operand
Comment
68
S231450
69
extends beyond column 32, however, the operand field must begin after not
more than one blank separator and can begin after column 35.
The comment field begins with the first nonblank character following the
operand field or, if the operand field is empty, does not begin before column
35. If the result field extends beyond column 32 and no operand entry is
provided, two or more blanks must precede the comment field.
If editing is enabled, comments are edited.
The old format is specified by either the FORMAT pseudo instruction or the -F
parameter of the assembler invocation statement.
6.1.6 Case Sensitivity
Formal parameters, symbols, names, and macro names are case sensitive.
To be recognized, subsequent references to a previously defined formal
parameter, symbol, name, or macro name must match the original definition
character-for-character and case-for-case (uppercase or lowercase).
The following rules govern the use of uppercase and lowercase characters
in CAL statements:
Pseudo instructions and mnemonics are case sensitive; they can be uppercase
or lowercase, but not mixed case.
Register types are case insensitive; they can be uppercase, lowercase, or
mixed case.
Macro names, opdef mnemonics, symbol names, and other names are case
sensitive; they are interpreted as coded.
6.2 Symbols
A symbol is an identifier that can be from 1255 characters long and has an
associated value and attributes. You can use symbols in expressions and in
the following ways:
In the label field of a source statement to define the symbol for use in the
program and to assign it a value and certain characteristics called attributes.
In the operand or result field of a source statement to reference the symbol.
In loader linkage.
70
S231450
A symbol can be local or global depending on where the symbol is defined; that
is, a symbol used within a single program module is local, and a symbol used by
a number of program segments is global (see Section 4.2, page 41). A symbol also
can be unique to a code sequence (see Section 6.2.1.2, page 72).
In addition to symbols specified in source statements, the assembler may
generate symbols for internal use of the following form (where n is a decimal
digit):
%%nnnnnn
Symbols that begin with the character sequence %% are discarded at the end of
a program segment regardless of whether they are redefinable or defined in
the global definitions part, and regardless of whether they are user-defined or
generated by the assembler.
For more detailed information about symbols generated by the assembler, see the
description of the LOCAL pseudo instruction in Section 7.38, page 151.
If a symbol name is the same as a Cray X1 register name, a warning message
is issued.
6.2.1 Symbol Qualification
Symbols defined within a program module (between IDENT and END pseudo
instructions) can be unqualified or qualified. They are unqualified unless
preceded by the QUAL pseudo instruction (see Section 7.52, page 163, for more
information).
6.2.1.1 Unqualified Symbol
The following statements describe ways in which unqualified symbols can
be referenced:
Unqualified symbols defined in an unqualified code sequence can be
referenced without qualification from within that sequence.
If the symbol has not been redefined within the current qualifier, unqualified
symbols can be referenced without qualification from within the current
qualifier.
Unqualified symbols can be referenced from within the current qualifier by
using the form // symbol.
S231450
71
; symbol is equal to n
SYM_1
SYM_2
SYM_3
EDIT
OFF
IDENT TEST
=
*
A1
SET
=
END
SYM_1
2
3
;
;
;
;
;
/[identifier]/symbol
72
IDENT
TEST
=
1
QUAL NAME1
; Assignment
; Declare qualifier name
S231450
SYM1
=
S1
S1
S1
QUAL
S1
S1
S1
END
2
SYM1
//SYM1
/NAME1/SYM1
*
SYM1
//SYM1
/NAME1/SYM1
;
;
;
;
;
;
;
;
PARAM
SET
D18
EXT
SECOND
;
;
;
;
;
S231450
Immobile
A symbol is assigned the relative attribute of immobile when the current
location counter is immobile and it appears in the label field of a machine
instruction, BSS pseudo instruction, or data generation pseudo instruction,
such as BSSZ or CON, or if it is equated to an expression that is immobile. The
symbol is known only at assembly time.
Relocatable
A symbol is assigned the relative attribute of relocatable when the current
location counter is relocatable and it appears in the label field of a machine
instruction, BSS pseudo instruction, or data generation pseudo instruction
such as BSSZ or CON. A symbol also is relocatable if it is equated to an
expression that is relocatable.
External
A symbol is assigned the relative attribute of external when it is defined by an
EXT pseudo instruction. An external symbol defined in this manner is entered
in the symbol table with a value of 0. The address attribute of an external
symbol is specified as value (V), byte ( B), or word ( W); the default is value.
A symbol is also assigned the relative attribute of external if it is equated to an
expression that is external. Such a symbol assumes the value of the expression
and can have an attribute of byte address, word address, or value.
Note: The assignment of an unknown variable with a register at assembly
time is made by using a symbol with a relative attribute of external.
In the following example, register s1 is loaded with variable ext1 at assembly
time:
ident test1
ext
test1
ext1
s1
ext1
end
ident test2
entry ext1
=
3
end
S231450
75
IDENT
=
SET
SET
SET
END
TEST
1
2
2
3
;
;
;
;
Not redefinable
Redefinable
Error: SYM1 previously defined as 1
Redefinable
SYM1+1
IFA
DEF,SYM1
;
;
;
;
;
;
;
6.3 Tags
A tag is an identifier that does not have an associated value or attribute and
cannot be used in expressions. Tags that are 132 characters in length are used to
identify the following types of information:
76
S231450
Macro instructions
Micro character strings
Conditional sequences
Duplicated sequences
The first character must be one of the following:
Alphabetic character (A through Z or a through z)
Dollar sign ($)
Percent sign (%)
At sign (@)
Underscore character (_)
Characters 232 can also be decimal digits (0 through 9).
Tags that are 1255 characters in length can be used to identify the following
types of information:
Program modules
Sections
The first character must be one of the valid tag characters or the underscore (_)
character. Characters 2255 can also be decimal digits (0 through 9).
Different types of tags do not conflict with each other or with symbols. For
example, a micro can have the same tag as a macro, and a program module
can have the same tag as a section.
Examples of valid and not valid tags:
S231450
Valid
Comment
count
Lowercase is permitted
@ADD
_SUBTRACT
ABCDE465
77
Not valid
Comment
9knt
Y+Z3
+YZ3
Begins with +
Note: If you plan to use a source manager to store your CAL program, avoid
using special character sequences such as the three-character string %U%. A
source manager may replace these strings throughout your source program
with other text. Because this type of string is allowed within identifiers and
long-identifiers, avoid using it in names, long names, and symbols.
The underscore character (_) also is used as the concatenation character (see
Section 6.10, page 97). Usually the assembler edits this character out of a source
line. To insert this character into a long name, either disable editing or use
the predefined concatenation micro ($CNC). To disable editing, use either the
invocation statement or the EDIT pseudo instruction.
6.4 Constants
Constants can be defined as floating, integer, or character.
6.4.1 Floating Constant
A floating constant is evaluated as a 32-bit, 64-bit, or 128-bit quantity, depending
on the precision specified.
The floating constant is defined as follows:
[decimal-prefix] floating-decimal [floating-suffix] [binary-scale decimal-integer]
In the preceding definition, variables are defined as follows:
decimal-prefix
This variable specifies the numeric base for the floating-decimal and/or the
decimal-integer variables. D or d specifies a decimal-prefix and is the only
prefix available for a floating constant.
floating-decimal
The floating-decimal variable can include the decimal-integer, decimal-fraction
and/or decimal-exponent variables. A decimal-integer is a nonempty string of
78
S231450
or n. nDn
or n. D+n
or n. +n or n.nn or nnD+ n
79
sn or s+n
S-n or s-n
SYM
CON
CON
D1.5
4.5E+10
CON
4.D+15
CON
D1.0E-6
CON
1000e2
1777752d+l0
;
;
;
;
;
;
;
;
;
;
;
S231450
sn or s+n
s-n or S-n
O or o
Octal
X, x, 0X, or 0x
Hexadecimal
octal-integer
A string of octal integers (0, 1, 2, 3, 4, 5, 6, 7) of any length
decimal-integer
A string of decimal integers (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) of any length
hex-integer
A string of hexadecimal integers (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A or a, B or b, C or
c, D or d, E or e, F or f) of any length
The following examples illustrate integer constants:
S231450
S1
A4
O1234567
D50
SYM
xffffffa
SYM2
0Xbeef
;
;
;
;
;
;
;
81
L or l
Left-justified, zero-filled
R or r
Right-justified, zero-filled
Z or z
32/EFG
;
;
;
;
;
;
;
justified,
justified,
justified,
justified,
zero filled.
zero filled.
blank filled.
blank
justified, blank
field (all default).
82
S231450
Not complemented
Ones complemented
Note: Although syntactically correct, ~ is not permitted; a semantic error
is generated with floating data.
floating-constant
The syntax for a floating data item is the same as the syntax for floating
constants. Floating constants are described in Section 6.4.1, page 78.
The following example illustrates floating constants for data items:
S231450
DATA
D1345.567
DATA
1345.E+1
DATA
4.5E+1O
DATA
4.D+15
DATA
D1.0E-6
DATA
1000e2
DATA
1.5S2
;
;
;
;
;
;
;
;
;
;
;
;
;
;
83
Not complemented
Ones complemented
+o20
40/0,24/O200
; Octal integer
character-string
The default is a string of zero or more characters (enclosed in apostrophes)
from the ASCII character set. Two consecutive apostrophes (excluding the
delimiting apostrophes) indicate one apostrophe.
character-count
The length of the field, in number of characters, into which the data item
will be placed. If count is not supplied, the length is the number of words
84
S231450
needed to hold the character string. If a count field is present, the length is the
character count times the character width; therefore, length is not necessarily
an integral number of words. The character width is 8 bits for ASCII or
EBCDIC, and 6 bits for control data display code.
If an asterisk is in the count field, the actual number of characters in the
string is used as the count. Two apostrophes that are used to represent one
apostrophe are counted as one character.
If the base is mixed, the assembler assumes that the count is decimal
character-suffix
This variable specifies justification and fill of the character string as follows:
H or h
L or l
Left-justified, zero-filled
R or r
Right-justified, zero-filled
Z or z
AERROR IN DSN
;
;
Aerror in dsnR ;
;
Error
;
;
;
6.6 Literals
Literals are read-only data items whose storage is controlled by the assembler.
Specifying a literal lets you implicitly insert a constant value into memory. The
actual storage of the literal value is the responsibility of the assembler. Literals
can be used only in expressions because the address of a literal, rather than its
value, is used.
The first use of a literal value in an expression causes the assembler to store
the data item in one or more words in a special local block of memory known
as the literals section. Subsequent references to a literal value do not produce
multiple copies of the same literal.
S231450
85
Because literals can map into the same location in the literals section, the
assembler checks for the presence of matching literals before new entries are
added. This check is made bit by bit. If the current string is identical to any
string currently stored in the literals section, the assembler maps that string to
the location of the matching string. If the current string is not identical to any of
the strings currently stored, the current string is considered to be unique, and is
assigned a location in the literals section.
The following special syntaxes are in effect for literals:
Literals always have the following attributes:
Relocatable (relative) to a constant section
Byte (address)
Literals cannot be specified as character strings of zero bits. The actual
constant within a literal must have a bit length greater than 0. In actual use,
you must specify at least one 8-bit character for the ASCII character set.
By default, literals always fall on full-word boundaries. Trailing blanks are
added to fill the word to the next word boundary.
When used as an element of an expression, a literal is defined as follows:
=data-item
A data item for literals is the same as data items for constants. Data items for
constants are described in Section 6.5, page 82.
Single-precision literals are stored in one 64-bit word (default). Double-precision
literals are stored in two 64-bit words. The following example shows how literals
can be specified with single or double precision:
CON
CON
=1.5
=1.sD1
; Single-precision literal
; Double-precision literal
Figure 5 illustrates how the ASCII character a is stored by either of the following
instructions (^ represents a blank character):
CON =aH
CON =a
86
S231450
Figure 6 illustrates how the ASCII character a is stored by any of the following
instructions:
CON =aL
CON aR
CON -aS
This example illustrates how the ASCII character a is stored when =aR is
specified.
S231450
87
=AB3
CON
=AB3H
CON
=AB6R
CON
=AB6Z
;
;
;
;
;
;
;
;
6.7 Micros
Through the use of micros, you can assign a name to a character string and
subsequently refer to the character string by its name. A reference to a micro
results in the character string being substituted for the name before assembly of
the source statement containing the reference. The CMICRO, MICRO, OCTMIC,
and DECMIC pseudo instructions (described in Chapter 7, page 103) assign the
name to the character string.
Refer to a micro by enclosing the micro name in double quotation marks (" ")
anywhere in a source statement other than within a comment. If column 72 of a
line is exceeded because of a micro substitution, the assembler creates additional
continuation lines. No replacement occurs if the micro name is unknown or if one
of the quotation marks is omitted.
When a micro is edited, the source statement that contains the micro is changed.
Each substitution produces one of the following cases:
The length of the micro name and the pair of quotation marks is the same
as the predefined substitute string. When the micro is edited, the length of
the source statement is unchanged.
88
S231450
The length of the micro name and the double quotation marks is greater than
the predefined substitute string. When the string is edited, all characters to
the right of the edited string shift left the number of spaces equal to the
difference between the length of the micro name including the double
quotation marks and the predefined substitute string.
The length of the micro name and the double quotation marks is less than
the predefined substitute string. If column 72 of a line is exceeded because
of a micro substitution, the assembler creates additional continuation lines.
Resulting lines are processed as if they were one statement.
In the following example, the length of the micro name (including quotation
marks) is equal to the length of the predefined substitute string. A micro named
PFX is defined as EQUAL. A reference to PFX is in the label field of the statement,
as follows:
"PFX"TAG
S0
S1
When the line is interpreted, the assembler substitutes EQUAL for "PFX",
producing the following line:
EQUALTAG
S0
S1
In the following example, the length of the micro name (including quotation
marks) is greater than the length of the predefined substitute string. A micro
named PFX is defined as LESS. A reference to PFX is in the label field of the
statement, as follows:
"PFX"TAG
S0
S1
;
;
;
;
;
Before the line is interpreted, the assembler substitutes LESS for "PFX",
producing the following line:
LESSTAG
S231450
S0
S1
;
;
;
;
;
89
In the following example, the length of the micro name (including quotation
marks) is less than the length of the predefined substitute string. A micro
named pfx is defined as greater. A reference to pfx is in the label field of the
following statement:
"pfx" tag S0
S1
;
;
;
;
;
Before the line is interpreted, the assembler substitutes the predefined string
greater for "pfx". Because the predefined substitute string is 2 characters
longer than micro name, the fields to the right of the substitution are shifted 2
characters to the right, producing the following statement:
greatertag
S0
S1
;
;
;
;
One or more micro substitutions can occur between the beginning and ending
quotation marks of a micro. These substitutions create a micro name that is
substituted, along with the surrounding quotation marks, for the corresponding
micro string. Substitutions of this type are embedded micros. An embedded micro
consists of a micro name included between a left ({) and a right brace ( }) and is
specified as follows:
{microname}
micro
micro
\
\\
S231450
*
*
*
*
*
*
*
*
91
S231450
93
generated. You can alter this normal advancement by using the BITW, BITP,
DATA, and VWD pseudo instructions.
6.8.4 Force Longword Boundary
If either of the following conditions are true, the assembler completes a partial
word and sets the word-bit-position counter to 0:
The current instruction is an ALIGN, BSS, BSSZ, CON, LOC, or ORG pseudo
instruction.
The current instruction is a DATA or VWD pseudo instruction and the
instruction has an entry in the label field.
6.9 Expressions
The result and operand fields for many source statements contain expressions.
An expression consists of one or more constants (see Section 6.4, page 78), literals
(see Section 6.6, page 85), location elements (see Section 6.8, page 92) or symbols
(see Section 6.2, page 70) and zero or more operators (see Section 6.9.1, page 95).
There are some restrictions on the combinations of operands and operators that
are allowed in the different contexts, as specified below.
The assembler will evaluate the expression, applying appropriate restrictions
and if no restrictions are violated, insert the value of the expression into the
immediate field in the machine instruction or the operand field of the pseudo
instruction.
Registers are not included as part of a CAL expression. A register may be an
operand in an instruction but the assembler cannot determine the value of the
register. For example, in the instruction:
s5
s3+2*3
the assembler parses the instruction such that 2*3 is an expression that it
evaluates and then inserts the value of 6 into the immediate field of the machine
instruction. It does not treat s3 as part of the expression.
Each CAL expression has a type and a value. The type is one of:
absolute
object
94
S231450
function
If the type of the expression is either object or function, it has a relative attribute
that is one of:
relocatable
external
immobile
and has an address attribute that is one of:
byte address
stack offset
6.9.1 Operators
The CAL operators are:
unary operators:
+ (unary plus)
(unary minus)
~ (bitwise complement)
! (logical NOT)
B. (byte prefix)
b. (byte prefix)
W. (word prefix)
w. (word prefix)
L. (longword prefix)
l. (longword prefix)
< (mask right)
> (mask left)
binary operators:
+ (add)
S231450
95
( subtract)
* (multiply)
/ (divide)
& (bitwise AND)
| (bitwise OR)
^ (bitwise XOR)
&& (logical AND)
|| (logical OR)
<< (bitwise left shift)
>> (bitwise right shift)
6.9.2 Operator Precedence
CAL expressions are evaluated according to the following operator precedence:
! ~ +(unary) -(unary) B. W. L. b. w. l. < >
* /
+ << >>
&
^
|
&&
||
Right to left
Left to right
Left to right
Left to right
Left to right
Left to right
Left to right
Left to right
Left to right
S231450
S231450
97
Character
Edit
Description
Yes
Yes
No
No
No
Note: When the assembler edits "$CMNT", "$MIC", "$CNC", or "$APP", the
string name and the pair of double quotation marks (" ") are replaced by a
previously defined string. For example, when the assembler edits "$CMNT", a
semicolon is substituted for the micro name $CMNT and the double quotation
marks (" "). After the substitution occurs, the semicolon is not edited again
and editing continues on the line. Using the predefined "$CMNT" micro
permits a comment to be edited.
For example,
"$CMNT" Cray Inc
"$DATE" - "$TIME"
is edited as follows:
; Cray Inc
12/31/02 - 8:15:45
The characters to the right of the substituted character are shifted six positions
to the left after editing, because the character string substituted for "$CMNT"
(;) is six characters shorter than the micro name.
98
S231450
S231450
99
6.10.5 Comment
A semicolon (;) in any column (new format only) or an asterisk (*) in column 1
indicates a comment line. The assembler lists comment lines, but they have no
effect on the program. When a semicolon or an asterisk has an editing symbol
after it, the symbol is treated as part of the comment and is not used. In the new
format, comment statements with semicolons or asterisks are not appended.
Note: Asterisk comment statements are not included in macro definitions. To
include a comment line in a macro definition, enter an underscore in column 1
of the comment line followed by an asterisk and then the comment. Because
editing is disabled at definition time, the statement is inserted. If editing is
enabled at expansion time, the underscore is edited out and the statement is
treated as a comment.
The following example illustrates the use of comment statements in a macro:
MACRO
EXAMPLE
* This comment is not included in the definition.
_* This comment is included in the definition.
SYM
=
1
EXAMPLE ENDM
100
S231450
MCALL
ARG1,\
ARG2,\
ARG3,\
ARG4,\
ARG5
MCALL
ARG1,ARG2,ARG3,ARG4,ARG5
S231450
ARG1,ARG2,ARG3
; Comments
101
This chapter lists the pseudo instructions presented throughout Chapter 3, page
33, in alphabetical order for easy reference.
Note: You can specify pseudo instructions in uppercase or lowercase, but
not in mixed case.
Throughout this chapter, pseudo instructions with ignored fields (location or
operand) are defined as follows:
pseudox
ignored
ignored
The assembler ignores the label field of this statement. If the field is
not empty, then all of the characters in the field are skipped until
a blank character is encountered and a caution-level message is
issued. The first nonblank character following the blank character
is assumed to be the beginning of the result field.
pseudox
ignored
pseudoy
ignored
103
expression[,[attribute]]
(A*B+100)/4
BASE
option/*
S231450
The option variable specifies the numeric base of numeric data. It is a required
single character specified as follows:
O or o (Octal)
D or d (Decimal)
X or x (Hex)
M or m (Mixed)
Numeric data is assumed to be octal, except for numeric data used for the
following (assumed to be decimal):
Statement counts in DUP and conditional statements
Line count in the SPACE pseudo instruction
Bit position or count in the BITW, BITB, or VWD pseudo instructions
Character counts as in CMICRO, MICRO, OCTMIC, and DECMIC pseudo
instructions
Character count in data items (see Section 6.5.3, page 84).
When the asterisk (*) is used with the BASE pseudo instruction, the numeric
base reverts to the base that was in effect prior to the specification of the
current prefix within the current program segment. Each occurrence of a BASE
pseudo instruction other than BASE * can modify the current prefix. Each
BASE * releases the most current prefix and reactivates the prefix that preceded
the current prefix. If all BASE pseudo instructions specified are released, a
caution-level message is issued, and the default mode (decimal) is used.
The following example illustrates the use of the BASE pseudo instruction:
BASE
VWD
.
.
.
BASE
VWD
.
.
.
BASE
VWD
S231450
D
49/19
M
39/12
.
.
.
BASE
BASE
BASE
*
*
*
7.4 BITW
The BITW pseudo instruction resets the current bit position to the value specified,
relative to bit 0 of the current word. If the current bit position is not bit 0, a value
of 64 (decimal) forces the following instruction to be assembled at the beginning
of the next word (force word boundary). If the current bit position is bit 0, the
BITW pseudo instruction with a value of 64 does not force a word boundary, and
the instruction following BITW is assembled at bit 0 of the current word.
If the origin and location counters are set lower than the current value, any
code previously generated in the overlapping part of the word is ORed with
any new code.
The BITW pseudo instruction is restricted to sections that allow data or
instructions and data. If the BITW pseudo instruction is found within a definition,
it is defined and is not recognized as a pseudo instruction. If the BITW pseudo
instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the BITW pseudo instruction is as follows:
ignored
BITW
[expression]
The expression variable is optional. If expression is not specified, the default is the
absolute value of 0. If expression is specified, it must have an address attribute of
value, a relative attribute of absolute, and be a positive value in the range from 0
to 64 (decimal). All symbols within expression (if any) must have been defined
previously. If the current base is mixed, decimal is used.
The expression operand must meet the requirements for expressions as described
in Section 6.9, page 94.
The value generated in the code field of the listing is equal to the value of the
expression.
The following example illustrates the use of the BITW pseudo instruction:
106
S231450
BITW
D39
7.5 BSS
The BSS pseudo instruction reserves a block of memory in a section. A forced
byte boundary occurs, and the number of bytes specified by the operand field
expression is reserved. This pseudo instruction does not generate data. To
reserve the block of memory, the location and origin counters are increased.
You must specify the BSS pseudo instruction from within a program module. If
the BSS pseudo instruction is found within a definition, it is defined and is not
recognized as a pseudo instruction. If the BSS pseudo instruction is found within
a skipping sequence, it is skipped and is not recognized as a pseudo instruction.
The format of the BSS pseudo instruction is as follows:
[symbol]
BSS
[expression]
The symbol variable is optional. It is assigned the byte address of the location
counter after the force byte boundary occurs. symbol must meet the requirement
for symbols as described in Section 6.2, page 70.
The expression variable is an optional absolute expression with a byte address
or value attribute and with all symbols, if any, previously defined. The value
of the expression must be positive. A force byte boundary occurs before the
expression is evaluated.
The expression operand must meet the requirements for an expression as
described in Section 6.9, page 94.
The left margin of the listing shows the hex byte count.
The following example illustrates the use of the BSS pseudo instruction:
A
S231450
BSS
CON
CON
CON
BSS
4
NAME
1
2
16+A-W.*
107
7.6 BSSZ
The BSSZ pseudo instruction generates a block of bytes that contain 0s. When
BSSZ is specified, a forced byte boundary occurs, and the number of zeroed bytes
specified by the operand field expression is generated.
The BSSZ pseudo instruction is restricted to sections that have a type of data
or instructions and data. If the BSSZ pseudo instruction is found within a
definition, it is defined and is not recognized as a pseudo instruction. If the BSSZ
pseudo instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the BSSZ pseudo instruction is as follows:
[symbol]
BSSZ
[expression]
7.7 CMICRO
The CMICRO pseudo instruction assigns a name to a character string. After
the name is defined, it cannot be redefined. If the CMICRO pseudo instruction
is defined within the global definitions part of a program segment, it can be
referenced at any time after its definition by any of the segments that follow. If
the CMICRO pseudo instruction is defined within a program module, it can be
referenced at any time after its definition within the module. However, a constant
micro defined within a program module is discarded at the end of the module
and cannot be referenced by any segments that follow.
If the CMICRO pseudo instruction is found within a definition, it is defined and
is not recognized as a pseudo instruction. If the CMICRO pseudo instruction
108
S231450
CMICRO
[string[,[exp][,[exp],[case]]]]
The name variable is required and is assigned to the character string in the
operand field. It has attributes that cannot be redefined. If name was previously
defined and the string represented by the previous definition is not the same
string, an error message is issued and definition occurs. If the strings match,
no error message is issued and no definition occurs. name must meet the
requirements for identifiers as described in Section 6.3, page 76.
The string variable represents an optional character string that can include
previously defined micros. If string is not specified, an empty string is used. A
character string can be delimited by any character other than a space. Two
consecutive occurrences of the delimiting character indicate a single such
character (for example, a micro consisting of the single character * can be
specified as * or ****).
The exp variable represents optional expressions. The first expression must be
an absolute expression that indicates the number of characters in the micro
character string. All symbols, if any, must be previously defined. If the current
base is mixed, decimal is used for the expression. The expressions must meet the
requirements for expressions as described in Section 6.9, page 94.
The micro character string is terminated by the value of the first expression or
the final apostrophe of the character string, whichever occurs first. If the first
expression has a 0 or negative value, the string is considered empty. If the first
expression is not specified, the full value of the character string is used. In this
case, the string is terminated by the final apostrophe.
The second expression must be an absolute expression indicating the micro
strings starting character. All symbols, if any, must be defined previously. If the
current base is mixed, decimal is used for the expression.
The starting character of the micro string begins with the character that is equal
to the value of the second expression, or with the first character in the character
string if the second expression is null or has a value of 1 or less.
The optional case variable denotes the way uppercase and lowercase characters
are interpreted when they are read from string. Character conversion is restricted
S231450
109
to the letter characters (A - Z and a - z) specified in string. You can specify case in
uppercase, lowercase, or mixed case, and it must be one of the following values:
MIXED or mixed
string is interpreted as you entered it and no case conversion occurs. This
is the default.
UPPER or upper
All lowercase alphabetic characters in string are converted to their uppercase
equivalents.
LOWER or lower
All uppercase alphabetic characters in string are converted to their lowercase
equivalents.
7.8 COMMENT
The COMMENT pseudo instruction defines a character string of up to 256
characters that will be entered as an informational comment in the generated
binary load module.
If the operand field is empty, the comment field is cleared and no comment is
generated. If a comment is specified more than once, the most recent one is
used. If the last comment differs from the previous comment, a caution-level
message is issued.
If a subprogram contains more than one COMMENT pseudo instruction, the
character string from the last COMMENT pseudo instruction goes into the binary
load module.
You must specify the COMMENT pseudo instruction from within a program
module. If the COMMENT pseudo instruction is found within a definition, it
is defined and is not recognized as a pseudo instruction. If the COMMENT
pseudo instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the COMMENT pseudo instruction is as follows:
ignored
110
COMMENT
[del-char[string-of-ASCII]del-char]
S231450
CAL
COPYRIGHT CRAY INC. 2002
-CRAY X1 computer system@ABCDEF@@FEDCBA@
7.9 CON
The CON pseudo instruction generates one or more full 64-bit words of binary
data. This pseudo instruction always causes a forced 64-bit word boundary.
The CON pseudo instruction is restricted to sections that have a type of data
or instructions and data. If the CON pseudo instruction is found within a
definition, it is defined and is not recognized as a pseudo instruction. If the CON
pseudo instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the CON pseudo instruction is as follows:
[symbol]
CON
[expression]{,[expression]}
The symbol variable is an optional symbol. It is assigned the byte address value of
the location counter after the force 64bit word boundary occurs. symbol must
meet the requirements for a symbol as described in Section 6.2, page 70.
The expression variable is an expression whose value will be inserted into one
64-bit word. If an expression is null, a single zero word is generated. A force
word boundary occurs before any operand field expressions are evaluated. A
double-precision, floating-point constant is not allowed. expression must meet the
requirements for an expression as described in Section 6.9, page 94.
The following example illustrates the use of the CON pseudo instruction:
S231450
111
CON
CON
O7777017
A
; Generates the
; address of A.
7.10 DATA
The DATA pseudo instruction generates zero or more bits of code for each data
item parameter found in the operand field. If a label exists in the label field, a
forced word boundary occurs and the symbol is assigned an address attribute
and the value of the current location counter.
If a label is not included in the label field, a forced word boundary does not occur.
The DATA pseudo instruction is restricted to sections that have a type of data,
constants, or instructions and data. If the DATA pseudo instruction is found
within a definition, it is defined and is not recognized as a pseudo instruction. If
the DATA pseudo instruction is found within a skipping sequence, it is skipped
and is not recognized as a pseudo instruction.
The length of the field generated for each data item depends on the type of
constant involved. Data items produce zero or more bits of absolute value binary
code, as follows:
Data item
Description
Floating
Integer
Character
112
S231450
[symbol]
[data_item][,[data_item]]
DATA
The symbol variable represents an optional symbol that is assigned the word
address of the location counter after a force byte boundary. If no symbol
is present, a force word boundary does not occur. symbol must meet the
requirements for a symbol as described in Section 6.2, page 70.
The data_item variable represents numeric or character data. data_item must meet
the requirements for a data item as described in Section 6.5, page 82.
The DATA pseudo instruction works with the actual number of bits given in
the data item.
In the following example, unlabeled data items are stored in the next available
bit position (see Figure 9):
IDENT
DATA
DATA
END
01100001 01100010
EXDAT
abcd*
efgh
01100011 01100100
In the following example, labeled data items cause a forced word boundary
(see Figure 10):
ALPHA
BETA
S231450
IDENT
DATA
DATA
DATA
DATA
EXDAT
abcd*
efgh*
ijkl*
mnop
;
;
;
;
113
01100001 01100010
01100100 01100100
00000000 00000000
00000000 00000000
01100101 01100110
01100111 01101000
00000000 00000000
00000000 00000000
01101001 01101010
01101011 01101100
01101101 01101110
011001111 01110000
In the following example, if no forced word boundary occurs, data is stored bit
by bit in consecutive words.
The following example shows the code generated by each source statement:
IDENT EXAMPLE
DATA 05252,AABCR
LL2
114
DATA
DATA
DATA
DATA
DATA
ABCD
EFGH
ABCD*
EFGH*
ABCD12R
DATA
EFGHIJ*
DATA
ABCD
;
;
;
;
;
;
;
;
;
;
;
0000000000000000005252
0000000000000020241103
0405022064204010020040
0425062164404010020040
040502206420
10521443510
0000000000000000000000
040502206420
10521443510
044512
0405022064204010020040
S231450
DATA
DATA
DATA
VWD
END
100
; 0000000000000000000144
1.25E-9
; 0377435274616704302142
THIS IS A MESSAGE*L
; 0521102225144022251440
; O4044O232425232464O5O7
; 0424
8/0
; 000
7.11 DBSM
The DBSM pseudo instruction generates a named label entry in the debug
symbol tables with the type specified.
The format of the DBSM pseudo instruction is as follows:
[ignored]
DBSM
TYPE=symbol
S231450
TEST
FRED
*
16
S4
*
ATP=FRED
S1
S1
S1
BOE=FRED
; Fake prolog.
5
B00
115
From the debugger, you can do a stop in FRED to generate a breakpoint at CHK. A
call to this routine from a program executing in the debugger stops the execution.
7.12 DECMIC
The DECMIC pseudo instruction converts the positive or negative value of an
expression into a positive or negative decimal character string that is assigned
a redefinable micro name. The final length of the micro string is inserted into
the code field of the listing.
You can specify DECMIC with zero, one, or two expressions. DECMIC converts
the value of the first expression into a character string with a character length
indicated by the second expression. If the second expression is not specified,
the minimum number of characters needed to represent the decimal value of
the first expression is used.
If the second expression is specified, the string is equal to the length specified
by the second expression. If the number of characters in the micro string is less
than the value of the second expression, and the value of the first expression is
positive, the character value is right-justified with the specified fill characters
(zeros or blanks) preceding the value.
If the number of characters in the string is less than the value of the second
expression, and the value of the first expression is negative, a minus sign
precedes the value. If zero fill is indicated, zeros are used as fill between the
minus sign and the value. If blank fill is indicated, blanks are used as fill before
the minus sign.
If the number of characters in the string is greater than the value of the second
expression, the characters at the beginning of the string are truncated and a
warning message is issued.
You can specify the DECMIC pseudo instruction anywhere within a program
segment. If the DECMIC pseudo instruction is found within a definition, it is
defined and is not recognized as a pseudo instruction. If the DECMIC pseudo
instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the DECMIC pseudo instruction is as follows:
name
116
DECMIC
[[[expression1],expression2[,[option]]]]
S231450
name is assigned to the character string that represents the decimal value of
expression1 and has redefinable attributes. name must meet the requirements for
identifiers as described in Section 6.3, page 76.
expression1 is optional and represents the micro string equal to the value of the
expression. If specified, expression1 must have an address attribute of value
and a relative attribute of absolute with all symbols, if any, previously defined.
If the first expression is not specified, the absolute value of 0 is used. If the
current base is mixed, a default of octal is used. If the first expression is not
specified, the absolute value of 0 is used when creating the micro string. The
expression1 operand must meet the requirements for expressions as described in
Section 6.9, page 94.
expression2 is optional and provides a positive character count less than or
equal to decimal 20. If this parameter is present, the necessary leading zeros or
blanks (depending on option) are supplied to provide the requested number of
characters. If specified, expression2 must have an address attribute of value and a
relative attribute of absolute with all symbols, if any, previously defined. If the
current base is mixed, a default of decimal is used. expression2 must meet the
requirements for expressions as described in Section 6.9, page 94.
If expression2 is not specified, the micro string is represented in the minimum
number of characters needed to represent the decimal value of the first
expression.
option represents the type of fill characters (ZERO for zeros or BLANK for spaces)
to be used if the second expression is present and fill is needed. The default is
ZERO. You can enter option in mixed case.
The following example illustrates the use of the DECMIC and MICSIZE pseudo
instructions:
MIC MICRO
V MICSIZE
ABCD
MIC
S231450
117
The following example demonstrates the ZERO and BLANK options with positive
and negative strings:
BASE D
; The base is decimal
DECMIC 1,2
"ONE"
; Returns 1 in 2 digits.
01
; Returns 1 in 2 digits.
DECMIC 5*8+60+900,3
; Decimal 1000.
"TWO"
; Returns 1000 as 3 digits (000).
000
; Returns 1000 as 3 digits (000).
DECMIC -256000,l0,ZERO
; Decimal string with zero fill.
"THREE"
; Minus sign, zero fill, value.
-000256000
; Minus sign, zero fill, value.
DECMIC -256000,l0,BLANK
; Decimal string with blank fill.
"FOUR"
; Blank fill, minus sign, value.
^^^-256000
; Blank fill, minus sign, value.
DECMIC 256000,10,ZERO
"FIVE"
; Zero fill on the left.
0000256000
; Zero fill on the left.
DECMIC 256000,10,BLANK
"SIX"
; Blank fill (^) on the left.
^^^^256000
; Blank fill (^) on the left.
END
SEVEN DECMIC 256000,5
_*
"SEVEN"
; Truncation warning issued.
*
56000
; Truncation warning issued.
EIGHT DECMIC 777777777,3
_*
"EIGHT"
; Truncation warning issued.
*
777
; Truncation warning issued.
ONE
_*
*
TWO
_*
*
THREE
_*
*
FOUR
_*
*
FIVE
_*
*
SIX
_*
*
7.13 DMSG
The DMSG pseudo instruction issues a comment level diagnostic message that
contains the string found in the operand field, if a string exists. If the string
consists of more than 80 characters, a warning message is issued and the string is
truncated.
Comment level diagnostic messages might not be issued by default on the
operating system in which the assembler is executing. For more information, see
Chapter 5, page 47.
118
S231450
The assembler recognizes up to 80 characters within the string, but the string may
be truncated further when the diagnostic message is issued (depending on the
operating system in which the assembler is executing).
You can specify the DMSG pseudo instruction anywhere within a program
segment. If the DMSG pseudo instruction is found within a definition, it is defined
and is not recognized as a pseudo instruction. If the DMSG pseudo instruction
is found within a skipping sequence, it is skipped and is not recognized as a
pseudo instruction.
The format of the DMSG pseudo instruction is as follows:
ignored
DMSG
[del-char[string-of-ASCII]del-char]
7.14 DUP
The DUP pseudo instruction introduces a sequence of code that is assembled
repetitively a specified number of times The duplicated code immediately
follows the DUP pseudo instruction.
The DUP pseudo instruction is described in detail in Section 9.4, page 250.
7.15 ECHO
The ECHO pseudo instruction defines a sequence of code that is assembled zero or
more times immediately following the definition.
S231450
119
The ECHO pseudo instruction is described in detail in Section 9.5, page 252.
7.16 EDIT
The EDIT pseudo instruction toggles the editing function on and off within a
program segment. Appending (\ in the new format) and continuation (, in the
old format) are not affected by the EDIT pseudo instruction. The current editing
status is reset at the beginning of each segment to the editing option specified on
the assembler invocation statement. For a description of statement editing, see
Section 6.10, page 97.
You can specify the EDIT pseudo instruction anywhere within a program
segment. If the EDIT pseudo instruction is found within a definition, it is defined
and is not recognized as a pseudo instruction. If the EDIT pseudo instruction
is found within a skipping sequence, it is skipped and is not recognized as a
pseudo instruction.
The format of the EDIT pseudo instruction is as follows:
ignored
EDIT
*/option
The option variable turns editing on and off. option can be specified in uppercase,
lowercase, or mixed case, and it can be one of the following:
ON (enable editing)
OFF (disable editing)
No entry (reverts to the format specified on the assembler invocation
statement)
An asterisk (*) resumes use of the edit option in effect before the most recent edit
option within the current program segment. Each occurrence of an EDIT other
than an EDIT * initiates a new edit option. Each EDIT * removes the current
edit option and reactivates the edit option that preceded the current edit option.
If the EDIT * statement is encountered and all specified edit options were
released, a caution-level message is issued and the default is used.
7.17 EJECT
The EJECT pseudo instruction causes the beginning of a new page in the output
listing. EJECT is a list control pseudo instruction and by default, is not listed. To
120
S231450
include the EJECT pseudo instruction on the listing, specify the LIS option on
the LIST pseudo instruction.
You can specify the EJECT pseudo instruction anywhere within a program
segment. If the EJECT pseudo instruction is found within a definition, it is
defined and is not recognized as a pseudo instruction. If the EJECT pseudo
instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the EJECT pseudo instruction is as follows:
ignored
EJECT
ignored
7.18 ELSE
The ELSE pseudo instruction terminates skipping initiated by the IFA, IFC,
IFE, ELSE, or SKIP pseudo instructions with the same label field name. If
statements are currently being skipped under control of a statement count,
ELSE has no effect.
You can specify the ELSE pseudo instruction anywhere within a program
segment. If the assembler is not currently skipping statements, ELSE initiates
skipping. Skipping is terminated by an ELSE pseudo instruction with a matching
label field name. If the ELSE pseudo instruction is found within a definition, it is
defined and is not recognized as a pseudo instruction.
The format of the ELSE pseudo instruction is as follows:
name
ELSE
ignored
S231450
=
MICRO
=
=
IFA
=
1
LESS THAN
1000
100
#DEF,A,1
10
121
BTEST
WARNING
IFA
ERROR
EXT,SYM
; Generate warning message if SYM is
; absolute.
BTEST
ELSE
A1
SYM ; Assemble if SYM is not absolute.
BTEST
ENDIF
*Assemble BSSZ instruction if W.* is less than BUF, otherwise
*assemble ORG
IFE
BSSZ
ERROR
SKIP
ORG
IFC
ERROR
IFC
X
Y
S1
S2
ENDIF
IFC
S3
S4
IFC
S5
S6
ENDIF
W.*,LT,BUF,2
BUF-W.*
; Generate words of zero to address BUF.
1
; Skip next statement.
BUF
"L" ,EQ,,2
; Error message if micro string defined
; by L is empty.
ABCD,GT,ABC
; If ABCD is greater than ABC,
DEF ; Statement is included.
BUF ; Statement is included.
,GT,,2
; If single space is greater than null
; string,
DEF ; Statement is included.
BUF ; Statement is included.
,EQ,**,2
; If single apostrophe equals single
; apostrophe.
5
; Statement is included.
6
; Statement is included.
7.19 END
The END pseudo instruction terminates a program segment (module initiated
with an IDENT pseudo instruction) under the following conditions:
If the assembler is not in definition mode
If the assembler is not in skipping mode
122
S231450
END
ignored
S231450
123
7.20 ENDDUP
The ENDDUP pseudo instruction ends the definition of the code sequence to be
repeated. An ENDDUP pseudo instruction terminates a dup or echo definition
with the same name.
The ENDDUP pseudo instruction is described in detail in Section 9.8, page 256.
7.21 ENDIF
The ENDIF pseudo instruction terminates skipping initiated by an IFA, IFE, IFC,
ELSE, or SKIP pseudo instruction with the same label field name; otherwise,
ENDIF acts as a do-nothing pseudo instruction. ENDIF does not affect skipping,
which is controlled by a statement count.
You can specify the ENDIF pseudo instruction anywhere within a program
segment. Skipping is terminated by an ENDIF pseudo instruction with a
matching label field name. If the ENDIF pseudo instruction is found within a
definition, it is defined and is not recognized as a pseudo instruction.
The format of the ENDIF pseudo instruction is as follows:
name
ENDIF
ignored
7.22 ENDM
An ENDM pseudo instruction terminates the body of a macro or opdef definition.
The ENDM pseudo instruction is described in detail in Section 9.6, page 254.
124
S231450
7.23 ENDTEXT
The ENDTEXT pseudo instruction terminates text source initiated by a TEXT
instruction. An IDENT or END pseudo instruction also terminates text source.
The ENDTEXT is a list control pseudo instruction and by default, is not listed
unless the TXT option is enabled. If the LIS option is enabled, the ENDTEXT
instruction is listed regardless of other listing options.
You can specify the ENDTEXT pseudo instruction anywhere within a program
segment. If the ENDTEXT pseudo instruction is found within a definition,
it is defined and is not recognized as a pseudo instruction. If the ENDTEXT
pseudo instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the ENDTEXT pseudo instruction is as follows:
ignored
ENDTEXT
ignored
The following example illustrates the use of the ENDTEXT pseudo instruction
(with the TXT option off).
The following represents the source listing:
IDENT
A
=
TXTNAME TEXT
B
=
C
=
ENDTEXT
A1
A2
END
TEXT
2
An example.
3
4
A
B
S231450
125
7.24 ENTRY
The ENTRY pseudo instruction specifies symbolic addresses or values that can
be referred to by other program modules linked by the loader. Each entry
symbol must be an absolute, immobile, or relocatable symbol defined within
the program module.
The ENTRY pseudo instruction is restricted to sections that allow instructions
or data or both. If the ENTRY pseudo instruction is found within a definition or
skipping sequence, it is defined and not recognized as a pseudo instruction.
The format of the ENTRY pseudo instruction is as follows:
ignored
ENTRY
[symbol:[attr]],[symbol:[attr]]
The symbol variable specifies the name of zero, one, or more symbols. Each of
the names must be defined as an unqualified symbol within the same program
module. The corresponding symbol must not be redefinable, external, or
relocatable relative to either a stack or a task common section.
The length of the symbol is restricted depending on the type of loader table that
the assembler is currently generating. If the symbol is too long, the assembler
will issue an error message.
The symbol operand must meet the requirements for symbols as described in
Section 6.2, page 70.
The attr attribute can be either OBJ or FUNC, specifying whether the symbol is an
object or a function entry point. If attr is not specified and the ENTRY pseudo
instruction occurs in a DATA, CONST, or COMMON section, the default is OBJ.
The following example illustrates the use of the ENTRY pseudo instruction:
ENTRY EPTNME,TREG
.
.
.
EPTNME =
*
TREG
=
O17
7.25 ERRIF
The ERRIF pseudo instruction conditionally issues a listing message. If the
condition is satisfied (true), the appropriate user-defined message is issued. If
126
S231450
the level is not specified, the ERRIF pseudo instruction issues an error-level
message. If the condition is not satisfied (false), no message is issued. If any
errors are encountered while evaluating the operand field, the resulting condition
is handled as if true and the appropriate user-defined message is issued.
You can specify the ERRIF pseudo instruction anywhere within a program
segment. If the ERRIF pseudo instruction is found within a definition, it is
defined and is not recognized as a pseudo instruction. If the ERRIF pseudo
instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the ERRIF pseudo instruction is as follows:
[option]
ERRIF
[expression],condition,[expression]
The option variable used in the ERRIF pseudo instruction is the same as in the
ERROR pseudo instruction. See the ERROR pseudo instruction for information.
Zero, one, or two expressions to be compared by condition. If one or both of the
expressions are missing, a value of absolute 0 is substituted for every expression
that is not specified. Symbols found in either of the expressions can be defined
later in a segment.
The expression operand must meet the requirements for expressions as described
in Section 6.9, page 94.
The condition variable specifies the relationship between two expressions that
causes the generation of an error. For LT, LE, GT, and GE, only the values of the
expressions are examined. You can enter condition in uppercase, lowercase, or
mixed case, and it can be one of the following:
LT (less than)
The value of the first expression must be less than the value of the second
expression.
LE (less than or equal)
The value of the first expression must be less than or equal to the value
of the second expression.
GT (greater than)
The value of the first expression must be greater than the value of the second
expression.
S231450
127
ERRIF
ABC,LT,DEF
7.26 ERROR
The ERROR pseudo instruction unconditionally issues a listing message. If the
level is not specified, the ERROR pseudo instruction issues an error level message.
If the condition is not satisfied (FALSE), no message is issued.
You can specify the ERROR pseudo instruction anywhere within a program
segment. If the ERROR pseudo instruction is found within a definition, it is
defined and is not recognized as a pseudo instruction. If the ERROR pseudo
instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the ERROR pseudo instruction is as follows:
128
S231450
[option]
ERROR
ignored
The option variable specifies the error level. It can be entered in upper, lower, or
mixed case. The following error levels are mapped directly into a user-defined
message of the corresponding level:
COMMENT, NOTE, CAUTION, WARNING, or ERROR
ERROR
7.27 EXITM
The EXITM pseudo instruction immediately terminates the innermost nested
macro or opdef expansion, if any, caused by either a macro or an opdef call.
The EXITM pseudo instruction is described in detail in Section 9.7, page 255.
7.28 EXT
The EXT pseudo instruction specifies linkage to symbols that are defined as
entry symbols in other program modules. They can be referred to from within
the program module, but must not be defined as unqualified symbols elsewhere
within the program module. Symbols specified in the EXT instruction are
defined as unqualified symbols that have relative attributes of external and
specified address.
S231450
129
You can specify the EXT pseudo instruction anywhere within a program module.
If the EXT pseudo instruction is found within a definition or skipping sequence, it
is defined and not recognized as a pseudo instruction.
The format of the EXT pseudo instruction is as follows:
ignored
EXT
[symbol:[attribute]],[symbol:[attribute]]
The variables associated with the EXT pseudo instruction are described as
follows:
symbol
The symbol variable specifies the name of zero, one, or more external symbols.
Each of the names must be an unqualified symbol that has a relative attribute
of external and the corresponding address attribute.
The length of the symbol is restricted depending on the type of loader table
that the assembler is currently generating. If the symbol is too long, the
assembler will issue an error message.
The symbol operand must meet the requirements for symbols as described in
Section 6.2, page 70.
attribute
The attribute variable specifies the attribute symbol-type as follows:
The symbol-type will be assigned to the external symbol; it can be one
of the following:
V or v
Value (default)
OBJ
Object
FUNC
Function
130
S231450
A soft reference for a particular external name is resolved at load time only
when at least one other module has referenced that same external name
as a hard reference.
You conditionally reference a soft external name at execution time. If a soft
external name was not included at load time and is referenced at execution
time, an appropriate message is issued.
If the operating system for which the assembler is generating code does not
support soft externals, a caution-level message is issued and soft externals are
treated as hard externals.
Note: Typically, a soft external is used for references to large software
packages (such as graphics packages) that may not be required in a
particular load. When such code is required, load time is shorter and the
absolute module is smaller in size. For most uses, however, hard externals
are recommended.
The following example illustrates the use of the EXT pseudo instruction:
VALUE
IDENT A
.
.
.
ENTRY VALUE
=
2.0
.
.
.
END
IDENT B
EXT
VALUE
CON
VALUE
END
7.29 FORMAT
The assembler supports both the CAL version 1 (CAL1) statement format
and a new statement format. The FORMAT pseudo instruction lets you switch
between statement formats within a program segment. The current statement
format is reset at the beginning of each section to the format option specified on
the assembler invocation statement. For a description of the recommended
formatting conventions for the new format, see Section 6.2.1.2, page 72.
S231450
131
You can specify the FORMAT pseudo instruction anywhere within a program
segment. If the FORMAT pseudo instruction is found within a definition, it is
defined and is not recognized as a pseudo instruction. If the FORMAT pseudo
instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the FORMAT pseudo instruction is as follows:
ignored
FORMAT
*/option
The option variable specifies old or new format. option can be specified in
uppercase, lowercase, or mixed case, and it can be one of the following:
OLD (old format)
NEW (new format)
No entry (reverts to the EDIT option specified on the assembler invocation
statement)
An asterisk (*) resumes use of the format option in effect before the most recent
format option within the current program segment. Each occurrence of a FORMAT
other than a FORMAT * initiates a new format option. Each FORMAT * removes
the current format option and reactivates the format that preceded the current
format. If the FORMAT * statement is encountered and all specified format
options were released, a caution-level message is issued and the default is used.
7.30 IDENT
The IDENT pseudo instruction identifies a program module and marks its
beginning. The module name appears in the heading of the listing produced
by the assembler (if the title pseudo instruction has not been used) and in the
generated binary load module.
You must specify the IDENT pseudo instruction in the global part of a CAL
program. If the IDENT pseudo instruction is found within a definition, it is
defined and is not recognized as a pseudo instruction. If the IDENT pseudo
instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the IDENT pseudo instruction is as follows:
ignored
132
IDENT
lname
S231450
The lname variable is the long name of the program module. lname must meet the
requirements for long names as described in Section 6.3, page 76.
The length of the long name is restricted depending on the type of loader table
the assembler is currently generating. If the name is too long, the assembler
issues an error message.
The following example illustrates the use of the IDENT pseudo instruction:
IDENT
.
.
.
END
EXAMPLE
7.31 IFA
The IFA pseudo instruction tests an attribute of an expression. If the expression
has the specified attribute, assembly continues with the next statement. If the
result of the attribute test is false, subsequent statements are skipped. If a
label field name is present, skipping stops when an ENDIF or ELSE pseudo
instruction with the same name is encountered; otherwise, skipping stops when
the statement count is exhausted.
If any errors are encountered while evaluating the attribute-condition, the
resulting condition is handled as if true and the appropriate listing message
is issued.
You can specify the IFA pseudo instruction anywhere within a program segment.
If the IFA pseudo instruction is found within a definition, it is defined and is not
recognized as a pseudo instruction. If the IFA pseudo instruction is found within
a skipping sequence, it is skipped and is not recognized as a pseudo instruction.
The format of the IFA pseudo instruction is as follows:
S231450
[name]
IFA
[# or !]exp-attribute,expression[,[count]]
[name]
IFA
[# or !]redef-attribute,symbol[,[count]]
[name]
IFA
[# or !]reg-attribute,reg-arg_value[,[count]]
[name]
IFA
[# or !]micro-attribute,mname[,[count]]
133
134
Mnemonic
Attribute
VAL
PA
WA
ABS
IMM
REL
EXT
CODE
S231450
DATA
ZERODATA
CONST
MIXED
COM
COMMON
TASKCOM
ZEROCOM
DYNAMIC
STACK
CM
EM
LM
DEF
Attribute
SET
Attribute
REG
Attribute
MIC
MICRO
CMICRO
S231450
previously defined. A missing or null count subfield gives a zero count. count is
used only when the label field is not specified. If name is not present and count is
present in the operand field, skipping stops when count is exhausted. If neither
name nor count is present, no skipping occurs.
The following example illustrates the use of the IFA pseudo instruction:
SYM1
SYM2
SYM2
SET 1
=
2
IFA SET,SYM1,2
S1 SYM1
S2 SYM2
=
1
IFA SET,SYM2,1
S3 SYM2
7.32 IFC
The IFC pseudo instruction tests a pair of character strings for a condition under
which code will be assembled if the relation specified by conditionis satisfied
(true). If the relationship is not satisfied (false), subsequent statements are
skipped. If a label field name is present, skipping stops when an ENDIF or ELSE
pseudo instruction with the same name is encountered; otherwise, skipping stops
when the statement count is exhausted.
If any errors are encountered during evaluation of the string condition, the
resulting condition is handled as if true and an appropriate listing message
is issued.
You can specify the IFC pseudo instruction anywhere within a program segment.
If the IFC pseudo instruction is found within a definition, it is defined and is not
recognized as a pseudo instruction. If the IFC pseudo instruction is found within
a skipping sequence, it is skipped and is not recognized as a pseudo instruction.
The format of the IFC pseudo instruction is as follows:
[name]
IFC
[string],condition,[string] [,[count]]
137
takes precedence. name must meet the requirements for names as described in
Section 6.3, page 76.
The string variable specifies the character string that will be compared. The first
and third subfields can be null (empty) indicating a null character string. The
ASCII character code value of each character in the first string is compared with
the value of each character in the second string. The comparison is from left to
right and continues until an inequality is found or until the longer string is
exhausted. A value of 0 is substituted for missing characters in the shorter string.
Micros and formal parameters can be contained in the character strings.
The string operand is an optional ASCII character string that must be specified
with one matching character on both ends. A character string can be delimited by
any ASCII character other than a comma or space. Two consecutive occurrences
of the delimiting character indicate a single such character will be included in
the character string.
The following example compares the character strings O100 and ABCD*:
AIF IFC =Ol00=,EQ,*ABCD***
The condition variable specifies the relation that will be satisfied by the two
strings. You can enter condition in mixed case, and it must be one of the following:
LT (less than)
The value of the first string must be less than the value of the second string.
LE (less than or equal)
The value of the first string must be less than or equal to the value of the
second string.
GT (greater than)
The value of the first string must be greater than the value of the second
string.
GE (greater than or equal)
The value of the first string must be greater than or equal to the value of
the second string.
EQ (equal)
The value of the first string must be equal to the value of the second string.
NE (not equal)
138
S231450
The value of the first string must not equal the value of the second string.
The count variable specifies the statement count. It must be an absolute
expression with positive value. All symbols in the expression, if any, must be
previously defined. A missing or null count subfield gives a zero count. The
count operand is used only when the label field is not specified. If name is not
present and count is present in the operand field, skipping stops when count is
exhausted. If neither name nor count is present, no skipping occurs.
The following examples illustrates the use of the IFC pseudo instruction. The
first string is delimited by the at sign (@), and the second string is delimited by
the percent sign (%). The first string is equal to the second string.
EX1
EX1
EX1
IDENT TEST
IFC
@ABC@@D@,EQ,%ABC@D%
;
;
S1
1
;
S2
2
;
ELSE
;
;
;
S3
3
;
ENDIF
;
END
In the next example, the first string is not equal to the second string, the two
statements following the IFC are skipped.
EX1
EX1
IDENT TEST
IFC
@ABBCD@,EQ,@ABCD@
S1
1
S2
2
ENDIF
S3
3
;
;
;
;
;
;
;
;
END
7.33 IFE
The IFE pseudo instruction tests a pair of expressions for a condition. If the
relation (condition)specified by the operation is satisfied, code is assembled. If
S231450
139
conditionis true, assembly resumes with the next statement; if condition is false,
subsequent statements are skipped. If a label field name is present, skipping
stops when an ENDIF or ELSE pseudo instruction with the same name is
encountered; otherwise, skipping stops when the statement count is exhausted.
If any errors are encountered during the evaluation of the expression-condition,
the resulting condition is handled as if true and an appropriate listing message
is issued.
If an assembly error is detected, assembly continues with the next statement.
You can specify the IFE pseudo instruction anywhere within a program segment.
If the IFE pseudo instruction is found within a definition, it is defined and is not
recognized as a pseudo instruction. If the IFE pseudo instruction is found within
a skipping sequence, it is skipped and is not recognized as a pseudo instruction.
The format of the IFE pseudo instruction is as follows:
[name]
IFE
[expression],condition,[expression] [,[count]]]
S231450
GT (greater than)
The value of the first expression must be greater than the value of the second
expression. The attributes are not checked.
GE (greater than or equal)
The value of the first expression must be greater than or equal to the value of
the second expression. The attributes are not checked.
EQ (equal)
The value of the first expression must be equal to the value of the second
expression. Both expressions must be one of the following:
Attributes must be the same
Immobile relative to the same section
Relocatable relative to the same section
External relative to the same external symbol.
The word-address, byte-address, or value
NE (not equal)
The first expression and the second expression do not satisfy the conditions
required for EQ described above.
The count variable specifies the statement count. It must be an absolute
expression with a positive value. All symbols in the expression, if any, must be
previously defined. A missing or null count subfield gives a zero count. count is
used only when the label field is not specified. If name is not present and count is
present in the operand field, skipping stops when count is exhausted. If neither
name nor count is present, no skipping occurs.
The following example illustrates the use of the IFE pseudo instruction:
SYM1
SYM2
SYM3
SYM4
NOTEQ
IDENT TEST
=
0
=
*
SET 1000
SET 500
IFE SYM1,EQ,SYM2
S1
S2
S231450
SYM1
SYM2
141
NOTEQ
NOTEQ
ELSE
S1
SYM3
S2
SYM4
ENDIF
END
; Statement is included.
; Statement is included.
; End of conditional sequence.
7.34 IFM
The IFM pseudo instruction tests characteristics of the current target machine.
If the result of the machine condition is true, assembly continues with the next
statement. If the result of the machine condition is false, subsequent statements
are skipped. If a label field name is present, skipping stops when an ENDIF or
ELSE pseudo instruction with the same name is encountered; otherwise, skipping
stops when the statement count is exhausted.
If any errors are encountered during the evaluation of the string condition, the
resulting condition is handled as if true and an appropriate listing message
is issued.
You can specify the IFM pseudo instruction anywhere within a program segment.
If the IFM pseudo instruction is found within a definition, it is defined and is not
recognized as a pseudo instruction. If the IFM pseudo instruction is found within
a skipping sequence, it is skipped and is not recognized as a pseudo instruction.
The format of the IFM pseudo instruction is as follows:
[name]
IFM
[# or !]logical-name[,[count]]
[name]
IFM
numeric-name,condition,[expression]
[,[count]]
S231450
traits of the CPU option for the appropriate operating system in Chapter 5,
page 47.
The numeric-name variable specifies the mnemonic that signifies a numeric
condition of the machine for which the assembler is currently targeting code.
For a detailed list of the mnemonics, see the numeric traits of the CPU option for
the appropriate operating system in Chapter 5, page 47. You can specify these
mnemonics in mixed case.
The condition variable specifies the relation to be satisfied between the numeric
name and the expression, if any. You can enter condition in mixed case, and it
must be one of the following:
LT (less than)
The value of the numeric name must be less than the value of the expression.
LE (less than or equal)
The value of the numeric name must be less than or equal to the value
of the expression.
GT (greater than)
The value of the numeric name must be greater than the value of the
expression.
GE (greater than or equal)
The value of the numeric name must be greater than or equal to the value
of the expression.
EQ (equal)
The value of the numeric name must be equal to the value of the expression.
NE (not equal)
The value of the numeric name must not equal the value of the expression.
The expression variable specifies the expression to be compared to the numeric
name. All symbols in the expression must be defined previously and must have
an address attribute of value and a relative attribute of absolute. If the current
base is mixed, a default of decimal is used. If an expression is not specified, the
absolute value of 0 is used. expression must meet the requirements for expressions
as described in Section 6.9, page 94.
S231450
143
ex1
ex2
ex2
ident test
ifm
vpop
.
.
.
ifm
numcpus,eq,4
.
.
.
else
.
.
.
endif
end
7.35 INCLUDE
The INCLUDE pseudo instruction inserts a file at the current source position. The
INCLUDE pseudo instruction always prepares the file for reading by opening it
and positioning the pointer at the beginning.
You can use this pseudo instruction to include the same file more than once
within a particular file.
You can also nest INCLUDE instructions. Because you cannot use INCLUDE
recursively, you should review nested INCLUDE instructions for recursive calls to
a file that you have already opened.
You can specify the INCLUDE pseudo instruction anywhere within a program
segment. If the INCLUDE pseudo instruction occurs within a definition, it is
recognized as a pseudo instruction and the specified file is included in the
definition. If the INCLUDE pseudo instruction occurs within a skipping sequence,
it is recognized as a pseudo instruction and the specified file is included in the
144
S231450
INCLUDE
filename
The filename variable is an ASCII character string that identifies the file to be
included. The ASCII character string must be a valid file name depending on
the operating system under which the assembler is executing. If the ASCII
character string is not a valid file name or the assembler cannot open the file,
a listing message is issued.
filename must be specified with one matching character on each end. Any ASCII
character other than a comma or space can be used. Two consecutive occurrences
of the delimiting character indicate a single such character will be included in
the character string.
In the following examples, the module named INCTEST contains an INCLUDE
pseudo instruction. The file to be included is named DOG and the CAT file is
included within the DOG file.
The INCTEST module is as follows:
IDENT
INCTEST
INCLUDE *DOG*
END
S231450
; Register S1 gets 1.
; Call file CAT with INCLUDE.
; Register S2 gets 2.
145
; Register S3 gets 3.
;
;
;
;
;
CAT
2
; Register S1 gets 1.
; Call file CAT with INCLUDE.
; Register S2 gets 2.
; Register S3 gets 3.
-DOG; Illegal. If file B was included by
; file A, it cannot include file A.
The following example demonstrates that it is legal to include a file more than
once if it is not currently being included.
The INCTEST module is as follows:
IDENT
INCTEST
INCLUDE *DOG*
INCLUDE *DOG*
END
S231450
S1
S2
1
2
; Register S1 gets 1.
; Register S2 gets 2.
;
;
;
;
;
;
7.36 LIST
The LIST pseudo instruction controls the listing. LIST is a list control pseudo
instruction and by default, is not listed. To include the LIST pseudo instruction
on the listing, specify the LIS option on this instruction. An END pseudo
instruction resets options to the default values.
You can specify the LIST pseudo instruction anywhere within a program
segment. If the LIST pseudo instruction is found within a definition, it is defined
and is not recognized as a pseudo instruction. If the LIST pseudo instruction
is found within a skipping sequence, it is skipped and is not recognized as a
pseudo instruction.
The format of the LIST pseudo instruction is as follows:
[name]
LIST
[option]{,[option]}*
The name variable specifies the optional list name. name must meet the
requirements for identifiers as described in Section 6.3, page 76.
If name is present, the instruction is ignored unless a matching name is specified
on the list parameter on the assembler invocation statement. LIST pseudo
instructions with a matching name are not ignored. LIST pseudo instructions
with a blank label field are always processed.
The option variable specifies that a particular listing feature be enabled or
disabled. All option names can be specified in some form as assembler invocation
statement parameters. The selection of an option on the assembler invocation
statement overrides the enabling or disabling of the corresponding feature by
S231450
147
a LIST pseudo instruction. If you use the no-list option on the assembler
invocation statement, all LIST pseudo instructions in the program are ignored.
There can be zero, one, or more options specified or an *. If no options are
specified, OFF is assumed. The allowed options are described as follows:
ON (enables source statement listing)
Source statements and code generated are listed (default).
OFF (disables source statement listing)
While this option is selected, only statements with errors are listed. If the LIS
option is enabled, listing control pseudo instructions are also listed.
ED (enables listing of edited statements)
Edited statements are included in the listing file (default).
NED (disables listing of edited statements)
Edited statements are not included in the listing file.
XRF (enables cross-reference)
Symbol references are accumulated and a cross-reference listing is produced
(default).
NXRF (disables cross-reference)
Symbol references are not accumulated. If this option is selected when the
END pseudo instruction is encountered, no cross-reference is produced.
XNS (includes nonreferenced local symbols in the reference)
Local symbols that were not referenced in the listing output are included in
the cross-reference listing (default).
NXNS (excludes nonreferenced local symbols from the cross-reference)
If this option is selected when the END pseudo instruction is encountered,
local symbols that were not referenced in the listing output are not included in
the cross-reference.
LIS (enables listing of the listing pseudo instructions)
The LIST, SPACE, EJECT, TITLE, SUBTITLE, TEXT, and ENDTEXT pseudo
instructions are included in the listing.
NLIS (disables listing of the listing pseudo instructions)
148
S231450
The LIST, SPACE, EJECT, TITLE, SUBTITLE, TEXT, and ENDTEXT pseudo
instructions are not included in the listing (default).
TXT (enables global text source listing)
Each statement following a TEXT pseudo instruction is listed through the
ENDTEXT instruction if the listing is otherwise enabled.
NTXT (disables global text source listing)
Statements that follow a TEXT pseudo instruction through the following
ENDTEXT instruction are not listed (default).
MAC (enables listing of macro and opdef expansions)
Statements generated by macro and opdef calls are listed. Conditional
statements and skipped statements generated by macro and opdef calls are
not listed unless the macro conditional list feature is enabled (MIF).
NMAC (disables listing of macro and opdef expansions)
Statements generated by macro and opdef calls are not listed (default).
MBO (enables listing of generated statements before editing)
Only statements that produce generated code are listed. The listing of macro
expansions (MAC) or the listing of duplicated statements (DUP) must also be
enabled.
NMBO (disables listing of statements that produce generated code)
Statements generated by a macro or opdef call (MAC), or by a DUP or ECHO
(DUP) pseudo instruction, are not listed before editing (default).
Note: Source statements containing a micro reference (see MIC and NMIC
options) or a concatenation character are listed before editing regardless
of whether this option is enabled or disabled.
MIC (enables listing of generated statements before editing)
Statements that are generated by a macro or opdef call, or by a DUP or ECHO
pseudo instruction, and that contain a micro reference or concatenation
character are listed before and after editing. The listing of macro expansions
or the listing of duplicated statements must also be enabled.
NMIC (disables listing of generated statements before editing)
Statements generated by a macro or opdef call, or by a DUP or ECHO pseudo
instruction, are not listed before editing (default).
S231450
149
Note: Conditional statements (see NIF and NMIF options) and skipped
statements in source code are listed regardless of whether this option is
enabled or disabled.
MIF (enables macro conditional listing)
Conditional statements and skipped statements generated by a macro or
opdef call, or by a DUP or ECHO pseudo instruction, are listed. The listing
of macro expansions or the listing of duplicated statements must also be
enabled.
NMIF (disables macro conditional listing)
Conditional statements and skipped statements generated by a macro or
opdef call, or by a DUP or ECHO pseudo instruction, are not listed (default).
DUP (enables listing of duplicated statements)
Statements generated by DUP and ECHO expansions are listed. Conditional
statements and skipped statements generated by DUP and ECHO are not listed
unless the macro conditional list feature is enabled (MIF).
NDUP (disables listing of duplicated statements)
Statements generated by DUP and ECHO are not listed (default).
The asterisk (*) reactivates the LIST pseudo instruction in effect before the
current LIST pseudo instruction was specified within the current program
segment. Each occurrence of a LIST pseudo instruction other than LIST
initiates a new listing control. Each LIST releases the current listing control and
reactivates the listing control that preceded the current list control. If all specified
listing controls were released when a LIST * is encountered, the assembler
issues a caution-level message and uses the defaults for listing control.
7.37 LOC
The LOC pseudo instruction sets the location counter to the first byte of the word
address specified. The location counter is used for assigning address values to
label field symbols. Changing the location counter allows code to be assembled
and loaded at one location, controlled by the origin counter, then moved and
executed at another address controlled by the location counter. The LOC pseudo
instruction forces a word boundary within the current section before the location
counter is modified.
150
S231450
LOC
[expression]
The expression variable is optional and represents the new value of the location
counter. If the expression does not exist, the counter is reset to the absolute value
of 0. If the expression does exist, all symbols (if any) must be defined previously.
If the current base is mixed, octal is used as the base.
The expression operand cannot have an address attribute of byte, a relative
attribute of external, or a negative value. A force word boundary occurs before
the expression is evaluated. The expression operand must meet the requirements
for an expression as described in Section 6.9, page 94.
The following example illustrates the use of the LOC pseudo instruction:
LBL
ORG
LOC
A1
.
.
.
J
W.*+1000
200
0
LBL
Note: In the preceding example, the code is generated and loaded at location
W.*+1000 and the user must move it to absolute location 200 before execution.
7.38 LOCAL
The LOCAL pseudo instruction specifies unique character string replacements
within a program segment that are defined only within the macro, opdef, dup,
or echo definition. These character string replacements are known only in the
macro, opdef, dup, or echo at expansion time. The most common usage of the
LOCAL pseudo instruction is for defining symbols, but it is not restricted to the
definition of symbols.
The LOCAL pseudo instruction is described in detail in Section 9.11, page 260.
S231450
151
7.39 MACRO
The MACRO pseudo instruction marks the beginning of a sequence of source
program instructions saved by the assembler for inclusion in a program when
called for by the macro name.
Macros are described in detail in Section 9.2, page 221.
7.40 MICRO
The MICRO pseudo instruction assigns a name to a character string. The assigned
name can be redefined. You can reference and redefine a redefinable micro after
its initial definition within a program segment. A micro defined with the MICRO
pseudo instruction is discarded at the end of a module and cannot be referenced
by any of the segments that follow.
You can specify the MICRO pseudo instruction anywhere within a program
segment. If the MICRO pseudo instruction is found within a definition, it is
defined and is not recognized as a pseudo instruction. If the MICRO pseudo
instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the MICRO pseudo instruction is as follows:
name
MICRO
[string[,[exp][,[exp],[case]]]]
The name variable is required and is assigned to the character string in the
operand field. It has redefinable attributes. If name was previously defined, the
previous micro definition is lost. name must meet the requirements for identifiers
as described in Section 6.3, page 76.
The string variable represents an optional character string that can include
previously defined micros. If string is not specified, an empty string is used. A
character string can be delimited by any character other than a space. Two
consecutive occurrences of the delimiting character indicate a single such
character (for example, a micro consisting of the single character * can be
specified as * or ****).
The exp variable represents optional expressions. The first expression must be
an absolute expression that indicates the number of characters in the micro
character string. All symbols, if any, must be previously defined. If the current
base is mixed, decimal is used for the expression. The expressions must meet the
requirements for expressions as described in Section 6.9, page 94.
152
S231450
The micro character string is terminated by the value of the first expression or
the final apostrophe of the character string, whichever occurs first. If the first
expression has a 0 or negative value, the string is considered empty. If the first
expression is not specified, the full value of the character string is used. In this
case, the string is terminated by the final apostrophe.
The second expression must be an absolute expression that indicates the micro
strings starting character. All symbols, if any, must be defined previously. If the
current base is mixed, decimal is used for the expression.
The starting character of the micro string begins with the character that is equal
to the value of the second expression, or with the first character in the character
string if the second expression is null or has a value of 1 or less.
The optional case variable denotes the way uppercase and lowercase characters
are interpreted when they are read from string. Character conversion is restricted
to the letter characters (A - Z and a - z) specified in string. You can specify case in
uppercase, lowercase, or mixed case, and it must be one of the following:
MIXED or mixed
string is interpreted as entered and no case conversion occurs. This is the
default.
UPPER or upper
All lowercase alphabetic characters in string are converted to their uppercase
equivalents.
LOWER or lower
All uppercase alphabetic characters in string are converted to their lowercase
equivalents.
The following example illustrates the use of the MICRO pseudo instruction:
MIC
MIC2
MIC2;
MIC3
MIC3;
MIC4
MIC4;
MIC5
MICRO
MIC6
MIC6;
MICRO
THIS IS A MICRO STRING
MICRO
"MIC",1
CAL has edited these lines
MICRO THIS IS A MICRO STRING,1
MICRO
"MIC2"
CAL has edited these lines
MICRO
T
MICRO
"MIC",10
; CALL TO MICRO MIC2.
CAL has edited these lines MICRO
THIS IS A MICRO STRING,10
MICRO
"MIC4" MIC5
THIS IS A
MICRO
"MIC" ,5,11
CAL has edited these lines MICRO
THIS IS A MICRO STRING,5,11
S231450
153
MIC7
MICRO
MIC7; CAL has edited
MIC8
MICRO
MIC8; CAL has edited
MIC9
MICRO
MIC9; CAL has edited
"MIC6"
these lines MICRO
"MIC",11,5
these lines MICRO
"MIC8"
these lines MICRO
MICRO
THIS IS A MICRO STRING,11,5
IS A MICRO
7.41 MICSIZE
The MICSIZE pseudo instruction defines the symbol in the label field as a
symbol with an address attribute of value, a relative attribute of absolute, and
a value equal to the number of characters in the micro string whose name is in
the operand field. Another SET or MICSIZE instruction with the same symbol
redefines the symbol to a new value.
You can specify the MICSIZE pseudo instruction anywhere within a program
segment. If the MICSIZE pseudo instruction is found within a definition,
it is defined and is not recognized as a pseudo instruction. If the MICSIZE
pseudo instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the MICSIZE pseudo instruction is as follows:
[symbol]
MICSIZE
name
7.42 MLEVEL
The MLEVEL pseudo instruction sets the message level for the output listing, the
message listing, and the standard error file.
If the option accompanying the MLEVEL pseudo instruction is not valid, a
diagnostic message is generated and MLEVEL is ignored.
154
S231450
You can specify the MLEVEL pseudo instruction anywhere within a program
segment. If the MLEVEL pseudo instruction is found within a definition, it is
defined and is not recognized as a pseudo instruction. If the MLEVEL pseudo
instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the MLEVEL pseudo instruction is as follows:
ignored
MLEVEL
[option]/*
7.43 MSG
The MSG pseudo instruction enables specified assembler messages to be printed.
It essentially increases the severity of the specified messages so that when
encountered, the message will be printed. The format is as follows:
MSG
S231450
msgnum[:msgnum ... ]
155
msgnum
If the value of the -M message option on the as statement differs from the option
on the MSG pseudo instruction, the as statement value is used.
If the option accompanying the MSG pseudo instruction is not valid, a diagnostic
message is generated, and MSG is ignored.
If MSG is placed in global scope (outside of any IDENT/END pair), it applies to the
file. If MSG is placed in module scope (inside an IDENT/END pair), it applies to
just that module. If there are multiple MSG and NOMSG (see Section 7.45, page 156)
pseudo instructions for the same message number, the last applies throughout.
The two pseudo instructions cannot be toggled.
7.44 NEXTDUP
The NEXTDUP pseudo instruction stops the current iteration of a duplication
sequence indicated by a DUP or an ECHO pseudo instruction. Assembly of the
current repetition of the dup sequence is terminated immediately and the next
repetition, if any, is begun.
The NEXTDUP pseudo instruction is described in detail in Section 9.9, page 256.
7.45 NOMSG
The NOMSG pseudo instruction disables specified assembler messages to prevent
them from being printed. It essentially decreases the severity of the messages so
that when encountered, the message will not be printed. The format is as follows:
NOMSG
msgnum
msgnum[:msgnum ... ]
Number of the assembler message to disable.
Multiple message numbers are separated by
colons.
If the value of the -M message option on the as statement differs from the option
on the NOMSG pseudo instruction, the as statement value is used.
If the option accompanying the NOMSG pseudo instruction is not valid, a
diagnostic message is generated, and NOMSG is ignored.
156
S231450
7.46 OCTMIC
The OCTMIC pseudo instruction converts the value of an expression to a character
string that is assigned a redefinable micro name. The character string that the
pseudo instruction generates is represented as an octal number. The final length
of the micro string is inserted into the code field of the listing.
You can specify OCTMIC with zero, one, or two expressions. The value of the
first expression is converted to a micro string with a character length equal to
the second expression. If the second expression is not specified, the minimum
number of characters needed to represent the octal value of the first expression is
used.
If the second expression is specified, the string is equal to the length specified by
the second expression. If the number of characters in the micro string is less than
the value of the second expression, the character value is right justified with the
specified fill characters (zeros or blanks) preceding the value. If the number of
characters in the string is greater than the value of the second expression, the
beginning characters of the string are truncated and a warning message is issued.
You can specify the OCTMIC pseudo instruction anywhere within a program
segment. If the OCTMIC pseudo instruction is found within a definition, it is
defined and is not recognized as a pseudo instruction. If the OCTMIC pseudo
instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the OCTMIC pseudo instruction is as follows:
name
OCTMIC
[expression1] [","[expression2[","[option]]]]
The name variable is required and specifies the name of the micro. name must
meet the requirements for identifiers as described in Section 6.3, page 76.
The expression1 variable is an optional expression and is equal to name. If
specified, expression1 must have an address attribute of value and a relative
attribute of absolute. All symbols used must be previously defined. If the current
S231450
157
base is mixed, a default of octal is used. If the first expression is not specified, the
absolute value of 0 is used in creating the micro string. The expression1 operand
must meet the requirements for expressions as described in Section 6.9, page 94.
expression2 provides a positive character count less than or equal to decimal 22.
If this parameter is present, leading zeros or blanks (depending on option) are
supplied, if necessary, to provide the requested number of characters. If specified,
expression2 must have an address attribute of value and a relative attribute of
absolute with all symbols, if any, previously defined. If the current base is mixed,
a default of decimal is used. If expression2 is not specified, the micro string is
represented in the minimum number of characters needed to represent the octal
value of the first expression. The expression2 operand must meet the requirements
for expressions as described in Section 6.9, page 94.
option represents the type of fill characters (ZERO for zeros or BLANK for spaces)
that will be used if the second expression is present and fill is needed. The
default is ZERO. You can enter option in mixed case.
The following example illustrates the use of the OCTMIC pseudo instruction:
IDENT
EXOCT
BASE
0
;
ONE OCTMIC 1,2
_*
"ONE"
;
*
01
;
TWO OCTMIC
5*7+60+700,3
_* "TWO"
;
*
*
023
;
*
THREE OCTMIC 256000,10,ZERO
_* "THREE"
;
*
00256000
;
FOUR OCTMIC 256000,l0,BLANK
_* " FOUR"
;
*
*
^^256000
;
*
END
7.47 HEXMIC
The HEXMIC pseudo instruction converts the value of an expression to a character
string that is assigned a redefinable micro name. The character string that the
158
S231450
HEXMIC
[expression1] [","[expression2[","[option]]]]
The name variable is required and specifies the name of the micro. name must
meet the requirements for identifiers as described in Section 6.3, page 76.
The expression1 variable is an optional expression and is equal to name. If
specified, expression1 must have an address attribute of value and a relative
attribute of absolute. All symbols used must be previously defined. If the
current base is mixed, a default of hexadecimal is used. If the first expression is
not specified, the absolute value of 0 is used in creating the micro string. The
expression1 operand must meet the requirements for expressions as described in
Section 6.9, page 94.
expression2 provides a positive character count less than or equal to decimal 22.
If this parameter is present, leading zeros or blanks (depending on option) are
supplied, if necessary, to provide the requested number of characters. If specified,
expression2 must have an address attribute of value and a relative attribute of
absolute with all symbols, if any, previously defined. If the current base is mixed,
a default of decimal is used. If expression2 is not specified, the micro string is
represented in the minimum number of characters needed to represent the
S231450
159
hexadecimal value of the first expression. The expression2 operand must meet the
requirements for expressions as described in Section 6.9, page 94.
option represents the type of fill characters (ZERO for zeros or BLANK for spaces)
that will be used if the second expression is present and fill is needed. The
default is ZERO. You can enter option in mixed case.
The following example illustrates the use of the HEXMIC pseudo instruction:
IDENT
EXOCT
BASE
0
;
ONE HEXMIC 1,2
_*
"ONE"
;
*
01
;
TWO HEXMIC
5*7+60+700,3
_* "TWO"
;
*
*
023
;
*
THREE HEXMIC 256000,10,ZERO
_* "THREE"
;
*
00256000
;
FOUR HEXMIC 256000,l0,BLANK
_* " FOUR"
;
*
*
^^256000
;
*
END
7.48 OPDEF
The OPDEF pseudo instruction marks the beginning of an operation definition
(opdef). The opdef identifies a sequence of statements to be called later in the
source program by an opdef call. Each time the opdef call occurs, the definition
sequence is placed into the source program.
The OPDEF pseudo instruction is described in detail in Section 9.3, page 237.
7.49 OPSYN
The OPSYN pseudo instruction defines an operation that is synonymous with
another macro or pseudo instruction operation.
160
S231450
The OPSYN pseudo instruction is described in detail in Section 9.12, page 262.
7.50 ORG
The ORG pseudo instruction resets the location and origin counters to the byte
address specified. ORG resets the location and origin counters to the same address
relative to the same section.
The ORG pseudo instruction forces a 64-bit longword boundary within the current
section and also within the new section specified by the expression. These forced
longword boundaries occur before the counter is reset. ORG can change the
current working section without modifying the section stack.
The ORG pseudo instruction is restricted to sections that allow instructions or
data, or instructions and data. If the ORG pseudo instruction is found within a
definition, it is defined and not recognized as a pseudo instruction. If the ORG
pseudo instruction is found within a skipping sequence, it is skipped and not
recognized as a pseudo instruction.
The format of the ORG pseudo instruction is as follows:
ignored
ORG
[expression]
S231450
W.*+0200
161
7.51 OSINFO
The OSINFO pseudo instruction allows the assembler to pass specific information
to the linker. The format is as follows:
OSINFO
keyword=value
The keywords and the valid values for each are as follows:
Keyword
Value
TEXTPAGESIZE
System default
System minimum
System maximum
System default
System minimum
System maximum
DATAPAGESIZ
MINMSPWIDTH
MAXMSPWIDTH
MINMAXVL
MAXMAXVL
VADDRWIDTH
NUMBARRIERS
SVXMODEL
PROGMODEL
HANDLECPF
Anything
else
HANDLEUVL
162
S231450
HANDLEMTO
Anything
else
Anything
else
7.52 QUAL
A QUAL pseudo instruction begins or ends a code sequence in which all symbols
defined are qualified by a qualifier specified by the QUAL pseudo instruction
or are unqualified. Until the first use of a QUAL pseudo instruction, symbols
are defined as unqualified for each program segment. Global symbols cannot
be qualified. The QUAL pseudo instruction must not occur before an IDENT
pseudo instruction.
A qualifier applies only to symbols. Names used for sections, conditional
sequences, duplicated sequences, macros, micros, externals, formal parameters,
and so on, are not affected.
You must specify the QUAL pseudo instruction from within a program module. If
the QUAL pseudo instruction is found within a definition or skipping sequence, it
is defined and is not recognized as a pseudo instruction.
At the end of each program segment, all qualified symbols are discarded.
The format of the QUAL pseudo instruction is as follows:
ignored
QUAL
*/[name]
The name variable is optional and indicates whether symbols will be qualified or
unqualified and, if qualified, indicates the qualifier to be used. The name operand
must meet the requirements for names as described Section 6.3, page 76.
S231450
163
The name operand causes all symbols defined until the next QUAL pseudo
instruction to be qualified. A qualified symbol can be referenced with or without
the qualifier that is currently active. If the symbol is referenced while some other
qualifier is active, the reference must be in the following form:
/qualifier/symbol
If the operand field of the QUAL is empty, symbols are unqualified until the
next occurrence of a QUAL pseudo instruction. An unqualified symbol can be
referenced without qualification from any place in the program module, or in
the case of global symbols, from any program segment assembled after the
symbol definition.
An asterisk (*) resumes use of the qualifier in effect before the most recent
qualification within the current program segment. Each occurrence of a QUAL
other than a QUAL * causes the initiation of a new qualifier. Each QUAL *
removes the current qualifier and activates the most recent prior qualification. If
the QUAL * statement is encountered and all specified qualifiers are released, a
caution-level message is issued and succeeding symbols are defined as being
unqualified.
The following example illustrates the use of the QUAL pseudo instruction:
* Assembler default for symbols is unqualified.
ABC
=
1
; ABC is unqualified.
QUAL QNAME1
; Symbol qualifier QNAME1
ABC
=
2
; ABC is qualified by QNAME1.
J
XYZ
XYZ
S1 A2
; XYZ is qualified by QNAME1.
.
.
.
QUAL QNAME2
164
S231450
7.53 SECTION
The SECTION pseudo instruction establishes or resumes a section of code. The
section can be common or local, depending on the options found in the operand
field. Each section has its own location, origin, and bit-position counters.
You must specify the SECTION pseudo instruction from within a program
module. If the SECTION pseudo instruction is found within a definition, it
is defined and is not recognized as a pseudo instruction. If the SECTION
S231450
165
SECTION
[type][","[location]][","[ENTRY]]
[lname]
SECTION
[location]","[type][","[ENTRY]]
[lname]
SECTION
[type][","[ENTRY]][","[location]]
[lname]
SECTION
[location]","[[ENTRY]][","[type]]
[lname]
SECTION
[ENTRY][","[location]][","[type]]
[lname]
SECTION
[ENTRY][","[type]][","[location]]
ignored
SECTION
The variables associated with the SECTION pseudo instruction are described
as follows:
lname
The lname variable is optional and names the section. lname must meet the
requirements for tags as described in Section 6.3, page 76.
type
The type variable specifies the type of section. It can be specified in
uppercase, lowercase, or mixed case. type can be one of the following (for a
description of local sections, see Section 7.53.1, page 172):
MIXED
Defines a section that permits both instructions and data. MIXED is the default
type for the main section initiated by the IDENT pseudo instruction. If type is
not specified, MIXED is the default. The loader treats a MIXED section as a
local section.
166
S231450
CODE
Restricts a section to instructions only; data is not permitted. The loader treats
a CODE section as a local section.
DATA
Restricts a section to data only (CON, DATA, BSSZ, and so on); instructions are
not permitted. The loader treats the DATA section as a local section.
ZERODATA
Neither instructions nor data are allowed within this section. The loader
treats a ZERODATA section as a local section. At load time, all space within a
ZERODATA section is set to 0.
CONST
Restricts a section to constants only (CON, DATA, BSSZ, and so on);
instructions are not permitted. The loader treats the CONST section as a
local section.
STACK
Sets up a stack frame (designated memory area). Neither data nor instructions
are allowed. All symbols that are defined using the location or origin counter
and are relative to a section that has a type of STACK are assigned a relative
attribute of immobile.
These symbols may be used as offsets into the STACK section itself. These
sections are treated like other section types except relocation does not occur
after assembly. Because relocation does not occur, sections with a type of
stack are not passed to the loader.
Sections with a type of STACK conveniently indicate that symbols are relative
to an execution-time stack frame and that their values correspond to an
absolute location within the stack frame relative to the base of the stack
frame. Symbols with stack attributes are indicated as such in the debug
tables that the assembler produces.
COMMON
Defines a common section that can be referenced by another program module.
Instructions are not allowed.
Data cannot be defined in a COMMON section without a name (no name in
label field); only storage reservation can be defined in an unnamed COMMON
section. The label field that names a COMMON section cannot match the label
S231450
167
S231450
is used as an offset into an execution time task common table. The word at
which it points within this table contains the address of the base of the task
common section in memory.
All symbols defined using the location or origin counter within a task
common section are assigned a relative attribute of immobile. These symbols
are treated like other symbols, but relocation does not occur after assembly.
These symbols can be used as offsets into the task common section itself.
Sections with a type of TASKCOM indicate that their symbols are relative to
an execution-time task common section, and their values correspond to an
absolute location within the task common section relative to the beginning of
the task common section. These values are indicated as such in the debug
tables that the assembler produces. For a description of local sections, see
Section 7.53.1, page 172.
TASKCOM must always be named. The label field that names a TASKCOM
section cannot match the label field name of a previously defined section with
a type of COMMON, DYNAMIC, ZEROCOM, or TASKCOM . If duplicate label field
names are specified, an error level message is issued.
Note: Accessing data from a task common section is not as straightforward
as accessing data directly from memory. For more information about task
common, see the Fortran Language Reference Manual, Volume 3.
ENTRY
Sets a bit in the Program header to direct the loader to create an entry point at
the same address as the first word of the section.
*
The name, type, and location of the section in control reverts to the name, type,
and location of the section in effect before the current section was specified
within the current program module. Each occurrence of a SECTION pseudo
instruction other than SECTION * causes a section with the name, type, and
location specified to be allocated. Each SECTION * releases the currently
active section and reactivates the section that preceded the current section. If
all specified sections were released when a SECTION * is encountered, the
assembler issues a caution-level message and uses the main section.
When type is not specified, MIXED is used by default.
If type is not specified, the default is MIXED for type. Because a module within
a program segment is initialized without a name, these defaults, when acting
together, force this initial section entry to become the current working section.
S231450
169
If the section name and attributes are previously defined, the SECTION pseudo
instruction makes the previously defined section entry the current working
section. If the section name and attributes are not defined, the SECTION pseudo
instruction tries to create a new section with the name and attributes. The
following restrictions apply when a new section is created:
A section of the type TASKCOM, COMMON, ZEROCOM, and a section with a
specified entry must always have a label field name.
If a section with a type of COMMON, DYNAMIC, ZEROCOM, or TASKCOM is being
created for the first time, it must never have a name that matches a section
that was created previously with a type of COMMON, DYNAMIC, ZEROCOM,
or TASKCOM.
The following example illustrates the use of the SECTION pseudo instruction:
ident exsect
; The Main section has by default a type of mixed.
.
.
con
1
; Data and instructions are permitted in
S1
1
; the Main section.
.
.
dsect section data
; This section is defined with a name of
.
; dsect and a type of data.
.
con
3
; Data is permitted in dsect.
bszz 2
; Data is permitted in dsect.
.
.
.
S2
S3
; The assembler generates an error-level
.
; message because instructions are illegal in a
.
; section with a type of data.
170
S231450
.
csect section common
; This section is defined with a name of
.
; csect and a type of common.
.
data 12345678
; Data is permitted in a named common section.
S2
A1
; The assembler generates an error-level
.
; message, because instructions are not permitted
.
; in a common section.
.
section
; This section is unnamed and is assigned
; by default a type of mixed. When a section is
; specified without a name and a type, the main
; section becomes the current section.
section *
; The current section reverts to the previous section
; in the stack buffer csect.
section *
; The current section reverts to the previous section in the
; stack buffer dsect.
con
2
; A memory location with a value of 2 is inserted into dsect.
.
.
section *
; The current section reverts to the main
.
; section.
.
.
dsect section code
; The assembler considers this section specification unique
; and different from the previously defined section named
; dsect. Sections with types of mixed, code, data, and stack
; are treated as local sections that are specified with the
S231450
171
S231450
173
A section with the same name, type, and location used in different areas of
a program is recognized as the same section. For more information, see the
SECTION pseudo instruction in Section 7.53, page 165.
7.53.5 Common Sections
When a SECTION pseudo instruction is used with a type of COMMON, DYNAMIC,
ZEROCOM, or TASKCOM, all code generated (other than literals) or memory
reserved between occurrences of SECTION pseudo instructions is assigned to the
designated common, dynamic, zero common, or task common section.
At program end, each common section is identified to the loader by its SECTION
name and is available for reference by another program module. If you
specify the ORG pseudo instruction, an exception to these conditions can occur.
Specifying the ORG pseudo instruction may cause the placement of code or
memory reservations to be different from the currently specified working section.
If a common section is specified, the identifier in the label field that names the
section must be unique within the module in which it is defined. When a section
is assigned a type (COMMON, DYNAMIC, ZEROCOM, or TASKCOM) that differs from
the type of a previously defined section, it cannot be assigned the name of a
previously defined section within the same module.
7.53.6 Section Stack Buffer
The assembler maintains a stack buffer that contains a list of the sections
specified. Each time a SECTION pseudo instruction names a new section,
the assembler adds the name of the section to the list and identifies the new
section as the current section. You also can use the BLOCK and COMMON pseudo
instructions to name sections.
The assembler remembers the order in which sections are specified. An entry is
deleted from the list each time a SECTION pseudo instruction contains an asterisk
(*). When an entry is deleted, the name, location, and type of the previously
specified section is enabled.
The first section on the list is the last section that will be deleted from the list. If
the program contains more SECTION * instructions than there are entries, the
assembler uses the main section. (The BLOCK * and COMMON * instructions
replace the current section with the most recent previous section that was
specified by the BLOCK and COMMON pseudo instructions.)
174
S231450
For each section used in a program, the assembler maintains an origin counter, a
location counter, and a bit position counter. When a section is first established or
its use is resumed, the assembler uses the counters for that section.
The following example illustrates section specification and deletion and indicates
the current section. The example includes the QUAL pseudo instruction. For a
description of the QUAL pseudo instruction, see Section 7.52, page 163.
IDENT
;
;
;
;
SYM1 =
1
;
QUAL
QNAME1
;
SYM2 =
2
;
;
SNAME SECTION MIXED
;
;
MLEVEL ERROR
;
;
SYM3 =
*
;
;
;
MLEVEL *
;
;
SECTION *
;
;
SYM4 =
4
;
;
;
QUAL
QNAME2
;
SYM5 =
5
;
;
SYM6 =
/QNAME1/SYM2 ;
;
;
QUAL
*
;
;
SYM7 =
6
;
;
SYM8 =
7
;
;
S231450
STACK
175
S231450
7.54 SET
The SET pseudo instruction resembles the = pseudo instruction; however, a
symbol defined by SET is redefinable.
You can specify the SET pseudo instruction anywhere within a program segment.
If the SET pseudo instruction is found within a definition, it is defined and is not
recognized as a pseudo instruction. If the SET pseudo instruction is found within
a skipping sequence, it is skipped and is not recognized as a pseudo instruction.
The format of the SET pseudo instruction is as follows:
[symbol]
SET
expression[,[attribute]]
S231450
177
The following example illustrates the use of the SET pseudo instruction:
SIZE
PARAM
WORD
BYTE
SIZE
PARAM
=
SET
SET
SET
=
SET
o100
D18
*W
*B
SIZE+1
PARAM+2
; Illegal
; Legal
7.55 SKIP
The SKIP pseudo instruction unconditionally skips subsequent statements.
If a label field name is present, skipping stops when an ENDIF or ELSE with
the same name is encountered; otherwise, skipping stops when the statement
count is exhausted.
You can specify the SKIP pseudo instruction anywhere within a program
segment. If the SKIP pseudo instruction is found within a definition, it is defined
and is not recognized as a pseudo instruction. If the SKIP pseudo instruction
is found within a skipping sequence, it is skipped and is not recognized as a
pseudo instruction.
The format of the SKIP pseudo instruction is as follows:
[name]
SKIP
[count]
The name variable specifies an optional name for a conditional sequence of code.
If both name and count are present, name takes precedence. name must meet the
requirements for identifiers as described in Section 6.3, page 76.
The count variable specifies a statement count. It must be an absolute expression
with a positive value. All symbols in the expression, if any, must be previously
defined. A missing or null count subfield gives a zero count. count is used only
when the label field is not specified. If name is not present and count is present in
the operand field, skipping stops when count is exhausted. If neither name nor
count is present, no skipping occurs.
The following example illustrates the use of the SKIP pseudo instruction:
SNAME1
178
SKIP
SKIP
.
.
;
;
;
;
No skipping occurs.
Statements are skipped if an ENDIF or
ELSE with a matching label field
label is found.
S231450
SNAME1
SNAME2
SNAME2
.
ENDIF
.
.
.
SKIP 10
.
.
ENDIF
.
.
.
SKIP 4
7.56 SPACE
The SPACE pseudo instruction inserts the number of blank lines specified into the
output listing. SPACE is a list control pseudo instruction and by default, is not
listed. To include the SPACE pseudo instruction on the listing, specify the LIS
option on the LIST pseudo instruction.
You can specify the SPACE pseudo instruction anywhere within a program
segment. If the SPACE pseudo instruction is found within a definition, it is
defined and is not recognized as a pseudo instruction. If the SPACE pseudo
instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the SPACE pseudo instruction is as follows:
ignored
SPACE
[expression]
179
7.57 STACK
The STACK pseudo instruction increases the size of the stack. Increments made
by the STACK pseudo instruction are cumulative. Each time the STACK pseudo
instruction is used within a module, the current stack size is incremented by the
number of words specified by the expression in the operand field of the STACK
pseudo instruction.
The STACK pseudo instruction is used in conjunction with sections that have a
type of STACK. If either a STACK section or the STACK pseudo instruction is
specified within a module, the loader tables that the assembler produces indicate
that the module uses one or more stacks. The stack size indicated in the loader
tables is the combined sizes of all STACK sections, if any, added to the total value
of all STACK pseudo instructions, if any, specified within a module.
You must specify the STACK pseudo instruction from within a program module.
If the STACK pseudo instruction is found within a definition, it is defined and
is not recognized as a pseudo instruction. If the STACK pseudo instruction is
found within a skipping sequence, it is skipped and not recognized as a pseudo
instruction.
The format of the STACK pseudo instruction is as follows:
ignored
STACK
[expression]
7.58 START
The START pseudo instruction specifies the main program entry. The program
uses the START pseudo instruction to specify the symbolic address at which
execution begins following the loading of the program. The named symbol can
optionally be an entry symbol specified in an ENTRY pseudo instruction.
You must specify the START pseudo instruction from within a program module.
If the START pseudo instruction is found within a definition or skipping
sequence, it is defined and is not recognized as a pseudo instruction.
180
S231450
START
symbol
HERE
IDENT
START
=
.
.
.
END
EXAMPLE
HERE
*
7.59 STOPDUP
The STOPDUP pseudo instruction stops duplication of a code sequence indicated
by a DUP or ECHO pseudo instruction.
The STOPDUP pseudo instruction is described in detail in Section 9.10, page 257.
7.60 SUBTITLE
The SUBTITLE pseudo instruction specifies the subtitle that will be printed on
the listing. The instruction also causes a page eject. SUBTITLE is a list control
pseudo instruction and is, by default, not listed. To include the SUBTITLE
pseudo instruction on the listing, specify the LIS option on the LIST pseudo
instruction.
S231450
181
You can specify the SUBTITLE pseudo instruction anywhere within a program
segment. If the SUBTITLE pseudo instruction is found within a definition,
it is defined and is not recognized as a pseudo instruction. If the SUBTITLE
pseudo instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the SUBTITLE pseudo instruction is as follows:
ignored
SUBTITLE
[del-char[string-of-ASCII]del-char]
7.61 TEXT
Source lines that follow the TEXT pseudo instruction through the next ENDTEXT
pseudo instruction are treated as text source statements. These statements are
listed only when the TXT listing option is enabled. A symbol defined in text
source is treated as a text symbol for cross-reference purposes; that is, such
a symbol is not listed in the cross-reference unless a reference to the symbol
from a listed statement exists. The text name part of the cross-reference listing
contains the text name.
If the text appears in the global part of a program segment, Symbols defined in
text source are global. If the text appears within a program module, symbols in
text source are local.
TEXT is a list control pseudo instruction and is, by default, not listed. The TEXT
pseudo instruction is listed if the listing is on or if the LIS listing option is
enabled regardless of other listing options.
The TEXT and ENDTEXT pseudo instructions have no effect on a binary definition
file.
You can specify the TEXT pseudo instruction anywhere within a program
segment. If the TEXT pseudo instruction is found within a definition, it is defined
182
S231450
TEXT
[del-char[string-of-ASCII]del-char]
The name variable is optional. It is used as the name of the following source until
the next ENDTEXT pseudo instruction. The name found in the label field is
the text name for all defined symbols in the section, and it is listed in the text
name part of the cross-reference listing.
The name location must meet the requirements for names as described in Section
6.3, page 76.
The del-char variable is the delimiting character. It must be a single matching
character on both ends of the ASCII character string. Apostrophes and spaces
are not legal delimiters; all other ASCII characters are allowed. Two consecutive
occurrences of the delimiting character indicate a single such character will
be included in the character string.
The string-of-ASCII variable is an ASCII character string that will be printed as
the subtitle on subsequent pages of the listing. A maximum of 72 characters is
allowed. This string replaces any previous string found within the subtitle field.
7.62 TITLE
The TITLE pseudo instruction specifies the main title that will be printed on the
listing. TITLE is a list control pseudo instruction and is, by default, not listed. To
include the TITLE pseudo instruction on the listing, specify the LIS option on
the LIST pseudo instruction.
You can specify the TITLE pseudo instruction anywhere within a program
segment. If the TITLE pseudo instruction is found within a definition, it is
defined and is not recognized as a pseudo instruction. If the TITLE pseudo
instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the TITLE pseudo instruction is as follows:
ignored
S231450
TITLE
[del-char[string-of-ASCII]del-char]
183
7.63 VWD
The VWD pseudo instruction allows data to be generated in fields that are from
0 to 64 bits wide. Fields can cross Longword boundaries. Data begins at the
current bit position unless a symbol is used in the label field. If a symbol is
present within the label field, a forced Longword boundary occurs, and the data
begins at the new current bit position.
Code for each subfield is packed tightly with no unused bits inserted.
The VWD pseudo instruction is restricted to sections that have a type of
instructions, data, or both. If the VWD pseudo instruction is found within a
definition, it is defined and is not recognized as a pseudo instruction. If the VWD
pseudo instruction is found within a skipping sequence, it is skipped and is not
recognized as a pseudo instruction.
The format of the VWD pseudo instruction is as follows:
[symbol]
VWD
[count/[expression]][,[count/[expression]]]
184
S231450
The expression variable represents the expression whose value will be inserted
in the field. If expression is missing, the absolute value of 0 is used. If count
is not equal to 0, the count is the number of bits reserved to store the following
expression, if any. expression must meet the requirement for expressions as
described in Section 6.9, page 94.
The following example illustrates the use of the VWD pseudo instruction:
BASE M
BSS 0
VWD 1/SIGN,3/0,60A"NAM"R
; 1000000000000023440515
; 10000000653
REMDR =
64-*W
; 41
VWD
REMDR/DSN
; 00011044516
PDT
In the preceding example, the value of SIGN is 1, the value of FC is 0, the value of
ADD is 653 (octal), and the value of DSN is $IN in ASCII code.
S231450
185
This chapter lists the symbolic machine instructions for Cray X1 systems. Some
of the values in these tables are in binary; for instance, the j column in Section
8.4.4, page 199.
The notations used in the instructions have the following meanings:
S231450
ai
{}
ck
{d ... }
hnt
hw
hw
ab
abc
abcd
01
10
11
imm6
{ ... l}
mm
PC
{s ... }
187
sd
sd
s
d
00
01
sj
vi
{ ... w}
wl
wl
w
l
10
11
188
S231450
000000
xxxxxx
xxxxxx
xxxxxx
xx
000001
000000
000000
000000
00
Syntax
Description
000000
break {n}
Break. n is an integer of up
to 20 bit that is placed in
bits 25..6 of the instruction.
000000
syscall
System call
Syntax
Description
000010
000000
aj
000000
00
000000
gsync aj
Global ordering
000010
000000
aj
000000
00
000001
gsync aj,cpu
000010
000000
aj
000000
00
000010
gsync aj,a
000010
000000
aj
000000
00
000011
gsync aj,r
000010
000000
000000
000000
00
001000
lsync s,v
000010
000000
000000
000000
00
001001
lsync v,s
000010
000000
000000
000000
00
001010
lsync vr,s
000010
000000
000000
000000
00
001011
lsync v,v
000010
000000
vj
000000
00
001100
lsync vj,v
S231450
189
Syntax
Description
000010
000000
vj
000000
00
001101
lsync vj,v,el
000010
000000
000000
000000
00
001110
lsync i
000010
000000
000000
000000
00
001111
lsync fp
Local ordering of
floating-point operations
000010
000000
aj
000000
00
010000
msync aj
000010
000000
aj
000000
00
010001
msync aj,p
000010
000000
aj
000000
00
010010
msync aj,v
000010
000000
000000
000000
00
010100
mint
Syntax
Description
000011
ai
000000
sk
01
000000
ai{,d:,l:} sk
S to A move 64-bit
000011
ai
000000
sk
00
000000
ai,{s:w} sk
S to A move 32-bit
000011
si
000000
ak
01
000001
si{,d:,l:} ak
A to S move 64-bit
000011
si
000000
ak
00
000001
si,{s:w} ak
A to S move 32-bit
000011
ai
000000
ck
01
111101
ai ck
C to A move 64-bit
000011
ci
000000
ak
01
000011
ci ak
A to C move 64-bit
000011
000000
000000
ak
01
000000
vl ak
A to VL move
000011
ai
000000
000000
00
000001
ai vl
VL to A move
190
S231450
Syntax
Description
000011
ai
aj
vk
01
011100
ai{,d:,l:} vk,aj
V to A move 64-bit
000011
ai
aj
vk
00
011100
ai,{s:w} vk,aj
V to A move 32-bit
000011
si
aj
vk
01
011000
si{,d:,l:} vk,aj
V to S move 64-bit
000011
si
aj
vk
00
011000
si,{s:w} vk,aj
V to S move 32-bit
000011
ai
imm6
vk
01
011110
ai{,d:,l:} vk,imm6
000011
ai
imm6
vk
00
011110
ai,{s:w} vk,imm6
000011
si
imm6
vk
01
011010
si{,d:,l:} vk,imm6
000011
si
imm6
vk
00
011010
si,{s:w} vk,imm6
000011
vi
aj
ak
01
011101
vi,aj ak{,d:,l:}
A to V move 64-bit
000011
vi
aj
ak
00
011101
vi,aj sk,{s:w}
A to V move 32-bit
000011
vi
aj
sk
01
011001
vi,aj sk{,d:,l:}
S to V move 64-bit
000011
vi
aj
sk
00
011001
vi,aj sk,{s:w}
S to V move 32-bit
000011
vi
imm6
ak
01
011111
vi,imm6 ak{,d:,l:}
000011
vi
imm6
ak
00
011111
vi,imm6 ak,{s:w}
000011
vi
imm6
sk
01
011011
vi,imm6 sk{,d:,l:}
000011
vi
imm6
sk
00
011011
vi,imm6 sk,{s:w}
101111
ai
aj
000000
00
101111
ai
aj
000000
101111
ai
aj
000000
S231450
Syntax
Description
000000
j, ai aj
Jump
ai<-PC+4;PC<-aj
00
000000
j, ai aj,sr
Jump subroutine
ai<-PC+4;PC<-aj
00
000000
j, ai aj,rt
Jump return
ai<-PC+4;PC<-aj
191
Syntax
Description
100010
ai
aj
ak
wl
000000
ai{,w:,l:} aj+ak
A int add
100011
ai
aj
imm8
000000
ai{,l:} aj+imm8
100011
ai
aj
imm8
101000
ai,w aj+imm8
100010
ai
aj
ak
000101
ai{w:,l:} aj-sk
A int subtract
100011
ai
aj
imm8
000101
ai{,l:} aj-imm8
100011
ai
aj
imm8
101101
ai,w aj-imm8
100010
ai
aj
ak
wl
011000
ai{,w:,l:} aj*ak
A int multiply
100010
ai
aj
ak
11
011001
ai{,l:} hi(aj*ak)
100010
ai
aj
ak
wl
001000
ai{,w:,l:} ak/aj
A int divide
100010
ai
aj
000000
wl
001010
ai{,w:,l:} lz(aj)
100010
ai
aj
000000
wl
001011
ai{,w:,l:} pop(aj)
A population count
192
wl
S231450
Syntax
Description
100010
ai
aj
ak
11
010000
ai{,l:} aj&ak
A logical AND
100011
ai
aj
imm8
010000
ai{,l:} aj&imm8
100010
ai
aj
ak
010001
ai{,l:} aj|ak
A logical OR
100011
ai
aj
imm8
010001
ai{,l:} aj|imm8
A logical OR imm8
100010
ai
aj
ak
11
010010
ai{,l:} ~aj^ak
A logical equivalence
100010
ai
aj
ak
11
010011
ai{,l:} aj^ak
A logical exclusive OR
100011
ai
aj
imm8
010011
ai{,l:} aj^imm8
A logical exclusive OR
imm8
100010
ai
aj
ak
010100
ai{,l:} ~aj&ak
A logical ANDNOT
11
11
100010
ai
aj
ak
wl
100011
ai
aj
100011
ai
100010
Syntax
Description
011100
ai{,w:,l:} aj<<ak
imm8
011100
ai{,l:} aj<<imm8
aj
imm8
101110
ai,w aj<<imm8
ai
aj
ak
011110
ai{,w:,l:} aj>>ak
100011
ai
aj
imm8
011110
ai{,l:} aj>>imm8
100011
ai
aj
imm8
101110
ai,w aj>>imm8
100010
ai
aj
ak
011111
ai{,l:} +aj>>ak
A shift right
arithmetic
100011
ai
aj
imm8
011111
ai{,l:} +aj>>imm8
A shift right
arithmetic imm8
S231450
wl
11
193
100000
ai
00hw
100000
ai
100000
100000
Syntax
Description
imm16
ai:{a:b:c:d} imm16
A insert imm16
01hw
imm16
ai imm16:{a:b:c:d}
ai
10hw
imm16
ai:{ab:abc} imm16
A insert
sign_ext(imm16)
ai
11hw
imm16
ai imm16:{ab:abc:abcd}
100010
ai
aj
ak
11
100011
ai
aj
imm8
100010
ai
aj
ak
100011
ai
aj
imm8
Syntax
Description
110010
ai{,l:} aj< ak
110010
ai{,l:} aj<imm8
111010
ai,u{l:} aj<ak
111010
ai,u{l:} aj<imm8
11
000101
ai
aj
ak
11
000101
ai
aj
ak
000101
ai
aj
000101
ai
000101
000101
194
Syntax
Description
100000
A extract byte
11
100001
A extract halfword
ak
11
100100
A insert byte
aj
ak
11
100101
A insert halfword
ai
aj
ak
11
100010
A mask byte
ai
aj
ak
11
100011
A mask halfword
S231450
100010
ai
aj
ak
100010
ai
aj
100010
ai
100011
ai
Syntax
Description
11
010111
ai{,l:} aj?ai:ak
A move if zero
ak
11
010110
ai{,l:} aj?ak:ai
A move if non-zero
000000
ak
11
000111
ai{,l:} cvl(ak)
A compute vector
length
000000
imm8
000111
ai{,l:}
cvl(imm8)
A compute vector
length imm8
Syntax
Description
101000
ai
imm20
bz ai,imm20
A branch (ai==0)
PC<-PC+4+(imm20<<2)
101001
ai
imm20
bn ai,imm20
A branch (ai!=0)
PC<-PC+4+(imm20<<2)
101010
ai
imm20
ble ai,imm20
A branch (ai<=0)
PC<-PC+4+(imm20<<2)
101011
ai
imm20
blt ai,imm20
A branch (ai<0)
PC<-PC+4+(imm20<<2)
101100
ai
imm20
bge ai,imm20
A branch (ai>=0)
PC<-PC+4+(imm20<<2)
101101
ai
imm20
bgt ai,imm20
A branch (ai>0)
PC<-PC+4+(imm20<<2)
195
100101
ai
aj
100100
ai
100001
Syntax
Description
imm14
ai{,d:,l:} [aj+imm14]
aj
imm14
ai,{s:w} [aj+imm14]
A load 32-bit,
sign-extended imm14
ai
aj
ak
01
000000
ai{,d:,l:} [aj+ak]
100001
ai
aj
ak
00
000000
ai,{s:w} [aj+ak]
A load 32-bit
sign-extended
indexed
100111
ai
aj
imm14
[aj+imm14] ai{,d:,l:}
100110
ai
aj
imm14
[aj+imm14] ai,{s:w}
100001
ai
aj
ak
01
000001
[aj+ak] ai{,d:,l:}
100001
ai
aj
ak
00
000001
[aj+ak] ai,{s:w}
100001
ai
aj
000000
01
000010
ai{,d:,l:} [aj],ua
A load 64-bit
unaligned
100001
ai
aj
000000
01
000011
[aj] ai{,d:,l:},ua
A store 64-bit
unaligned
Syntax
Description
pref [aj+imm14]
Prefetch imm14
pref [aj+ak]
Prefetch indexed
100101
000000 aj
imm14
100001
000000 aj
ak
01
f
000000
196
S231450
Syntax
Description
000100
ai
aj
ak
01
hnt000
ai{,d:,l:}
[aj],afadd,ak{,hnt}
000100
ai
aj
ak
01
hnt001
ai{,d:,l:}
[aj],afax,ak{,hnt}
000100
ai
aj
ak
01
hnt010
ai{,d:,l:}
[aj],acswap,ak{,hnt}
000100
ai
aj
000000
01
hnt100
[aj] ai{,d:,l:},aadd{,hnt}
Atomic add
000100
ai
aj
ak
01
hnt101
[aj]
ai{,d:,l:},aax,ak{,hnt}
197
S Register Floating Point Compare Instructions (see Section 8.4.9, page 201).
S Register Conversion Instructions (see Section 8.4.10, page 202).
S Register Memory Instructions (see Section 8.4.11, page 203).
8.4.1 S Register Integer Instructions
Syntax
Description
110010
si
sj
sk
wl
000000
si{,w:,l:} sj+sk
S int add
110011
si
sj
imm8
000000
si{,l:} sj+imm8
110011
si
sj
imm8
101000
si,w sj+imm8
110010
si
sj
sk
000101
si{,w:,l:} sj-sk
S int subtract
110011
si
sj
imm8
000101
si{,l:} sj-imm8
110011
si
sj
imm8
101101
si,w sj-imm8
110010
si
sj
sk
wl
011000
si{,w:,l:} sj*sk
S int multiply
110010
si
sj
sk
11
011001
si{,l:} hi(sj*sk)
110010
si
sj
sk
wl
001000
si{,w:,l:} sk/sj
S int divide
110010
si
sj
000000
wl
001010
si{,w:,l:} lz(sj)
110010
si
sj
000000
wl
001011
si{,w:,l:} pop(sj)
S population count
Syntax
Description
010000
si{,l:} sj&sk
S logical AND
010000
si{,l:} sj&imm8
010001
si{,l:} sj|sk
S logical OR
010001
si{,l:} sj|imm8
S logical OR imm8
010010
si{,l:} ~sj^sk
S logical equivalence
wl
110010
si
sj
sk
11
110011
si
sj
imm8
110010
si
sj
sk
110011
si
sj
imm8
110010
si
sj
sk
198
11
11
S231450
110010
si
sj
sk
11
110011
si
sj
imm8
110010
si
sj
sk
Syntax
Description
010011
si{,l:} sj^sk
S logical exclusive OR
010011
si{,l:} sj^imm8
S logical exclusive OR
imm8
010100
si{,l:} ~sj&sk
S logical ANDNOT
11
Syntax
Description
110010
si
sj
sk
wl
011100
si{,w:,l:} sj<<sk
110011
si
sj
imm8
011100
si{,l:} sj<<imm8
110011
si
sj
imm8
101100
si,w sj<<imm8
110010
si
sj
sk
011110
si{,w:,l:} sj>>sk
110011
si
sj
imm8
011110
si{,l:} sj>>imm8
110011
si
sj
imm8
101110
si,w sj>>imm8
110010
si
sj
sk
011111
si{,l:} +sj>>sk
110011
si
sj
imm8
011111
si{,l:} +sj>>imm8
wl
11
110000
si
00hw
110000
si
110000
110000
S231450
Syntax
Description
imm16
si:{a:b:c:d} imm16
S insert imm16
01hw
imm16
si imm16:{a:b:c:d}
si
10hw
imm16
si:{ab:abc} imm16
S insert sign_ext(imm16)
si
11hw
imm16
si
imm16:{ab:abc:abcd}
199
110010
si
sj
sk
11
110011
si
sj
imm8
110010
si
sj
sk
110011
si
sj
imm8
Syntax
Description
110010
si{,l:} sj< sk
110010
si{,l:} sj<imm8
111010
si,u{l:} sj<sk
111010
si,u{l:} sj<imm8
11
Syntax
Description
110010
si
sj
sk
11
010111
si{,l:} sj?si:sk
S move if zero
110010
si
sj
sk
11
010110
si{,l:} sj?sk:si
S move if non-zero
110010
si
sj
sk
01
001100
si{,d:,l:} cpys(sj,sk)
110010
si
sj
sk
00
001100
si{,s:w} cpys(sj,sk)
110010
si
000000
sk
11
101111
si bmm(sk)
111000
si
111001
Syntax
Description
imm20
bz si,imm20
S branch (si=0)
PC<-PC+4+(imm20<<2)
si
imm20
bn si,imm20
S branch (si!=0)
PC<-PC+4+(imm20<<2)
111010
si
imm20
ble si,imm20
S branch (si<=0)
PC<-PC+4+(imm20<<2)
111011
si
imm20
blt si,imm20
S branch (si<0)
PC<-PC+4+(imm20<<2)
200
S231450
111100
si
111101
si
Syntax
Description
imm20
bge si,imm20
S branch (si>=0)
PC<-PC+4+(imm20<<2)
imm20
bgt si,imm20
S branch (si>0)
PC<-PC+4+(imm20<<2)
Syntax
Description
110010
si
sj
sk
sd
000000
si,{s:d} sj+sk
110010
si
sj
sk
sd
000101
si,{s:d} sj-sk
S floating point
subtract
110010
si
sj
sk
sd
011000
si,{s:d} sj*sk
S floating point
multiply
110010
si
sj
sk
sd
001000
si,{s:d} sj/sk
110010
si
sj
000000
sd
001001
si,{s:d} sqrt(sj)
S floating point
square root
110010
si
sj
000000
sd
001111
si,{s:d} abs(sj)
S floating point
absolute value
110010
si
sj
sk
sd
110010
si
sj
sk
110010
si
sj
sk
S231450
Syntax
Description
110001
si,{s:d} sj=sk
S floating point
compare equal
sd
111110
si,{s:d} sj!=sk
S floating point
compare not equal
sd
110010
si,{s:d} sj<sk
S floating point
compare less than
201
110010
si
sj
sk
sd
110010
si
sj
sk
sd
Syntax
Description
110011
si,{s:d} sj<=sk
S floating point
compare less than
or equal
110000
si,{s:d} sj?sk
S floating point
compare unordered
Syntax
Description
110010
si
sj
000000
01
101010
si,d sj,w
S convert word to
double
110010
si
sj
000000
01
101011
si,d sj,l
110010
si
sj
000000
01
101000
si,d sj,s
S convert single to
double
110010
si
sj
000000
00
101010
si,s sj,w
110010
si
sj
000000
00
101011
si,s sj,l
110010
si
sj
000000
00
101001
si,s sj,d
S convert double to
single
110010
si
sj
000000
11
101000
si,l sj,s
110010
si
sj
000000
11
101001
si,l sj,d
110010
si
sj
000000
10
101000
si,w sj,s
110010
si
sj
000000
10
101001
si,w sj,d
S convert double to
word
110010
si
sj
000000
11
100000
si,l round(sj),s
110010
si
sj
000000
11
100001
si,l round(sj),d
110010
si
sj
000000
10
100000
si,w round(sj),s
110010
si
sj
000000
10
100001
si,w round(sj),d
110010
si
sj
000000
11
100010
si,l trunc(sj),s
110010
si
sj
000000
11
100011
si,l trunc(sj),d
S truncate double to
long
202
S231450
Syntax
Description
110010
si
sj
000000
10
1000100
si,w trunc(sj),s
110010
si
sj
000000
10
100011
si,w trunc(sj),d
S truncate double to
word
110010
si
sj
000000
11
100100
si,l ceil(sj),s
110010
si
sj
000000
11
100101
si,l ceil(sj),d
110010
si
sj
000000
10
100100
si,w ceil(sj),s
110010
si
sj
000000
10
100101
si,w ceil(sj),d
110010
si
sj
000000
11
100110
si,l floor(sj),s
110010
si
sj
000000
11
100111
si,l floor(sj),d
110010
si
sj
000000
10
100110
si,w floor(sj),s
110010
si
sj
000000
10
100111
si,w floor(sj),d
110101
si
aj
110100
si
110001
Syntax
Description
imm14
si{,d:,l:} [aj+imm14]
aj
imm14
si,{s:w} [aj+imm14]
si
aj
ak
01
000000
si{,d:,l:} [aj+ak]
110001
si
aj
ak
00
000000
si,{s:w} [aj+ak]
110111
si
aj
imm14
[aj+imm14] si{,d:,l:}
110110
si
aj
imm14
[aj+imm14] si,{s:w}
110001
si
aj
ak
01
000001
[aj+ak] si{,d:,l:}
110001
si
aj
ak
00
000001
[aj+ak] si,{s:w}
S231450
203
Syntax
Description
0100mm
vi
vj
vk
wl
000000
vi{,w:,l:} vj+vk,mm
V int add
0101mm
vi
vj
sk
wl
000000
vi,vc vj+sk,mm
0100mm
vi
vj
vk
11
000010
vi{,w:,l:} vj+vk,mm
0101mm
vi
vj
sk
11
000010
vi,vc vj+sk,mm
0100mm
vi
vj
vk
wl
000001
vi{,w:,l:} vk-vj,mm
V int subtract
0101mm
vi
vj
sk
wl
000001
vi{,w:,l:} sk-vj,mm
0100mm
vi
vj
vk
11
000011
vi, vc vk-vj,mm
0101mm
vi
vj
sk
11
000011
vi,cv sk-vj,mm
0100mm
vi
vj
vk
wl
011000
vi{,w:,l:} vj*vk,mm
V int multiply
0101mm
vi
vj
sk
wl
011000
vi{,w:,l:} vj*sk,mm
204
S231450
Syntax
Description
0100mm
vi
vj
vk
11
011001
vi{,l:} hi(vj*vk),mm
0101mm
vi
vj
sk
11
011001
vi{,l:} hi(vj*sk),mm
0100mm
vi
vj
000000 wl
001010
vi{,w:,l:} lz(vj),mm
0100mm
vi
vj
000000 wl
001011
vi{,w:,l:} pop(vj),mm
V population count
Syntax
Description
0100mm
vi
vj
vk
wl
010000
vi{,w:,l:} vj&vk,mm
V logical AND
0101mm
vi
vj
sk
wl
010000
vi{,w:,l:} vj&sk,mm
0100mm
vi
vj
vk
wl
010001
vi{,w:,l:} vj|vk,mm
V logical OR
0101mm
vi
vj
sk
wl
010001
vi{,w:,l:} vj|sk,mm
V/S logical OR
0100mm
vi
vj
vk
wl
010010
vi{,w:,l:} ~vj^vk,mm
V logical equivalence
0101mm
vi
vj
sk
wl
010010
vi{,w:,l:} ~vj^sk,mm
V/S logical
equivalence
0100mm
vi
vj
vk
wl
010011
vi{,w:,l:} vj^vk,mm
V logical exclusive OR
0101mm
vi
vj
sk
wl
010011
vi{,w:,l:} vj^sk,mm
0100mm
vi
vj
vk
wl
010100
vi{,w:,l:} ~vj&vk,mm
V logical ANDNOT
0101mm
vi
vj
sk
wl
010110
vi{,w:,l:} ~vj&sk,mm
Syntax
Description
0100mm
vi
vj
vk
wl
011100
vi{,w:,l:} vj<<vk,mm
0101mm
vi
vj
sk
wl
011100
vi{,w:,l:} vj<<sk,mm
0100mm
vi
vj
vk
wl
011110
vi{,w:,l:} vj>>vk,mm
0101mm
vi
vj
sk
wl
011110
vi{,w;,l:} vj>>sk,mm
S231450
205
0100mm
vi
vj
vk
wl
0101mm
vi
vj
sk
wl
Syntax
Description
011111
vi{,w:,l:} +vj>>vk,mm
011111
vi{,w:,l:} +vj>>sk,mm
Syntax
Description
0100mm
000mi
vj
vk
wl
110001
0101mm
000mi
vj
sk
wl
110001
0100mm
000mi
vj
vk
wl
111110
mi{,w:,l:} vj!=vk,mm
0101mm
000mi
vj
sk
wl
111110
0100mm
000mi
vj
vk
wl
110010
mi{,w:,l:} vj<vk,mm
0101mm
000mi
vj
sk
wl
110010
mi{,w:,l:} vj<sk,mm
0100mm
000mi
vj
vk
wl
110011
mi,u{,w:,l:} vj<vk,mm
0101mm
000mi
vj
sk
wl
110011
mi,u{,w:,l:} vj<sk,mm
0100mm
000mi
vj
vk
wl
111011
0101mm
000mi
vj
sk
wl
111011
0100mm
000mi
vj
vk
wl
111011
V int compare
less than or equal
unsigned
0101mm
000mi
vj
sk
wl
111011
206
S231450
Syntax
Description
0101mm
000mi
vj
sk
wl
110100
mi{,w:,l:} vj>sk,mm
0101mm
000mi
vj
sk
wl
111100
0101mm
000mi
vj
sk
wl
110101
0101mm
000mi
vj
sk
wl
111101
Syntax
Description
0100mm
vi
vj
vk
sd
000000
vi,{s:d} vj+sk,mm
0101mm
vi
vj
sk
sd
000000
vi,{s:d} vj+vk,mm
0100mm
vi
vj
vk
sd
000001
vi,{s:d} vj-vk,mm
V floating point
subtract
0101mm
vi
vj
sk
sd
000001
vi,{s:d} sk-vj,mm
0100m
vi
vj
vk
sd
011000
vi,{s:d} vj*vk,mm
V floating point
multiply
0101mm
vi
vj
vk
sd
011000
vi,{s:d} vj*vk,mm
0100mm
vi
vj
vk
sd
001000
vi,{s:d} vk/vj,mm
0101mm
vi
vj
sk
sd
001000
vi,{s:d} sk/vj,mm
0100mm
vi
vj
000000 sd
001001
vi,{s:d} sqrt(vj),mm
0100mm
vi
vj
000000 sd
001111
vi,{s:d} abs(vj),mm
V floating point
absolute value
S231450
207
Syntax
Description
0100mm
00mi
vj
vk
sd
110001
mi,{s:d} vj==vk,mm
V floating point
compare equal
0101mm
00mi
vj
sk
sd
110001
mi,{s:d} vj==sk,mm
0100mm
00mi
vj
vk
sd
111110
mi,{s:d} vj!=vk,mm
V floating point
compare not equal
0101mm
00mi
vj
sk
sd
111110
mi,{s:d} vj!=sk,mm
0100mm
00mi
vj
vk
sd
110010
mi,{s:d} vj<vk,mm
V floating point
compare less than
0101mm
00mi
vj
sk
sd
110010
mi,{s:d} vj<sk,mm
0100mm
00mi
vj
vk
sd
110011
mi,{s:d} vj<=vk,mm
V floating point
compare less than
or equal
0101mm
00mi
vj
sk
sd
110010
mi,{s:d} vj<=sk,mm
0101mm
00mi
vj
sk
sd
110100
mi,{s:d} vj>sk,mm
0101mm
00mi
vj
sk
sd
110101
mi,{s:d} vj>=sk,mm
0100mm
00mi
vj
vk
sd
111000
mi,{s:d} vj?vk,mm
V floating point
compare unordered
0101mm
00mi
vj
sk
sd
111000
mi,{s:d} vj?sk,mm
208
S231450
Syntax
Description
0100mm
vi
vj
000000
01
101010
vi,d vj,w,mm
V convert word to
double
0100mm
vi
vj
000000
01
101011
vi,d vj,l,mm
V convert long to
double
0100mm
vi
vj
000000
01
101000
vi,d vj,s,mm
V convert single to
double
0100mm
vi
vj
000000
00
101010
vi,s vj,w,mm
V convert word to
single
0100mm
vi
vj
000000
00
101011
vi,s vj,l,mm
0100mm
vi
vj
000000
00
101001
vi,s vj,d,mm
V convert double to
single
0100mm
vi
vj
000000
11
101010
vi,l vj,w,mm
0100mm
vi
vj
000000
11
101000
vi,l vj,s,mm
0100mm
vi
vj
000000
11
101001
vi,l vj,d,mm
V convert double to
long
0100mm
vi
vj
000000
10
101011
vi,w vj,l,mm
0100mm
vi
vj
000000
10
100000
vi,w vj,s,mm
V convert single to
word
0100mm
vi
vj
000000
10
100001
vi,w vj,d,mm
V convert double to
word
0100mm
vi
vj
000000
11
100000
vi,l round(vj),s,mm
0100mm
vi
vj
000000
11
100001
vi,l round(vj),d,mm
0100mm
vi
vj
000000
10
100000
vi,w round(vj),s,mm
0100mm
vi
vj
000000
10
100001
vi,w round(vj),d,mm
V round double to
word
0100mm
vi
vj
000000
11
100010
vi,l trunc(vj),s,mm
V truncate single to
long
0100mm
vi
vj
000000
11
100011
vi,l trunc(vj),d,mm
V truncate double to
long
S231450
209
Syntax
Description
0100mm
vi
vj
000000
10
100010
vi,w trunc(vj),s,mm
V truncate single to
word
0100mm
vi
vj
000000
10
100011
vi,w trunc(vj),d,mm
V truncate double to
word
0100mm
vi
vj
000000
11
100100
vi,l ceil(vj),s,mm
0100mm
vi
vj
000000
11
100101
vi,l ceil(vj),d,mm
0100mm
vi
vj
000000
10
100100
vi,w ceil(vj),s,mm
0100mm
vi
vj
000000
10
100100
vi,w ceil(vj),d,mm
V ceiling double to
word
0100mm
vi
vj
000000
11
100110
vi,l floor(vj),s,mm
0100mm
vi
vj
000000
11
100111
vi,l floor(vj),d,mm
0100mm
vi
vj
000000
10
100110
vi,w floor(vj),s,mm
0100mm
vi
vj
000000
10
100111
vi,w floor(vj),d,mm
Syntax
Description
011100
000000
000000
vk
11
000010 bmm vk
0100mm
vi
000000
vk
11
101111 vi bmm(vk),mm
V bit matrix
multiply
0100mm
vi
vj
vk
01
0100mm
vi
vj
vk
00
011100
000000
000000
000000
00
000100 vrip
Vector rest in
peace
210
S231450
Syntax
Description
0100mm vi
vj
vk
01
101110
vi{,d:,l:} mm?vk:vj
V merge 64-bit
0101mm vi
vj
sk
01
101110
vi{,d:,l:} mm?sk:vj
0100mm vi
vj
vk
00
101110
vi{,d:,l:} mm?vk:vj
V merge 32-bit
0101mm vi
vj
sk
00
101110
vi,{s:w} mm?sk:vj
010100
vi
000mj
ak
11
101100
vi scan(ak,mj)
V iota continuous
010100
vi
000mj
ak
11
101101
vi{,l:} cidx(ak,mj)
V iota compressed
010000
vi
000mj
vk
01
010101
vi{,d:,l:} cmprss(vk,mj)
V compress
011100
000mi
000000
ak
00
001000
mi fill(ak)
VM fill
011100
ai
000000
000mk
00
001001
ai last(mk)
011100
ai
000000
000mk
00
001010
ai first(mk)
011100
ai
000000
000mk
00
001011
ai pop(mk)
VM pop count
011100
000mi
000mj
000mk
00
010000
mi mj&mk
VM logical AND
011100
00mi
00mj
00mk
00
010001
mi mj|mk
VM logical OR
011100
00mi
000mj
000mk
00
010010
mi ~mj^mk
VM logical equivalence
011100
00mi
00mj
00mk
00
010011
mi mj^mk
VM logical exclusive OR
011100
00mi
00mj
00mk
00
010100
mi mj&mj
VM logical ANDNOT
S231450
ex (000)
When you specify ex or do not specify a value for hnt you get the
default, which is exclusive. Read misses allocate the cache line
exclusively, anticipating a subsequent write by the same MSP. If the
cache line is already shared, read misses allocate the line in shared
mode. Write misses must allocate the line exclusively.
sh (001)
Shared. Read misses allocate the cache line in the shared state,
anticipating a subsequent read by a different MSP. This hint
is ignored by writes.
211
na (010)
Syntax
Description
0110mm
vi
aj
ak
01
hnt000
vi{,d:,l:} [aj,ak],mm{,hnt}
0110mm
vi
aj
ak
00
hnt000
vi{,s:,w:} [aj,ak],mm{,hnt}
0110mm
vi
aj
imm6
01
hnt010
vi{,d:,l:} [aj,imm6],mm{,hnt}
0110mm
vi
aj
imm6
00
hnt010
vi{,s:,w:}
[aj,imm6],mm{,hnt}
0110mm
vi
aj
vk
01
hnt100
vi{,d:,l:} [aj,vk],mm{,hnt}
V gather 64-bit vk
scaled by 8
0110mm
vi
aj
vk
00
hnt100
vi{,s:,w:} [aj,vk],mm{,hnt}
V gather 32-bit vk
scaled by 4
0110mm
vi
aj
ak
01
hnt001
[aj,ak] vi{,d:,l:},mm{,hnt}
0110mm
vi
aj
ak
00
hnt001
[aj,ak] vi{,s:,w:},mm{,hnt}
0110mm
vi
aj
imm6
01
hnt011
[aj,imm6] vi{,d:,l:},mm{,hnt}
0110mm
vi
aj
imm6
00
hnt011
[aj,imm6]
vi{,s:,w:},mm{,hnt}
0110mm
vi
aj
vk
01
hnt101
[aj,vk] vi{,d:,l:},mm{,hnt}
V scatter 64-bit vk
scaled by 8
0110mm
vi
aj
vk
00
hnt101
[aj,vk] vi{,s:,w:},mm{,hnt}
V scatter 32-bit vk
scaled by 4
212
S231450
0110mm
vi
aj
vk
01
0110mm
vi
aj
vk
00
Syntax
Description
hnt111
[aj,vk] vi{,d:,l:},mm,ord{,hnt}
hnt111
[aj,vk]
vi{,s:,w:},mm,ord{,hnt}
000110
000000
000000
000000
00
000011
ai
aj
000000
00011
000000
aj
011100
000000
000000
S231450
Syntax
Description
000000
eret
01
000100
ai hw[ai]
ak
01
000101
hw[ai] ak
000000
00
000101
vclean
213
Defined sequences are named sequences of instructions that can be saved for
assembly later in the source program. Defined sequences have several functional
similarities.
The four types of defined sequences are specified by the MACRO, OPDEF, DUP, and
ECHO pseudo instructions. The ENDM, ENDDUP, and STOPDUP pseudo instructions
terminate defined sequences. The LOCAL and OPSYN pseudo instructions are
associated with definitions and are included in this chapter.
The defined sequence pseudo instructions are as follows:
S231450
Pseudo
Description
MACRO
OPDEF
DUP
ECHO
ENDM
ENDDUP
STOPDUP
LOCAL
OPSYN
EXITM
215
.
.
.
ENDM
; underscore
217
the proper name in the label field ends a dup definition. An ENDDUP pseudo
instruction with the proper name in the label field ends an echo definition.
9.1.3 Formal Parameters
Formal parameters are defined in the definition header and recognized in the
definition body. Four types of formal parameters are recognized as follows:
Positional
Keyword
Echo
Local
The characters that identify positional, keyword, echo, and local parameters must
all have unique names within a given definition. Positional, keyword, and echo
parameters are also case-sensitive. To be recognized, you must specify these
parameters in the body of the definition exactly as specified in the definition
header. Parameter names must meet the requirements for identifiers as described
in Section 6.3, page 76.
You can embed a formal parameter name within the definition body; however,
embedded parameters must satisfy the following requirements:
The first character of an embedded parameter must begin with a legal
initial-identifier-character.
An embedded parameter cannot be preceded by an initial-identifier-character
(for example, PARAM is a legally embedded parameter within the
ABC_PARAM_DEF string because it is preceded by an underscore character).
PARAM is not a legally embedded character within the string ABCPARAMDEF
because it is preceded by an initial-identifier-character (C).
An embedded parameter must not be followed by an identifier-character.
In the following example, the embedded parameter is legal because it is
followed by an element separator (blank character):
PARAM678
218
S231450
S231450
219
If the sequence field (columns 73 through 90) of the source file is not empty, the
assembler copies the existing field for a call into every statement expanded by
the call reserving columns 89 and 90 for the nesting level. For example, if the
sequence field for MCALL was LQ5992A.112, the sequence field for a statement
expanded from MCALL would read as follows:
LQ5992A.1l2
:l
Additional nested calls within MCALL would change the nesting level, but the
sequence field would be unchanged during MCALL. For example:
LQ5992A.112
LQ5992A.l12
LQ5992A.112
LQ5992A.112
LQ5992A.112
LQ5992A.112
:2
:2
:2
:3
:*
:l
If the sequence field (columns 73 through 90) of the source file is empty, the
assembler inserts the name of the definition, as follows:
Name
Description
Macro
The inserted name in the sequence field is the name found in the
result field of the macro prototype statement.
Opdef
The inserted name in the sequence field is the name used in the
label field of the OPDEF pseudo instruction itself.
Dup
The inserted name in the sequence field is the name used in the
label field of the DUP pseudo instruction, or if the count is specified
and name is not, the name is *Dup.
Echo
The inserted name in the sequence field is the name used in the
label field of the ECHO pseudo instruction.
In all cases, the first two columns of the sequence field contain asterisks (**) to
indicate that the assembler has generated the sequence field. Columns 89 and
90 of the sequence field are reserved for the nesting level. If, for example, the
sequence field is missing for MCALL, it would read as follows:
** MCALL
:1
Additional nested calls within MCALL would change the nesting level, but the
sequence field number would be unchanged for the duration of MCALL.
The following example illustrates how the assembler tracks the nesting sequence:
220
S231450
*MCALL
*MCALL
*MCALL
*MCALL
*MCALL
** MCALL
** MCALL
:1
:2
:2
:2
:3
:*
:1
Description
MACRO
OPDEF
DUP
ECHO
221
GLOBAL
; Globally defined.
* GLOBAL DEFINITION IS USED.
GLOBAL ENDM
LIST
MAC
GLOBAL
; Call to global definition.
* GLOBAL DEFINITION IS USED.
IDENT TEST
GLOBAL
; Call to global definition.
* GLOBAL DEFINITION IS USED.
MACRO
; Locally defined.
GLOBAL
; Attempted global definition.
* Redefinition warning message is issued
* LOCAL DEFINITION IS USED.
GLOBAL ENDM
GLOBAL
; Call to local definition.
* LOCAL DEFINITION IS USED.
END
; Local definitions discarded
IDENT TEST2
GLOBAL
; Call to global definition.
* GLOBAL DEFINITION IS USED.
END
intconv
; extension.
+f_p1 ; Normalize the S register.
; End of macro definition.
p2
endm
As with every macro, INTCONV begins with the MACRO pseudo instruction. The
second statement is the prototype statement, which names the macro and defines
the parameters. The next three statements are definition statements that identify
what the macro does. The ENDM pseudo instruction ends the macro definition.
The format of the macro definition is as follows:
ignored
MACRO
[location]
functional
LOCAL
ignored
parameters
[[name],[name]]
.
.
.
functional
ENDM
223
S231450
is used as the argument. Use of the syntactically valid expression permits you
to enter a string (=, R) of characters that may contain one or more spaces or
a comma.
The null string is an empty string.
positional-parameters
positional-parameters must be specified with valid and unique names and they
must meet the requirements for names as described in Section 6.3, page 76. There
can be none, one, or more positional parameters. The default argument for a
positional-parameter is an empty string.
The positional parameters defined in the macro definition are case-sensitive.
Positional parameters that are specified in the definition body must identically
match positional parameters defined by the macro prototype statement.
The syntax for keyword-parameters can be any of the following:
[*]name=[expression-argument-value]
[,[keyword-parameters]]
[*] | name=[expression-argument-value]
[,[keyword-parameters]]
[*]name=[string-argument-value]
[,[keyword-parameters]]
The elements of keyword-parameters are described as follows:
keyword-parameters
keyword-parameters must be specified with valid and unique names. Names
within keyword-parameter must meet the requirements for names as described in
Section 6.3, page 76.
There can be zero, one, or more keyword-parameters . You can enter names
within keyword-parameters in any order. Default arguments can be provided for
each keyword-parameter at definition time, and they are used if the keyword
is not specified at call time.
S231450
225
|PARAM
; Macro prototype.
S231450
JUSTIFY
ENDM
JUSTIFY
JUSTIFY
,R ; Macro call
R; Macro call
When the following macro is called, the positional parameter p1 receives a value
of v1 because an asterisk does not precede the parameter on the prototype
statement. The positional parameter p2, however, receives a value of (v2)
because an asterisk precedes the parameter on the prototype statement.
paren
macro
paren
.
.
.
endm
paren
p1,p2
; Macro prototype.
227
S231450
INTCONV
P2
INTCO
P2
ENDM
LIST
S2
tabn,val1=#0,val2=,val3=0
data
tabn1
val1
val2
val3
* : Resume use of previous section.
mac
The following shows the call and expansion of the table macro:
table
tables section
taba
con
con
con
con
S231450
taba,val3=4,val2=a
data
taba1
~
a
4
; Macro call.
229
section
param1,param2,param3=,param4=b
param1
param2
param3
param4
mac
(1),2,param4=dog,param3=d
1
2
d
dog
Macros ONE, two, and THREE demonstrate that the number of parameters
specified in the macro call may form the number of parameters specified in
the macro definition.
MACRO
ONE
_*PARAMETER1:
_*PARAMETER2:
_*PARAMETER3:
ONE
ENDM
LIST
PARAM1,PARAM2,PARAM3
PARAM1
; SYM1 corresponds to PARAM1.
PARAM2
; Null string.
PARAM3
; Null string.
MAC
The call and expansion of the ONE macro using one parameter is as follows:
ONE
* PARAMETER 1:
* PARAMETER 2:
* PARAMETER 3:
macro
two
_* Parameter 1:
230
SYM1 ; Call
SYM1 ; SYM1
; Null
; Null
param1,param2,param3
param1
S231450
_* Parameter 2:
_* Parameter 3:
two
endm
list
The call and expansion of the two macro using two parameters is as follows:
two
* Parameter 1:
* Parameter 2:
* Parameter 3:
MACRO
THREE
_*PARAMETER 1:
_*PARAMETER 2:
_*PARAMETER 3:
THREE
ENDM
LIST
sym1,sym2 ;
sym1 ; sym1
sym2 ; sym2
; Null
PARAM1,PARAM2,PARAM3
PARAM1
;SYM1 corresponds to PARAM1.
PARAM2
;SYM2 corresponds to PARAM2.
PARAM3
;SYM3 corresponds to PARAM3.
MAC
The call and expansion of the THREE macro using prototype parameters is as
follows:
THREE
* PARAMETER 1:
* PARAMETER 2:
* PARAMETER 3:
S231450
PARAMl,|PARAM2,|PARAM3=,PARAM4=
PARAM1
; Embedded argument.
PARAM2
; Syntactically valid expression
231
_* PARAMETER 3:
_* PARAMETER 4:
BANG
ENDM
LIST
PARAM3
; Syntactically valid expression
PARAM4
; Null string.
MAC
(1,2),abc,def,PARAM3=1+2
; Macro call.
1,2
; Embedded argument.
abc,def
; Syntactically valid expression.
1+2
; Syntactically valid expression.
; Null string.
remem
macro
remem |param1= r
s1
param1
endm
list mac
232
param1=,r
s1
,r
S231450
The NULL and nullparm macros that follow demonstrate the effect of null
strings when parameters are passed.
NULL demonstrates the effect of a null string on macro expansions. P2 is passed
a null string. When NULL is expanded, the resulting line is left-shifted two
spaces, which is the difference between the length of the parameter (P2) and
the null string.
NULL
MACRO
NULL P1,P2,P3
S1
P1
S2
P2
S3
P3
ENDM
LIST MAC
NULL 1,,3
S1
1
S2
S3
3
; Macro call.
; Left shifted two places.
Macro nullparm demonstrates how a macro is expanded when the macro call
does not include the label field name specified on the macro definition.
macro
nullparm
longparm =
nullparm endm
list
longparm
; Prototype statement.
1
mac
S231450
233
Note: The label field parameter was omitted on the macro call in the previous
example. The result and operand fields of the first line of the expansion were
shifted left 8 character positions because a null argument was substituted for
the 8-character parameter, LONGPARM.
If the old format is used, only one space appears between the label field
parameter and result field in the macro definition. If a null argument is
substituted for the location parameter, the result field is shifted into the
label field in column 2. Therefore, at least two spaces should always appear
between a parameter in the label field and the first character in the result field
in a definition. If the new format is used, the result field is never shifted
into the label field.
The following macro, DEFAULT, illustrates how defaults are assigned for
keywords when the macro is expanded:
MACRO
DEFAULT
_* PARAM 1
_* PARAM 2
_* PARAM 3
DEFAULT ENDM
LIST
PARAM1=(ABC DEF,GHI),PARAM2=ABC,PARAM3=
MAC
PARAM1=ARG1,PARAM2=ARG2,PARAM3=ARG3
; Macro call.
DEFAULT
PARAM1=,PARAM2=(ARG2),PARAM3=ARG3
DEFAULT
PARAM1=((ARG1)),PARAM2=,PARAM3=ARG3
; Macro call.
*ARG1
*ARG2
*ARG3
*ARG2
*ARG3
* (*ARG1)
* ARG3
The following examples illustrate the correct and incorrect way to specify a
literal string in a macro definition.
Macro WRONG shows the incorrect way to specify a literal string in a macro
definition. The comments in the expansion are writer comments and are not
part of the expansion.
234
S231450
MACRO
WRONG PARAM1= R
_* PARAM1
WRONG ENDM
LIST MAC
; Prototype statement.
; End of macro definition.
; List expansion.
; Macro call
Macro right shows the correct way to specify a literal string in a macro
definition.
macro
right |param1= r
* param1
right endm
list mac
; Prototype statement.
; End of macro definition.
; List expansion.
; Macro call.
* r
The following macros demonstrate the wrong and right methods for replacing
parameters on the prototype statement with parameters on the macro call
statement.
Macro BAD demonstrates the wrong method of replacing parameters.
MACRO
BAD
* PARAMETER
* PARAMETER
* PARAMETER
BAD
ENDM
LIST
PARAM1,PARAM2,PARAM3=JJJ
1:
PARAM1
2:
PARAM2
3:
PARAM3
; End of macro definition.
MAC
; Listing expansion.
235
* PARAMETER 3:
JJJ
ENDM
LIST
MAC
; EDIT=ON
; Appending a string.
PARAM
ABC_PARAM_DEFG
; Concatenation off at call time.
; End of macro definition.
; List expansion.
; Macro call.
1
ABC1DEFG
S231450
237
These two exceptions allow you to specify parameters in the place of registers
and expressions for an opdef definition.
The syntax defining a register_parameter and an expression_parameter is
case-sensitive. Every character that identifies the parameter in the opdef
prototype statement must be identical to every character in the body of the
opdef definition. This includes the case (uppercase, lowercase, or mixed case) of
each character.
Because the opdef can accept arguments in many forms, it can be more flexible
than a macro. Opdefs place a greater responsibility for parsing arguments on the
assembler. When a macro is specified, the responsibility for parsing arguments
is placed on the user in many cases. Parsing a macro argument can involve
numerous micro substitutions, which greatly increase the number of statements
required to perform a similar operation with an opdef.
Defined sequences (macros, opdefs, dups, and echos) are costly in terms of
assembler efficiency. As the number of statements in a defined sequence
increases, the speed of the assembler decreases. This decrease in speed is directly
related to the number of statements expanded and the number of times a defined
sequence is called.
Limiting the number of statements in a defined sequence improves the
performance of the assembler. In some cases, an opdef can perform the same
operation as a macro and use fewer statements in the process.
The following example illustrates that an opdef can accept many different kinds
of arguments from the opdef call:
MANYCALL
OPDEF
A.REG1
A.REG2|A.REG3
; Opdef prototype statement.
S1
A.REG2
S2
A.REG3
A.REG1
S3
; OR of registers S1 and S2.
MANYCALL
ENDM
; End of opdef definition.
The following example illustrates the calls and expansions of the previous
example:
A1
S1
S2
S3
A.1
A.1
238
A2|A3
A.2
A.3
S1|S2
S3
A.2|A.3
S1
S2
S3
A.1
ONE
=
TWO
=
THREE =
A.ONE
S1
S2
S3
A.ONE
A1
S1
S2
S3
A.1
A.2
A.3
S1|S2
S3
1
2
3
A.TWO|A.THREE
A.2
A.3
S1|S2
S3
A.2|A.THREE
A.2
A.3
S1|S2
s3
In the first and second calls to opdef MANYCALL, the arguments passed to
REG1, REG2, and REG3 are 1, 2, and 3, respectively. In the third call to opdef
MANYCALL, the arguments passed to REG1, REG2, and REG3 are ONE, TWO, and
THREE, respectively. The fourth call to opdef MANYCALL demonstrates that the
form of the arguments can vary within one call to an opdef if they take a valid
form. The arguments passed to REG1, REG2, and REG3 in the fourth call are 1,
2, and THREE, respectively.
The following example illustrates how to use an opdef to limit the number of
statements required in a defined sequence:
$IF
S231450
MACRO
$IF
.
.
.
ENDM
.
.
.
$IF
.
.
.
$ELSE
.
S6,EQ,S.3
; Macro call.
239
.
.
$ENDIF
Parsing the parameters (S6,EQ,S3) passed to the definition requires many micro
substitutions within the definition body. These micros increase the number of
statements within the definition body.
The same function is performed in the following example, but an opdef is
specified instead of a macro. In this instance, specifying an opdef rather than a
macro reduces the number of statements required for the function.
Because an opdef is called by its form, it is more flexible than a macro in
accepting arguments. The opdef expects to be passed two S registers and the EQ
mnemonic. You can specify the arguments for the registers in a number of ways
and still be recognized as S register arguments by the opdef.
opdef
example $if s.reg1,eq,s.reg2 ; Opdef definition statement.
_* Register1: reg1
_* Register2: reg2
example endm
; End of opdef definition.
list mac
; Listing expansion.
The following are the calls and expansions of the preceding example:
$if
* Register1:
* Register2:
s6,eq,s.3
6
3
opdef
S231450
example
s.reg
a.reg
endm
list
@exp
@exp
mac
;
;
;
;
Prototype statement.
New machine instruction.
End of opdef definition.
Listing expansion.
The following are the calls and expansions of the preceding example:
s1
a.1
2
2
; Opdef call.
; New machine instruction.
OPDEF
[loc]
defsynres
LOCAL
defsynop
[name][,[name]]
.
.
.
name
S231450
ENDM
241
S231450
<<
>>
<=
>=
register-ending
The optional register-ending is specified using the following syntax form:
register [register-expression-separator register-or-expression]
The register and register-expression-separator elements are described previously
under initial-register.
The optional register-or-expression can be a register or an expression. If register
is not specified, expression is required. If expression is not specified, register is
required.
expression has been redefined for the opdef prototype statement, as
expression-parameter. expression-parameter is an identifier that must begin with the
at symbol (@). The @ can be followed by 0 to 7 identifier characters.
expression-ending
expression-ending is specified as follows:
S231450
243
expression [register_
expression_separator [register-or-expression]
expression is required and has been redefined for the opdef prototype statement
as follows:
expression-parameter
expression-parameter is an identifier that must begin with the at symbol (@). The @
can be followed by 0 to 7 identifier characters.
register_expression-separator is defined above.
The optional register-or-expression can be a register or an expression. If register
is not specified, expression is required. If expression is not specified, register is
required.
A mnemonic is a 1- to 8-character identifier that must begin with a letter (A
through Z or a through z), a decimal digit (0 through 9), or one of the following
characters: $, %, &, ,*, +, -, ., /, :, =, ?,, , |, or ~. Optional characters 2
through 8 can be the at symbol (@) or any of the previously mentioned characters.
Mnemonics are case-insensitive.
Initial-expression specifies an initial-expression on the opdef prototype statement,
use one of the following syntax forms for initial-expressions:
prefixl [expression-prefix] expression [expression-separator [register-ending]]
[prefix] [expression-prefix] expression [expression-separator [expression-ending]]
expression [expression-separator [register-ending]]
expression [expression-separator [expression-ending]]
The elements of the initial expression are described as follows:
prefix
prefix is optional and can be either a right parenthesis or a right bracket ([).
expression-prefix
expression-prefix is optional and can be any of the following:
<, >, #<, or #>
244
S231450
expression
expression is required and has been redefined for the opdef prototype statement,
as follows:
expression-parameter
expression-parameter is an identifier that must begin with the at symbol (@). The
@ can be followed from 0 to 7 identifier characters.
expression-separator
expression-separator is optional and can be one of the following:
), ], &, |, \, <, >, #<, or #>
callsynres
callsynop
The variables associated with the opdef call are described as follows:
S231450
245
locarg
locarg is an optional label field argument. It can consist of any characters and
is terminated by a space (embedded spaces are illegal).
If a label field parameter is specified on the opdef definition, a matching
label field parameter can be specified on the opdef call. locarg is substituted
wherever the label field parameter occurs in the definition. If no label field
parameter is specified in the definition, this field must be empty.
callsynres
callsynres specifies the result field syntax for the opdef call. It can consist of
one, two, or three subfields and must have the same syntax as specified in the
result field of the opdef definition prototype statement.
The syntax of the result field call is the same as the syntax of the result field
definition with two exceptions. The special syntax rules that are in effect for
registers and expressions on the opdef definition do not apply to the opdef
call. The syntax for registers and expressions used on the opdef call is the
same as the syntax for registers and expressions.
The subfields in the result field on the opdef call can be specified with one of
the following:
Initial-register
Mnemonic
Initial-expression
For a description of the syntax for the result field of the opdef call, see the
syntax for the result field of the opdef definition.
callsynop
callsynop specifies the operand field syntax for the opdef call. It can consist
of zero, one, two, or three subfields, and it must have the same syntax as
specified in the operand field of the opdef definition prototype statement.
The syntax of the operand field call is the same as the syntax of the operand
field definition with two exceptions. The special syntax rules that are in effect
for registers and expressions on the opdef definition do not apply to the opdef
call. The syntax for registers and expressions used on the opdef call is the
same as the syntax for registers and expressions.
The subfields in the operand field on the opdef call can be specified with
one of the following:
246
S231450
Initial-register
Mnemonic
Initial-expression
For a description of the syntax for the operand field of the opdef call, see
the syntax for the result field of the opdef definition.
The following rules apply for opdef calls:
The character strings callsynres and callsynop must be exactly as specified in
the opdef definition.
An expression must appear whenever an expression in the form @ exp
is indicated in the prototype statement. The actual argument string is
substituted in the definition sequence wherever the corresponding formal
parameter @ exp occurs.
The actual argument string consisting of a complex-register mnemonic
followed by a period (.) followed by a register-parameter. A register-designator
followed by a register-parameter must appear wherever the register-designator
A. register-parameter, B. register-parameter, SB. register-parameter, S.
register-parameter, T. register-parameter, ST. register-parameter, SM.
register-parameter, or V. register-parameter, respectively, appeared in the
prototype statement.
If the register-parameter is of the form octal-integer, the actual argument is
the octal-integer part. The octal-integer is restricted to 4 octal digits.
If the register-parameter is of the form . integer-constant or . symbol, the
actual argument is an integer-constant or a symbol.
The following opdef definition shows a scalar floating-point divide sequence:
fdv
opdef
s.r1
errif
errif
s.r1
s.r2
s.r3
s.r1
endm
fdv
S231450
247
The following example illustrates the opdef call and expansion of the preceding
example:
a
s4
errif
errif
s.4
s.3
s.2
s.4
s3/fs2
4,eq,3
4,eq,2
/hs.2
s.3*fs.4
s.2*is.4
s.3*fs.2
The following opdef definition, call, and expansion define a conditional jump
where a jump occurs if the A register values are equal:
JEQ
L
L
_*
JEQ
OPDEF
JEQ
A0
JAZ
ENDM
LIST
A.A1,A.A2,@TAG
A_A1-A_A2
@TAG
MAC
The following example illustrates the opdef call and expansion of the preceding
example (the expansion starts on line 2.):
JEQ
A0
JAZ
A3,A6,GO
A3-A5
GO
; Opdef call.
; Expression is expected.
The opdef in the following example illustrates how an opdef can redefine an
existing machine instruction:
EXAMPLE
EXAMPLE
OPDEF
S.REG
A.REG
ENDM
LIST MAC
The following example illustrates the opdef call and expansion of the preceding
example:
S1 2
A.1 2
248
; Opdef call.
; New instruction.
S231450
;
;
;
;
;
The following example illustrates the opdef call and expansion of the preceding
example:
=
s1 s2
*
s.2 s.1
; Opdef call.
; Left-shift if lbl is left off.
; Register s2 gets register s1.
The label field parameter was omitted on the opdef call in the previous example.
The result and operand fields of the first line of the expansion were shifted
left three character positions because a null argument was substituted for the
3-character parameter, lbl.
If the old format is used, only one space appears between the label field
parameter and result field in the macro definition. If a null argument is
substituted for the location parameter, the result field is shifted into the label
field in column 2. Therefore, at least two spaces should always appear between
a parameter in the label field and the first character in the result field in a
definition.
If the new format is used, the result field is never shifted into the label field.
The following example illustrates the case insensitivity of the register and
register-prefix:
CASE
CASE
OPDEF
S1
.
.
.
ENDM
#Pa2
; Prototype statement.
The following example illustrates the opdef calls of the preceding example:
S1
S1
S231450
#pa2
#Pa2
; Recognized by CASE.
; Recognized by CASE.
249
S1
S1
s1
s1
s1
s1
#pA2
#PA2
#pa2
#Pa2
#pA2
#PA2
;
;
;
;
;
;
Recognized
Recognized
Recognized
Recognized
Recognized
Recognized
by
by
by
by
by
by
CASE.
CASE.
CASE.
CASE.
CASE.
CASE.
DUP
expression[,[count]]
The variables associated with the DUP pseudo instruction are described as
follows:
dupname
dupname specifies an optional name for the dup sequence. It is required if
the count field is null or missing. If no count field is present, dupname must
match an ENDDUP name. The sequence field in the DUP pseudo instruction
itself represents the nested dup level and appears in columns 89 and 90
on the listing. For a description of sequence field nest level numbering,
see Section 9.1, page 216.
250
S231450
The dupname variable must meet the requirements for names as described in
Section 6.3, page 76.
expression
expression is an absolute expression with a positive value that specifies the
number of times to repeat the code sequence. All symbols, if any, must
be defined previously. If the current base is mixed, octal is used for the
expression. If the value is 0, the code is skipped. You can use a STOPDUP
to override the given expression.
The expression operand must meet the requirements for expressions as
described in Section 6.9, page 94.
count
count is an optional absolute expression with positive value that specifies the
number of statements to be duplicated. All symbols (if any) must be defined
previously. If the current base is mixed, octal is used for the expression.
LOCAL pseudo instructions and comment statements (* in column 1) are
ignored for the purpose of this count. Statements are counted before
expansion of nested macro or opdef calls, and dup or echo sequences.
The count operand must meet the requirements for expressions as described in
Section 6.9, page 94.
In the following example, the code sequence following the DUP pseudo
instruction will be repeated 3 times. There are 5 statements in the sequence.
DUP
3,5
LOCAL
SYM1,SYM2
; LOCAL pseudo instruction not counted.
*Asterisk comment; not counted
S1
1
; First statement is definition.
*Asterisk comment; not counted
INCLUDE ALPHA
; INCLUDE pseudo instruction not
; counted.
S231450
;
;
;
;
;
251
In the following example, the two con pseudo instructions are duplicated three
times immediately following the definition:
example
example
list
dup
con
con
enddup
dup
3
1
2
; Definition.
1
2
1
2
1
2
252
ECHO
[name=argument],[[name=]argument]
S231450
The variables associated with the ECHO pseudo instruction are described as
follows:
dupname
dupname specifies the required name of the echo sequence. It must match the
label field name in the ENDDUP instruction that terminates the echo sequence.
dupname must meet the requirements for names as described in Section 6.3,
page 76.
name
name specifies the formal parameter name. It must be unique. There can be
none, one, or more formal parameters. name must meet the requirements for
names as described in Section 6.3, page 76.
argument
argument specifies a list of actual arguments. The list can be one argument or
a parenthesized list of arguments.
A single argument is any ASCII character up to but not including the element
separator, a space, a tab (new format only), or a semicolon (new format only).
The first character cannot be a left parenthesis.
A parenthesized list can be a list of one or more actual arguments. Each actual
argument can be one of the following:
An ASCII character string can contain embedded arguments. If, however,
an ASCII string is intended, the first character in the string cannot be a left
parenthesis. A legal ASCII string is 4(5). An illegal ASCII string is (5)4(5).
A null argument; an empty ASCII character string.
An embedded argument that contains a list of arguments enclosed in
matching parentheses. An embedded argument can contain blanks or
commas and matched pairs of parentheses. The outermost parentheses are
always stripped from an embedded argument when an echo definition
is expanded.
An embedded argument must meet the requirements for embedded arguments
as described in page 218.
In the following example, the ECHO pseudo instruction is expanded twice
immediately following the definition:
EXAMPLE
S231450
LIST
ECHO
DUP
PARAM1=(1,3),PARAM2=(2,4)
253
CON
CON
EXAMPLE
; Definition.
PARAM1
; Gets 1 and 3.
PARAM2
; Gets 2 and 4.
ENDDUP
1
2
3
3
4
;
;
;
;
;
Gets
Gets
Gets
Gets
Gets
1
2
1
1
2
and
and
and
and
and
3.
4.
3.
3.
4.
list
echo
dup
param1=,param2=()
; ECHO with two null parameters.
param1
param2
_*Parameter 1 is:
_*Parameter 2 is:
example enddup
ENDM
ignored
S231450
The func variable associated with the ENDM pseudo instruction identifies the
name of the macro or opdef definition sequence. It must be a valid identifier or
the equal sign. func must match the name that appears in the result field of the
macro prototype or the label field name in an OPDEF instruction.
If the ENDM pseudo instruction is encountered within a definition but func does
not match the name of an opdef or the name of a macro, the ENDM instruction
is defined and does not terminate the opdef or macro definition in which it is
found. func must meet the requirements for functionals.
EXITM
ignored
255
alpha
*First comment
exitm
; Macro call
The dupname variable associated with the ENDDUP pseudo instruction specifies
the required name of a dup sequence. dupname must meet the requirements for
names as described in Section 6.3, page 76.
256
S231450
You can specify the NEXTDUP pseudo instruction anywhere within a program
segment. If the NEXTDUP pseudo instruction is found within a definition,
it is defined and is not recognized as a pseudo instruction. If the NEXTDUP
pseudo instruction is found within a skipping sequence, it is skipped and is
not recognized as a pseudo.
The format of the NEXTDUP pseudo instruction is as follows:
[dupname]
NEXTDUP
ignored
The optional dupname variable specifies the name of a dup sequence. If the name
is present but does not match any existing duplication expansion, a caution-level
listing message is issued and the pseudo instruction does nothing. If the name is
not present and a duplication expansion does not currently exist, a caution-level
listing message is issued and the pseudo instruction does nothing.
S231450
257
STOPDUP
ignored
The dupname variable associated with the STOPDUP pseudo instruction specifies
the name of a dup sequence. If the name is present but does not match any
existing duplication expansion, or, if the name is not present and a duplication
expansion does not currently exist, a caution-level listing message is issued and
the pseudo instruction does nothing. dupname must meet the requirements for
names as described in Section 6.3, page 76.
The following example uses a DUP pseudo instruction to define an array with
values 0, 1, and 2:
S
=
DUP
CON
W*
3,1
W.*-S
W.*-S
W.*-S
W.*-S
In the following example the ECHO and DUP pseudo instructions define a nested
duplication:
ECHO
I
DUPI
JK
DUPJK
JK
DUPJK
I
DUPI
ECHO
ECHO
SET
DUP
SET
DUP
RI.I
SET
ENDDUP
SET
ENDDUP
ENDDUP
RI=(A,S),RJK=(B,T)
0
8
0
64
RJK.JK
JK+1
I+1
258
S231450
A.0
.
.
.
A.0
.
.
.
A.1
.
.
.
A.7
S.0
.
.
.
S.0
.
.
.
S.8
B.0
.
.
.
B.64
.
.
.
B.0
.
.
.
B.64
T.O
.
.
.
T.64
.
.
.
T.64
;
;
;
;
;
i is l to 7.
In the second expansion of the echo
pseudo instruction the S and T
parameters are used.
;
;
;
;
DUPJK and
series of
the S and
generated
LIST
SET
DUP
SET
IFE
STOPDUP
CON
ENDDUP
DUP
0
1000
T+1
T,EQ,3,1
SET
CON
SET
T+1
T
T+1
259
T
A
CON
T
SET
T+1
STOPDUP
S231450
LOCAL
[name][,[name]]
The name variable associated with the LOCAL pseudo instruction specifies formal
parameters that must be unique and will be rendered local to the definition. name
must meet the requirements for names as described in Section 6.3, page 76.
The following example demonstrates that all formal parameters must be unique:
MACRO
UNIQUE
LOCAL
.
.
.
UNIQUE
PARM2
PARM1,PARM2
.
.
.
ENDM
;
;
;
;
S231450
261
param1 =
param2 =
1
s1
param1
2
s2
param2
string endm
list
mac
The following example illustrates the call and expansion from the preceding
example:
string
%%262144 =
s1
%%131072 =
s2
; Macro call.
1
%%262144
; Register s1 gets the value defined by
; param1.
2
%%131072
; Register s2 gets the value defined by
; param2.
The call to the macro string generates unique strings for param1 (%%262144)
and for param2 (%%131072).
S231450
If the OPSYN pseudo instruction occurs within a definition, it is defined and is not
recognized as a pseudo instruction. If the OPSYN pseudo instruction is found
within a skipping sequence, it is skipped and is not recognized as a pseudo
instruction.
The format of the OPSYN pseudo instruction is as follows:
func1
OPSYN
[func2]
The func1 variable associated with the OPSYN pseudo instruction specifies a
required name. It must be a valid name. The name of a defined operation such as
a pseudo instruction or macro, or the equal sign. func 1 must not be blank and
must meet the requirements for names.
The func2 variable specifies an optional name. It must be the name of a defined
operation or the equal sign. If func 2 is blank, func 1 becomes a do-nothing
pseudo instruction.
In the following example, the macro definition includes the OPSYN pseudo
instruction that redefines the IDENT pseudo instruction:
IDENTT
OPSYN
MLEVEL
NAME
MACRO
IDENT
LIST
LIST
IDENT
IDENTT
ENDM
IDENT
ERROR ; Eliminates the warning error that is
; issued because the IDENT pseudo
; instruction is redefined.
NAME
LIS,OFF,NXRF
LIS,ON,XRF
; Processed if LIST=NAME on CAL control
; statement.
NAME
The following example illustrates the OPSYN call and expansion (The expansion
starts on line 2.):
S231450
IDENT
LIST
LIST
A
LIS,OFF,NXRF
LIS,ON,XRF
IDENTT
263
In the following example, the first macro illustrates that a functional can be
redefined many times:
first
second
macro
first
s1
s2
s3
endm
opsyn
third
opsyn
1
2
s1+2
first
; second is the same as first.
second
; third is the same as second.
The following example includes the opdef calls and expansions from the
preceding example:
first
s1
s2
s3
second
s1
s2
s3
third
s1
s2
s3
; Macro call.
1
2
s1+s2
s1
1
2
s1+s2
s1
1
2
s1+s2
In the following example, the functional EQU is defined to perform the same
operation as =:
EQU
264
OPSYN
;
;
;
;
;
;
EQU is defined to
perform the
operation that the
= pseudo
instruction
performs.
S231450
Cray specifies a calling convention that the CAL programmer must follow to
properly interface with Cray-provided libraries and compiler-generated code.
Note: (Deferred implementation) This appendix provides a brief overview
of the calling conventions. Publication of the complete calling conventions is
deferred.
To support the calling conventions, the assembler recognizes the following
symbolic register designators:
a.SP == a63
a.FP == a62
a.EA == a61
a.RA == a60
Register a.SP contains the stack pointer. It is always aligned to 8 bytes. The stack
grows from higher addresses to lower addresses, and a.SP contains the address
of the highest unused aligned Longword.
Register a.FP, contains the frame pointer. It is set from a.SP on entry to a
subprogram and replaced in a.SP on exit. The old value of a.FP is saved to the
new stack frame at offset -0x0 from the new a.FP.
Register a.EA, must contain the subprograms entry address on entry to a
subprogram. It is saved to the new stack frame at offset -0x8 from the new
a.FP.
Register a.RA must contain the subprogram calls return address on entry to a
subprogram. It is saved to the new stack frame at offset -0x10 from the new
a.FP.
Arguments are passed in a1:a16, s1:s16, and in memory at the end of the
callers stack frame, where an argument passing area of at least 128 bytes is
always allocated. The first sixteen argument words are passed in registers,
with floating-point value arguments in scalar registers and all others, including
arguments by reference, in address registers. Register arguments are not
compacted, so a subprogram expecting to receive an int, a float, and an
int would take them from a1, s2, and a3. Additional argument words
after the sixteenth must be passed in memory. Each argument occupies at
least a Longword. Arguments less than 64 bits wide are right-justified and
sign-extended.
S231450
265
Return values <= 128 bytes long are returned in registers. Scalar registers
beginning with s1 are used to return floating-point results. Other types <= 128
bytes long are returned in address registers beginning with a1. Return values >
128 bytes long are returned in a properly aligned memory area which is allocated
by the caller and whose address is passed as a "hidden" initial argument.
Mask register m0 must have all bits set on entry to and exit from a subprogram.
Subroutine callers can assume that a32-a58, a62 (a.FP), s32-s63, and m0
are preserved across the call.
The compilers can place useful information about the subprogram prior to its
instruction text, such as its name and source code location. The format of this
information is compiler-dependent.
MSP codes have additional conventions not described here. Vector functions, also
known as VFUNCTIONs, have alternative calling conventions.
266
S231450
(Deferred implementation)
S231450
267
NUL
000/00
SOH
001/01
STX
002/02
ETX
003/03
EOT
004/04
ENQ
005/05
ACK
006/06
BEL
007/07
BS
010/08
HT
011/09
LF
012/0A
VT
013/0B
FF
014/0C
CR
015/0D
SO
016/0E
SI
017/0F
DLE
020/10
DC1
021/11
DC2
022/12
DC3
023/13
DC4
024/14
NAK
025/15
SYN
026/16
S231450
269
Character
ETB
027/17
CAN
030/18
EM
031/19
SUB
032/1A
ESC
033/1B
FS
034/1C
GS
035/1D
RS
036/1E
US
037/1F
Space
040/20
041/21
"
042/22
043/23
044/24
045/25
&
046/26
047/27
050/28
051/29
052/2A
053/2B
054/2C
055/2D
056/2E
057/2F
060/30
061/31
062/32
270
S231450
Character
063/33
064/34
065/35
066/36
067/37
070/38
071/39
072/3A
073/3D
<
074/3C
075/3D
>
076/3E
077/3F
100/40
101/41
102/42
103/43
104/44
105/45
106/46
107/47
110/48
111/49
112/4A
113/4B
114/4C
115/4D
116/4E
S231450
271
Character
117/4F
120/50
121/51
122/52
123/53
124/54
125/55
126/56
127/57
130/58
131/59
132/5A
133/5B
134/5C
135/5D
136/5E
137/5F
140/69
141/61
142/62
143/63
144/64
145/65
146/66
147/67
150/68
151/69
152/6A
272
S231450
Character
153/6B
154/6C
155/6D
156/6E
157/6F
160/70
161/71
162/72
163/73
164/74
165/75
166/76
167/77
170/78
171/79
172/7A
173/7B
174/7C
175/7D
176/7E
DEL
177/7F
S231450
273
Glossary
absolute address
1. A unique, explicit identification of a memory location, a peripheral device, or
a location within a peripheral device. 2. A precise memory location that is an
actual address number rather than an expression from which the address can
be calculated. See also absolute memory address.
application node
A node that is used to run user applications. Application nodes are best suited
for executing parallel applications and are managed by the strong application
placement scheduling and gang scheduling mechanism psched. See also OS
node; support node.
argument
1. A value that determines the result or behavior of a software entity, such as
a program or function. 2. A character string in a command line that supplies
information for the preceding option. Sometimes called option-argument.
array
A data structure that contains a series of related data items arranged in rows and
columns for convenient access. The C shell and the awk(1) command can store
and process arrays. A Fortran array is a set of scalar data, all of the same type and
type parameters. The rank of an array is at least 1 and at most 7. Arrays may be
used as expression operands, procedure arguments, and function results, and
they may appear in input/output (I/O) lists.
assemble
To prepare a machine language program from a symbolic language program,
such as a Cray Assembly Language (CAL) program, by substituting machine
code for symbolic code, and absolute or relocatable addresses for symbolic
addresses. See also compiler and interpreter.
assembler
A computer program that creates a machine language program from a symbolic
language program. The assembler substitutes machine operation codes for
symbolic operation codes and substitutes absolute or relocatable addresses for
symbolic instructions. See also compiler and interpreter.
S231450
275
assembly language
A programming language that uses symbolic notation to represent machine
language instructions. It is a low-level language that is closely related to the
internal architecture of the computer on which it runs. See also high-level
programming language.
association
An association permits an entity to be referenced by different names in a scoping
unit or by the same or different names in different scoping units. Several kinds
of associations exist. The principal kinds of association are pointer association,
argument association, host association, use association, and storage association.
See also scoping unit.
atomic
Not interruptible. An atomic operation occurs as a logical unit.
barrier
An obstacle within a program that provides a mechanism for synchronizing
tasks. When a task encounters a barrier, it must wait until all specified tasks
reach the barrier.
big-endian
A format for storage or transmission of binary data in which the most significant
bit (or byte) has the lowest address (the word is stored big-end-first). The reverse
convention is little-endian.
cache
In a processing unit, a high-speed buffer that is continually updated to contain
recently accessed contents of memory. Its purpose is to reduce access time.
cache line
A division of cache. Each cache line can hold multiple data items. On the Cray
X1 system, a cache line is 32 bytes, which is the maximum size of a hardware
message.
276
S231450
Glossary
cache pollution
A delay that occurs when data that will not be used before it is evicted is loaded
into cache, potentially displacing more useful data.
CPU
Processor. See MSP and SSP.
deferred implementation
The label used to introduce information about a feature that will not be
implemented until a later release.
designator
Sometimes it is convenient to reference only part of an object, such as an element
or section of an array, a substring of a character string, or a component of a
structure. This requires the use of the name of the object followed by a selector
that selects a part of the object. A name followed by a selector is called a
designator.
distributed memory
1. Memory in which each processor has a separate share of the total memory. 2.
Memory that is physically distributed among several modules.
entry point
A location in a program or routine at which execution begins. A routine may
have several entry points, each serving a different purpose. Linkage between
program modules is performed when the linkage editor binds the external
references of one group of modules to the entry points of another module.
environment
1. The set of hardware and software products on which an application is being
run. 2. A set of values supported by the shell used to pass information between
processes (specifically, from parent to child).
environment variable
A variable that stores a string of characters for use by your shell and the
processes that execute under the shell. Some environment variables are
predefined by the shell, and others are defined by an application or user.
S231450
277
Shell-level environment variables let you specify the search path that the shell
uses to locate executable files, the shell prompt, and many other characteristics
of the operation of your shell. Most environment variables are described in the
ENVIRONMENT VARIABLES section of the man page for the affected command.
explicit communication
A programming style in which communication is language independent and in
which communication occurs through library calls. The message-passing and
explicit shared memory programming methods use products such as MPI or
SHMEM. See also implicit communication.
gather/scatter
An operation that copies data between remote and local memory or within
local memory. A gather is any software operation that copies a set of data
that is nonsequential in a remote (or local) processor, usually storing into a
sequential (contiguous) area of local processor memory. A scatter copies data
from a sequential, contiguous area of local processor memory) into nonsequential
locations in a remote (or local) memory.
implicit communication
A programming style in which most communication is recognized implicitly
by the compiler and run-time libraries from the Fortran source (including
directives). The data-sharing and work-sharing programming methods use
implicit communication. Also called global addressing or implicit shared
memory. See explicit communication.
load
To create a binary executable file (an executable) from a binary relocatable object
file (the object). This process adds library subprograms to the object and resolves
the external references among subprograms. Executable files and the libraries
and data they access are loaded into memory during the load step. Links are
created among modules that must access each other. The command that performs
a load is called a link-edit loader, or simply a loader.
loader
A generic term for the system software product that loads a compiled or
assembled program into memory and prepares it for execution.
278
S231450
Glossary
loader table
The form in which code is presented to the loader. Loader tables, which are
generated by compilers and assemblers according to loader requirements, contain
information required for loading. This information includes the type of code;
names, types, and lengths of storage blocks; data to be stored; and so on.
mask
A machine word that specifies the parts of another machine word on which to
operate. Bit masks are commonly used with the AND, OR, and exclusive OR
instructions.
mode
1. A method of operation (for example, binary mode). 2. The permissions for a
file (read, write, and execute for user, group,and other). The permissions mode is
referred to by either an octal number (absolute mode) or a sequence of characters
(relative mode). The mode is used in conjunction with chmod to change
permissions of files. 3. Processing mode (either background or foreground).
module file
A metafile that defines information specific to an application or collection of
applications. (This term is not related to the module statement of the Fortran
language; it is related to setting up the Cray X1 system environment.) For
example, to define the paths, command names, and other environment variables
to use the Cray Programming Environment, you use the module file PrgEnv,
which contains the base information needed for application compilations. The
module file mpt sets a number of environment variables needed for message
passing and data passing application development.
Modules
Note: This term is not related to the module statement of the Fortran language,
but is related to setting up the environment of the X1 system so a Cray product
can be used. A package on the Cray X1 system that allows you to dynamically
modify your user environment by using module files. The user interface to this
package is the module command. The module command provides a number
of capabilities to the user, including loading a module file, unloading a module
file, listing which module files are loaded, determining which module files are
available, and others. See also module file.
S231450
279
node
The configurable scalable building block for a Cray X1 mainframe. The actual
hardware contents of a node are housed in four multichip modules (MCMs). This
is the conceptual or software configuration view of a hardware unit called a node
module. Physically, all nodes are the same; software controls how a node is used,
such as for an OS node, application node, or support node. See also application
node; MCM, MSP, node module; OS node; SSP; support node.
node module
The physical node in a Cray X1 system.
operator
1. A symbolic expression that indicates the action to be performed in an
expression; operator types include arithmetic, relational, and logical.
OS node
The node that provides kernel-level services, such as system calls, to all support
nodes and application nodes. See also application node; node; support node.
program counter
A hardware element that contains the address of the instruction currently
executing.
satisfy
A term used when describing adder operations. In an additive adder, 0 plus 0
equals 0; a 0 result in a bit position is a satisfy condition. It is so named because it
prevents a carry up from propagating further, thus satisfying it.
scalar instruction
An instruction that requires the use of a scalar, rather than a vector, register.
scalar processing
A form of fine-grain serial processing whereby iterative operations are performed
sequentially on the elements of an array, with each iteration producing one
result. Compare to vector processing .
280
S231450
Glossary
scalar register
The register that serves as source and destination for operands that use scalar
arithmetic and logical instructions.
scope
The region of a program in which a variable is defined and can be referenced.
scoping unit
Part of a program in which a name has a fixed meaning. A program unit or
subprogram generally defines a scoping unit. Type definitions and procedure
interface bodies also constitute scoping units. Scoping units do not overlap,
although one scoping unit may contain another in the sense that it surrounds it.
If a scoping unit contains another scoping unit, the outer scoping unit is referred
to as the host scoping unit of the inner scoping unit.
shift
A basic mathematical operation that moves data right or left within a register or
between two registers.
SHMEM
A library of optimized functions and subroutines that take advantage of shared
memory to move data between the memories of processors. The routines can
either be used by themselves or in conjunction with another programming style
such as Message Passing Interface.
stack
1. A data structure that provides a dynamic, sequential data list that can be
accessed from either end; a last-in, first-out (push-down, pop-up) stack is
accessed from just one end. 2. The call stack consists of stack frames that hold
return locations for called routines, routine arguments, local variables, and
saved registers.
stack frame
An element of a stack that contains local variables, arguments, contents of the
registers used by an individual routine, a frame pointer that points to the
previous stack frame, and the value of the program counter at the time the
routine was called. A stack frame is allocated when a reentrant subroutine
is entered; it is deallocated on exit.
S231450
281
stride
The relationship between the layout of an arrays elements in memory and
the order in which those elements are accessed. A stride of 1 means that
memory-adjacent array elements are accessed on successive iterations of an
array-processing loop.
support node
The node that is used to run serial commands, such as shells, editors, and other
user commands (ls, for example). See also application node; OS node; node; support
node.
symbol table
A table of symbolic names (for example, variables) used in a program to store
their memory locations. The symbol table is part of the executable object
generated by the compiler. Debuggers use it to help analyze the program.
type
A means for categorizing data. Each intrinsic and user-defined data type has
four characteristics: a name, a set of values, a set of operators, and a means to
represent constant values of the type in a program.
UNICOS
The operating system for Cray SV1 series systems.
UNICOS/mp
The operating system for Cray X1 systems.
vector
An array, or a subset of an array, on which a computer operates. When
arithmetic, logical, or memory operations are applied to vectors, it is referred to
as vector processing.
vector instruction
An instruction that operates on a series of elements by repeating the same
function and producing a series of results; eliminates instruction startup time
for all of the operands but the first.
282
S231450
Glossary
vector length
The number of elements in a vector.
vector length register
A register that holds the number of elements of a vector register that are required
for an operation.
vector processing
A technique whereby operations are performed simultaneously on the elements
of an array instead of iteratively. Compare to scalar processing.
virtual address
The apparent location of a data element, such as the name of a variable or
an array element, as referenced by a users program during a read or write
operation. The hardware translates a virtual address into a physical address,
which is the actual location in the machine memory.
S231450
283
Index
A
$APP
Editing, 98
Append, 99
as
command line options
-b, 48
-B, 48
-D, 49
-o, 52
command-line options, 47
Assembler
command line, 47
cross-reference listing format,
Diagnostic messages, 62
Error messages, 62
Source statement listing, 58
Asterisk character (*), 100
60
B
Binary definition files
macros in, 64
micros in, 65
opdefs in, 65
opsyns in, 65
symbols in, 64
using
multiple references to a definition, 5557
Binary Definition files
using
multiple references to a definition, 55
C
CAL program
program segment, 42
program module, 41
CAL syntax
new format
S231450
comment field, 69
label field, 68
operand field, 68
result field, 68
Case sensitivity, 70
Character set, 269
Circumflex character (^), 99
$CMNT
Editing, 98
$CNC
Editing, 98
Comma character (,), 99
Comment, 100
Comment field
New format, 69
Concatenate, 99
Concatenation, 97
Continuation, 99
Counters
location, 93, 176
origin, 93, 176
word-bit-position, 93, 176
Cray Assembly Language (CAL), 1
D
Data
types
constant, 78, 80, 82
constants, 78
literals, 85
Data items, 82
character, 84
floating, 83
integer, 84
Defined sequences
definition format, 217
definition of, 215
Duplicate with varying argument,
252
285
duplication, 250
editing, 216
ending duplicated code, 256
Ending macros and operation definitions, 254
formal parameters, 218
INCLUDE pseudo, 221
instruction calls, 219
LOCAL pseudo, 260
macro calls, 227
macro definition, 222
OPDEF calls, 245
OPDEF definition, 241
operation definitions, 237
premature exit from a macro expansion, 255
premature exit from code duplication, 256
similarities among, 216
stopping duplication, 257
synonymous operations, 262
types, 215
Duplication, 250
E
Editing
$APP, 98
$CMNT, 98
$CNC, 98
$MIC, 98
micro substitution, 99
statements, 97
concatenation, 97
micro substitution, 97
Environment variables
LPP, 53
TARGET, 53
TMPDIR, 53
L
Label field
new format, 68
Line continuation, 99
Listings
lines per page control, 53
286
156
S231450
Index
O
OPDEF calls, 245
OPDEF definition, 241
Operand field
new format, 68
Operation definitions (OPDEF), 237
Origin counter, 93, 176
P
Pseudo instructions
=, 103
= or equate, 36
ALIGN, 35, 104
BASE, 35, 104
BITW, 35, 106
BSS, 35, 107
BSSZ, 37, 108
case sensitivity, 33
classes, 33
CMICRO, 38, 108
COMMENT, 34, 110
CON, 37, 111
conditional assembly, 37
DATA, 37, 112
data definition, 36
DBSM, 36, 115
DECMIC, 38, 116
defined sequences, 215
Defined sequences of code
MACRO, 221
DMSG, 36, 118
DUP, 39, 119, 215, 221, 250
ECHO, 39, 119, 215, 221, 252
EDIT, 35, 120
EJECT, 36, 120
ELSE, 37, 121
END, 34, 122
ENDDUP, 39, 124, 215, 256
ENDIF, 37, 124
ENDM, 39, 124, 215, 254
ENDTEXT, 36, 125
ENTRY, 34, 126
S231450
287
288
main, 173
stack buffer, 174
types, 44
Semicolon character (;), 100
Source statements
editing, 97
Statements
actual and edited, 100
Symbols, 70
attributes, 74
redefinable, 76
relative, 74
definition, 73
qualification, 71
qualified, 72
reference, 76
unqualified, 71
U
Underscore character,
99
W
Word boundary
forcing a, 94, 177
Word-bit-position counter,
93, 176
S231450