age in a descending order of addresses, and both the
count and the address are stepped down. When the
count in any operation reaches zero, the storage area
defined by the ccw is exhausted.
Any main-storage location provided in the system
can be used to transfer data to or from an I/O device,
provided that during an input operation the location
is not protected. Similarly, the ccw's can be specified
in any part of available main storage. When the chan­
nel attempts to store data at a protected location, the
protection-check condition is generated, and the de­
vice is signaled to terminate the operation.
When the channel refers to a location not provided
in the system, the program-check condition is gener­
ated. When this condition occurs because the first ccw
designated by the CAW contains a data address ex­
ceeding the addressing capacity of the model, the I/O operation is not initiated, and the status portion of the
csw with the program-check indication is stored dur­
ing execution of START I/O. Invalid data addresses de­
tected after initiation of the opcration or detection of
an invalid ccw address during chaining is indicated
to the program with the interruption conditions at the
termination of the operation or chain of operations.
During an output operation, thc channel may fetch
data from main storage ahead of the time the I/O de­
vice requests the data. As many as 16 bytes may be
prefetehed and buffered. Similarly, on data chaining
during an output operation, the channel may fetch the
new ccw when as many as 16 bytes remain to be
transferred under the control of the current ccw.
When the I/O operation uses data and ccw's from 10- ations near the end of the available storage, such pre­
fetching may cause the channel to refer to locations
that do not exist. Invalid addresses detected during
prefetching of data or ccw's do not affect the execu­
tion of the operation and do not cause error indica­
tions until the I/O operation actually attempts to use
the information. If the operation is terminated by the I/O device or by HALT I/O before the invalid informa­
tion is needed, the condition is not brought to the
attention of the program. Storage addresses do not wrap around to location 0 unless the system has the maximum addressable stor­
age (16,777,216 bytes). When the maximum address­
able storage is provided, location 0 follows location
16,777,215 and, on reading backward, location
16,777,215 follows location O. The count field in the ccw can specify any number
of bytes up to 65,535. Except for a ccw specifying
transfer in channel, it may not contain the value zero.
Whenever the count field in the ccw initially contains
a zero, the program-check condition is generated.
When this occurs in the first ccw designated by the
98
CAW, the operation is not initiated, and the status por­
tion of the csw with the program-check indication is
stored during execution of START I/O. When a count
of zero is detected during data chaining, the I/O de­
vice is signaled to terminate the operation. Detection
of a count of zero during command chaining sup­
presses initiation of the new operation and generates
an interruption condition. Chaining When the channel has performed the transfer of in­
formation specified by a ccw, it can continue the ac­
tivity initiated by START I/O by fetching a new ccw.
The fetching of a new ccw upon the exhaustion of the
current ccw is called chaining and the ccw's belonging
to such a sequence are said to be chained.
Chaining takes place only between ccw's 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
ccw's located in noncontiguous storage areas can be
coupled for chaining purposes by a transfer in chan­
nel command. All ccw's in a chain apply to the I/O device specified in the original START I/O. 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 the ccw. These flags specify the action
to be taken by the channel upon the exhaustion of
the current ccw. The following code is used:
CD CC ACTION o 0 No chaining. The current CCW is the last.
o 1 Command chaining
1 0 Data chaining
1 1 Data chaining
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 transfer
in channel is used for the type of chaining specified
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. Data chaining occurs only when all data
designated by the current ccw have been transferred
to or from the device and causes the operation to con­
tinue, using the storage area designated by the new
ccw. The content of the command-code field of the
new ccw is ignored, unless it specifies 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 or from the device. When
the last byte has been placed in main storage or ac­
cepted by the device, the new ccw takes over the con­
trol of the operation and replaces the pertinent in­
formation in the subchannel. If the device sends chan­
nel end after exhausting 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 termination identifies the new ccw.
If programming errors are detected h ... the new ccw
or during its fetching, the program-check condition is
generated, and the device is signaled to terminate the
operation when it attempts to transfer data designatcd
by the new ccw. If the device signals the channel-end
condition before transferring any data designated by
the new ccw, program check is indicated in the csw
associated with the termination. Unless the address of
the new ccw is invalid or programming errors are de­
tected in an intervening transfer-in-channel command,
the content of the csw pertains to the new ccw. A
data address referring to a nonexistent area or, on
reading, to a protected area causes an error indication
only after the I/O device has attempted to transfer
data to or from the invalid location, but an address
exceeding the addressing capacity of the model is de­
tected immediately upon fetching the ccw.
Data chaining during an input operation causes the
new ccw to be fetched when all data designated by
the current ccw have been placed in main storage. On an output operation, the channel may fetch the new
ccw from main storage ahead of the time data chain­
ing occurs. The earliest such prefetching may occur
is when 16 bytes still remain to be transferred under
the control of the current ccw. Any programming
errors in the prefetched ccw, however, do not affect
the execution of the operation until all data desig­
nated by the current ccw have been transferred to the I/O device. If the device terminates the operation be­
fore all data designated by the current ccw have been
transferred, the conditions associated with the pre­
fetched ccw are not indicated to the program. Only one ccw describing a data area may be pre­
fetched and buffered in the channel. If the prefetched
ccw specifies transfer in channel, only one more ccw
is fetched before the exhaustion of the current ccw.
Programming Notes
Data chaining permits information to be rearranged
as it is transferred between main storage and the I/O device. Data chaining also permits a block of informa­
tion to be transferred to or from noncontiguous areas
of storage, and, when used in conjunction with the
skipping function, it permits the program to place in
storage selected portions of a block of data.
When during an input operation, the program
specifies data chaining to a location into which data
have been placed under the control of the current
ccw, the channel fetches the new contents of the lo­
cation, even if the location contains the last byte
transferred under thc control of the current ccw.
The program, therefore, can use self-describing rec­
ords; that is, it can chain to a ccw that has been read
under the control of the current ccw. However,
since the program is not notified of any data errors
until the end of the operation, there is no assurance
that the ccw is correct. The ccw in main storage may
be invalid even though its parity is good.
Command Chaining
During command chaining, the new ccw fetched by
the channel specifies a new I/O operation. The chan­
nel fetches the new ccw and initiates the new oper­
ation upon the receipt of the device-end signal for the
current operation. When command chaining takes
place, the completion of the current operation does
not cause an I/O interruption, and the count indicat­
ing the amount of data transferred during the current
operation is not made available to the program. For
operations involving data transfer, the new command
always applies to the next block at the device. Command chaining takes place and the new oper­
ation is initiated only if no unusual conditions have
been detected in the current operation. If a condition
such as unit check, unit exception, or incorrect length has occurred, the sequence of operations is termi­
nated, and the status associated with the current op­
eration causes an interruption condition to be gener­
ated. The new ccw in this case is not fetched. The
incorrect-length condition does not suppress command
chaining if the current ccw has the SLI Hag on.
An exception to sequential chaining of ccw's occuts
when the I/O device presents the status-modifier con­
dition with the device-end signal. When command
chaining is specified and no unusual conditions have
been detected, the combination of status-modifier and
device-end bits causes the channel to fetch and chain
to the ccw whose main-storage address is 16 higher
than that of the current ccw.
When both command and data chaining are used,
the first ccw associated with the operation specifies
the operation to be executed, and the last ccw indi­
cates whether another operation follows.
Input/Output Operations 99
Previous Page Next Page