Command Code
The command code, bit positions 0-7 of the CCW,
specifies to the channel and the I/O device the oper­
ation to be performed. A detailed description of each
command appears under" Commands. " The two low-order bits or, when these bits are 00, the four low-order bits of the command code identi­
fy the operation to the channel. The channel distin­
guishes among the following four operations: Output forward (write, control)
Input forward (read, sense)
Input backward (read backward)
Branching (transfer in channel)
The channel ignores the high-order bits of the
command code.
Commands that initiate I/O operations (write,
read, read backward, control, and sense) cause all
eight bits iQf the command code to be transfened to
the I/O device. In these command codes, the high­
order bit positions contain modifier bits. The modifi­
er bits specify to the device how the command is to
be executed. They may cause, for example, the de­
vice to compare data received during a write opera­
tion with data previously recorded, and they may
specify such conditions as recording density and
parity. For the control command, the modifer bits
may contain the order code specifying the control
function to be performed. The meaning of the modi­
fier bits depends on the type of I/O device and is
specified in the SL or SRL publication for the de­
vice.
The command -code assignment is listed in the
following table. The symbol x indicates that the bit
position is ignored; m identifies a modifier bit. Code Command xxxx 0000 Invalid mmmm 0100 Sense
xxx x 1000 Transfer in Channel mmmm 1100 Read Backward
mmmm mm01 Write
mmmm mm10 Read
mrnmm mm11 Control Whenever the channel detects an invalid com­
mand code during the initiation of a command, the
program-check condition is generated. When the
first CCW designated by the CAW contains an in­
valid command code, the status portion of the CSW with the program-check indication is stored during
execution of START I/O or, if being executed as START I/O, START I/O FAST RELEASE. When
the invalid code is detected during command chain­
ing or subsequent to the execution of ST ART I/O FAST RELEASE, the new operation is not initiated,
and an interruption condition is generated. The com-
212 System/370 Principles of Operation manq code is ignored during data chaining, unless it
specifies transfer in channel.
Designation of Storage Area Note: For a description of the storage area associat­
ed with a CCW when channel indirect data address­
ing is invoked, see "Channel Indirect Data Address-
. " .' mg.
The main-storage area associated with an I/O operation is defined by one or more CCWs. A CCW
defines an area by specifying the address of the first
eight-bit byte to be transferred and the number of
consecutive eight-bit bytes contained in the area.
The address of the first byte appears in the data­
address field of the CCW. The number of bytes con­
tained in the storage area is specified in the count
field.
In write, read, control, and sense operations stor­
age locations are used in ascending order of address­
es. As information is transferred to or from main
storage, the address from the address field is incre­
mented, and the count from the count field is decre­
mented. The read-backward operation places data in
storage in a descending order of addresses, and both
the count and the address are decremented. When
the count reaches zero, the storage area defined by
the CCW is exhausted.
Any main-storage location available to the chan­
nel can be used in the transfer of data to or from an I/O device, provided that the location is not protect­
ed against the type of reference. Similarly, the
CCWs can be located in any part of available main
storage, provided the location is not protected
against a fetch-type reference. When the channel
attempts to refer to a protected location, the protec­
tion check condition is generated, and the device is
signaled to terminate the operation.
In the event the channel refers to a location not
provided in the system, the program-check condition
is generated. When the first CCW designated by the
CAW is at a nonexistent location, the I/O operation
is not initiated, and the status portion of the CSW with the program-check indication is stored during
the execution of START I/O or ST ART I/O FAST RELEASE being executed as START I/O. Invalid
data addresses, as well as any invalid CCW address­
es detected on chaining or subsequent to the execut­
ing of START I/O FAST RELEASE, are indicated
to the program with the interruption conditions at
the conclusion of the operation or chain of opera­
tions.
During an output operation, the channel may
fetch data from the main storage before the time the I/O device requests the data. Any number of bytes
specified by the current CCW may be prefetched
and buffered. When data chaining during an output
operation, the channel may fetch the next CCW at
any time during the execution of the current CCW.
When the I/O operation uses data and CCWs from
locations near the end of the available storage, such
pre fetching may cause the channel to refer to loca­
tions that do not exist. Invalid addresses detected
during prefetching of data or CCWs do not affect
the execution of the operation and do not cause er­
ror indications until the I/O operation actually at­ tempts to use the information. If the operation is
concluded by the I/O device or by HALT I/O, HALT DEVICE, or CLEAR I/O before the invalid
information is needed, the condition is not brought
to the attention of the program.
The count field in the CCW can specify any num­ ber of bytes up to 65,535. Except for a CCW specify­ ing transfer in channel, where the count field is
ignored, the count field may not contain the value
zero. Whenever the count field in the CCW initially
contains a zero, the program-check condition is gen­
erated. When this occurs in the first CCW designat­
ed by the CAW, the operation is not initiated, and
the status portion of the CSW with the program­
check indication is stored during execution of ST ART I/O or START I/O FAST RELEASE being
executed as START I/O. When a count of zero is
detected during data chaining, the I/O device is sig­
naled to terminate the operation. Detection of a count of zero during command chaining or subse­ quent to the execution of ST ART I/O FAST RE­ LEASE suppresses initiation of the new operation
and generates an interruption condition.
Chaining
When the channel has performed the transfer of
information specified by a CCW, it can continue the
activity initiated by START I/O or START I/O FAST RELEASE by fetching a new CCW. Such
fetching of a new CCW is called chaining, and the
CCWs belonging to such a sequence are said to be
chained.
Chaining takes place CCWs located in
successive double word locations in storage. It pro­
ceeds in an ascending order of addresses; that is, the
address of the new CCW is obtained by adding eight
to the address of the current CCW. Two chains of
CCWs located in noncontiguous storage areas can
be coupled for chaining purposes by a transfer-in­
channel command. All CCW s in a chain apply to the I/O device specified in the original START I/O or
START I/O FAST RELEASE.
Two types of chaining are provided: chaining of
data and chaining of commands. Chaining is con-
trolled by the chain-data (CD) and chain-command
(CC) flags in conjunction with the suppress-length­
indication (SLI) flag in the CCW. These flags speci­
fy the action to be taken by the channel upon the
exhaustion of the current CCW and upon receipt of
ending status from the device, as shown in the ac­ companying table.
The specification of chaining is effectively propa­ gated through a transfer-in-channel command. When
in the process of chaining a transfer-in-channel com­ mand is fetched, the CCW designated by the trans­ fer in channel is used for the type of chaining speci­
fied in the CCW preceding the transfer-in-channel.
The CD and CC flags are ignored in the transfer­ in-channel command.
Data Chaining
During data chaining, the new CCW fetched by the
channel defines a new storage area for the original I/O operation. Execution of the operation at the I/O device is not affected. When all data designated
by the current CCW has been transferred to main
storage or to the device, data chaining causes the
operation to continue, using the storage area desig­ nated by the new CCW. The contents of the
command-code field of the new CCW are ignored,
unless they specify transfer in channel.
Data chaining is considered to occur immediately
after the last byte of data designated by the current
CCW has been transferred to main storage or to the
device. When the last byte of the transfer has been
placed in main storage or accepted by the device, the
new CCW takes over the control of the operation
and replaces the pertinent information in the sub­
channel. If the device sends channel end after ex­
hausting the count of the current CCW but before
transferring any data to or from the storage area
designated by the new CCW, the CSW associated
with the concluded operation pertains to the new
CCW.
If programming errors are detected in the new
CCW or during its fetching, the error indication is
generated, and the device is signaled to conclude the
operation when it attempts to transfer data designat­
ed by the new CCW. If the device signals the
channel-end condition before transferring any data
designated by the new CCW, program check or pro­ tection check is indicated in the CSW associated
with the termination. The contents of the CSW per­
tain to the new CCW unless the address of the new
CCW is invalid, the location is protected against
fetching, or programming errors are detected in an
intervening transfer-in-channel command. A data
Input/Output Operations 213
Previous Page Next Page