$CONTROL PRIVILEGED, UNCALLABLE, CODE, MAP,   LIST                      00010000
                                                                        00015000
$TITLE "Antelope/Buckhorn MPE-V Magnetic Tape Driver."                  00020000
<<                                                                      00025000
  COPYRIGHT (C) COPYRIGHT HEWLETT-PACKARD CO. 1983.                     00030000
                                                                        00035000
      This program may be used with one computer system at a            00040000
      time and shall not otherwise be recorded, transmitted or          00045000
      stored in a retrieval system.  Copying or other reproduction      00050000
      of this program except for archival purposes is prohibited        00055000
      without the prior written consent of HEWLETT-PACKARD Company.     00060000
                                                                        00065000
                                                                        00070000
1       PRODUCT IDENTIFICATION                                          00075000
                                                                        00080000
1.1     PRODUCT NAME    :  HIOTAPE2 - MPE-V I/O Tape Driver (HP-IB)     00085000
        PRODUCT MNEMONIC:  BUCKHORN/ANTELOPE                            00090000
        MPE MODULE #    :  44                                           00095000
                                                                        00100000
2       HIOTAPE2 DESIGN                                                 00105000
                                                                        00110000
2.1     MAJOR MODULES                                                   00115000
                                                                        00120000
        The driver consists of a global area, a linkage area "outer     00125000
        block" for INITIAL, and two procedures (MTINIT and MTDRVR)      00130000
        which initialize and process requests for particular            00135000
        operations required from the device.                            00140000
                                                                        00145000
2.2     DRIVER CREATION                                                 00150000
                                                                        00155000
        At system start-up, the driver is created by PROGEN.            00160000
                                                                        00165000
        After system startup the Input/Output device monitor, SIODM,    00170000
        is the creator of HIOTAPE2.  SIODM is invoked through the       00175000
        ATTACHIO process.  During interrupt processing the driver is    00180000
        executed on the interrupt control stack (ICS).  Other           00185000
        processing is performed on the stack of the process which       00190000
        invoked the driver.                                             00195000
                                                                        00200000
        For user processes, the driver is invoked through the           00205000
        following processing.  The file system creates the initial      00210000
        request and calls ATTACHIO.  ATTACHIO creates the               00215000
        appropriate request in the I/O Queue (IOQ) table.  ATTACHIO     00220000
        then calls the I/O device monitor SIODM.  SIODM freezes the     00225000
        data segments associated with the request and calls the         00230000
        driver.  The driver looks up appropriate information in the     00235000
        IOQ and creates a channel program to satisfy the request and    00240000
        sends it to the  device.  When the device completes the         00245000
        request, an interrupt is generated which invokes the general    00250000
        interrupt processor (GIP).  GIP then calls ATTACHIO which in    00255000
        turn calls SIODM.  SIODM calls the driver.  The driver checks   00260000
        for success or failure, marks the appropriate status and        00265000
        returns to SIODM.  SIODM unfreezes the data segment and         00270000
        returns to ATTACHIO, which returns to the file system.  The     00275000
        file system processing may be by-passed if so desired by        00280000
        calling ATTACHIO directly.                                      00285000
                                                                        00290000
2.3     PROCEDURE INTERFACE                                             00295000
                                                                        00300000
        A single parameter is passed to MTINIT when called.  This is    00305000
        a pointer to the Device Information Table (DIT) array for       00310000
        this particular device.                                         00315000
                                                                        00320000
        There are six parameters passed to MTDRVR.  The first           00325000
        parameter passed is the index to the Input/Output Queue         00330000
        (IOQ) array for the current request.  IOQ elements contain      00335000
        information relevent to the current request.                    00340000
                                                                        00345000
        The second parameter is a pointer to the DIT array.  DIT        00350000
        elements contain information about its associated device.       00355000
        This is information which must be saved between I/O requests    00360000
        to the driver.  There is one DIT array per unit on the          00365000
        controller.  The third parameter is the memory bank where       00370000
        the data is to be written to or read from by the device.        00375000
        The fourth parameter is the offset within the memory bank       00380000
        (memory address) where the data is to be written to or read     00385000
        from.  The third and fourth parameters comprise the absolute    00390000
        memory location where the data buffer resides.  The fifth       00395000
        variable passed is a pointer to the channel program which       00400000
        is also a part of the Interrupt Linkage Table (ILT) array.      00405000
        The last parameter passed is a pointer to the hardware          00410000
        interrupt location for the device.                              00415000
                                                                        00420000
2.4     PROCEDURE OVERVIEW                                              00425000
                                                                        00430000
        MTINIT is responsible for setting up the channel program with   00435000
        the parameters required for most of the Read, Write, and End    00440000
        commands.  A channel program is issued to enable immediate      00445000
        report (driver default).  The idle channel program is started   00450000
        if it is not already running.  The idle channel program is the  00455000
        process by which the driver can be invoked upon an unexpected   00460000
        interrupt from the device.                                      00465000
                                                                        00470000
        MTDRVR is the main procedure for the driver.   This procedure   00475000
        is responsible for initiating and completing I/O requests       00480000
        against the device.  MTDRVR is always called by the I/O device  00485000
        monitor SIODM.  MTDRVR determines the reason for the call by    00490000
        examining the IOQ array for the request and the DIT array.      00495000
        When a new request is initiated, MTDRVR examines the function   00500000
        code and parameter fields contained in the IOQ to determine     00505000
        what operation is to be performed.  The proper command codes    00510000
        and program branches are then placed in the channel program     00515000
        and its execution is begun with a call to the external          00520000
        procedure START'HPIB.                                           00525000
                                                                        00530000
        Upon completion of the request, an interrupt is generated and   00535000
        MTDRVR is again called.  The driver checks for current          00540000
        activity in progress, and this being the case, transfers to     00545000
        the completion section of the driver.  The completion section   00550000
        examines the device status words returned by the channel        00555000
        program for errors or special conditions which might have       00560000
        occurred during the execution of the channel program, the       00565000
        data transfer, or the operation of the device.  These           00570000
        conditions can cause error retries and/or special notation      00575000
        back to the caller.                                             00580000
                                                                        00585000
        The following is a brief description of the external            00590000
        procedures called by the driver.                                00595000
                                                                        00600000
      o TIMEREQ                                                         00605000
                                                                        00610000
        This procedure initiates a timeout request.  This is used to    00615000
        wake-up the driver after a one second pause for mounting a      00620000
        write ring.                                                     00625000
                                                                        00630000
      o ABORTTIMEREQ                                                    00635000
                                                                        00640000
        This procedure terminates a timeout request.                    00645000
                                                                        00650000
      o EOFCHECK                                                        00655000
                                                                        00660000
        This procedure checks for an end-of-file (EOF) condition.  The  00665000
        conditions which can be checked for are:  Hardware EOF, DATA    00670000
        command, end-of-data (EOD) command, JOB command, end-of-job     00675000
        (EOJ) command, and no EOF found.                                00680000
                                                                        00685000
      o GIP'HPIB                                                        00690000
                                                                        00695000
        This procedure handles all general interrupt processing.        00700000
                                                                        00705000
      o IOMESSAGE                                                       00710000
                                                                        00715000
        This procedure is used for sending messages to the console.     00720000
                                                                        00725000
      o SIODM                                                           00730000
                                                                        00735000
        This procedure is the I/O device monitor process.  This         00740000
        procedure activates the I/O driver.                             00745000
                                                                        00750000
      o START'HPIB                                                      00755000
                                                                        00760000
        This procedure starts a channel program.                        00765000
                                                                        00770000
      o MASTERCLEARHPIB                                                 00775000
                                                                        00780000
        This procedure terminates channel program processing.           00785000
                                                                        00790000
      o GETDRT                                                          00795000
                                                                        00800000
        This procedure returns the value of a specified word from       00805000
        the DRT entry for the device.                                   00810000
                                                                        00815000
2.5     PROCEDURE PROCESSING                                            00820000
                                                                        00825000
2.5.1   MTINIT                                                          00830000
                                                                        00835000
        MTINIT aquires the pointer to the ILT array from the DIT array. 00840000
        From the ILT array, pointers to the channel program and channel 00845000
        program status area are acquired.  Using the channel program    00850000
        pointer, the pointer to the idle channel program and SYSDB      00855000
        location of the channel program are acquired.  The SYSDB        00860000
        location of the idle channel program is acquired using the      00865000
        pointer to the idle channel program.  Using this information,   00870000
        the channel program is initialized with data for most of the    00875000
        read, write and end commands.  A channel program is issued which00880000
        enables immediate report processing.  If the idle channel       00885000
        program is not running, it is started with a call to START'HPIB.00890000
                                                                        00895000
2.5.2   MTDRVR                                                          00900000
                                                                        00905000
2.5.2.1 DRIVER INITIATOR SECTION                                        00910000
                                                                        00915000
        This section is responsible for validating new requests and     00920000
        issuing the channel program for execution of the request.       00925000
                                                                        00930000
2.5.2.2 DRIVER COMPLETOR SECTION                                        00935000
                                                                        00940000
        This section is responsible for checking the success or failure 00945000
        of a completed request, logging any device errors, and informing00950000
        the calling process of the success or failure of the request    00955000
        (through the IOQ).                                              00960000
                                                                        00965000
2.5.2.3 IMMEDIATE REPORT                                                00970000
                                                                        00975000
        Immediate report allows one command to be actively processing   00980000
        while other commands are queued and readied for execution within00985000
        the same controller.  The use of immediate report can           00990000
        significantly contribute to performance improvement since the   00995000
        time spent executing the first command is overlapped with the   01000000
        setup of the next command.                                      01005000
                                                                        01010000
        Immediate report is used only for write requests.  The device   01015000
        will respond with a success status immediately after the DMA    01020000
        transfer from memory to the device's internal buffer is         01025000
        complete.  This allows another DMA transfer to be sent to the   01030000
        device while the device is transfering the data from the        01035000
        internal buffer to tape.  The default mode will be immediate    01040000
        report enabled.                                                 01045000
                                                                        01050000
        If immediate report is disabled, any failures of a request will 01055000
        be reported back to the user in the status area for that        01060000
        request.                                                        01065000
                                                                        01070000
        If immediate report is enabled, any failure of a transfer of    01075000
        data from the internal buffer to tape may not be reported       01080000
        immediately.  The user will be informed that the transfer was   01085000
        successful upon completion of the transfer from memory to the   01090000
        device's internal buffer.  If the device fails to write the data01095000
        to tape, the failure may not be reported back in the status area01100000
        for the same request.  That is, since it is possible to submit  01105000
        multiple DMA transfers to the device's buffer successfully      01110000
        before a prior one has been completely transferred to the tape, 01115000
        the failure may be indicated in the status of a request         01120000
        submitted after the original failure.                           01125000
                                                                        01130000
        With immediate report enabled, the user must check status from  01135000
        the last rewind, close file, or close device.  This is necessary01140000
        to ensure that the last write performed was successful when     01145000
        transferred from the internal buffer to the tape.  Users who do 01150000
        not adhear to this run the risk of missing a failure status for 01155000
        the last record transferred to tape.                            01160000
                                                                        01165000
2.5.2.4 READ-AHEAD                                                      01170000
                                                                        01175000
        With the read-ahead capability of the device, there is no need  01180000
        for the immediate report for reads.  Read-ahead continues to    01185000
        transfer data after the end of the current record into the      01190000
        device's internal buffer.  This transfer continues until another01195000
        command is received, the internal buffer is filled, a read error01200000
        occurs, or an end or interrupt (EOI) condition occurs.          01205000
                                                                        01210000
        The read-ahead operation does not change the logical position of01215000
        the tape for the current request.  Requests are processed       01220000
        against the internal buffer until the operation exceeds the     01225000
        limits of the internal buffer.  When this occurs, the device    01230000
        will again fill the buffer with data, repositioning as required 01235000
        depending upon the request which caused the buffer to be filled.01240000
                                                                        01245000
2.5.2.5 INDIVIDUAL COMMAND PROCESSING                                   01250000
                                                                        01255000
        Each request will be processed through the initiator section and01260000
        completor section of MTDRVR.  The initiator section is          01265000
        responsible for validating new requests.  If the request is new 01270000
        and has not been initiated, this section creates the channel    01275000
        program necessary to initiate and execute the request and exits.01280000
        Channel programs are sent to the device by calling the external 01285000
        procedure START'HPIB.                                           01290000
                                                                        01295000
        The completor section of MTDRVR is responsible for determining  01300000
        the success or failure of the request.  A failure of a request  01305000
        is determined by checking the error status and the device       01310000
        specified jump (DSJ) vector.  If either of these are non zero, a01315000
        failure has occured.  If the request is completed successfully, 01320000
        the IOQ entry is marked as such and MTDRVR exits.  If the       01325000
        request failed, the completor section logs the device status    01330000
        values in the DIT, interogates the device status to determine   01335000
        the specific reason for the failure, places the appropriate     01340000
        error status in the IOQ, and exits.                             01345000
                                                                        01350000
2.5.2.6 REQUEST PROCESSING                                              01355000
                                                                        01360000
        The following is a description of how the driver will process   01365000
        each individual function when requested.                        01370000
                                                                        01375000
        The device recognizes byte transfers only, therefore, if the IOQ01380000
        transfer count is in words,  the driver will convert it to bytes01385000
        when sent to the device.  A positive transfer count indicates a 01390000
        word transfer.  A negative transfer count indicates a byte      01395000
        transfer.                                                       01400000
                                                                        01405000
        New requests will generate the initialization of the channel    01410000
        program to initiate and execute the request.  The channel       01415000
        program is sent to the device via a call to the external        01420000
        procedure START'HPIB.                                           01425000
                                                                        01430000
        If the request has been completed, the I/O status will be placed01435000
        in the IOQ entry for the request and the request marked         01440000
        complete.                                                       01445000
                                                                        01450000
      o READ (function code 0)                                          01455000
                                                                        01460000
        This request transfers one record from tape to main memory.     01465000
                                                                        01470000
        A transfer count greater than 16384 bytes is invalid.           01475000
                                                                        01480000
        If the count requested is greater than the actual number of     01485000
        bytes contained in the record, only the actual number of bytes  01490000
        will be transferred.  If the byte count is less than the actual 01495000
        number of bytes, only the number of bytes requested will be     01500000
        transfered.  This aspect of the read is handled by the drive    01505000
        controller itself.                                              01510000
                                                                        01515000
        If the transfer count is zero, this request will be processed as01520000
        a forward space record request.                                 01525000
                                                                        01530000
        If the transfer count is less than six, a short read process    01535000
        will be created.  The short read process will transfer the data 01540000
        into the short read buffer of the channel program instead of the01545000
        user's buffer.  In the completor section of MTDRVR, it will be  01550000
        transferred into the user's buffer.  Short read processing is   01555000
        used for processing JOBs submitted from the device.  With a     01560000
        short read, the external procedure EOFCHECK (see description of 01565000
        EOFCHECK earlier in this document) is used to check for special 01570000
        conditions that may be encountered from JOBs.                   01575000
                                                                        01580000
      o WRITE (function code 1)                                         01585000
                                                                        01590000
        This request transfers one record from main memory to tape.     01595000
                                                                        01600000
        A transfer count greater than 16384 bytes is invalid.           01605000
                                                                        01610000
        If the transfer count is zero, the request will generate a write01615000
        ring presence check on the device.  If a write ring is not      01620000
        present, a message is sent to the console requesting a write    01625000
        ring mount and a timeout process started with a call to the     01630000
        external procedure TIMEREQ.  This process causes the driver to  01635000
        pause for 1 second to allow the operator to mount a write ring. 01640000
        When the driver is invoked again, it checks for a timeout       01645000
        occurance.  If a timeout has occured, the driver will call the  01650000
        external procedure ABORTTIMEREQ to remove it from timeout       01655000
        processing.                                                     01660000
                                                                        01665000
        Bit 13 of the IOQ param 2 indicates if writes past end-of-tape  01670000
        are allowed.  If this bit is not zero, the driver will allow a  01675000
        write to extend past the EOT marker.  If a write past EOT is    01680000
        allowed and occurs, the IOQ I/O status will reflect this        01685000
        condition.  If a write past EOT is not allowed and is attempted,01690000
        the driver will indicate this in the IOQ I/O status.            01695000
                                                                        01700000
      o OPEN FILE (function code 2)                                     01705000
                                                                        01710000
        This request will enable or disable immediate report as         01715000
        specified in the IOQ param 2.  If IOQ param 2 is zero,          01720000
        immediate reporting will be enabled.  If IOQ param 2 is one,    01725000
        immediate reporting will be disabled.                           01730000
                                                                        01735000
      o CLOSE FILE (function code 3)                                    01740000
                                                                        01745000
        This request generates a null operation with a good status      01750000
        returned in the IOQ I/O status.                                 01755000
                                                                        01760000
        No channel program is executed for this request.                01765000
                                                                        01770000
      o CLOSE DEVICE (function code 4)                                  01775000
                                                                        01780000
        This request resets the end-of-file flags in the Logical        01785000
        Physical Device Table entry for this device.  Immediate report  01790000
        will be enabled (driver default) and a rewind-offline operation 01795000
        performed.                                                      01800000
                                                                        01805000
      o REWIND (function code 5)                                        01810000
                                                                        01815000
        This request will move the tape back to load point and leave the01820000
        device on-line.                                                 01825000
                                                                        01830000
      o WRITE FILE MARK (function code 6)                               01835000
                                                                        01840000
        This request will write one file mark on the tape.              01845000
                                                                        01850000
        Bit 13 of the IOQ param 2 indicates if writes past end-of-tape  01855000
        are allowed.  If this bit is not zero, the driver will allow a  01860000
        write to extend past the EOT marker.  If a write past EOT is    01865000
        allowed and occurs, the IOQ I/O status will reflect this        01870000
        condition.  If a write past EOT is not allowed and is attempted,01875000
        the driver will indicate this in the IOQ I/O status.            01880000
                                                                        01885000
      o FORWARD SPACE FILE (function code 7)                            01890000
                                                                        01895000
        This request will move the tape forward until a tape mark is    01900000
        encountered.  The tape will be positioned immediately following 01905000
        the tape mark found.                                            01910000
                                                                        01915000
      o BACKSPACE FILE (function code 8)                                01920000
                                                                        01925000
        This request moves the tape in the reverse direction until an   01930000
        end-of-file mark or the beginning-of-tape is detected.  If the  01935000
        operation is successful, the tape will be positioned in front of01940000
        the end-of-file mark or at the beginning-oftape.                01945000
                                                                        01950000
        If the tape is at the beginning-of-tape when this request is    01955000
        received, status will be returned indicating success with no    01960000
        execution of a channel program.                                 01965000
                                                                        01970000
      o REWIND AND OFFLINE (function code 9)                            01975000
                                                                        01980000
        This request will move the tape back to the beginning-of-tape   01985000
        and place the unit offline.                                     01990000
                                                                        01995000
        If the unit is already at the beginning-of-tape and offline, a  02000000
        successful status will be placed in the IOQ and no channel      02005000
        program will be executed.                                       02010000
                                                                        02015000
      o GAP TAPE (function code 10)                                     02020000
                                                                        02025000
        This request will erase approximately 3.5 inches of tape.       02030000
                                                                        02035000
      o FORWARD SPACE RECORD (function code 11)                         02040000
                                                                        02045000
        This request will move the tape in a forward direction until the02050000
        next inter-record gap is detected.  The tape will be positioned 02055000
        in front of the inter-record gap found.                         02060000
                                                                        02065000
      o BACKSPACE RECORD (function code 12)                             02070000
                                                                        02075000
        This request will move the tape in a backward direction until an02080000
        inter-record gap is detected or the beginning-of-tape is found. 02085000
        The tape will be positioned in front of the inter-record gap    02090000
        found or at the beginning-of-tape.                              02095000
                                                                        02100000
        If the tape is at the beginning-of-tape when this request is    02105000
        encountered,  a success condition will be placed in the  IOQ I/O02110000
        status and no channel program will be executed.                 02115000
                                                                        02120000
      o SUPPLY BYTE COUNT (function code 14)                            02125000
                                                                        02130000
        This request will return the actual byte count, in two bytes,   02135000
        contained in the record just read reguardless of the requested  02140000
        transfer count.                                                 02145000
                                                                        02150000
        No channel program is executed for this request.                02155000
                                                                        02160000
      o GENERIC STATUS (function code 15)                               02165000
                                                                        02170000
        This request will transfer the generic status, in two bytes,    02175000
        from the last request.                                          02180000
                                                                        02185000
        No channel program is executed for this request.                02190000
                                                                        02195000
      o SET DENSITY (function code 16)                                  02200000
                                                                        02205000
        This request will write the requested density ID on the tape.   02210000
        This request can be issued only when the unit is online, and the02215000
        tape positioned at load point.                                  02220000
                                                                        02225000
        Density specifications are in QPARM2, bits 13-15.               02230000
        0 = set density to 6250 (GCR).  Buckhorn only.                  02235000
        1 = set density to 1600 (PE).  Buckhorn and Antelope.           02240000
        2 - set density to 800 (NRZI).  Antelope only.                  02245000
                                                                        02250000
      o DOWNLOAD DIAGNOSTIC (function code 18).                         02255000
                                                                        02260000
        This request will download and execute a diagnostic program.    02265000
                                                                        02270000
        A transfer count greater than 16384 bytes is invalid.           02275000
                                                                        02280000
      o READ DIAGNOSTIC RESULTS (function code 19)                      02285000
                                                                        02290000
        This request will return the diagnostic program's status.  A    02295000
        single byte is returned from this command.                      02300000
                                                                        02305000
      o LOOPBACK (function code 20)                                     02310000
                                                                        02315000
        This request exercises the ABI, bus transceivers, data buffer   02320000
        handshake logic and buffer memory to ensure correct operation of02325000
        the HP-IB communication link.  The data sent to the drive is    02330000
        stored in the data buffer and echoed back to the host when      02335000
        requested.                                                      02340000
                                                                        02345000
      o SELFTEST (function code 21)                                     02350000
                                                                        02355000
        This request causes the drive to perform a selected selftest    02360000
        routine.  See 4.4 Selftest Selection for a description of the   02365000
        modes.  A single byte of data is passed to the driver indicating02370000
        which selftest mode is to be performed.  Two bytes of selftest  02375000
        results are returned.                                           02380000
                                                                        02385000
      o END DIAGNOSTIC (function code 22)                               02390000
                                                                        02395000
        This request terminates a diagnostic program.                   02400000
                                                                        02405000
      o IDENTIFY (function code 23)                                     02410000
                                                                        02415000
        This request returns a two byte identity code.  The identity    02420000
        code for Buckhorn is 0178 (Hex) and 0172 (Hex) for Antelope.    02425000
                                                                        02430000
        Bit      Meaning                                                02435000
                                                                        02440000
        0-2      Storage device, value 000                              02445000
        3-6      Value 0000                                             02450000
        7        Non 13037 protocol, value 1                            02455000
        8        Value 0                                                02460000
        9        Command queuing capability, value 1                    02465000
        10-15    Device dependent                                       02470000
                                                                        02475000
      o SPEED SELECT (function code 24)                                 02480000
                                                                        02485000
        This request changes the read/write speed of the drive.  This   02490000
        feature is supported only on Antelope and is ignored by         02495000
        Buckhorn.                                                       02500000
                                                                        02505000
        The speed requested is found in QPARM2.  A zero indicates       02510000
        streaming mode (100 IPS) and a one indicates start/stop mode    02515000
        (50 IPS).                                                       02520000
                                                                        02525000
      o DEVICE STATUS (function code 25)                                02530000
                                                                        02535000
        This request will transfer the actual device status from the    02540000
        last I/O operation.  The transfer count must be greater than 2  02545000
        bytes and will be invalid if it isn't.  The maximum number of   02550000
        bytes returned is six.  A transfer count in excess of six will  02555000
        not be considered an error and six bytes of status will be      02560000
        returned.                                                       02565000
                                                                        02570000
        No channel program is executed for this request.                02575000
                                                                        02580000
      o READ STATUS LOG (function code 26)                              02585000
                                                                        02590000
        This request will transfer the device's internal status log to  02595000
        main memory.  For information on this log see the Diagnostic    02600000
        ERS.                                                            02605000
                                                                        02610000
        The transfer count must be at least 4213 bytes.  Any value less 02615000
        than 4213 bytes will be invalid.  A transfer count in excess of 02620000
        4213 bytes will not be considered an error and the request will 02625000
        return only 4213 bytes.                                         02630000
                                                                        02635000
      o WRITE FIRMWARE (function code 27)                               02640000
                                                                        02645000
        This request downloads a firmware update to the device.  For    02650000
        information on the format of the firmware update see the        02655000
        hardware diagnostic ERS.                                        02660000
                                                                        02665000
        The transfer count must be greater than zero and cannot be      02670000
        greater than 4000 bytes.  Any value outside this range will be  02675000
        considered invalid.                                             02680000
                                                                        02685000
      o READ FIRMWARE (function code 28)                                02690000
                                                                        02695000
        This request will transfer firmware code from the device to main02700000
        memory.  For information on the format of the firmware code see 02705000
        the hardware diagnostic ERS.                                    02710000
                                                                        02715000
        The transfer count must be greater than zero.  A transfer count 02720000
        greater than 4000 bytes will not be considered an error.        02725000
                                                                        02730000
      o ENABLE/DISABLE IMMEDIATE REPORT (function code 29)              02735000
                                                                        02740000
        This request will enable or disable the immediate reporting     02745000
        feature of the device for writes.                               02750000
                                                                        02755000
        If the QPARM 2 parameter is zero, immediate report for writes   02760000
        will be disabled.  If the QPARM 2 parameter is one, immediate   02765000
        report for writes will be enabled.                              02770000
                                                                        02775000
      o GET DEVICE STATUS (function code 30)                            02780000
                                                                        02785000
        This request will transfer the actual device status after all   02790000
        requests under immediate report have been completed.            02795000
                                                                        02800000
        The transfer count must be greater than 2 bytes and will be     02805000
        invalid if it isn't.  The maximum number of bytes returned is   02810000
        six.  A transfer count in excess of six will not be considered  02815000
        an error and the six bytes of status will be returned.          02820000
                                                                        02825000
      o DEVICE CLEAR (function code 31)                                 02830000
                                                                        02835000
        This request performs an AMIGO device clear against the device. 02840000
                                                                        02845000
3       MAJOR DATA STRUCTURES                                           02850000
                                                                        02855000
        There are four MPE tables used by the driver.  These are the    02860000
        Device Reference Table (DRT), Device Information Table (DIT),   02865000
        Interrupt Linkage Table (ILT), and Input/Output Queue (IOQ)     02870000
        table.                                                          02875000
$PAGE                                                                   02880000
3.1     DEVICE REFERENCE TABLE (DRT)                                    02885000
                                                                        02890000
        There is one DRT for each device controller configured on the   02895000
        system.  The contents of the table are used for processing      02900000
        interrupts.                                                     02905000
                                                                        02910000
        %   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15  MNEMONIC    02915000
          ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---             02920000
        0 |        Channel Program Pointer (SIOP)         | DRT0        02925000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             02930000
        1 | Channel Program Variable Area Pointer (CPVA)  | DRT1        02935000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             02940000
        2 |        Interrupt Handler Program Label        | DRT2        02945000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             02950000
        3 |ST|SH|PF|          Status          |WS|GF|DT|WT| DRT3        02955000
          ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---             02960000
                                                                        02965000
        DRT0 - Channel Program Pointer.                                 02970000
               Absolute address of the current I/O instruction in       02975000
               execution for this device.                               02980000
                                                                        02985000
        DRT1 - Channel Program Variable Area Pointer.                   02990000
               Absolute address of the base of the Interrupt Linkage    02995000
               Table (ILT).  Points to first word of the channel program03000000
               variable area of the ILT for controller.                 03005000
                                                                        03010000
        DRT2 - Interrupt Handler Program Label.                         03015000
               The external program label of the interrupt service      03020000
               routine for the controller.                              03025000
                                                                        03030000
        DRT3 - Channel Program Status.                                  03035000
               Contains channel program status information which is used03040000
               by the channel program interpreter.                      03045000
               ST - channel program is running.                         03050000
               SH - SIOP or HIOP instruction pending.                   03055000
               PF - powerfail recovery in progress.                     03060000
               WS - waiting for device status request.                  03065000
               GF - GIC FIFO buffer not empty.                          03070000
               DT - DMA transfer active.                                03075000
               WT - channel program in wait state.                      03080000
$PAGE                                                                   03085000
3.2     DEVICE INFORMATION TABLE (DIT)                                  03090000
                                                                        03095000
        There is one DIT per physical device.  If a physical device     03100000
        represents more than one logical device, the logical device     03105000
        number is obtained from the IOQ array.                          03110000
                                                                        03115000
         %   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15  MNEMONIC   03120000
           ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---            03125000
         0 | 0| 0|AC|RQ| 0|MU| 0|IO|IA|NO|ST| 0|   State   | DFLAG      03130000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03135000
         1 | SYSDB relative pointer to the DIT for the next| DLINK      03140000
           | device requesting this resource or service    |            03145000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03150000
         2 | SYSDB relative pointer to the first IOQ in    | DIOQP      03155000
           | request list for this device.                 |            03160000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03165000
         3 |        | Phys. unit # | Logical device number | DLDEV      03170000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03175000
         4 | SYSDB relative pointer to Device Linkage Table| DDLTP      03180000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03185000
         5 | SYSDB relative pntr to Interrupt Linkage Table| DILTP      03190000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03195000
         6 |RW|RU|SH|     |PF|          |EOV|PP|IR| EI  |PA| DS         03200000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03205000
         7 | Hardware error status.  Set when the driver   | DSERR      03210000
           | detects an error.  Whenever <> 0, the driver  |            03215000
           | monitor logs an I/O error and clears this word|            03220000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03225000
        10 | Bit 0 is set at completion of timer.          | DTIME      03230000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03235000
        11 | Interrupt status for this unit.  Set by the   | DSTAT      03240000
           | driver each time it processes an interrupt.   |            03245000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03250000
        12 | Holds the time out request entry index while  | DRQST      03255000
           | a timer is active.                            |            03260000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03265000
        13 | Error log. Contains 6 bytes of status from    | DDEVSTAT   03270000
        14 | the previous operation.                       |            03275000
        15 |                                               |            03280000
           ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---            03285000
                                                                        03290000
        DFLAG - Device Flags and Request State.                         03295000
                AC - A monitor is currently servicing this device.      03300000
                RQ - A service request is pending while the monitor is  03305000
                     active.                                            03310000
                MU - This device is on a multi-unit controller.         03315000
                IO - An I/O Channel Program is running for this device. 03320000
                IA - An interrupt or response has occurred for this     03325000
                     device.                                            03330000
                NO - Not ready, start Idle Channel Program then go to   03335000
                     state %10.                                         03340000
                ST - The device monitor is starting an idle channel     03345000
                     program for this device.  There is no IOQ          03350000
                     associated with this state.                        03355000
                                                                        03360000
        STATE - Device Monitor State.                                   03365000
                Specifies the next action to be taken by SIODM in       03370000
                servicing the request:                                  03375000
                  0 - Start a new request.                              03380000
                  1 - Not used.                                         03385000
                  2 - Call driver initiator procedure.                  03390000
                  3 - Call driver completor procedure.                  03395000
                  4 - Not used.                                         03400000
                  5 - Completed request processing.                     03405000
                  6 - Initiate device recognition sequence.             03410000
                  7 - Start operator intervention wait.                 03415000
                %10 - Wait for interrupt (operator intervention),       03420000
                      restart at state 0.                               03425000
                %11 - Wait for data segment freeze, then state 2.       03430000
                %12 - Wait for driver initiator to be frozen, then      03435000
                      allocate controller (state 2).                    03440000
                %13 - Wait for I/O completion interrupt, then state 3.  03445000
                %14 - Wait for controller, then call driver initiator.  03450000
                %15 - Not used.                                         03455000
                %16 - Wait for initiator make present, then state 2.    03460000
                %17 - Wait for completor make present, then state 3.    03465000
                                                                        03470000
       DSAVE - Device processing flags.                                 03475000
               RW - Indicates tape has been rewound.                    03480000
               RO - Indicates a rewind/offline was performed to allow   03485000
                    a write-ring mount.                                 03490000
               SH - Indicates a short read is in progress.  After       03495000
                    completion of the read, EOF is checked for and if   03500000
                    not present, the data requested is transferred from 03505000
                    the short read buffer to the user's buffer.         03510000
               PF - Indicates device is powered up.                     03515000
              EOV - enable check on 2 consecutive EOFs.                 03520000
                    0 - no check                                        03525000
                    1 - enable                                          03530000
                    2 - 1 EOF read                                      03535000
                    3 - 2 consecutive EOFs encountered                  03540000
               PP - Device powerfail processing flag.                   03545000
                    0 - Device powerfail process complete.              03550000
                    1 - 1st pass of device powerfail processing.        03555000
               IR - Immediate report status.                            03560000
                    0 - Immediate report is disabled.                   03565000
                    1 - Immediate report is enabled.                    03570000
               EI - EOF processing indicator.                           03575000
                    0 - Last operation was not a write file mark.       03580000
                    1 - Last operation was a write file mark.           03585000
                    2 - Device buffered operations are being            03590000
                        completed prior to issuing the second           03595000
                        of a double write file mark (EOF).              03600000
               PA - Pending abort processing.                           03605000
                                                                        03610000
       DSTAT - First two bytes of device status.                        03615000
               See 4.2 DEVICE STATUS LAYOUT.                            03620000
