Asmg 1020
Asmg 1020
General Information
Release 6
GC26-4943-05
High Level Assembler for z/OS & z/VM & z/VSE
General Information
Release 6
GC26-4943-05
Note!
Before using this information and the product it supports, be sure to read the general
information under “Notices” on page 87.
This book is designed to help you evaluate High Level Assembler for your data
processing operation and to plan for its use.
v Appendix B, “System variable symbols,” lists and describes the system variable
symbols provided by High Level Assembler.
v Appendix C, “Hardware and software requirements,” provides information
about the operating system environments in which High Level Assembler will
operate.
v The Bibliography lists other IBM publications which may serve as a useful
reference to this book.
z/OS
z/VM
z/VSE
Hardcopy Publications
The books in the High Level Assembler library are shown in Table 1. This figure
shows which books can help you with specific tasks, such as application
programming.
Table 1. IBM High Level Assembler for z/OS & z/VM & z/VSE Publications
Task Publication Order Number
Evaluation and Planning HLASM V1R6 General GC26-4943
Information
Installation and HLASM V1R6 Installation SC26-3494
Customization and Customization Guide
HLASM V1R6 Programmer’s SC26-4941
Guide
HLASM V1R6 Toolkit GC26-8711
Feature Installation Guide
Table 1. IBM High Level Assembler for z/OS & z/VM & z/VSE Publications (continued)
Task Publication Order Number
Application HLASM V1R6 Programmer’s SC26-4941
Programming Guide
HLASM V1R6 Language SC26-4940
Reference
HLASM V1R6 General GC26-4943
Information
HLASM V1R6 Toolkit GC26-8710
Feature User’s Guide
HLASM V1R6 Toolkit GC26-8709
Feature Interactive Debug
Facility User’s Guide
Diagnosis HLASM V1R6 Installation SC26-3494
and Customization Guide
Warranty HLASM V1R6 Licensed GC26-4944
Program Specifications
Online publications
The High Level Assembler publications are available in the following softcopy
formats:
v z/OS Collection CD-ROM: SK3T-4269 (Book), SK3T-8334 (PDF)
v z/VM Collection CD-ROM: SK2T-2401 (Book), SK3T-8330 (PDF)
v z/VSE Collection CD-ROM: SK2T-2402 (Book), SK3T-8331 (PDF)
For more information about High Level Assembler, see the High Level Assembler
web site, at
http://www-306.ibm.com/software/awdtools/hlasm/
Mnemonic tagging
v Suffix tags for instruction mnemonics let you use identically-named macro
instructions and machine instructions in the same source program.
New features
v High Level Assembler for Linux™ on System z™
New options
v WORKFILE
Services Interface
v HLASM Services Interface for I/O exits added
Miscellany
v Qualifiers identified in symbol cross-reference.
Language compatibility
The assembler language supported by High Level Assembler has functional
extensions to the languages supported by Assembler H Version 2 and DOS/VSE
Assembler. High Level Assembler uses the same language syntax, function,
operation, and structure as these earlier assemblers. The functions provided by the
Assembler H Version 2 macro facility are all provided by High Level Assembler.
With the exception of these possible conflicts, and with appropriate High Level
Assembler option values, assembler language source programs written for
Assembler H Version 2 or DOS/VSE Assembler, that assemble without warning or
error diagnostic messages, should assemble correctly using High Level Assembler.
High Level Assembler, like its predecessor Assembler H Version 2, can assemble
source programs that use the following machine instructions:
v S/370™
v System/370 Extended Architecture (370-XA)
v Enterprise Systems Architecture/370™ (ESA/370)
v Enterprise Systems Architecture/390 (ESA/390)
v z/Architecture™
The set of machine instructions that you can use in an assembler source program
depend upon which operation code table you use for the assembly.
v A new associated data file, the ADATA file, containing both language-dependent
and language-independent records that can be used by debugging and other
tools
v A DOS operation code table to assist in migration from DOS/VSE Assembler
v The use of 31-bit addressing for most working storage requirements
v A generalized object format data set
v Internal performance enhancements and diagnostic capabilities
This book contains a summary of information designed to help you evaluate the
High Level Assembler licensed product. For more detailed information, see
HLASM Programmer’s Guide and HLASM Language Reference.
“Generalized object format modules (z/OS and CMS)” on page 11. The
linkage conventions for the symbol are established using this instruction.
Two new operands are provided for the EQU instruction, a program-type
operand, and an assembler-type operand.
ISEQ instruction:
Sequence checking of any column on input records is allowed.
OPSYN instruction:
You can code OPSYN instructions anywhere in your source module.
ORG instruction:
Two new operands are provided for the ORG statement that will specify
the boundary and offset to be used to set the location counter.
The BOUNDARY operand is an absolute expression that must be a power
of 2 with a range from 8 (doubleword) to 4096 (page).
The OFFSET operand is any absolute expression.
If BOUNDARY and/or OFFSET are used, then the resultant location
counter will be calculated by rounding the expression up to the next
higher BOUNDARY and then adding the OFFSET value.
POP instruction:
An additional operand, NOPRINT, can be specified with the POP
instruction to cause the assembler to suppress the printing of the specified
POP statement. The operand ACONTROL saves the ACONTROL status.
PRINT instruction:
Seven additional operands can be specified with the PRINT instruction.
They are:
MCALL | NOMCALL
The MCALL operand instructs the assembler to print nested macro
call instructions.
The NOMCALL operand suppresses the printing of nested macro
call instructions.
MSOURCE | NOMSOURCE
The MSOURCE operand causes the assembler to print the source
statements generated during macro processing, as well as the
assembled addresses and generated object code of the statements.
The NOMSOURCE operand suppresses the printing of the
generated source statements, but does not suppress the printing of
the assembled addresses and generated object code.
UHEAD | NOUHEAD
The UHEAD operand causes the assembler to print a summary of
active USINGs following the TITLE line on each page of the source
and object program section of the assembler listing.
The NOUHEAD operand suppresses the printing of this summary.
NOPRINT
The NOPRINT operand causes the assembler to suppress the
printing of the PRINT statement that is specified.
The assembler has changed the way generated object code is printed in the
assembler listing when the PRINT NOGEN instruction is used. Now the
object code for the first generated instruction, or the first 8 bytes of
generated data is printed in the object code column of the listing on the
same line as the macro call instruction. The DC, DS, DXD, and CXD
instructions can cause the assembler to generate zeros as alignment data.
With PRINT NOGEN the generated alignment data is not printed in the
listing.
PUSH instruction:
An additional operand, NOPRINT, can be specified with the PUSH
instruction to cause the assembler to suppress the printing of the specified
PUSH statement. The operand ACONTROL restores the ACONTROL
status.
USING statements:
Labeled USINGs and dependent USINGs provide you with enhanced
control over the resolution of symbolic expressions into base-displacement
form with specific base registers. Dependent USINGs can be labeled or
unlabeled.
The end of range parameter lets you specify a range for the USING
statement, rather than accepting the default range. See “Labeled USINGs
and qualified symbols” on page 14 and “Dependent USINGs” on page 15.
In addition, all EBCDIC characters can be used in comments and remarks, and
anywhere that characters can appear between paired single quotation marks.
When the DBCS option is specified, High Level Assembler accepts double-byte
data as follows:
v Double-byte data, optionally mixed with single-byte data, is permitted in:
– The nominal value of character (C-type) constants and literals
– The value of character (C-type) self-defining terms
– The operand of MNOTE, PUNCH and TITLE statements
v Pure double-byte data is supported by:
– The pure DBCS (G-type) constant and literal
– The pure DBCS (G-type) self-defining term
Translation table
In addition to the standard EBCDIC set of characters, High Level Assembler can
use a user-specified translation table to convert the characters contained in
character (C-type) data constants (DCs) and literals. High Level Assembler
provides a translation table to convert the EBCDIC character set to the ASCII
character set. The assembler can also use a translation table supplied by the
programmer.
Unicode support
High Level Assembler can be used to create Unicode character constants. The
CODEPAGE option selects which codepage to use and the CU constant is used to
define the data that will be translated into the Unicode.
Blank lines
High Level Assembler allows blank lines to be used in the source program. In open
code, each blank line is treated as equivalent to a SPACE 1 statement. In the body
of a macro definition, each blank line is treated as equivalent to an ASPACE 1
statement.
Comment statements
A macro comment statement consists of a period in the begin column, followed by
an asterisk, followed by any character string. An open code comment consists of an
asterisk in the begin column followed by any character string.
High Level Assembler allows open code statements to use the macro comment
format, and processes them like an open code comment statement.
Mixed-case input
High Level Assembler allows mixed-case input statements, and maintains the case
when it produces the assembler listing. You can use the COMPAT and FOLD
assembler options to control how the assembler treats mixed-case input.
Continuation lines
You are allowed as many as nine continuation lines for most ordinary assembler
language statements. However, you are allowed to specify as many continuation
lines as you need for the following statements:
v Macro prototype statements
v Macro instruction statements
v The AIF, AGO, SETx, LCLx, and GBLx conditional assembly instructions.
When you specify the FLAG(CONT) assembler option, the assembler issues new
warning messages if it suspects that a continuation statement might be incorrect.
Symbol length
High Level Assembler supports three types of symbols:
Ordinary symbols
The format of an ordinary symbol consists of an alphabetic
character, followed by a maximum of 62 alphanumeric characters.
Variable symbols
The format of a variable symbol consists of an ampersand (&)
followed by an alphabetic character, followed by a maximum of 61
alphanumeric characters.
Sequence symbols
The format of a sequence symbol consists of a period (.) followed
by an alphabetic character, followed by a maximum of 61
alphanumeric characters.
External symbols are ordinary symbols used in the name field of START, CSECT,
RSECT, COM, DXD, and ALIAS statements, and in the operand field of ENTRY,
EXTRN, WXTRN, and ALIAS statements. Symbols used in V-type and Q-type
| address constants are restricted to 8 characters, unless the GOFF option is
| specified, which allows symbols up to 63 characters. You can specify an alias string
of up to 64 characters to represent an external symbol.
Underscore
High Level Assembler accepts the underscore character as alphabetic. It is accepted
in any position in any symbol name.
Literals
The following changes have been made to previous restrictions on the use of
literals:
v Literals can be used as relocatable terms in expressions. They no longer have to
be used as a complete operand.
v Literals can be used in RX-format instructions in which an index register is used.
For further details about this facility refer to DFSMS/MVS V1R4 Program
Management.
Use the RMODE instruction to specify the residence mode to be associated with
the control sections in the object program. The residence modes are:
24 Residence mode of 24. The control section must reside below the
16MB line.
You can specify the AMODE and RMODE instructions anywhere in the assembly
source. If the name field in either instruction is left blank, you must have an
unnamed control section in the assembly. These instructions do not initiate an
unnamed control section.
Note: The 64-bit addressing and residence modes are accepted and processed by
the assembler. However, other operating system components and utility
programs may not be able to accept and process information related to these
operands.
The format of the CCW0 and CCW1 instructions, like that of the CCW instruction,
consists of a name field, the operation, and an operand (that contains a command
code, data address, flags, and data count).
Using EXCP or EXCPVR access methods:
If you use the EXCP or EXCPVR access method, only CCW or
CCW0 is valid, because EXCP and EXCPVR do not support 31-bit
data addresses in channel command words.
Using RMODE ANY:
If you use RMODE ANY with CCW or CCW0, an invalid data
address in the channel command word can result at execution
time.
The read-only attribute in the object module shows which control sections are
read-only.
┌───────────────────────────┐
│ MAINCODE LOCTR │
│ • ├────────────────────────────┐
│ • │ │
└───────────────────────────┘ │
│
┌───────────────────────────┐ │
│ WORKAREA LOCTR │ Addresses follow │ Assembled with
│ XXX DC XXX ├─── combined sections ├─── consecutive
│ XXX DS XXX │ of MAINCODE │ addresses
└───────────────────────────┘ │
│
┌───────────────────────────┐ │
│ MAINCODE LOCTR │ │
│ • ├────────────────────────────┘
│ • │
└───────────────────────────┘
z/VSE
names of some of these items can appear in the external symbol dictionary (ESD)
of the assembler’s object module. Note that other products might not be able to
handle as many external symbols as the assembler can produce.
Many instructions can cause the initiation of an unnamed CSECT if they appear
before a START or CSECT statement. Unnamed CSECTs appear in the external
symbol dictionary with a type of PC.
Addressing extensions
High Level Assembler extends the means that you can use to establish
addressability of a control section with two powerful new facilities:
v Labeled USINGs and qualified symbols
v Dependent USINGs
Labeled USINGs provide you with enhanced control over the resolution of symbolic
expressions into base-displacement form with specific base registers. The assembler
uses a labeled USING when you qualify a symbol with the USING label. You
qualify a symbol by prefixing the symbol with the label on the USING followed by
a period.
The domain of a labeled USING instruction continues until the end of a source
module, except when:
v You specify the label in the operand of a subsequent DROP instruction.
v You specify the same label in a subsequent USING instruction.
Dependent USINGs
The format of the assembler USING instruction now lets you specify a relocatable
expression instead of a base register in the instruction operand. When you specify
a relocatable expression, it is known as the supporting base address, and the USING
is known as a dependent USING. If a valid ordinary symbol, or a variable symbol
that has been assigned a valid ordinary symbol, is specified in the name entry of a
dependent USING instruction, the USING is known as a labeled dependent USING.
Dependent USINGs provide you with further control over the resolution of
symbolic expressions into base-displacement form. With dependent USINGs you
can reduce the number of base registers you need for addressing by using an
existing base register to provide addressability to the symbolic address.
v If more than one ordinary USING gives the smallest displacement, the assembler
uses the higher-numbered register for assembling addresses within the
coinciding USING ranges.
The ACONTROL instruction lets you specify selected assembler options anywhere
through the assembler source program, rather than at the beginning of the source
(as provided by *PROCESS statements).
Options specified by the ACONTROL instruction take effect when the specifying
ACONTROL instruction is encountered during the assembly. An option specified
by an ACONTROL instruction may override an option specified at the start of the
assembly.
The assembler lists the options specified in process statements in the High Level
Assembler Option Summary section of the assembler listing.
Process statements are also shown as comment lines in the source and object section
of the assembler listing.
Either type of macro definition can be called from anywhere in the source module
by a macro instruction, however a source macro definition must occur before it is
first called.
You use a macro prototype statement to define the name of the macro and the
symbolic parameters you can pass it from a macro instruction.
The assembler assigns attribute values to the ordinary symbols and variable
symbols that represent data. By referencing the data attributes of these symbols, or
by varying the values assigned to these symbols, you can control the logic of the
macro processing, and, in turn, control the sequence and contents of generated
statements.
The assembler replaces the macro call with the statements generated from the
macro definition. The generated statements are then processed like open code
source statements.
z/VSE
“Reading edited macros (VSE only)” on page 39 describes how you can use a
LIBRARY exit to allow High Level Assembler to read edited macros.
End of z/VSE
Redefining macros
You can redefine a macro definition at any point in your source module. When a
macro is redefined, the new definition is effective for all subsequent macro
instructions that call it.
You can save the function of the original macro definition by using the OPSYN
instruction before you redefine the macro. If you want to reestablish the initial
function of the operation code, you can include another OPSYN instruction to
redefine it. The following example shows this:
Name Operation Operand Comment
MACRO
MAC1 , The symbol MAC1 is assigned as the
name of this macro definition.
.
.
.
MEND
.
.
.
MAC2 OPSYN MAC1 MAC2 is assigned as an alias for MAC1.
MACRO
MAC1 , MAC1 is assigned as the name of this
new macro definition.
.
.
.
MEND
.
.
.
MAC1 OPSYN MAC2 MAC1 is assigned to the first
definition. The second
definition is lost.
You can issue a conditional assembly branch (AGO or AIF) to a point before the
initial definition of the macro and reestablish a previous source macro definition.
Then that definition will be edited and effective for subsequent macro instructions
calling it.
┌─────────────┐
│ MACRO │
│ MAC1 ├─────────────────────────────────────┐
│ • │ │
└─────────────┘ │
┌─────────────┐ │
│ MACRO │ │
│ MAC2 ├──────────────────┐ │
│ • │ │ │
└─────────────┘ │ │
┌─────────────┐ │ │
│ MACRO │ │ │
│ MAC3 │ │ │
│ • │ Edited when │ Edited when │ Edited when
│ • ├── MAC2 is called ├── MAC1 is called ├── definition first
│ • │ and generated │ and generated │ encountered
│ • │ │ │
│ MEND │ │ │
└─────────────┘ │ │
┌─────────────┐ │ │
│ • ├──────────────────┘ │
│ MEND │ │
└─────────────┘ │
┌─────────────┐ │
│ • ├─────────────────────────────────────┘
│ MEND │
└─────────────┘
First MAC1 is edited, and MAC2 and MAC3 are not. When MAC1 is called, MAC2 is edited
(unless its definition is bypassed by an AIF or AGO branch); when MAC2 is called,
MAC3 is edited. No macro can be called until it has been edited.
There is no limit to the number of nestings allowed for inner macro definitions.
The depth of this nesting is limited only by the constraint that the total length of
| an individual operand cannot exceed 1024 characters.
Sublists may also be assigned to SETC symbols and used in macro instruction
operands. However, if you specify the COMPAT(SYSLIST) assembler option, the
assembler treats sublists in SETC symbols as character strings, not sublists, when
used in the operand of macro instructions.
• 2 MACRO
• MAC
• •
1 MAC •
4 JOHN L. SMITH ────┤3 &S AREAD
│ •
│ •
│ MEND
│
│
The macro instruction MAC (1) causes the macro MAC (2) to be called. When the
AREAD instruction (3) is encountered, the next sequential record (4) following
the macro instruction is read and assigned to the SETC symbol &S (5).
When macro instructions are nested, the records read by AREAD must always
follow the outermost macro instruction regardless of the level of nesting in which
the AREAD instruction is found.
If the macro instruction is found in code brought in by the COPY instruction (copy
code), the records read by the AREAD instruction can also be in the copy code. If
no more records exist in the copy code, subsequent records are read from the
ordinary input stream.
Records that are read in by the AREAD instruction are not checked by the
assembler. Therefore, no diagnostic is issued if your AREAD statements read
records that are meant to be part of your source program. For example, if an
AREAD statement is processed immediately before the END instruction, the END
instruction is lost to the assembler.
For example, you can use AREAD and PUNCH to write simple conversion
programs. The following macro interchanges the left and right halves of records
placed immediately after a macro instruction calling it. End-of-input is indicated
with the word FINISHED in the first columns of the last record in the input to the
macro.
Name Operation Operand
MACRO
SWAP
.loop ANOP
&CARD AREAD
AIF (’&CARD’(1,8) EQ ’FINISHED’).MEND
&CARD SETC ’&CARD’(41,40).’&CARD’(1,40)
PUNCH ’&CARD’
AGO .LOOP
.MEND MEND
The assembler calls the external function load module, and passes it the address of
an external function parameter list. Each differently named external function called
in the same assembly is provided with a separate parameter list.
SETAF instruction:
You use the SETAF instruction to pass parameters containing arithmetic
values to the external function module. The symbol in the name field of
the instruction is assigned the fullword integer value returned by the
external function module.
SETCF instruction:
You use the SETCF instruction to pass parameters containing character
values to the external function module. The symbol in the name field of
the instruction is assigned the character string value returned by the
external function module. The length of the returned character string can
be from 0 to 255 bytes.
Built-in functions
The assembler provides you with many built-in functions that you can use in SETx
instructions to perform logical, arithmetic, and character string operations on
SETA, SETB and SETC expressions.
For a complete list, see “Summary of built-in functions” in the HLASM Language
Reference.
AIF instruction
The AIF instruction can include a string of logical expressions and related sequence
symbols that is equivalent to multiple AIF instructions. This form of the AIF
instruction is described as an extended AIF instruction. There is no limit to the
number of expressions and symbols that you can use in an extended AIF
instruction.
AGO instruction
An AGO instruction lets you make branches according to the value of an
arithmetic expression in the operand. This form of the AGO instruction is
described as a computed AGO instruction.
If you declare a SET symbol to have local scope, you can use it only in the
statements that are part of:
v The macro definition in which it was defined, or
v Open code, if it was defined in open code
If you declare a SET symbol to have global scope, you can use it in the statements
that are part of:
v The same macro definition
v A different macro definition
v Open code
To help you with SET symbol definition, High Level Assembler provides the
following facilities:
v A SET symbol is declared implicitly when it appears in the name field of a SETx
instruction, and it has not been declared in a LCLx or GBLx instruction. It is
assigned as having local scope. If the assembler subsequently encounters any
local scope explicit declaration of the symbol, the symbol is flagged as a
duplicate declaration. A SET symbol is declared as an array if the name field of
the SETx instruction contains a subscript. See “Array processing with SET
symbols” on page 29.
v Global and local SET symbol declarations are processed at conditional assembly
time. Both a macro definition and open code can contain more than one
declaration for a given SET symbol, as long as only one is encountered during a
given macro generation or conditional assembly of open code.
v A SET symbol can be defined as an array of values by specifying a subscript
when you declare it, either explicitly or implicitly. All such SET symbol arrays
are open-ended; the subscript value specified in the declaration does not limit
the size of the array, as shown in the following example:
Name Operation Operand
LCLA &J(50)
&J(45) SETA 415
&J(89) SETA 38
You can use created SET symbols wherever ordinary SET symbols are permitted,
including declarations; they can even be nested in other created SET symbols.
The created SET symbol can be thought of as a form of indirect addressing. With
nested created SET symbols, you can use such indirect addressing to any level.
Created SET symbols can also offer an “associative memory” facility. For example,
a symbol table of numeric attributes can be referenced by an expression of the
form &(&SYM)(&I) to yield the I-th element of the symbol substituted for &SYM.
Note that the value of &SYM need not be the name of a valid symbol; thus created
SET symbols may have arbitrary names.
Created SET symbols also allow you to achieve some of the effect of
multidimensional arrays by creating a separate named item for each element of the
array. For example, a three-dimensional array of the form &X(&I,&J,&K) can be
addressed as &(X&I.$&J.$&K). Then &X(2,3,4) is represented as a reference to the
symbol &X2$3$4.
Note that what is being created here is a SET symbol. Both creation and
recognition occur at macro-generation time. In contrast, the names of parameters
are recognized and encoded (fixed) at macro-edit time. If a created SET symbol
name happens to coincide with a parameter name, the coincidence is ignored and
there is no interaction between the two.
where:
&SYM is a dimensioned SET symbol
exp is a SETA arithmetic expression
SETx is SETA, SETB, or SETC
For example, the following set of instructions converts a hexadecimal value in &X
into the decimal value 243 in &VAL.
BEGIN CSECT
.
.
.
CSECTLEN EQU *-BEGIN
&CSCTLEN SETA CSECTLEN
FIFTY EQU 50
.
.
.
&SPACES SETC (FIFTY)’ ’
The following examples show how the substring notation can be used:
Name Operation Operand Comment
Attribute references
Data such as instructions, constants, and areas have characteristics called data
attributes. The assembler assigns attribute values to the ordinary symbols and
variable symbols that represent the data.
You can determine up to eight attributes of symbols you define in your program
by means of an attribute reference. By testing attributes in conditional assembly
instructions, you can control the conditional assembly logic.
For example:
Name Operation Operand Comment
Attribute references to the count (K') and number (N') attributes, however, can
only be used in conditional assembly instructions.
v The name of a symbolic parameter whose value is the name of the ordinary
symbol
v The name of a SETC symbol whose value is the name of the ordinary symbol
If an operation code is redefined using the OPSYN instruction the attribute value
represents the new operation code type. If the operation code is deleted using the
OPSYN instruction the attribute value is ‘U’.
The following example checks to see if the macro MYMAC is defined. If not, the
MYMAC macro instruction is bypassed. This example prevents the assembly from
failing when the macro is not available.
Name Operation Operand
&A(1) SETA 0
&A(2) SETA 0
&A(3) SETA &A(2)
&A(5) SETA 5
&A(10) SETA 0
The number attribute is zero for a SET symbol that has been defined but not
assigned any value, regardless of whether it is subscripted or not. The number
attribute is always 1 for a SET symbol that is not subscripted and when the SET
symbol has been assigned a value.
You must be careful with the contents of any AREAD input in your source
module. If an AREAD input record is encountered before the symbol definition,
and the record has the same format as an assembler language statement, and the
name field contains the symbol referred to in the attribute reference, then the
forward scan will attempt to evaluate that record instead.
.
.
.
MEND Macro trailer
.
.
.
AIF OPSYN AGO Assign AGO properties to AIF
MVC OPSYN MVI Assign MVI properties to MVC
.
.
.
MACRDEF ... Macro call
(AIF interpreted as AIF instruct-
ion; generated AIFs not printed)
+ MVC ... Interpreted as MVI instruction
.
.
.
Open code started at this point
AIF ... Interpreted as AGO instruction
MVC ... Interpreted as MVI instruction
In this example, AIF and MVC instructions are used in a macro definition. AIF is a
conditional assembly instruction, and MVC is a machine instruction. OPSYN
statements assign the properties of AGO to AIF and assign the properties of MVI
to MVC. In subsequent calls of the macro MACRDEF, AIF is still defined, and used
as an AIF operation, but the generated MVC is treated as an MVI operation. In
open code following the macro call, the operations of both instructions are derived
from their new definitions assigned by the OPSYN statements. If the macro is
redefined (by another macro definition), the new definitions of AIF and MVC (that
is, AGO and MVI) are used for further generations.
This description does not apply to nested macro definitions because the assembler
does not edit inner macro definitions until it encounters them during the
generation of its outer macro. An OPSYN statement placed before the outer macro
instruction can affect conditional assembly statements in the inner macro
definition.
The format of the following two system variables has changed since Assembler H
Version 2:
v &SYSLIST treats parenthesized sublists in SETC symbols as sublists when passed
to a macro definition in the operand of a macro instruction. The
COMPAT(SYSLIST) assembler option can be used to treat sublists in the same
way as Assembler H Version 2, that is, parenthesized sublists are treated as
character strings, not sublists.
v &SYSPARM can now be up to 255 characters long, subject to restrictions
imposed by job control language.
Some of the new system variable symbols introduced with High Level Assembler
supplement the data provided by system variables available in previous
assemblers.
&SYSCLOCK: &SYSCLOCK provides the date and time the macro is generated.
&SYSDATE and &SYSDATC:
&SYSDATE provides the date in the format MM/DD/YY without
the century digits, and the year digits are in the lowest-order
positions.
The new variable symbol &SYSDATC provides the date with the
century, and the year digits in the highest-order positions. Its
format is YYYYMMDD.
&SYSECT and &SYSSTYP:
All previous assemblers have supported the &SYSECT variable to
hold the name of the enclosing control section at the time a macro
was invoked. This allows a macro that needs to change control
sections to resume the original control section on exit from the
macro. However, there was no capability to determine what type of
control section to resume.
The &SYSSTYP variable provides the type of the control section
named by &SYSECT. This permits a macro to restore the correct
previous control section environment on exit.
&SYSMAC: Retrieves the name of any macro called between open code and the
current nesting level.
&SYSM_HSEV:
Provides the highest MNOTE severity code for the assembly so far.
&SYSM_SEV: Provides the highest MNOTE severity code for the macro most
recently called from this macro or open code.
&SYSOPT_XOBJECT:
Determines if the XOBJECT assembler option was specified.
&SYSNDX and &SYSNEST:
All previous assemblers have supported the &SYSNDX variable
symbol, which is incremented by one for every macro invocation in
the program. This permits macros to generate unique ordinary
symbols if they are needed as local labels. Occasionally, in
recursively nested macro calls, the value of the &SYSNDX variable
was used to determine either the depth of nesting, or to determine
when control had returned to a particular level.
Alternatively, the programmer could define a global variable
symbol, and in each macro insert statements to increment that
variable on entry and decrement it on exit. This technique is both
cumbersome (because it requires extra coding in every macro) and
unreliable (because not every macro called in a program is likely to
be under the programmer’s control).
High Level Assembler provides the &SYSNEST variable to keep
track of the level of macro-call nesting in the program. The value
of &SYSNEST is incremented globally on each macro entry, and
decremented on each exit.
You may write an exit in any language that allows it to be loaded once and called
many times at the module entry point, and conforms to standard OS Linkage
conventions.
On entry to the exit module, Register 1 points to an Exit Parameter list supplied by
the assembler. The Exit Parameter list has a pointer to an Exit-Specific Information
block that contains specific information for each exit type. High Level Assembler
provides you with a macro, called ASMAXITP, which lets you map the Exit
Parameter list and the Exit Specific Information block.
You specify the name of the exit module in the EXIT assembler option. You can
also pass up to 64 characters of data to the exit, by supplying them as a suboption
of the EXIT option. The assembler passes the data to your exit during assembler
initialization.
Statistics
The assembler writes the exit usage statistics to the Diagnostic Cross Reference and
Assembler Summary section of the assembler listing.
Disabling an exit
A return code of 16 allows an EXIT to disable itself. The EXIT is not called again
during this assembly, or any following assemblies if the BATCH option is being
used.
See the subsection Using the High Level Assembler Library Exit for Processing E-Decks,
in Chapter 4 Using VSE Libraries, section High Level Assembler Considerations, in
VSE/ESA Guide to System Functions. This section describes how to set up a
LIBRARY exit and use it to process E-Decks.
Sample exits provided with High Level Assembler (z/OS and CMS)
The following sample exits are provided with High Level Assembler:
ADATA exit:
The ADATA exit handles the details of interfaces to the assembler. It
provides ADATA records to a number of filter routines, and also to exits
which control the ADATA record output, or reformat ADATA records from
new to old format.
The filter routines inspect the records to extract the information they
require. This lets you add or modify a filter routine without impacting
either the exit or the other filter routines.
The design of the exit:
v Supports multiple simultaneous filter routines.
v Simplifies the ADATA-record interface for each filter, because you do not
need to be concerned about the complex details of interacting directly
with the assembler.
v Supports filter routines written in high-level languages.
v Supports an exit to control the ADATA record output.
v Supports an exit to reformat ADATA records from new to old format.
There are three components that make up the functional ADATA filter
routine:
1. The exit, ASMAXADT, which the assembler invokes.
2. A table of filter-routine names, contained in a Filter Management Table
(FMT), module ASMAXFMT. The exit routine loads the FMT.
3. The filter routines. The exit loads these as directed by the FMT.
Assembler listings
High Level Assembler produces a comprehensive assembler listing that provides
information about a program and its assembly. Each section of the assembler
listing is clear and easily readable. The following assembler options are used to
control the format and which sections of the listing to produce:
ASA (z/OS and CMS) Allows you to use American National Standard
printer control characters, instead of machine printer control
characters.
DXREF Produces the DSECT Cross Reference section.
ESD Produces the External Symbol Dictionary section.
EXIT(PRTEXIT(mod3))
Supplies a listing exit to replace or complement the assembler’s
listing output processing.
FOLD Instructs the assembler to print the assembler listing in uppercase
characters, except for quoted strings and comments.
LANGUAGE Produces error diagnostic messages in the following languages:
v English mixed case (EN)
v English uppercase (UE)
v German (DE)
v Japanese (JP)
v Spanish (ES)
When you select either of the English languages, the assembler
listing headings are produced in the same case as the diagnostic
messages.
When you select either the German language or the Spanish
language, the assembler listing headings are produced in mixed
case English.
When you select the Japanese language, the assembler listing
headings are produced in uppercase English.
The assembler uses the installation default language for messages
produced in CMS by the High Level Assembler command.
LINECOUNT Specifies how many lines should be printed on each page,
including the title and heading lines.
LIST Controls the format of the Source and Object section of the listing.
NOLIST suppresses the entire listing.
MXREF Produces one, or both, of the Macro and Copy Code Source Summary
and Macro and Copy Code Cross Reference sections.
PCONTROL Controls what statements are printed in the listing, and overrides
some PRINT instructions.
RLD Produces the Relocation Dictionary section.
RXREF Produces the General Purpose Register Cross Reference section.
USING(MAP) Produces the Using Map section.
XREF Produces one, or both, of the Ordinary Symbol and Literal Cross
Reference and the Unreferenced Symbols Defined in CSECTs sections.
Option summary
High Level Assembler provides a summary of the options current for the assembly,
including:
v A list of the overriding parameters specified in the external file or library
member (VSE only)
v A list of the overriding parameters specified when the assembler was called
v The options specified on *PROCESS statements
v In-line error diagnostic messages for any overriding parameters and *PROCESS
statements in error
You cannot suppress the option summary unless you suppress the entire listing, or
you supply a user exit to control which lines are printed.
On z/OS and CMS, High Level Assembler provides a sample LISTING exit that
allows you to suppress the option summary or print it at the end of the listing. See
the description of the sample listing exit on page 40.
Figure 4 shows an example of the High Level Assembler Option Summary. The
example includes assembler options that have been specified in the external file or
library member, the invocation parameters and in *PROCESS statements. It also
shows the *PROCESS statements in the Source and Object section of the listing.
3
** ASMA400W Error in invocation parameter - size(4meg)
** ASMA438N Attempt to override ASMAOPT parameter. Option norxref ignored.
** ASMA425N Option conflict in invocation parameters. noadata overrides an earlier setting.
** ASMA423N Option ADATA, in a *PROCESS OVERRIDE statement conflicts with invocation or default option. Option is not
permitted in a *PROCESS statement and has been ignored.
** ASMA422N Option LANGUAGE(ue) is not valid in a *PROCESS statement.
** ASMA437N Attempt to override invocation parameter in a *PROCESS statement. Suboption FULL of XREF option ignored.
4
3 NOADATA
5 ALIGN
NOASA
BATCH
CODEPAGE(047C)
NOCOMPAT
5 NODBCS
NODECK
DXREF
ESD
NOEXIT
5 FLAG(0,ALIGN,CONT,EXLITW,NOIMPLEN,NOPAGE0,PUSH,RECORD,NOSUBSTR,USING0)
5 NOFOLD
NOGOFF
NOINFO
3 LANGUAGE(EN)
5 NOLIBMAC
LINECOUNT(60)
LIST(121)
MACHINE(,NOLIST)
1 MXREF(FULL)
3 NOOBJECT
OPTABLE(UNI,NOLIST)
NOPCONTROL
NOPESTOP
NOPROFILE
5 NORA2
NORENT
RLD
2 RXREF
SECTALGN(8)
SIZE(MAX)
NOSUPRWARN
2 SYSPARM(thisisatestsysparm)
NOTERM
5
No Overriding DD Names
1 External Symbol Dictionary Page 3
-Symbol Type Id Address Length Owner Id Flags Alias-of HLASM R6.0 2008/07/11 17.48
0A SD 00000001 00000000 00000000 00
1 Page 4
Active Usings: None
0 Loc Object Code Addr1 Addr2 Stmt Source Statement HLASM R6.0 2008/07/11 17.48
6
0 1 *PROCESS OVERRIDE(ADATA,MXREF(full))
2 *PROCESS ALIGN
3 *PROCESS noDBCS
4 *PROCESS MXREF(FULL),nolibmac
5 *PROCESS FLAG(0)
6 *PROCESS noFOLD,LANGUAGE(ue)
7 *PROCESS NORA2
8 *PROCESS NODBCS
9 *PROCESS XREF(FULL)
000000 00000 00000 10 A CSECT
R:F 00000 11 USING *,15
5 On z/OS and CMS, if the assembler has been called by a program and any
standard (default) DDnames have been overridden, both the default
DDnames and the overriding DDnames are listed. Otherwise, this
statement appears:
No Overriding DD Names
6 The *PROCESS statements are written as comment statements in the
Source and Object section of the listing.
1 Shows the name of every external dummy section, control section, entry
point, external symbol, and class.
2 Indicates whether the symbol is the name of a label definition, external
reference, unnamed control section definition, common control section
definition, external dummy section, weak external reference, or external
definition.
3 Shows the length of the control section.
4 When you define a symbol in an ALIAS instruction, this field shows the
external symbol name of which the symbol is an alias.
You can suppress this section of the listing by specifying the NOESD assembler
option.
The 133-character format shows the location counter, and the first and second
operand addresses (ADDR1 and ADDR2) as 8-byte fields in support of 31-bit
addresses. This format is required when producing the extended object file; see
“Generalized object format modules (z/OS and CMS)” on page 11. The
133-character format also contains the first eight characters of the macro name in
the identification-sequence field for statements generated by macros.
Figure 6 on page 47 shows an example of the Source and Object section of the
listing. This section shows the source statements of the module, and the object
code of the assembled statements.
The fixed heading line printed on each page of the source and object section of the
assembler listing indicates if the control section, at the time of the page eject, is a
COM section, a DSECT or an RSECT.
High Level Assembler lets you write your program and print the assembler listing
headings in mixed-case.
1 Shows, in hexadecimal notation, the assembled address of the object code.
2 Shows, in hexadecimal notation, the object code generated by assembly of
the statement. The object code of machine instructions is printed in full.
Only 8 bytes of object code are printed for assembled constants, unless the
PRINT DATA instruction or the PCONTROL(DATA) assembler option is
specified, in which case all the object code is printed.
3 Shows the statement number. If you specify the PCONTROL(GEN)
assembler option, or if you specify the PRINT GEN instruction before a
macro instruction, the statements generated by the macro instruction is
printed. A plus sign (+) suffixes the statement numbers of generated
statements.
4 Shows the source statement.
5 The Addr1 and Addr2 columns show the first and second operand
Relocation dictionary
Figure 8 shows an example of the Relocation Dictionary section of the listing, which
contains information passed to the linkage editor, or z/OS Program Management
Binder, in the object module. The entries describe the address constants in the
assembled program that are affected by relocation.
1 Indicates the ESD ID assigned to the ESD entry for the control section in
which the address constant is defined.
2 Indicates the ESD ID assigned to the ESD entry for the control section to
which this address constant refers.
3 Shows the assembled address of the address constant.
4 Indicates the type and length of the address constant. The type may be one
of the following:
A A-type address constant
V V-type address constant
Q Q-type address constant
J J-type address constant or CXD instruction
R R-type address constant
RI Relative Immediate offset
5 Indicates the relocation action. The action may be one of the following:
+ the relocation operand is added to the address constant
- the relocation operand is subtracted from the address constant
ST the relocation operand overwrites the address constant
You can suppress this section of the listing by specifying the NORLD assembler
option.
1 Each symbol or literal. Symbols are shown in the form in which they are
defined, either in the name entry of a machine or assembler instruction, or
in the operand of an EXTRN or WXTRN instruction. Symbols defined
using mixed-case letters are shown in mixed-case letters, unless the FOLD
assembler option was specified.
2 The byte length of the field represented by the symbol, in decimal notation.
3 Shows the hexadecimal address that the symbol or literal represents, or the
hexadecimal value to which the symbol is equated.
4 Shows the ESD ID assigned to the ESD entry for the control section in
which the symbol or literal is defined.
5 Symbols DCBBIT0, DCBBIT1, etc. are absolute symbols and are flagged “A”
in the R column. A symbol that is the result of a complex relocatable
expression would be flagged “C” in the R column. Symbol INDCB is simply
relocatable and is not flagged. (Column title R is an abbreviation for
“Relocatability Type”.)
6 Indicates the type attribute of the symbol or literal.
7 Indicates the assembler type of the symbol.
8 Indicates the program type of the symbol.
9 Indicates the number of the statement in which the symbol or literal was
defined.
10 Shows the statement numbers of the statements in which the symbol or
literal appears as an operand. Additional indicators are suffixed to
statement numbers as follows:
You can suppress this section of the listing by specifying the NOXREF assembler
option. You can also suppress all symbols not referenced in the assembly by
specifying the XREF(SHORT) assembler option.
You can produce this section of the listing by specifying the RXREF
Note: The implicit use of a register to resolve a symbol to a base and displacement
does not create a reference in the General Purpose Register Cross Reference.
1 Shows the concatenation value representing the source of the macros and
copy code members. This number is not shown if the source is PRIMARY
INPUT. The number is prefixed with L which indicates Library. The
concatenation value is cross referenced in the Macro and Copy Code Cross
Reference section, and the Diagnostic Cross Reference and Assembler Summary
section.
2 Shows the name of each library from which the assembler read a macro or
a copy code member. The term PRIMARY INPUT is used for in-line
macros.
3 Shows the volume serial number of the volume on which the library
resides.
4 Shows the names of the macros or copy members.
You can suppress this section of the listing by specifying the NOMXREF assembler
option, or by specifying the MXREF(XREF) assembler option.
v The statement number for macros defined in the primary input file
v A dash (–) for macros or copy code members read from a library.
5 Shows the statement number that contains the macro call or COPY
instruction.
6 Shows the statement reference number with a suffix of C, which indicates
that the member is specified on a COPY instruction.
Figure 14 shows an example of the Macro and Copy Code Cross Reference section
when you specify the LIBMAC assembler option.
Figure 14. Macro and copy code cross reference - with LIBMAC option
1 The “X” flag indicates the macro was read from a macro library and
imbedded in the input source program immediately preceding the
invocation of that macro. For example, in Figure 14, you can see that
SAMPMAC was called by the PRIMARY INPUT stream from LIBRARY L1, at
statement number 174, after being imbedded in the input stream at
statement number 153.
You can suppress this section of the listing by specifying the NOMXREF assembler
option, or the MXREF(SOURCE) assembler option.
1 Shows the name of each dummy section defined in your program.
2 Shows, in hexadecimal notation, the assembled byte length of the dummy
section.
3 Shows the ESD ID assigned to the ESD entry for external dummy sections.
For internal dummy sections it shows the control section ID assigned to
the dummy control section. You can use this field in conjunction with the
ID field in the Ordinary Symbol and Literal Cross Reference section to relate
symbols to a specific DSECT.
4 Shows the number of the statement where the definition of the dummy
section begins.
You can suppress this section of the listing by specifying the NODXREF assembler
option.
USING map
Figure 16 shows an example of the Using Map section of the listing. It shows a
summary of the USING, DROP, PUSH USING, and POP USING instructions used
in your program.
1 Shows the number of the statement that contains the USING, DROP, PUSH
USING, or POP USING instruction.
2 Indicates whether the instruction was a USING, DROP, PUSH, or POP
instruction.
3 Shows the type of USING instruction. A USING instruction can be an
ordinary USING, a labeled USING, a dependent USING, or a labeled
dependent USING.
4 For ordinary and labeled USING instructions, this field indicates the base
address specified in the USING. For dependent USING instructions, this
field is prefixed with a plus sign (+) and indicates the hexadecimal offset
of the address of the second operand from the base address specified in
the corresponding ordinary USING.
5 Shows the range of the USING. For more information, see the description
of the USING statement in the HLASM Language Reference.
6 For USING instructions, this field indicates the ESDID of the section
specified on the USING statement.
7 Indicates the registers specified in USING instructions, and DROP
instructions. There is a separate line in the USING map for each register
specified in the instruction.
8 Shows the maximum displacement from the base register that the
assembler calculated when resolving symbolic addresses into
base-displacement form.
You can suppress this section of the listing by specifying the USING(NOMAP)
assembler option, or the NOUSING assembler option.
See the description of the sample LISTING exit on page 40, which lets you
suppress this section.
z/OS, this may also be the name of a partitioned data set member
that is included in the primary input (SYSIN) concatenation.
record is the relative record number from the start of the dataset or
member which contains the flagged statement.
2 The number of statements flagged, and the highest non-zero severity code
of all messages issued.
3 Provides information about the system on which the assembly was run.
4 On z/OS and CMS, all data sets used in the assembly are listed by their
standard DDname. The data set information includes the data set name,
and the serial number of the volume containing the data set. On z/OS, the
data set information may also include the name of a member of a
partitioned data set (PDS).
If a user exit provides the data set information, then the data set name is
the value extracted from the Exit-Specific Information Block described in
“Exit-Specific Information Block” in the HLASM Programmer’s Guide.
The “Con” column shows the concatenation value assigned for each input
data set. You use this value to cross-reference flagged statements, and
macros and copy code members listed in the Macro and Copy Code Cross
Reference section.
5 Output data sets do not have a concatenation value.
6 The usage statistics of external functions for the assembly. The following
statistics are reported:
SETAF function calls The number of times the function was
called from a SETAF assembler instruction.
SETCF function calls The number of times the function was
called from a SETCF assembler instruction.
Messages issued The number of times the function
requested that a message be issued.
Messages severity The maximum severity for the messages
issued by this function.
Function name The name of the external function module.
7 The usage statistics of the I/O exits you specified for the assembly. If you
do not specify an exit, the assembler does not produce any statistics. The
following statistics are reported:
Exit type
The type of exit.
Name The name of the exit module as specified in the EXIT assembler
option.
Calls The number of times the exit was called.
Records
The number of records added and deleted by the exit.
Diagnostic messages
The number of diagnostic messages printed, as a result of exit
processing.
All counts are shown right justified and leading zeroes are suppressed,
unless the count is zero.
8 The suppressed message statistics for the assembly.
These messages have been suppressed by means of the SUPRWARN
option.
9 Statistics about the assembly.
10 On z/VSE, the assembly start and stop times in hours, minutes and
seconds.
On z/OS and CMS, the assembly start and stop times in hours, minutes
and seconds and the approximate amount of processor time used for the
assembly, in hours, minutes, and seconds to four decimal places.
When you specify the FLAG assembler option, the assembler may print additional
diagnostic messages. The FLAG(ALIGN) option directs the assembler to issue
diagnostic messages when there is an alignment error between an operation code
and the operand data address. The FLAG(CONT) option directs the assembler to
issue diagnostic messages when the assembler detects a possible continuation error.
The FLAG(RECORD) option directs the assembler to print an additional
informational message after the last error diagnostic message for each statement in
error. Figure 18 shows the effect of the FLAG(RECORD) option:
000000 1 CSECT
.
.
.
22 COMM
** ASMA057E Undefined operation code - COMM
** ASMA435I Record 22 in ’HLASM3.SAMPLE.SOURCE(SAMP01)’ on volume: HLASM3
.
.
.
000000 35 DS (*+5)F
** ASMA032E Relocatable value found when absolute value required - (*+5)F
** ASMA435I Record 35 in ’HLASM3.SAMPLE.SOURCE(SAMP01)’ on volume: HLASM3
000000 00000000 36 2NAME DC F’0’
** ASMA147E Symbol too long, or first character not a letter - 2NAME
** ASMA435I Record 36 in ’HLASM3.SAMPLE.SOURCE(SAMP01)’ on volume: HLASM3
.
.
.
118 &C SETC ’AGO’
119 &C .X
ASMA001E Operation code not allowed to be generated - AGO
ASMA435I Record 119 in ’HLASM3.SAMPLE.SOURCE(SAMP01)’ on volume: HLASM3
.
.
.
151 END
You can locate messages in your assembly listing by searching for “** ASMA” in
the listing. The preferred alternative is to specify the TERM option.
Macro-generated statements
A macro-generated statement is a statement generated by the assembler after a
macro call. During macro generation, the assembler copies any model statements
processed in the macro definition into the input stream for further processing.
Model statements are statements from which assembler language statements are
generated during conditional assembly. You can use variable symbols as points of
substitution in a model statement to vary the contents or format of a generated
statement.
Open code: Model statements can also be included in open code by using variable
symbols as points of substitution.
On z/OS and CMS, when you specify the LIST(121) assembler option, the first 5
characters of the macro name are printed after the hyphen. When you specify the
LIST(133) assembler option, the first 8 characters of the macro name are printed
after the hyphen.
On z/VSE, only the first 5 characters of the macro name are printed after the
hyphen.
Loc Object Code Addr1 Addr2 Stmt Source Statement HLASM R6.0 2008/07/11 17.48
1 macro
2 macgen
3 &A SETC ’abcdefghijklmnopq’
4 &A LA 1,4 Comment
5 &B SETC ’abc’
6 &B LA 1,4 Comment
7 mend
8 macgen
000000 4110 0004 00004 9+abcdefghijklmnopq LA 1,4 Comment 01-00004
000004 4110 0004 00004 10+abc LA 1,4 Comment 01-00006
11 end
Note: If the next line to print after macro call or model statement is a diagnostic
message, the object code or generated data is not shown in the assembler
listing.
Figure 20 shows the object code of the first statement generated for the wto
macro instruction when PRINT NOGEN is effective. The data constant (DC)
for jump causes 7 bytes of binary zeroes to be generated before the DC to
align the constant on a double word. With PRINT NOGEN effective, these
are not shown, but the location counter accounts for them.
Loc Object Code Addr1 Addr2 Stmt Source Statement HLASM R6.0 2008/07/11 17.48
..
.
000016 1851 13 lr 5,1
14 print nogen
000018 4510 F026 00002 15 wto ’Hello’
000028 C1 23 dc cl1’A’
000030 4238000000000000 24 jump dc d’56’
..
.
MACRO
MAC1
.
.
.
LCLC &.A Invalid variable symbol
.
.
.
&N SETA &A
.
.
.
MEND
Figure 22 shows the placement of error messages when the macro is called:
1 MAC1
** ASMA024E Invalid variable symbol - MACRO - MAC1
.
.
.
** ASMA003E Undeclared variable symbol; default=0, null, or type=U - LIBMA/A
.
.
.
36 MAC1
.
.
.
** ASMA003E Undeclared variable symbol; default=0, null, or type=U - LIBMA/A
.
.
.
66 END
Terminal output
On z/OS and CMS, the TERM option lets you receive a summary of the assembly
at your terminal. You may direct the terminal output to a disk data set.
On z/VSE, the TERM option lets you send a summary of the assembly to SYSLOG.
The output from the assembly includes all error diagnostic messages and the
source statement in error. It also shows the number of flagged statements and the
highest severity code.
The terminal output can be shown in two formats. Figure 24 on page 65, the wide
format, shows the source statements in the same columns as they were in the input
data set. Figure 23, the narrow format, shows the source statements which have
been compressed by replacing multiple consecutive blanks with a single blank. Use
the TERM assembler option to control the format.
You can replace or modify the terminal output using a TERM user exit. See
Chapter 5, “Using exits to complement file processing,” on page 37.
Input/output enhancements
High Level Assembler includes the following enhancements:
v QSAM Input/Output
The assembler uses QSAM input/output for all sequential data sets.
v System-Determined Blocksize
Under z/OS, High Level Assembler supports DFSMS System-Determined
Blocksize (SDB) for all output datasets, except SYSPUNCH and SYSLIN.
SDB is applicable when all of the following conditions are true:
– You run High Level Assembler under a z?OS operating system that includes a
DFSMS level of 3.1 or higher.
– You DO NOT allocate the data set to SYSOUT.
– Your JCL omits the blocksize, or specifies a blocksize of zero.
– You specify a record length (LRECL).
– You specify a record format (RECFM).
– You specify a data set organization (DSORG).
If these conditions are met, DFP selects the appropriate blocksize for a new data
set depending on the device type you select for output.
If the System-Determined Blocksize feature is not available, and your JCL omits
the blocksize, or specifies a blocksize of zero, the assembler uses the logical
record length as the blocksize.
You can specify assembler options as parameters when you issue the High Level
Assembler command. You may delimit each parameter using either a space or
comma. There must be no intervening spaces when you specify suboptions and
their delimiters.
ASMAHL XREF(SHORT)
The Assembler H Version 2 CMS-specific options NUM, STMT, and TERM have
been removed. SYSTERM support is provided by the standard assembler TERM
option.
The new SEG and NOSEG options let you specify from where CMS should load
the High Level Assembler modules. By default the assembler loads its modules
from the Logical Saved Segment (LSEG), but if the LSEG is not available, it loads
the modules from disk. You can specify the NOSEG option to force the assembler
to load its modules from disk, or you can specify the SEG option to force the
assembler to load its modules from the Logical Saved Segment (LSEG). If the
assembler cannot load its modules it terminates with an error message.
The MHELP instruction lets you select one or more of the following facilities:
Macro Call Trace
A one-line trace for each macro call
Macro Branch Trace
A one-line trace for each AGO and true AIF conditional assembly
statement within a macro
Macro Entry Dump
A dump of parameter values from the macro dictionary immediately after
a macro call is processed
Macro Exit Dump
A dump of SET symbol values from the macro dictionary on encountering
a MEND or MEXIT statement
Macro AIF dump
A dump of SET symbol values from the macro dictionary immediately
before each AIF statement that is encountered
Global Suppression
Suppresses the dumping of global SET symbols in the two preceding types
of dump
Macro Hex Dump
An EBCDIC and hexadecimal dump of the parameters and SETC symbol
values when you select the Macro AIF dump, the Macro Exit dump or the
Macro Entry dump
MHELP suppression
Stops all active MHELP options.
MHELP Control on &SYSNDX
Controls the maximum value of the &SYSNDX system variable symbol.
The limit is set by specifying the number in the operand of the MHELP
instruction. When the &SYSNDX value is exceeded, the assembler
Diagnosis facility
If there is an error in the assembler, the IBM service representative may ask for the
output produced by the assembler, and the source program to help debug the
error. A new internal trace facility in the assembler can provide the IBM service
representative with additional debugging information. The IBM service
representative determines the need for this information and the circumstances
under which it can be produced. Until this facility is invoked, its inclusion in the
assembler does not impact the performance.
The ADATA file contains variable-length blocked records. The maximum record
length is 32756 bytes, and the maximum block size is 32760 bytes.
The file contains records classified into different record types. Each type of record
provides information about the assembler language program being assembled.
Each record consists of two parts:
v A 12-byte header section which has the same structure for all record types
v A variable-length data section, which varies by record type
Resident tables and source text: Keeping intermediate text, macro definition text,
dictionaries, and symbol tables in main storage whenever possible improves
| performance. High Level Assembler writes working storage blocks to the assembler
| work data set only if necessary, and then only if the WORKFILE option is
| specified. Less input and output reduces system overhead and frees channels and
input/output devices for other uses.
Shared virtual storage: High Level Assembler is a reentrant program that can be
installed in shared virtual storage, such as the z/OS Link Pack Area (LPA), a CMS
logical saved segment or in a VSE Shared Virtual Area (SVA). When High Level
Assembler is installed in shared virtual storage, the demand for system resources
associated with loading the assembler load modules is reduced. In a multi-user
environment, multiple users are able to share one copy of the assembler load
modules.
31-bit addressing: High Level Assembler takes advantage of the extended address
space, available in extended architecture operating systems, by allowing most of its
data areas to reside above the 16-megabyte line. I/O areas and exit parameter lists
remain in storage below the 16-megabyte line to satisfy access method
requirements and user exits using 24-bit addressing mode. The High Level
Assembler’s modules can be loaded above the 16-megabyte line, except for some
| initialization routines. 31-bit addressing increases the assembler’s available work
area, which allows larger programs than previously possible to be assembled
in-storage. In-storage assemblies reduce the input and output system overhead and
free channels and input/output devices for other uses.
Multiple assembly: You can run multiple assemblies, known as batching, with one
invocation of the assembler. Source records are placed together, with no
intervening ‘/*’ JCL statement.
Batch assembly improves performance by eliminating job and step overhead for
each assembly. It is especially useful for processing related assemblies such as a
main program and its subroutines.
Macro-editing process: High Level Assembler edits only those macro definitions
encountered during a given macro generation or during conditional assembly or
open code, as controlled by AIF and AGO statements.
Unlike DOS/VSE Assembler, High Level Assembler requires that library macros be
stored in source format. This removes the necessity to edit library macros before
they can be stored in the library.
Consolidating source text passes: Consolidating assembly source text passes and
other new organization procedures reduce the number of internal processor
instructions used to handle source text in High Level Assembler, which causes
proportionate savings in processor time. The saving is independent of the size or
speed of the system processor involved; it is a measure of the relative efficiency of
the processor.
ESD | NOESD
Produce the External Symbol Dictionary section of the assembler listing.
EXIT(suboption1,suboption2,...) | NOEXIT
Provide user exits to the assembler for input/output processing.
ADEXIT(name(string)) | NOADEXIT
Identify the name of a user-supplied ADATA exit module.
INEXIT(name(string)) | NOINEXIT
Identify the name of a user-supplied SOURCE exit module.
LIBEXIT(name(string)) | NOLIBEXIT
Identify the name of a user-supplied LIBRARY exit module.
OBJEXIT(name(string)) | NOOBJEXIT
Identify the name of a user-supplied OBJECT exit module.
PRTEXIT(name(string)) | NOPRTEXIT
Identify the name of a user-supplied LISTING exit module.
TRMEXIT(name(string)) | NOTRMEXIT
Identify the name of a user-supplied TERM exit module.
FLAG(suboption1,suboption2,...)
Specify the level and type of error diagnostic messages to be written.
FOLD | NOFOLD
Convert lowercase characters to uppercase characters in the assembly
listing.
GOFF | NOGOFF
(z/OS and CMS) Set generalized object format.
INFO | NOINFO
Display service information selected by date.
LANGUAGE(EN | ES | DE | JP | UE)
Specify the language in which assembler diagnostic messages are
presented. High Level Assembler lets you select any of the following:
v English mixed case (EN)
v English uppercase (UE)
v German (DE)
v Japanese (JP)
v Spanish (ES)
When you select either of the English languages, the assembler listing
headings are produced in the same case as the diagnostic messages.
When you select either the German language or the Spanish language, the
assembler listing headings are produced in mixed case English.
When you select the Japanese language, the assembler listing headings are
produced in uppercase English.
The assembler uses the default language for messages produced on CMS
by the High Level Assembler command.
LIBMAC | NOLIBMAC
Instruct the assembler to imbed library macro definitions in the input
source program.
LINECOUNT(integer)
Specify the number of lines to print in each page of the assembly listing.
SEG | NOSEG
(CMS) Specify that assembler modules are loaded from the Logical Saved
Segment (LSEG).
SIZE(value)
Specify the amount of virtual storage that the assembler can use for
working storage.
SUPRWARN(msgnum1,msgnum2,...) | NOSUPRWARN
Specify one or more message numbers, of warning (4) or less severity, to be
suppressed.
SYSPARM(value)
Specify the character string that is to be used as the value of the
&SYSPARM system variable.
TERM(WIDE | NARROW) | NOTERM
Specify whether error diagnostic messages are to be written to the terminal
data set On z/OS and CMS, or SYSLOG On z/VSE.
TEST | NOTEST
Specify whether special symbol table data is to be generated as part of the
object module.
THREAD | NOTHREAD
Specify whether or not the location counter is to be reset at the beginning
of each CSECT.
TRANSLATE(AS | suffix) | NOTRANSLATE
Specify whether characters contained in character (C-type) data constants
(DCs) and literals should be translated using a user-supplied translation
table. The suboption AS directs the assembler to use the ASCII translation
table provided with High Level Assembler.
TYPECHECK(suboption1,suboption2) | NOTYPECHECK
Control whether or not HLASM performs type checking of machine
instruction operands.
USING(suboption1,suboption2,...) | NOUSING
Specify the level of monitoring of USING statements required, and whether
the assembler is to generate a USING map as part of the assembly listing.
| WORKFILE | NOWORKFILE
| If storage apart from central storage is required during assembly, use the
| utility file for temporary storage.
XREF(SHORT | UNREFS | FULL) | NOXREF
Produce the Ordinary Symbol and Literal Cross Reference, or the Unreferenced
Symbols Defined in CSECTs, or both, in the assembly listing.
You can use these symbols as points of substitution in model statements and
conditional assembly instructions. You can use some system variable symbols both
inside macro definitions and in open code, and some system variable symbols only
in macro definitions.
In High Level Assembler enhancements have been made to some system variable
symbols and many new system variable symbols have been introduced.
The system variable symbols introduced in High Level Assembler Release 3 are:
Variable Description
&SYSCLOCK A local-scope variable that holds the date and time
at which a macro is generated.
&SYSMAC A local-scope variable that can be subscripted, thus
referring to the name of any of the macros opened
between open code and the current nesting level.
&SYSOPT_XOBJECT A global-scope variable that indicates if the
XOBJECT assembly option was specified.
&SYSM_HSEV A global-scope variable that indicates the latest
MNOTE severity so far for the assembly.
&SYSM_SEV A global-scope variable that indicates the latest
MNOTE severity for the macro most recently called
from this level.
The system variable symbols introduced in High Level Assembler Release 2 are:
Variable Description
&SYSADATA_DSN A local-scope variable containing the name of the
data set where associated data (ADATA) records
are written.
&SYSADATA_MEMBER A local-scope variable containing the name of the
partitioned data set member where associated data
(ADATA) records are written.
&SYSADATA_VOLUME A local-scope variable containing the volume
identifier of the first volume containing the
ADATA data set.
&SYSLIN_DSN A local-scope variable containing the name of the
data set where object module records are written.
In addition, High Level Assembler provides the following system variable symbols
not provided by DOS/VSE Assembler but provided by Assembler H Version 2:
Variable Description
&SYSDATE A global-scope variable containing the date in the
form MM/DD/YY.
&SYSLOC A local-scope variable containing the name of the
location counter now in effect. &SYSLOC can only
be used in macro definitions.
&SYSNDX A local-scope variable containing a number from 1
Hardware requirements
High Level Assembler, and its generated object programs, can run in any IBM
ES/9000®, 937X, or zSeries processor supported by the operating systems listed
below under Software requirements. However, you can only run a generated object
program that uses 370-XA machine instructions on a 370-XA mode processor under
an operating system that provides the necessary architecture support for the
370-XA instructions used. Similarly, you can only run a generated object program
that uses ESA/370, ESA/390, or zSeries machine instructions on an associated
processor under an operating system that provides the necessary architecture
support for the ESA/370, ESA/390, and zSeries instructions used.
Software requirements
High Level Assembler runs under the operating systems listed below. Unless
otherwise stated, the assembler also operates under subsequent versions, releases,
and modification levels of these systems:
v OS/390® Version 2 Release 10.0
v VM/ESA® Version 3 Release 1.0
v z/VM Version 5 Release 2
v VSE/ESA Version 2 Release 6
v z/VSE Version 3 Release 1 andVersion 4
v z/OS Version 1 Release 2.0
In addition, installation of High Level Assembler requires one of the following:
z/OS IBM System Modification Program/Extended (SMP/E). All load modules
are reentrant, and you can place them in the link pack area (LPA).
z/VM IBM VM Serviceability Enhancements Staged/Extended (VMSES/E) and
VMFPLC2. Most load modules are reentrant, and you can place them in a
logical saved segment.
z/VSE Maintain System History Program (MSHP). Most phases are reentrant, and
you can place them in the shared virtual area (SVA).
Table 6 shows the DDNAME and allowed device types associated with a particular
class of assembler input or output:
Table 6. Assembler input/output devices (z/OS)
Function DDNAME Device type When required
1
Input SYSIN DASD Always
Magnetic tape
Card reader
Macro library SYSLIB DASD When a library macro is
called or a COPY statement
used 1
Options file ASMAOPT DASD When assembler options are
to be provided via an
external file
Print SYSPRINT DASD When the LIST assembler
Magnetic tape option is specified 1
Printer
Output to linkage SYSLIN DASD When the OBJECT assembler
editor Magnetic tape option or the XOBJECT
assembler option is specified
1
At assembly time, and during subsequent object module processing, High Level
Assembler requires associated devices for the following types of input and output:
v Source program input
v Options file
v Printed listing
v Object module in relocatable card-image format
v Terminal output
v ADATA output
IBM may not offer the products, services, or features discussed in this document in
other countries. Consult your local IBM representative for information on the
products and services currently available in your area. Any reference to an IBM
product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product,
program, or service that does not infringe any IBM intellectual property right may
be used instead. However, it is the user’s responsibility to evaluate and verify the
operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you
any license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
Licensees of this program who wish to have information about it for the purpose
of enabling: (i) the exchange of information between independently created
programs and other programs (including this one) and (ii) the mutual use of the
information which has been exchanged, should contact:
IBM Corporation
Mail Station P300
2455 South Road
Poughkeepsie New York 12601-5400
U.S.A.
The licensed program described in this document and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement or any equivalent agreement
between us.
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
IBM World Trade Asia Corporation
Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106-0032, Japan
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law: INTERNATIONAL
BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION ″AS IS″
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
Any references in this information to non-IBM Web sites are provided for
convenience only and do not in any manner serve as an endorsement of those Web
sites. The materials at those Web sites are not part of the materials for this IBM
product and use of those Web sites is at your own risk.
If you are viewing this information softcopy, the photographs and color
illustrations may not appear.
Trademarks
The following are trademarks of International Business Machines Corporation in
the United States, or other countries, or both:
IBM
The IBM Logo
ibm.com
DFSMS
DFSMS/MVS
DFSMSdfp
ES/9000
Enterprise Systems Architecture/370
MVS
MVS/DFP
Multiprise
OS/390
REXX
S/390
System z
System/370
VM/ESA
VSE/ESA
z/Architecture
z/OS
z/VM
z/VSE
zSeries
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Index 93
PESTOP assembler option 77 sectioning and linking extensions symbolic parameter
planning for High Level Assembler 4 external dummy sections 13 conflicting with created SET
POP instruction 7 multiple location counters 13 symbol 29
precedence of options 16 no restrictions on ESD items 13 syntax extensions
PRINT assembler option 77 read-only control sections 12 blank lines 9
PRINT instruction 7 SEG assembler option 78 character variables in arithmetic
printer control characters 75 sequence field in macro-generated expressions 29
process (*PROCESS) statements 16 statements 61 continuation lines, number of 9
processor time sequence symbol length 10, 26 levels of parentheses
in assembly listing 60 SET symbol in macro instruction 22
reduced instruction path 74 built-in macro functions 27 in ordinary assembler
processor time for the assembly 60 created 28 expressions 11
PROFILE assembler option 77 declaration number of terms in expression 11
Programmer’s Guide vii implicit 28 removal of restrictions for literals 11
prototype, in macro definitions 19 multiple 28 symbol length 10
PRTEXIT assembler option 76 defined as an array of values 28 SYSLIST (&SYSLIST) with multilevel
PSECT 13 dimension 28 sublists 23
publications global scope 28 SYSNDX (&SYSNDX), MHELP control
High Level Assembler vii, 89 local scope 28 on 66
HLASM Toolkit 89 SET symbol format and definition SYSPARM assembler option 78
machine instructions 89 changes 28 system determined blocksize 65
online (CD-ROM) viii SETAF instruction 27 system variable symbols 34, 79
z/OS 89 SETC symbol &SYSLIST with multilevel sublists 23
z/VM 89 attribute reference with 31 &SYSNDX, MHELP control on 66
z/VSE 90 in arithmetic expressions 29 system-determined blocksize 65
PUNCH operand, double-byte character SETCF instruction 27 SYSTERM output 64
set 8 SETx instruction
PUNCH output capability 25 built-in macro functions 27
PUSH instruction 8 extended 27, 29
using ordinary symbols 30
T
TERM assembler option 64, 66, 78, 84,
shared virtual area (SVA) 73
85, 86
R shared virtual storage 73
shift-in (SI) character (DBCS) 8
terminal output 64, 76
RA2 assembler option 77 terms, number of, in expressions 11
shift-out (SO) character (DBCS) 8
read-only control sections 12 TEST assembler option 78
SI (shift-in) character (DBCS) 8
reading edited macros 39 THREAD assembler option 78
SIZE assembler option 73, 78
record numbers 60 time of assembly 36
SO (shift-out) character (DBCS) 8
redefining conditional assembly TITLE instruction 60
softcopy publications viii
instructions 33 TITLE operand, double-byte character
software requirements 83
redefining macro names 20 set 8
source and object listing
redefining standard operation codes as Toolkit Customization book vii
121-character format 47
macro names 26 Toolkit installation and customization
133-character format 48
Release 6, what’s new 1 book information vii
description 46
relocatable address constants, 2-byte 8 TRANSLATE assembler option 78
source macro, error messages for 64
relocation dictionary listing 49 translation table 9
source stream input (AREAD) 24
RENT assembler option 77, 81 TRMEXIT assembler option 76
source stream insertion (AINSERT) 25
requirements type attribute of a CNOP label 32
SPACE instruction 60
hardware 83 TYPECHECK assembler option 78
start time of assembly 60
software 83
statistics
storage 85
I/O exit usage 38
resident macro definition text 73
resident source text 73
in the listing 60 U
stop time of assembly 60 underscore, in symbol names 11
resident tables 73
sublists, multilevel 22 Unicode support 9
revised assembler instructions 6
substitution in macro instruction unreferenced symbols defined in
RLD assembler option 77
operation code 22 CSECTs 52
RMODE instruction 11
substring length value 30 USING assembler option 57, 78
RSECT instruction 5, 12
suppress USING instruction
RXREF assembler option 53, 77
alignment zeroes in generated dependent USING 15
text 62 example of map listing 56
dumping of global SET symbols (in labeled USING 14
S MHELP options) 66 using map listing 56
sample I/O exits 39 suppressed messages listing 60
sample interchange program using SUPRWARN assembler option 78
macros 25
saved segment in CMS 73
symbol and literal cross reference
listing 50
V
variable symbol length 10
SDB 65 symbol name definition 10, 11
virtual storage
SECTALGN assembler option 77
CMS requirements 84
W
what’s new in High Level Assembler
release 6 1
WORKFILE assembler option 78
X
XATTR instruction 5
XOBJECT assembler option 11, 84
XREF assembler option 52, 78
Z
z/OS
assembling under 83
use of link pack area by High Level
Assembler 73
virtual storage requirements 83
z/OS publications 89
z/VM
assembling under CMS 84
CMS interface command 65
CMS saved segment 73
z/VM publications 89
z/VSE publications 90
zeroes, suppress alignment 62
Index 95
96 HLASM: V1R6 General Information
Readers’ Comments — We’d Like to Hear from You
High Level Assembler for z/OS & z/VM & z/VSE
General Information
Release 6
We appreciate your comments about this publication. Please comment on specific errors or omissions, accuracy,
organization, subject matter, or completeness of this book. The comments you send should pertain to only the
information in this manual or product and the way in which the information is presented.
For technical questions and information about products and prices, please contact your IBM branch office, your
IBM business partner, or your authorized remarketer.
When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any
way it believes appropriate without incurring any obligation to you. IBM or any other organizations will only use
the personal information that you supply to contact you about the issues that you state on this form.
Comments:
Name Address
Company or Organization
_ _ _ _ _ _ _Fold
_ _ _and
_ _ _Tape
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _Please
_ _ _ _ _do
_ _not
_ _ staple
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _Fold
_ _ _and
_ _ Tape
______
NO POSTAGE
NECESSARY
IF MAILED IN THE
UNITED STATES
IBM Corporation
Reader Comments
DTX/E269
555 Bailey Avenue
San Jose, CA
U.S.A. 95141-9989
_________________________________________________________________________________________
Fold and Tape Please do not staple Fold and Tape
Cut or Fold
GC26-4943-05 Along Line
Printed in USA
GC26-4943-05