Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
CNOP instruction HLASM Language Reference SC26-4940-06 |
|||||||||||||||||||||||||||||||
The CNOP instruction aligns any instruction or other data on a
specific halfword boundary. This ensures an unbroken flow of executable
instructions, since the CNOP instruction generates no-operation instructions
to fill the bytes skipped to achieve specified alignment. If a control
section has not been established, CNOP initiates an unnamed (private)
control section.
>>-+--------+--CNOP--byte,boundary----------------------------->< '-symbol-'
Table 1 shows valid pairs of byte and word.
Figure 1 shows the position in a doubleword
that each of these pairs specifies. Both 0,4 and 2,4 specify two locations
in a doubleword.
Figure 1. CNOP alignment
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Quadword │ ├────────────────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────┤ │ Doubleword │ Doubleword │ ├─────────────────────────────────┬──────────────────────────────────┼─────────────────────────────────┬──────────────────────────────────┤ │ Fullword │ Fullword │ Fullword │ Fullword │ ├───────────────┬─────────────────┼────────────────┬─────────────────┼───────────────┬─────────────────┼────────────────┬─────────────────┤ │ Halfword │ Halfword │ Halfword │ Halfword │ Halfword │ Halfword │ Halfword │ Halfword │ ├───────┬───────┼────────┬────────┼────────┬───────┼────────┬────────┼───────┬───────┼────────┬────────┼────────┬───────┼────────┬────────┤ │ Byte │ Byte │ Byte │ Byte │ Byte │ Byte │ Byte │ Byte │ Byte │ Byte │ Byte │ Byte │ Byte │ Byte │ Byte │ Byte │ ├───────┴───────┴────────┴────────┴────────┴───────┴────────┴────────┼───────┴───────┴────────┴────────┴────────┴───────┴────────┴────────┤ │0,4 2,4 0,4 2,4 0,4 2,4 0,4 2,4 │ │0,8 2,8 4,8 6,8 0,8 2,8 4,8 6,8 │ │0,16 2,16 4,16 6,16 8,16 10,16 12,16 14,16 │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Use the CNOP instruction, for example, when you code the linkage
to a subroutine, and you want to pass parameters to the subroutine
in fields immediately following the branch and link instructions.
These parameters—for example, channel command words—can require alignment
on a specific boundary. The subroutine can then address the parameters
you pass through the register with the return address, as in the following
example:
Assume that the location counter is aligned at a doubleword boundary.
Then the CNOP instruction causes the following no-operations to be
generated, thus aligning the BALR instruction at the last halfword
in a doubleword as follows:
After the BALR instruction is generated, the location counter is at a doubleword boundary, thus ensuring that the CCW instruction immediately follows the branch and link instruction. The CNOP instruction forces the alignment of the location counter to a halfword, fullword, doubleword, or quadword boundary. It does not affect the location counter if the counter is already correctly aligned. If the specified alignment requires the location counter to be incremented, no-operation instructions are generated to fill the skipped bytes. Any single byte skipped to achieve alignment to the first no-operation instruction is filled with zeros, even if the preceding byte contains no machine language object code. A length attribute reference to the name of a CNOP instruction is always invalid. Message ASMA042E is issued, and a default value of 1 is assigned. |
Copyright IBM Corporation 1990, 2014
|