$PAGE                                                                   03625000
3.3     INTERRUPT LINKAGE TABLE (ILT)                                   03630000
                                                                        03635000
        There is one ILT for each device controller configured on the   03640000
        system.                                                         03645000
                                                                        03650000
         %   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15  MNEMONIC   03655000
           ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---            03660000
         0 |                    Channel                    | ICPVA0     03665000
         1 |                    Program                    | ICPVA1     03670000
         2 |                    Variable                   | ICPVA2     03675000
         3 |                  Area (ICPVA)                 | ICPVA3     03680000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03685000
         4 |                   DMA Abort                   | ICPVA4     03690000
         5 |                    Address                    | ICPVA5     03695000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03700000
         6 |                       0                       | ISRQL      03705000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03710000
         7 |LI|     CHANQUE     | IMB |   CHAN    |  DEV   | ICNTRL     03715000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03720000
        10 | SYSDB relative pointer to Channel Program area| ISIOP      03725000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03730000
        11 | SYSDB relative pointer to Status Return area  | ISTAP      03735000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03740000
        12 | Single instruction that is executed to extract| IUNIT      03745000
           | the device unit number from the status pointed|            03750000
           | to by ISTAP                                   |            03755000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03760000
        13 | SYSDB  relative  DIT  pointer  of  the  device| ICDP       03765000
           | currently using the  channel to perform a data|            03770000
           | operation                                     |            03775000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03780000
        14 |       SIOPSIZE        |         CQUEN         | IQUEUE     03785000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03790000
        15 |RW|WP|IG|                          |  HCUNIT   | IFLAG      03795000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03800000
        16 | SYSDB relative DIT pointer for unit 0  *      | IDITP0     03805000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03810000
        17 |             Idle Channel Program              |            03815000
        20 |              Status Return Area               | ISTAT      03820000
        21 |                                               |            03825000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            03830000
        22 |                    Mag Tape                   |            03835000
         . |                    Channel                    |            03840000
         . |                    Program                    |            03845000
         . ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---            03850000
                                                                        03855000
        * This driver does not support more than one unit.              03860000
                                                                        03865000
        ICPVA0 - Channel Program Variable Area                          03870000
                 ICPVA0 is used by the Channel Program processor to     03875000
                 store status information after I/O channel aborts.     03880000
                 ICPVA1 is use  by thedriver to indicate if status      03885000
                 should be   examined for speci conditions or errors.   03890000
                 ICPVA2 and ICPVA3 are not used.                        03895000
                                                                        03900000
        ICPVA4 &                                                        03905000
        ICPVA5 - DMA Abort Address                                      03910000
                 If a DMA abort occurs, the absolute address where the  03915000
                 abort occurred is stored in this area.                 03920000
                                                                        03925000
        ICNTRL - Controller Information                                 03930000
                 LI       - If this bit is set, the controller is       03935000
                            sharing a software channel resource in order03940000
                            to limit bandwidth.                         03945000
                 CHANQUE  - The software channel resource number.       03950000
                 IMB      - IMB number.  (First 2 bits of DRTN).        03955000
                 CHAN     - Channel number.  (Next 4 bits of DRTN).     03960000
                 DEV      - Device number.  (Next 3 bits of DRTN).      03965000
                 IQUEUE   -                                             03970000
                 SIOPSIZE - (number of words + 1) / 2 in the channel    03975000
                            program area.                               03980000
                 CQUEN    - For a multi-unit controller, this field     03985000
                            contains the software controller resource   03990000
                            number.                                     03995000
                                                                        04000000
        IFLAG - Controller and Channel Program State Flags              04005000
                RW     - An idle channel program should be started when 04010000
                         there are no active requests to process.       04015000
                WP     - An idle channel program has been started for   04020000
                         this controller.  This bit is reset by an      04025000
                         interrupt.                                     04030000
                IG     - An HIOP instruction has been issued against    04035000
                         this controller but the channel program was not04040000
                         in a wait state.  Therefore, ignore the        04045000
                         interrupt generated by the channel code when   04050000
                         this program halts.                            04055000
                HCUNIT - Highest configured unit number for this        04060000
                         controller.                                    04065000
                                                                        04070000
        ISTAT - Idle Channel Program Status Return                      04075000
                See 4.2 DEVICE STATUS LAYOUT.                           04080000
$PAGE                                                                   04085000
3.4     I/O QUEUE REQUEST TABLE (IOQ)                                   04090000
                                                                        04095000
         %   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15  MNEMONIC   04100000
           ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---            04105000
         0 |            Request dependent flags            | QFLAG      04110000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            04115000
         1 | SYSDB relative pointer to next IOQ element.   | QLINK      04120000
           | Points to first word of element.              |            04125000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            04130000
         2 |                       | Logical device number | QLDEV      04135000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            04140000
         3 |           |BO|                    | RTCNTR    | QMISC      04145000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            04150000
         4 | S| If QFLAG.(3:1) is clear then this is the   | QDSTN      04155000
           |    DST number of the target data segment.  If |            04160000
           |    S is set, QADDR is DB relative.            |            04165000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            04170000
         5 | offset in the data segment or system buffer   | QADDR      04175000
           | table to the target data buffer.              |            04180000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            04185000
         6 |                       | Function code for     | QFUNC      04190000
           |                       | this request.  (See   |            04195000
           |                       | next section.)        |            04200000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            04205000
         7 | On initiation, specifies the word count (> 0) | QWBCT      04210000
           | or byte count (< 0).  At completion of the    |            04215000
           | request this location contains the actual     |            04220000
           | transmission count in the same units (bytes   |            04225000
           | or words) as in the request.                  |            04230000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            04235000
        10 | IOQ param 1.                                  | QPAR1      04240000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            04245000
        11 | IOQ param 2.  Used to indicate writing past   | QPAR2      04250000
           | EOT allowed or density specification.         |            04255000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            04260000
        12 |         PCBN          |  QUALIFIER   | STATUS | QSTAT      04265000
           ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---            04270000
                                                                        04275000
        QFLAG - Request dependent flags.                                04280000
                Bit  0 - ABORT, abort this request and return an error  04285000
                         indication to the caller.                      04290000
                     1 - not used.                                      04295000
                     2 - not used.                                      04300000
                     3 - SYSBUFF, target is an index relative to the    04305000
                         SBUF table of the data buffer.                 04310000
                     4 - IOWAKE, wake caller on completion of request.  04315000
                     5 - BLOCKED, blocked I/O.  The caller is waited in 04320000
                         ATTACHIO until the request is completed.       04325000
                         Implies IOWAKE.                                04330000
                     6 - COMPLETED, the request has been completed and  04335000
                         the caller awakened if he had requested (with  04340000
                         IOWAKE).                                       04345000
                     7 - DATAFRZN, set by the memory management routines04350000
                         (MAM) when a MAKEPRESENT request is successfull04355000
                         completed and indicates the data segment is    04360000
                         frozen in memory.                              04365000
                     8 - MAMERRORD, an error has occurred while MAM was 04370000
                         trying to make the target data segment present 04375000
                         and freeze it in memory.                       04380000
                     9 - not used.                                      04385000
                    10 - SFAIL, delayed failure of SIO instruction.     04390000
                         If a cal  to START'HPIB resulted in the request04395000
                         being added to the the channel queue, this bit 04400000
                         indicates that the SIO instruction failed when 04405000
                         the request was selected for execution.        04410000
                    11 - PFAIL, the request was aborted because of a    04415000
                         system power failure.                          04420000
                                                                        04425000
        QMISC - Driver Request Dependent Flags                          04430000
                RTCNTR - Retry count for a read or a write.             04435000
                BODEOF - Backspace record due to a data EOF processing  04440000
                         in       progress.                             04445000
                                                                        04450000
        QSTAT - PCB Number and Request Completion Status                04455000
                PCBN      - The Process Control Block (PCB) number of   04460000
                            the process which made this request.  If    04465000
                            zero, the request is not associated with    04470000
                            any process and the IOQ element is to be    04475000
                            returned by the system when the request     04480000
                            completes.                                  04485000
                STATUS    - General status indicating the final state of04490000
                            the request.  The following codes are used: 04495000
                            0 - Not started or awaiting completion.     04500000
                            1 - Successful completion.                  04505000
                            2 - End-of-file detected.                   04510000
                            3 - Unusual, but recoverable, condition     04515000
                                detected.                               04520000
                            4 - Irrecoverable error has occurred.       04525000
                QUALIFIER - A code which further defines or qualifies   04530000
                            the status.  (See Driver Return Status      04535000
                            Codes.)                                     04540000
$PAGE                                                                   04545000
4       STATUS/SELFTEST/FRU LAYOUTS                                     04550000
                                                                        04555000
4.1     IOQ I/O STATUS                                                  04560000
                                                                        04565000
        The following status values are returned by the Buckhorn driver.04570000
                                                                        04575000
        General Status    Qualifying Status (8:5)      Overall Value    04580000
             (13:3)             (8:5)                                   04585000
                                                                        04590000
        0 - Pending         1 - Completion wait           %10           04595000
                            3 - Not ready wait            %30           04600000
                            4 - No write ring wait        %40           04605000
                                                                        04610000
        1 - Successful      0 - No errors                   1           04615000
                            2 - Retry was necessary       %21           04620000
                            3 - EOT after write           %31           04625000
                                                                        04630000
        2 - End-of-file     1 - A tape  mark was  read                  04635000
                                or P1 was non-zero and                  04640000
                                the  last record  read                  04645000
                                was a tape mark           %12           04650000
                                                                        04655000
        3 - Unusual         3 - Request aborted           %33           04660000
                            4 - PRIOR'ERR'ABORT           %43           04665000
                            5 - PASS'EOV'ABORT            %53           04670000
            condition       6 - Powerfail abort           %63           04675000
                            7 - BOT and backspace                       04680000
                                requested                 %73           04685000
                          %10 - Tape runaway             %103           04690000
                          %11 - EOT and write requested  %113           04695000
                          %21 - Device powered up        %213           04700000
                          %23 - Set density and not at                  04705000
                                load point               %233           04710000
                                                                        04715000
       4 - Irrecoverable    0 - Invalid request             4           04720000
           error            1 - Transmission error        %14           04725000
                            3 - Timing error              %34           04730000
                            4 - SIO failure               %44           04735000
                            5 - Unit failure              %54           04740000
                          %12 - System error             %124           04745000
                          %14 - Channel failure          %144           04750000
$PAGE                                                                   04755000
4.2     DEVICE STATUS LAYOUT                                            04760000
                                                                        04765000
        WORD 1                                                          04770000
                                                                        04775000
        Bit     Meaning                                                 04780000
                                                                        04785000
          0     End-of-file (EOF)                                       04790000
          1     Beginning-of-tape (BOT)/Load-point (LP)                 04795000
          2     End-of-tape (EOT)                                       04800000
          3     Recovered error (STE)                                   04805000
          4     Command reject                                          04810000
          5     File protect (not write enabled; no write ring)         04815000
          6     Unrecovered error (MTE)                                 04820000
          7     Unit online                                             04825000
          8     GCR (6250 BPI Density)                                  04830000
          9     Unknown density                                         04835000
         10     Data parity error                                       04840000
         11     Timing error                                            04845000
         12     Tape runaway                                            04850000
         13     Door open                                               04855000
         14     Not used                                                04860000
         15     Immediate report enable                                 04865000
                                                                        04870000
        WORD 2                                                          04875000
                                                                        04880000
        Bit     Meaning                                                 04885000
                                                                        04890000
          0     PE (1600 BPI Density)                                   04895000
          1     NRZI (800 BPI Density)                                  04900000
          2     Power restored                                          04905000
          3     HPIB Command Parity Error                               04910000
          4     Position Unrecovered                                    04915000
          5     Formatter error                                         04920000
          6     Servo error                                             04925000
          7     Controller error                                        04930000
          8-10  Command Reject detail                                   04935000
                000 - Null code                                         04940000
                001 - Reserved                                          04945000
                010 - Device Reject                                     04950000
                011 - Protocol Reject                                   04955000
                                                                        04960000
                100 - Reserved                                          04965000
                101 - Prior error reject                                04970000
                110 - Reserved                                          04975000
                111 - Selftest failure                                  04980000
         11-15  Retry count.                                            04985000
                                                                        04990000
        WORD 3 (left byte)                                              04995000
                                                                        05000000
        The contents of this byte contains binary coded information     05005000
        regarding the specific error encountered.                       05010000
                                                                        05015000
        If COMMAND REJECT                                               05020000
                                                                        05025000
          5 - Device is write protected when a write type command was   05030000
              initiated.                                                05035000
          6 - Tape was not tensioned when the command was queued.       05040000
          7 - Write density command given but requested density is not  05045000
              available (option not present).                           05050000
          9 - The tape to be read was unidentifiable as to format.      05055000
              The density read may not be available, or the tape may    05060000
              have an unreadable identifications field, or may be       05065000
              blank                                                     05070000
         10 - The tape to be written on has not been identified as to   05075000
              format.  A write Record, Write File Mark, or Write Gap    05080000
              command was received but cannot be processed without a    05085000
              Write Format command if the tape was unidentified at      05090000
              load point.                                               05095000
         11 - Drive not online.                                         05100000
         16 - A write format command was issued but the tape isn't at   05105000
              load point.                                               05110000
         19 - A backward type command (except a rewind command) was     05115000
              just initiated but the tape was already positioned at     05120000
              BOT.                                                      05125000
         22 - An improper command sequence was detected by the drive.   05130000
         23 - Protocol not synced.                                      05135000
         24 - The tape command byte received was unknown to the drive.  05140000
         31 - The length of a write record requested exceeded the       05145000
              size of the drive's data buffer.                          05150000
         37 - Cannot write past 10 feet beyond end-of-tape.             05155000
         40 - Door open reject.  The door was opened during a long gap  05160000
              while the tape was beyond the end-of-tape marker.  This   05165000
              condition is non-retriable to prevent unspooling of the   05170000
              tape.                                                     05175000
                                                                        05180000
       If UNRECOVERED ERROR                                             05185000
                                                                        05190000
         41 - Tape velocity was out of specification.                   05195000
         43 - Tape tension was out of specification.                    05200000
         45 - Multiple tracks were in error.  Either two or more        05205000
              tracks were in error for a PE or NRZI write, or two       05210000
              or more tracks were in error for a GCR write.             05215000
         47 - Failure to verify a tape mark or density ID just written. 05220000
         48 - Noise on detect.  Indistinguishable flux transitions were 05225000
              detected while attempting to detect a recorded block.     05230000
         49 - Data format error.  Flux transitions were found or were   05235000
              missing in the appropriate tracks for a block detect.     05240000
         50 - Failure to identify tape following a rewind command       05245000
         51 - Gap detected before end-of-data.  The read formatter      05250000
              dected a full tape width dropout within the data portion  05255000
              of a data block.                                          05260000
         52 - Data block dropout.  A full tape width dropout was        05265000
              detected within the preamble or postamble of a data       05270000
              block.                                                    05275000
         53 - Redundancy check error.  The read formatter detected      05280000
              either a CRC, ACRC, LRC or residual error while reading   05285000
              or verifying a data block.                                05290000
         54 - Read parity error.  The read formatter detected an        05295000
              unrecovered parity error within a data block.  For PE     05300000
              this error could include multiple tracks in error, and    05305000
              for GCR this error could also include a redundancy check  05310000
              error.  (Buckhorn only).                                  05315000
         55 - Abnormal command abort, door opened (Antelope only).      05320000
         57 - Maximum skew exceeded (Antelope only).                    05325000
         58 - False preamble or postamble detected (Antelope only).     05330000
         59 - Corrected data error on write (Antelope only).            05335000
         61 - Data block timeout.  Could not detect the gap following   05340000
              a data block.  Could be caused by a record length longer  05345000
              than the drive supportes on read.                         05350000
         62 - Tape mark dropout.  A full tape width dropout was         05355000
              detected within a tape mark.                              05360000
         63 - Tape mark unverified.  A tape mark was detected which     05365000
              does not meet ANSI specifications in terms of flux        05370000
              transitions and erasure in the appropriate tracks.        05375000
         64 - Tape mark timeout.  Could not detect the gap following    05380000
              a detected tape mark.                                     05385000
                                                                        05390000
       If POSITION UNRECOVERED                                          05395000
                                                                        05400000
         81 - Servo controller unresponsive.  The servo will not take   05405000
              data from the master controller.                          05410000
         82 - Servo failed to reach the desired state reqquested by     05415000
              the master controller.                                    05420000
         83 - Servo shutdown.  The servo system lost tape tension       05425000
              unexpectedly.                                             05430000
         84 - Servo controller hard failure.  The servo controller has  05435000
              detected a hard failure within itself.                    05440000
         85 - Servo protocol error.  An invalid byte was received by    05445000
              the servo from the master controller.                     05450000
         86 - A run time error was detected by the servo.               05455000
         87 - In position interrupt not received.  Master controller    05460000
              did not get the in position interrupt it expected.        05465000
         88 - No gap detected by the servo after reading or writing a   05470000
              data block or tape mark.                                  05475000
         90 - No BOT detected on load or rewind.                        05480000
         91 - Speed out of specifications.                              05485000
         92 - The desired state requested by the master controller      05490000
              was invalid for the current context.                      05495000
         94 - Tape positioning failure.                                 05500000
                                                                        05505000
       If FORMATTER ERROR                                               05510000
                                                                        05515000
        101 - Buckhorn read formatter unresponsive.  The read formatter 05520000
              did not respond with end of record status after a data    05525000
              block was detected.                                       05530000
        102 - Buckhorn read formatter hardware error.                   05535000
        103 - Bad block type detected on a write operation.             05540000
        104 - Erase failure.  Flux transitions were detected in a       05545000
              portion of tape currently being erased.                   05550000
        105 - No data detected after write.                             05555000
        106 - Tracks out of sync on write verify.                       05560000
        107 - Antelope formatter hardware error.                        05565000
        108 - Antelope formatter unresponsive.                          05570000
        110 - Formatter byte count mismatch with data buffer.           05575000
                                                                        05580000
      If CONTROLLER ERROR                                               05585000
                                                                        05590000
        121 - Transaction ID mismatch between command sent to Device    05595000
              program and the returned report.                          05600000
        122 - No pending command found for report received from Device  05605000
              program.                                                  05610000
        123 - Invalid report message received from Device program.      05615000
        124 - Report queue overflow.                                    05620000
        125 - Unknown command received by Device program.               05625000
        126 - Command queue overflow.                                   05630000
        128 - Missing end-of-record flag in data buffer.                05635000
        131 - Byte count mismatch between putting a record into the     05640000
              data buffer and removing it.                              05645000
        133 - Processor handshake abort between HP-IB interface board   05650000
              and channel program.                                      05655000
        134 - Unknown HP-IB interface exception detected.               05660000
        138 - Device program firmware error.                            05665000
        139 - Hardware utilities firmware error.                        05670000
        140 - Channel program firmware error.                           05675000
                                                                        05680000
      If COMMAND REJECT and PROTOCOL REJECT                             05685000
                                                                        05690000
        161 - Command queue not empty.  Cannot accept new tape          05695000
              command or diagnostic request.                            05700000
        162 - Request DSJ expected.                                     05705000
        163 - Request status expected.                                  05710000
        165 - Unknown unit select.                                      05715000
        166 - Tape command secondary expected.                          05720000
        167 - Data byte expected.                                       05725000
        168 - Missing EOI on tape command data byte, selftest number,   05730000
              or END command data byte.                                 05735000
        170 - Command phase protocol error for write record.            05740000
        172 - Read record report phase protocol error.                  05745000
        173 - Report phase protocol error.                              05750000
        174 - Cold load sequence protocol error.                        05755000
        176 - END "Complete" or "Complete-Idle" exptected.              05760000
        178 - END "Data" expected.                                      05765000
        180 - Unknown interface secondary command.                      05770000
        181 - Misplaced data byte.                                      05775000
        184 - Interface loopback protocol error.                        05780000
        185 - Run selftest protocol error.                              05785000
        188 - HP-IB command parity error.                               05790000
        189 - Reset by operator during a protocol sequence.             05795000
        190 - Device clear received.  (Internal error code only.)       05800000
                                                                        05805000
        WORD 3 (second byte)                                            05810000
                                                                        05815000
        The sixth byte is used only when reporting transparent status of05820000
        hard and soft errors while in immediate report mode.  When an   05825000
        immediate report write has a soft error (retries were necessary)05830000
        or a hard error (write failure) this byte indicates which       05835000
        command had the error.  It contains the number of commands sent 05840000
        and reported since the command in question was issued.  If the  05845000
        immediate reported write had a hard error, all of the commands  05850000
        issued after the failure also fail (they will be aborted by the 05855000
        device).  Thus on a hard error, this byte actually indicates the05860000
        number of preceeding commands that failed.  For non-transparent 05865000
        status, this byte will always be zero.                          05870000
$PAGE                                                                   05875000
4.3     GENERIC STATUS LAYOUT                                           05880000
                                                                        05885000
        Bit     Meaning                                                 05890000
                                                                        05895000
        0-3     Fatal Errors                                            05900000
                0000 = No fatal error.                                  05905000
                0001 = Tape runaway.                                    05910000
                0010 = Multiple tracks in error (MTE).                  05915000
                0011 = Timing error.                                    05920000
                0100 = Command reject.                                  05925000
                0101 = Unit failure.                                    05930000
                0110 = Data parity error.                               05935000
                0111 = Command parity error.                            05940000
                                                                        05945000
        4-6     Density                                                 05950000
                000 = Unrecognized density.                             05955000
                001 = 800 BPI (NRZI).                                   05960000
                010 = 1600 BPI (PE).                                    05965000
                011 = 6250 BPI (GCR).                                   05970000
                                                                        05975000
        7-8     Unit Number                                             05980000
                00 = Unit 0                                             05985000
                01 = Unit 1                                             05990000
                10 = Unit 2                                             05995000
                11 = Unit 3                                             06000000
                                                                        06005000
        9       End-of-file (EOF).                                      06010000
        10      Beginning-of-tape (BOT)/Load Point.                     06015000
        11      End-of-tape (EOT).                                      06020000
        12      Immediate Report Enabled.                               06025000
        13      Single Track in Error (STE).                            06030000
        14      Unit Online.                                            06035000
        15      File Protect (no write ring).                           06040000
$PAGE                                                                   06045000
4.4     SELFTEST SELECTION                                              06050000
                                                                        06055000
        Remote/    Test #        Test                   FRU's           06060000
        Local#   (decimal)                              Tested##        06065000
                                                                        06070000
        local         0     Display error table          N/A            06075000
        local         1     Display diagnostic errors    N/A            06080000
        local         2     Clear diagnostic error log   N/A            06085000
        all           3     Clear data buffer            N/A            06090000
        all           4     Generate data                N/A            06095000
        all           5     Power on self test           MC             06100000
                                                         HPIB           06105000
                                                         F              06110000
                                                         WE             06115000
                                                         PLL            06120000
                                                         SC             06125000
        all           6     Kernal MC test               MC             06130000
        all           7     All RAM March test           MC             06135000
        all           8     Walking RAM test             MC             06140000
        all           9     Timer test                   MC             06145000
        all          10     EEPROM test                  MC             06150000
        all          11     Data buffer test             MC             06155000
        all          12     Write clock test             WE             06160000
        all          13     HPIB Internal loopback       HPIB           06165000
        all          14     HPIB DB loopback             HPIB           06170000
                                                         MC             06175000
        all          15     Digital Loopback             F              06180000
                                                         PLL            06185000
                                                         WE             06190000
                                                         MC             06195000
        all          16     Loopback WO PLL              F              06200000
                                                         WE             06205000
                                                         MC             06210000
        all          17     SC MC handshake              SC             06215000
        all          18     Servo controller gap test    SC             06220000
                                                         F              06225000
        all          19     EEPROM write test            MC             06230000
        local        20     Front panel confidence test  FP             06235000
        all          21     Write PE data block          MC             06240000
                                                         F              06245000
                                                         PLL            06250000
                                                         WE             06255000
                                                         P              06260000
                                                         RE             06265000
                                                         HEAD           06270000
                                                         TAPE MEDIUM    06275000
        all          22     Write GCR data block         Same as test   06280000
                                                         #21            06285000
        all          23     Read tape test               Same as test   06290000
                                                         #21            06295000
        local        24     Auto gain value update       N/A            06300000
        local        25     Set to single looping        N/A            06305000
        local        26     Set to infinite looping      N/A            06310000
        local        27     Display MC revision          N/A            06315000
        local        28     Display SC revision          N/A            06320000
        local        29     Display densities supported  N/A            06325000
        local        30     Local firmware update        N/A            06330000
        remote      255     return MSB error code        N/A            06335000
                                                                        06340000
         # Remote access is from the HOST via the HP-IB.  Local access  06345000
           is from the USER via the from pannel.  All is both remote    06350000
           and local access.                                            06355000
                                                                        06360000
        ## See the Diagnostic Field Replacable Unit (FRU) Table.        06365000
                                                                        06370000
4.5     SELFTEST RESULTS LAYOUT                                         06375000
                                                                        06380000
        Selftest results are returned in the format yz (hex) for all    06385000
        tests except test #255 where yz is the Field Replacable Unit    06390000
        (FRU) error code (see 4.6 Field Replacable Unit (FRU) Layout).  06395000
        For test #255, y = subsystem test number and z = subsystem      06400000
        error code.  (See Diagnostic ERS).                              06405000
                                                                        06410000
4.6     FIELD REPLACEABLE UNIT (FRU) LAYOUT                             06415000
                                                                        06420000
        Abbreviation       Description              FRU Error Code      06425000
                                                      (LSB)             06430000
                                                                        06435000
                        No status available              00H            06440000
            SC          Servo controller assemble        1xH            06445000
            WE          Write electronics assembly       2xH            06450000
            RE          Read electronics assembly        3xH            06455000
            PLL         Phase locked loop assembly       4xH            06460000
            F           Formatter assembly               5xH            06465000
            MC          Master controller assembly       6xH            06470000
            HPIB        HPIB assembly                    7xH            06475000
            FP          Front panel assembly             8xH            06480000
            P           Preamp assembly                  9xH            06485000
            HEAD        Head assembly                    ni #           06490000
            MOTORS      Two motors                       ni #           06495000
            MB          Mother board                     ni #           06500000
            TAPE        Tape medium                      ni #           06505000
                        Firmware errors                  DxH            06510000
                        Protocol errors                  ExH            06515000
                        Remote status                    FxH            06520000
                        Non-accessible diagnostics       FCH            06525000
                        Online mode diagnostic only      FDH            06530000
                        Non-existent diagnostic          FEH            06535000
                        Diagnostic passed                FFH            06540000
                                                                        06545000
        # ni indicates failure cannot be isolated to this assembly.     06550000
$PAGE                                                                   06555000
MODIFICATION HISTORY                                                    06560000
                                                                        06565000
MM/DD/YY  First Last name.                                              06570000
                                                                        06575000
  Modification explanation.                                             06580000
                                                                        06585000
11/18/83  Dean Coggins.                                                 06590000
          FIX01 - Cause device to complete its buffered requests        06595000
                  prior to issuing the second file mark when two        06600000
                  write EOF's are requested back to back.               06605000
                                                                        06610000
12/ 5/83  Dean Coggins.                                                 06615000
          FIX02 - Log retries from non-transparent status.              06620000
                                                                        06625000
12/14/83  Dean Coggins.                                                 06630000
          FIX03 - Another attempt to fix the unit extract               06635000
                  instruction.                                          06640000
>>                                                                      06645000
 1/27/84  Dean Coggins.                                                 06650000
          FIX04 - If device powerfails, immediate report will           06655000
                  be enabled if that was the case prior to the          06660000
                  powerfail.                                            06665000
                                                                        06670000
                                                                        06675000
 2/15/84  Jim Kochanowicz.                                              06680000
          FIX05 - Handle write of length zero ( determine if write ring 06685000
                  present ) by issuing a request device status request. 06690000
>>                                                                      06695000
<<                                                                      06700000
Jesse Chin     6/15/84                                                  06705000
                                                                        06710000
1. New function code ENABLE'EOV'CHECK for fixing unspool                06715000
   problem after detecting 2 consecutive EOFs. Caller                   06720000
   resets this function by DEVICE CLOSE call. REWIND,                   06725000
   REWIND/UNLOAD or another ENABLE'EOV'CHECK will reenable              06730000
   the flag. Once the condition is true, the following                  06735000
   commands will be aborted with status PASS'EOV'ABORT:                 06740000
   READ, FORWARD SPACE FILE, GAP TAPE, FORWARD SPACE RECORD.            06745000
                                                                        06750000
2. Use DIT word DSAVE bits 9,10 for the counter.                        06755000
                                                                        06760000
Jesse Chin  7/11/84                                                     06765000
                                                                        06770000
Correct problem with short read buffer address calculation.             06775000
                                                                        06780000
>>                                                                      06785000
$PAGE                                                                   06790000
BEGIN                                                                   06795000
                                                                        06800000
