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 will initiate an unnamed (private) control section.
|
The name is assigned to the next halfword aligned location. There may be a single byte before that location, but this is skipped for alignment. There may be zero or more NOP(R)s generated at or after that location.
Table 15 shows valid pairs of byte and word.
| Values | Specify |
|---|---|
| 0,4 | Beginning of a word |
| 2,4 | Middle of a word |
| 0,8 | Beginning of a doubleword |
| 2,8 | Second halfword of a doubleword |
| 4,8 | Middle (third halfword) of a doubleword |
| 6,8 | Fourth halfword of a doubleword |
| 0,16 | Beginning of a quadword |
| 2,16 | Second halfword of a quadword |
| 4,16 | Third halfword of a quadword |
| 6,16 | Fourth halfword of a quadword |
| 8,16 | Fifth halfword of a quadword |
| 10,16 | Sixth halfword of a quadword |
| 12,16 | Seventh halfword of a quadword |
| 14,16 | Eighth halfword of a quadword |
Figure 16 shows the position in a doubleword that each of these pairs specifies. Note that both 0,4 and 2,4 specify two locations in a doubleword.
*-----------------------------------------------------------------------------------------------------------------------------------------* | 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:
CNOP 6,8
LINK BALR 2,10
CCW 1,DATADR,X'48',X'50'
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:
BCR 0,0
BC 0,X'700'
BALR 2,10
LINK CCW 1,DATADR,X'48',X'50'
After the BALR instruction is generated, the location counter is at a doubleword boundary, thereby 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 will be issued, and a default value of 1 is assigned.
[ Top of Page | Previous Page | Next Page | Contents | Index ]