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

ORG Instruction AFTER is defined in COPYBOOK, the following code gives an ASMA042E error (Length attribute of symbol is unavailable): AIF (L'AFTER LT 2).BEYOND OPCOPY OPSYN COPY OPSYN not processed during look ahead OPCOPY COPYBOOK OPCOPY fails .BEYOND ANOP , Redefining Conditional Assembly Instructions A redefinition of a conditional assembly instruction only comes into effect in macro definitions occurring after the OPSYN instruction. The original definition is always used when a macro instruction calls a macro that was defined and edited before the OPSYN instruction. An OPSYN instruction that redefines the operation code of an assembler or machine instruction generated from a macro instruction is, however, effective immediately, even if the definition of the macro was made prior to the OPSYN instruction. Consider the following example: MACRO Macro header MAC ... Macro prototype AIF ... MVC ... . MEND Macro trailer . AIF OPSYN AGO Assign AGO properties to AIF MVC OPSYN MVI Assign MVI properties to MVC . MAC ... Macro call (AIF interpreted as AIF instruction; 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 instructions are used to assign the properties of AGO to AIF and to assign the properties of MVI to MVC. In subsequent calls of the macro MAC, 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 instructions. 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. ORG Instruction The ORG instruction alters the setting of the location counter and thus controls the structure of the current control section. This redefines portions of a control section. If a control section has not been previously established, ORG will initiate an unnamed (private) control section. 200 HLASM V1R5 Language Reference

ORG Instruction ►►──┬────────┬──ORG─────────────────────────────────────────────────► └─symbol─┘ ►──┬────────────────────────────────────────────────┬──────────────►◄ | └─expression──┬────────────────────────────────┬─┘ | └─,──┬─boundary──┬───────────┬─┬─┘ | │ └─,──offset─┘ │ | └─,──offset───────────────┘ symbol is one of the following: An ordinary symbol A variable symbol that has been assigned a character string with a value that is valid for an ordinary symbol A sequence symbol If symbol denotes an ordinary symbol, the ordinary symbol is defined with the value that the location counter had before the ORG statement is processed. expression is a relocatable expression, the value of which is used to set the location counter. If expression is omitted, the location counter is set to the next available location for the current control section. | boundary | is an absolute expression that must be a power of 2 with a range from 8 | (doubleword) to 4096 (page). If boundary exceeds the SECTALGN value, | message ASMA500E is issued. | offset | Any absolute expression | If boundary or offset are provided, then the resultant location counter is calculated | by rounding the expression up to the next higher boundary and then adding the | offset value. In general, symbols used in expression need not have been previously defined. However, the relocatable component of expression (that is, the unpaired relocatable term) must have been previously defined in the same control section in which the ORG statement appears, or be equated to a previously defined value. A length attribute reference to the name of a ORG instruction is always invalid. Message ASMS042E is issued, and a default value of 1 is assigned. An ORG statement cannot be used to specify a location below the beginning of the control section in which it appears. For example, the following statement is not correct if it appears less than 500 bytes from the beginning of the current control section. ORG –5 This is because the expression specified is negative, and sets the location counter to a value larger than the assembler can process. The location counter wraps around (the location counter is discussed in detail in “Location Counter” on page 36). Chapter 5. Assembler Instruction Statements 201

ORG Instruction<br />

AFTER is defined in COPYBOOK, the following code gives an ASMA042E error<br />

(Length attribute of symbol is unavailable):<br />

AIF (L'AFTER LT 2).BEYOND<br />

OPCOPY OPSYN COPY OPSYN not processed during look ahead<br />

OPCOPY COPYBOOK<br />

OPCOPY fails<br />

.BEYOND ANOP ,<br />

Redefining Conditional Assembly Instructions<br />

A redefinition of a conditional assembly instruction only comes into effect in macro<br />

definitions occurring after the OPSYN instruction. The original definition is always<br />

used when a macro instruction calls a macro that was defined and edited before<br />

the OPSYN instruction.<br />

An OPSYN instruction that redefines the operation code of an assembler or<br />

machine instruction generated from a macro instruction is, however, effective<br />

immediately, even if the definition of the macro was made prior to the OPSYN<br />

instruction. Consider the following example:<br />

MACRO<br />

Macro header<br />

MAC ... Macro prototype<br />

AIF ...<br />

MVC ...<br />

.<br />

MEND<br />

Macro trailer<br />

.<br />

AIF OPSYN AGO Assign AGO properties to AIF<br />

MVC OPSYN MVI Assign MVI properties to MVC<br />

.<br />

MAC ... Macro call<br />

(AIF interpreted as AIF instruction;<br />

generated AIFs not printed)<br />

+ MVC ... Interpreted as MVI instruction<br />

.<br />

. Open code started at this point<br />

AIF ... Interpreted as AGO instruction<br />

MVC ... Interpreted as MVI instruction<br />

In this example, AIF and MVC instructions are used in a macro definition. AIF is a<br />

conditional assembly instruction, and MVC is a machine instruction. OPSYN<br />

instructions are used to assign the properties of AGO to AIF and to assign the<br />

properties of MVI to MVC. In subsequent calls of the macro MAC, AIF is still<br />

defined, and used, as an AIF operation, but the generated MVC is treated as an<br />

MVI operation. In open code following the macro call, the operations of both<br />

instructions are derived from their new definitions assigned by the OPSYN<br />

instructions. If the macro is redefined (by another macro definition), the new<br />

definitions of AIF and MVC (that is, AGO and MVI) are used for further generations.<br />

ORG Instruction<br />

The ORG instruction alters the setting of the location counter and thus controls the<br />

structure of the current control section. This redefines portions of a control section.<br />

If a control section has not been previously established, ORG will initiate an<br />

unnamed (private) control section.<br />

200 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!