EQUATE                                                                  06805000
                                                                        06810000
  << *************** >>                                                 06815000
  << Function Codes. >>                                                 06820000
  << *************** >>                                                 06825000
                                                                        06830000
  FC'READ           = 0 ,                                               06835000
  FC'WRITE          = 1 ,                                               06840000
  FC'OPEN'FILE      = 2 ,                                               06845000
  FC'CLOSE'FILE     = 3 ,                                               06850000
  FC'CLOSE'DEVICE   = 4 ,                                               06855000
  FC'REWIND         = 5 ,                                               06860000
  FC'FILE'MARK      = 6 ,                                               06865000
  FC'NEXT'FILE      = 7 , << Forward space to next file.   >>           06870000
  FC'PREV'FILE      = 8 , << Backspace to previous file.   >>           06875000
  FC'REWIND'OFFLINE = 9 ,                                               06880000
  FC'GAP'TAPE       = 10,                                               06885000
  FC'NEXT'RECORD    = 11, << Forward space to next record. >>           06890000
  FC'PREV'RECORD    = 12, << Backspace to previous record. >>           06895000
  FC'ACT'TRANS'CNT  = 14, << Actual prior transfer count.  >>           06900000
  FC'GENERIC'STATUS = 15,                                               06905000
  FC'SET'DENSITY    = 16,                                               06910000
  FC'DOWNLOAD'DIAG  = 18,                                               06915000
  FC'DIAG'STATUS    = 19, << Read diagnostic status.       >>           06920000
  FC'LOOPBACK       = 20,                                               06925000
  FC'SELFTEST       = 21,                                               06930000
  FC'END'DIAG       = 22,                                               06935000
  FC'IDENTIFY       = 23,                                               06940000
  FC'SPEED'SELECT   = 24,                                               06945000
  FC'DEV'STATUS     = 25, << Returns last device status.   >>           06950000
  FC'STATUS'LOG     = 26, << Read internal status log.     >>           06955000
  FC'WRITE'FIRMWARE = 27,                                               06960000
  FC'READ'FIRMWARE  = 28,                                               06965000
  FC'IMMED'REPORT   = 29, << Enable/disable immediate rpt. >>           06970000
  FC'GET'DEV'STATUS = 30, << Gets and returns last status. >>           06975000
  FC'DEV'CLEAR      = 31, << Amigo device clear.           >>           06980000
FC'ENABLE'EOV'CHECK = 128, << Enable End O Volume check >>     <<J8874>>06985000
  << ****************** >>                                              06990000
  << Mag Tape Commands. >>                                              06995000
  << ****************** >>                                              07000000
                                                                        07005000
  TC'WRITE          = 5 , << Write record.                >>            07010000
  TC'FILE'MARK      = 6 , << Write EOF.                   >>            07015000
  TC'GAP'TAPE       = 7 , << Write gap.                   >>            07020000
  TC'READ           = 8 , << Read record.                 >>            07025000
  TC'NEXT'RECORD    = 9 , << Forward space to next record.>>            07030000
  TC'PREV'RECORD    = 10, << Backspace to prior record.   >>            07035000
  TC'NEXT'FILE      = 11, << Forward space to next file.  >>            07040000
  TC'PREV'FILE      = 12, << Backspace to prior file.     >>            07045000
  TC'REWIND         = 13, << Rewind tape.                 >>            07050000
  TC'REWIND'OFFLINE = 14, << Rewind tape and offline.     >>            07055000
  TC'DENSITY'6250   = 16, << 6250 BPI (GCR).              >>            07060000
  TC'DENSITY'1600   = 17, << 1600 BPI (PE).               >>            07065000
  TC'DENSITY'800    = 18, << 800 BPI (NRZI).              >>            07070000
  TC'START'STOP     = 20, << Enable start/stop mode.      >>            07075000
  TC'STREAM         = 21, << Enable streaming mode.       >>            07080000
  TC'DISABLE'IMMED  = 22, << Disable immediate report.    >>            07085000
  TC'ENABLE'IMMED   = 23, << Enable immediate report.     >>            07090000
  TC'DEV'STATUS     = 24, << Read device status.          >>            07095000
$PAGE                                                                   07100000
  << ************************ >>                                        07105000
  << IO Status Return Values. >>                                        07110000
  << ************************ >>                                        07115000
                                                                        07120000
  COMPLETION'WAIT  =  %10,                                              07125000
  NOT'READY'WAIT   =  %30,                                              07130000
  WRITE'RING'WAIT  =  %40,                                              07135000
                                                                        07140000
  GOOD'IO          =    1,                                              07145000
  GOOD'RETRY       =  %21,                                              07150000
  GOOD'EOT'WRITE   =  %31, << EOT after successful write.    >>         07155000
                                                                        07160000
  SYSTEM'ABORT     =  %33,                                              07165000
  PRIOR'ERR'ABORT  =  %43,                                              07170000
  PASS'EOV'ABORT   =  %53, << Attempt to pass EOVnd of Vol >>  <<J8874>>07175000
  POWERFAIL'ABORT  =  %63,                                              07180000
  BACKSPACE'BOT    =  %73, << BOT and backspace requested.   >>         07185000
  TAPE'RUNAWAY     = %103,                                              07190000
  EOT'WRITE        = %113, << EOT and write requested.       >>         07195000
  POWER'UP         = %213,                                              07200000
  DENSITY'ERROR    = %233,                                              07205000
                                                                        07210000
  INVALID'REQUEST  =    4,                                              07215000
  TRANSFER'ERROR   =  %14,                                              07220000
  TIMING'ERROR     =  %34,                                              07225000
  CHAN'PGM'FAILURE =  %44,                                              07230000
  UNIT'FAILURE     =  %54,                                              07235000
  SYSTEM'ERROR     = %124,                                              07240000
  CHAN'IO'FAILURE  = %144,                                              07245000
$PAGE                                                                   07250000
  << ***********************************. >>                            07255000
  << Misc Pointers And Program Constants. >>                            07260000
  << ************************************ >>                            07265000
                                                                        07270000
  CONSOLE              = 0    , << For console messages.        >>      07275000
  CPVA'1'INDEX         = 1    ,                                         07280000
  DISABLE'IMMED'RPT    = 1    ,                                         07285000
  DIT'ERR'LOG'INDEX    = 11   ,                                         07290000
  DOOR'OPEN'MSG        = 23   , << Door open message index.     >>      07295000
  ENABLE'IMMED'RPT     = 0    ,                                         07300000
  GCR'6250             = 0    , << 6250 BPI (GCR) density mode. >>      07305000
  INITIATOR'STATE      = 2    ,                                         07310000
  INTERRUPT'WAIT       = %13  ,                                         07315000
  IOQ'DST'OFFSET'INDEX = 5    ,                                         07320000
  IOQ'FUNCTION'INDEX   = 6    ,                                         07325000
  IOQ'MISC'INDEX       = 3    ,                                         07330000
  IOQ'PARM'2'INDEX     = 9    ,                                         07335000
  LPDT'ENTRY'SIZE      = 4    ,                                         07340000
  MAXIMUM'TRANSFER     = 16384, << Maximum byte transfer.       >>      07345000
  NOT'READY'MSG        = 11   , << Not ready message index.     >>      07350000
  NO'WRITE'RING'MSG    = 220  , << No write ring message index. >>      07355000
  NRZI'800             = 2    , << 800 BPI (NRZI) density.      >>      07360000
  OPERATOR'WAIT        = 7    , << Operator intervention wait.  >>      07365000
  PE'1600              = 1    , << 1600 BPI (PE) density mode.  >>      07370000
  REQUEST'COMPLETE     = 5    ,                                         07375000
  PRIOR'ERROR'REJECT   = 5    ,                                         07380000
  PROTOCOL'REJECT      = 3    ,                                         07385000
  SELFTEST'FAILURE     = 7    ,                                         07390000
  START'STOP           = 1    ,                                         07395000
  STREAM               = 2    ,                                         07400000
  SYSDB                = %1000,                                         07405000
  TWO'EOF'ENCOUNTERED  = 3    ,                                <<J8874>>07410000
  ZERO                 = 0    ; << Because its easier to find.  >>      07415000
$PAGE                                                                   07420000
  << **************************************** >>                        07425000
  << Device Information Table (DIT) Elements. >>                        07430000
  << **************************************** >>                        07435000
                                                                        07440000
EQUATE                                                                  07445000
                                                                        07450000
  << ********** >>                                                      07455000
  << DIT words. >>                                                      07460000
  << ********** >>                                                      07465000
                                                                        07470000
  DLDEV     =  3 ,                                                      07475000
  DILTP     =  5 ,                                                      07480000
  DSAVE     =  6 ,                                                      07485000
  DSERR     =  7 ,                                                      07490000
  DTIME     = %10,                                                      07495000
  DSTAT     = %11,                                                      07500000
  DRQST     = %12,                                                      07505000
  DDEVSTAT1 = %13,                                                      07510000
  DDEVSTAT2 = %14,                                                      07515000
  DDEVSTAT3 = %15;                                                      07520000
                                                                        07525000
DEFINE                                                                  07530000
                                                                        07535000
  << ********* >>                                                       07540000
  << DIT bits. >>                                                       07545000
  << ********* >>                                                       07550000
                                                                        07555000
  DLDEV'LD'BITS     = ( 8:8)#,                                          07560000
  DSAVE'RW'BIT      = ( 0:1)#,                                          07565000
  DSAVE'RO'BIT      = ( 1:1)#,                                          07570000
  DSAVE'SR'BIT      = ( 2:1)#,                                          07575000
  DSAVE'PF'BIT      = ( 5:1)#,                                          07580000
  DSAVE'PP'BIT      = (11:1)#,                                 <<F8007>>07585000
  DSAVE'IR'BIT      = (12:1)#,                                 <<F8007>>07590000
  DSAVE'EI'BITS     = (13:2)#,                                 <<F7703>>07595000
  DSAVE'EOFS        = (9:2)#,                                  <<J8874>>07600000
  DSAVE'PA'BIT      = (15:1)#,                                          07605000
  DTIME'TO'BIT      = ( 0:1)#,                                          07610000
  DDEVSTAT1'EF'BIT  = ( 0:1)#,                                          07615000
  DDEVSTAT1'LP'BIT  = ( 1:1)#,                                          07620000
  DDEVSTAT1'ET'BIT  = ( 2:1)#,                                          07625000
  DDEVSTAT1'RE'BIT  = ( 3:1)#,                                          07630000
  DDEVSTAT1'CR'BIT  = ( 4:1)#,                                          07635000
  DDEVSTAT1'FP'BIT  = ( 5:1)#,                                          07640000
  DDEVSTAT1'UE'BIT  = ( 6:1)#,                                          07645000
  DDEVSTAT1'OL'BIT  = ( 7:1)#,                                          07650000
  DDEVSTAT1'GC'BIT  = ( 8:1)#,                                          07655000
  DDEVSTAT1'UD'BIT  = ( 9:1)#,                                          07660000
  DDEVSTAT1'DP'BIT  = (10:1)#,                                          07665000
  DDEVSTAT1'TE'BIT  = (11:1)#,                                          07670000
  DDEVSTAT1'TR'BIT  = (12:1)#,                                          07675000
  DDEVSTAT1'DO'BIT  = (13:1)#,                                          07680000
  DDEVSTAT1'IR'BIT  = (15:1)#,                                          07685000
  DDEVSTAT2'PE'BIT  = ( 0:1)#,                                          07690000
  DDEVSTAT2'NR'BIT  = ( 1:1)#,                                          07695000
  DDEVSTAT2'PU'BIT  = ( 2:1)#,                                          07700000
  DDEVSTAT2'CP'BIT  = ( 3:1)#,                                          07705000
  DDEVSTAT2'UF'BITS = ( 4:4)#,                                          07710000
  DDEVSTAT2'UP'BIT  = ( 4:1)#,                                          07715000
  DDEVSTAT2'FE'BIT  = ( 5:1)#,                                          07720000
  DDEVSTAT2'SE'BIT  = ( 6:1)#,                                          07725000
  DDEVSTAT2'CF'BIT  = ( 7:1)#,                                          07730000
  DDEVSTAT2'CR'BITS = ( 8:3)#,                                          07735000
  DDEVSTAT2'RC'BITS = (11:5)#,                                          07740000
  DDEVSTAT3'EC'BITS = ( 0:8)#,                                          07745000
  DDEVSTAT3'IE'BITS = ( 8:8)#,                                          07750000
                                                                        07755000
  << ************* >>                                                   07760000
  << DIT elements. >>                                                   07765000
  << ************* >>                                                   07770000
                                                                        07775000
  DIT'LDEV             =  P'DIT (DLDEV    ).DLDEV'LD'BITS    #,         07780000
  DIT'ILT'PTR          =  P'DIT (DILTP    )                  #,         07785000
  DIT'DSAVE'EOFS       =  P'DIT (DSAVE    ).DSAVE'EOFS       #,<<J8874>>07790000
  DIT'SAVE'WORD        =  P'DIT (DSAVE    )                  #,         07795000
  DIT'REWIND           =  P'DIT (DSAVE    ).DSAVE'RW'BIT     #,         07800000
  DIT'REWIND'OFFLINE   =  P'DIT (DSAVE    ).DSAVE'RO'BIT     #,         07805000
  DIT'SHORT'READ       =  P'DIT (DSAVE    ).DSAVE'SR'BIT     #,         07810000
  DIT'POWERFAIL        =  P'DIT (DSAVE    ).DSAVE'PF'BIT     #,         07815000
  DIT'PF'IR'FLAG       =  P'DIT (DSAVE    ).DSAVE'PP'BIT     #,<<F8007>>07820000
  DIT'IMMED'RPT'STATUS =  P'DIT (DSAVE    ).DSAVE'IR'BIT     #,<<F8007>>07825000
  DIT'EOF'INDICATOR    =  P'DIT (DSAVE    ).DSAVE'EI'BITS    #,<<F7703>>07830000
  DIT'PENDING'ABORT    =  P'DIT (DSAVE    ).DSAVE'PA'BIT     #,         07835000
  DIT'ERROR'STATUS     =  P'DIT (DSERR    )                  #,         07840000
  DIT'TIMEOUT'WORD     =  P'DIT (DTIME    )                  #,         07845000
  DIT'TIMEOUT          =  P'DIT (DTIME    ).DTIME'TO'BIT     #,         07850000
  DIT'STATUS'WORD      =  P'DIT (DSTAT    )                  #,         07855000
  DIT'TIMEOUT'INDEX    =  P'DIT (DRQST    )                  #,         07860000
  DIT'DEV'STAT1        =  P'DIT (DDEVSTAT1)                  #,         07865000
  DIT'END'OF'FILE      =  P'DIT (DDEVSTAT1).DDEVSTAT1'EF'BIT #,         07870000
  DIT'LOAD'POINT       =  P'DIT (DDEVSTAT1).DDEVSTAT1'LP'BIT #,         07875000
  DIT'END'OF'TAPE      =  P'DIT (DDEVSTAT1).DDEVSTAT1'ET'BIT #,         07880000
  DIT'RECOVERED'ERR    =  P'DIT (DDEVSTAT1).DDEVSTAT1'RE'BIT #,         07885000
  DIT'CMD'REJECT       =  P'DIT (DDEVSTAT1).DDEVSTAT1'CR'BIT #,         07890000
  DIT'FILE'PROTECT     =  P'DIT (DDEVSTAT1).DDEVSTAT1'FP'BIT #,         07895000
  DIT'UNRECOVERED'ERR  =  P'DIT (DDEVSTAT1).DDEVSTAT1'UE'BIT #,         07900000
  DIT'UNIT'ONLINE      =  P'DIT (DDEVSTAT1).DDEVSTAT1'OL'BIT #,         07905000
  DIT'6250'DENSITY     =  P'DIT (DDEVSTAT1).DDEVSTAT1'GC'BIT #,         07910000
  DIT'UNKNOWN'DENSITY  =  P'DIT (DDEVSTAT1).DDEVSTAT1'UD'BIT #,         07915000
  DIT'DATA'PARITY      =  P'DIT (DDEVSTAT1).DDEVSTAT1'DP'BIT #,         07920000
  DIT'TIMING'ERROR     =  P'DIT (DDEVSTAT1).DDEVSTAT1'TE'BIT #,         07925000
  DIT'TAPE'RUNAWAY     =  P'DIT (DDEVSTAT1).DDEVSTAT1'TR'BIT #,         07930000
  DIT'DOOR'OPEN        =  P'DIT (DDEVSTAT1).DDEVSTAT1'DO'BIT #,         07935000
  DIT'IMMED'RPT'ENABLE =  P'DIT (DDEVSTAT1).DDEVSTAT1'IR'BIT #,         07940000
  DIT'DEV'STAT2        =  P'DIT (DDEVSTAT2)                  #,         07945000
  DIT'1600'DENSITY     =  P'DIT (DDEVSTAT2).DDEVSTAT2'PE'BIT #,         07950000
  DIT'800'DENSITY      =  P'DIT (DDEVSTAT2).DDEVSTAT2'NR'BIT #,         07955000
  DIT'POWER'RESTORED   =  P'DIT (DDEVSTAT2).DDEVSTAT2'PU'BIT #,         07960000
  DIT'CMD'PARITY       =  P'DIT (DDEVSTAT2).DDEVSTAT2'CP'BIT #,         07965000
  DIT'UNIT'FAILURE     =  P'DIT (DDEVSTAT2).DDEVSTAT2'UF'BITS#,         07970000
  DIT'UNKNOWN'POSITION =  P'DIT (DDEVSTAT2).DDEVSTAT2'UP'BIT #,         07975000
  DIT'FORMATTER'ERROR  =  P'DIT (DDEVSTAT2).DDEVSTAT2'FE'BIT #,         07980000
  DIT'SERVO'ERROR      =  P'DIT (DDEVSTAT2).DDEVSTAT2'SE'BIT #,         07985000
  DIT'CONTROLLER'FAIL  =  P'DIT (DDEVSTAT2).DDEVSTAT2'CF'BIT #,         07990000
  DIT'CMD'REJ'CODE     =  P'DIT (DDEVSTAT2).DDEVSTAT2'CR'BITS#,         07995000
  DIT'RETRY'COUNT      =  P'DIT (DDEVSTAT2).DDEVSTAT2'RC'BITS#,         08000000
  DIT'DEV'STAT3        =  P'DIT (DDEVSTAT3)                  #,         08005000
  DIT'ERROR'CODE       =  P'DIT (DDEVSTAT3).DDEVSTAT3'EC'BITS#,         08010000
  DIT'IMMED'RPT'DETAIL =  P'DIT (DDEVSTAT3).DDEVSTAT3'IE'BITS#;         08015000
$PAGE                                                                   08020000
  << *************************************** >>                         08025000
  << Interrupt Linkage Table (ILT) Elements. >>                         08030000
  << *************************************** >>                         08035000
                                                                        08040000
EQUATE                                                                  08045000
                                                                        08050000
  << ********** >>                                                      08055000
  << ILT words. >>                                                      08060000
  << ********** >>                                                      08065000
                                                                        08070000
  ISIOP = %10,                                                          08075000
  ISTAP = %11,                                                          08080000
  IFLAG = %15;                                                          08085000
                                                                        08090000
DEFINE                                                                  08095000
                                                                        08100000
  << ********* >>                                                       08105000
  << ILT bits. >>                                                       08110000
  << ********* >>                                                       08115000
                                                                        08120000
  IFLAG'IP'BIT = (1:1)#,                                                08125000
                                                                        08130000
  << ************* >>                                                   08135000
  << ILT elements. >>                                                   08140000
  << ************* >>                                                   08145000
                                                                        08150000
  ILT'CHAN'PGM'PTR     = P'ILT (ISIOP)             #,                   08155000
  ILT'STATUS'PTR       = P'ILT (ISTAP)             #,                   08160000
  ILT'IDLE'PGM'RUNNING = P'ILT (IFLAG).IFLAG'IP'BIT#;                   08165000
$PAGE                                                                   08170000
  << ********************************** >>                              08175000
  << Input/Output Queue (IOQ) Elements. >>                              08180000
  << ********************************** >>                              08185000
                                                                        08190000
EQUATE                                                                  08195000
                                                                        08200000
  << ********** >>                                                      08205000
  << IOQ words. >>                                                      08210000
  << ********** >>                                                      08215000
                                                                        08220000
  QFLAG = 0  ,                                                          08225000
  QLINK = 1  ,                                                          08230000
  QMISC = 3  ,                                                          08235000
  QDSTN = 4  ,                                                          08240000
  QFUNC = 6  ,                                                          08245000
  QWBCT = 7  ,                                                          08250000
  QPAR1 = %10,                                                          08255000
  QPAR2 = %11,                                                          08260000
  QSTAT = %12;                                                          08265000
                                                                        08270000
