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

COPY Instruction In the following example, addressability to the common area of storage is established relative to the named statement XYZ. . . L 1,=A(XYZ) USING XYZ,1 MVC PDQ(16),=4C'ABCD' . . COM XYZ DS 16F PDQ DS 16C . . A common control section may include any assembler language instructions, but no object code is generated by the assembly of instructions or constants appearing in a common control section. Data can only be placed in a common control section through execution of the program. If the common storage is assigned in the same manner by each independent assembly, reference to a location in common by any assembly results in the same location being referenced. COPY Instruction Use the COPY instruction to obtain source statements from a source language library and include them in the program being assembled. You can thereby avoid writing the same, often-used sequence of code over and over. ►►──┬─────────────────┬──COPY──member──────────────────────────────►◄ └─sequence_symbol─┘ sequence_symbol is a sequence symbol. member is an ordinary symbol that identifies a source language library member to be copied from either a system macro library or a user macro library. In open code it can also be a variable symbol that has been assigned a valid ordinary symbol. The source statements that are copied into a source module: Are inserted immediately after the COPY instruction. Are inserted and processed according to the standard instruction statement coding format, even if an ICTL instruction has been specified. Must not contain either an ICTL or ISEQ instruction. Can contain other COPY statements. There are no restrictions on the number of levels of nested copy instructions. However, the COPY nesting must not be recursive. For example, assume that the source program contains the statement: 122 HLASM V1R5 Language Reference

CSECT Instruction COPY A and library member A contains the statement: COPY B In this case, the library member B must not contain a COPY A or COPY B statement. Can contain macro definitions. Note, however, that if a source macro definition is copied into a source module, both the MACRO and MEND statements that delimit the definition must be contained in the same level of copied code. Notes: 1. The COPY instruction can also be used to copy statements into source macro definitions. 2. The rules that govern the occurrence of assembler language statements in a source module also govern the statements copied into the source module. 3. Whenever the assembler processes a COPY statement, whether it is in open code or in a macro definition, the assembler attempts to read the source language library member specified in the COPY statement. This means that all source language library members specified by COPY statements in a source program, including those specified in macro definitions, must be available during the assembly. The HLASM Programmer's Guide describes how to specify the libraries when you run the assembler. 4. If an END instruction is encountered in a member during COPY processing, the assembly is ended. Any remaining statements in the COPY member are discarded. CSECT Instruction The CSECT instruction initiates an executable control section or indicates the continuation of an executable control section. ►►──┬────────┬──CSECT──────────────────────────────────────────────►◄ └─symbol─┘ 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 The CSECT instruction can be used anywhere in a source module after any ICTL or *PROCESS statements. If it is used to initiate the first executable control section, it must not be preceded by any instruction that affects the location counter and thereby causes a control section to be initiated. If symbol denotes an ordinary symbol, the ordinary symbol identifies the control section. If several CSECT instructions within a source module have the same Chapter 5. Assembler Instruction Statements 123

CSECT Instruction<br />

COPY<br />

A<br />

and library member A contains the statement:<br />

COPY B<br />

In this case, the library member B must not contain a COPY A or COPY B<br />

statement.<br />

Can contain macro definitions. Note, however, that if a source macro definition<br />

is copied into a source module, both the MACRO and MEND statements that<br />

delimit the definition must be contained in the same level of copied code.<br />

Notes:<br />

1. The COPY instruction can also be used to copy statements into source macro<br />

definitions.<br />

2. The rules that govern the occurrence of assembler language statements in a<br />

source module also govern the statements copied into the source module.<br />

3. Whenever the assembler processes a COPY statement, whether it is in open<br />

code or in a macro definition, the assembler attempts to read the source<br />

language library member specified in the COPY statement. This means that all<br />

source language library members specified by COPY statements in a source<br />

program, including those specified in macro definitions, must be available<br />

during the assembly. The <strong>HLASM</strong> Programmer's Guide describes how to<br />

specify the libraries when you run the assembler.<br />

4. If an END instruction is encountered in a member during COPY processing, the<br />

assembly is ended. Any remaining statements in the COPY member are<br />

discarded.<br />

CSECT Instruction<br />

The CSECT instruction initiates an executable control section or indicates the<br />

continuation of an executable control section.<br />

►►──┬────────┬──CSECT──────────────────────────────────────────────►◄<br />

└─symbol─┘<br />

symbol<br />

is one of the following:<br />

An ordinary symbol<br />

A variable symbol that has been assigned a character string with a value<br />

that is valid for an ordinary symbol<br />

A sequence symbol<br />

The CSECT instruction can be used anywhere in a source module after any ICTL<br />

or *PROCESS statements. If it is used to initiate the first executable control<br />

section, it must not be preceded by any instruction that affects the location counter<br />

and thereby causes a control section to be initiated.<br />

If symbol denotes an ordinary symbol, the ordinary symbol identifies the control<br />

section. If several CSECT instructions within a source module have the same<br />

Chapter 5. Assembler Instruction Statements 123

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

Saved successfully!

Ooh no, something went wrong!