HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

Terms, Literals, and Expressions Assembler Language │ Address Value │ Object Code Statements │ of Symbol │ in Hexadecimal ─────────────────────────┼─────────────────┼────────────────────────────────── │ Relocatable │ ┌────── Address │ │ ▼ of AREA │ │ ┌──┬─┬─┬────┐ LOAD L 3,AREA ▌1▐ LOAD ──────────┼────►│58│3││xxxx│ │ │ └──┴─┴─┴────┘ │ │ │ │ ┌───────────┐ AREA DS F ▌2▐ AREA ──────────┼────►│xx x x xxxx│ │ ┌──────┼────►└───────────┘ │ │ │ │ │ │ ┌───────────┐ F2 DC F'2' ▌3▐ F2 ──────────┼────►│ C8│ │ │ ┌──┼────►└───────────┘ ─────────────────────────┼──────────┼───┼──┼─────────────────────────────────── FULL EQU AREA │ FULL ───┘ │ │ ▌4▐ │ │ TW EQU F2 │ TW ───────┘ │ ─────────────────────────┼─────────────────┼─────────────────────────────────── │ Absolute │ │ │ R3 EQU 3 ▌5▐ R3=3 │ ┌────── Address │ │ ▼ of FULL │ │ ┌──┬─┬─┬────┐ L R3,FULL │ │ │58│3││xxxx│ │ │ ├──┼─┼─┼────┤ A R3,TW │ │ │5A│3││xxxx│ │ │ └──┴─┴─┴────┘ │ │ ▲ Address │ │ └────── of TW Figure 13. Transition from Assembler Language Statement to Object Code Restrictions on Symbols: A symbol must be defined only once in a source module with one or more control sections, with the following exceptions: The symbol in the name field of a CSECT, RSECT, DSECT, or COM instruction can be the same as the name of previous CSECT, RSECT, DSECT, or COM instruction, respectively. It identifies the resumption of the control section specified by the name field. The symbol in the name field of a CATTR instruction can be the same as the name of a previous CATTR instruction. It identifies the resumption of the class specified by the name field. The symbol in the name field of a LOCTR instruction can be the same as the name of a previous START, CSECT, RSECT, DSECT, COM, or LOCTR instruction. It identifies the resumption of the location counter specified by the name field. The symbol in the name field of a labeled USING instruction can be the same as the name of a previous labeled USING instruction. It identifies the termination of the domain of the previous labeled USING instruction with the specified name. A symbol can be used as an operand of a V-type constant and as an ordinary | label, without duplication, because the operand of a V-type constant does not | define the symbol in the symbol table. 32 HLASM V1R5 Language Reference

Terms, Literals, and Expressions An ordinary symbol is not defined when: It is used in the name field of an OPSYN or TITLE instruction. It can, therefore, be used in the name field of any other statement in a source module. It is used as the operand of a V-type address constant. It is only used in the name field of a macro instruction and does not appear in the name field of a macro-generated assembler statement. It can, therefore, be used in the name field of any other statement in a source module. It is only used in the name field of an ALIAS instruction and does not appear in one of the following: – The name field of a START, CSECT, RSECT, COM, or DXD instruction. – The name field of a DSECT instruction and the nominal value of a Q-type address constant. – The operand of an ENTRY, EXTRN or WXTRN instruction. Previously Defined Symbols: An ordinary symbol is previously defined if the statement that defines it is processed before the statement in which the symbol | appears in an operand. An ordinary symbol must be defined by the time the END statement is reached, however, it need not be previously defined when it is used as follows: In operand expressions of certain instructions such as CNOP instructions and some ORG instructions In modifier expressions of DC, DS, and DXD instructions In the first operand of an EQU instruction In Q-type constants When using the forward-reference capability of the assembler, avoid the following types of errors: Circular definition of symbols, such as: X EQU Y Y EQU X Circular location-counter dependency, as in this example: A DS (B-A)C B LR 1,2 The first statement in this example cannot be resolved because the value of the duplication factor is dependent on the location of B, which is, in turn, dependent upon the length and duplication factor of A. Literals may contain symbolic expressions in modifiers, but any ordinary symbols used must have been previously defined. Chapter 2. Coding and Structure 33

Terms, Literals, and Expressions<br />

An ordinary symbol is not defined when:<br />

It is used in the name field of an OPSYN or TITLE instruction. It can,<br />

therefore, be used in the name field of any other statement in a source module.<br />

It is used as the operand of a V-type address constant.<br />

It is only used in the name field of a macro instruction and does not appear in<br />

the name field of a macro-generated assembler statement. It can, therefore, be<br />

used in the name field of any other statement in a source module.<br />

It is only used in the name field of an ALIAS instruction and does not appear in<br />

one of the following:<br />

– The name field of a START, CSECT, RSECT, COM, or DXD instruction.<br />

– The name field of a DSECT instruction and the nominal value of a Q-type<br />

address constant.<br />

– The operand of an ENTRY, EXTRN or WXTRN instruction.<br />

Previously Defined Symbols: An ordinary symbol is previously defined if the<br />

statement that defines it is processed before the statement in which the symbol<br />

| appears in an operand.<br />

An ordinary symbol must be defined by the time the END statement is reached,<br />

however, it need not be previously defined when it is used as follows:<br />

In operand expressions of certain instructions such as CNOP instructions and<br />

some ORG instructions<br />

In modifier expressions of DC, DS, and DXD instructions<br />

In the first operand of an EQU instruction<br />

In Q-type constants<br />

When using the forward-reference capability of the assembler, avoid the following<br />

types of errors:<br />

Circular definition of symbols, such as:<br />

X EQU Y<br />

Y EQU X<br />

Circular location-counter dependency, as in this example:<br />

A DS (B-A)C<br />

B LR 1,2<br />

The first statement in this example cannot be resolved because the value of the<br />

duplication factor is dependent on the location of B, which is, in turn, dependent<br />

upon the length and duplication factor of A.<br />

Literals may contain symbolic expressions in modifiers, but any ordinary symbols<br />

used must have been previously defined.<br />

Chapter 2. Coding and Structure 33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!