DEFINE                                                                  08275000
                                                                        08280000
  << ********* >>                                                       08285000
  << IOQ bits. >>                                                       08290000
  << ********* >>                                                       08295000
                                                                        08300000
  QFLAG'AB'BIT  = ( 0:1 )#,                                             08305000
  QFLAG'DC'BIT  = (10:1 )#,                                             08310000
  QFLAG'PF'BIT  = (11:1 )#,                                             08315000
  QMISC'BE'BIT  = ( 4:1 )#,                                             08320000
  QMISC'RC'BITS = (12:4 )#,                                             08325000
  QDSTN'DR'BIT  = ( 0:1 )#,                                             08330000
  QDSTN'DN'BITS = ( 1:15)#,                                             08335000
  QFUNC'FC'BITS = ( 8:8 )#,                                             08340000
  QPAR2'WE'BIT  = (13:1 )#,                                             08345000
  QPAR2'DE'BITS = (13:3 )#,                                             08350000
  QSTAT'ST'BITS = ( 8:8 )#,                                             08355000
                                                                        08360000
  << ************* >>                                                   08365000
  << IOQ elements. >>                                                   08370000
  << ************* >>                                                   08375000
                                                                        08380000
  IOQ'ABORT          =  P'IOQ'TABLE (IOQ'INDEX + QFLAG).QFLAG'AB'BIT #, 08385000
  IOQ'DELAY'CP'FAIL  =  P'IOQ'TABLE (IOQ'INDEX + QFLAG).QFLAG'DC'BIT #, 08390000
  IOQ'POWERFAIL      =  P'IOQ'TABLE (IOQ'INDEX + QFLAG).QFLAG'PF'BIT #, 08395000
  IOQ'LINK           =  P'IOQ'TABLE (IOQ'INDEX + QLINK)              #, 08400000
  IOQ'BACKSPACE'EOF  =  P'IOQ'TABLE (IOQ'INDEX + QMISC).QMISC'BE'BIT #, 08405000
  IOQ'RETRY'COUNT    =  P'IOQ'TABLE (IOQ'INDEX + QMISC).QMISC'RC'BITS#, 08410000
  IOQ'DST'DB'REL     =  P'IOQ'TABLE (IOQ'INDEX + QDSTN).QDSTN'DR'BIT #, 08415000
  IOQ'DST'NUMBER     =  P'IOQ'TABLE (IOQ'INDEX + QDSTN).QDSTN'DN'BITS#, 08420000
  IOQ'FUNCTION'CODE  = IP'IOQ'TABLE (IOQ'INDEX + QFUNC).QFUNC'FC'BITS#, 08425000
  IOQ'TRANSFER'COUNT = IP'IOQ'TABLE (IOQ'INDEX + QWBCT)              #, 08430000
  IOQ'PARM'2         = IP'IOQ'TABLE (IOQ'INDEX + QPAR2)              #, 08435000
  IOQ'WRITE'PAST'EOT =  P'IOQ'TABLE (IOQ'INDEX + QPAR2).QPAR2'WE'BIT #, 08440000
  IOQ'DENSITY        =  P'IOQ'TABLE (IOQ'INDEX + QPAR2).QPAR2'DE'BITS#, 08445000
  IOQ'IO'STATUS      =  P'IOQ'TABLE (IOQ'INDEX + QSTAT).QSTAT'ST'BITS#; 08450000
$PAGE                                                                   08455000
  << ********************************************** >>                  08460000
  << Logical Physical Device Table (LPDT) Elements. >>                  08465000
  << ********************************************** >>                  08470000
                                                                        08475000
EQUATE                                                                  08480000
                                                                        08485000
  << *********** >>                                                     08490000
  << LPDT words. >>                                                     08495000
  << *********** >>                                                     08500000
                                                                        08505000
  LSTATE = 1;                                                           08510000
                                                                        08515000
DEFINE                                                                  08520000
                                                                        08525000
  << ********** >>                                                      08530000
  << LPDT bits. >>                                                      08535000
  << ********** >>                                                      08540000
                                                                        08545000
  LSTATE'EF'BITS = (7:3)#,                                              08550000
                                                                        08555000
  << ************** >>                                                  08560000
  << LPDT elements. >>                                                  08565000
  << ************** >>                                                  08570000
                                                                        08575000
  LPDT'EOF'TYPE = IP'LPDT (LPDT'ENTRY'INDEX + LSTATE).LSTATE'EF'BITS#;  08580000
$PAGE                                                                   08585000
  << ****************************** >>                                  08590000
  << Channel Program (CP) Elements. >>                                  08595000
  << ****************************** >>                                  08600000
                                                                        08605000
EQUATE                                                                  08610000
                                                                        08615000
  << ********* >>                                                       08620000
  << CP words. >>                                                       08625000
  << ********* >>                                                       08630000
                                                                        08635000
  CSTART'JVEC      = 1  ,                                               08640000
  CTAPE'CMD'ADR    = 6  ,                                               08645000
  CCMD'DSJ0        = 11 ,                                               08650000
  CRD'EXEC         = 14 ,                                               08655000
  CRD'BYTE'CNT     = 15 ,                                               08660000
  CRD'ADR          = 18 ,                                               08665000
  CRD'BANK         = 17 ,                                               08670000
  CLOOP'JUMP       = 19 ,                                               08675000
  CLOG'JUMP        = 19 ,                                               08680000
  CDIAG'JUMP       = 19 ,                                               08685000
  CEND'DATA        = 19 ,                                               08690000
  CFIRM'JUMP       = 19 ,                                               08695000
  CTEST'JUMP       = 19 ,                                               08700000
  CFIRM'JVEC       = 20 ,                                               08705000
  CDIAG'JVEC       = 20 ,                                               08710000
  CLOOP'JVEC       = 20 ,                                               08715000
  CLOG'JVEC        = 20 ,                                               08720000
  CEND'DATA'CNT    = 20 ,                                               08725000
  CTEST'JVEC       = 20 ,                                               08730000
  CEND'DATA'ADR    = 23 ,                                               08735000
  CACT'CNT'ADR     = 33 ,                                               08740000
  CSTAT1'ADR       = 38 ,                                               08745000
  CEND'CMPL1'ADR   = 43 ,                                               08750000
  CSTAT2'ADR       = 50 ,                                               08755000
  CEND'CMPL2'ADR   = 55 ,                                               08760000
  CSTAT3'ADR       = 62 ,                                               08765000
  CEND'CMPL3'ADR   = 67 ,                                               08770000
  CSTAT4'ADR       = 74 ,                                               08775000
  CEND'CMPL4'ADR   = 79 ,                                               08780000
  CWR'CMD          = 82 ,                                               08785000
  CIDENTIFY        = 82 ,                                               08790000
  CIDENT'CODE      = 83 ,                                               08795000
  CWR'CMD'CNT      = 83 ,                                               08800000
  CIDENT'JVEC      = 85 ,                                               08805000
  CWR'CMD'BANK     = 85 ,                                               08810000
  CWR'CMD'ADR      = 86 ,                                               08815000
  CIDENT'DSJ0      = 91 ,                                               08820000
  CWR'CMD'DSJ0     = 91 ,                                               08825000
  CWR'EXEC         = 94 ,                                               08830000
  CWR'BYTE'CNT     = 95 ,                                               08835000
  CWR'BANK         = 97 ,                                               08840000
  CWR'ADR          = 98 ,                                               08845000
  CWR'DSJ0         = 103,                                               08850000
  CWR'DSJ1         = 104,                                               08855000
  CWR'DSJ2         = 105,                                               08860000
  CEND'IDLE        = 106,                                               08865000
  CCLEAR           = 106,                                               08870000
  CIDLE'CP         = 106,                                               08875000
  CEND'IDLE'CNT    = 107,                                               08880000
  CCLEAR'WD2       = 107,                                               08885000
  CCLEAR'JUMP      = 108,                                               08890000
  CEND'IDLE'WD3    = 108,                                               08895000
  CEND'IDLE'BANK   = 109,                                               08900000
  CCLEAR'JVEC      = 109,                                               08905000
  CEND'IDLE'ADR    = 110,                                               08910000
  CCLEAR'DSJ       = 113,                                               08915000
  CIDLE'DSJ        = 113,                                               08920000
  CEND'DIAG        = 113,                                               08925000
  CEND'DIAG'CODE   = 114,                                               08930000
  CIDLE'STAT1'ADR  = 122,                                               08935000
  CEND'CMPL5'ADR   = 127,                                               08940000
  CIDLE'STAT2'ADR  = 134,                                               08945000
  CEND'CMPL6'ADR   = 139,                                               08950000
  CTAPE'CMD        = 142,                                               08955000
  CEND'DATA'CMD    = 143,                                               08960000
  CEND'CMPL'CMD    = 144,                                               08965000
  CDEVSTAT1        = 145,                                               08970000
  CDEVSTAT2        = 146,                                               08975000
  CDEVSTAT3        = 147,                                               08980000
  CSHORT'BUF1      = 148,                                               08985000
  CSHORT'BUF2      = 149,                                               08990000
  CSHORT'BUF3      = 150,                                               08995000
  CACT'CNT         = 151,                                               09000000
  CEND'IDLE'CMD    = 152;                                               09005000
                                                                        09010000
DEFINE                                                                  09015000
                                                                        09020000
  << ******** >>                                                        09025000
  << CP bits. >>                                                        09030000
  << ******** >>                                                        09035000
                                                                        09040000
  CDEVSTAT1'EF'BIT  = ( 0:1)#,                                          09045000
  CDEVSTAT1'LP'BIT  = ( 1:1)#,                                          09050000
  CDEVSTAT1'ET'BIT  = ( 2:1)#,                                          09055000
  CDEVSTAT1'RE'BIT  = ( 3:1)#,                                          09060000
  CDEVSTAT1'CR'BIT  = ( 4:1)#,                                          09065000
  CDEVSTAT1'FP'BIT  = ( 5:1)#,                                          09070000
  CDEVSTAT1'UE'BIT  = ( 6:1)#,                                          09075000
  CDEVSTAT1'OL'BIT  = ( 7:1)#,                                          09080000
  CDEVSTAT1'GC'BIT  = ( 8:1)#,                                          09085000
  CDEVSTAT1'UD'BIT  = ( 9:1)#,                                          09090000
  CDEVSTAT1'DP'BIT  = (10:1)#,                                          09095000
  CDEVSTAT1'TE'BIT  = (11:1)#,                                          09100000
  CDEVSTAT1'TR'BIT  = (12:1)#,                                          09105000
  CDEVSTAT1'DO'BIT  = (13:1)#,                                          09110000
  CDEVSTAT1'IR'BIT  = (15:1)#,                                          09115000
  CDEVSTAT2'PE'BIT  = ( 0:1)#,                                          09120000
  CDEVSTAT2'NR'BIT  = ( 1:1)#,                                          09125000
  CDEVSTAT2'PU'BIT  = ( 2:1)#,                                          09130000
  CDEVSTAT2'CP'BIT  = ( 3:1)#,                                          09135000
  CDEVSTAT2'UF'BITS = ( 4:4)#,                                          09140000
  CDEVSTAT2'UP'BIT  = ( 4:1)#,                                          09145000
  CDEVSTAT2'FE'BIT  = ( 5:1)#,                                          09150000
  CDEVSTAT2'SE'BIT  = ( 6:1)#,                                          09155000
  CDEVSTAT2'CF'BIT  = ( 7:1)#,                                          09160000
  CDEVSTAT2'CR'BITS = ( 8:3)#,                                          09165000
  CDEVSTAT2'RC'BITS = (11:5)#,                                          09170000
  CDEVSTAT3'EC'BITS = ( 0:8)#,                                          09175000
  CDEVSTAT3'IE'BITS = ( 8:8)#,                                          09180000
                                                                        09185000
  << ************ >>                                                    09190000
  << CP elements. >>                                                    09195000
  << ************ >>                                                    09200000
                                                                        09205000
  CP'END'OF'FILE      = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'EF'BIT #,      09210000
  CP'LOAD'POINT       = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'LP'BIT #,      09215000
  CP'END'OF'TAPE      = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'ET'BIT #,      09220000
  CP'RECOVERED'ERR    = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'RE'BIT #,      09225000
  CP'CMD'REJECT       = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'CR'BIT #,      09230000
  CP'FILE'PROTECT     = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'FP'BIT #,      09235000
  CP'UNRECOVERED'ERR  = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'UE'BIT #,      09240000
  CP'UNIT'ONLINE      = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'OL'BIT #,      09245000
  CP'6250'DENSITY     = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'GC'BIT #,      09250000
  CP'UNKNOWN'DENSITY  = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'UD'BIT #,      09255000
  CP'DATA'PARITY      = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'DP'BIT #,      09260000
  CP'TIMING'ERROR     = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'TE'BIT #,      09265000
  CP'TAPE'RUNAWAY     = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'TR'BIT #,      09270000
  CP'DOOR'OPEN        = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'DO'BIT #,      09275000
  CP'IMMED'RPT'ENABLE = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'IR'BIT #,      09280000
  CP'1600'DENSITY     = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'PE'BIT #,      09285000
  CP'800'DENSITY      = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'NR'BIT #,      09290000
  CP'POWERED'UP       = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'PU'BIT #,      09295000
  CP'CMD'PARITY       = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'CP'BIT #,      09300000
  CP'UNKNOWN'POSITION = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'UP'BIT #,      09305000
  CP'FORMATTER'ERROR  = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'FE'BIT #,      09310000
  CP'SERVO'ERROR      = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'SE'BIT #,      09315000
  CP'CONTROLLER'FAIL  = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'CF'BIT #,      09320000
  CP'CMD'REJ'CODE     = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'CR'BITS#,      09325000
  CP'RETRY'COUNT      = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'RC'BITS#,      09330000
  CP'ERROR'CODE       = P'CHAN'PGM (CDEVSTAT3).CDEVSTAT3'EC'BITS#,      09335000
  CP'IMMED'RPT'DETAIL = P'CHAN'PGM (CDEVSTAT3).CDEVSTAT3'IE'BITS#;      09340000
$PAGE                                                                   09345000
  << ************************************* >>                           09350000
  << Idle Channel Program Status elements. >>                           09355000
  << ************************************* >>                           09360000
                                                                        09365000
DEFINE                                                                  09370000
                                                                        09375000
  CP'IDLE'POWER'UP = P'CHAN'PGM (-2).( 2:1)#,                           09380000
  CP'IDLE'STAT1    = P'CHAN'PGM (-3)       #,                           09385000
  CP'IDLE'STAT2    = P'CHAN'PGM (-2)       #,                           09390000
  CP'IDLE'STAT3    = P'CHAN'PGM (-1)       #,                           09395000
$PAGE                                                                   09400000
  << ********************************* >>                               09405000
  << Channel Program Error Indicators. >>                               09410000
  << ********************************* >>                               09415000
                                                                        09420000
  CPVA'ERROR'CODE = P'CP'VAR'AREA (0).( 0:3)#,                          09425000
  CPVA'HALT'CODE  = P'CP'VAR'AREA (1).(14:2)#,                          09430000
$PAGE                                                                   09435000
  << ************************ >>                                        09440000
  << Generic Status Elements. >>                                        09445000
  << ************************ >>                                        09450000
                                                                        09455000
  GS'FATAL'ERROR      = GENERIC'STATUS.( 0:4)#,                         09460000
  GS'DENSITY          = GENERIC'STATUS.( 4:3)#,                         09465000
  GS'UNIT'NUMBER      = GENERIC'STATUS.( 7:2)#,                         09470000
  GS'END'OF'FILE      = GENERIC'STATUS.( 9:1)#,                         09475000
  GS'LOAD'POINT       = GENERIC'STATUS.(10:1)#,                         09480000
  GS'END'OF'TAPE      = GENERIC'STATUS.(11:1)#,                         09485000
  GS'IMMED'RPT'ENABLE = GENERIC'STATUS.(12:1)#,                         09490000
  GS'RECOVERED'ERR    = GENERIC'STATUS.(13:1)#,                         09495000
  GS'UNIT'ONLINE      = GENERIC'STATUS.(14:1)#,                         09500000
  GS'FILE'PROTECT     = GENERIC'STATUS.(15:1)#;                         09505000
$PAGE                                                                   09510000
<< ************************** >>                                        09515000
<<                            >>                                        09520000
<< Driver DB Area Definition. >>                                        09525000
<<                            >>                                        09530000
<< ************************** >>                                        09535000
                                                                        09540000
ARRAY INITIAL (0:179) = DB :=                                           09545000
                                                                        09550000
  [8/14, 8/%21], << DIT size, not core res., idle chan pgm, type 1.>>   09555000
              0, << Not used.                                      >>   09560000
         %37400, << Unit extract instr.  Logical AND 0.   >>   <<*8594>>09565000
    [8/77, 8/3], << Chan pgm length + 1 / 2, device status length. >>   09570000
                                                                        09575000
<< ************* >>                                                     09580000
<< Mag Tape DIT. >>                                                     09585000
<< ************* >>                                                     09590000
                                                                        09595000
              0, << DIT'FLAG             >>                             09600000
              0, << DIT'LINK             >>                             09605000
              0, << DIT'IOQ'INDEX        >>                             09610000
         %40000, << DIT'LDEV             >>                             09615000
              0, << DIT'DLT'PTR          >>                             09620000
              0, << DIT'ILT'PTR          >>                             09625000
              0, << DIT'SAVE'WORD        >>                             09630000
              0, << DIT'DEV'STATUS       >>                             09635000
              0, << DIT'TIMEOUT          >>                             09640000
              0, << DIT'INTERRUPT'STATUS >>                             09645000
              0, << DIT'TIMEOUT'ENTRY    >>                             09650000
              0, << DIT'DEV'STAT1        >>                             09655000
              0, << DIT'DEV'STAT2        >>                             09660000
              0, << DIT'DEV'STAT3        >>                             09665000
$page                                                                   09670000
<< **************** >>                                                  09675000
<< Channel Program. >>                                                  09680000
<< **************** >>                                                  09685000
                                                                        09690000
<< ************** >>                                                    09695000
<< Jump to start. >>                                                    09700000
<< ************** >>                                                    09705000
                                                                        09710000
<< 0   >>       0,                                                      09715000
<< 1   >>       0, << CSTART'JVEC.>>                                    09720000
                                                                        09725000
<< ************************************** >>                            09730000
<< Read record and tape command requests. >>                            09735000
<< ************************************** >>                            09740000
                                                                        09745000
<< ********************************* >>                                 09750000
<< Send READ record or Tape Command. >>                                 09755000
<< ********************************* >>                                 09760000
                                                                        09765000
<< 2   >>   %2001,                                                      09770000
<< 3   >>       1,                                                      09775000
<< 4   >>       0,                                                      09780000
<< 5   >>  %42000,                                                      09785000
<< 6   >>       0, << CTAPE'CMD'ADR >>                                  09790000
                                                                        09795000
<< *********************** >>                                           09800000
<< Wait for parallel poll. >>                                           09805000
<< *********************** >>                                           09810000
                                                                        09815000
<< 7   >>   %1000,                                                      09820000
<< 8   >>       0,                                                      09825000
                                                                        09830000
<< ***************************** >>                                     09835000
<< DSJ, check status of command. >>                                     09840000
<< ***************************** >>                                     09845000
                                                                        09850000
<< 9   >>   %2402,                                                      09855000
<< 10  >>       0,                                                      09860000
<< 11  >>       0, << CCMD'DSJ0.>> << DSJ 0 returned.>>                 09865000
<< 12  >>      32,                 << DSJ 1 returned.>>                 09870000
<< 13  >>      44,                 << DSJ 2 returned.>>                 09875000
                                                                        09880000
<< ******************************* >>                                   09885000
<< Execute DMA transfer to device. >>                                   09890000
<< ******************************* >>                                   09895000
                                                                        09900000
<< 14  >>   %1400, << CRD'EXEC.    >>                                   09905000
<< 15  >>       0, << CRD'BYTE'CNT.>>                                   09910000
<< 16  >>       0,                                                      09915000
<< 17  >>       0, << CRD'BANK.    >>                                   09920000
<< 18  >>       0, << CRD'ADR.     >>                                   09925000
                                                                        09930000
<< ********************** >>                                            09935000
<< Send END DATA command. >>                                            09940000
<< ********************** >>                                            09945000
                                                                        09950000
<< 19  >>   %2007, << CEND'DATA,    >>                                  09955000
                   << CDIAG'JUMP,   >>                                  09960000
                   << CLOOP'JUMP,   >>                                  09965000
                   << CTEST'JUMP,   >>                                  09970000
                   << CLOG'JUMP,    >>                                  09975000
                   << CFIRM'JUMP.   >>                                  09980000
<< 20  >>       1, << CEND'DATA'CNT,>>                                  09985000
                   << CDIAG'JVEC,   >>                                  09990000
                   << CLOOP'JVEC.   >>                                  09995000
                   << CTEST'JVEC.   >>                                  10000000
                   << CLOG'JVEC.    >>                                  10005000
                   << CFIRM'JVEC.   >>                                  10010000
<< 21  >>       0,                                                      10015000
<< 22  >>  %42000,                                                      10020000
<< 23  >>       0, << CEND'DATA'ADR >>                                  10025000
                                                                        10030000
<< ********************************** >>                                10035000
<< DSJ, check status of DMA transfer. >>                                10040000
<< ********************************** >>                                10045000
                                                                        10050000
<< 24  >>   %2402,                                                      10055000
<< 25  >>       0,                                                      10060000
<< 26  >>       0, << DSJ 0 returned.>>                                 10065000
<< 27  >>      17, << DSJ 1 returned.>>                                 10070000
<< 28  >>      17, << DSJ 2 returned.>>                                 10075000
                                                                        10080000
<< *********************** >>                                           10085000
<< Read actual byte count. >>                                           10090000
<< *********************** >>                                           10095000
                                                                        10100000
<< 29  >>   %1402,                                                      10105000
<< 30  >>       2,                                                      10110000
<< 31  >>       0,                                                      10115000
<< 32  >>   %2000,                                                      10120000
<< 33  >>       0, << CACT'CNT'ADR >>                                   10125000
$PAGE                                                                   10130000
<< ************************* >>                                         10135000
<< Interrupt, halt code = 0. >>                                         10140000
<< ************************* >>                                         10145000
                                                                        10150000
<< ******************* >>                                               10155000
<< Read device status. >>                                               10160000
<< ******************* >>                                               10165000
                                                                        10170000
<< 34  >>   %1401,                                                      10175000
<< 35  >>       6,                                                      10180000
<< 36  >>       0,                                                      10185000
<< 37  >>   %2000,                                                      10190000
<< 38  >>       0, << CSTAT1'ADR.>>                                     10195000
                                                                        10200000
<< ************************** >>                                        10205000
<< Send END COMPLETE command. >>                                        10210000
<< ************************** >>                                        10215000
                                                                        10220000
<< 39  >>   %2007, << End complete.    >>                               10225000
<< 40  >>       1,                                                      10230000
<< 41  >>       0,                                                      10235000
<< 42  >>  %42000,                                                      10240000
<< 43  >>       0, << CEND'CMPL1'ADR.>>                                 10245000
                                                                        10250000
<< ********** >>                                                        10255000
<< Interrupt. >>                                                        10260000
<< ********** >>                                                        10265000
                                                                        10270000
<< 44  >>    %601,                                                      10275000
<< 45  >>       0, << Halt code.>>                                      10280000
                                                                        10285000
                                                                        10290000
<< ************************* >>                                         10295000
<< Interrupt, halt code = 1. >>                                         10300000
<< ************************* >>                                         10305000
                                                                        10310000
<< ******************* >>                                               10315000
<< Read device status. >>                                               10320000
<< ******************* >>                                               10325000
                                                                        10330000
<< 46  >>   %1401,                                                      10335000
<< 47  >>       6,                                                      10340000
<< 48  >>       0,                                                      10345000
<< 49  >>   %2000,                                                      10350000
<< 50  >>       0, << CSTAT2'ADR >>                                     10355000
                                                                        10360000
<< ************************** >>                                        10365000
<< Send END COMPLETE command. >>                                        10370000
<< ************************** >>                                        10375000
                                                                        10380000
<< 51  >>   %2007, << End complete.    >>                               10385000
<< 52  >>       1,                                                      10390000
<< 53  >>       0,                                                      10395000
<< 54  >>  %42000,                                                      10400000
<< 55  >>       0, << CEND'CMPL2'ADR.>>                                 10405000
                                                                        10410000
<< ********** >>                                                        10415000
<< Interrupt. >>                                                        10420000
<< ********** >>                                                        10425000
                                                                        10430000
<< 56  >>    %601,                                                      10435000
<< 57  >>       1, << Halt code.>>                                      10440000
                                                                        10445000
                                                                        10450000
<< ************************* >>                                         10455000
<< Interrupt, halt code = 2. >>                                         10460000
<< ************************* >>                                         10465000
                                                                        10470000
<< ******************* >>                                               10475000
<< Read device status. >>                                               10480000
<< ******************* >>                                               10485000
                                                                        10490000
<< 58  >>   %1401,                                                      10495000
<< 59  >>       6,                                                      10500000
<< 60  >>       0,                                                      10505000
<< 61  >>   %2000,                                                      10510000
<< 62  >>       0, << CSTAT3'ADR.>>                                     10515000
                                                                        10520000
<< ************************** >>                                        10525000
<< Send END COMPLETE command. >>                                        10530000
<< ************************** >>                                        10535000
                                                                        10540000
<< 63  >>   %2007,                                                      10545000
<< 64  >>       1,                                                      10550000
<< 65  >>       0,                                                      10555000
<< 66  >>  %42000,                                                      10560000
<< 67  >>       0, << CEND'CMPL3'ADR.>>                                 10565000
                                                                        10570000
<< ********** >>                                                        10575000
<< Interrupt. >>                                                        10580000
<< ********** >>                                                        10585000
                                                                        10590000
<< 68  >>    %601,                                                      10595000
<< 69  >>       2, << Halt code.>>                                      10600000
                                                                        10605000
                                                                        10610000
<< ************************* >>                                         10615000
<< Interrupt, halt code = 3. >>                                         10620000
<< ************************* >>                                         10625000
                                                                        10630000
<< ******************* >>                                               10635000
<< Read device status. >>                                               10640000
<< ******************* >>                                               10645000
                                                                        10650000
<< 70  >>   %1401,                                                      10655000
<< 71  >>       6,                                                      10660000
<< 72  >>       0,                                                      10665000
<< 73  >>   %2000,                                                      10670000
<< 74  >>       0, << CSTAT4'ADR >>                                     10675000
                                                                        10680000
<< ************************** >>                                        10685000
<< Send END COMPLETE command. >>                                        10690000
<< ************************** >>                                        10695000
                                                                        10700000
<< 75  >>   %2007,                                                      10705000
<< 76  >>       1,                                                      10710000
<< 77  >>       0,                                                      10715000
<< 78  >>  %42000,                                                      10720000
<< 79  >>       0, << CEND'CMPL4'ADR.>>                                 10725000
                                                                        10730000
<< ********** >>                                                        10735000
<< Interrupt. >>                                                        10740000
<< ********** >>                                                        10745000
                                                                        10750000
<< 80  >>    %601,                                                      10755000
<< 81  >>       3, << Halt code.>>                                      10760000
$PAGE                                                                   10765000
<< ********************************* >>                                 10770000
<< Write record or Identify request. >>                                 10775000
<< ********************************* >>                                 10780000
                                                                        10785000
<< ************************************** >>                            10790000
<< Send WRITE record or IDENTIFY command. >>                            10795000
<< ************************************** >>                            10800000
                                                                        10805000
<< 82  >>   %2001, << CWR'CMD,      >>                                  10810000
                   << CIDENTIFY.    >>                                  10815000
<< 83  >>       2, << CWR'CMD'CNT,  >>                                  10820000
                   << CIDENT'CODE.  >>                                  10825000
<< 84  >>       0, << Identify jump.>>                                  10830000
<< 85  >>   %2000, << CWR'CMD'BANK, >>                                  10835000
                   << CIDENT'JVEC.  >>                                  10840000
<< 86  >>       0, << CWR'CMD'ADR.  >>                                  10845000
                                                                        10850000
<< *********************** >>                                           10855000
<< Wait for parallel poll. >>                                           10860000
<< *********************** >>                                           10865000
                                                                        10870000
<< 87  >>   %1000,                                                      10875000
<< 88  >>       0,                                                      10880000
                                                                        10885000
<< ***************************** >>                                     10890000
<< DSJ, check status of command. >>                                     10895000
<< ***************************** >>                                     10900000
                                                                        10905000
<< 89  >>   %2402,                                                      10910000
<< 90  >>       0,                                                      10915000
<< 91  >>       0, << CWR'CMD'DSJ0,>>                                   10920000
                   << CIDENT'DSJ0. >>                                   10925000
<< 92  >>     -48,                                                      10930000
<< 93  >>     -36,                                                      10935000
                                                                        10940000
<< ******************************* >>                                   10945000
<< Execute DMA transfer to device. >>                                   10950000
<< ******************************* >>                                   10955000
                                                                        10960000
<< 94  >>   %2000, << CWR'EXEC.    >>                                   10965000
<< 95  >>       0, << CWR'BYTE'CNT.>>                                   10970000
<< 96  >>       0,                                                      10975000
<< 97  >>       0, << CWR'BANK.    >>                                   10980000
<< 98  >>       0, << CWR'ADR.     >>                                   10985000
                                                                        10990000
<< *********************** >>                                           10995000
<< Wait for parallel poll. >>                                           11000000
<< *********************** >>                                           11005000
                                                                        11010000
<< 99  >>   %1000,                                                      11015000
<< 100 >>       0,                                                      11020000
                                                                        11025000
<< ********************************** >>                                11030000
<< DSJ, check status of DMA transfer. >>                                11035000
<< ********************************** >>                                11040000
                                                                        11045000
<< 101 >>   %2402,                                                      11050000
<< 102 >>       0,                                                      11055000
<< 103 >>     -72, << CWR'DSJ0.>>                                       11060000
<< 104 >>     -60, << CWR'DSJ1.>>                                       11065000
<< 105 >>     -36, << CWR'DSJ2.>>                                       11070000
$PAGE                                                                   11075000
<< ********************* >>                                             11080000
<< Idle Channel Program. >>                                             11085000
<< ********************* >>                                             11090000
                                                                        11095000
<< ********************** >>                                            11100000
<< Send END IDLE command. >>                                            11105000
<< ********************** >>                                            11110000
                                                                        11115000
<< 106 >>   %2007, << CIDLE'CP,       >>                                11120000
                   << CEND'IDLE,      >>                                11125000
                   << CCLEAR.         >>                                11130000
<< 107 >>       1, << CEND'IDLE'CNT,  >>                                11135000
                   << CCLEAR'WD2.     >>                                11140000
<< 108 >>       0, << CEND'IDLE'WORD3,>>                                11145000
                   << CCLEAR'JUMP.    >>                                11150000
<< 109 >>  %42000, << CEND'IDLE'BANK, >>                                11155000
                   << CCLEAR'JVEC.    >>                                11160000
<< 110 >>       0, << CEND'IDLE'ADR.  >>                                11165000
                                                                        11170000
<< *********************** >>                                           11175000
<< Wait for parallel poll. >>                                           11180000
<< *********************** >>                                           11185000
                                                                        11190000
<< 111 >>   %1000,                                                      11195000
<< 112 >>       0,                                                      11200000
                                                                        11205000
<< ****************************** >>                                    11210000
<< DSJ, check idle device status. >>                                    11215000
<< ****************************** >>                                    11220000
                                                                        11225000
<< 113 >>   %2402, << CIDLE'DSJ,       >>                               11230000
                   << CEND'DIAG.       >>                               11235000
                   << CCLEAR'DSJ.      >>                               11240000
<< 114 >>       0, << CEND'DIAG'CODE.  >>                               11245000
<< 115 >>       0, << DSJ 0 returned.  >>                               11250000
<< 116 >>      12, << DSJ 1 returned.  >>                               11255000
<< 117 >>      12, << DSJ 2 returned.  >>                               11260000
                                                                        11265000
<< ************************ >>                                          11270000
<< Interrupt, halt code = 0.>>                                          11275000
<< ************************ >>                                          11280000
                                                                        11285000
<< ******************* >>                                               11290000
<< Read device status. >>                                               11295000
<< ******************* >>                                               11300000
                                                                        11305000
<< 118 >>   %1401,                                                      11310000
<< 119 >>       6,                                                      11315000
<< 120 >>       0,                                                      11320000
<< 121 >>   %2000,                                                      11325000
<< 122 >>       0, << CIDLE'STAT1'ADR.>>                                11330000
                                                                        11335000
<< ************************** >>                                        11340000
<< Send END COMPLETE command. >>                                        11345000
<< ************************** >>                                        11350000
                                                                        11355000
<< 123 >>   %2007,                                                      11360000
<< 124 >>       1,                                                      11365000
<< 125 >>       0,                                                      11370000
<< 126 >>  %42000,                                                      11375000
<< 127 >>       0, << CEND'CMPL5'ADR.>>                                 11380000
                                                                        11385000
<< ********** >>                                                        11390000
<< Interrupt. >>                                                        11395000
<< ********** >>                                                        11400000
                                                                        11405000
<< 128 >>    %601,                                                      11410000
<< 129 >>       0, << Halt code.>>                                      11415000
                                                                        11420000
<< ************************* >>                                         11425000
<< Interrupt, halt code = 1. >>                                         11430000
<< ************************* >>                                         11435000
                                                                        11440000
<< ******************* >>                                               11445000
<< Read device status. >>                                               11450000
<< ******************* >>                                               11455000
                                                                        11460000
<< 130 >>   %1401,                                                      11465000
<< 131 >>       6,                                                      11470000
<< 132 >>       0,                                                      11475000
<< 133 >>   %2000,                                                      11480000
<< 134 >>       0, << CIDLE'STAT2'ADR >>                                11485000
                                                                        11490000
<< ************************** >>                                        11495000
<< Send END COMPLETE command. >>                                        11500000
<< ************************** >>                                        11505000
                                                                        11510000
<< 134 >>   %2007,                                                      11515000
<< 136 >>       1,                                                      11520000
<< 137 >>       0,                                                      11525000
<< 138 >>  %42000,                                                      11530000
<< 139 >>       0, << CEND'CMPL6'ADR.>>                                 11535000
                                                                        11540000
<< ********** >>                                                        11545000
<< Interrupt. >>                                                        11550000
<< ********** >>                                                        11555000
                                                                        11560000
<< 140 >>    %601,                                                      11565000
<< 141 >>       1, << Halt code. >>                                     11570000
$PAGE                                                                   11575000
<< ************************************** >>                            11580000
<< Miscellaneous channel program storage. >>                            11585000
<< ************************************** >>                            11590000
                                                                        11595000
<< 142 >>       0, << CTAPE'CMD.       >>                               11600000
<< 143 >>       2, << CEND'DATA'CMD.   >>                               11605000
<< 144 >>     %10, << CEND'CMPL'CMD.   >>                               11610000
<< 145 >>       0, << CDEVSTAT1.       >>                               11615000
<< 146 >>       0, << CDEVSTAT2.       >>                               11620000
<< 147 >>       0, << CDEVSTAT3.       >>                               11625000
<< 148 >>       0, << CSHORT'BUF1.     >>                               11630000
<< 149 >>       0, << CSHORT'BUF2.     >>                               11635000
<< 150 >>       0, << CSHORT'BUF3.     >>                               11640000
<< 151 >>       0, << CACT'CNT.        >>                               11645000
<< 152 >>       4, << CEND'IDLE'CMD.   >>                               11650000
<< 153 >>       0; << Filler, not used.>>                               11655000
$PAGE                                                                   11660000
<< ******************************** >>                                  11665000
<<                                  >>                                  11670000
<< External Procedure Declarations. >>                                  11675000
<<                                  >>                                  11680000
<< ******************************** >>                                  11685000
                                                                        11690000
<< ************** >>                                                    11695000
<< Timer Request. >>                                                    11700000
<< ************** >>                                                    11705000
                                                                        11710000
INTEGER PROCEDURE TIMEREQ (CODE, REQ, TIME);                            11715000
                                                                        11720000
VALUE                                                                   11725000
                                                                        11730000
  CODE,                                                                 11735000
  REQ ,                                                                 11740000
  TIME;                                                                 11745000
                                                                        11750000
INTEGER                                                                 11755000
                                                                        11760000
  CODE,                                                                 11765000
  REQ ;                                                                 11770000
                                                                        11775000
DOUBLE                                                                  11780000
                                                                        11785000
  TIME;                                                                 11790000
                                                                        11795000
OPTION                                                                  11800000
                                                                        11805000
  EXTERNAL;                                                             11810000
                                                                        11815000
                                                                        11820000
                                                                        11825000
                                                                        11830000
<< ************ >>                                                      11835000
<< Abort Timer. >>                                                      11840000
<< ************ >>                                                      11845000
                                                                        11850000
PROCEDURE ABORTTIMEREQ (TRLX);                                          11855000
                                                                        11860000
VALUE                                                                   11865000
                                                                        11870000
  TRLX;                                                                 11875000
                                                                        11880000
INTEGER                                                                 11885000
                                                                        11890000
  TRLX;                                                                 11895000
                                                                        11900000
OPTION                                                                  11905000
                                                                        11910000
  EXTERNAL;                                                             11915000
                                                                        11920000
                                                                        11925000
                                                                        11930000
                                                                        11935000
<< ********** >>                                                        11940000
<< EOF Check. >>                                                        11945000
<< ********** >>                                                        11950000
                                                                        11955000
PROCEDURE EOFCHECK (IOQ'INDEX, BUF'BANK'ADR, TRANSFER'COUNT,            11960000
                    HCHK);                                              11965000
                                                                        11970000
VALUE                                                                   11975000
                                                                        11980000
  IOQ'INDEX,                                                            11985000
  BUF'BANK'ADR,                                                         11990000
  TRANSFER'COUNT,                                                       11995000
  HCHK;                                                                 12000000
                                                                        12005000
INTEGER                                                                 12010000
                                                                        12015000
  IOQ'INDEX,                                                            12020000
  TRANSFER'COUNT,                                                       12025000
  HCHK;                                                                 12030000
                                                                        12035000
DOUBLE                                                                  12040000
                                                                        12045000
  BUF'BANK'ADR;                                                         12050000
                                                                        12055000
OPTION                                                                  12060000
                                                                        12065000
  EXTERNAL;                                                             12070000
                                                                        12075000
                                                                        12080000
                                                                        12085000
                                                                        12090000
<< ********************************* >>                                 12095000
<< HPIB General Interrupt Processor. >>                                 12100000
<< ********************************* >>                                 12105000
                                                                        12110000
PROCEDURE GIP'HPIB;                                                     12115000
                                                                        12120000
OPTION                                                                  12125000
                                                                        12130000
  EXTERNAL;                                                             12135000
                                                                        12140000
                                                                        12145000
                                                                        12150000
                                                                        12155000
<< ************* >>                                                     12160000
<< I/O Messages. >>                                                     12165000
<< ************* >>                                                     12170000
                                                                        12175000
LOGICAL PROCEDURE IOMESSAGE (SETNO, MSGNO, MASK, P1, P2, P3, P4,        12180000
                             P5, DEST, REPLY, OFFSET, P'DIT,            12185000
                             IOTYPE);                                   12190000
                                                                        12195000
VALUE                                                                   12200000
                                                                        12205000
  SETNO ,                                                               12210000
  MSGNO ,                                                               12215000
  MASK  ,                                                               12220000
  P1    ,                                                               12225000
  P2    ,                                                               12230000
  P3    ,                                                               12235000
  P4    ,                                                               12240000
  P5    ,                                                               12245000
  DEST  ,                                                               12250000
  REPLY ,                                                               12255000
  OFFSET,                                                               12260000
  P'DIT ,                                                               12265000
  IOTYPE;                                                               12270000
                                                                        12275000
INTEGER                                                                 12280000
                                                                        12285000
  SETNO ,                                                               12290000
  MSGNO ,                                                               12295000
  MASK  ,                                                               12300000
  P1    ,                                                               12305000
  P2    ,                                                               12310000
  P3    ,                                                               12315000
  P4    ,                                                               12320000
  P5    ,                                                               12325000
  DEST  ,                                                               12330000
  REPLY ,                                                               12335000
  OFFSET,                                                               12340000
  IOTYPE;                                                               12345000
                                                                        12350000
LOGICAL POINTER                                                         12355000
                                                                        12360000
  P'DIT;                                                                12365000
                                                                        12370000
OPTION                                                                  12375000
                                                                        12380000
  VARIABLE,                                                             12385000
  EXTERNAL;                                                             12390000
                                                                        12395000
                                                                        12400000
                                                                        12405000
                                                                        12410000
<< ****************** >>                                                12415000
<< Master Clear HPIB. >>                                                12420000
<< ****************** >>                                                12425000
                                                                        12430000
PROCEDURE MASTERCLEARHPIB (P'DIT);                                      12435000
                                                                        12440000
VALUE                                                                   12445000
                                                                        12450000
  P'DIT;                                                                12455000
                                                                        12460000
LOGICAL POINTER                                                         12465000
                                                                        12470000
  P'DIT;                                                                12475000
                                                                        12480000
OPTION                                                                  12485000
                                                                        12490000
  EXTERNAL;                                                             12495000
                                                                        12500000
                                                                        12505000
                                                                        12510000
                                                                        12515000
<< ******************* >>                                               12520000
<< I/O Device Monitor. >>                                               12525000
<< ******************* >>                                               12530000
                                                                        12535000
PROCEDURE SIODM (P'DIT, FLAGS);                                         12540000
                                                                        12545000
VALUE                                                                   12550000
                                                                        12555000
  P'DIT,                                                                12560000
  FLAGS;                                                                12565000
                                                                        12570000
LOGICAL                                                                 12575000
                                                                        12580000
  FLAGS;                                                                12585000
                                                                        12590000
LOGICAL POINTER                                                         12595000
                                                                        12600000
  P'DIT;                                                                12605000
                                                                        12610000
OPTION                                                                  12615000
                                                                        12620000
  EXTERNAL;                                                             12625000
                                                                        12630000
                                                                        12635000
                                                                        12640000
                                                                        12645000
<< *************************** >>                                       12650000
<< Start HPIB Channel Program. >>                                       12655000
<< *************************** >>                                       12660000
                                                                        12665000
PROCEDURE START'HPIB (P'DIT, P'CHAN'PGM, QFLAG);                        12670000
                                                                        12675000
VALUE                                                                   12680000
                                                                        12685000
  P'DIT     ,                                                           12690000
  P'CHAN'PGM,                                                           12695000
  QFLAG     ;                                                           12700000
                                                                        12705000
LOGICAL                                                                 12710000
                                                                        12715000
  QFLAG;                                                                12720000
                                                                        12725000
LOGICAL POINTER                                                         12730000
                                                                        12735000
  P'DIT     ,                                                           12740000
  P'CHAN'PGM;                                                           12745000
                                                                        12750000
OPTION                                                                  12755000
                                                                        12760000
  EXTERNAL;                                                             12765000
                                                                        12770000
                                                                        12775000
                                                                        12780000
                                                                        12785000
<< ******************* >>                                               12790000
<< Get DRT entry word. >>                                               12795000
<< ******************* >>                                               12800000
                                                                        12805000
INTEGER PROCEDURE GETDRT (DRT'INDEX, WORD'OFFSET);                      12810000
                                                                        12815000
VALUE                                                                   12820000
                                                                        12825000
  DRT'INDEX  ,                                                          12830000
  WORD'OFFSET;                                                          12835000
                                                                        12840000
INTEGER                                                                 12845000
                                                                        12850000
  DRT'INDEX  ,                                                          12855000
  WORD'OFFSET;                                                          12860000
                                                                        12865000
OPTION                                                                  12870000
                                                                        12875000
  EXTERNAL;                                                             12880000
$PAGE                                                                   12885000
<< ****************************************************** >>            12890000
<<                                                        >>            12895000
<<  Buckhorn/Antelope Initialization Procedure - MTINIT.  >>            12900000
<<                                                        >>            12905000
<< ****************************************************** >>            12910000
                                                                        12915000
PROCEDURE MTINIT (P'DIT);                                               12920000
                                                                        12925000
VALUE                                                                   12930000
                                                                        12935000
  P'DIT;                                                                12940000
                                                                        12945000
LOGICAL POINTER                                                         12950000
                                                                        12955000
  P'DIT; << Pointer to DIT.>>                                           12960000
                                                                        12965000
<< ********************************************** >>                    12970000
<< This procedure initializes the channel program >>                    12975000
<< for Read, Write, and tape commands.            >>                    12980000
<< ********************************************** >>                    12985000
                                                                        12990000
BEGIN << MTINIT >>                                                      12995000
                                                                        13000000
LOGICAL POINTER                                                         13005000
                                                                        13010000
  P'ILT        , << Pointer to ILT.                   >>                13015000
  P'CHAN'PGM   , << Pointer to chan pgm.             >>                 13020000
  P'IDLE'PGM   , << Pointer to idle chan pgm.        >>                 13025000
  P'IDLE'STATUS; << Pointer to idle chan pgm status. >>                 13030000
                                                                        13035000
INTEGER POINTER                                                         13040000
                                                                        13045000
  IP'CHAN'PGM    = P'CHAN'PGM   ,                                       13050000
  IP'IDLE'PGM    = P'IDLE'PGM   ,                                       13055000
  IP'IDLE'STATUS = P'IDLE'STATUS;                                       13060000
                                                                        13065000
INTEGER                                                                 13070000
                                                                        13075000
  SYSDB'CHAN'PGM,    << SYSDB adr of chan pgm.            >>            13080000
  SYSDB'IDLE'STATUS; << SYSDB adr of idle chan pgm status.>>            13085000
$PAGE                                                                   13090000
<< *************************** >>                                       13095000
<< Initialize local variables. >>                                       13100000
<< *************************** >>                                       13105000
                                                                        13110000
@P'ILT            := DIT'ILT'PTR;                                       13115000
@P'CHAN'PGM       := ILT'CHAN'PGM'PTR;                                  13120000
@IP'IDLE'PGM      := @IP'CHAN'PGM + CIDLE'CP;                           13125000
@P'IDLE'STATUS    := ILT'STATUS'PTR;                                    13130000
SYSDB'CHAN'PGM    := @IP'CHAN'PGM + SYSDB;                              13135000
SYSDB'IDLE'STATUS := @IP'IDLE'STATUS + SYSDB;                           13140000
                                                                        13145000
<< *********************** >>                                           13150000
<< Initiate idle chan pgm. >>                                           13155000
<< *********************** >>                                           13160000
                                                                        13165000
IF NOT ILT'IDLE'PGM'RUNNING THEN << start idle channel program.>>       13170000
BEGIN                                                                   13175000
                                                                        13180000
  << ********************************* >>                               13185000
  << Initialize channel program areas. >>                               13190000
  << ********************************* >>                               13195000
                                                                        13200000
  IP'CHAN'PGM (CTAPE'CMD'ADR   ) := SYSDB'CHAN'PGM + CTAPE'CMD    ;     13205000
  IP'CHAN'PGM (CWR'CMD'ADR     ) := SYSDB'CHAN'PGM + CTAPE'CMD    ;     13210000
  IP'CHAN'PGM (CACT'CNT'ADR    ) := SYSDB'CHAN'PGM + CACT'CNT     ;     13215000
  IP'CHAN'PGM (CSTAT1'ADR      ) := SYSDB'CHAN'PGM + CDEVSTAT1    ;     13220000
  IP'CHAN'PGM (CSTAT2'ADR      ) := SYSDB'CHAN'PGM + CDEVSTAT1    ;     13225000
  IP'CHAN'PGM (CSTAT3'ADR      ) := SYSDB'CHAN'PGM + CDEVSTAT1    ;     13230000
  IP'CHAN'PGM (CSTAT4'ADR      ) := SYSDB'CHAN'PGM + CDEVSTAT1    ;     13235000
  IP'CHAN'PGM (CIDLE'DSJ       ) := %2402                         ;     13240000
  IP'CHAN'PGM (CIDLE'STAT1'ADR ) := SYSDB'IDLE'STATUS             ;     13245000
  IP'CHAN'PGM (CIDLE'STAT2'ADR ) := SYSDB'IDLE'STATUS             ;     13250000
  IP'CHAN'PGM (CEND'DATA'ADR   ) := SYSDB'CHAN'PGM + CEND'DATA'CMD;     13255000
  IP'CHAN'PGM (CEND'IDLE'ADR   ) := SYSDB'CHAN'PGM + CEND'IDLE'CMD;     13260000
  IP'CHAN'PGM (CEND'CMPL1'ADR  ) := SYSDB'CHAN'PGM + CEND'CMPL'CMD;     13265000
  IP'CHAN'PGM (CEND'CMPL2'ADR  ) := SYSDB'CHAN'PGM + CEND'CMPL'CMD;     13270000
  IP'CHAN'PGM (CEND'CMPL3'ADR  ) := SYSDB'CHAN'PGM + CEND'CMPL'CMD;     13275000
  IP'CHAN'PGM (CEND'CMPL4'ADR  ) := SYSDB'CHAN'PGM + CEND'CMPL'CMD;     13280000
  IP'CHAN'PGM (CEND'CMPL5'ADR  ) := SYSDB'CHAN'PGM + CEND'CMPL'CMD;     13285000
  IP'CHAN'PGM (CEND'CMPL6'ADR  ) := SYSDB'CHAN'PGM + CEND'CMPL'CMD;     13290000
                                                                        13295000
  START'HPIB (P'DIT, P'IDLE'PGM, FALSE);                                13300000
                                                                        13305000
END;                                                                    13310000
                                                                        13315000
END; << MTINIT >>                                                       13320000
$PAGE                                                                   13325000
<< ********************************************************** >>        13330000
<<                                                            >>        13335000
<< Buckhorn/Atelope Magnetic Tape Driver Procedure - MTDRVR.  >>        13340000
<<                                                            >>        13345000
<< ********************************************************** >>        13350000
                                                                        13355000
INTEGER PROCEDURE MTDRVR (IOQ'INDEX, P'DIT, BUF'BANK, BUF'ADR,          13360000
                          P'CHAN'PGM, DRTN);                            13365000
                                                                        13370000
<< *********************************************************** >>       13375000
<< This procedure initiates and completes I/O requests for the >>       13380000
<< tape drive connected to he HP-IB and controlled by the GIC. >>       13385000
<<                                                             >>       13390000
<< Driver States returned from MTDRVR:                         >>       13395000
<<    5 - Request completed.                                   >>       13400000
<<    7 - Operator intervention required.                      >>       13405000
<<  %13 - Wait for operation completion.                       >>       13410000
<< *********************************************************** >>       13415000
                                                                        13420000
VALUE                                                                   13425000
                                                                        13430000
  P'DIT     ,                                                           13435000
  IOQ'INDEX ,                                                           13440000
  BUF'BANK  ,                                                           13445000
  BUF'ADR   ,                                                           13450000
  P'CHAN'PGM,                                                           13455000
  DRTN      ;                                                           13460000
                                                                        13465000
LOGICAL                                                                 13470000
                                                                        13475000
  BUF'BANK, << Memory bank of buffer for transfers.   >>                13480000
  BUF'ADR ; << Memory address of buffer for transfers.>>                13485000
                                                                        13490000
INTEGER                                                                 13495000
                                                                        13500000
  IOQ'INDEX, << Index to IOQ entry of IOQ table.>>                      13505000
  DRTN     ; << Device reference table number.  >>                      13510000
                                                                        13515000
LOGICAL POINTER                                                         13520000
                                                                        13525000
  P'DIT     , << Pointer to DIT.            >>                          13530000
  P'CHAN'PGM; << Pointer to channel program.>>                          13535000
                                                                        13540000
OPTION                                                                  13545000
                                                                        13550000
  PRIVILEGED,                                                           13555000
  UNCALLABLE;                                                           13560000
                                                                        13565000
BEGIN << MTDRVR >>                                                      13570000
                                                                        13575000
LOGICAL POINTER                                                         13580000
                                                                        13585000
  P'IOQ'TABLE = 5, << Pointer to IOQ table.             >>              13590000
  P'CP'VAR'AREA  , << Pointer to chan pgm variable area.>>              13595000
  P'IDLE'PGM     ; << Pointer to idle chan pgm.         >>              13600000
                                                                        13605000
INTEGER POINTER                                                         13610000
                                                                        13615000
  IP'IOQ'TABLE   = 5            , << Pointer to IOQ table.    >>        13620000
  IP'LPDT        = 8            , << Pointer to LPDT table.   >>        13625000
  IP'CHAN'PGM    = P'CHAN'PGM   , << Pointer to chan pgm.     >>        13630000
  IP'DIT         = P'DIT        , << Pointer to DIT table.    >>        13635000
  IP'CP'VAR'AREA = P'CP'VAR'AREA, << Pointer to CPVA.         >>        13640000
  IP'IDLE'PGM    = P'IDLE'PGM   ; << Pointer to idle chan pgm.>>        13645000
                                                                        13650000
LOGICAL                                                                 13655000
                                                                        13660000
  GENERIC'STATUS;                                                       13665000
                                                                        13670000
INTEGER                                                                 13675000
                                                                        13680000
  TRANSFER'COUNT       , << in bytes.>>                                 13685000
  BYTES'TRANSFERED     ,                                                13690000
  LPDT'ENTRY'INDEX     ,                                                13695000
  DRIVER'STATE = MTDRVR,                                                13700000
  S0           = S - 0 ,                                                13705000
  S1           = S - 1 ,                                                13710000
  S3           = S - 3 ,                                                13715000
  X            = X     ;                                                13720000
                                                                        13725000
DOUBLE                                                                  13730000
                                                                        13735000
  BUF'BANK'ADR   , << Bank and offset adr of memory buffer.        >>   13740000
  WS'BUF'BANK'ADR; << Working bank and offset adr of memory buffer.>>   13745000
$PAGE                                                                   13750000
<< **************************************** >>                          13755000
<< Initialize local pointers and variables. >>                          13760000
<< **************************************** >>                          13765000
                                                                        13770000
@P'CP'VAR'AREA := DIT'ILT'PTR;                                          13775000
@IP'IDLE'PGM   := @IP'CHAN'PGM + CIDLE'CP;                              13780000
BUF'BANK'ADR   := DOUBLE (BUF'BANK) &DLSL (16) + DOUBLE (BUF'ADR);      13785000
                                                                        13790000
<< ************************ >>                                          13795000
<< Get byte transfer count. >>                                          13800000
<< ************************ >>                                          13805000
                                                                        13810000
IF IOQ'TRANSFER'COUNT < ZERO THEN << byte transfer.>>                   13815000
                                                                        13820000
  TRANSFER'COUNT := -IOQ'TRANSFER'COUNT << make it positive.>>          13825000
                                                                        13830000
ELSE << word transfer, convert to bytes.>>                              13835000
                                                                        13840000
  TRANSFER'COUNT := IOQ'TRANSFER'COUNT &ASL (1);                        13845000
$PAGE                                                                   13850000
<< ********************* >>                                             13855000
<< Powerfail while idle. >>                                             13860000
<< ********************* >>                                             13865000
                                                                        13870000
IF CP'IDLE'POWER'UP THEN << device powerfailed while idle.>>            13875000
BEGIN                                                                   13880000
                                                                        13885000
  CP'IDLE'POWER'UP := ZERO; << Reset.             >>                    13890000
  DIT'POWERFAIL    := TRUE; << Flag the powerfail.>>                    13895000
                                                                        13900000
END;                                                                    13905000
$PAGE                                                                   13910000
<< ******************************** >>                                  13915000
<< Idle Channel Program Initiation. >>                                  13920000
<< ******************************** >>                                  13925000
                                                                        13930000
IF IOQ'INDEX = ZERO THEN << nothing to do.>>                            13935000
BEGIN                                                                   13940000
                                                                        13945000
  << ********************* >>                                           13950000
  << Set up idle chan pgm. >>                                           13955000
  << ********************* >>                                           13960000
                                                                        13965000
  IP'CHAN'PGM (CEND'IDLE     ) := %2007 ;                               13970000
  IP'CHAN'PGM (CEND'IDLE'CNT ) := 1     ;                               13975000
  IP'CHAN'PGM (CEND'IDLE'WD3 ) := ZERO  ;                               13980000
  IP'CHAN'PGM (CEND'IDLE'BANK) := %42000;                               13985000
  IP'CHAN'PGM (CIDLE'DSJ     ) := %2402 ;                               13990000
                                                                        13995000
  START'HPIB (P'DIT, P'IDLE'PGM, FALSE);                                14000000
                                                                        14005000
  IF < THEN << idle channel program failed to start.>>                  14010000
                                                                        14015000
    MASTERCLEARHPIB (P'DIT); << Halt channel program.>>                 14020000
                                                                        14025000
  P'CP'VAR'AREA := ZERO            ; << Reset.>>                        14030000
  DRIVER'STATE  := REQUEST'COMPLETE;                                    14035000
                                                                        14040000
  RETURN;                                                               14045000
                                                                        14050000
END;                                                                    14055000
$PAGE                                                                   14060000
<< ************* >>                                                     14065000
<< System Abort. >>                                                     14070000
<< ************* >>                                                     14075000
                                                                        14080000
IF IOQ'ABORT THEN << system is requesting abort.>>                      14085000
BEGIN                                                                   14090000
                                                                        14095000
  IF NOT DIT'PENDING'ABORT THEN                                         14100000
  BEGIN                                                                 14105000
                                                                        14110000
    DIT'PENDING'ABORT := TRUE;                                          14115000
                                                                        14120000
    << ****************************** >>                                14125000
    << Set chan pgm for device clear. >>                                14130000
    << ****************************** >>                                14135000
                                                                        14140000
    IP'CHAN'PGM (CSTART'JVEC) := 99   ;                                 14145000
    IP'CHAN'PGM (CWR'DSJ0   ) := ZERO ;                                 14150000
    IP'CHAN'PGM (CWR'DSJ1   ) := ZERO ;                                 14155000
    IP'CHAN'PGM (CWR'DSJ2   ) := ZERO ;                                 14160000
    IP'CHAN'PGM (CCLEAR     ) := %4400;                                 14165000
    IP'CHAN'PGM (CCLEAR'WD2 ) := ZERO ;                                 14170000
    IP'CHAN'PGM (CCLEAR'JUMP) := ZERO ;                                 14175000
    IP'CHAN'PGM (CCLEAR'JVEC) := 1    ;                                 14180000
    IP'CHAN'PGM (CCLEAR'DSJ ) := %2402;                                 14185000
                                                                        14190000
    GO TO START'CHAN'PGM;                                               14195000
                                                                        14200000
  END                                                                   14205000
                                                                        14210000
  ELSE << device clear has already been issued.>>                       14215000
                                                                        14220000
    GO TO COMPLETE'REQUEST;                                             14225000
                                                                        14230000
END;                                                                    14235000
$PAGE                                                                   14240000
<< ***************** >>                                                 14245000
<< Device Powerfail. >>                                                 14250000
<< ***************** >>                                                 14255000
                                                                        14260000
IF DIT'POWERFAIL THEN << device has powerfailed.>>             <<F8007>>14265000
BEGIN                                                                   14270000
                                                               <<F8007>>14275000
POWERFAIL'PROCESSOR:                                           <<F8007>>14280000
                                                               <<F8007>>14285000
  IF (DIT'IMMED'RPT'STATUS = 1   LAND                          <<F8007>>14290000
      DIT'PF'IR'FLAG = 1)        OR                            <<F8007>>14295000
     DIT'IMMED'RPT'STATUS = ZERO THEN                          <<F8007>>14300000
  BEGIN                                                        <<F8007>>14305000
                                                               <<F8007>>14310000
    IF CPVA'HALT'CODE = 1 AND                                  <<F8007>>14315000
       NOT CP'UNIT'ONLINE AND                                  <<F8007>>14320000
       DIT'IMMED'RPT'STATUS = 1 THEN                           <<F8007>>14325000
                                                               <<F8007>>14330000
    BEGIN << unit is not ready.>>                              <<F8007>>14335000
                                                               <<F8007>>14340000
      DIT'PF'IR'FLAG := ZERO;                                  <<F8007>>14345000
                                                               <<F8007>>14350000
      IF IOMESSAGE (1, NOT'READY'MSG, %10000, DIT'LDEV,,,,,    <<F8007>>14355000
                    CONSOLE) THEN                              <<F8007>>14360000
      BEGIN                                                    <<F8007>>14365000
                                                               <<F8007>>14370000
        IOQ'IO'STATUS := NOT'READY'WAIT;                       <<F8007>>14375000
        DRIVER'STATE  := OPERATOR'WAIT ;                       <<F8007>>14380000
                                                               <<F8007>>14385000
        RETURN;                                                <<F8007>>14390000
                                                               <<F8007>>14395000
      END;                                                     <<F8007>>14400000
                                                               <<F8007>>14405000
      << IOMESSAGE failed.>>                                   <<F8007>>14410000
                                                               <<F8007>>14415000
      MASTERCLEARHPIB (P'DIT); << Halt channel program.>>      <<F8007>>14420000
                                                               <<F8007>>14425000
      IOQ'IO'STATUS := SYSTEM'ERROR    ;                       <<F8007>>14430000
      DRIVER'STATE  := REQUEST'COMPLETE;                       <<F8007>>14435000
                                                               <<F8007>>14440000
      RETURN;                                                  <<F8007>>14445000
                                                               <<F8007>>14450000
    END                                                        <<F8007>>14455000
                                                               <<F8007>>14460000
    ELSE                                                       <<F8007>>14465000
    BEGIN                                                      <<F8007>>14470000
                                                               <<F8007>>14475000
                                                                        14480000
      DIT'PF'IR'FLAG := ZERO            ;                      <<F8007>>14485000
      DIT'POWERFAIL  := FALSE           ;                      <<F8007>>14490000
      IOQ'IO'STATUS  := POWER'UP        ;                      <<F8007>>14495000
      DRIVER'STATE   := REQUEST'COMPLETE;                      <<F8007>>14500000
                                                               <<F8007>>14505000
      RETURN;                                                  <<F8007>>14510000
                                                               <<F8007>>14515000
    END;                                                       <<F8007>>14520000
                                                               <<F8007>>14525000
  END                                                          <<F8007>>14530000
                                                               <<F8007>>14535000
  ELSE                                                         <<F8007>>14540000
  BEGIN                                                        <<F8007>>14545000
                                                               <<F8007>>14550000
    MASTERCLEARHPIB (P'DIT); << Halt chan pgm.>>               <<F8007>>14555000
    DIT'PF'IR'FLAG := 1;                                       <<F8007>>14560000
                                                               <<F8007>>14565000
    << ************************************* >>                <<F8007>>14570000
    << Set up chan pgm for immediate report. >>                <<F8007>>14575000
    << ************************************* >>                <<F8007>>14580000
                                                               <<F8007>>14585000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO           ;              <<F8007>>14590000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20             ;              <<F8007>>14595000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'ENABLE'IMMED;              <<F8007>>14600000
                                                               <<F8007>>14605000
    GO TO START'CHAN'PGM;                                      <<F8007>>14610000
                                                               <<F8007>>14615000
  END;                                                         <<F8007>>14620000
                                                                        14625000
END;                                                                    14630000
$PAGE                                                                   14635000
<< ******** >>                                                          14640000
<< Timeout. >>                                                          14645000
<< ******** >>                                                          14650000
                                                                        14655000
IF DIT'TIMEOUT THEN << timeout has occured.  This occurs if >>          14660000
BEGIN               << operator doesn't mount a write ring  >>          14665000
                    << within one second (got to be fast).  >>          14670000
                                                                        14675000
  ABORTTIMEREQ (DIT'TIMEOUT'INDEX); << Stop timer.>>                    14680000
                                                                        14685000
  DIT'TIMEOUT'WORD   := ZERO; << Reset.>>                               14690000
  DIT'REWIND'OFFLINE := TRUE;                                           14695000
                                                                        14700000
  << *********************************** >>                             14705000
  << Set up chan pgm for rewind/offline. >>                             14710000
  << *********************************** >>                             14715000
                                                                        14720000
  IP'CHAN'PGM (CSTART'JVEC) := ZERO             ;                       14725000
  IP'CHAN'PGM (CCMD'DSJ0  ) := 20               ;                       14730000
  IP'CHAN'PGM (CTAPE'CMD  ) := TC'REWIND'OFFLINE;                       14735000
                                                                        14740000
  GO TO START'CHAN'PGM;                                                 14745000
                                                                        14750000
END;                                                                    14755000
$PAGE                                                                   14760000
<< **************************************** >>                          14765000
<< Check for transparent status, door open, >>                          14770000
<< or failure from previous operation       >>                          14775000
<< **************************************** >>                          14780000
                                                                        14785000
IF NOT (DRIVER'STATE = INITIATOR'STATE) THEN                            14790000
BEGIN                                                                   14795000
                                                                        14800000
  IF IOQ'FUNCTION'CODE = FC'CLOSE'DEVICE AND                            14805000
     CP'UNIT'ONLINE                      AND                            14810000
     CPVA'HALT'CODE = ZERO               then                           14815000
                                                                        14820000
    << ****************************************** >>                    14825000
    << more device close processing to be done.   >>                    14830000
    << This is a null statement to cause a branch >>                    14835000
    << around the following processing.           >>                    14840000
    << ****************************************** >>                    14845000
                                                                        14850000
  ELSE                                                                  14855000
                                                               <<F7703>>14860000
  IF IOQ'FUNCTION'CODE = FC'FILE'MARK AND                      <<F7703>>14865000
     DIT'EOF'INDICATOR = 2            AND                      <<F7703>>14870000
     CPVA'HALT'CODE = ZERO            THEN                     <<F7703>>14875000
                                                               <<F7703>>14880000
    << ****************************************** >>           <<F7703>>14885000
    << more double EOF processing to be done.     >>           <<F7703>>14890000
    << This is a null statement to cause a branch >>           <<F7703>>14895000
    << around the following processing.           >>           <<F7703>>14900000
    << ****************************************** >>           <<F7703>>14905000
                                                               <<F7703>>14910000
  ELSE                                                         <<F7703>>14915000
                                                               <<F7703>>14920000
  BEGIN                                                                 14925000
                                                                        14930000
    IF CPVA'HALT'CODE = ZERO OR                                         14935000
       CPVA'HALT'CODE = 1    THEN                                       14940000
                                                                        14945000
      GO TO COMPLETE'REQUEST;                                           14950000
                                                                        14955000
    << ****************************************************** >>        14960000
    << Transparent status processing.  This is either a       >>        14965000
    << door open or successful retry message from the device. >>        14970000
    << ****************************************************** >>        14975000
                                                                        14980000
    << ******************* >>                                           14985000
    << Was it a door open? >>                                           14990000
    << ******************* >>                                           14995000
                                                                        15000000
    IF CP'DOOR'OPEN THEN                                                15005000
    BEGIN                                                               15010000
                                                                        15015000
      IF NOT (IOMESSAGE (1, DOOR'OPEN'MSG, %10000, DIT'LDEV,,,,,        15020000
              CONSOLE)) THEN                                            15025000
      BEGIN << IOMESSAGE failed.>>                                      15030000
                                                                        15035000
        MASTERCLEARHPIB (P'DIT); << Halt channel program.>>             15040000
                                                                        15045000
        IOQ'IO'STATUS := SYSTEM'ERROR    ;                              15050000
        DRIVER'STATE  := REQUEST'COMPLETE;                              15055000
                                                                        15060000
        RETURN;                                                         15065000
                                                                        15070000
      END;                                                              15075000
                                                                        15080000
    END;                                                                15085000
                                                                        15090000
    << ***************************************************** >>         15095000
    << If the door wasn't open then the device is informing  >>         15100000
    << that a successful retry occured.                      >>         15105000
    << ***************************************************** >>         15110000
                                                                        15115000
    << ************ >>                                                  15120000
    << Log retries. >>                                                  15125000
    << ************ >>                                                  15130000
                                                                        15135000
    IF NOT (CP'RETRY'COUNT = ZERO) THEN                                 15140000
    BEGIN                                                               15145000
                                                                        15150000
      DIT'ERROR'STATUS := [8/3, 8/DIT'ERR'LOG'INDEX];                   15155000
      DIT'STATUS'WORD  := IP'CHAN'PGM (CDEVSTAT1);                      15160000
      DIT'DEV'STAT1    := IP'CHAN'PGM (CDEVSTAT1);                      15165000
      DIT'DEV'STAT2    := IP'CHAN'PGM (CDEVSTAT2);                      15170000
      DIT'DEV'STAT3    := IP'CHAN'PGM (CDEVSTAT3);                      15175000
                                                                        15180000
      IOQ'RETRY'COUNT := CP'RETRY'COUNT;                                15185000
      CP'RETRY'COUNT  := ZERO;                                          15190000
                                                                        15195000
    END;                                                                15200000
                                                                        15205000
    << **************************************************** >>          15210000
    << Determine where to return to in the channel program. >>          15215000
    << **************************************************** >>          15220000
                                                                        15225000
    IF CPVA'HALT'CODE = 2 THEN << return to the wait for parallel >>    15230000
    BEGIN                      << poll after the tape command.    >>    15235000
                                                                        15240000
      IF IOQ'FUNCTION'CODE = FC'WRITE THEN                              15245000
                                                                        15250000
        P'CHAN'PGM (CSTART'JVEC) := 85                                  15255000
                                                                        15260000
      ELSE                                                              15265000
                                                                        15270000
        P'CHAN'PGM (CSTART'JVEC) := 5;                                  15275000
                                                                        15280000
      CPVA'HALT'CODE := ZERO;                                           15285000
                                                                        15290000
      GO TO START'CHAN'PGM;                                             15295000
                                                                        15300000
    END                                                                 15305000
                                                                        15310000
    ELSE                                                                15315000
    BEGIN                                                               15320000
                                                                        15325000
      << ******************* >>                                         15330000
      << CPVA halt code = 3. >>                                         15335000
      << ******************* >>                                         15340000
                                                                        15345000
      << *********************************************************** >> 15350000
      << Return to the wait for parallel poll after the DMA transfer >> 15355000
      << in the write record portion of the channel program.         >> 15360000
      << *********************************************************** >> 15365000
                                                                        15370000
      CPVA'HALT'CODE := ZERO;                                           15375000
                                                                        15380000
      P'CHAN'PGM (CSTART'JVEC) := 97;                                   15385000
                                                                        15390000
      GO TO START'CHAN'PGM;                                             15395000
                                                                        15400000
    END;                                                                15405000
                                                                        15410000
  END;                                                                  15415000
                                                                        15420000
END;                                                                    15425000
$PAGE                                                                   15430000
<< ******************************************* >>                       15435000
<< Zero length read is a forward space record. >>                       15440000
<< ******************************************* >>                       15445000
                                                                        15450000
IF IOQ'TRANSFER'COUNT = ZERO    AND                                     15455000
   IOQ'FUNCTION'CODE  = FC'READ THEN                                    15460000
                                                                        15465000
  IOQ'FUNCTION'CODE := FC'NEXT'RECORD;                                  15470000
$PAGE                                                                   15475000
<< ******************************************** >>                      15480000
<< Zero length write is a check for write ring. >>                      15485000
<< ******************************************** >>                      15490000
                                                                        15495000
IF IOQ'TRANSFER'COUNT = ZERO     AND                                    15500000
   IOQ'FUNCTION'CODE  = FC'WRITE THEN                                   15505000
BEGIN                                                                   15510000
                                                                        15515000
  TRANSFER'COUNT := IOQ'TRANSFER'COUNT;                                 15520000
                                                                        15525000
  IF DRIVER'STATE = INITIATOR'STATE THEN << check for write ring.>>     15530000
  BEGIN                                                                 15535000
                                                                        15540000
                                                               <<F8105>>15545000
                                                               <<F8105>>15550000
                                                                        15555000
      << Get current device status. This is used to >>         <<F8105>>15560000
      << determine if a write ring is present or not. >>       <<F8105>>15565000
                                                               <<F8105>>15570000
                                                               <<F8105>>15575000
      IP'CHAN'PGM (CSTART'JVEC) := ZERO         ;              <<F8105>>15580000
      IP'CHAN'PGM (CCMD'DSJ0)   := 32           ;              <<F8105>>15585000
      IP'CHAN'PGM (CTAPE'CMD)   := TC'DEV'STATUS;              <<F8105>>15590000
                                                               <<F8105>>15595000
                                                               <<F8105>>15600000
      << Start channel program to get device status >>         <<F8105>>15605000
                                                               <<F8105>>15610000
      START'HPIB (P'DIT, P'CHAN'PGM, TRUE);                    <<F8105>>15615000
                                                               <<F8105>>15620000
      IF < THEN << Channel porgram failed to start. >>         <<F8105>>15625000
      BEGIN                                                    <<F8105>>15630000
                                                               <<F8105>>15635000
       MASTERCLEARHPIB (P'DIT); <<Halt channel program>>       <<F8105>>15640000
       IOQ'IO'STATUS := CHAN'PGM'FAILURE;                      <<F8105>>15645000
       DRIVER'STATE  := REQUEST'COMPLETE;                      <<F8105>>15650000
                                                               <<F8105>>15655000
      RETURN;                                                  <<F8105>>15660000
                                                               <<F8105>>15665000
      END;                                                     <<F8105>>15670000
                                                               <<F8105>>15675000
      << Wait for request status to complete. >>               <<F8105>>15680000
                                                               <<F8105>>15685000
      P'CP'VAR'AREA := ZERO           ;                        <<F8105>>15690000
      IOQ'IO'STATUS := COMPLETION'WAIT;                        <<F8105>>15695000
      DRIVER'STATE  := INTERRUPT'WAIT ;                        <<F8105>>15700000
                                                               <<F8105>>15705000
      RETURN;                                                  <<F8105>>15710000
                                                               <<F8105>>15715000
                                                               <<F8105>>15720000
                                                               <<F8105>>15725000
  END                                                          <<F8105>>15730000
                                                               <<F8105>>15735000
  ELSE                                                         <<F8105>>15740000
  BEGIN                                                        <<F8105>>15745000
                                                               <<F8105>>15750000
    << Complete request >>                                     <<F8105>>15755000
                                                                        15760000
    GO TO COMPLETE'REQUEST;                                             15765000
                                                                        15770000
  END;                                                                  15775000
                                                                        15780000
END;                                                                    15785000
$PAGE                                                                   15790000
<< ****************** >>                                                15795000
<<                    >>                                                15800000
<< REQUEST PROCESSOR. >>                                                15805000
<<                    >>                                                15810000
<< ****************** >>                                                15815000
                                                                        15820000
                                                                        15825000
REQUEST'PROCESSOR:                                                      15830000
                                                                        15835000
                                                                        15840000
<< ************************** >>                               <<J8874>>15845000
<< Enable End Of Volume check >>                               <<J8874>>15850000
<< ************************** >>                               <<J8874>>15855000
                                                               <<J8874>>15860000
IF IOQ'FUNCTION'CODE = FC'ENABLE'EOV'CHECK THEN                <<J8874>>15865000
BEGIN                                                          <<J8874>>15870000
<<IF DIT'DSAVE'EOFS = 0 THEN  >>                               <<J8874>>15875000
<<BEGIN    >>                                                  <<J8874>>15880000
    DIT'DSAVE'EOFS := 1;                                       <<J8874>>15885000
    IOQ'IO'STATUS := GOOD'IO;                                  <<J8874>>15890000
<<END ELSE IOQ'IO'STATUS := INVALID'REQUEST;>>                 <<J8874>>15895000
  DRIVER'STATE := REQUEST'COMPLETE;                            <<J8874>>15900000
  RETURN;                                                      <<J8874>>15905000
END;                                                           <<J8874>>15910000
                                                               <<J8874>>15915000
<< ************************* >>                                <<J8874>>15920000
<< Check see EOV flag set    >>                                <<J8874>>15925000
<< ************************* >>                                <<J8874>>15930000
                                                               <<J8874>>15935000
IF DIT'DSAVE'EOFS = TWO'EOF'ENCOUNTERED THEN                   <<J8874>>15940000
  IF IOQ'FUNCTION'CODE = FC'READ                               <<J8874>>15945000
  OR IOQ'FUNCTION'CODE = FC'NEXT'FILE                          <<J8874>>15950000
  OR IOQ'FUNCTION'CODE = FC'GAP'TAPE                           <<J8874>>15955000
  OR IOQ'FUNCTION'CODE = FC'NEXT'RECORD                        <<J8874>>15960000
  THEN BEGIN                                                   <<J8874>>15965000
    IOQ'IO'STATUS := PASS'EOV'ABORT;                           <<J8874>>15970000
    DRIVER'STATE := REQUEST'COMPLETE;                          <<J8874>>15975000
    RETURN;                                                    <<J8874>>15980000
  END;                                                         <<J8874>>15985000
<< ************************************* >>                             15990000
<< Validate function and transfer count. >>                             15995000
<< ************************************* >>                             16000000
                                                                        16005000
IF IOQ'FUNCTION'CODE = 13 OR                                            16010000
   IOQ'FUNCTION'CODE = 17 OR                                            16015000
   IOQ'FUNCTION'CODE > 31 OR                                            16020000
   TRANSFER'COUNT > MAXIMUM'TRANSFER THEN                               16025000
BEGIN                                                                   16030000
                                                                        16035000
  IOQ'IO'STATUS := INVALID'REQUEST ;                                    16040000
  DRIVER'STATE  := REQUEST'COMPLETE;                                    16045000
                                                                        16050000
  RETURN;                                                               16055000
                                                                        16060000
END;                                                                    16065000
                                                               <<F7703>>16070000
<< ************************************* >>                    <<F7703>>16075000
<< Reset EOF indicator if function isn't >>                    <<F7703>>16080000
<< a write file mark.                    >>                    <<F7703>>16085000
<< ************************************* >>                    <<F7703>>16090000
                                                               <<F7703>>16095000
IF NOT (IOQ'FUNCTION'CODE = FC'FILE'MARK) THEN                 <<F7703>>16100000
                                                               <<F7703>>16105000
  DIT'EOF'INDICATOR := ZERO;                                   <<F7703>>16110000
                                                                        16115000
<< **************** >>                                                  16120000
<< Process request. >>                                                  16125000
<< **************** >>                                                  16130000
                                                                        16135000
CASE * IOQ'FUNCTION'CODE OF                                             16140000
BEGIN                                                                   16145000
$PAGE                                                                   16150000
  << ***************************** >>                                   16155000
  << Read Record, function code 0. >>                                   16160000
  << ***************************** >>                                   16165000
                                                                        16170000
  BEGIN << case 0.>>                                                    16175000
                                                                        16180000
    EOFCHECK (IOQ'INDEX, 0D, 0, 0); << Check for read   >>              16185000
                                    << past EOF allowed.>>              16190000
    IF <> THEN << EOF, read not allowed.>>                              16195000
    BEGIN                                                               16200000
                                                                        16205000
      DRIVER'STATE := REQUEST'COMPLETE;                                 16210000
                                                                        16215000
      RETURN;                                                           16220000
                                                                        16225000
    END;                                                                16230000
                                                                        16235000
    << ******************************** >>                              16240000
    << Set up chan pgm for read record. >>                              16245000
    << ******************************** >>                              16250000
                                                                        16255000
    IP'CHAN'PGM (CSTART'JVEC  ) := ZERO   ;                             16260000
    IP'CHAN'PGM (CCMD'DSJ0    ) := ZERO   ;                             16265000
    IP'CHAN'PGM (CRD'EXEC     ) := %1400  ;                             16270000
    IP'CHAN'PGM (CEND'DATA    ) := %2007  ;                             16275000
    IP'CHAN'PGM (CEND'DATA'CNT) := 1      ;                             16280000
    IP'CHAN'PGM (CTAPE'CMD    ) := TC'READ;                             16285000
                                                                        16290000
    IF TRANSFER'COUNT < 6 THEN << short read processing.>>              16295000
    BEGIN                                                               16300000
                                                                        16305000
      IP'CHAN'PGM (CRD'BYTE'CNT) := 6   ; << Transfer count.   >>       16310000
      IP'CHAN'PGM (CRD'BANK    ) := ZERO; << Buffer bank       >>       16315000
                                                                        16320000
      IP'CHAN'PGM (CRD'ADR     ) := @P'CHAN'PGM (CSHORT'BUF1)           16325000
        + SYSDB;                            << and address.      >>     16330000
                                                                        16335000
      IP'CHAN'PGM (CSHORT'BUF1 ) := ZERO;                               16340000
      IP'CHAN'PGM (CSHORT'BUF2 ) := ZERO;                               16345000
      IP'CHAN'PGM (CSHORT'BUF3 ) := ZERO;                               16350000
                                                                        16355000
      DIT'SHORT'READ := TRUE;                                           16360000
                                                                        16365000
    END                                                                 16370000
                                                                        16375000
    ELSE << normal read processing.>>                                   16380000
    BEGIN                                                               16385000
                                                                        16390000
      IP'CHAN'PGM (CRD'BYTE'CNT) := TRANSFER'COUNT;                     16395000
      IP'CHAN'PGM (CRD'BANK    ) := BUF'BANK      ;                     16400000
      IP'CHAN'PGM (CRD'ADR     ) := BUF'ADR       ;                     16405000
                                                                        16410000
    END;                                                                16415000
                                                                        16420000
  END; << Case 0.>>                                                     16425000
$PAGE                                                                   16430000
  << ****************************** >>                                  16435000
  << Write Record, function code 1. >>                                  16440000
  << ****************************** >>                                  16445000
                                                                        16450000
  BEGIN << Case 1.>>                                                    16455000
                                                                        16460000
    IF DIT'END'OF'TAPE        AND                                       16465000
       NOT IOQ'WRITE'PAST'EOT THEN << no write after EOT allowed.>>     16470000
    BEGIN                                                               16475000
                                                                        16480000
      IOQ'IO'STATUS := EOT'WRITE       ;                                16485000
      DRIVER'STATE  := REQUEST'COMPLETE;                                16490000
                                                                        16495000
      RETURN;                                                           16500000
                                                                        16505000
    END;                                                                16510000
                                                                        16515000
    << ********************************* >>                             16520000
    << Set up chan pgm for write record. >>                             16525000
    << ********************************* >>                             16530000
                                                                        16535000
    IP'CHAN'PGM (CSTART'JVEC ) := 80            ;                       16540000
    IP'CHAN'PGM (CWR'CMD     ) := %2001         ;                       16545000
    IP'CHAN'PGM (CWR'CMD'CNT ) := 2             ;                       16550000
    IP'CHAN'PGM (CWR'CMD'BANK) := %2000         ;                       16555000
    IP'CHAN'PGM (CWR'CMD'DSJ0) := ZERO          ;                       16560000
    IP'CHAN'PGM (CWR'EXEC    ) := %2000         ;                       16565000
    IP'CHAN'PGM (CWR'BYTE'CNT) := TRANSFER'COUNT;                       16570000
    IP'CHAN'PGM (CWR'BANK    ) := BUF'BANK      ;                       16575000
    IP'CHAN'PGM (CWR'ADR     ) := BUF'ADR       ;                       16580000
    IP'CHAN'PGM (CWR'DSJ0    ) := -72           ;                       16585000
    IP'CHAN'PGM (CWR'DSJ1    ) := -60           ;                       16590000
    IP'CHAN'PGM (CWR'DSJ2    ) := -36           ;                       16595000
                                                                        16600000
    << Set up write command.  Place write command in left byte.>>       16605000
    << Place transfer count / 256 in right byte.  This is so   >>       16610000
    << the device can poll for transfer when there is enough   >>       16615000
    << room in its internal buffer to hold the transfer.       >>       16620000
                                                                        16625000
    IP'CHAN'PGM (CTAPE'CMD).(0:8) := TC'WRITE;                          16630000
    IP'CHAN'PGM (CTAPE'CMD).(8:8) := (TRANSFER'COUNT - 1) / 256;        16635000
                                                                        16640000
  END; << Case 1.>>                                                     16645000
$PAGE                                                                   16650000
  << *************************** >>                                     16655000
  << Open File, function code 2. >>                                     16660000
  << *************************** >>                                     16665000
                                                                        16670000
  BEGIN << Case 2.>>                                                    16675000
                                                                        16680000
    << ******************************************** >>                  16685000
    << Set up chan pgm for enable immediate report. >>                  16690000
    << ******************************************** >>                  16695000
                                                                        16700000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO;                                  16705000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20  ;                                  16710000
                                                                        16715000
    IF IOQ'PARM'2 = DISABLE'IMMED'RPT THEN                              16720000
                                                                        16725000
      IP'CHAN'PGM (CTAPE'CMD) := TC'DISABLE'IMMED                       16730000
                                                                        16735000
    ELSE                                                                16740000
                                                                        16745000
      IP'CHAN'PGM (CTAPE'CMD) := TC'ENABLE'IMMED;                       16750000
                                                                        16755000
  END;  << Case 2.>>                                                    16760000
$PAGE                                                                   16765000
  << **************************** >>                                    16770000
  << Close File, function code 3. >>                                    16775000
  << **************************** >>                                    16780000
                                                                        16785000
  BEGIN << Case 3.>>                                                    16790000
                                                                        16795000
    << ************************** >>                                    16800000
    << Always return good status. >>                                    16805000
    << ************************** >>                                    16810000
                                                                        16815000
    IOQ'IO'STATUS := GOOD'IO         ;                                  16820000
    DRIVER'STATE  := REQUEST'COMPLETE;                                  16825000
                                                                        16830000
    RETURN;                                                             16835000
                                                                        16840000
  END; << Case 3.>>                                                     16845000
$PAGE                                                                   16850000
  << ****************************** >>                                  16855000
  << Close Device, function code 4. >>                                  16860000
  << ****************************** >>                                  16865000
                                                                        16870000
  BEGIN << Case 4.>>                                                    16875000
                                                                        16880000
    LPDT'ENTRY'INDEX := DIT'LDEV * LPDT'ENTRY'SIZE;                     16885000
    LPDT'EOF'TYPE    := ZERO;                                           16890000
                                                                        16895000
    IF NOT CP'IMMED'RPT'ENABLE THEN                                     16900000
    BEGIN                                                               16905000
                                                                        16910000
      << ******************************************** >>                16915000
      << Set up chan pgm for enable immediate report. >>                16920000
      << ******************************************** >>                16925000
                                                                        16930000
      IP'CHAN'PGM (CSTART'JVEC) := ZERO           ;                     16935000
      IP'CHAN'PGM (CCMD'DSJ0  ) := 20             ;                     16940000
      IP'CHAN'PGM (CTAPE'CMD  ) := TC'ENABLE'IMMED;                     16945000
                                                                        16950000
    END                                                                 16955000
                                                                        16960000
    ELSE                                                                16965000
    BEGIN                                                               16970000
                                                                        16975000
      << *********************************** >>                         16980000
      << Set up chan pgm for rewind/offline. >>                         16985000
      << *********************************** >>                         16990000
                                                                        16995000
      IP'CHAN'PGM (CSTART'JVEC) := ZERO             ;                   17000000
      IP'CHAN'PGM (CCMD'DSJ0  ) := 20               ;                   17005000
      IP'CHAN'PGM (CTAPE'CMD  ) := TC'REWIND'OFFLINE;                   17010000
                                                                        17015000
    END;                                                                17020000
                                                                        17025000
  END; << Case 4.>>                                                     17030000
$PAGE                                                                   17035000
  << ************************ >>                                        17040000
  << Rewind, function code 5. >>                                        17045000
  << ************************ >>                                        17050000
                                                                        17055000
  BEGIN << Case 5.>>                                                    17060000
                                                                        17065000
    IF DIT'REWIND     AND                                               17070000
       DIT'LOAD'POINT THEN << don't bother, its already rewound.>>      17075000
    BEGIN                                                               17080000
                                                                        17085000
      IOQ'IO'STATUS := GOOD'IO         ;                                17090000
      DRIVER'STATE  := REQUEST'COMPLETE;                                17095000
                                                                        17100000
      RETURN;                                                           17105000
                                                                        17110000
    END;                                                                17115000
                                                                        17120000
    << *************************** >>                                   17125000
    << Set up chan pgm for rewind. >>                                   17130000
    << *************************** >>                                   17135000
                                                                        17140000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO     ;                             17145000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20       ;                             17150000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'REWIND;                             17155000
                                                                        17160000
  END; << Case 5.>>                                                     17165000
$PAGE                                                                   17170000
  << ********************************* >>                               17175000
  << Write File Mark, function code 6. >>                               17180000
  << ********************************* >>                               17185000
                                                                        17190000
  BEGIN << Case 6.>>                                                    17195000
                                                                        17200000
    IF DIT'END'OF'TAPE        AND                                       17205000
       NOT IOQ'WRITE'PAST'EOT THEN << no write after EOT allowed.>>     17210000
    BEGIN                                                               17215000
                                                                        17220000
      IOQ'IO'STATUS := EOT'WRITE       ;                                17225000
      DRIVER'STATE  := REQUEST'COMPLETE;                                17230000
                                                                        17235000
      RETURN;                                                           17240000
                                                                        17245000
    END;                                                                17250000
                                                                        17255000
    IF DIT'EOF'INDICATOR = 1 THEN                              <<F7703>>17260000
    BEGIN                                                      <<F7703>>17265000
                                                               <<F7703>>17270000
      << ********************************************** >>     <<F7703>>17275000
      << Set up chan pgm for complete device buffered   >>     <<F7703>>17280000
      << operations and return device status when done. >>     <<F7703>>17285000
      << ********************************************** >>     <<F7703>>17290000
                                                               <<F7703>>17295000
      DIT'EOF'INDICATOR := 2;                                  <<F7703>>17300000
                                                               <<F7703>>17305000
      IP'CHAN'PGM (CSTART'JVEC) := ZERO         ;              <<F7703>>17310000
      IP'CHAN'PGM (CCMD'DSJ0  ) := 20           ;              <<F7703>>17315000
      IP'CHAN'PGM (CTAPE'CMD  ) := TC'DEV'STATUS;              <<F7703>>17320000
                                                               <<F7703>>17325000
    END                                                        <<F7703>>17330000
                                                               <<F7703>>17335000
    ELSE                                                       <<F7703>>17340000
    BEGIN                                                      <<F7703>>17345000
                                                               <<F7703>>17350000
      << ****************************************** >>         <<F7703>>17355000
      << Set up chan pgm for write file mark (EOF). >>         <<F7703>>17360000
      << ****************************************** >>         <<F7703>>17365000
                                                                        17370000
      DIT'EOF'INDICATOR := ZERO;                               <<F7703>>17375000
                                                               <<F7703>>17380000
      IP'CHAN'PGM (CSTART'JVEC) := ZERO        ;               <<F7703>>17385000
      IP'CHAN'PGM (CCMD'DSJ0  ) := 20          ;               <<F7703>>17390000
      IP'CHAN'PGM (CTAPE'CMD  ) := TC'FILE'MARK;               <<F7703>>17395000
                                                               <<F7703>>17400000
    END;                                                       <<F7703>>17405000
                                                                        17410000
  END; << Case 6.>>                                                     17415000
$PAGE                                                                   17420000
  << ************************************ >>                            17425000
  << Forward Space File, function code 7. >>                            17430000
  << ************************************ >>                            17435000
                                                                        17440000
  BEGIN << Case 7.>>                                                    17445000
                                                                        17450000
    << *************************************** >>                       17455000
    << Set up chan pgm for forward space file. >>                       17460000
    << *************************************** >>                       17465000
                                                                        17470000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO        ;                          17475000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20          ;                          17480000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'NEXT'FILE;                          17485000
                                                                        17490000
  END; << Case 7.>>                                                     17495000
$PAGE                                                                   17500000
  << ******************************** >>                                17505000
  << Backspace File, function code 8. >>                                17510000
  << ******************************** >>                                17515000
                                                                        17520000
  BEGIN << Case 8.>>                                                    17525000
                                                                        17530000
    IF DIT'LOAD'POINT THEN << can't backspace at load point.>>          17535000
    BEGIN                                                               17540000
                                                                        17545000
      IOQ'IO'STATUS := BACKSPACE'BOT   ;                                17550000
      DRIVER'STATE  := REQUEST'COMPLETE;                                17555000
                                                                        17560000
      RETURN;                                                           17565000
                                                                        17570000
    END;                                                                17575000
                                                                        17580000
    << *********************************** >>                           17585000
    << Set up chan pgm for backspace file. >>                           17590000
    << *********************************** >>                           17595000
                                                                        17600000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO        ;                          17605000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20          ;                          17610000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'PREV'FILE;                          17615000
                                                                        17620000
  END; << Case 8.>>                                                     17625000
$PAGE                                                                   17630000
  << ******************************** >>                                17635000
  << Rewind/Offline, function code 9. >>                                17640000
  << ******************************** >>                                17645000
                                                                        17650000
  BEGIN << Case 9.>>                                                    17655000
                                                                        17660000
    IF DIT'REWIND          AND                                          17665000
       NOT DIT'UNIT'ONLINE THEN << don't bother, its already there.>>   17670000
    BEGIN                                                               17675000
                                                                        17680000
      IOQ'IO'STATUS := GOOD'IO         ;                                17685000
      DRIVER'STATE  := REQUEST'COMPLETE;                                17690000
                                                                        17695000
      RETURN;                                                           17700000
                                                                        17705000
    END;                                                                17710000
                                                                        17715000
    << *********************************** >>                           17720000
    << Set up chan pgm for rewind/offline. >>                           17725000
    << *********************************** >>                           17730000
                                                                        17735000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO             ;                     17740000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20               ;                     17745000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'REWIND'OFFLINE;                     17750000
                                                                        17755000
  END; << Case 9.>>                                                     17760000
$PAGE                                                                   17765000
  << *************************** >>                                     17770000
  << Gap Tape, function code 10. >>                                     17775000
  << *************************** >>                                     17780000
                                                                        17785000
  BEGIN << Case 10.>>                                                   17790000
                                                                        17795000
    << *********************************** >>                           17800000
    << Set up chan pgm for write tape gap. >>                           17805000
    << *********************************** >>                           17810000
                                                                        17815000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO       ;                           17820000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20         ;                           17825000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'GAP'TAPE;                           17830000
                                                                        17835000
  END; << Case 10.>>                                                    17840000
$PAGE                                                                   17845000
  << *************************************** >>                         17850000
  << Forward Space Record, function code 11. >>                         17855000
  << *************************************** >>                         17860000
                                                                        17865000
  BEGIN << Case 11.>>                                                   17870000
                                                                        17875000
    EOFCHECK (IOQ'INDEX, 0D, 0, 0); << Check for forward space >>       17880000
                                    << past EOF allowed.       >>       17885000
    IF <> THEN << EOF, forward space not allowed.>>                     17890000
    BEGIN                                                               17895000
                                                                        17900000
      DRIVER'STATE := REQUEST'COMPLETE;                                 17905000
                                                                        17910000
      RETURN;                                                           17915000
                                                                        17920000
    END;                                                                17925000
                                                                        17930000
    << ***************************************** >>                     17935000
    << Set up chan pgm for forward space record. >>                     17940000
    << ***************************************** >>                     17945000
                                                                        17950000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO          ;                        17955000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20            ;                        17960000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'NEXT'RECORD;                        17965000
                                                                        17970000
  END; << Case 11.>>                                                    17975000
$PAGE                                                                   17980000
  << *********************************** >>                             17985000
  << Backspace Record, function code 12. >>                             17990000
  << *********************************** >>                             17995000
                                                                        18000000
  BEGIN << Case 12.>>                                                   18005000
                                                                        18010000
    EOFCHECK (IOQ'INDEX, 0D, 0, 0); << Check for backspace >>           18015000
                                    << past EOF allowed.   >>           18020000
    IF <> THEN << EOF, backspace not allowed.>>                         18025000
    BEGIN                                                               18030000
                                                                        18035000
      DRIVER'STATE := REQUEST'COMPLETE;                                 18040000
                                                                        18045000
      RETURN;                                                           18050000
                                                                        18055000
    END;                                                                18060000
                                                                        18065000
    IF DIT'LOAD'POINT THEN << can't issue backspace at load point.>>    18070000
    BEGIN                                                               18075000
                                                                        18080000
      IOQ'IO'STATUS := BACKSPACE'BOT   ;                                18085000
      DRIVER'STATE  := REQUEST'COMPLETE;                                18090000
                                                                        18095000
      RETURN;                                                           18100000
                                                                        18105000
    END;                                                                18110000
                                                                        18115000
    << ************************************* >>                         18120000
    << Set up chan pgm for backspace record. >>                         18125000
    << ************************************* >>                         18130000
                                                                        18135000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO          ;                        18140000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20            ;                        18145000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'PREV'RECORD;                        18150000
                                                                        18155000
  END; << Case 12.>>                                                    18160000
$PAGE                                                                   18165000
  << *********** >>                                                     18170000
  << Dummy Case. >>                                                     18175000
  << *********** >>                                                     18180000
                                                                        18185000
  BEGIN << Case 13.>>                                                   18190000
                                                                        18195000
    << Not referenced.>>                                                18200000
                                                                        18205000
    << This is a dummy case.  Function code 13 is used by the >>        18210000
    << 7976 for a read backwards request.  This driver does   >>        18215000
    << not support the read backwards function.  This case is >>        18220000
    << here only as a place holder.                           >>        18225000
                                                                        18230000
    ;                                                                   18235000
                                                                        18240000
  END; << Case 13.>>                                                    18245000
$PAGE                                                                   18250000
  << **************************************** >>                        18255000
  << Actual Transfer Count, function code 14. >>                        18260000
  << **************************************** >>                        18265000
                                                                        18270000
  BEGIN << Case 14.>>                                                   18275000
                                                                        18280000
    IF TRANSFER'COUNT < 2 THEN << invalid.>>                            18285000
    BEGIN                                                               18290000
                                                                        18295000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                18300000
      DRIVER'STATE  := REQUEST'COMPLETE;                                18305000
                                                                        18310000
      RETURN;                                                           18315000
                                                                        18320000
    END;                                                                18325000
                                                                        18330000
    TOS := BUF'BANK'ADR;                                                18335000
    TOS := IP'CHAN'PGM (CACT'CNT);                                      18340000
    ASSEMBLE (SSEA);     << Store single word from S into         >>    18345000
                         << the address from S-1 (buffer address) >>    18350000
                         << and S-2 (bank).                       >>    18355000
    DDEL;                << Clean up our stack.>>                       18360000
                                                                        18365000
    GO TO NO'ERROR;                                                     18370000
                                                                        18375000
  END; << Case 14.>>                                                    18380000
$PAGE                                                                   18385000
  << ******************************** >>                       <<08868>>18390000
  << Device Status, function code 15. >>                       <<08868>>18395000
  << ******************************** >>                       <<08868>>18400000
                                                               <<08868>>18405000
  << ******************************************************* >><<08868>>18410000
  << This request returns device status of the last request. >><<08868>>18415000
  << ******************************************************* >><<08868>>18420000
                                                               <<08868>>18425000
  BEGIN << Case 15.>>                                          <<08868>>18430000
                                                               <<08868>>18435000
    IF TRANSFER'COUNT < 2 THEN << don't issue request.>>       <<08868>>18440000
    BEGIN                                                      <<08868>>18445000
                                                               <<08868>>18450000
      IOQ'IO'STATUS := INVALID'REQUEST ;                       <<08868>>18455000
      DRIVER'STATE  := REQUEST'COMPLETE;                       <<08868>>18460000
                                                               <<08868>>18465000
      RETURN;                                                  <<08868>>18470000
                                                               <<08868>>18475000
    END;                                                       <<08868>>18480000
                                                               <<08868>>18485000
    TOS := BUF'BANK'ADR; << Push buffer address on TOS.   >>   <<08868>>18490000
    TOS := IP'CHAN'PGM (CDEVSTAT1);                            <<08868>>18495000
                         << Push 1st status word on TOS.  >>   <<08868>>18500000
    ASSEMBLE (SSEA);     << Put 1st status word in buffer.>>   <<08868>>18505000
                                                               <<08868>>18510000
    IOQ'TRANSFER'COUNT := -2;                                  <<08868>>18515000
                                                               <<08868>>18520000
    IF TRANSFER'COUNT > 2 THEN                                 <<08868>>18525000
    BEGIN                                                      <<08868>>18530000
                                                               <<08868>>18535000
      TOS := TOS + 1;  << Increment buffer address.     >>     <<08868>>18540000
      TOS := IP'CHAN'PGM (CDEVSTAT2);                          <<08868>>18545000
                       << Push 2nd status word on TOS.  >>     <<08868>>18550000
      ASSEMBLE (SSEA); << Put 2nd status word in buffer.>>     <<08868>>18555000
                                                               <<08868>>18560000
      IOQ'TRANSFER'COUNT := -4;                                <<08868>>18565000
                                                               <<08868>>18570000
    END;                                                       <<08868>>18575000
                                                               <<08868>>18580000
    IF TRANSFER'COUNT > 4 THEN                                 <<08868>>18585000
    BEGIN                                                      <<08868>>18590000
                                                               <<08868>>18595000
      TOS := TOS + 1;  << Increment buffer address.     >>     <<08868>>18600000
      TOS := IP'CHAN'PGM (CDEVSTAT3);                          <<08868>>18605000
                       << Push 3rd status word on TOS.  >>     <<08868>>18610000
      ASSEMBLE (SSEA); << Put 3rd status word in buffer.>>     <<08868>>18615000
                                                               <<08868>>18620000
      IOQ'TRANSFER'COUNT := -6;                                <<08868>>18625000
                                                               <<08868>>18630000
    END;                                                       <<08868>>18635000
                                                               <<08868>>18640000
    DDEL; << clean up stack.>>                                 <<08868>>18645000
                                                               <<08868>>18650000
    IOQ'IO'STATUS := GOOD'IO         ;                         <<08868>>18655000
    DRIVER'STATE  := REQUEST'COMPLETE;                         <<08868>>18660000
                                                               <<08868>>18665000
    RETURN;                                                    <<08868>>18670000
                                                               <<08868>>18675000
  END; << Case 15.>>                                           <<08868>>18680000
$PAGE                                                                   18685000
  << ****************************** >>                                  18690000
  << Set Density, function code 16. >>                                  18695000
  << ****************************** >>                                  18700000
                                                                        18705000
  BEGIN << Case 16.>>                                                   18710000
                                                                        18715000
    << ******************************** >>                              18720000
    << Set up chan pgm for set density. >>                              18725000
    << ******************************** >>                              18730000
                                                                        18735000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO;                                  18740000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20  ;                                  18745000
                                                                        18750000
    IF IOQ'DENSITY = NRZI'800 THEN                                      18755000
                                                                        18760000
      IP'CHAN'PGM (CTAPE'CMD) := TC'DENSITY'800                         18765000
                                                                        18770000
    ELSE                                                                18775000
                                                                        18780000
    IF IOQ'DENSITY = PE'1600 THEN                                       18785000
                                                                        18790000
      IP'CHAN'PGM (CTAPE'CMD) := TC'DENSITY'1600                        18795000
                                                                        18800000
    ELSE                                                                18805000
                                                                        18810000
    IF IOQ'DENSITY = GCR'6250 THEN                                      18815000
                                                                        18820000
      IP'CHAN'PGM (CTAPE'CMD) := TC'DENSITY'6250                        18825000
                                                                        18830000
    ELSE << what are they trying to do?>>                               18835000
    BEGIN                                                               18840000
                                                                        18845000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                18850000
      DRIVER'STATE  := REQUEST'COMPLETE;                                18855000
                                                                        18860000
      RETURN;                                                           18865000
                                                                        18870000
    END;                                                                18875000
                                                                        18880000
  END; << Case 16.>>                                                    18885000
$PAGE                                                                   18890000
  << *********** >>                                                     18895000
  << Dummy Case. >>                                                     18900000
  << *********** >>                                                     18905000
                                                                        18910000
  BEGIN << Case 17.>>                                                   18915000
                                                                        18920000
    << Not referenced.>>                                                18925000
                                                                        18930000
    << This is a dummy case.  Function code 17 is the download >>       18935000
    << diagnostic monitor for the 7976.  This driver does not  >>       18940000
    << support this function (the monitor is resident in the   >>       18945000
    << device).  This case is here only as a place holder.     >>       18950000
                                                                        18955000
    ;                                                                   18960000
                                                                        18965000
  END; << Case 17.>>                                                    18970000
$PAGE                                                                   18975000
  << ************************************** >>                          18980000
  << Download Diagnostic, function code 18. >>                          18985000
  << ************************************** >>                          18990000
                                                                        18995000
  BEGIN << Case 18.>>                                                   19000000
                                                                        19005000
    IF TRANSFER'COUNT > 514 THEN << set maximum transfer count.>>       19010000
                                                                        19015000
      TRANSFER'COUNT := 514;                                            19020000
                                                                        19025000
    << ********************************** >>                            19030000
    << Set up chan pgm for download diag. >>                            19035000
    << ********************************** >>                            19040000
                                                                        19045000
    IP'CHAN'PGM (CSTART'JVEC ) := 92            ;                       19050000
    IP'CHAN'PGM (CWR'EXEC    ) := %2004         ;                       19055000
    IP'CHAN'PGM (CWR'BYTE'CNT) := TRANSFER'COUNT;                       19060000
    IP'CHAN'PGM (CWR'BANK    ) := BUF'BANK      ;                       19065000
    IP'CHAN'PGM (CWR'ADR     ) := BUF'ADR       ;                       19070000
    IP'CHAN'PGM (CWR'DSJ0    ) := -72           ;                       19075000
    IP'CHAN'PGM (CWR'DSJ1    ) := -60           ;                       19080000
    IP'CHAN'PGM (CWR'DSJ2    ) := -60           ;                       19085000
    IP'CHAN'PGM (CTAPE'CMD   ) := TC'WRITE      ;                       19090000
                                                                        19095000
  END; << Case 18.>>                                                    19100000
$PAGE                                                                   19105000
  << ***************************************** >>                       19110000
  << Read Diagnostic Status, function code 19. >>                       19115000
  << ***************************************** >>                       19120000
                                                                        19125000
  BEGIN << Case 19.>>                                                   19130000
                                                                        19135000
    << ************************************* >>                         19140000
    << Set up chan pgm for read diag status. >>                         19145000
    << ************************************* >>                         19150000
                                                                        19155000
    IP'CHAN'PGM (CSTART'JVEC ) := 12            ;                       19160000
    IP'CHAN'PGM (CRD'EXEC    ) := %1403         ;                       19165000
    IP'CHAN'PGM (CRD'BYTE'CNT) := TRANSFER'COUNT;                       19170000
    IP'CHAN'PGM (CRD'BANK    ) := BUF'BANK      ;                       19175000
    IP'CHAN'PGM (CRD'ADR     ) := BUF'ADR       ;                       19180000
    IP'CHAN'PGM (CDIAG'JUMP  ) := ZERO          ;                       19185000
    IP'CHAN'PGM (CDIAG'JVEC  ) := 13            ;                       19190000
    IP'CHAN'PGM (CTAPE'CMD   ) := TC'READ       ;                       19195000
                                                                        19200000
  END; << Case 19.>>                                                    19205000
$PAGE                                                                   19210000
  << *************************** >>                                     19215000
  << Loopback, function code 20. >>                                     19220000
  << *************************** >>                                     19225000
                                                                        19230000
  BEGIN << Case 20.>>                                                   19235000
                                                                        19240000
    << ***************************** >>                                 19245000
    << Set up chan pgm for loopback. >>                                 19250000
    << ***************************** >>                                 19255000
                                                                        19260000
    IP'CHAN'PGM (CSTART'JVEC ) := 92            ;                       19265000
    IP'CHAN'PGM (CRD'EXEC    ) := %3416         ;                       19270000
    IP'CHAN'PGM (CRD'BYTE'CNT) := TRANSFER'COUNT;                       19275000
    IP'CHAN'PGM (CRD'BANK    ) := BUF'BANK      ;                       19280000
    IP'CHAN'PGM (CRD'ADR     ) := BUF'ADR       ;                       19285000
    IP'CHAN'PGM (CLOOP'JUMP  ) := ZERO          ;                       19290000
    IP'CHAN'PGM (CLOOP'JVEC  ) := 18            ;                       19295000
    IP'CHAN'PGM (CWR'EXEC    ) := %4016         ;                       19300000
    IP'CHAN'PGM (CWR'BYTE'CNT) := TRANSFER'COUNT;                       19305000
    IP'CHAN'PGM (CWR'BANK    ) := BUF'BANK      ;                       19310000
    IP'CHAN'PGM (CWR'ADR     ) := BUF'ADR       ;                       19315000
    IP'CHAN'PGM (CWR'DSJ0    ) := -92           ;                       19320000
    IP'CHAN'PGM (CWR'DSJ1    ) := -92           ;                       19325000
    IP'CHAN'PGM (CWR'DSJ2    ) := -92           ;                       19330000
                                                                        19335000
  END; << Case 20.>>                                                    19340000
$PAGE                                                                   19345000
  << *************************** >>                                     19350000
  << Selftest, function code 21. >>                                     19355000
  << *************************** >>                                     19360000
                                                                        19365000
  BEGIN << Case 21.>>                                                   19370000
                                                                        19375000
    IF TRANSFER'COUNT < 1 THEN << invalid.>>                            19380000
    BEGIN                                                               19385000
                                                                        19390000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                19395000
      DRIVER'STATE  := REQUEST'COMPLETE;                                19400000
                                                                        19405000
      RETURN;                                                           19410000
                                                                        19415000
    END;                                                                19420000
                                                                        19425000
    << ***************************** >>                                 19430000
    << Set up chan pgm for selftest. >>                                 19435000
    << ***************************** >>                                 19440000
                                                                        19445000
    IP'CHAN'PGM (CSTART'JVEC ) := 92      ;                             19450000
    IP'CHAN'PGM (CRD'EXEC    ) := %3417   ;                             19455000
    IP'CHAN'PGM (CRD'BYTE'CNT) := 2       ;                             19460000
    IP'CHAN'PGM (CRD'BANK    ) := BUF'BANK;                             19465000
    IP'CHAN'PGM (CRD'ADR     ) := BUF'ADR ;                             19470000
    IP'CHAN'PGM (CTEST'JUMP  ) := ZERO    ;                             19475000
    IP'CHAN'PGM (CTEST'JVEC  ) := 23      ;                             19480000
    IP'CHAN'PGM (CWR'EXEC    ) := %4017   ;                             19485000
    IP'CHAN'PGM (CWR'BYTE'CNT) := 1       ;                             19490000
    IP'CHAN'PGM (CWR'BANK    ) := BUF'BANK + %40000; << Right byte.>>   19495000
    IP'CHAN'PGM (CWR'ADR     ) := BUF'ADR ;                             19500000
    IP'CHAN'PGM (CWR'DSJ0    ) := -92     ;                             19505000
    IP'CHAN'PGM (CWR'DSJ1    ) := -92     ;                             19510000
    IP'CHAN'PGM (CWR'DSJ2    ) := -92     ;                             19515000
                                                                        19520000
  END; << Case 21.>>                                                    19525000
$PAGE                                                                   19530000
  << ********************************* >>                               19535000
  << End Diagnostic, function code 22. >>                               19540000
  << ********************************* >>                               19545000
                                                                        19550000
  BEGIN << Case 22.>>                                                   19555000
                                                                        19560000
    << ***************************** >>                                 19565000
    << Set up chan pgm for end diag. >>                                 19570000
    << ***************************** >>                                 19575000
                                                                        19580000
    IP'CHAN'PGM (CSTART'JVEC   ) := 111 ;                               19585000
    IP'CHAN'PGM (CEND'DIAG     ) := %601;                               19590000
    IP'CHAN'PGM (CEND'DIAG'CODE) := ZERO;                               19595000
                                                                        19600000
  END; << Case 22.>>                                                    19605000
$PAGE                                                                   19610000
  << *************************** >>                                     19615000
  << Identify, function code 23. >>                                     19620000
  << *************************** >>                                     19625000
                                                                        19630000
  BEGIN << Case 23.>>                                                   19635000
                                                                        19640000
    IF TRANSFER'COUNT < 2 THEN << invalid.>>                            19645000
    BEGIN                                                               19650000
                                                                        19655000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                19660000
      DRIVER'STATE  := REQUEST'COMPLETE;                                19665000
                                                                        19670000
      RETURN;                                                           19675000
                                                                        19680000
    END;                                                                19685000
                                                                        19690000
    << ***************************** >>                                 19695000
    << Set up chan pgm for identify. >>                                 19700000
    << ***************************** >>                                 19705000
                                                                        19710000
    IP'CHAN'PGM (CSTART'JVEC) := 80   ;                                 19715000
    IP'CHAN'PGM (CIDENTIFY  ) := %3000;                                 19720000
    IP'CHAN'PGM (CIDENT'CODE) := ZERO ;                                 19725000
    IP'CHAN'PGM (CIDENT'JVEC) := 3    ;                                 19730000
    IP'CHAN'PGM (CIDENT'DSJ0) := -60  ;                                 19735000
                                                                        19740000
  END; << Case 23.>>                                                    19745000
$PAGE                                                                   19750000
  << ******************************* >>                                 19755000
  << Speed Select, function code 24. >>                                 19760000
  << ******************************* >>                                 19765000
                                                                        19770000
  BEGIN << Case 24.>>                                                   19775000
                                                                        19780000
    << ********************************* >>                             19785000
    << Set up chan pgm for speed select. >>                             19790000
    << ********************************* >>                             19795000
                                                                        19800000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO;                                  19805000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20  ;                                  19810000
                                                                        19815000
    IF IOQ'PARM'2 = START'STOP THEN                                     19820000
                                                                        19825000
      IP'CHAN'PGM (CTAPE'CMD) := TC'START'STOP                          19830000
                                                                        19835000
    ELSE                                                                19840000
                                                                        19845000
    IF IOQ'PARM'2 = STREAM THEN                                         19850000
                                                                        19855000
      IP'CHAN'PGM (CTAPE'CMD) := TC'STREAM                              19860000
                                                                        19865000
    ELSE << what are they trying to do?>>                               19870000
    BEGIN                                                               19875000
                                                                        19880000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                19885000
      DRIVER'STATE  := REQUEST'COMPLETE;                                19890000
                                                                        19895000
      RETURN;                                                           19900000
                                                                        19905000
    END;                                                                19910000
                                                                        19915000
  END; << Case 24.>>                                                    19920000
$PAGE                                                                   19925000
  << ********************************* >>                      <<08868>>19930000
  << Generic Status, function code 25. >>                      <<08868>>19935000
  << ********************************* >>                      <<08868>>19940000
                                                               <<08868>>19945000
  <<*********************************************************>><<08868>>19950000
  << This request returns generic status of   prior request. >><<08868>>19955000
  <<*********************************************************>><<08868>>19960000
                                                               <<08868>>19965000
  BEGIN << Case 25.>>                                          <<08868>>19970000
                                                               <<08868>>19975000
    IF TRANSFER'COUNT < 2 THEN << invalid.>>                   <<08868>>19980000
    BEGIN                                                      <<08868>>19985000
                                                               <<08868>>19990000
      IOQ'IO'STATUS := INVALID'REQUEST ;                       <<08868>>19995000
      DRIVER'STATE  := REQUEST'COMPLETE;                       <<08868>>20000000
                                                               <<08868>>20005000
      RETURN;                                                  <<08868>>20010000
                                                               <<08868>>20015000
    END;                                                       <<08868>>20020000
                                                               <<08868>>20025000
    IF TRANSFER'COUNT > 2 THEN << set maximum byte count.>>    <<08868>>20030000
                                                               <<08868>>20035000
       TRANSFER'COUNT := 2;                                    <<08868>>20040000
                                                               <<08868>>20045000
    GENERIC'STATUS := ZERO;                                    <<08868>>20050000
                                                               <<08868>>20055000
    << ************ >>                                         <<08868>>20060000
    << Fatal error. >>                                         <<08868>>20065000
    << ************ >>                                         <<08868>>20070000
                                                               <<08868>>20075000
    IF DIT'TAPE'RUNAWAY THEN                                   <<08868>>20080000
                                                               <<08868>>20085000
      GS'FATAL'ERROR := 1                                      <<08868>>20090000
                                                               <<08868>>20095000
    ELSE                                                       <<08868>>20100000
                                                               <<08868>>20105000
    IF DIT'UNRECOVERED'ERR THEN                                <<08868>>20110000
                                                               <<08868>>20115000
      GS'FATAL'ERROR := 2                                      <<08868>>20120000
                                                               <<08868>>20125000
    ELSE                                                       <<08868>>20130000
                                                               <<08868>>20135000
    IF DIT'TIMING'ERROR THEN                                   <<08868>>20140000
                                                               <<08868>>20145000
      GS'FATAL'ERROR := 3                                      <<08868>>20150000
                                                               <<08868>>20155000
    ELSE                                                       <<08868>>20160000
                                                               <<08868>>20165000
    IF DIT'CMD'REJECT THEN                                     <<08868>>20170000
                                                               <<08868>>20175000
      GS'FATAL'ERROR := 4                                      <<08868>>20180000
                                                               <<08868>>20185000
    ELSE                                                       <<08868>>20190000
                                                               <<08868>>20195000
    IF NOT (DIT'UNIT'FAILURE = ZERO) THEN                      <<08868>>20200000
                                                               <<08868>>20205000
      GS'FATAL'ERROR := 5                                      <<08868>>20210000
                                                               <<08868>>20215000
    ELSE                                                       <<08868>>20220000
                                                               <<08868>>20225000
    IF DIT'DATA'PARITY THEN                                    <<08868>>20230000
                                                               <<08868>>20235000
      GS'FATAL'ERROR := 6                                      <<08868>>20240000
                                                               <<08868>>20245000
    ELSE                                                       <<08868>>20250000
                                                               <<08868>>20255000
    IF DIT'CMD'PARITY THEN                                     <<08868>>20260000
                                                               <<08868>>20265000
      GS'FATAL'ERROR := 7;                                     <<08868>>20270000
                                                               <<08868>>20275000
    << ******** >>                                             <<08868>>20280000
    << Density. >>                                             <<08868>>20285000
    << ******** >>                                             <<08868>>20290000
                                                               <<08868>>20295000
    IF DIT'800'DENSITY THEN                                    <<08868>>20300000
                                                               <<08868>>20305000
      GS'DENSITY := 1                                          <<08868>>20310000
                                                               <<08868>>20315000
    ELSE                                                       <<08868>>20320000
                                                               <<08868>>20325000
    IF DIT'1600'DENSITY THEN                                   <<08868>>20330000
                                                               <<08868>>20335000
      GS'DENSITY := 2                                          <<08868>>20340000
                                                               <<08868>>20345000
    ELSE                                                       <<08868>>20350000
                                                               <<08868>>20355000
    IF DIT'6250'DENSITY THEN                                   <<08868>>20360000
                                                               <<08868>>20365000
      GS'DENSITY := 3;                                         <<08868>>20370000
                                                               <<08868>>20375000
    << ************ >>                                         <<08868>>20380000
    << Unit number. >>                                         <<08868>>20385000
    << ************ >>                                         <<08868>>20390000
                                                               <<08868>>20395000
    GS'UNIT'NUMBER := ZERO;                                    <<08868>>20400000
                                                               <<08868>>20405000
    << ************ >>                                         <<08868>>20410000
    << End of file. >>                                         <<08868>>20415000
    << ************ >>                                         <<08868>>20420000
                                                               <<08868>>20425000
    IF DIT'END'OF'FILE THEN                                    <<08868>>20430000
                                                               <<08868>>20435000
      GS'END'OF'FILE := TRUE;                                  <<08868>>20440000
                                                               <<08868>>20445000
    << *********** >>                                          <<08868>>20450000
    << Load point. >>                                          <<08868>>20455000
    << *********** >>                                          <<08868>>20460000
                                                               <<08868>>20465000
    IF DIT'LOAD'POINT THEN                                     <<08868>>20470000
                                                               <<08868>>20475000
      GS'LOAD'POINT := TRUE;                                   <<08868>>20480000
                                                               <<08868>>20485000
    << ************ >>                                         <<08868>>20490000
    << End of tape. >>                                         <<08868>>20495000
    << ************ >>                                         <<08868>>20500000
                                                               <<08868>>20505000
    IF DIT'END'OF'TAPE THEN                                    <<08868>>20510000
                                                               <<08868>>20515000
      GS'END'OF'TAPE := TRUE;                                  <<08868>>20520000
                                                               <<08868>>20525000
    << ***************** >>                                    <<08868>>20530000
    << Immediate report. >>                                    <<08868>>20535000
    << ***************** >>                                    <<08868>>20540000
                                                               <<08868>>20545000
    IF DIT'IMMED'RPT'ENABLE THEN                               <<08868>>20550000
                                                               <<08868>>20555000
      GS'IMMED'RPT'ENABLE := TRUE;                             <<08868>>20560000
                                                               <<08868>>20565000
    << **************** >>                                     <<08868>>20570000
    << Recovered error. >>                                     <<08868>>20575000
    << **************** >>                                     <<08868>>20580000
                                                               <<08868>>20585000
    IF DIT'RECOVERED'ERR THEN                                  <<08868>>20590000
                                                               <<08868>>20595000
      GS'RECOVERED'ERROR := TRUE;                              <<08868>>20600000
                                                               <<08868>>20605000
    << ************ >>                                         <<08868>>20610000
    << Unit online. >>                                         <<08868>>20615000
    << ************ >>                                         <<08868>>20620000
                                                               <<08868>>20625000
    IF DIT'UNIT'ONLINE THEN                                    <<08868>>20630000
                                                               <<08868>>20635000
      GS'UNIT'ONLINE := TRUE;                                  <<08868>>20640000
                                                               <<08868>>20645000
    << ************* >>                                        <<08868>>20650000
    << File protect. >>                                        <<08868>>20655000
    << ************* >>                                        <<08868>>20660000
                                                               <<08868>>20665000
    IF DIT'FILE'PROTECT THEN                                   <<08868>>20670000
                                                               <<08868>>20675000
      GS'FILE'PROTECT := TRUE;                                 <<08868>>20680000
                                                               <<08868>>20685000
    << ************************************** >>               <<08868>>20690000
    << Put generic status into user's buffer. >>               <<08868>>20695000
    << ************************************** >>               <<08868>>20700000
                                                               <<08868>>20705000
    TOS := BUF'BANK'ADR; << Push addr of user's bufr on TOS.>> <<08868>>20710000
    TOS := GENERIC'STATUS; << Push generic status on TOS.  >>  <<08868>>20715000
    ASSEMBLE (SSEA);       << Put generic status into buffer >><<08868>>20720000
    DDEL;                  << Clean up our stack.>>            <<08868>>20725000
                                                               <<08868>>20730000
    IOQ'IO'STATUS := GOOD'IO         ;                         <<08868>>20735000
    DRIVER'STATE  := REQUEST'COMPLETE;                         <<08868>>20740000
                                                               <<08868>>20745000
    RETURN;                                                    <<08868>>20750000
                                                               <<08868>>20755000
  END; << Case 25.>>                                           <<08868>>20760000
$PAGE                                                                   20765000
  << ************************************ >>                            20770000
  << Read internal log, function code 26. >>                            20775000
  << ************************************ >>                            20780000
                                                                        20785000
  BEGIN << Case 26.>>                                                   20790000
                                                                        20795000
    IF TRANSFER'COUNT < 4213 THEN << invalid request.>>                 20800000
    BEGIN                                                               20805000
                                                                        20810000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                20815000
      DRIVER'STATE  := REQUEST'COMPLETE;                                20820000
                                                                        20825000
      RETURN;                                                           20830000
                                                                        20835000
    END;                                                                20840000
                                                                        20845000
    << ************************************ >>                          20850000
    << Set up chan pgm for read status log. >>                          20855000
    << ************************************ >>                          20860000
                                                                        20865000
    IP'CHAN'PGM (CSTART'JVEC ) := 12      ;                             20870000
    IP'CHAN'PGM (CRD'EXEC    ) := %1405   ;                             20875000
    IP'CHAN'PGM (CRD'BYTE'CNT) := 4213    ;                             20880000
    IP'CHAN'PGM (CRD'BANK    ) := BUF'BANK;                             20885000
    IP'CHAN'PGM (CRD'ADR     ) := BUF'ADR ;                             20890000
    IP'CHAN'PGM (CLOG'JUMP   ) := ZERO    ;                             20895000
    IP'CHAN'PGM (CLOG'JVEC   ) := 23      ;                             20900000
                                                                        20905000
  END; << Case 26.>>                                                    20910000
$PAGE                                                                   20915000
  << ********************************* >>                               20920000
  << Write firmware, function code 27. >>                               20925000
  << ********************************* >>                               20930000
                                                                        20935000
  BEGIN << Case 27.>>                                                   20940000
                                                                        20945000
    << *********************************** >>                           20950000
    << Set up chan pgm for write firmware. >>                           20955000
    << *********************************** >>                           20960000
                                                                        20965000
    IP'CHAN'PGM (CSTART'JVEC ) := 92            ;                       20970000
    IP'CHAN'PGM (CWR'EXEC    ) := %2006         ;                       20975000
    IP'CHAN'PGM (CWR'BYTE'CNT) := TRANSFER'COUNT;                       20980000
    IP'CHAN'PGM (CWR'BANK    ) := BUF'BANK      ;                       20985000
    IP'CHAN'PGM (CWR'ADR     ) := BUF'ADR       ;                       20990000
    IP'CHAN'PGM (CWR'DSJ0    ) := -72           ;                       20995000
    IP'CHAN'PGM (CWR'DSJ1    ) := -60           ;                       21000000
    IP'CHAN'PGM (CWR'DSJ2    ) := -60           ;                       21005000
                                                                        21010000
  END; << Case 27.>>                                                    21015000
$PAGE                                                                   21020000
  << *************************************** >>                         21025000
  << Read firmware update, function code 28. >>                         21030000
  << *************************************** >>                         21035000
                                                                        21040000
  BEGIN << Case 28.>>                                                   21045000
                                                                        21050000
    << ********************************** >>                            21055000
    << Set up chan pgm for read firmware. >>                            21060000
    << ********************************** >>                            21065000
                                                                        21070000
    IP'CHAN'PGM (CSTART'JVEC ) := 12            ;                       21075000
    IP'CHAN'PGM (CRD'EXEC    ) := %1406         ;                       21080000
    IP'CHAN'PGM (CRD'BYTE'CNT) := TRANSFER'COUNT;                       21085000
    IP'CHAN'PGM (CRD'BANK    ) := BUF'BANK      ;                       21090000
    IP'CHAN'PGM (CRD'ADR     ) := BUF'ADR       ;                       21095000
    IP'CHAN'PGM (CFIRM'JUMP  ) := 0             ;                       21100000
    IP'CHAN'PGM (CFIRM'JVEC  ) := 23            ;                       21105000
                                                                        21110000
  END; << Case 28.>>                                                    21115000
$PAGE                                                                   21120000
  << *********************************** >>                             21125000
  << Immediate Report, function code 29. >>                             21130000
  << *********************************** >>                             21135000
                                                                        21140000
  BEGIN << Case 29.>>                                                   21145000
                                                                        21150000
    << ************************************* >>                         21155000
    << Set up chan pgm for immediate report. >>                         21160000
    << ************************************* >>                         21165000
                                                                        21170000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO;                                  21175000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20  ;                                  21180000
                                                                        21185000
    IF IOQ'PARM'2 = DISABLE'IMMED'RPT THEN                              21190000
                                                                        21195000
      IP'CHAN'PGM (CTAPE'CMD) := TC'DISABLE'IMMED                       21200000
                                                                        21205000
    ELSE                                                                21210000
                                                                        21215000
    IF IOQ'PARM'2 = ENABLE'IMMED'RPT THEN                               21220000
                                                                        21225000
      IP'CHAN'PGM (CTAPE'CMD) := TC'ENABLE'IMMED                        21230000
                                                                        21235000
    ELSE << what are they trying to do?>>                               21240000
    BEGIN                                                               21245000
                                                                        21250000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                21255000
      DRIVER'STATE  := REQUEST'COMPLETE;                                21260000
                                                                        21265000
      RETURN;                                                           21270000
                                                                        21275000
    END;                                                                21280000
                                                                        21285000
  END; << Case 29.>>                                                    21290000
$PAGE                                                                   21295000
  << ************************************ >>                            21300000
  << Get Device Status, function code 30. >>                            21305000
  << ************************************ >>                            21310000
                                                                        21315000
  << *********************************************** >>                 21320000
  << This request returns the current device status. >>                 21325000
  << *********************************************** >>                 21330000
                                                                        21335000
  BEGIN << Case 30.>>                                                   21340000
                                                                        21345000
    IF TRANSFER'COUNT < 2 THEN << don't issue request.>>                21350000
    BEGIN                                                               21355000
                                                                        21360000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                21365000
      DRIVER'STATE  := REQUEST'COMPLETE;                                21370000
                                                                        21375000
      RETURN;                                                           21380000
                                                                        21385000
    END;                                                                21390000
                                                                        21395000
    << ************************************** >>                        21400000
    << Set up chan pgm for get device status. >>                        21405000
    << ************************************** >>                        21410000
                                                                        21415000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO         ;                         21420000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20           ;                         21425000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'DEV'STATUS;                         21430000
                                                                        21435000
  END; << Case 30.>>                                                    21440000
$PAGE                                                                   21445000
  << ******************************* >>                                 21450000
  << Device clear, function code 31. >>                                 21455000
  << ******************************* >>                                 21460000
                                                                        21465000
  BEGIN << Case 31.>>                                                   21470000
                                                                        21475000
    << ********************************* >>                             21480000
    << Set up chan pgm for device clear. >>                             21485000
    << ********************************* >>                             21490000
                                                                        21495000
    IP'CHAN'PGM (CSTART'JVEC) := 99   ;                                 21500000
    IP'CHAN'PGM (CWR'DSJ0   ) := ZERO ;                                 21505000
    IP'CHAN'PGM (CWR'DSJ1   ) := ZERO ;                                 21510000
    IP'CHAN'PGM (CWR'DSJ2   ) := ZERO ;                                 21515000
    IP'CHAN'PGM (CCLEAR     ) := %4400;                                 21520000
    IP'CHAN'PGM (CCLEAR'WD2 ) := ZERO ;                                 21525000
    IP'CHAN'PGM (CCLEAR'JUMP) := ZERO ;                                 21530000
    IP'CHAN'PGM (CCLEAR'JVEC) := 1    ;                                 21535000
    IP'CHAN'PGM (CCLEAR'DSJ ) := %2402;                                 21540000
                                                                        21545000
  END; << Case 31.>>                                                    21550000
                                                                        21555000
END;                                                                    21560000
$PAGE                                                                   21565000
<< ********************** >>                                            21570000
<<                        >>                                            21575000
<< START CHANNEL PROGRAM. >>                                            21580000
<<                        >>                                            21585000
<< ********************** >>                                            21590000
                                                                        21595000
                                                                        21600000
START'CHAN'PGM:                                                         21605000
                                                                        21610000
                                                                        21615000
START'HPIB (P'DIT, P'CHAN'PGM, TRUE);                                   21620000
                                                                        21625000
IF < THEN << channel program failed to start.>>                         21630000
BEGIN                                                                   21635000
                                                                        21640000
  MASTERCLEARHPIB (P'DIT); << Halt channel program.>>                   21645000
                                                                        21650000
  IOQ'IO'STATUS := CHAN'PGM'FAILURE;                                    21655000
  DRIVER'STATE  := REQUEST'COMPLETE;                                    21660000
                                                                        21665000
  RETURN;                                                               21670000
                                                                        21675000
END;                                                                    21680000
                                                                        21685000
P'CP'VAR'AREA := ZERO          ; << Reset.>>                            21690000
DIT'REWIND    := ZERO          ; <<   "  .>>                            21695000
DRIVER'STATE  := INTERRUPT'WAIT;                                        21700000
                                                                        21705000
IF IOQ'BACKSPACE'EOF THEN  << status already set.>>                     21710000
                                                                        21715000
  RETURN;                                                               21720000
                                                                        21725000
IOQ'IO'STATUS := COMPLETION'WAIT;                                       21730000
                                                                        21735000
RETURN;                                                                 21740000
                                                                        21745000
$PAGE                                                                   21750000
<< ***************** >>                                                 21755000
<<                   >>                                                 21760000
<< Complete Request. >>                                                 21765000
<<                   >>                                                 21770000
<< ***************** >>                                                 21775000
                                                                        21780000
                                                                        21785000
COMPLETE'REQUEST:                                                       21790000
                                                                        21795000
<< ******************************** >>                                  21800000
<< Delayed channel program failure? >>                                  21805000
<< ******************************** >>                                  21810000
                                                                        21815000
IF IOQ'DELAY'CP'FAIL THEN << delayed channel program failure.>>         21820000
BEGIN                                                                   21825000
                                                                        21830000
  MASTERCLEARHPIB (P'DIT); << Halt channel program.>>                   21835000
                                                                        21840000
  IOQ'IO'STATUS := CHAN'PGM'FAILURE;                                    21845000
  DRIVER'STATE  := REQUEST'COMPLETE;                                    21850000
                                                                        21855000
  RETURN;                                                               21860000
                                                                        21865000
END;                                                                    21870000
                                                                        21875000
<< **************** >>                                                  21880000
<< Channel Failure? >>                                                  21885000
<< **************** >>                                                  21890000
                                                                        21895000
IF CPVA'ERROR'CODE > 5 THEN << DMA failure (value 6) or    >>           21900000
BEGIN                       << execution failure (value 7).>>           21905000
                                                                        21910000
  MASTERCLEARHPIB (P'DIT); << Halt channel program.>>                   21915000
                                                                        21920000
  << Log failure information. >>                                        21925000
                                                                        21930000
  DIT'ERROR'STATUS := [8/3, 8/DIT'ERR'LOG'INDEX];                       21935000
  DIT'DEV'STAT1    := P'CP'VAR'AREA;                                    21940000
  DIT'DEV'STAT2    := (GETDRT (DRTN, 0) - @P'CHAN'PGM) - %1000;         21945000
  DIT'DEV'STAT3    := @P'CHAN'PGM;                                      21950000
                                                                        21955000
  IOQ'IO'STATUS := CHAN'IO'FAILURE ;                                    21960000
  DRIVER'STATE  := REQUEST'COMPLETE;                                    21965000
                                                                        21970000
  RETURN;                                                               21975000
                                                                        21980000
END;                                                                    21985000
                                                                        21990000
<< ***************** >>                                                 21995000
<< Device powerfail? >>                                                 22000000
<< ***************** >>                                                 22005000
                                                                        22010000
IF CP'POWERED'UP      AND                                               22015000
   NOT CP'UNIT'ONLINE THEN << device has powerfailed.>>                 22020000
BEGIN                                                                   22025000
                                                                        22030000
  DIT'POWERFAIL := 1;                                          <<F8007>>22035000
                                                                        22040000
  GO TO POWERFAIL'PROCESSOR;                                   <<F8007>>22045000
                                                               <<F8007>>22050000
END;                                                           <<F8007>>22055000
                                                               <<F8007>>22060000
                                                               <<F8007>>22065000
                                                               <<F8007>>22070000
                                                                        22075000
<< ****************** >>                                                22080000
<< Log device status. >>                                                22085000
<< ****************** >>                                                22090000
                                                                        22095000
DIT'STATUS'WORD := IP'CHAN'PGM (CDEVSTAT1);                             22100000
DIT'DEV'STAT1   := IP'CHAN'PGM (CDEVSTAT1);                             22105000
DIT'DEV'STAT2   := IP'CHAN'PGM (CDEVSTAT2);                             22110000
DIT'DEV'STAT3   := IP'CHAN'PGM (CDEVSTAT3);                             22115000
                                                                        22120000
<< *********** >>                                                       22125000
<< I/O errors? >>                                                       22130000
<< *********** >>                                                       22135000
                                                                        22140000
IF CPVA'HALT'CODE = 1 THEN << possible error has occured.>>             22145000
BEGIN                                                                   22150000
                                                                        22155000
  P'CP'VAR'AREA (CPVA'1'INDEX) := ZERO; << Reset.>>                     22160000
                                                                        22165000
  << *************** >>                                                 22170000
  << Unit not ready? >>                                                 22175000
  << *************** >>                                                 22180000
                                                                        22185000
  IF NOT CP'UNIT'ONLINE THEN                                            22190000
  BEGIN << unit is not ready.>>                                         22195000
                                                                        22200000
    IF IOQ'FUNCTION'CODE = FC'CLOSE'DEVICE THEN << who cares.>>         22205000
    BEGIN                                                               22210000
                                                                        22215000
      IOQ'IO'STATUS := GOOD'IO         ;                                22220000
      DRIVER'STATE  := REQUEST'COMPLETE;                                22225000
                                                                        22230000
      RETURN;                                                           22235000
                                                                        22240000
    END;                                                                22245000
                                                                        22250000
    IF IOMESSAGE (1, NOT'READY'MSG, %10000, DIT'LDEV,,,,, CONSOLE) THEN 22255000
    BEGIN                                                               22260000
                                                                        22265000
      IOQ'IO'STATUS := NOT'READY'WAIT;                                  22270000
      DRIVER'STATE  := OPERATOR'WAIT ;                                  22275000
                                                                        22280000
      RETURN;                                                           22285000
                                                                        22290000
    END;                                                                22295000
                                                                        22300000
    << IOMESSAGE failed.>>                                              22305000
                                                                        22310000
    MASTERCLEARHPIB (P'DIT); << Halt channel program.>>                 22315000
                                                                        22320000
    IOQ'IO'STATUS := SYSTEM'ERROR    ;                                  22325000
    DRIVER'STATE  := REQUEST'COMPLETE;                                  22330000
                                                                        22335000
    RETURN;                                                             22340000
                                                                        22345000
  END;                                                                  22350000
                                                                        22355000
  << ************** >>                                                  22360000
  << No write ring? >>                                                  22365000
  << ************** >>                                                  22370000
                                                                        22375000
  IF IOQ'FUNCTION'CODE = FC'WRITE       OR                              22380000
     IOQ'FUNCTION'CODE = FC'FILE'MARK   OR                              22385000
     IOQ'FUNCTION'CODE = FC'GAP'TAPE    OR                              22390000
     IOQ'FUNCTION'CODE = FC'SET'DENSITY THEN                            22395000
                                                                        22400000
    IF CP'LOAD'POINT THEN                                               22405000
                                                                        22410000
      IF CP'FILE'PROTECT THEN << no write ring, write disabled.>>       22415000
      BEGIN                                                             22420000
                                                                        22425000
        if IOMESSAGE (1, NO'WRITE'RING'MSG, %10000, DIT'LDEV,,,,,       22430000
                      CONSOLE) then << console message successful,>>    22435000
        BEGIN                       << start timeout.             >>    22440000
                                                                        22445000
          DIT'TIMEOUT'WORD  := ZERO; << Reset.>>                        22450000
          DIT'TIMEOUT'INDEX := TIMEREQ (%20, @P'DIT, 1000d);            22455000
                                                                        22460000
          DRIVER'STATE := INTERRUPT'WAIT;                               22465000
                                                                        22470000
          RETURN;                                                       22475000
                                                                        22480000
        END;                                                            22485000
                                                                        22490000
        << IOMESSAGE failed. >>                                         22495000
                                                                        22500000
        MASTERCLEARHPIB (P'DIT); << Halt channel program.>>             22505000
                                                                        22510000
        IOQ'IO'STATUS := SYSTEM'ERROR    ;                              22515000
        DRIVER'STATE  := REQUEST'COMPLETE;                              22520000
                                                                        22525000
        RETURN;                                                         22530000
                                                                        22535000
      END;                                                              22540000
                                                                        22545000
  << ************************** >>                                      22550000
  << Door open (Antelope only)? >>                                      22555000
  << ************************** >>                                      22560000
                                                                        22565000
  IF (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE = 55) THEN                  22570000
  BEGIN                                                                 22575000
                                                                        22580000
    IF NOT (IOMESSAGE (1, DOOR'OPEN'MSG, %10000, DIT'LDEV,,,,,          22585000
            CONSOLE)) THEN                                              22590000
    BEGIN << IOMESSAGE failed.>>                                        22595000
                                                                        22600000
      MASTERCLEARHPIB (P'DIT); << Halt channel program.>>               22605000
                                                                        22610000
      IOQ'IO'STATUS := SYSTEM'ERROR    ;                                22615000
      DRIVER'STATE  := REQUEST'COMPLETE;                                22620000
                                                                        22625000
      RETURN;                                                           22630000
                                                                        22635000
    END;                                                                22640000
                                                                        22645000
  END;                                                                  22650000
                                                                        22655000
  << ************* >>                                                   22660000
  << Unit failure? >>                                                   22665000
  << ************* >>                                                   22670000
                                                                        22675000
  IF (CP'UNKNOWN'POSITION                         ) LOR                 22680000
     (CP'FORMATTER'ERROR                          ) LOR                 22685000
     (CP'SERVO'ERROR                              ) LOR                 22690000
     (CP'CONTROLLER'FAIL                          ) LOR                 22695000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 6 ) LOR                 22700000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 31) LOR                 22705000
     (CP'CMD'REJECT      LAND CP'CMD'REJ'CODE = 7 ) LOR                 22710000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 41) LOR                 22715000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 43) LOR                 22720000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 47) LOR                 22725000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 49) LOR                 22730000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 57) LOR                 22735000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 58) LOR                 22740000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 59) THEN                22745000
                                                                        22750000
    IOQ'IO'STATUS := UNIT'FAILURE                                       22755000
                                                                        22760000
  ELSE                                                                  22765000
                                                                        22770000
  << *************** >>                                                 22775000
  << Transfer error? >>                                                 22780000
  << *************** >>                                                 22785000
                                                                        22790000
  IF (CP'DATA'PARITY                              ) LOR                 22795000
     (CP'CMD'PARITY                               ) LOR                 22800000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 9 ) LOR                 22805000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 10) LOR                 22810000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 22) LOR                 22815000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 23) LOR                 22820000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 24) LOR                 22825000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 37) LOR                 22830000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 40) LOR                 22835000
     (CP'CMD'REJECT      LAND CP'CMD'REJ'CODE = 3 ) LOR                 22840000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 45) LOR                 22845000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 48) LOR                 22850000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 50) LOR                 22855000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 51) LOR                 22860000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 52) LOR                 22865000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 53) LOR                 22870000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 55) LOR                 22875000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 61) LOR                 22880000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 62) LOR                 22885000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 63) LOR                 22890000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 64) THEN                22895000
                                                                        22900000
    IOQ'IO'STATUS := TRANSFER'ERROR                                     22905000
                                                                        22910000
  ELSE                                                                  22915000
                                                                        22920000
  << ************************ >>                                        22925000
  << Not at BOT, set density? >>                                        22930000
  << ************************ >>                                        22935000
                                                                        22940000
  IF (CP'CMD'REJECT land CP'ERROR'CODE = 16) THEN                       22945000
                                                                        22950000
    IOQ'IO'STATUS := DENSITY'ERROR                                      22955000
                                                                        22960000
  ELSE                                                                  22965000
                                                                        22970000
  << ******************************** >>                                22975000
  << Density requested not available? >>                                22980000
  << ******************************** >>                                22985000
                                                                        22990000
  IF (CP'CMD'REJECT land CP'ERROR'CODE = 7) THEN                        22995000
                                                                        23000000
    IOQ'IO'STATUS := INVALID'REQUEST                                    23005000
                                                                        23010000
  ELSE                                                                  23015000
                                                                        23020000
  << ************* >>                                                   23025000
  << Tape runaway? >>                                                   23030000
  << ************* >>                                                   23035000
                                                                        23040000
  IF CP'TAPE'RUNAWAY THEN                                               23045000
                                                                        23050000
    IOQ'IO'STATUS := TAPE'RUNAWAY                                       23055000
                                                                        23060000
  ELSE                                                                  23065000
                                                                        23070000
  << ************* >>                                                   23075000
  << Timing error? >>                                                   23080000
  << ************* >>                                                   23085000
                                                                        23090000
  IF CP'TIMING'ERROR THEN                                               23095000
                                                                        23100000
    IOQ'IO'STATUS := TIMING'ERROR                                       23105000
                                                                        23110000
  ELSE                                                                  23115000
                                                                        23120000
<< ********************************************* >>                     23125000
<< Errors with no detailed (byte 5) description  >>                     23130000
<< or byte 5 error code and no fatal error bit.  >>                     23135000
<< ********************************************* >>                     23140000
                                                                        23145000
IF CP'CMD'REJECT              OR                                        23150000
   CP'UNRECOVERED'ERR         OR                                        23155000
   NOT (CP'ERROR'CODE = ZERO) THEN                                      23160000
                                                                        23165000
    IOQ'IO'STATUS := UNIT'FAILURE                                       23170000
                                                                        23175000
ELSE                                                                    23180000
                                                                        23185000
    << **************** >>                                              23190000
    << No errors found. >>                                              23195000
    << **************** >>                                              23200000
                                                                        23205000
    GO TO NO'ERROR;                                                     23210000
                                                                        23215000
                                                                        23220000
  << ***************** >>                                               23225000
  << Log error status. >>                                               23230000
  << ***************** >>                                               23235000
                                                                        23240000
  DIT'ERROR'STATUS := [8/3, 8/DIT'ERR'LOG'INDEX];                       23245000
                                                                        23250000
  MASTERCLEARHPIB (P'DIT); << halt channel program.  >>                 23255000
                                                                        23260000
  DRIVER'STATE := REQUEST'COMPLETE;                                     23265000
                                                                        23270000
  RETURN;                                                               23275000
                                                                        23280000
END;                                                                    23285000
$PAGE                                                                   23290000
<< ********* >>                                                         23295000
<<           >>                                                         23300000
<< No Error. >>                                                         23305000
<<           >>                                                         23310000
<< ********* >>                                                         23315000
                                                                        23320000
                                                                        23325000
NO'ERROR:                                                               23330000
<< *************************** >>                              <<J8874>>23335000
<< See if Operation is READ    >>                              <<J8874>>23340000
<< *************************** >>                              <<J8874>>23345000
                                                               <<J8874>>23350000
IF IOQ'FUNCTION'CODE <> FC'READ AND DIT'DSAVE'EOFS > 0         <<J8874>>23355000
THEN DIT'DSAVE'EOFS := 1;       << RESET TO INITIAL STATE >>   <<J8874>>23360000
                                                                        23365000
                                                                        23370000
<< ************************** >>                                        23375000
<< Complete write ring mount. >>                                        23380000
<< ************************** >>                                        23385000
                                                                        23390000
IF DIT'REWIND'OFFLINE THEN << waiting for write ring mount.>>           23395000
BEGIN                                                                   23400000
                                                                        23405000
  DIT'REWIND'OFFLINE := ZERO           ; << Reset.>>                    23410000
  IOQ'IO'STATUS      := WRITE'RING'WAIT;                                23415000
  DRIVER'STATE       := OPERATOR'WAIT  ;                                23420000
                                                                        23425000
  RETURN;                                                               23430000
                                                                        23435000
END;                                                                    23440000
                                                                        23445000
<< **************** >>                                                  23450000
<< Set end of file. >>                                                  23455000
<< **************** >>                                                  23460000
                                                                        23465000
IF CP'END'OF'FILE THEN << set EOF in LPDT.>>                            23470000
BEGIN                                                                   23475000
                                                                        23480000
  LPDT'ENTRY'INDEX := DIT'LDEV * LPDT'ENTRY'SIZE;                       23485000
  LPDT'EOF'TYPE    := 1                         ;                       23490000
                                                                        23495000
END;                                                                    23500000
                                                                        23505000
<< ********************** >>                                            23510000
<< Complete system abort. >>                                            23515000
<< ********************** >>                                            23520000
                                                                        23525000
IF DIT'PENDING'ABORT THEN                                               23530000
BEGIN                                                                   23535000
                                                                        23540000
  IF IOQ'POWERFAIL THEN                                                 23545000
                                                                        23550000
    IOQ'IO'STATUS := POWERFAIL'ABORT                                    23555000
                                                                        23560000
  ELSE                                                                  23565000
                                                                        23570000
    IOQ'IO'STATUS := SYSTEM'ABORT;                                      23575000
                                                                        23580000
  DIT'PENDING'ABORT := FALSE;                                           23585000
                                                                        23590000
  DRIVER'STATE := REQUEST'COMPLETE;                                     23595000
                                                                        23600000
  RETURN;                                                               23605000
                                                                        23610000
END                                                                     23615000
                                                                        23620000
ELSE                                                                    23625000
                                                                        23630000
<< **************************************** >>                          23635000
<< Complete next record or previous record. >>                          23640000
<< **************************************** >>                          23645000
                                                                        23650000
IF IOQ'FUNCTION'CODE = FC'NEXT'RECORD OR                                23655000
   IOQ'FUNCTION'CODE = FC'PREV'RECORD THEN                              23660000
BEGIN                                                                   23665000
                                                                        23670000
  << Check for forward space past EOF allowed. >>              <<F7703>>23675000
  EOFCHECK (IOQ'INDEX, BUF'BANK'ADR, 0, 0);                    <<F7703>>23680000
  IF <> THEN << EOF, forward space not allowed.>>                       23685000
  BEGIN                                                                 23690000
                                                                        23695000
    DRIVER'STATE := REQUEST'COMPLETE;                                   23700000
                                                                        23705000
    RETURN;                                                             23710000
                                                                        23715000
  END;                                                                  23720000
                                                                        23725000
END                                                                     23730000
                                                                        23735000
ELSE                                                                    23740000
                                                                        23745000
<< *************************** >>                                       23750000
<< Complete rewind operations. >>                                       23755000
<< *************************** >>                                       23760000
                                                                        23765000
IF IOQ'FUNCTION'CODE = FC'REWIND         OR                             23770000
   IOQ'FUNCTION'CODE = FC'REWIND'OFFLINE THEN                  <<F8007>>23775000
                                                               <<F8007>>23780000
BEGIN                                                          <<J8874>>23785000
  IF DIT'DSAVE'EOFS > 0 THEN   << REENABLE COUNTER >>          <<J8874>>23790000
  DIT'DSAVE'EOFS := 1;                                         <<J8874>>23795000
                                                                        23800000
  DIT'REWIND := 1                                                       23805000
                                                                        23810000
END                                                            <<J8874>>23815000
ELSE                                                                    23820000
                                                                        23825000
<< ************** >>                                                    23830000
<< Complete read. >>                                                    23835000
<< ************** >>                                                    23840000
                                                                        23845000
IF IOQ'FUNCTION'CODE = FC'READ THEN                                     23850000
BEGIN                                                                   23855000
                                                                        23860000
  << ******************************** >>                       <<J8874>>23865000
  << For READ, see if EOF encountered >>                       <<J8874>>23870000
  << ******************************** >>                       <<J8874>>23875000
                                                               <<J8874>>23880000
  IF DIT'DSAVE'EOFS > 0 AND                                    <<J8874>>23885000
    DIT'DSAVE'EOFS < TWO'EOF'ENCOUNTERED                       <<J8874>>23890000
    THEN IF CP'END'OF'FILE THEN                                <<J8874>>23895000
      DIT'DSAVE'EOFS := DIT'DSAVE'EOFS + 1                     <<J8874>>23900000
      ELSE DIT'DSAVE'EOFS := 1;                                <<J8874>>23905000
  IF DIT'SHORT'READ THEN                                                23910000
  BEGIN                                                                 23915000
                                                                        23920000
    DIT'SHORT'READ := FALSE;                                            23925000
                                                                        23930000
    BYTES'TRANSFERED := 6 - IP'CHAN'PGM (CRD'BYTE'CNT);                 23935000
                                                                        23940000
    WS'BUF'BANK'ADR  :=                                                 23945000
      double (LOGICAL(@IP'CHAN'PGM + CSHORT'BUF1 + SYSDB));    <<J8991>>23950000
                                                                        23955000
    EOFCHECK (IOQ'INDEX, WS'BUF'BANK'ADR, -BYTES'TRANSFERED, 0);        23960000
                                                                        23965000
    IF > THEN << Hardware EOF or EOD/EOJ read.>>                        23970000
    BEGIN     << IOQ status set by EOFCHECK.  >>                        23975000
                                                                        23980000
      DRIVER'STATE := REQUEST'COMPLETE;                                 23985000
                                                                        23990000
      RETURN;                                                           23995000
                                                                        24000000
    END                                                                 24005000
                                                                        24010000
    ELSE                                                                24015000
                                                                        24020000
    IF < THEN << JOB, :JOB, DATA, or :DATA read.  EOJ or EOD missing.>> 24025000
    BEGIN     << Backspace record so next read will re-read record   >> 24030000
              << just read.  This is for job tape processing.        >> 24035000
                                                                        24040000
      IOQ'BACKSPACE'EOF := TRUE;                                        24045000
                                                                        24050000
      IP'CHAN'PGM (CSTART'JVEC) := ZERO          ;                      24055000
      IP'CHAN'PGM (CCMD'DSJ0  ) := 20            ;                      24060000
      IP'CHAN'PGM (CTAPE'CMD  ) := TC'PREV'RECORD;                      24065000
                                                                        24070000
      GO TO START'CHAN'PGM;                                             24075000
                                                                        24080000
    END;                                                                24085000
                                                                        24090000
    IF BYTES'TRANSFERED < TRANSFER'COUNT THEN                           24095000
                                                                        24100000
      TRANSFER'COUNT := BYTES'TRANSFERED;                               24105000
                                                                        24110000
    << Transfer data to user's buffer.>>                                24115000
                                                                        24120000
    TOS := BUF'BANK'ADR;                  << Destination address.>>     24125000
    TOS := WS'BUF'BANK'ADR;               << Source address.     >>     24130000
    TOS := (TRANSFER'COUNT +1 ) &ASR (1); << # of words to move. >>     24135000
                                                                        24140000
    ASSEMBLE (MABS); << Transfer it.>>                                  24145000
                                                                        24150000
  END                                                                   24155000
                                                                        24160000
  ELSE << normal read.>>                                                24165000
  BEGIN                                                                 24170000
                                                                        24175000
    TRANSFER'COUNT := TRANSFER'COUNT - IP'CHAN'PGM (CRD'BYTE'CNT);      24180000
                                                                        24185000
    EOFCHECK (IOQ'INDEX, BUF'BANK'ADR, -TRANSFER'COUNT, 0);             24190000
                                                                        24195000
    IF <> THEN  << one of the conditions noted above in >>              24200000
    BEGIN       << short read checking has occured.     >>              24205000
                                                                        24210000
      IF < THEN                                                         24215000
                                                                        24220000
        IOQ'BACKSPACE'EOF := TRUE;                                      24225000
                                                                        24230000
      X := IF TRANSFER'COUNT < 127 THEN                                 24235000
                                                                        24240000
             (TRANSFER'COUNT + 3) &ASR (1)                              24245000
                                                                        24250000
           ELSE                                                         24255000
                                                                        24260000
             128;                                                       24265000
                                                                        24270000
      TOS := BUF'BANK'ADR;                                              24275000
                                                                        24280000
      WHILE (X := X - 1) <> ZERO DO << Zero out user's buffer.>>        24285000
      BEGIN                                                             24290000
                                                                        24295000
        TOS := ZERO;                                                    24300000
        ASSEMBLE (SSEA);                                                24305000
        TOS := TOS + 1;                                                 24310000
                                                                        24315000
      END;                                                              24320000
                                                                        24325000
      DDEL; << Clean up our stack.>>                                    24330000
                                                                        24335000
      IF IOQ'BACKSPACE'EOF THEN << backspace record so next read   >>   24340000
      BEGIN                     << will re'read record just read.  >>   24345000
                                << This is for job tape processing.>>   24350000
                                                                        24355000
        IP'CHAN'PGM (CSTART'JVEC) := ZERO          ;                    24360000
        IP'CHAN'PGM (CCMD'DSJ0  ) := 20            ;                    24365000
        IP'CHAN'PGM (CTAPE'CMD  ) := TC'PREV'RECORD;                    24370000
                                                                        24375000
        GO TO START'CHAN'PGM;                                           24380000
                                                                        24385000
      END                                                               24390000
                                                                        24395000
      ELSE                                                              24400000
                                                                        24405000
      BEGIN                                                             24410000
                                                                        24415000
        DRIVER'STATE := REQUEST'COMPLETE;                               24420000
                                                                        24425000
        RETURN;                                                         24430000
                                                                        24435000
      END;                                                              24440000
                                                                        24445000
    END;                                                                24450000
                                                                        24455000
  END;                                                                  24460000
                                                                        24465000
  IF IOQ'TRANSFER'COUNT < ZERO THEN                                     24470000
                                                                        24475000
    IOQ'TRANSFER'COUNT := -TRANSFER'COUNT                               24480000
                                                                        24485000
  else                                                                  24490000
                                                                        24495000
    IOQ'TRANSFER'COUNT := (TRANSFER'COUNT + 1) &ASR (1);                24500000
                                                                        24505000
END                                                                     24510000
                                                                        24515000
ELSE                                                                    24520000
                                                                        24525000
<< ********************************** >>                       <<F7703>>24530000
<< Complete write or write file mark. >>                       <<F7703>>24535000
<< ********************************** >>                       <<F7703>>24540000
                                                                        24545000
IF IOQ'FUNCTION'CODE = FC'WRITE     OR                                  24550000
   IOQ'FUNCTION'CODE = FC'FILE'MARK THEN                                24555000
BEGIN                                                                   24560000
                                                                        24565000
  IF IOQ'FUNCTION'CODE = FC'FILE'MARK THEN                     <<F7703>>24570000
                                                               <<F7703>>24575000
    DIT'EOF'INDICATOR := 1;                                    <<F7703>>24580000
                                                               <<F7703>>24585000
  IF CP'END'OF'TAPE THEN                                                24590000
  BEGIN                                                                 24595000
                                                                        24600000
    IOQ'IO'STATUS := GOOD'EOT'WRITE  ;                                  24605000
    DRIVER'STATE  := REQUEST'COMPLETE;                                  24610000
                                                                        24615000
    RETURN;                                                             24620000
                                                                        24625000
  END;                                                                  24630000
                                                                        24635000
END                                                                     24640000
                                                                        24645000
ELSE                                                                    24650000
                                                                        24655000
<< ************************************ >>                              24660000
<< Complete transfer count or selftest. >>                              24665000
<< ************************************ >>                              24670000
                                                                        24675000
IF IOQ'FUNCTION'CODE = FC'ACT'TRANS'CNT OR                              24680000
   IOQ'FUNCTION'CODE = FC'SELFTEST      THEN                            24685000
                                                                        24690000
  IF IOQ'TRANSFER'COUNT < ZERO THEN                                     24695000
                                                                        24700000
    IOQ'TRANSFER'COUNT := -2                                            24705000
                                                                        24710000
  ELSE                                                                  24715000
                                                                        24720000
    IOQ'TRANSFER'COUNT := 1                                             24725000
                                                                        24730000
ELSE                                                                    24735000
                                                                        24740000
<< *************************************** >>                           24745000
<< Complete diagnostic status or loopback. >>                           24750000
<< *************************************** >>                           24755000
                                                                        24760000
IF IOQ'FUNCTION'CODE = FC'DIAG'STATUS OR                                24765000
   IOQ'FUNCTION'CODE = FC'LOOPBACK    THEN                              24770000
BEGIN                                                                   24775000
                                                                        24780000
  TRANSFER'COUNT := TRANSFER'COUNT - IP'CHAN'PGM (CRD'BYTE'CNT);        24785000
                                                                        24790000
  IF IOQ'TRANSFER'COUNT < ZERO THEN                                     24795000
                                                                        24800000
    IOQ'TRANSFER'COUNT := -TRANSFER'COUNT                               24805000
                                                                        24810000
  ELSE                                                                  24815000
                                                                        24820000
    IOQ'TRANSFER'COUNT := (TRANSFER'COUNT + 1) &ASR (1);                24825000
                                                                        24830000
END                                                                     24835000
                                                                        24840000
ELSE                                                                    24845000
                                                                        24850000
<< ********************************************** >>                    24855000
<< Complete download diagnostic, read status log, >>                    24860000
<< write firmware, or read firmware.              >>                    24865000
<< ********************************************** >>                    24870000
                                                                        24875000
IF IOQ'FUNCTION'CODE = FC'DOWNLOAD'DIAG  OR                             24880000
   IOQ'FUNCTION'CODE = FC'STATUS'LOG     OR                             24885000
   IOQ'FUNCTION'CODE = FC'WRITE'FIRMWARE OR                             24890000
   IOQ'FUNCTION'CODE = FC'READ'FIRMWARE  THEN                           24895000
BEGIN                                                                   24900000
                                                                        24905000
  TRANSFER'COUNT := TRANSFER'COUNT - IP'CHAN'PGM (CWR'BYTE'CNT);        24910000
                                                                        24915000
  IF IOQ'TRANSFER'COUNT < ZERO THEN                                     24920000
                                                                        24925000
    IOQ'TRANSFER'COUNT := -TRANSFER'COUNT                               24930000
                                                                        24935000
  ELSE                                                                  24940000
                                                                        24945000
    IOQ'TRANSFER'COUNT := (TRANSFER'COUNT + 1) &ASR (1);                24950000
                                                                        24955000
END                                                                     24960000
                                                                        24965000
ELSE                                                                    24970000
                                                                        24975000
<< ****************** >>                                                24980000
<< Complete identify. >>                                                24985000
<< ****************** >>                                                24990000
                                                                        24995000
IF IOQ'FUNCTION'CODE = FC'IDENTIFY THEN                                 25000000
BEGIN                                                                   25005000
                                                                        25010000
  TOS := BUF'BANK'ADR;             << Push buffer address on TOS.>>     25015000
  TOS := P'CHAN'PGM (CIDENT'CODE); << Push identity on TOS.      >>     25020000
  ASSEMBLE (SSEA);                 << Put identity into buffer.  >>     25025000
  DDEL;                            << Clean up our stack.        >>     25030000
                                                                        25035000
  IF IOQ'TRANSFER'COUNT < ZERO THEN                                     25040000
                                                                        25045000
    IOQ'TRANSFER'COUNT := -2                                            25050000
                                                                        25055000
  ELSE                                                                  25060000
                                                                        25065000
    IOQ'TRANSFER'COUNT := 1;                                            25070000
                                                                        25075000
END                                                                     25080000
                                                                        25085000
ELSE                                                                    25090000
                                                                        25095000
<< *************************** >>                                       25100000
<< Complete get device status. >>                                       25105000
<< *************************** >>                                       25110000
                                                                        25115000
IF IOQ'FUNCTION'CODE = FC'GET'DEV'STATUS THEN                           25120000
BEGIN                                                                   25125000
                                                                        25130000
  TOS := BUF'BANK'ADR; << Push buffer address on TOS.   >>              25135000
  TOS := IP'CHAN'PGM (CDEVSTAT1);                                       25140000
                       << Push 1st status word on TOS.  >>              25145000
  ASSEMBLE (SSEA);     << Put 1st status word in buffer.>>              25150000
                                                                        25155000
  IOQ'TRANSFER'COUNT := -2;                                             25160000
                                                                        25165000
  IF TRANSFER'COUNT > 2 THEN                                            25170000
  BEGIN                                                                 25175000
                                                                        25180000
    TOS := TOS + 1;  << Increment buffer address.     >>                25185000
    TOS := IP'CHAN'PGM (CDEVSTAT2);                                     25190000
                     << Push 2nd status word on TOS.  >>                25195000
    ASSEMBLE (SSEA); << Put 2nd status word in buffer.>>                25200000
                                                                        25205000
    IOQ'TRANSFER'COUNT := -4;                                           25210000
                                                                        25215000
  END;                                                                  25220000
                                                                        25225000
  IF TRANSFER'COUNT > 4 THEN                                            25230000
  BEGIN                                                                 25235000
                                                                        25240000
    TOS := TOS + 1;  << Increment buffer address.     >>                25245000
    TOS := IP'CHAN'PGM (CDEVSTAT3);                                     25250000
                     << Push 3rd status word on TOS.  >>                25255000
    ASSEMBLE (SSEA); << Put 3rd status word in buffer.>>                25260000
                                                                        25265000
    IOQ'TRANSFER'COUNT := -6;                                           25270000
                                                                        25275000
  END;                                                                  25280000
                                                                        25285000
  DDEL; << clean up stack.>>                                            25290000
                                                                        25295000
END                                                                     25300000
                                                                        25305000
ELSE                                                                    25310000
                                                               <<F8007>>25315000
<< ************************************ >>                     <<F8007>>25320000
<< Complete open file, close device, or >>                     <<F8007>>25325000
<< immediate report enable/disable      >>                     <<F8007>>25330000
<< ************************************ >>                     <<F8007>>25335000
                                                               <<F8007>>25340000
IF IOQ'FUNCTION'CODE = FC'OPEN'FILE OR                         <<F8007>>25345000
   IOQ'FUNCTION'CODE = FC'CLOSE'DEVICE OR                      <<F8007>>25350000
   IOQ'FUNCTION'COEE = FC'IMMED'REPORT THEN                    <<F8007>>25355000
BEGIN                                                          <<F8007>>25360000
                                                               <<F8007>>25365000
  IF CP'IMMED'RPT'ENABLE THEN                                  <<F8007>>25370000
                                                               <<F8007>>25375000
    DIT'IMMED'RPT'STATUS := 1                                  <<F8007>>25380000
                                                               <<F8007>>25385000
  ELSE                                                         <<F8007>>25390000
                                                               <<F8007>>25395000
     DIT'IMMED'RPT'STATUS := ZERO;                             <<F8007>>25400000
                                                               <<F8007>>25405000
  IF IOQ'FUNCTION'CODE = FC'CLOSE'DEVICE THEN                  <<F8007>>25410000
                                                               <<F8007>>25415000
  BEGIN                                                        <<J8874>>25420000
    DIT'REWIND := 1;                                           <<F8007>>25425000
    IF DIT'DSAVE'EOFS > 0 THEN DIT'DSAVE'EOFS := 0;            <<J8874>>25430000
  END                                                          <<J8874>>25435000
                                                               <<F8007>>25440000
END                                                            <<F8007>>25445000
                                                               <<F8007>>25450000
ELSE                                                           <<F8007>>25455000
                                                                        25460000
  << ************************ >>                                        25465000
  << Complete other requests. >>                                        25470000
  << ************************ >>                                        25475000
                                                                        25480000
  IOQ'TRANSFER'COUNT := ZERO;                                           25485000
                                                                        25490000
IF NOT (CP'RETRY'COUNT = 0) THEN                                        25495000
BEGIN                                                                   25500000
                                                                        25505000
  DIT'ERROR'STATUS := [8/3, 8/DIT'ERR'LOG'INDEX];              <<F7702>>25510000
  IOQ'RETRY'COUNT := CP'RETRY'COUNT;                                    25515000
  CP'RETRY'COUNT  := ZERO          ;                                    25520000
  IOQ'IO'STATUS   := GOOD'RETRY    ;                                    25525000
                                                                        25530000
END                                                                     25535000
                                                                        25540000
ELSE                                                                    25545000
                                                                        25550000
  IOQ'IO'STATUS := GOOD'IO;                                             25555000
                                                                        25560000
<< ****************** >>                                                25565000
<< Request completed. >>                                                25570000
<< ****************** >>                                                25575000
                                                                        25580000
DRIVER'STATE := REQUEST'COMPLETE;                                       25585000
                                                                        25590000
RETURN;                                                                 25595000
                                                                        25600000
END; << MTDRVR >>                                                       25605000
$PAGE                                                                   25610000
<< Main entry point >>                                                  25615000
                                                                        25620000
ASSEMBLE (PCAL SIODM   ;   << Device monitor.       >>                  25625000
          PCAL MTDRVR  ;   << Driver Initiator.     >>                  25630000
          PCAL MTDRVR  ;   << Driver Completor.     >>                  25635000
          CON  ZERO    ;   << No I/O process.       >>                  25640000
          PCAL MTINIT  ;   << Driver Initialization.>>                  25645000
          CON  1       ;   << One interrupt handler.>>                  25650000
          PCAL GIP'HPIB ); << Interrupt handler.    >>                  25655000
                                                                        25660000
END.                                                                    25665000
