CSW DEBUG subcommand Use the CSW subcommand to display at the terminal the contents of the CSW (channel status word) as it existed at the time the debug environment was entered. The format of the CSW subcommand is: +----------+------------------------------------------------------------------+ | CSW | | +----------+------------------------------------------------------------------+ Usage Notes: 1. The CSW indicates the status of the channel or an input/output device, or the conditions under which an I/O operation terminated. The CSW is formed in the channel and stored in storage location X'40' when an I/O interruption occurs. If I/O interruptions are suppressed, the CSW is stored when the next Start I/O, Test I/O, or Halt I/O instruction is executed. 2. Whenever an I/O operation abnormally terminates, issue the CSW subcommand. The status and residual count information in the CSW is very useful in debugging. Also, use the CSW to calculate the address of the last executed CCW (subtract eight bytes from the command address to find the address of the last CCW executed). Responses: The contents of the CSW are displayed at the terminal in hexadecimal representation. Its format is: Bits Contents 0-3 The protection key is moved to the CSW from the CAW. It shows the protection key at the time the I/O operation started. The contents of this field are not affected by programming errors detected by the channel or by the condition causing termination of the operation. 4-7 This field is not used and must contain binary zeros. 8-31 The command address contains a storage address (in hexadecimal representation) that is eight bytes greater than the address of the last CCW executed. 32-47 The status bits indicate the conditions in the device or channel that caused the CSW to be stored. 48-63 The residual count is the difference between the number of bytes specified in the last executed CCW and the number of bytes that were actually transferred. When an input operation is terminated, the difference between the original count in the CCW and the residual count in the CSW is equal to the number of bytes transferred to storage; on an output operation, the difference is equal to the number of bytes transferred to the I/O device.