22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Data Attributes<br />

Defined Attribute (D')<br />

The defined attribute shows whether or not the ordinary symbol or literal referenced<br />

has been defined prior to the attribute reference. A symbol is defined if it has been<br />

encountered in the operand field of an EXTRN or WXTRN statement, or in the<br />

name field of any other statement except a TITLE statement or a macro instruction.<br />

A literal is defined if it has been encountered in the operand field of a machine<br />

instruction. The value of the defined attribute is an arithmetic value that can be<br />

assigned to a SETA symbol, and is equal to 1 if the symbol has been defined, or 0<br />

if the symbol has not been defined.<br />

The defined attribute can reference:<br />

Ordinary symbols not constructed by substitution<br />

Macro instruction operands<br />

SETC symbols whose value is an ordinary symbol<br />

System variable symbols whose value is an ordinary symbol<br />

Literals<br />

The following is an example of how you can use the defined attribute:<br />

Name Operation Operand<br />

AIF<br />

(D'A).AROUND<br />

A LA 1,4<br />

.AROUND ANOP<br />

In this example, assuming there has been no previous definition of the symbol A,<br />

the statement labeled A would be assembled, since the conditional-assembly<br />

branch around it would not be taken. However, if by an AGO or AIF<br />

conditional-assembly branch the same statement were processed again, the<br />

statement at A would not be assembled:<br />

Name Operation Operand<br />

.UP AIF (D'A).AROUND<br />

A LA 1,4<br />

.AROUND ANOP<br />

.<br />

.<br />

AGO<br />

.UP<br />

You can save assembly time using the defined attribute which avoids lookahead<br />

mode (see “Lookahead” on page 340 for more information. You can use the<br />

defined attribute in your program to prevent the assembler from making this<br />

time-consuming forward scan. This attribute reference can be used in the operand<br />

field of a SETA instruction or as one of the values in the operand field of a SETB or<br />

AIF instruction.<br />

Operation Code Attribute (O')<br />

The operation code attribute shows whether a given operation code has been<br />

defined prior to the attribute reference. The operation code can be represented by<br />

a character string or by a variable symbol containing a character string. The<br />

variable must be set using a SETC assembler instruction prior to being referenced<br />

by the operation code (O') attribute.<br />

Chapter 9. How to Write Conditional Assembly Instructions 337

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

Saved successfully!

Ooh no, something went wrong!