$CONTROL PRIVILEGED, UNCALLABLE, CODE, MAP,   LIST                      00010000
                                                                        00012000
$TITLE "Antelope/Buckhorn MPE-IV Magnetic Tape Driver."                 00014000
<<                                                                      00016000
  COPYRIGHT (C) COPYRIGHT HEWLETT-PACKARD CO. 1983.                     00018000
                                                                        00020000
      This program may be used with one computer system at a            00022000
      time and shall not otherwise be recorded, transmitted or          00024000
      stored in a retrieval system.  Copying or other reproduction      00026000
      of this program except for archival purposes is prohibited        00028000
      without the prior written consent of HEWLETT-PACKARD Company.     00030000
                                                                        00032000
                                                                        00034000
1       PRODUCT IDENTIFICATION                                          00036000
                                                                        00038000
1.1     PRODUCT NAME    :  HIOTAPE2 - MPE-IV I/O Tape Driver (HP-IB)    00040000
        PRODUCT MNEMONIC:  BUCKHORN/ANTELOPE                            00042000
        MPE MODULE #    :  44                                           00044000
                                                                        00046000
2       HIOTAPE2 DESIGN                                                 00048000
                                                                        00050000
2.1     MAJOR MODULES                                                   00052000
                                                                        00054000
        The driver consists of a global area, a linkage area "outer     00056000
        block" for INITIAL, and two procedures (MTINIT and MTDRVR)      00058000
        which initialize and process requests for particular            00060000
        operations required from the device.                            00062000
                                                                        00064000
2.2     DRIVER CREATION                                                 00066000
                                                                        00068000
        At system start-up, the driver is created by PROGEN.            00070000
                                                                        00072000
        After system startup the Input/Output device monitor, SIODM,    00074000
        is the creator of HIOTAPE2.  SIODM is invoked through the       00076000
        ATTACHIO process.  During interrupt processing the driver is    00078000
        executed on the interrupt control stack (ICS).  Other           00080000
        processing is performed on the stack of the process which       00082000
        invoked the driver.                                             00084000
                                                                        00086000
        For user processes, the driver is invoked through the           00088000
        following processing.  The file system creates the initial      00090000
        request and calls ATTACHIO.  ATTACHIO creates the               00092000
        appropriate request in the I/O Queue (IOQ) table.  ATTACHIO     00094000
        then calls the I/O device monitor SIODM.  SIODM freezes the     00096000
        data segments associated with the request and calls the         00098000
        driver.  The driver looks up appropriate information in the     00100000
        IOQ and creates a channel program to satisfy the request and    00102000
        sends it to the  device.  When the device completes the         00104000
        request, an interrupt is generated which invokes the general    00106000
        interrupt processor (GIP).  GIP then calls ATTACHIO which in    00108000
        turn calls SIODM.  SIODM calls the driver.  The driver checks   00110000
        for success or failure, marks the appropriate status and        00112000
        returns to SIODM.  SIODM unfreezes the data segment and         00114000
        returns to ATTACHIO, which returns to the file system.  The     00116000
        file system processing may be by-passed if so desired by        00118000
        calling ATTACHIO directly.                                      00120000
                                                                        00122000
2.3     PROCEDURE INTERFACE                                             00124000
                                                                        00126000
        A single parameter is passed to MTINIT when called.  This is    00128000
        a pointer to the Device Information Table (DIT) array for       00130000
        this particular device.                                         00132000
                                                                        00134000
        There are six parameters passed to MTDRVR.  The first           00136000
        parameter passed is the pointer to the Input/Output Queue       00138000
        (IOQ) array for the current request.  IOQ elements contain      00140000
        information relevent to the current request.                    00142000
                                                                        00144000
        The second parameter is a pointer to the DIT array.  DIT        00146000
        elements contain information about its associated device.       00148000
        This is information which must be saved between I/O requests    00150000
        to the driver.  There is one DIT array per unit on the          00152000
        controller.  The third parameter is the memory bank where       00154000
        the data is to be written to or read from by the device.        00156000
        The fourth parameter is the offset within the memory bank       00158000
        (memory address) where the data is to be written to or read     00160000
        from.  The third and fourth parameters comprise the absolute    00162000
        memory location where the data buffer resides.  The fifth       00164000
        variable passed is a pointer to the channel program which       00166000
        is also a part of the Interrupt Linkage Table (ILT) array.      00168000
        The last parameter passed is a pointer to the hardware          00170000
        interrupt location for the device.                              00172000
                                                                        00174000
2.4     PROCEDURE OVERVIEW                                              00176000
                                                                        00178000
        MTINIT is responsible for setting up the channel program with   00180000
        the parameters required for most of the Read, Write, and End    00182000
        commands.  A channel program is issued to enable immediate      00184000
        report (driver default).  The idle channel program is started   00186000
        if it is not already running.  The idle channel program is the  00188000
        process by which the driver can be invoked upon an unexpected   00190000
        interrupt from the device.                                      00192000
                                                                        00194000
        MTDRVR is the main procedure for the driver.   This procedure   00196000
        is responsible for initiating and completing I/O requests       00198000
        against the device.  MTDRVR is always called by the I/O device  00200000
        monitor SIODM.  MTDRVR determines the reason for the call by    00202000
        examining the IOQ array for the request and the DIT array.      00204000
        When a new request is initiated, MTDRVR examines the function   00206000
        code and parameter fields contained in the IOQ to determine     00208000
        what operation is to be performed.  The proper command codes    00210000
        and program branches are then placed in the channel program     00212000
        and its execution is begun with a call to the external          00214000
        procedure START'HPIB.                                           00216000
                                                                        00218000
        Upon completion of the request, an interrupt is generated and   00220000
        MTDRVR is again called.  The driver checks for current          00222000
        activity in progress, and this being the case, transfers to     00224000
        the completion section of the driver.  The completion section   00226000
        examines the device status words returned by the channel        00228000
        program for errors or special conditions which might have       00230000
        occurred during the execution of the channel program, the       00232000
        data transfer, or the operation of the device.  These           00234000
        conditions can cause error retries and/or special notation      00236000
        back to the caller.                                             00238000
                                                                        00240000
        The following is a brief description of the external            00242000
        procedures called by the driver.                                00244000
                                                                        00246000
      o TIMEREQ                                                         00248000
                                                                        00250000
        This procedure initiates a timeout request.  This is used to    00252000
        wake-up the driver after a one second pause for mounting a      00254000
        write ring.                                                     00256000
                                                                        00258000
      o ABORTTIMEREQ                                                    00260000
                                                                        00262000
        This procedure terminates a timeout request.                    00264000
                                                                        00266000
      o EOFCHECK                                                        00268000
                                                                        00270000
        This procedure checks for an end-of-file (EOF) condition.  The  00272000
        conditions which can be checked for are:  Hardware EOF, DATA    00274000
        command, end-of-data (EOD) command, JOB command, end-of-job     00276000
        (EOJ) command, and no EOF found.                                00278000
                                                                        00280000
      o GIP'HPIB                                                        00282000
                                                                        00284000
        This procedure handles all general interrupt processing.        00286000
                                                                        00288000
      o IOMESSAGE                                                       00290000
                                                                        00292000
        This procedure is used for sending messages to the console.     00294000
                                                                        00296000
      o SIODM                                                           00298000
                                                                        00300000
        This procedure is the I/O device monitor process.  This         00302000
        procedure activates the I/O driver.                             00304000
                                                                        00306000
      o START'HPIB                                                      00308000
                                                                        00310000
        This procedure starts a channel program.                        00312000
                                                                        00314000
      o MASTERCLEARHPIB                                                 00316000
                                                                        00318000
        This procedure terminates channel program processing.           00320000
                                                                        00322000
      o GETDRT                                                          00324000
                                                                        00326000
        This procedure returns the value of a specified word from       00328000
        the DRT entry for the device.                                   00330000
                                                                        00332000
2.5     PROCEDURE PROCESSING                                            00334000
                                                                        00336000
2.5.1   MTINIT                                                          00338000
                                                                        00340000
        MTINIT aquires the pointer to the ILT array from the DIT array. 00342000
        From the ILT array, pointers to the channel program and channel 00344000
        program status area are acquired.  Using the channel program    00346000
        pointer, the pointer to the idle channel program and SYSDB      00348000
        location of the channel program are acquired.  The SYSDB        00350000
        location of the idle channel program is acquired using the      00352000
        pointer to the idle channel program.  Using this information,   00354000
        the channel program is initialized with data for most of the    00356000
        read, write and end commands.  A channel program is issued which00358000
        enables immediate report processing.  If the idle channel       00360000
        program is not running, it is started with a call to START'HPIB.00362000
                                                                        00364000
2.5.2   MTDRVR                                                          00366000
                                                                        00368000
2.5.2.1 DRIVER INITIATOR SECTION                                        00370000
                                                                        00372000
        This section is responsible for validating new requests and     00374000
        issuing the channel program for execution of the request.       00376000
                                                                        00378000
2.5.2.2 DRIVER COMPLETOR SECTION                                        00380000
                                                                        00382000
        This section is responsible for checking the success or failure 00384000
        of a completed request, logging any device errors, and informing00386000
        the calling process of the success or failure of the request    00388000
        (through the IOQ).                                              00390000
                                                                        00392000
2.5.2.3 IMMEDIATE REPORT                                                00394000
                                                                        00396000
        Immediate report allows one command to be actively processing   00398000
        while other commands are queued and readied for execution within00400000
        the same controller.  The use of immediate report can           00402000
        significantly contribute to performance improvement since the   00404000
        time spent executing the first command is overlapped with the   00406000
        setup of the next command.                                      00408000
                                                                        00410000
        Immediate report is used only for write requests.  The device   00412000
        will respond with a success status immediately after the DMA    00414000
        transfer from memory to the device's internal buffer is         00416000
        complete.  This allows another DMA transfer to be sent to the   00418000
        device while the device is transfering the data from the        00420000
        internal buffer to tape.  The default mode will be immediate    00422000
        report enabled.                                                 00424000
                                                                        00426000
        If immediate report is disabled, any failures of a request will 00428000
        be reported back to the user in the status area for that        00430000
        request.                                                        00432000
                                                                        00434000
        If immediate report is enabled, any failure of a transfer of    00436000
        data from the internal buffer to tape may not be reported       00438000
        immediately.  The user will be informed that the transfer was   00440000
        successful upon completion of the transfer from memory to the   00442000
        device's internal buffer.  If the device fails to write the data00444000
        to tape, the failure may not be reported back in the status area00446000
        for the same request.  That is, since it is possible to submit  00448000
        multiple DMA transfers to the device's buffer successfully      00450000
        before a prior one has been completely transferred to the tape, 00452000
        the failure may be indicated in the status of a request         00454000
        submitted after the original failure.                           00456000
                                                                        00458000
        With immediate report enabled, the user must check status from  00460000
        the last rewind, close file, or close device.  This is necessary00462000
        to ensure that the last write performed was successful when     00464000
        transferred from the internal buffer to the tape.  Users who do 00466000
        not adhear to this run the risk of missing a failure status for 00468000
        the last record transferred to tape.                            00470000
                                                                        00472000
2.5.2.4 READ-AHEAD                                                      00474000
                                                                        00476000
        With the read-ahead capability of the device, there is no need  00478000
        for the immediate report for reads.  Read-ahead continues to    00480000
        transfer data after the end of the current record into the      00482000
        device's internal buffer.  This transfer continues until another00484000
        command is received, the internal buffer is filled, a read error00486000
        occurs, or an end or interrupt (EOI) condition occurs.          00488000
                                                                        00490000
        The read-ahead operation does not change the logical position of00492000
        the tape for the current request.  Requests are processed       00494000
        against the internal buffer until the operation exceeds the     00496000
        limits of the internal buffer.  When this occurs, the device    00498000
        will again fill the buffer with data, repositioning as required 00500000
        depending upon the request which caused the buffer to be filled.00502000
                                                                        00504000
2.5.2.5 INDIVIDUAL COMMAND PROCESSING                                   00506000
                                                                        00508000
        Each request will be processed through the initiator section and00510000
        completor section of MTDRVR.  The initiator section is          00512000
        responsible for validating new requests.  If the request is new 00514000
        and has not been initiated, this section creates the channel    00516000
        program necessary to initiate and execute the request and exits.00518000
        Channel programs are sent to the device by calling the external 00520000
        procedure START'HPIB.                                           00522000
                                                                        00524000
        The completor section of MTDRVR is responsible for determining  00526000
        the success or failure of the request.  A failure of a request  00528000
        is determined by checking the error status and the device       00530000
        specified jump (DSJ) vector.  If either of these are non zero, a00532000
        failure has occured.  If the request is completed successfully, 00534000
        the IOQ entry is marked as such and MTDRVR exits.  If the       00536000
        request failed, the completor section logs the device status    00538000
        values in the DIT, interogates the device status to determine   00540000
        the specific reason for the failure, places the appropriate     00542000
        error status in the IOQ, and exits.                             00544000
                                                                        00546000
2.5.2.6 REQUEST PROCESSING                                              00548000
                                                                        00550000
        The following is a description of how the driver will process   00552000
        each individual function when requested.                        00554000
                                                                        00556000
        The device recognizes byte transfers only, therefore, if the IOQ00558000
        transfer count is in words,  the driver will convert it to bytes00560000
        when sent to the device.  A positive transfer count indicates a 00562000
        word transfer.  A negative transfer count indicates a byte      00564000
        transfer.                                                       00566000
                                                                        00568000
        New requests will generate the initialization of the channel    00570000
        program to initiate and execute the request.  The channel       00572000
        program is sent to the device via a call to the external        00574000
        procedure START'HPIB.                                           00576000
                                                                        00578000
        If the request has been completed, the I/O status will be placed00580000
        in the IOQ entry for the request and the request marked         00582000
        complete.                                                       00584000
                                                                        00586000
      o READ (function code 0)                                          00588000
                                                                        00590000
        This request transfers one record from tape to main memory.     00592000
                                                                        00594000
        A transfer count greater than 16384 bytes is invalid.           00596000
                                                                        00598000
        If the count requested is greater than the actual number of     00600000
        bytes contained in the record, only the actual number of bytes  00602000
        will be transferred.  If the byte count is less than the actual 00604000
        number of bytes, only the number of bytes requested will be     00606000
        transfered.  This aspect of the read is handled by the drive    00608000
        controller itself.                                              00610000
                                                                        00612000
        If the transfer count is zero, this request will be processed as00614000
        a forward space record request.                                 00616000
                                                                        00618000
        If the transfer count is less than six, a short read process    00620000
        will be created.  The short read process will transfer the data 00622000
        into the short read buffer of the channel program instead of the00624000
        user's buffer.  In the completor section of MTDRVR, it will be  00626000
        transferred into the user's buffer.  Short read processing is   00628000
        used for processing JOBs submitted from the device.  With a     00630000
        short read, the external procedure EOFCHECK (see description of 00632000
        EOFCHECK earlier in this document) is used to check for special 00634000
        conditions that may be encountered from JOBs.                   00636000
                                                                        00638000
      o WRITE (function code 1)                                         00640000
                                                                        00642000
        This request transfers one record from main memory to tape.     00644000
                                                                        00646000
        A transfer count greater than 16384 bytes is invalid.           00648000
                                                                        00650000
        If the transfer count is zero, the request will generate a write00652000
        ring presence check on the device.  If a write ring is not      00654000
        present, a message is sent to the console requesting a write    00656000
        ring mount and a timeout process started with a call to the     00658000
        external procedure TIMEREQ.  This process causes the driver to  00660000
        pause for 1 second to allow the operator to mount a write ring. 00662000
        When the driver is invoked again, it checks for a timeout       00664000
        occurance.  If a timeout has occured, the driver will call the  00666000
        external procedure ABORTTIMEREQ to remove it from timeout       00668000
        processing.                                                     00670000
                                                                        00672000
        Bit 13 of the IOQ param 2 indicates if writes past end-of-tape  00674000
        are allowed.  If this bit is not zero, the driver will allow a  00676000
        write to extend past the EOT marker.  If a write past EOT is    00678000
        allowed and occurs, the IOQ I/O status will reflect this        00680000
        condition.  If a write past EOT is not allowed and is attempted,00682000
        the driver will indicate this in the IOQ I/O status.            00684000
                                                                        00686000
      o OPEN FILE (function code 2)                                     00688000
                                                                        00690000
        This request will enable or disable immediate report as         00692000
        specified in the IOQ param 2.  If IOQ param 2 is zero,          00694000
        immediate reporting will be enabled.  If IOQ param 2 is one,    00696000
        immediate reporting will be disabled.                           00698000
                                                                        00700000
      o CLOSE FILE (function code 3)                                    00702000
                                                                        00704000
        This request generates a null operation with a good status      00706000
        returned in the IOQ I/O status.                                 00708000
                                                                        00710000
        No channel program is executed for this request.                00712000
                                                                        00714000
      o CLOSE DEVICE (function code 4)                                  00716000
                                                                        00718000
        This request resets the end-of-file flags in the Logical        00720000
        Physical Device Table entry for this device.  Immediate report  00722000
        will be enabled (driver default) and a rewind-offline operation 00724000
        performed.                                                      00726000
                                                                        00728000
      o REWIND (function code 5)                                        00730000
                                                                        00732000
        This request will move the tape back to load point and leave the00734000
        device on-line.                                                 00736000
                                                                        00738000
      o WRITE FILE MARK (function code 6)                               00740000
                                                                        00742000
        This request will write one file mark on the tape.              00744000
                                                                        00746000
        Bit 13 of the IOQ param 2 indicates if writes past end-of-tape  00748000
        are allowed.  If this bit is not zero, the driver will allow a  00750000
        write to extend past the EOT marker.  If a write past EOT is    00752000
        allowed and occurs, the IOQ I/O status will reflect this        00754000
        condition.  If a write past EOT is not allowed and is attempted,00756000
        the driver will indicate this in the IOQ I/O status.            00758000
                                                                        00760000
      o FORWARD SPACE FILE (function code 7)                            00762000
                                                                        00764000
        This request will move the tape forward until a tape mark is    00766000
        encountered.  The tape will be positioned immediately following 00768000
        the tape mark found.                                            00770000
                                                                        00772000
      o BACKSPACE FILE (function code 8)                                00774000
                                                                        00776000
        This request moves the tape in the reverse direction until an   00778000
        end-of-file mark or the beginning-of-tape is detected.  If the  00780000
        operation is successful, the tape will be positioned in front of00782000
        the end-of-file mark or at the beginning-oftape.                00784000
                                                                        00786000
        If the tape is at the beginning-of-tape when this request is    00788000
        received, status will be returned indicating success with no    00790000
        execution of a channel program.                                 00792000
                                                                        00794000
      o REWIND AND OFFLINE (function code 9)                            00796000
                                                                        00798000
        This request will move the tape back to the beginning-of-tape   00800000
        and place the unit offline.                                     00802000
                                                                        00804000
        If the unit is already at the beginning-of-tape and offline, a  00806000
        successful status will be placed in the IOQ and no channel      00808000
        program will be executed.                                       00810000
                                                                        00812000
      o GAP TAPE (function code 10)                                     00814000
                                                                        00816000
        This request will erase approximately 3.5 inches of tape.       00818000
                                                                        00820000
      o FORWARD SPACE RECORD (function code 11)                         00822000
                                                                        00824000
        This request will move the tape in a forward direction until the00826000
        next inter-record gap is detected.  The tape will be positioned 00828000
        in front of the inter-record gap found.                         00830000
                                                                        00832000
      o BACKSPACE RECORD (function code 12)                             00834000
                                                                        00836000
        This request will move the tape in a backward direction until an00838000
        inter-record gap is detected or the beginning-of-tape is found. 00840000
        The tape will be positioned in front of the inter-record gap    00842000
        found or at the beginning-of-tape.                              00844000
                                                                        00846000
        If the tape is at the beginning-of-tape when this request is    00848000
        encountered,  a success condition will be placed in the  IOQ I/O00850000
        status and no channel program will be executed.                 00852000
                                                                        00854000
      o SUPPLY BYTE COUNT (function code 14)                            00856000
                                                                        00858000
        This request will return the actual byte count, in two bytes,   00860000
        contained in the record just read reguardless of the requested  00862000
        transfer count.                                                 00864000
                                                                        00866000
        No channel program is executed for this request.                00868000
                                                                        00870000
      o GENERIC STATUS (function code 15)                               00872000
                                                                        00874000
        This request will transfer the generic status, in two bytes,    00876000
        from the last request.                                          00878000
                                                                        00880000
        No channel program is executed for this request.                00882000
                                                                        00884000
      o SET DENSITY (function code 16)                                  00886000
                                                                        00888000
        This request will write the requested density ID on the tape.   00890000
        This request can be issued only when the unit is online, and the00892000
        tape positioned at load point.                                  00894000
                                                                        00896000
        Density specifications are in QPARM2, bits 13-15.               00898000
        0 = set density to 6250 (GCR).  Buckhorn only.                  00900000
        1 = set density to 1600 (PE).  Buckhorn and Antelope.           00902000
        2 - set density to 800 (NRZI).  Antelope only.                  00904000
                                                                        00906000
      o DOWNLOAD DIAGNOSTIC (function code 18).                         00908000
                                                                        00910000
        This request will download and execute a diagnostic program.    00912000
                                                                        00914000
        A transfer count greater than 16384 bytes is invalid.           00916000
                                                                        00918000
      o READ DIAGNOSTIC RESULTS (function code 19)                      00920000
                                                                        00922000
        This request will return the diagnostic program's status.  A    00924000
        single byte is returned from this command.                      00926000
                                                                        00928000
      o LOOPBACK (function code 20)                                     00930000
                                                                        00932000
        This request exercises the ABI, bus transceivers, data buffer   00934000
        handshake logic and buffer memory to ensure correct operation of00936000
        the HP-IB communication link.  The data sent to the drive is    00938000
        stored in the data buffer and echoed back to the host when      00940000
        requested.                                                      00942000
                                                                        00944000
      o SELFTEST (function code 21)                                     00946000
                                                                        00948000
        This request causes the drive to perform a selected selftest    00950000
        routine.  See 4.4 Selftest Selection for a description of the   00952000
        modes.  A single byte of data is passed to the driver indicating00954000
        which selftest mode is to be performed.  Two bytes of selftest  00956000
        results are returned.                                           00958000
                                                                        00960000
      o END DIAGNOSTIC (function code 22)                               00962000
                                                                        00964000
        This request terminates a diagnostic program.                   00966000
                                                                        00968000
      o IDENTIFY (function code 23)                                     00970000
                                                                        00972000
        This request returns a two byte identity code.  The identity    00974000
        code for Buckhorn is 0178 (Hex) and 0172 (Hex) for Antelope.    00976000
                                                                        00978000
        Bit      Meaning                                                00980000
                                                                        00982000
        0-2      Storage device, value 000                              00984000
        3-6      Value 0000                                             00986000
        7        Non 13037 protocol, value 1                            00988000
        8        Value 0                                                00990000
        9        Command queuing capability, value 1                    00992000
        10-15    Device dependent                                       00994000
                                                                        00996000
      o SPEED SELECT (function code 24)                                 00998000
                                                                        01000000
        This request changes the read/write speed of the drive.  This   01002000
        feature is supported only on Antelope and is ignored by         01004000
        Buckhorn.                                                       01006000
                                                                        01008000
        The speed requested is found in QPARM2.  A zero indicates       01010000
        streaming mode (100 IPS) and a one indicates start/stop mode    01012000
        (50 IPS).                                                       01014000
                                                                        01016000
      o DEVICE STATUS (function code 25)                                01018000
                                                                        01020000
        This request will transfer the actual device status from the    01022000
        last I/O operation.  The transfer count must be greater than 2  01024000
        bytes and will be invalid if it isn't.  The maximum number of   01026000
        bytes returned is six.  A transfer count in excess of six will  01028000
        not be considered an error and six bytes of status will be      01030000
        returned.                                                       01032000
                                                                        01034000
        No channel program is executed for this request.                01036000
                                                                        01038000
      o READ STATUS LOG (function code 26)                              01040000
                                                                        01042000
        This request will transfer the device's internal status log to  01044000
        main memory.  For information on this log see the Diagnostic    01046000
        ERS.                                                            01048000
                                                                        01050000
        The transfer count must be at least 4213 bytes.  Any value less 01052000
        than 4213 bytes will be invalid.  A transfer count in excess of 01054000
        4213 bytes will not be considered an error and the request will 01056000
        return only 4213 bytes.                                         01058000
                                                                        01060000
      o WRITE FIRMWARE (function code 27)                               01062000
                                                                        01064000
        This request downloads a firmware update to the device.  For    01066000
        information on the format of the firmware update see the        01068000
        hardware diagnostic ERS.                                        01070000
                                                                        01072000
        The transfer count must be greater than zero and cannot be      01074000
        greater than 4000 bytes.  Any value outside this range will be  01076000
        considered invalid.                                             01078000
                                                                        01080000
      o READ FIRMWARE (function code 28)                                01082000
                                                                        01084000
        This request will transfer firmware code from the device to main01086000
        memory.  For information on the format of the firmware code see 01088000
        the hardware diagnostic ERS.                                    01090000
                                                                        01092000
        The transfer count must be greater than zero.  A transfer count 01094000
        greater than 4000 bytes will not be considered an error.        01096000
                                                                        01098000
      o ENABLE/DISABLE IMMEDIATE REPORT (function code 29)              01100000
                                                                        01102000
        This request will enable or disable the immediate reporting     01104000
        feature of the device for writes.                               01106000
                                                                        01108000
        If the QPARM 2 parameter is zero, immediate report for writes   01110000
        will be disabled.  If the QPARM 2 parameter is one, immediate   01112000
        report for writes will be enabled.                              01114000
                                                                        01116000
      o GET DEVICE STATUS (function code 30)                            01118000
                                                                        01120000
        This request will transfer the actual device status after all   01122000
        requests under immediate report have been completed.            01124000
                                                                        01126000
        The transfer count must be greater than 2 bytes and will be     01128000
        invalid if it isn't.  The maximum number of bytes returned is   01130000
        six.  A transfer count in excess of six will not be considered  01132000
        an error and the six bytes of status will be returned.          01134000
                                                                        01136000
      o DEVICE CLEAR (function code 31)                                 01138000
                                                                        01140000
        This request performs an AMIGO device clear against the device. 01142000
                                                                        01144000
3       MAJOR DATA STRUCTURES                                           01146000
                                                                        01148000
        There are four MPE tables used by the driver.  These are the    01150000
        Device Reference Table (DRT), Device Information Table (DIT),   01152000
        Interrupt Linkage Table (ILT), and Input/Output Queue (IOQ)     01154000
        table.                                                          01156000
$PAGE                                                                   01158000
3.1     DEVICE REFERENCE TABLE (DRT)                                    01160000
                                                                        01162000
        There is one DRT for each device controller configured on the   01164000
        system.  The contents of the table are used for processing      01166000
        interrupts.                                                     01168000
                                                                        01170000
        %   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15  MNEMONIC    01172000
          ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---             01174000
        0 |        Channel Program Pointer (SIOP)         | DRT0        01176000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             01178000
        1 | Channel Program Variable Area Pointer (CPVA)  | DRT1        01180000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             01182000
        2 |        Interrupt Handler Program Label        | DRT2        01184000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             01186000
        3 |ST|SH|PF|          Status          |WS|GF|DT|WT| DRT3        01188000
          ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---             01190000
                                                                        01192000
        DRT0 - Channel Program Pointer.                                 01194000
               Absolute address of the current I/O instruction in       01196000
               execution for this device.                               01198000
                                                                        01200000
        DRT1 - Channel Program Variable Area Pointer.                   01202000
               Absolute address of the base of the Interrupt Linkage    01204000
               Table (ILT).  Points to first word of the channel program01206000
               variable area of the ILT for controller.                 01208000
                                                                        01210000
        DRT2 - Interrupt Handler Program Label.                         01212000
               The external program label of the interrupt service      01214000
               routine for the controller.                              01216000
                                                                        01218000
        DRT3 - Channel Program Status.                                  01220000
               Contains channel program status information which is used01222000
               by the channel program interpreter.                      01224000
               ST - channel program is running.                         01226000
               SH - SIOP or HIOP instruction pending.                   01228000
               PF - powerfail recovery in progress.                     01230000
               WS - waiting for device status request.                  01232000
               GF - GIC FIFO buffer not empty.                          01234000
               DT - DMA transfer active.                                01236000
               WT - channel program in wait state.                      01238000
$PAGE                                                                   01240000
3.2     DEVICE INFORMATION TABLE (DIT)                                  01242000
                                                                        01244000
        There is one DIT per physical device.  If a physical device     01246000
        represents more than one logical device, the logical device     01248000
        number is obtained from the IOQ array.                          01250000
                                                                        01252000
         %   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15  MNEMONIC   01254000
           ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---            01256000
         0 | 0| 0|AC|RQ| 0|MU| 0|IO|IA|NO|ST| 0|   State   | DFLAG      01258000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01260000
         1 | SYSDB relative pointer to the DIT for the next| DLINK      01262000
           | device requesting this resource or service    |            01264000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01266000
         2 | SYSDB relative pointer to the first IOQ in    | DIOQP      01268000
           | request list for this device.                 |            01270000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01272000
         3 |        | Phys. unit # | Logical device number | DLDEV      01274000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01276000
         4 | SYSDB relative pointer to Device Linkage Table| DDLTP      01278000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01280000
         5 | SYSDB relative pntr to Interrupt Linkage Table| DILTP      01282000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01284000
         6 |RW|RU|SH|     |PF|                          |PA| DSAVE      01286000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01288000
         7 | Hardware error status.  Set when the driver   | DSERR      01290000
           | detects an error.  Whenever <> 0, the driver  |            01292000
           | monitor logs an I/O error and clears this word|            01294000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01296000
        10 | Bit 0 is set at completion of timer.          | DTIME      01298000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01300000
        11 | Interrupt status for this unit.  Set by the   | DSTAT      01302000
           | driver each time it processes an interrupt.   |            01304000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01306000
        12 | Holds the time out request entry index while  | DRQST      01308000
           | a timer is active.                            |            01310000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01312000
        13 | Error log. Contains 6 bytes of status from    | DDEVSTAT   01314000
        14 | the previous operation.                       |            01316000
        15 |                                               |            01318000
           ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---            01320000
                                                                        01322000
        DFLAG - Device Flags and Request State.                         01324000
                AC - A monitor is currently servicing this device.      01326000
                RQ - A service request is pending while the monitor is  01328000
                     active.                                            01330000
                MU - This device is on a multi-unit controller.         01332000
                IO - An I/O Channel Program is running for this device. 01334000
                IA - An interrupt or response has occurred for this     01336000
                     device.                                            01338000
                NO - Not ready, start Idle Channel Program then go to   01340000
                     state %10.                                         01342000
                ST - The device monitor is starting an idle channel     01344000
                     program for this device.  There is no IOQ          01346000
                     associated with this state.                        01348000
                                                                        01350000
        STATE - Device Monitor State.                                   01352000
                Specifies the next action to be taken by SIODM in       01354000
                servicing the request:                                  01356000
                  0 - Start a new request.                              01358000
                  1 - Not used.                                         01360000
                  2 - Call driver initiator procedure.                  01362000
                  3 - Call driver completor procedure.                  01364000
                  4 - Not used.                                         01366000
                  5 - Completed request processing.                     01368000
                  6 - Initiate device recognition sequence.             01370000
                  7 - Start operator intervention wait.                 01372000
                %10 - Wait for interrupt (operator intervention),       01374000
                      restart at state 0.                               01376000
                %11 - Wait for data segment freeze, then state 2.       01378000
                %12 - Wait for driver initiator to be frozen, then      01380000
                      allocate controller (state 2).                    01382000
                %13 - Wait for I/O completion interrupt, then state 3.  01384000
                %14 - Wait for controller, then call driver initiator.  01386000
                %15 - Not used.                                         01388000
                %16 - Wait for initiator make present, then state 2.    01390000
                %17 - Wait for completor make present, then state 3.    01392000
                                                                        01394000
       DSAVE - Device processing flags.                                 01396000
               RW - Indicates tape has been rewound.                    01398000
               RO - Indicates a rewind/offline was performed to allow   01400000
                    a write-ring mount.                                 01402000
               SH - Indicates a short read is in progress.  After       01404000
                    completion of the read, EOF is checked for and if   01406000
                    not present, the data requested is transferred from 01408000
                    the short read buffer to the user's buffer.         01410000
               PF - Indicates device is powered up.                     01412000
               PA - Pending abort processing.                           01414000
                                                                        01416000
       DSTAT - First two bytes of device status.                        01418000
               See 4.2 DEVICE STATUS LAYOUT.                            01420000
$PAGE                                                                   01422000
3.3     INTERRUPT LINKAGE TABLE (ILT)                                   01424000
                                                                        01426000
        There is one ILT for each device controller configured on the   01428000
        system.                                                         01430000
                                                                        01432000
         %   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15  MNEMONIC   01434000
           ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---            01436000
         0 |                    Channel                    | ICPVA0     01438000
         1 |                    Program                    | ICPVA1     01440000
         2 |                    Variable                   | ICPVA2     01442000
         3 |                  Area (ICPVA)                 | ICPVA3     01444000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01446000
         4 |                   DMA Abort                   | ICPVA4     01448000
         5 |                    Address                    | ICPVA5     01450000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01452000
         6 |                       0                       | ISRQL      01454000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01456000
         7 |LI|     CHANQUE     | IMB |   CHAN    |  DEV   | ICNTRL     01458000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01460000
        10 | SYSDB relative pointer to Channel Program area| ISIOP      01462000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01464000
        11 | SYSDB relative pointer to Status Return area  | ISTAP      01466000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01468000
        12 | Single instruction that is executed to extract| IUNIT      01470000
           | the device unit number from the status pointed|            01472000
           | to by ISTAP                                   |            01474000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01476000
        13 | SYSDB  relative  DIT  pointer  of  the  device| ICDP       01478000
           | currently using the  channel to perform a data|            01480000
           | operation                                     |            01482000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01484000
        14 |       SIOPSIZE        |         CQUEN         | IQUEUE     01486000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01488000
        15 |RW|WP|IG|                          |  HCUNIT   | IFLAG      01490000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01492000
        16 | SYSDB relative DIT pointer for unit 0  *      | IDITP0     01494000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01496000
        17 |             Idle Channel Program              |            01498000
        20 |              Status Return Area               | ISTAT      01500000
        21 |                                               |            01502000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01504000
        22 |                    Mag Tape                   |            01506000
         . |                    Channel                    |            01508000
         . |                    Program                    |            01510000
         . ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---            01512000
                                                                        01514000
        * This driver does not support more than one unit.              01516000
                                                                        01518000
        ICPVA0 - Channel Program Variable Area                          01520000
                 ICPVA0 is used by the Channel Program processor to     01522000
                 store status information after I/O channel aborts.     01524000
                 ICPVA1 is use  by thedriver to indicate if status      01526000
                 should be   examined for speci conditions or errors.   01528000
                 ICPVA2 and ICPVA3 are not used.                        01530000
                                                                        01532000
        ICPVA4 &                                                        01534000
        ICPVA5 - DMA Abort Address                                      01536000
                 If a DMA abort occurs, the absolute address where the  01538000
                 abort occurred is stored in this area.                 01540000
                                                                        01542000
        ICNTRL - Controller Information                                 01544000
                 LI       - If this bit is set, the controller is       01546000
                            sharing a software channel resource in order01548000
                            to limit bandwidth.                         01550000
                 CHANQUE  - The software channel resource number.       01552000
                 IMB      - IMB number.  (First 2 bits of DRTN).        01554000
                 CHAN     - Channel number.  (Next 4 bits of DRTN).     01556000
                 DEV      - Device number.  (Next 3 bits of DRTN).      01558000
                 IQUEUE   -                                             01560000
                 SIOPSIZE - (number of words + 1) / 2 in the channel    01562000
                            program area.                               01564000
                 CQUEN    - For a multi-unit controller, this field     01566000
                            contains the software controller resource   01568000
                            number.                                     01570000
                                                                        01572000
        IFLAG - Controller and Channel Program State Flags              01574000
                RW     - An idle channel program should be started when 01576000
                         there are no active requests to process.       01578000
                WP     - An idle channel program has been started for   01580000
                         this controller.  This bit is reset by an      01582000
                         interrupt.                                     01584000
                IG     - An HIOP instruction has been issued against    01586000
                         this controller but the channel program was not01588000
                         in a wait state.  Therefore, ignore the        01590000
                         interrupt generated by the channel code when   01592000
                         this program halts.                            01594000
                HCUNIT - Highest configured unit number for this        01596000
                         controller.                                    01598000
                                                                        01600000
        ISTAT - Idle Channel Program Status Return                      01602000
                See 4.2 DEVICE STATUS LAYOUT.                           01604000
$PAGE                                                                   01606000
3.4     I/O QUEUE REQUEST TABLE (IOQ)                                   01608000
                                                                        01610000
         %   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15  MNEMONIC   01612000
           ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---            01614000
         0 |            Request dependent flags            | QFLAG      01616000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01618000
         1 | SYSDB relative pointer to next IOQ element.   | QLINK      01620000
           | Points to first word of element.              |            01622000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01624000
         2 |                       | Logical device number | QLDEV      01626000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01628000
         3 |           |BO|                    | RTCNTR    | QMISC      01630000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01632000
         4 | S| If QFLAG.(3:1) is clear then this is the   | QDSTN      01634000
           |    DST number of the target data segment.  If |            01636000
           |    S is set, QADDR is DB relative.            |            01638000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01640000
         5 | offset in the data segment or system buffer   | QADDR      01642000
           | table to the target data buffer.              |            01644000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01646000
         6 |                       | Function code for     | QFUNC      01648000
           |                       | this request.  (See   |            01650000
           |                       | next section.)        |            01652000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01654000
         7 | On initiation, specifies the word count (> 0) | QWBCT      01656000
           | or byte count (< 0).  At completion of the    |            01658000
           | request this location contains the actual     |            01660000
           | transmission count in the same units (bytes   |            01662000
           | or words) as in the request.                  |            01664000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01666000
        10 | IOQ param 1.                                  | QPAR1      01668000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01670000
        11 | IOQ param 2.  Used to indicate writing past   | QPAR2      01672000
           | EOT allowed or density specification.         |            01674000
           |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|            01676000
        12 |         PCBN          |  QUALIFIER   | STATUS | QSTAT      01678000
           ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---            01680000
                                                                        01682000
        QFLAG - Request dependent flags.                                01684000
                Bit  0 - ABORT, abort this request and return an error  01686000
                         indication to the caller.                      01688000
                     1 - not used.                                      01690000
                     2 - not used.                                      01692000
                     3 - SYSBUFF, target is an index relative to the    01694000
                         SBUF table of the data buffer.                 01696000
                     4 - IOWAKE, wake caller on completion of request.  01698000
                     5 - BLOCKED, blocked I/O.  The caller is waited in 01700000
                         ATTACHIO until the request is completed.       01702000
                         Implies IOWAKE.                                01704000
                     6 - COMPLETED, the request has been completed and  01706000
                         the caller awakened if he had requested (with  01708000
                         IOWAKE).                                       01710000
                     7 - DATAFRZN, set by the memory management routines01712000
                         (MAM) when a MAKEPRESENT request is successfull01714000
                         completed and indicates the data segment is    01716000
                         frozen in memory.                              01718000
                     8 - MAMERRORD, an error has occurred while MAM was 01720000
                         trying to make the target data segment present 01722000
                         and freeze it in memory.                       01724000
                     9 - not used.                                      01726000
                    10 - SFAIL, delayed failure of SIO instruction.     01728000
                         If a cal  to START'HPIB resulted in the request01730000
                         being added to the the channel queue, this bit 01732000
                         indicates that the SIO instruction failed when 01734000
                         the request was selected for execution.        01736000
                    11 - PFAIL, the request was aborted because of a    01738000
                         system power failure.                          01740000
                                                                        01742000
        QMISC - Driver Request Dependent Flags                          01744000
                RTCNTR - Retry count for a read or a write.             01746000
                BODEOF - Backspace record due to a data EOF processing  01748000
                         in       progress.                             01750000
                                                                        01752000
        QSTAT - PCB Number and Request Completion Status                01754000
                PCBN      - The Process Control Block (PCB) number of   01756000
                            the process which made this request.  If    01758000
                            zero, the request is not associated with    01760000
                            any process and the IOQ element is to be    01762000
                            returned by the system when the request     01764000
                            completes.                                  01766000
                STATUS    - General status indicating the final state of01768000
                            the request.  The following codes are used: 01770000
                            0 - Not started or awaiting completion.     01772000
                            1 - Successful completion.                  01774000
                            2 - End-of-file detected.                   01776000
                            3 - Unusual, but recoverable, condition     01778000
                                detected.                               01780000
                            4 - Irrecoverable error has occurred.       01782000
                QUALIFIER - A code which further defines or qualifies   01784000
                            the status.  (See Driver Return Status      01786000
                            Codes.)                                     01788000
$PAGE                                                                   01790000
4       STATUS/SELFTEST/FRU LAYOUTS                                     01792000
                                                                        01794000
4.1     IOQ I/O STATUS                                                  01796000
                                                                        01798000
        The following status values are returned by the Buckhorn driver.01800000
                                                                        01802000
        General Status    Qualifying Status (8:5)      Overall Value    01804000
             (13:3)             (8:5)                                   01806000
                                                                        01808000
        0 - Pending         1 - Completion wait           %10           01810000
                            3 - Not ready wait            %30           01812000
                            4 - No write ring wait        %40           01814000
                                                                        01816000
        1 - Successful      0 - No errors                   1           01818000
                            2 - Retry was necessary       %21           01820000
                            3 - EOT after write           %31           01822000
                                                                        01824000
        2 - End-of-file     1 - A tape  mark was  read                  01826000
                                or P1 was non-zero and                  01828000
                                the  last record  read                  01830000
                                was a tape mark           %12           01832000
                                                                        01834000
        3 - Unusual         3 - Request aborted           %33           01836000
            condition       6 - Powerfail abort           %63           01838000
                            7 - BOT and backspace                       01840000
                                requested                 %73           01842000
                          %10 - Tape runaway             %103           01844000
                          %11 - EOT and write requested  %113           01846000
                          %21 - Device powered up        %213           01848000
                          %23 - Set density and not at                  01850000
                                load point               %233           01852000
                                                                        01854000
       4 - Irrecoverable    0 - Invalid request             4           01856000
           error            1 - Transmission error        %14           01858000
                            3 - Timing error              %34           01860000
                            4 - SIO failure               %44           01862000
                            5 - Unit failure              %54           01864000
                          %12 - System error             %124           01866000
                          %14 - Channel failure          %144           01868000
$PAGE                                                                   01870000
4.2     DEVICE STATUS LAYOUT                                            01872000
                                                                        01874000
        WORD 1                                                          01876000
                                                                        01878000
        Bit     Meaning                                                 01880000
                                                                        01882000
          0     End-of-file (EOF)                                       01884000
          1     Beginning-of-tape (BOT)/Load-point (LP)                 01886000
          2     End-of-tape (EOT)                                       01888000
          3     Recovered error (STE)                                   01890000
          4     Command reject                                          01892000
          5     File protect (not write enabled; no write ring)         01894000
          6     Unrecovered error (MTE)                                 01896000
          7     Unit online                                             01898000
          8     GCR (6250 BPI Density)                                  01900000
          9     Unknown density                                         01902000
         10     Data parity error                                       01904000
         11     Timing error                                            01906000
         12     Tape runaway                                            01908000
         13     Door open                                               01910000
         14     Not used                                                01912000
         15     Immediate report enable                                 01914000
                                                                        01916000
        WORD 2                                                          01918000
                                                                        01920000
        Bit     Meaning                                                 01922000
                                                                        01924000
          0     PE (1600 BPI Density)                                   01926000
          1     NRZI (800 BPI Density)                                  01928000
          2     Power restored                                          01930000
          3     HPIB Command Parity Error                               01932000
          4     Position Unrecovered                                    01934000
          5     Formatter error                                         01936000
          6     Servo error                                             01938000
          7     Controller error                                        01940000
          8-10  Command Reject detail                                   01942000
                000 - Null code                                         01944000
                001 - Reserved                                          01946000
                010 - Device Reject                                     01948000
                011 - Protocol Reject                                   01950000
                                                                        01952000
                100 - Reserved                                          01954000
                101 - Prior error reject                                01956000
                110 - Reserved                                          01958000
                111 - Selftest failure                                  01960000
         11-15  Retry count.                                            01962000
                                                                        01964000
        WORD 3 (left byte)                                              01966000
                                                                        01968000
        The contents of this byte contains binary coded information     01970000
        regarding the specific error encountered.                       01972000
                                                                        01974000
        If COMMAND REJECT                                               01976000
                                                                        01978000
          5 - Device is write protected when a write type command was   01980000
              initiated.                                                01982000
          6 - Tape was not tensioned when the command was queued.       01984000
          7 - Write density command given but requested density is not  01986000
              available (option not present).                           01988000
          9 - The tape to be read was unidentifiable as to format.      01990000
              The density read may not be available, or the tape may    01992000
              have an unreadable identifications field, or may be       01994000
              blank                                                     01996000
         10 - The tape to be written on has not been identified as to   01998000
              format.  A write Record, Write File Mark, or Write Gap    02000000
              command was received but cannot be processed without a    02002000
              Write Format command if the tape was unidentified at      02004000
              load point.                                               02006000
         11 - Drive not online.                                         02008000
         16 - A write format command was issued but the tape isn't at   02010000
              load point.                                               02012000
         19 - A backward type command (except a rewind command) was     02014000
              just initiated but the tape was already positioned at     02016000
              BOT.                                                      02018000
         22 - An improper command sequence was detected by the drive.   02020000
         23 - Protocol not synced.                                      02022000
         24 - The tape command byte received was unknown to the drive.  02024000
         31 - The length of a write record requested exceeded the       02026000
              size of the drive's data buffer.                          02028000
         37 - Cannot write past 10 feet beyond end-of-tape.             02030000
         40 - Door open reject.  The door was opened during a long gap  02032000
              while the tape was beyond the end-of-tape marker.  This   02034000
              condition is non-retriable to prevent unspooling of the   02036000
              tape.                                                     02038000
                                                                        02040000
       If UNRECOVERED ERROR                                             02042000
                                                                        02044000
         41 - Tape velocity was out of specification.                   02046000
         43 - Tape tension was out of specification.                    02048000
         45 - Multiple tracks were in error.  Either two or more        02050000
              tracks were in error for a PE or NRZI write, or two       02052000
              or more tracks were in error for a GCR write.             02054000
         47 - Failure to verify a tape mark or density ID just written. 02056000
         48 - Noise on detect.  Indistinguishable flux transitions were 02058000
              detected while attempting to detect a recorded block.     02060000
         49 - Data format error.  Flux transitions were found or were   02062000
              missing in the appropriate tracks for a block detect.     02064000
         50 - Failure to identify tape following a rewind command       02066000
         51 - Gap detected before end-of-data.  The read formatter      02068000
              dected a full tape width dropout within the data portion  02070000
              of a data block.                                          02072000
         52 - Data block dropout.  A full tape width dropout was        02074000
              detected within the preamble or postamble of a data       02076000
              block.                                                    02078000
         53 - Redundancy check error.  The read formatter detected      02080000
              either a CRC, ACRC, LRC or residual error while reading   02082000
              or verifying a data block.                                02084000
         54 - Read parity error.  The read formatter detected an        02086000
              unrecovered parity error within a data block.  For PE     02088000
              this error could include multiple tracks in error, and    02090000
              for GCR this error could also include a redundancy check  02092000
              error.  (Buckhorn only).                                  02094000
         55 - Abnormal command abort, door opened (Antelope only).      02096000
         57 - Maximum skew exceeded (Antelope only).                    02098000
         58 - False preamble or postamble detected (Antelope only).     02100000
         59 - Corrected data error on write (Antelope only).            02102000
         61 - Data block timeout.  Could not detect the gap following   02104000
              a data block.  Could be caused by a record length longer  02106000
              than the drive supportes on read.                         02108000
         62 - Tape mark dropout.  A full tape width dropout was         02110000
              detected within a tape mark.                              02112000
         63 - Tape mark unverified.  A tape mark was detected which     02114000
              does not meet ANSI specifications in terms of flux        02116000
              transitions and erasure in the appropriate tracks.        02118000
         64 - Tape mark timeout.  Could not detect the gap following    02120000
              a detected tape mark.                                     02122000
                                                                        02124000
       If POSITION UNRECOVERED                                          02126000
                                                                        02128000
         81 - Servo controller unresponsive.  The servo will not take   02130000
              data from the master controller.                          02132000
         82 - Servo failed to reach the desired state reqquested by     02134000
              the master controller.                                    02136000
         83 - Servo shutdown.  The servo system lost tape tension       02138000
              unexpectedly.                                             02140000
         84 - Servo controller hard failure.  The servo controller has  02142000
              detected a hard failure within itself.                    02144000
         85 - Servo protocol error.  An invalid byte was received by    02146000
              the servo from the master controller.                     02148000
         86 - A run time error was detected by the servo.               02150000
         87 - In position interrupt not received.  Master controller    02152000
              did not get the in position interrupt it expected.        02154000
         88 - No gap detected by the servo after reading or writing a   02156000
              data block or tape mark.                                  02158000
         90 - No BOT detected on load or rewind.                        02160000
         91 - Speed out of specifications.                              02162000
         92 - The desired state requested by the master controller      02164000
              was invalid for the current context.                      02166000
         94 - Tape positioning failure.                                 02168000
                                                                        02170000
       If FORMATTER ERROR                                               02172000
                                                                        02174000
        101 - Buckhorn read formatter unresponsive.  The read formatter 02176000
              did not respond with end of record status after a data    02178000
              block was detected.                                       02180000
        102 - Buckhorn read formatter hardware error.                   02182000
        103 - Bad block type detected on a write operation.             02184000
        104 - Erase failure.  Flux transitions were detected in a       02186000
              portion of tape currently being erased.                   02188000
        105 - No data detected after write.                             02190000
        106 - Tracks out of sync on write verify.                       02192000
        107 - Antelope formatter hardware error.                        02194000
        108 - Antelope formatter unresponsive.                          02196000
        110 - Formatter byte count mismatch with data buffer.           02198000
                                                                        02200000
      If CONTROLLER ERROR                                               02202000
                                                                        02204000
        121 - Transaction ID mismatch between command sent to Device    02206000
              program and the returned report.                          02208000
        122 - No pending command found for report received from Device  02210000
              program.                                                  02212000
        123 - Invalid report message received from Device program.      02214000
        124 - Report queue overflow.                                    02216000
        125 - Unknown command received by Device program.               02218000
        126 - Command queue overflow.                                   02220000
        128 - Missing end-of-record flag in data buffer.                02222000
        131 - Byte count mismatch between putting a record into the     02224000
              data buffer and removing it.                              02226000
        133 - Processor handshake abort between HP-IB interface board   02228000
              and channel program.                                      02230000
        134 - Unknown HP-IB interface exception detected.               02232000
        138 - Device program firmware error.                            02234000
        139 - Hardware utilities firmware error.                        02236000
        140 - Channel program firmware error.                           02238000
                                                                        02240000
      If COMMAND REJECT and PROTOCOL REJECT                             02242000
                                                                        02244000
        161 - Command queue not empty.  Cannot accept new tape          02246000
              command or diagnostic request.                            02248000
        162 - Request DSJ expected.                                     02250000
        163 - Request status expected.                                  02252000
        165 - Unknown unit select.                                      02254000
        166 - Tape command secondary expected.                          02256000
        167 - Data byte expected.                                       02258000
        168 - Missing EOI on tape command data byte, selftest number,   02260000
              or END command data byte.                                 02262000
        170 - Command phase protocol error for write record.            02264000
        172 - Read record report phase protocol error.                  02266000
        173 - Report phase protocol error.                              02268000
        174 - Cold load sequence protocol error.                        02270000
        176 - END "Complete" or "Complete-Idle" exptected.              02272000
        178 - END "Data" expected.                                      02274000
        180 - Unknown interface secondary command.                      02276000
        181 - Misplaced data byte.                                      02278000
        184 - Interface loopback protocol error.                        02280000
        185 - Run selftest protocol error.                              02282000
        188 - HP-IB command parity error.                               02284000
        189 - Reset by operator during a protocol sequence.             02286000
        190 - Device clear received.  (Internal error code only.)       02288000
                                                                        02290000
        WORD 3 (second byte)                                            02292000
                                                                        02294000
        The sixth byte is used only when reporting transparent status of02296000
        hard and soft errors while in immediate report mode.  When an   02298000
        immediate report write has a soft error (retries were necessary)02300000
        or a hard error (write failure) this byte indicates which       02302000
        command had the error.  It contains the number of commands sent 02304000
        and reported since the command in question was issued.  If the  02306000
        immediate reported write had a hard error, all of the commands  02308000
        issued after the failure also fail (they will be aborted by the 02310000
        device).  Thus on a hard error, this byte actually indicates the02312000
        number of preceeding commands that failed.  For non-transparent 02314000
        status, this byte will always be zero.                          02316000
$PAGE                                                                   02318000
4.3     GENERIC STATUS LAYOUT                                           02320000
                                                                        02322000
        Bit     Meaning                                                 02324000
                                                                        02326000
        0-3     Fatal Errors                                            02328000
                0000 = No fatal error.                                  02330000
                0001 = Tape runaway.                                    02332000
                0010 = Multiple tracks in error (MTE).                  02334000
                0011 = Timing error.                                    02336000
                0100 = Command reject.                                  02338000
                0101 = Unit failure.                                    02340000
                0110 = Data parity error.                               02342000
                0111 = Command parity error.                            02344000
                                                                        02346000
        4-6     Density                                                 02348000
                000 = Unrecognized density.                             02350000
                001 = 800 BPI (NRZI).                                   02352000
                010 = 1600 BPI (PE).                                    02354000
                011 = 6250 BPI (GCR).                                   02356000
                                                                        02358000
        7-8     Unit Number                                             02360000
                00 = Unit 0                                             02362000
                01 = Unit 1                                             02364000
                10 = Unit 2                                             02366000
                11 = Unit 3                                             02368000
                                                                        02370000
        9       End-of-file (EOF).                                      02372000
        10      Beginning-of-tape (BOT)/Load Point.                     02374000
        11      End-of-tape (EOT).                                      02376000
        12      Immediate Report Enabled.                               02378000
        13      Single Track in Error (STE).                            02380000
        14      Unit Online.                                            02382000
        15      File Protect (no write ring).                           02384000
$PAGE                                                                   02386000
4.4     SELFTEST SELECTION                                              02388000
                                                                        02390000
        Remote/    Test #        Test                   FRU's           02392000
        Local#   (decimal)                              Tested##        02394000
                                                                        02396000
        local         0     Display error table          N/A            02398000
        local         1     Display diagnostic errors    N/A            02400000
        local         2     Clear diagnostic error log   N/A            02402000
        all           3     Clear data buffer            N/A            02404000
        all           4     Generate data                N/A            02406000
        all           5     Power on self test           MC             02408000
                                                         HPIB           02410000
                                                         F              02412000
                                                         WE             02414000
                                                         PLL            02416000
                                                         SC             02418000
        all           6     Kernal MC test               MC             02420000
        all           7     All RAM March test           MC             02422000
        all           8     Walking RAM test             MC             02424000
        all           9     Timer test                   MC             02426000
        all          10     EEPROM test                  MC             02428000
        all          11     Data buffer test             MC             02430000
        all          12     Write clock test             WE             02432000
        all          13     HPIB Internal loopback       HPIB           02434000
        all          14     HPIB DB loopback             HPIB           02436000
                                                         MC             02438000
        all          15     Digital Loopback             F              02440000
                                                         PLL            02442000
                                                         WE             02444000
                                                         MC             02446000
        all          16     Loopback WO PLL              F              02448000
                                                         WE             02450000
                                                         MC             02452000
        all          17     SC MC handshake              SC             02454000
        all          18     Servo controller gap test    SC             02456000
                                                         F              02458000
        all          19     EEPROM write test            MC             02460000
        local        20     Front panel confidence test  FP             02462000
        all          21     Write PE data block          MC             02464000
                                                         F              02466000
                                                         PLL            02468000
                                                         WE             02470000
                                                         P              02472000
                                                         RE             02474000
                                                         HEAD           02476000
                                                         TAPE MEDIUM    02478000
        all          22     Write GCR data block         Same as test   02480000
                                                         #21            02482000
        all          23     Read tape test               Same as test   02484000
                                                         #21            02486000
        local        24     Auto gain value update       N/A            02488000
        local        25     Set to single looping        N/A            02490000
        local        26     Set to infinite looping      N/A            02492000
        local        27     Display MC revision          N/A            02494000
        local        28     Display SC revision          N/A            02496000
        local        29     Display densities supported  N/A            02498000
        local        30     Local firmware update        N/A            02500000
        remote      255     return MSB error code        N/A            02502000
                                                                        02504000
         # Remote access is from the HOST via the HP-IB.  Local access  02506000
           is from the USER via the from pannel.  All is both remote    02508000
           and local access.                                            02510000
                                                                        02512000
        ## See the Diagnostic Field Replacable Unit (FRU) Table.        02514000
                                                                        02516000
4.5     SELFTEST RESULTS LAYOUT                                         02518000
                                                                        02520000
        Selftest results are returned in the format yz (hex) for all    02522000
        tests except test #255 where yz is the Field Replacable Unit    02524000
        (FRU) error code (see 4.6 Field Replacable Unit (FRU) Layout).  02526000
        For test #255, y = subsystem test number and z = subsystem      02528000
        error code.  (See Diagnostic ERS).                              02530000
                                                                        02532000
4.6     FIELD REPLACEABLE UNIT (FRU) LAYOUT                             02534000
                                                                        02536000
        Abbreviation       Description              FRU Error Code      02538000
                                                      (LSB)             02540000
                                                                        02542000
                        No status available              00H            02544000
            SC          Servo controller assemble        1xH            02546000
            WE          Write electronics assembly       2xH            02548000
            RE          Read electronics assembly        3xH            02550000
            PLL         Phase locked loop assembly       4xH            02552000
            F           Formatter assembly               5xH            02554000
            MC          Master controller assembly       6xH            02556000
            HPIB        HPIB assembly                    7xH            02558000
            FP          Front panel assembly             8xH            02560000
            P           Preamp assembly                  9xH            02562000
            HEAD        Head assembly                    ni #           02564000
            MOTORS      Two motors                       ni #           02566000
            MB          Mother board                     ni #           02568000
            TAPE        Tape medium                      ni #           02570000
                        Firmware errors                  DxH            02572000
                        Protocol errors                  ExH            02574000
                        Remote status                    FxH            02576000
                        Non-accessible diagnostics       FCH            02578000
                        Online mode diagnostic only      FDH            02580000
                        Non-existent diagnostic          FEH            02582000
                        Diagnostic passed                FFH            02584000
                                                                        02586000
        # ni indicates failure cannot be isolated to this assembly.     02588000
$PAGE                                                                   02590000
MODIFICATION HISTORY                                                    02592000
                                                                        02594000
MM/DD/YY  First Last name.                                              02596000
                                                                        02598000
  Modification explanation.                                             02600000
>>                                                                      02602000
$PAGE                                                                   02604000
begin                                                                   02606000
                                                                        02608000
EQUATE                                                                  02610000
                                                                        02612000
  << *************** >>                                                 02614000
  << Function Codes. >>                                                 02616000
  << *************** >>                                                 02618000
                                                                        02620000
  FC'READ           = 0 ,                                               02622000
  FC'WRITE          = 1 ,                                               02624000
  FC'OPEN'FILE      = 2 ,                                               02626000
  FC'CLOSE'FILE     = 3 ,                                               02628000
  FC'CLOSE'DEVICE   = 4 ,                                               02630000
  FC'REWIND         = 5 ,                                               02632000
  FC'FILE'MARK      = 6 ,                                               02634000
  FC'NEXT'FILE      = 7 , << Forward space to next file.   >>           02636000
  FC'PREV'FILE      = 8 , << Backspace to previous file.   >>           02638000
  FC'REWIND'OFFLINE = 9 ,                                               02640000
  FC'GAP'TAPE       = 10,                                               02642000
  FC'NEXT'RECORD    = 11, << Forward space to next record. >>           02644000
  FC'PREV'RECORD    = 12, << Backspace to previous record. >>           02646000
  FC'ACT'TRANS'CNT  = 14, << Actual prior transfer count.  >>           02648000
  FC'GENERIC'STATUS = 15,                                               02650000
  FC'SET'DENSITY    = 16,                                               02652000
  FC'DOWNLOAD'DIAG  = 18,                                               02654000
  FC'DIAG'STATUS    = 19, << Read diagnostic status.       >>           02656000
  FC'LOOPBACK       = 20,                                               02658000
  FC'SELFTEST       = 21,                                               02660000
  FC'END'DIAG       = 22,                                               02662000
  FC'IDENTIFY       = 23,                                               02664000
  FC'SPEED'SELECT   = 24,                                               02666000
  FC'DEV'STATUS     = 25, << Returns last device status.   >>           02668000
  FC'STATUS'LOG     = 26, << Read internal status log.     >>           02670000
  FC'WRITE'FIRMWARE = 27,                                               02672000
  FC'READ'FIRMWARE  = 28,                                               02674000
  FC'IMMED'REPORT   = 29, << Enable/disable immediate rpt. >>           02676000
  FC'GET'DEV'STATUS = 30, << Gets and returns last status. >>           02678000
  FC'DEV'CLEAR      = 31, << Amigo device clear.           >>           02680000
$PAGE                                                                   02682000
  << ****************** >>                                              02684000
  << Mag Tape Commands. >>                                              02686000
  << ****************** >>                                              02688000
                                                                        02690000
  TC'WRITE          = 5 , << Write record.                >>            02692000
  TC'FILE'MARK      = 6 , << Write EOF.                   >>            02694000
  TC'GAP'TAPE       = 7 , << Write gap.                   >>            02696000
  TC'READ           = 8 , << Read record.                 >>            02698000
  TC'NEXT'RECORD    = 9 , << Forward space to next record.>>            02700000
  TC'PREV'RECORD    = 10, << Backspace to prior record.   >>            02702000
  TC'NEXT'FILE      = 11, << Forward space to next file.  >>            02704000
  TC'PREV'FILE      = 12, << Backspace to prior file.     >>            02706000
  TC'REWIND         = 13, << Rewind tape.                 >>            02708000
  TC'REWIND'OFFLINE = 14, << Rewind tape and offline.     >>            02710000
  TC'DENSITY'6250   = 16, << 6250 BPI (GCR).              >>            02712000
  TC'DENSITY'1600   = 17, << 1600 BPI (PE).               >>            02714000
  TC'DENSITY'800    = 18, << 800 BPI (NRZI).              >>            02716000
  TC'START'STOP     = 20, << Enable start/stop mode.      >>            02718000
  TC'STREAM         = 21, << Enable streaming mode.       >>            02720000
  TC'DISABLE'IMMED  = 22, << Disable immediate report.    >>            02722000
  TC'ENABLE'IMMED   = 23, << Enable immediate report.     >>            02724000
  TC'DEV'STATUS     = 24, << Read device status.          >>            02726000
$PAGE                                                                   02728000
  << ************************ >>                                        02730000
  << IO Status Return Values. >>                                        02732000
  << ************************ >>                                        02734000
                                                                        02736000
  COMPLETION'WAIT  =  %10,                                              02738000
  NOT'READY'WAIT   =  %30,                                              02740000
  WRITE'RING'WAIT  =  %40,                                              02742000
                                                                        02744000
  GOOD'IO          =    1,                                              02746000
  GOOD'RETRY       =  %21,                                              02748000
  GOOD'EOT'WRITE   =  %31, << EOT after successful write.    >>         02750000
                                                                        02752000
  SYSTEM'ABORT     =  %33,                                              02754000
  PRIOR'ERR'ABORT  =  %43,                                              02756000
  POWERFAIL'ABORT  =  %63,                                              02758000
  BACKSPACE'BOT    =  %73, << BOT and backspace requested.   >>         02760000
  TAPE'RUNAWAY     = %103,                                              02762000
  EOT'WRITE        = %113, << EOT and write requested.       >>         02764000
  POWER'UP         = %213,                                              02766000
  DENSITY'ERROR    = %233,                                              02768000
                                                                        02770000
  INVALID'REQUEST  =    4,                                              02772000
  TRANSFER'ERROR   =  %14,                                              02774000
  TIMING'ERROR     =  %34,                                              02776000
  CHAN'PGM'FAILURE =  %44,                                              02778000
  UNIT'FAILURE     =  %54,                                              02780000
  SYSTEM'ERROR     = %124,                                              02782000
  CHAN'IO'FAILURE  = %144,                                              02784000
$PAGE                                                                   02786000
  << ***********************************. >>                            02788000
  << Misc Pointers And Program Constants. >>                            02790000
  << ************************************ >>                            02792000
                                                                        02794000
  CONSOLE              = 0    , << For console messages.        >>      02796000
  CPVA'1'INDEX         = 1    ,                                         02798000
  DISABLE'IMMED'RPT    = 1    ,                                         02800000
  DIT'ERR'LOG'INDEX    = 11   ,                                         02802000
  DOOR'OPEN'MSG        = 23   , << Door open message index.     >>      02804000
  ENABLE'IMMED'RPT     = 0    ,                                         02806000
  GCR'6250             = 0    , << 6250 BPI (GCR) density mode. >>      02808000
  INITIATOR'STATE      = 2    ,                                         02810000
  INTERRUPT'WAIT       = %13  ,                                         02812000
  IOQ'DST'OFFSET'INDEX = 5    ,                                         02814000
  IOQ'FUNCTION'INDEX   = 6    ,                                         02816000
  IOQ'MISC'INDEX       = 3    ,                                         02818000
  IOQ'PARM'2'INDEX     = 9    ,                                         02820000
  LPDT'ENTRY'SIZE      = 2    ,                                         02822000
  MAXIMUM'TRANSFER     = 16384, << Maximum byte transfer.       >>      02824000
  NOT'READY'MSG        = 11   , << Not ready message index.     >>      02826000
  NO'WRITE'RING'MSG    = 220  , << No write ring message index. >>      02828000
  NRZI'800             = 2    , << 800 BPI (NRZI) density.      >>      02830000
  OPERATOR'WAIT        = 7    , << Operator intervention wait.  >>      02832000
  PE'1600              = 1    , << 1600 BPI (PE) density mode.  >>      02834000
  REQUEST'COMPLETE     = 5    ,                                         02836000
  PRIOR'ERROR'REJECT   = 5    ,                                         02838000
  PROTOCOL'REJECT      = 3    ,                                         02840000
  SELFTEST'FAILURE     = 7    ,                                         02842000
  START'STOP           = 1    ,                                         02844000
  STREAM               = 2    ,                                         02846000
  SYSDB                = %1000,                                         02848000
  SYSLPDT              = %10  , << SYSGLOB LPDT pointer.        >>      02850000
  ZERO                 = 0    ; << Because its easier to find.  >>      02852000
$PAGE                                                                   02854000
  << **************************************** >>                        02856000
  << Device Information Table (DIT) Elements. >>                        02858000
  << **************************************** >>                        02860000
                                                                        02862000
EQUATE                                                                  02864000
                                                                        02866000
  << ********** >>                                                      02868000
  << DIT words. >>                                                      02870000
  << ********** >>                                                      02872000
                                                                        02874000
  DLDEV     =  3 ,                                                      02876000
  DILTP     =  5 ,                                                      02878000
  DSAVE     =  6 ,                                                      02880000
  DSERR     =  7 ,                                                      02882000
  DTIME     = %10,                                                      02884000
  DSTAT     = %11,                                                      02886000
  DRQST     = %12,                                                      02888000
  DDEVSTAT1 = %13,                                                      02890000
  DDEVSTAT2 = %14,                                                      02892000
  DDEVSTAT3 = %15;                                                      02894000
                                                                        02896000
DEFINE                                                                  02898000
                                                                        02900000
  << ********* >>                                                       02902000
  << DIT bits. >>                                                       02904000
  << ********* >>                                                       02906000
                                                                        02908000
  DLDEV'LD'BITS     = ( 8:8)#,                                          02910000
  DSAVE'RW'BIT      = ( 0:1)#,                                          02912000
  DSAVE'RO'BIT      = ( 1:1)#,                                          02914000
  DSAVE'SR'BIT      = ( 2:1)#,                                          02916000
  DSAVE'PF'BIT      = ( 5:1)#,                                          02918000
  DSAVE'PA'BIT      = (15:1)#,                                          02920000
  DTIME'TO'BIT      = ( 0:1)#,                                          02922000
  DDEVSTAT1'EF'BIT  = ( 0:1)#,                                          02924000
  DDEVSTAT1'LP'BIT  = ( 1:1)#,                                          02926000
  DDEVSTAT1'ET'BIT  = ( 2:1)#,                                          02928000
  DDEVSTAT1'RE'BIT  = ( 3:1)#,                                          02930000
  DDEVSTAT1'CR'BIT  = ( 4:1)#,                                          02932000
  DDEVSTAT1'FP'BIT  = ( 5:1)#,                                          02934000
  DDEVSTAT1'UE'BIT  = ( 6:1)#,                                          02936000
  DDEVSTAT1'OL'BIT  = ( 7:1)#,                                          02938000
  DDEVSTAT1'GC'BIT  = ( 8:1)#,                                          02940000
  DDEVSTAT1'UD'BIT  = ( 9:1)#,                                          02942000
  DDEVSTAT1'DP'BIT  = (10:1)#,                                          02944000
  DDEVSTAT1'TE'BIT  = (11:1)#,                                          02946000
  DDEVSTAT1'TR'BIT  = (12:1)#,                                          02948000
  DDEVSTAT1'DO'BIT  = (13:1)#,                                          02950000
  DDEVSTAT1'IR'BIT  = (15:1)#,                                          02952000
  DDEVSTAT2'PE'BIT  = ( 0:1)#,                                          02954000
  DDEVSTAT2'NR'BIT  = ( 1:1)#,                                          02956000
  DDEVSTAT2'PU'BIT  = ( 2:1)#,                                          02958000
  DDEVSTAT2'CP'BIT  = ( 3:1)#,                                          02960000
  DDEVSTAT2'UF'BITS = ( 4:4)#,                                          02962000
  DDEVSTAT2'UP'BIT  = ( 4:1)#,                                          02964000
  DDEVSTAT2'FE'BIT  = ( 5:1)#,                                          02966000
  DDEVSTAT2'SE'BIT  = ( 6:1)#,                                          02968000
  DDEVSTAT2'CF'BIT  = ( 7:1)#,                                          02970000
  DDEVSTAT2'CR'BITS = ( 8:3)#,                                          02972000
  DDEVSTAT2'RC'BITS = (11:5)#,                                          02974000
  DDEVSTAT3'EC'BITS = ( 0:8)#,                                          02976000
  DDEVSTAT3'IE'BITS = ( 8:8)#,                                          02978000
                                                                        02980000
  << ************* >>                                                   02982000
  << DIT elements. >>                                                   02984000
  << ************* >>                                                   02986000
                                                                        02988000
  DIT'LDEV             =  P'DIT (DLDEV    ).DLDEV'LD'BITS    #,         02990000
  DIT'ILT'PTR          =  P'DIT (DILTP    )                  #,         02992000
  DIT'SAVE'WORD        =  P'DIT (DSAVE    )                  #,         02994000
  DIT'REWIND           =  P'DIT (DSAVE    ).DSAVE'RW'BIT     #,         02996000
  DIT'REWIND'OFFLINE   =  P'DIT (DSAVE    ).DSAVE'RO'BIT     #,         02998000
  DIT'SHORT'READ       =  P'DIT (DSAVE    ).DSAVE'SR'BIT     #,         03000000
  DIT'POWERFAIL        =  P'DIT (DSAVE    ).DSAVE'PF'BIT     #,         03002000
  DIT'PENDING'ABORT    =  P'DIT (DSAVE    ).DSAVE'PA'BIT     #,         03004000
  DIT'ERROR'STATUS     =  P'DIT (DSERR    )                  #,         03006000
  DIT'TIMEOUT'WORD     =  P'DIT (DTIME    )                  #,         03008000
  DIT'TIMEOUT          =  P'DIT (DTIME    ).DTIME'TO'BIT     #,         03010000
  DIT'STATUS'WORD      =  P'DIT (DSTAT    )                  #,         03012000
  DIT'TIMEOUT'INDEX    =  P'DIT (DRQST    )                  #,         03014000
  DIT'DEV'STAT1        =  P'DIT (DDEVSTAT1)                  #,         03016000
  DIT'END'OF'FILE      =  P'DIT (DDEVSTAT1).DDEVSTAT1'EF'BIT #,         03018000
  DIT'LOAD'POINT       =  P'DIT (DDEVSTAT1).DDEVSTAT1'LP'BIT #,         03020000
  DIT'END'OF'TAPE      =  P'DIT (DDEVSTAT1).DDEVSTAT1'ET'BIT #,         03022000
  DIT'RECOVERED'ERR    =  P'DIT (DDEVSTAT1).DDEVSTAT1'RE'BIT #,         03024000
  DIT'CMD'REJECT       =  P'DIT (DDEVSTAT1).DDEVSTAT1'CR'BIT #,         03026000
  DIT'FILE'PROTECT     =  P'DIT (DDEVSTAT1).DDEVSTAT1'FP'BIT #,         03028000
  DIT'UNRECOVERED'ERR  =  P'DIT (DDEVSTAT1).DDEVSTAT1'UE'BIT #,         03030000
  DIT'UNIT'ONLINE      =  P'DIT (DDEVSTAT1).DDEVSTAT1'OL'BIT #,         03032000
  DIT'6250'DENSITY     =  P'DIT (DDEVSTAT1).DDEVSTAT1'GC'BIT #,         03034000
  DIT'UNKNOWN'DENSITY  =  P'DIT (DDEVSTAT1).DDEVSTAT1'UD'BIT #,         03036000
  DIT'DATA'PARITY      =  P'DIT (DDEVSTAT1).DDEVSTAT1'DP'BIT #,         03038000
  DIT'TIMING'ERROR     =  P'DIT (DDEVSTAT1).DDEVSTAT1'TE'BIT #,         03040000
  DIT'TAPE'RUNAWAY     =  P'DIT (DDEVSTAT1).DDEVSTAT1'TR'BIT #,         03042000
  DIT'DOOR'OPEN        =  P'DIT (DDEVSTAT1).DDEVSTAT1'DO'BIT #,         03044000
  DIT'IMMED'RPT'ENABLE =  P'DIT (DDEVSTAT1).DDEVSTAT1'IR'BIT #,         03046000
  DIT'DEV'STAT2        =  P'DIT (DDEVSTAT2)                  #,         03048000
  DIT'1600'DENSITY     =  P'DIT (DDEVSTAT2).DDEVSTAT2'PE'BIT #,         03050000
  DIT'800'DENSITY      =  P'DIT (DDEVSTAT2).DDEVSTAT2'NR'BIT #,         03052000
  DIT'POWER'RESTORED   =  P'DIT (DDEVSTAT2).DDEVSTAT2'PU'BIT #,         03054000
  DIT'CMD'PARITY       =  P'DIT (DDEVSTAT2).DDEVSTAT2'CP'BIT #,         03056000
  DIT'UNIT'FAILURE     =  P'DIT (DDEVSTAT2).DDEVSTAT2'UF'BITS#,         03058000
  DIT'UNKNOWN'POSITION =  P'DIT (DDEVSTAT2).DDEVSTAT2'UP'BIT #,         03060000
  DIT'FORMATTER'ERROR  =  P'DIT (DDEVSTAT2).DDEVSTAT2'FE'BIT #,         03062000
  DIT'SERVO'ERROR      =  P'DIT (DDEVSTAT2).DDEVSTAT2'SE'BIT #,         03064000
  DIT'CONTROLLER'FAIL  =  P'DIT (DDEVSTAT2).DDEVSTAT2'CF'BIT #,         03066000
  DIT'CMD'REJ'CODE     =  P'DIT (DDEVSTAT2).DDEVSTAT2'CR'BITS#,         03068000
  DIT'RETRY'COUNT      =  P'DIT (DDEVSTAT2).DDEVSTAT2'RC'BITS#,         03070000
  DIT'DEV'STAT3        =  P'DIT (DDEVSTAT3)                  #,         03072000
  DIT'ERROR'CODE       =  P'DIT (DDEVSTAT3).DDEVSTAT3'EC'BITS#,         03074000
  DIT'IMMED'RPT'DETAIL =  P'DIT (DDEVSTAT3).DDEVSTAT3'IE'BITS#;         03076000
$PAGE                                                                   03078000
  << *************************************** >>                         03080000
  << Interrupt Linkage Table (ILT) Elements. >>                         03082000
  << *************************************** >>                         03084000
                                                                        03086000
EQUATE                                                                  03088000
                                                                        03090000
  << ********** >>                                                      03092000
  << ILT words. >>                                                      03094000
  << ********** >>                                                      03096000
                                                                        03098000
  ISIOP = %10,                                                          03100000
  ISTAP = %11,                                                          03102000
  IFLAG = %15;                                                          03104000
                                                                        03106000
DEFINE                                                                  03108000
                                                                        03110000
  << ********* >>                                                       03112000
  << ILT bits. >>                                                       03114000
  << ********* >>                                                       03116000
                                                                        03118000
  IFLAG'IP'BIT = (1:1)#,                                                03120000
                                                                        03122000
  << ************* >>                                                   03124000
  << ILT elements. >>                                                   03126000
  << ************* >>                                                   03128000
                                                                        03130000
  ILT'CHAN'PGM'PTR     = P'ILT (ISIOP)             #,                   03132000
  ILT'STATUS'PTR       = P'ILT (ISTAP)             #,                   03134000
  ILT'IDLE'PGM'RUNNING = P'ILT (IFLAG).IFLAG'IP'BIT#;                   03136000
$PAGE                                                                   03138000
  << ********************************** >>                              03140000
  << Input/Output Queue (IOQ) Elements. >>                              03142000
  << ********************************** >>                              03144000
                                                                        03146000
EQUATE                                                                  03148000
                                                                        03150000
  << ********** >>                                                      03152000
  << IOQ words. >>                                                      03154000
  << ********** >>                                                      03156000
                                                                        03158000
  QFLAG = 0  ,                                                          03160000
  QLINK = 1  ,                                                          03162000
  QMISC = 3  ,                                                          03164000
  QDSTN = 4  ,                                                          03166000
  QFUNC = 6  ,                                                          03168000
  QWBCT = 7  ,                                                          03170000
  QPAR1 = %10,                                                          03172000
  QPAR2 = %11,                                                          03174000
  QSTAT = %12;                                                          03176000
                                                                        03178000
DEFINE                                                                  03180000
                                                                        03182000
  << ********* >>                                                       03184000
  << IOQ bits. >>                                                       03186000
  << ********* >>                                                       03188000
                                                                        03190000
  QFLAG'AB'BIT  = ( 0:1 )#,                                             03192000
  QFLAG'DC'BIT  = (10:1 )#,                                             03194000
  QFLAG'PF'BIT  = (11:1 )#,                                             03196000
  QMISC'BE'BIT  = ( 4:1 )#,                                             03198000
  QMISC'RC'BITS = (12:4 )#,                                             03200000
  QDSTN'DR'BIT  = ( 0:1 )#,                                             03202000
  QDSTN'DN'BITS = ( 1:15)#,                                             03204000
  QFUNC'FC'BITS = ( 8:8 )#,                                             03206000
  QPAR2'WE'BIT  = (13:1 )#,                                             03208000
  QPAR2'DE'BITS = (13:3 )#,                                             03210000
  QSTAT'ST'BITS = ( 8:8 )#,                                             03212000
                                                                        03214000
  << ************* >>                                                   03216000
  << IOQ elements. >>                                                   03218000
  << ************* >>                                                   03220000
                                                                        03222000
  IOQ'ABORT          =  P'IOQ (QFLAG).QFLAG'AB'BIT #,                   03224000
  IOQ'DELAY'CP'FAIL  =  P'IOQ (QFLAG).QFLAG'DC'BIT #,                   03226000
  IOQ'POWERFAIL      =  P'IOQ (QFLAG).QFLAG'PF'BIT #,                   03228000
  IOQ'LINK           =  P'IOQ (QLINK)              #,                   03230000
  IOQ'BACKSPACE'EOF  =  P'IOQ (QMISC).QMISC'BE'BIT #,                   03232000
  IOQ'RETRY'COUNT    =  P'IOQ (QMISC).QMISC'RC'BITS#,                   03234000
  IOQ'DST'DB'REL     =  P'IOQ (QDSTN).QDSTN'DR'BIT #,                   03236000
  IOQ'DST'NUMBER     =  P'IOQ (QDSTN).QDSTN'DN'BITS#,                   03238000
  IOQ'FUNCTION'CODE  = IP'IOQ (QFUNC).QFUNC'FC'BITS#,                   03240000
  IOQ'TRANSFER'COUNT = IP'IOQ (QWBCT)              #,                   03242000
  IOQ'PARM'2         = IP'IOQ (QPAR2)              #,                   03244000
  IOQ'WRITE'PAST'EOT =  P'IOQ (QPAR2).QPAR2'WE'BIT #,                   03246000
  IOQ'DENSITY        =  P'IOQ (QPAR2).QPAR2'DE'BITS#,                   03248000
  IOQ'IO'STATUS      =  P'IOQ (QSTAT).QSTAT'ST'BITS#;                   03250000
$PAGE                                                                   03252000
  << ********************************************** >>                  03254000
  << Logical Physical Device Table (LPDT) Elements. >>                  03256000
  << ********************************************** >>                  03258000
                                                                        03260000
EQUATE                                                                  03262000
                                                                        03264000
  << *********** >>                                                     03266000
  << LPDT words. >>                                                     03268000
  << *********** >>                                                     03270000
                                                                        03272000
  LSTATE = 1;                                                           03274000
                                                                        03276000
DEFINE                                                                  03278000
                                                                        03280000
  << ********** >>                                                      03282000
  << LPDT bits. >>                                                      03284000
  << ********** >>                                                      03286000
                                                                        03288000
  LSTATE'EF'BITS = (7:3)#,                                              03290000
                                                                        03292000
  << ************** >>                                                  03294000
  << LPDT elements. >>                                                  03296000
  << ************** >>                                                  03298000
                                                                        03300000
  LPDT'EOF'TYPE = IP'LPDT (LPDT'ENTRY'INDEX + LSTATE).LSTATE'EF'BITS#;  03302000
$PAGE                                                                   03304000
  << ****************************** >>                                  03306000
  << Channel Program (CP) Elements. >>                                  03308000
  << ****************************** >>                                  03310000
                                                                        03312000
EQUATE                                                                  03314000
                                                                        03316000
  << ********* >>                                                       03318000
  << CP words. >>                                                       03320000
  << ********* >>                                                       03322000
                                                                        03324000
  CSTART'JVEC      = 1  ,                                               03326000
  CTAPE'CMD'ADR    = 6  ,                                               03328000
  CCMD'DSJ0        = 11 ,                                               03330000
  CRD'EXEC         = 14 ,                                               03332000
  CRD'BYTE'CNT     = 15 ,                                               03334000
  CRD'ADR          = 18 ,                                               03336000
  CRD'BANK         = 17 ,                                               03338000
  CLOOP'JUMP       = 19 ,                                               03340000
  CLOG'JUMP        = 19 ,                                               03342000
  CDIAG'JUMP       = 19 ,                                               03344000
  CEND'DATA        = 19 ,                                               03346000
  CFIRM'JUMP       = 19 ,                                               03348000
  CTEST'JUMP       = 19 ,                                               03350000
  CFIRM'JVEC       = 20 ,                                               03352000
  CDIAG'JVEC       = 20 ,                                               03354000
  CLOOP'JVEC       = 20 ,                                               03356000
  CLOG'JVEC        = 20 ,                                               03358000
  CEND'DATA'CNT    = 20 ,                                               03360000
  CTEST'JVEC       = 20 ,                                               03362000
  CEND'DATA'ADR    = 23 ,                                               03364000
  CACT'CNT'ADR     = 33 ,                                               03366000
  CSTAT1'ADR       = 38 ,                                               03368000
  CEND'CMPL1'ADR   = 43 ,                                               03370000
  CSTAT2'ADR       = 50 ,                                               03372000
  CEND'CMPL2'ADR   = 55 ,                                               03374000
  CSTAT3'ADR       = 62 ,                                               03376000
  CEND'CMPL3'ADR   = 67 ,                                               03378000
  CSTAT4'ADR       = 74 ,                                               03380000
  CEND'CMPL4'ADR   = 79 ,                                               03382000
  CWR'CMD          = 82 ,                                               03384000
  CIDENTIFY        = 82 ,                                               03386000
  CIDENT'CODE      = 83 ,                                               03388000
  CWR'CMD'CNT      = 83 ,                                               03390000
  CIDENT'JVEC      = 85 ,                                               03392000
  CWR'CMD'BANK     = 85 ,                                               03394000
  CWR'CMD'ADR      = 86 ,                                               03396000
  CIDENT'DSJ0      = 91 ,                                               03398000
  CWR'CMD'DSJ0     = 91 ,                                               03400000
  CWR'EXEC         = 94 ,                                               03402000
  CWR'BYTE'CNT     = 95 ,                                               03404000
  CWR'BANK         = 97 ,                                               03406000
  CWR'ADR          = 98 ,                                               03408000
  CWR'DSJ0         = 103,                                               03410000
  CWR'DSJ1         = 104,                                               03412000
  CWR'DSJ2         = 105,                                               03414000
  CEND'IDLE        = 106,                                               03416000
  CCLEAR           = 106,                                               03418000
  CIDLE'CP         = 106,                                               03420000
  CEND'IDLE'CNT    = 107,                                               03422000
  CCLEAR'WD2       = 107,                                               03424000
  CCLEAR'JUMP      = 108,                                               03426000
  CEND'IDLE'WD3    = 108,                                               03428000
  CEND'IDLE'BANK   = 109,                                               03430000
  CCLEAR'JVEC      = 109,                                               03432000
  CEND'IDLE'ADR    = 110,                                               03434000
  CCLEAR'DSJ       = 113,                                               03436000
  CIDLE'DSJ        = 113,                                               03438000
  CEND'DIAG        = 113,                                               03440000
  CEND'DIAG'CODE   = 114,                                               03442000
  CIDLE'STAT1'ADR  = 122,                                               03444000
  CEND'CMPL5'ADR   = 127,                                               03446000
  CIDLE'STAT2'ADR  = 134,                                               03448000
  CEND'CMPL6'ADR   = 139,                                               03450000
  CTAPE'CMD        = 142,                                               03452000
  CEND'DATA'CMD    = 143,                                               03454000
  CEND'CMPL'CMD    = 144,                                               03456000
  CDEVSTAT1        = 145,                                               03458000
  CDEVSTAT2        = 146,                                               03460000
  CDEVSTAT3        = 147,                                               03462000
  CSHORT'BUF1      = 148,                                               03464000
  CSHORT'BUF2      = 149,                                               03466000
  CSHORT'BUF3      = 150,                                               03468000
  CACT'CNT         = 151,                                               03470000
  CEND'IDLE'CMD    = 152;                                               03472000
                                                                        03474000
DEFINE                                                                  03476000
                                                                        03478000
  << ******** >>                                                        03480000
  << CP bits. >>                                                        03482000
  << ******** >>                                                        03484000
                                                                        03486000
  CDEVSTAT1'EF'BIT  = ( 0:1)#,                                          03488000
  CDEVSTAT1'LP'BIT  = ( 1:1)#,                                          03490000
  CDEVSTAT1'ET'BIT  = ( 2:1)#,                                          03492000
  CDEVSTAT1'RE'BIT  = ( 3:1)#,                                          03494000
  CDEVSTAT1'CR'BIT  = ( 4:1)#,                                          03496000
  CDEVSTAT1'FP'BIT  = ( 5:1)#,                                          03498000
  CDEVSTAT1'UE'BIT  = ( 6:1)#,                                          03500000
  CDEVSTAT1'OL'BIT  = ( 7:1)#,                                          03502000
  CDEVSTAT1'GC'BIT  = ( 8:1)#,                                          03504000
  CDEVSTAT1'UD'BIT  = ( 9:1)#,                                          03506000
  CDEVSTAT1'DP'BIT  = (10:1)#,                                          03508000
  CDEVSTAT1'TE'BIT  = (11:1)#,                                          03510000
  CDEVSTAT1'TR'BIT  = (12:1)#,                                          03512000
  CDEVSTAT1'DO'BIT  = (13:1)#,                                          03514000
  CDEVSTAT1'IR'BIT  = (15:1)#,                                          03516000
  CDEVSTAT2'PE'BIT  = ( 0:1)#,                                          03518000
  CDEVSTAT2'NR'BIT  = ( 1:1)#,                                          03520000
  CDEVSTAT2'PU'BIT  = ( 2:1)#,                                          03522000
  CDEVSTAT2'CP'BIT  = ( 3:1)#,                                          03524000
  CDEVSTAT2'UF'BITS = ( 4:4)#,                                          03526000
  CDEVSTAT2'UP'BIT  = ( 4:1)#,                                          03528000
  CDEVSTAT2'FE'BIT  = ( 5:1)#,                                          03530000
  CDEVSTAT2'SE'BIT  = ( 6:1)#,                                          03532000
  CDEVSTAT2'CF'BIT  = ( 7:1)#,                                          03534000
  CDEVSTAT2'CR'BITS = ( 8:3)#,                                          03536000
  CDEVSTAT2'RC'BITS = (11:5)#,                                          03538000
  CDEVSTAT3'EC'BITS = ( 0:8)#,                                          03540000
  CDEVSTAT3'IE'BITS = ( 8:8)#,                                          03542000
                                                                        03544000
  << ************ >>                                                    03546000
  << CP elements. >>                                                    03548000
  << ************ >>                                                    03550000
                                                                        03552000
  CP'END'OF'FILE      = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'EF'BIT #,      03554000
  CP'LOAD'POINT       = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'LP'BIT #,      03556000
  CP'END'OF'TAPE      = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'ET'BIT #,      03558000
  CP'RECOVERED'ERR    = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'RE'BIT #,      03560000
  CP'CMD'REJECT       = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'CR'BIT #,      03562000
  CP'FILE'PROTECT     = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'FP'BIT #,      03564000
  CP'UNRECOVERED'ERR  = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'UE'BIT #,      03566000
  CP'UNIT'ONLINE      = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'OL'BIT #,      03568000
  CP'6250'DENSITY     = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'GC'BIT #,      03570000
  CP'UNKNOWN'DENSITY  = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'UD'BIT #,      03572000
  CP'DATA'PARITY      = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'DP'BIT #,      03574000
  CP'TIMING'ERROR     = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'TE'BIT #,      03576000
  CP'TAPE'RUNAWAY     = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'TR'BIT #,      03578000
  CP'DOOR'OPEN        = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'DO'BIT #,      03580000
  CP'IMMED'RPT'ENABLE = P'CHAN'PGM (CDEVSTAT1).CDEVSTAT1'IR'BIT #,      03582000
  CP'1600'DENSITY     = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'PE'BIT #,      03584000
  CP'800'DENSITY      = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'NR'BIT #,      03586000
  CP'POWERED'UP       = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'PU'BIT #,      03588000
  CP'CMD'PARITY       = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'CP'BIT #,      03590000
  CP'UNKNOWN'POSITION = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'UP'BIT #,      03592000
  CP'FORMATTER'ERROR  = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'FE'BIT #,      03594000
  CP'SERVO'ERROR      = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'SE'BIT #,      03596000
  CP'CONTROLLER'FAIL  = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'CF'BIT #,      03598000
  CP'CMD'REJ'CODE     = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'CR'BITS#,      03600000
  CP'RETRY'COUNT      = P'CHAN'PGM (CDEVSTAT2).CDEVSTAT2'RC'BITS#,      03602000
  CP'ERROR'CODE       = P'CHAN'PGM (CDEVSTAT3).CDEVSTAT3'EC'BITS#,      03604000
  CP'IMMED'RPT'DETAIL = P'CHAN'PGM (CDEVSTAT3).CDEVSTAT3'IE'BITS#;      03606000
$PAGE                                                                   03608000
  << ************************************* >>                           03610000
  << Idle Channel Program Status elements. >>                           03612000
  << ************************************* >>                           03614000
                                                                        03616000
DEFINE                                                                  03618000
                                                                        03620000
  CP'IDLE'POWER'UP = P'CHAN'PGM (-2).( 2:1)#,                           03622000
  CP'IDLE'STAT1    = P'CHAN'PGM (-3)       #,                           03624000
  CP'IDLE'STAT2    = P'CHAN'PGM (-2)       #,                           03626000
  CP'IDLE'STAT3    = P'CHAN'PGM (-1)       #,                           03628000
$PAGE                                                                   03630000
  << ********************************* >>                               03632000
  << Channel Program Error Indicators. >>                               03634000
  << ********************************* >>                               03636000
                                                                        03638000
  CPVA'ERROR'CODE = P'CP'VAR'AREA (0).( 0:3)#,                          03640000
  CPVA'HALT'CODE  = P'CP'VAR'AREA (1).(14:2)#,                          03642000
$PAGE                                                                   03644000
  << ************************ >>                                        03646000
  << Generic Status Elements. >>                                        03648000
  << ************************ >>                                        03650000
                                                                        03652000
  GS'FATAL'ERROR      = GENERIC'STATUS.( 0:4)#,                         03654000
  GS'DENSITY          = GENERIC'STATUS.( 4:3)#,                         03656000
  GS'UNIT'NUMBER      = GENERIC'STATUS.( 7:2)#,                         03658000
  GS'END'OF'FILE      = GENERIC'STATUS.( 9:1)#,                         03660000
  GS'LOAD'POINT       = GENERIC'STATUS.(10:1)#,                         03662000
  GS'END'OF'TAPE      = GENERIC'STATUS.(11:1)#,                         03664000
  GS'IMMED'RPT'ENABLE = GENERIC'STATUS.(12:1)#,                         03666000
  GS'RECOVERED'ERR    = GENERIC'STATUS.(13:1)#,                         03668000
  GS'UNIT'ONLINE      = GENERIC'STATUS.(14:1)#,                         03670000
  GS'FILE'PROTECT     = GENERIC'STATUS.(15:1)#;                         03672000
$PAGE                                                                   03674000
<< ************************** >>                                        03676000
<<                            >>                                        03678000
<< Driver DB Area Definition. >>                                        03680000
<<                            >>                                        03682000
<< ************************** >>                                        03684000
                                                                        03686000
ARRAY INITIAL (0:179) = DB :=                                           03688000
                                                                        03690000
  [8/14, 8/%21], << DIT size, not core res., idle chan pgm, type 1.>>   03692000
              0, << Not used.                                      >>   03694000
         %26622, << Unit extract instruction - EXF, J=9, K=2.      >>   03696000
    [8/77, 8/3], << Chan pgm length + 1 / 2, device status length. >>   03698000
                                                                        03700000
<< ************* >>                                                     03702000
<< Mag Tape DIT. >>                                                     03704000
<< ************* >>                                                     03706000
                                                                        03708000
              0, << DIT'FLAG             >>                             03710000
              0, << DIT'LINK             >>                             03712000
              0, << DIT'IOQ'PTR          >>                             03714000
         %40000, << DIT'LDEV             >>                             03716000
              0, << DIT'DLT'PTR          >>                             03718000
              0, << DIT'ILT'PTR          >>                             03720000
              0, << DIT'SAVE'WORD        >>                             03722000
              0, << DIT'DEV'STATUS       >>                             03724000
              0, << DIT'TIMEOUT          >>                             03726000
              0, << DIT'INTERRUPT'STATUS >>                             03728000
              0, << DIT'TIMEOUT'ENTRY    >>                             03730000
              0, << DIT'DEV'STAT1        >>                             03732000
              0, << DIT'DEV'STAT2        >>                             03734000
              0, << DIT'DEV'STAT3        >>                             03736000
$page                                                                   03738000
<< **************** >>                                                  03740000
<< Channel Program. >>                                                  03742000
<< **************** >>                                                  03744000
                                                                        03746000
<< ************** >>                                                    03748000
<< Jump to start. >>                                                    03750000
<< ************** >>                                                    03752000
                                                                        03754000
<< 0   >>       0,                                                      03756000
<< 1   >>       0, << CSTART'JVEC.>>                                    03758000
                                                                        03760000
<< ************************************** >>                            03762000
<< Read record and tape command requests. >>                            03764000
<< ************************************** >>                            03766000
                                                                        03768000
<< ********************************* >>                                 03770000
<< Send READ record or Tape Command. >>                                 03772000
<< ********************************* >>                                 03774000
                                                                        03776000
<< 2   >>   %2001,                                                      03778000
<< 3   >>       1,                                                      03780000
<< 4   >>       0,                                                      03782000
<< 5   >>  %42000,                                                      03784000
<< 6   >>       0, << CTAPE'CMD'ADR >>                                  03786000
                                                                        03788000
<< *********************** >>                                           03790000
<< Wait for parallel poll. >>                                           03792000
<< *********************** >>                                           03794000
                                                                        03796000
<< 7   >>   %1000,                                                      03798000
<< 8   >>       0,                                                      03800000
                                                                        03802000
<< ***************************** >>                                     03804000
<< DSJ, check status of command. >>                                     03806000
<< ***************************** >>                                     03808000
                                                                        03810000
<< 9   >>   %2402,                                                      03812000
<< 10  >>       0,                                                      03814000
<< 11  >>       0, << CCMD'DSJ0.>> << DSJ 0 returned.>>                 03816000
<< 12  >>      32,                 << DSJ 1 returned.>>                 03818000
<< 13  >>      44,                 << DSJ 2 returned.>>                 03820000
                                                                        03822000
<< ******************************* >>                                   03824000
<< Execute DMA transfer to device. >>                                   03826000
<< ******************************* >>                                   03828000
                                                                        03830000
<< 14  >>   %1400, << CRD'EXEC.    >>                                   03832000
<< 15  >>       0, << CRD'BYTE'CNT.>>                                   03834000
<< 16  >>       0,                                                      03836000
<< 17  >>       0, << CRD'BANK.    >>                                   03838000
<< 18  >>       0, << CRD'ADR.     >>                                   03840000
                                                                        03842000
<< ********************** >>                                            03844000
<< Send END DATA command. >>                                            03846000
<< ********************** >>                                            03848000
                                                                        03850000
<< 19  >>   %2007, << CEND'DATA,    >>                                  03852000
                   << CDIAG'JUMP,   >>                                  03854000
                   << CLOOP'JUMP,   >>                                  03856000
                   << CTEST'JUMP,   >>                                  03858000
                   << CLOG'JUMP,    >>                                  03860000
                   << CFIRM'JUMP.   >>                                  03862000
<< 20  >>       1, << CEND'DATA'CNT,>>                                  03864000
                   << CDIAG'JVEC,   >>                                  03866000
                   << CLOOP'JVEC.   >>                                  03868000
                   << CTEST'JVEC.   >>                                  03870000
                   << CLOG'JVEC.    >>                                  03872000
                   << CFIRM'JVEC.   >>                                  03874000
<< 21  >>       0,                                                      03876000
<< 22  >>  %42000,                                                      03878000
<< 23  >>       0, << CEND'DATA'ADR >>                                  03880000
                                                                        03882000
<< ********************************** >>                                03884000
<< DSJ, check status of DMA transfer. >>                                03886000
<< ********************************** >>                                03888000
                                                                        03890000
<< 24  >>   %2402,                                                      03892000
<< 25  >>       0,                                                      03894000
<< 26  >>       0, << DSJ 0 returned.>>                                 03896000
<< 27  >>      17, << DSJ 1 returned.>>                                 03898000
<< 28  >>      17, << DSJ 2 returned.>>                                 03900000
                                                                        03902000
<< *********************** >>                                           03904000
<< Read actual byte count. >>                                           03906000
<< *********************** >>                                           03908000
                                                                        03910000
<< 29  >>   %1402,                                                      03912000
<< 30  >>       2,                                                      03914000
<< 31  >>       0,                                                      03916000
<< 32  >>   %2000,                                                      03918000
<< 33  >>       0, << CACT'CNT'ADR >>                                   03920000
$PAGE                                                                   03922000
<< ************************* >>                                         03924000
<< Interrupt, halt code = 0. >>                                         03926000
<< ************************* >>                                         03928000
                                                                        03930000
<< ******************* >>                                               03932000
<< Read device status. >>                                               03934000
<< ******************* >>                                               03936000
                                                                        03938000
<< 34  >>   %1401,                                                      03940000
<< 35  >>       6,                                                      03942000
<< 36  >>       0,                                                      03944000
<< 37  >>   %2000,                                                      03946000
<< 38  >>       0, << CSTAT1'ADR.>>                                     03948000
                                                                        03950000
<< ************************** >>                                        03952000
<< Send END COMPLETE command. >>                                        03954000
<< ************************** >>                                        03956000
                                                                        03958000
<< 39  >>   %2007, << End complete.    >>                               03960000
<< 40  >>       1,                                                      03962000
<< 41  >>       0,                                                      03964000
<< 42  >>  %42000,                                                      03966000
<< 43  >>       0, << CEND'CMPL1'ADR.>>                                 03968000
                                                                        03970000
<< ********** >>                                                        03972000
<< Interrupt. >>                                                        03974000
<< ********** >>                                                        03976000
                                                                        03978000
<< 44  >>    %601,                                                      03980000
<< 45  >>       0, << Halt code.>>                                      03982000
                                                                        03984000
                                                                        03986000
<< ************************* >>                                         03988000
<< Interrupt, halt code = 1. >>                                         03990000
<< ************************* >>                                         03992000
                                                                        03994000
<< ******************* >>                                               03996000
<< Read device status. >>                                               03998000
<< ******************* >>                                               04000000
                                                                        04002000
<< 46  >>   %1401,                                                      04004000
<< 47  >>       6,                                                      04006000
<< 48  >>       0,                                                      04008000
<< 49  >>   %2000,                                                      04010000
<< 50  >>       0, << CSTAT2'ADR >>                                     04012000
                                                                        04014000
<< ************************** >>                                        04016000
<< Send END COMPLETE command. >>                                        04018000
<< ************************** >>                                        04020000
                                                                        04022000
<< 51  >>   %2007, << End complete.    >>                               04024000
<< 52  >>       1,                                                      04026000
<< 53  >>       0,                                                      04028000
<< 54  >>  %42000,                                                      04030000
<< 55  >>       0, << CEND'CMPL2'ADR.>>                                 04032000
                                                                        04034000
<< ********** >>                                                        04036000
<< Interrupt. >>                                                        04038000
<< ********** >>                                                        04040000
                                                                        04042000
<< 56  >>    %601,                                                      04044000
<< 57  >>       1, << Halt code.>>                                      04046000
                                                                        04048000
                                                                        04050000
<< ************************* >>                                         04052000
<< Interrupt, halt code = 2. >>                                         04054000
<< ************************* >>                                         04056000
                                                                        04058000
<< ******************* >>                                               04060000
<< Read device status. >>                                               04062000
<< ******************* >>                                               04064000
                                                                        04066000
<< 58  >>   %1401,                                                      04068000
<< 59  >>       6,                                                      04070000
<< 60  >>       0,                                                      04072000
<< 61  >>   %2000,                                                      04074000
<< 62  >>       0, << CSTAT3'ADR.>>                                     04076000
                                                                        04078000
<< ************************** >>                                        04080000
<< Send END COMPLETE command. >>                                        04082000
<< ************************** >>                                        04084000
                                                                        04086000
<< 63  >>   %2007,                                                      04088000
<< 64  >>       1,                                                      04090000
<< 65  >>       0,                                                      04092000
<< 66  >>  %42000,                                                      04094000
<< 67  >>       0, << CEND'CMPL3'ADR.>>                                 04096000
                                                                        04098000
<< ********** >>                                                        04100000
<< Interrupt. >>                                                        04102000
<< ********** >>                                                        04104000
                                                                        04106000
<< 68  >>    %601,                                                      04108000
<< 69  >>       2, << Halt code.>>                                      04110000
                                                                        04112000
                                                                        04114000
<< ************************* >>                                         04116000
<< Interrupt, halt code = 3. >>                                         04118000
<< ************************* >>                                         04120000
                                                                        04122000
<< ******************* >>                                               04124000
<< Read device status. >>                                               04126000
<< ******************* >>                                               04128000
                                                                        04130000
<< 70  >>   %1401,                                                      04132000
<< 71  >>       6,                                                      04134000
<< 72  >>       0,                                                      04136000
<< 73  >>   %2000,                                                      04138000
<< 74  >>       0, << CSTAT4'ADR >>                                     04140000
                                                                        04142000
<< ************************** >>                                        04144000
<< Send END COMPLETE command. >>                                        04146000
<< ************************** >>                                        04148000
                                                                        04150000
<< 75  >>   %2007,                                                      04152000
<< 76  >>       1,                                                      04154000
<< 77  >>       0,                                                      04156000
<< 78  >>  %42000,                                                      04158000
<< 79  >>       0, << CEND'CMPL4'ADR.>>                                 04160000
                                                                        04162000
<< ********** >>                                                        04164000
<< Interrupt. >>                                                        04166000
<< ********** >>                                                        04168000
                                                                        04170000
<< 80  >>    %601,                                                      04172000
<< 81  >>       3, << Halt code.>>                                      04174000
$PAGE                                                                   04176000
<< ********************************* >>                                 04178000
<< Write record or Identify request. >>                                 04180000
<< ********************************* >>                                 04182000
                                                                        04184000
<< ************************************** >>                            04186000
<< Send WRITE record or IDENTIFY command. >>                            04188000
<< ************************************** >>                            04190000
                                                                        04192000
<< 82  >>   %2001, << CWR'CMD,      >>                                  04194000
                   << CIDENTIFY.    >>                                  04196000
<< 83  >>       2, << CWR'CMD'CNT,  >>                                  04198000
                   << CIDENT'CODE.  >>                                  04200000
<< 84  >>       0, << Identify jump.>>                                  04202000
<< 85  >>   %2000, << CWR'CMD'BANK, >>                                  04204000
                   << CIDENT'JVEC.  >>                                  04206000
<< 86  >>       0, << CWR'CMD'ADR.  >>                                  04208000
                                                                        04210000
<< *********************** >>                                           04212000
<< Wait for parallel poll. >>                                           04214000
<< *********************** >>                                           04216000
                                                                        04218000
<< 87  >>   %1000,                                                      04220000
<< 88  >>       0,                                                      04222000
                                                                        04224000
<< ***************************** >>                                     04226000
<< DSJ, check status of command. >>                                     04228000
<< ***************************** >>                                     04230000
                                                                        04232000
<< 89  >>   %2402,                                                      04234000
<< 90  >>       0,                                                      04236000
<< 91  >>       0, << CWR'CMD'DSJ0,>>                                   04238000
                   << CIDENT'DSJ0. >>                                   04240000
<< 92  >>     -48,                                                      04242000
<< 93  >>     -36,                                                      04244000
                                                                        04246000
<< ******************************* >>                                   04248000
<< Execute DMA transfer to device. >>                                   04250000
<< ******************************* >>                                   04252000
                                                                        04254000
<< 94  >>   %2000, << CWR'EXEC.    >>                                   04256000
<< 95  >>       0, << CWR'BYTE'CNT.>>                                   04258000
<< 96  >>       0,                                                      04260000
<< 97  >>       0, << CWR'BANK.    >>                                   04262000
<< 98  >>       0, << CWR'ADR.     >>                                   04264000
                                                                        04266000
<< *********************** >>                                           04268000
<< Wait for parallel poll. >>                                           04270000
<< *********************** >>                                           04272000
                                                                        04274000
<< 99  >>   %1000,                                                      04276000
<< 100 >>       0,                                                      04278000
                                                                        04280000
<< ********************************** >>                                04282000
<< DSJ, check status of DMA transfer. >>                                04284000
<< ********************************** >>                                04286000
                                                                        04288000
<< 101 >>   %2402,                                                      04290000
<< 102 >>       0,                                                      04292000
<< 103 >>     -72, << CWR'DSJ0.>>                                       04294000
<< 104 >>     -60, << CWR'DSJ1.>>                                       04296000
<< 105 >>     -36, << CWR'DSJ2.>>                                       04298000
$PAGE                                                                   04300000
<< ********************* >>                                             04302000
<< Idle Channel Program. >>                                             04304000
<< ********************* >>                                             04306000
                                                                        04308000
<< ********************** >>                                            04310000
<< Send END IDLE command. >>                                            04312000
<< ********************** >>                                            04314000
                                                                        04316000
<< 106 >>   %2007, << CIDLE'CP,       >>                                04318000
                   << CEND'IDLE,      >>                                04320000
                   << CCLEAR.         >>                                04322000
<< 107 >>       1, << CEND'IDLE'CNT,  >>                                04324000
                   << CCLEAR'WD2.     >>                                04326000
<< 108 >>       0, << CEND'IDLE'WORD3,>>                                04328000
                   << CCLEAR'JUMP.    >>                                04330000
<< 109 >>  %42000, << CEND'IDLE'BANK, >>                                04332000
                   << CCLEAR'JVEC.    >>                                04334000
<< 110 >>       0, << CEND'IDLE'ADR.  >>                                04336000
                                                                        04338000
<< *********************** >>                                           04340000
<< Wait for parallel poll. >>                                           04342000
<< *********************** >>                                           04344000
                                                                        04346000
<< 111 >>   %1000,                                                      04348000
<< 112 >>       0,                                                      04350000
                                                                        04352000
<< ****************************** >>                                    04354000
<< DSJ, check idle device status. >>                                    04356000
<< ****************************** >>                                    04358000
                                                                        04360000
<< 113 >>   %2402, << CIDLE'DSJ,       >>                               04362000
                   << CEND'DIAG.       >>                               04364000
                   << CCLEAR'DSJ.      >>                               04366000
<< 114 >>       0, << CEND'DIAG'CODE.  >>                               04368000
<< 115 >>       0, << DSJ 0 returned.  >>                               04370000
<< 116 >>      12, << DSJ 1 returned.  >>                               04372000
<< 117 >>      12, << DSJ 2 returned.  >>                               04374000
                                                                        04376000
<< ************************ >>                                          04378000
<< Interrupt, halt code = 0.>>                                          04380000
<< ************************ >>                                          04382000
                                                                        04384000
<< ******************* >>                                               04386000
<< Read device status. >>                                               04388000
<< ******************* >>                                               04390000
                                                                        04392000
<< 118 >>   %1401,                                                      04394000
<< 119 >>       6,                                                      04396000
<< 120 >>       0,                                                      04398000
<< 121 >>   %2000,                                                      04400000
<< 122 >>       0, << CIDLE'STAT1'ADR.>>                                04402000
                                                                        04404000
<< ************************** >>                                        04406000
<< Send END COMPLETE command. >>                                        04408000
<< ************************** >>                                        04410000
                                                                        04412000
<< 123 >>   %2007,                                                      04414000
<< 124 >>       1,                                                      04416000
<< 125 >>       0,                                                      04418000
<< 126 >>  %42000,                                                      04420000
<< 127 >>       0, << CEND'CMPL5'ADR.>>                                 04422000
                                                                        04424000
<< ********** >>                                                        04426000
<< Interrupt. >>                                                        04428000
<< ********** >>                                                        04430000
                                                                        04432000
<< 128 >>    %601,                                                      04434000
<< 129 >>       0, << Halt code.>>                                      04436000
                                                                        04438000
<< ************************* >>                                         04440000
<< Interrupt, halt code = 1. >>                                         04442000
<< ************************* >>                                         04444000
                                                                        04446000
<< ******************* >>                                               04448000
<< Read device status. >>                                               04450000
<< ******************* >>                                               04452000
                                                                        04454000
<< 130 >>   %1401,                                                      04456000
<< 131 >>       6,                                                      04458000
<< 132 >>       0,                                                      04460000
<< 133 >>   %2000,                                                      04462000
<< 134 >>       0, << CIDLE'STAT2'ADR >>                                04464000
                                                                        04466000
<< ************************** >>                                        04468000
<< Send END COMPLETE command. >>                                        04470000
<< ************************** >>                                        04472000
                                                                        04474000
<< 134 >>   %2007,                                                      04476000
<< 136 >>       1,                                                      04478000
<< 137 >>       0,                                                      04480000
<< 138 >>  %42000,                                                      04482000
<< 139 >>       0, << CEND'CMPL6'ADR.>>                                 04484000
                                                                        04486000
<< ********** >>                                                        04488000
<< Interrupt. >>                                                        04490000
<< ********** >>                                                        04492000
                                                                        04494000
<< 140 >>    %601,                                                      04496000
<< 141 >>       1, << Halt code. >>                                     04498000
$PAGE                                                                   04500000
<< ************************************** >>                            04502000
<< Miscellaneous channel program storage. >>                            04504000
<< ************************************** >>                            04506000
                                                                        04508000
<< 142 >>       0, << CTAPE'CMD.       >>                               04510000
<< 143 >>       2, << CEND'DATA'CMD.   >>                               04512000
<< 144 >>     %10, << CEND'CMPL'CMD.   >>                               04514000
<< 145 >>       0, << CDEVSTAT1.       >>                               04516000
<< 146 >>       0, << CDEVSTAT2.       >>                               04518000
<< 147 >>       0, << CDEVSTAT3.       >>                               04520000
<< 148 >>       0, << CSHORT'BUF1.     >>                               04522000
<< 149 >>       0, << CSHORT'BUF2.     >>                               04524000
<< 150 >>       0, << CSHORT'BUF3.     >>                               04526000
<< 151 >>       0, << CACT'CNT.        >>                               04528000
<< 152 >>       4, << CEND'IDLE'CMD.   >>                               04530000
<< 153 >>       0; << Filler, not used.>>                               04532000
$PAGE                                                                   04534000
<< ******************************** >>                                  04536000
<<                                  >>                                  04538000
<< External Procedure Declarations. >>                                  04540000
<<                                  >>                                  04542000
<< ******************************** >>                                  04544000
                                                                        04546000
<< ************** >>                                                    04548000
<< Timer Request. >>                                                    04550000
<< ************** >>                                                    04552000
                                                                        04554000
INTEGER PROCEDURE TIMEREQ (CODE, REQ, TIME);                            04556000
                                                                        04558000
VALUE                                                                   04560000
                                                                        04562000
  CODE,                                                                 04564000
  REQ ,                                                                 04566000
  TIME;                                                                 04568000
                                                                        04570000
INTEGER                                                                 04572000
                                                                        04574000
  CODE,                                                                 04576000
  REQ ;                                                                 04578000
                                                                        04580000
DOUBLE                                                                  04582000
                                                                        04584000
  TIME;                                                                 04586000
                                                                        04588000
OPTION                                                                  04590000
                                                                        04592000
  EXTERNAL;                                                             04594000
                                                                        04596000
                                                                        04598000
                                                                        04600000
                                                                        04602000
<< ************ >>                                                      04604000
<< Abort Timer. >>                                                      04606000
<< ************ >>                                                      04608000
                                                                        04610000
PROCEDURE ABORTTIMEREQ (TRLX);                                          04612000
                                                                        04614000
VALUE                                                                   04616000
                                                                        04618000
  TRLX;                                                                 04620000
                                                                        04622000
INTEGER                                                                 04624000
                                                                        04626000
  TRLX;                                                                 04628000
                                                                        04630000
OPTION                                                                  04632000
                                                                        04634000
  EXTERNAL;                                                             04636000
                                                                        04638000
                                                                        04640000
                                                                        04642000
                                                                        04644000
<< ********** >>                                                        04646000
<< EOF Check. >>                                                        04648000
<< ********** >>                                                        04650000
                                                                        04652000
PROCEDURE EOFCHECK (P'IOQ, BUF'BANK'ADR, TRANSFER'COUNT,                04654000
                    HCHK);                                              04656000
                                                                        04658000
VALUE                                                                   04660000
                                                                        04662000
  P'IOQ         ,                                                       04664000
  BUF'BANK'ADR  ,                                                       04666000
  TRANSFER'COUNT,                                                       04668000
  HCHK          ;                                                       04670000
                                                                        04672000
POINTER                                                                 04674000
  P'IOQ;                                                                04676000
                                                                        04678000
INTEGER                                                                 04680000
                                                                        04682000
  TRANSFER'COUNT,                                                       04684000
  HCHK          ;                                                       04686000
                                                                        04688000
DOUBLE                                                                  04690000
                                                                        04692000
  BUF'BANK'ADR;                                                         04694000
                                                                        04696000
OPTION                                                                  04698000
                                                                        04700000
  EXTERNAL;                                                             04702000
                                                                        04704000
                                                                        04706000
                                                                        04708000
                                                                        04710000
<< ********************************* >>                                 04712000
<< HPIB General Interrupt Processor. >>                                 04714000
<< ********************************* >>                                 04716000
                                                                        04718000
PROCEDURE GIP'HPIB;                                                     04720000
                                                                        04722000
OPTION                                                                  04724000
                                                                        04726000
  EXTERNAL;                                                             04728000
                                                                        04730000
                                                                        04732000
                                                                        04734000
                                                                        04736000
<< ************* >>                                                     04738000
<< I/O Messages. >>                                                     04740000
<< ************* >>                                                     04742000
                                                                        04744000
LOGICAL PROCEDURE IOMESSAGE (SETNO, MSGNO, MASK, P1, P2, P3, P4,        04746000
                             P5, DEST, REPLY, OFFSET, P'DIT,            04748000
                             IOTYPE);                                   04750000
                                                                        04752000
VALUE                                                                   04754000
                                                                        04756000
  SETNO ,                                                               04758000
  MSGNO ,                                                               04760000
  MASK  ,                                                               04762000
  P1    ,                                                               04764000
  P2    ,                                                               04766000
  P3    ,                                                               04768000
  P4    ,                                                               04770000
  P5    ,                                                               04772000
  DEST  ,                                                               04774000
  REPLY ,                                                               04776000
  OFFSET,                                                               04778000
  P'DIT ,                                                               04780000
  IOTYPE;                                                               04782000
                                                                        04784000
INTEGER                                                                 04786000
                                                                        04788000
  SETNO ,                                                               04790000
  MSGNO ,                                                               04792000
  MASK  ,                                                               04794000
  P1    ,                                                               04796000
  P2    ,                                                               04798000
  P3    ,                                                               04800000
  P4    ,                                                               04802000
  P5    ,                                                               04804000
  DEST  ,                                                               04806000
  REPLY ,                                                               04808000
  OFFSET,                                                               04810000
  IOTYPE;                                                               04812000
                                                                        04814000
LOGICAL POINTER                                                         04816000
                                                                        04818000
  P'DIT;                                                                04820000
                                                                        04822000
OPTION                                                                  04824000
                                                                        04826000
  VARIABLE,                                                             04828000
  EXTERNAL;                                                             04830000
                                                                        04832000
                                                                        04834000
                                                                        04836000
                                                                        04838000
<< ****************** >>                                                04840000
<< Master Clear HPIB. >>                                                04842000
<< ****************** >>                                                04844000
                                                                        04846000
PROCEDURE MASTERCLEARHPIB (P'DIT);                                      04848000
                                                                        04850000
VALUE                                                                   04852000
                                                                        04854000
  P'DIT;                                                                04856000
                                                                        04858000
LOGICAL POINTER                                                         04860000
                                                                        04862000
  P'DIT;                                                                04864000
                                                                        04866000
OPTION                                                                  04868000
                                                                        04870000
  EXTERNAL;                                                             04872000
                                                                        04874000
                                                                        04876000
                                                                        04878000
                                                                        04880000
<< ******************* >>                                               04882000
<< I/O Device Monitor. >>                                               04884000
<< ******************* >>                                               04886000
                                                                        04888000
PROCEDURE SIODM (P'DIT, FLAGS);                                         04890000
                                                                        04892000
VALUE                                                                   04894000
                                                                        04896000
  P'DIT,                                                                04898000
  FLAGS;                                                                04900000
                                                                        04902000
LOGICAL                                                                 04904000
                                                                        04906000
  FLAGS;                                                                04908000
                                                                        04910000
LOGICAL POINTER                                                         04912000
                                                                        04914000
  P'DIT;                                                                04916000
                                                                        04918000
OPTION                                                                  04920000
                                                                        04922000
  EXTERNAL;                                                             04924000
                                                                        04926000
                                                                        04928000
                                                                        04930000
                                                                        04932000
<< *************************** >>                                       04934000
<< Start HPIB Channel Program. >>                                       04936000
<< *************************** >>                                       04938000
                                                                        04940000
PROCEDURE START'HPIB (P'DIT, P'CHAN'PGM, QFLAG);                        04942000
                                                                        04944000
VALUE                                                                   04946000
                                                                        04948000
  P'DIT     ,                                                           04950000
  P'CHAN'PGM,                                                           04952000
  QFLAG     ;                                                           04954000
                                                                        04956000
LOGICAL                                                                 04958000
                                                                        04960000
  QFLAG;                                                                04962000
                                                                        04964000
LOGICAL POINTER                                                         04966000
                                                                        04968000
  P'DIT     ,                                                           04970000
  P'CHAN'PGM;                                                           04972000
                                                                        04974000
OPTION                                                                  04976000
                                                                        04978000
  EXTERNAL;                                                             04980000
                                                                        04982000
                                                                        04984000
                                                                        04986000
                                                                        04988000
<< ******************* >>                                               04990000
<< Get DRT entry word. >>                                               04992000
<< ******************* >>                                               04994000
                                                                        04996000
INTEGER PROCEDURE GETDRT (DRT'INDEX, WORD'OFFSET);                      04998000
                                                                        05000000
VALUE                                                                   05002000
                                                                        05004000
  DRT'INDEX  ,                                                          05006000
  WORD'OFFSET;                                                          05008000
                                                                        05010000
INTEGER                                                                 05012000
                                                                        05014000
  DRT'INDEX  ,                                                          05016000
  WORD'OFFSET;                                                          05018000
                                                                        05020000
OPTION                                                                  05022000
                                                                        05024000
  EXTERNAL;                                                             05026000
$PAGE                                                                   05028000
<< ****************************************************** >>            05030000
<<                                                        >>            05032000
<<  Buckhorn/Antelope Initialization Procedure - MTINIT.  >>            05034000
<<                                                        >>            05036000
<< ****************************************************** >>            05038000
                                                                        05040000
PROCEDURE MTINIT (P'DIT);                                               05042000
                                                                        05044000
VALUE                                                                   05046000
                                                                        05048000
  P'DIT;                                                                05050000
                                                                        05052000
LOGICAL POINTER                                                         05054000
                                                                        05056000
  P'DIT; << Pointer to DIT.>>                                           05058000
                                                                        05060000
<< ********************************************** >>                    05062000
<< This procedure initializes the channel program >>                    05064000
<< for Read, Write, and tape commands.            >>                    05066000
<< ********************************************** >>                    05068000
                                                                        05070000
BEGIN << MTINIT >>                                                      05072000
                                                                        05074000
LOGICAL POINTER                                                         05076000
                                                                        05078000
  P'ILT        , << Pointer to ILT.                   >>                05080000
  P'CHAN'PGM   , << Pointer to chan pgm.             >>                 05082000
  P'IDLE'PGM   , << Pointer to idle chan pgm.        >>                 05084000
  P'IDLE'STATUS; << Pointer to idle chan pgm status. >>                 05086000
                                                                        05088000
INTEGER POINTER                                                         05090000
                                                                        05092000
  IP'CHAN'PGM    = P'CHAN'PGM   ,                                       05094000
  IP'IDLE'PGM    = P'IDLE'PGM   ,                                       05096000
  IP'IDLE'STATUS = P'IDLE'STATUS;                                       05098000
                                                                        05100000
INTEGER                                                                 05102000
                                                                        05104000
  SYSDB'CHAN'PGM,    << SYSDB adr of chan pgm.            >>            05106000
  SYSDB'IDLE'STATUS; << SYSDB adr of idle chan pgm status.>>            05108000
$PAGE                                                                   05110000
<< *************************** >>                                       05112000
<< Initialize local variables. >>                                       05114000
<< *************************** >>                                       05116000
                                                                        05118000
@P'ILT            := DIT'ILT'PTR;                                       05120000
@P'CHAN'PGM       := ILT'CHAN'PGM'PTR;                                  05122000
@IP'IDLE'PGM      := @IP'CHAN'PGM + CIDLE'CP;                           05124000
@P'IDLE'STATUS    := ILT'STATUS'PTR;                                    05126000
SYSDB'CHAN'PGM    := @IP'CHAN'PGM + SYSDB;                              05128000
SYSDB'IDLE'STATUS := @IP'IDLE'STATUS + SYSDB;                           05130000
                                                                        05132000
<< *********************** >>                                           05134000
<< Initiate idle chan pgm. >>                                           05136000
<< *********************** >>                                           05138000
                                                                        05140000
IF NOT ILT'IDLE'PGM'RUNNING THEN << start idle channel program.>>       05142000
BEGIN                                                                   05144000
                                                                        05146000
  << ********************************* >>                               05148000
  << Initialize channel program areas. >>                               05150000
  << ********************************* >>                               05152000
                                                                        05154000
  IP'CHAN'PGM (CTAPE'CMD'ADR   ) := SYSDB'CHAN'PGM + CTAPE'CMD    ;     05156000
  IP'CHAN'PGM (CWR'CMD'ADR     ) := SYSDB'CHAN'PGM + CTAPE'CMD    ;     05158000
  IP'CHAN'PGM (CACT'CNT'ADR    ) := SYSDB'CHAN'PGM + CACT'CNT     ;     05160000
  IP'CHAN'PGM (CSTAT1'ADR      ) := SYSDB'CHAN'PGM + CDEVSTAT1    ;     05162000
  IP'CHAN'PGM (CSTAT2'ADR      ) := SYSDB'CHAN'PGM + CDEVSTAT1    ;     05164000
  IP'CHAN'PGM (CSTAT3'ADR      ) := SYSDB'CHAN'PGM + CDEVSTAT1    ;     05166000
  IP'CHAN'PGM (CSTAT4'ADR      ) := SYSDB'CHAN'PGM + CDEVSTAT1    ;     05168000
  IP'CHAN'PGM (CIDLE'DSJ       ) := %2402                         ;     05170000
  IP'CHAN'PGM (CIDLE'STAT1'ADR ) := SYSDB'IDLE'STATUS             ;     05172000
  IP'CHAN'PGM (CIDLE'STAT2'ADR ) := SYSDB'IDLE'STATUS             ;     05174000
  IP'CHAN'PGM (CEND'DATA'ADR   ) := SYSDB'CHAN'PGM + CEND'DATA'CMD;     05176000
  IP'CHAN'PGM (CEND'IDLE'ADR   ) := SYSDB'CHAN'PGM + CEND'IDLE'CMD;     05178000
  IP'CHAN'PGM (CEND'CMPL1'ADR  ) := SYSDB'CHAN'PGM + CEND'CMPL'CMD;     05180000
  IP'CHAN'PGM (CEND'CMPL2'ADR  ) := SYSDB'CHAN'PGM + CEND'CMPL'CMD;     05182000
  IP'CHAN'PGM (CEND'CMPL3'ADR  ) := SYSDB'CHAN'PGM + CEND'CMPL'CMD;     05184000
  IP'CHAN'PGM (CEND'CMPL4'ADR  ) := SYSDB'CHAN'PGM + CEND'CMPL'CMD;     05186000
  IP'CHAN'PGM (CEND'CMPL5'ADR  ) := SYSDB'CHAN'PGM + CEND'CMPL'CMD;     05188000
  IP'CHAN'PGM (CEND'CMPL6'ADR  ) := SYSDB'CHAN'PGM + CEND'CMPL'CMD;     05190000
                                                                        05192000
  START'HPIB (P'DIT, P'IDLE'PGM, FALSE);                                05194000
                                                                        05196000
END;                                                                    05198000
                                                                        05200000
END; << MTINIT >>                                                       05202000
$PAGE                                                                   05204000
<< ********************************************************** >>        05206000
<<                                                            >>        05208000
<< Buckhorn/Atelope Magnetic Tape Driver Procedure - MTDRVR.  >>        05210000
<<                                                            >>        05212000
<< ********************************************************** >>        05214000
                                                                        05216000
INTEGER PROCEDURE MTDRVR (P'IOQ, P'DIT, BUF'BANK, BUF'ADR,              05218000
                          P'CHAN'PGM, DRTN);                            05220000
                                                                        05222000
<< *********************************************************** >>       05224000
<< This procedure initiates and completes I/O requests for the >>       05226000
<< tape drive connected to he HP-IB and controlled by the GIC. >>       05228000
<<                                                             >>       05230000
<< Driver States returned from MTDRVR:                         >>       05232000
<<    5 - Request completed.                                   >>       05234000
<<    7 - Operator intervention required.                      >>       05236000
<<  %13 - Wait for operation completion.                       >>       05238000
<< *********************************************************** >>       05240000
                                                                        05242000
VALUE                                                                   05244000
                                                                        05246000
  P'DIT     ,                                                           05248000
  P'IOQ     ,                                                           05250000
  BUF'BANK  ,                                                           05252000
  BUF'ADR   ,                                                           05254000
  P'CHAN'PGM,                                                           05256000
  DRTN      ;                                                           05258000
                                                                        05260000
LOGICAL                                                                 05262000
                                                                        05264000
  BUF'BANK, << Memory bank of buffer for transfers.   >>                05266000
  BUF'ADR ; << Memory address of buffer for transfers.>>                05268000
                                                                        05270000
INTEGER                                                                 05272000
                                                                        05274000
  DRTN; << Device reference table number.  >>                           05276000
                                                                        05278000
LOGICAL POINTER                                                         05280000
                                                                        05282000
  P'DIT     , << Pointer to DIT.            >>                          05284000
  P'IOQ     , << Pointer to IOQ.            >>                          05286000
  P'CHAN'PGM; << Pointer to channel program.>>                          05288000
                                                                        05290000
OPTION                                                                  05292000
                                                                        05294000
  PRIVILEGED,                                                           05296000
  UNCALLABLE;                                                           05298000
                                                                        05300000
BEGIN << MTDRVR >>                                                      05302000
                                                                        05304000
LOGICAL POINTER                                                         05306000
                                                                        05308000
  P'CP'VAR'AREA  , << Pointer to chan pgm variable area.>>              05310000
  P'IDLE'PGM     ; << Pointer to idle chan pgm.         >>              05312000
                                                                        05314000
INTEGER POINTER                                                         05316000
                                                                        05318000
  IP'IOQ         = P'IOQ        , << Pointer to IOQ table.        >>    05320000
  IP'LPDT        = DB + SYSLPDT , << Pointer to LPDT table.       >>    05322000
  IP'CHAN'PGM    = P'CHAN'PGM   , << Pointer to chan pgm.         >>    05324000
  IP'DIT         = P'DIT        , << Pointer to DIT table.        >>    05326000
  IP'CP'VAR'AREA = P'CP'VAR'AREA, << Pointer to CPVA.             >>    05328000
  IP'IDLE'PGM    = P'IDLE'PGM   ; << Pointer to idle chan pgm.    >>    05330000
                                                                        05332000
LOGICAL                                                                 05334000
                                                                        05336000
  GENERIC'STATUS;                                                       05338000
                                                                        05340000
INTEGER                                                                 05342000
                                                                        05344000
  LPDT'ENTRY'INDEX     ,                                                05346000
  TRANSFER'COUNT       , << in bytes.>>                                 05348000
  BYTES'TRANSFERED     ,                                                05350000
  DRIVER'STATE = MTDRVR,                                                05352000
  S0           = S - 0 ,                                                05354000
  S1           = S - 1 ,                                                05356000
  S3           = S - 3 ,                                                05358000
  X            = X     ;                                                05360000
                                                                        05362000
DOUBLE                                                                  05364000
                                                                        05366000
  BUF'BANK'ADR   , << Bank and offset adr of memory buffer.        >>   05368000
  WS'BUF'BANK'ADR; << Working bank and offset adr of memory buffer.>>   05370000
$PAGE                                                                   05372000
<< **************************************** >>                          05374000
<< Initialize local pointers and variables. >>                          05376000
<< **************************************** >>                          05378000
                                                                        05380000
@P'CP'VAR'AREA := DIT'ILT'PTR;                                          05382000
@IP'IDLE'PGM   := @IP'CHAN'PGM + CIDLE'CP;                              05384000
BUF'BANK'ADR   := DOUBLE (BUF'BANK) &DLSL (16) + DOUBLE (BUF'ADR);      05386000
                                                                        05388000
<< ************************ >>                                          05390000
<< Get byte transfer count. >>                                          05392000
<< ************************ >>                                          05394000
                                                                        05396000
IF IOQ'TRANSFER'COUNT < ZERO THEN << byte transfer.>>                   05398000
                                                                        05400000
  TRANSFER'COUNT := -IOQ'TRANSFER'COUNT << make it positive.>>          05402000
                                                                        05404000
ELSE << word transfer, convert to bytes.>>                              05406000
                                                                        05408000
  TRANSFER'COUNT := IOQ'TRANSFER'COUNT &ASL (1);                        05410000
$PAGE                                                                   05412000
<< ********************* >>                                             05414000
<< Powerfail while idle. >>                                             05416000
<< ********************* >>                                             05418000
                                                                        05420000
IF CP'IDLE'POWER'UP THEN << device powerfailed while idle.>>            05422000
BEGIN                                                                   05424000
                                                                        05426000
  CP'IDLE'POWER'UP := ZERO; << Reset.             >>                    05428000
  DIT'POWERFAIL    := TRUE; << Flag the powerfail.>>                    05430000
                                                                        05432000
END;                                                                    05434000
$PAGE                                                                   05436000
<< ******************************** >>                                  05438000
<< Idle Channel Program Initiation. >>                                  05440000
<< ******************************** >>                                  05442000
                                                                        05444000
IF @P'IOQ = ZERO THEN << nothing to do.>>                               05446000
BEGIN                                                                   05448000
                                                                        05450000
  << ********************* >>                                           05452000
  << Set up idle chan pgm. >>                                           05454000
  << ********************* >>                                           05456000
                                                                        05458000
  IP'CHAN'PGM (CEND'IDLE     ) := %2007 ;                               05460000
  IP'CHAN'PGM (CEND'IDLE'CNT ) := 1     ;                               05462000
  IP'CHAN'PGM (CEND'IDLE'WD3 ) := ZERO  ;                               05464000
  IP'CHAN'PGM (CEND'IDLE'BANK) := %42000;                               05466000
  IP'CHAN'PGM (CIDLE'DSJ     ) := %2402 ;                               05468000
                                                                        05470000
  START'HPIB (P'DIT, P'IDLE'PGM, FALSE);                                05472000
                                                                        05474000
  IF < THEN << idle channel program failed to start.>>                  05476000
                                                                        05478000
    MASTERCLEARHPIB (P'DIT); << Halt channel program.>>                 05480000
                                                                        05482000
  P'CP'VAR'AREA := ZERO            ; << Reset.>>                        05484000
  DRIVER'STATE  := REQUEST'COMPLETE;                                    05486000
                                                                        05488000
  RETURN;                                                               05490000
                                                                        05492000
END;                                                                    05494000
$PAGE                                                                   05496000
<< ************* >>                                                     05498000
<< System Abort. >>                                                     05500000
<< ************* >>                                                     05502000
                                                                        05504000
IF IOQ'ABORT THEN << system is requesting abort.>>                      05506000
BEGIN                                                                   05508000
                                                                        05510000
  IF NOT DIT'PENDING'ABORT THEN                                         05512000
  BEGIN                                                                 05514000
                                                                        05516000
    DIT'PENDING'ABORT := TRUE;                                          05518000
                                                                        05520000
    << ****************************** >>                                05522000
    << Set chan pgm for device clear. >>                                05524000
    << ****************************** >>                                05526000
                                                                        05528000
    IP'CHAN'PGM (CSTART'JVEC) := 99   ;                                 05530000
    IP'CHAN'PGM (CWR'DSJ0   ) := ZERO ;                                 05532000
    IP'CHAN'PGM (CWR'DSJ1   ) := ZERO ;                                 05534000
    IP'CHAN'PGM (CWR'DSJ2   ) := ZERO ;                                 05536000
    IP'CHAN'PGM (CCLEAR     ) := %4400;                                 05538000
    IP'CHAN'PGM (CCLEAR'WD2 ) := ZERO ;                                 05540000
    IP'CHAN'PGM (CCLEAR'JUMP) := ZERO ;                                 05542000
    IP'CHAN'PGM (CCLEAR'JVEC) := 1    ;                                 05544000
    IP'CHAN'PGM (CCLEAR'DSJ ) := %2402;                                 05546000
                                                                        05548000
    GO TO START'CHAN'PGM;                                               05550000
                                                                        05552000
  END                                                                   05554000
                                                                        05556000
  ELSE << device clear has already been issued.>>                       05558000
                                                                        05560000
    GO TO COMPLETE'REQUEST;                                             05562000
                                                                        05564000
END;                                                                    05566000
$PAGE                                                                   05568000
<< ***************** >>                                                 05570000
<< Device Powerfail. >>                                                 05572000
<< ***************** >>                                                 05574000
                                                                        05576000
IF DIT'POWERFAIL THEN << device has powerfailed while idle.>>           05578000
BEGIN                                                                   05580000
                                                                        05582000
  DIT'POWERFAIL := FALSE;  << Reset.>>                                  05584000
                                                                        05586000
  MASTERCLEARHPIB (P'DIT); << Halt chan pgm.>>                          05588000
                                                                        05590000
  IOQ'IO'STATUS := POWER'UP        ;                                    05592000
  DRIVER'STATE  := REQUEST'COMPLETE;                                    05594000
                                                                        05596000
  RETURN;                                                               05598000
                                                                        05600000
END;                                                                    05602000
$PAGE                                                                   05604000
<< ******** >>                                                          05606000
<< Timeout. >>                                                          05608000
<< ******** >>                                                          05610000
                                                                        05612000
IF DIT'TIMEOUT THEN << timeout has occured.  This occurs if >>          05614000
BEGIN               << operator doesn't mount a write ring  >>          05616000
                    << within one second (got to be fast).  >>          05618000
                                                                        05620000
  ABORTTIMEREQ (DIT'TIMEOUT'INDEX); << Stop timer.>>                    05622000
                                                                        05624000
  DIT'TIMEOUT'WORD   := ZERO; << Reset.>>                               05626000
  DIT'REWIND'OFFLINE := TRUE;                                           05628000
                                                                        05630000
  << *********************************** >>                             05632000
  << Set up chan pgm for rewind/offline. >>                             05634000
  << *********************************** >>                             05636000
                                                                        05638000
  IP'CHAN'PGM (CSTART'JVEC) := ZERO             ;                       05640000
  IP'CHAN'PGM (CCMD'DSJ0  ) := 20               ;                       05642000
  IP'CHAN'PGM (CTAPE'CMD  ) := TC'REWIND'OFFLINE;                       05644000
                                                                        05646000
  GO TO START'CHAN'PGM;                                                 05648000
                                                                        05650000
END;                                                                    05652000
$PAGE                                                                   05654000
<< **************************************** >>                          05656000
<< Check for transparent status, door open, >>                          05658000
<< or failure from previous operation       >>                          05660000
<< **************************************** >>                          05662000
                                                                        05664000
IF NOT (DRIVER'STATE = INITIATOR'STATE) THEN                            05666000
BEGIN                                                                   05668000
                                                                        05670000
  IF IOQ'FUNCTION'CODE = FC'CLOSE'DEVICE AND                            05672000
     CP'UNIT'ONLINE                      AND                            05674000
     CPVA'HALT'CODE = ZERO               then                           05676000
                                                                        05678000
    << ****************************************** >>                    05680000
    << more device close processing to be done.   >>                    05682000
    << This is a null statement to cause a branch >>                    05684000
    << around the following processing.           >>                    05686000
    << ****************************************** >>                    05688000
                                                                        05690000
  ELSE                                                                  05692000
  BEGIN                                                                 05694000
                                                                        05696000
    IF CPVA'HALT'CODE = ZERO OR                                         05698000
       CPVA'HALT'CODE = 1    THEN                                       05700000
                                                                        05702000
      GO TO COMPLETE'REQUEST;                                           05704000
                                                                        05706000
    << ****************************************************** >>        05708000
    << Transparent status processing.  This is either a       >>        05710000
    << door open or successful retry message from the device. >>        05712000
    << ****************************************************** >>        05714000
                                                                        05716000
    << ******************* >>                                           05718000
    << Was it a door open? >>                                           05720000
    << ******************* >>                                           05722000
                                                                        05724000
    IF CP'DOOR'OPEN THEN                                                05726000
    BEGIN                                                               05728000
                                                                        05730000
      IF NOT (IOMESSAGE (1, DOOR'OPEN'MSG, %10000, DIT'LDEV,,,,,        05732000
              CONSOLE)) THEN                                            05734000
      BEGIN << IOMESSAGE failed.>>                                      05736000
                                                                        05738000
        MASTERCLEARHPIB (P'DIT); << Halt channel program.>>             05740000
                                                                        05742000
        IOQ'IO'STATUS := SYSTEM'ERROR    ;                              05744000
        DRIVER'STATE  := REQUEST'COMPLETE;                              05746000
                                                                        05748000
        RETURN;                                                         05750000
                                                                        05752000
      END;                                                              05754000
                                                                        05756000
    END;                                                                05758000
                                                                        05760000
    << ***************************************************** >>         05762000
    << If the door wasn't open then the device is informing  >>         05764000
    << that a successful retry occured.                      >>         05766000
    << ***************************************************** >>         05768000
                                                                        05770000
    << ************ >>                                                  05772000
    << Log retries. >>                                                  05774000
    << ************ >>                                                  05776000
                                                                        05778000
    IF NOT (CP'RETRY'COUNT = ZERO) THEN                                 05780000
    BEGIN                                                               05782000
                                                                        05784000
      DIT'ERROR'STATUS := [8/3, 8/DIT'ERR'LOG'INDEX];                   05786000
      DIT'STATUS'WORD  := IP'CHAN'PGM (CDEVSTAT1);                      05788000
      DIT'DEV'STAT1    := IP'CHAN'PGM (CDEVSTAT1);                      05790000
      DIT'DEV'STAT2    := IP'CHAN'PGM (CDEVSTAT2);                      05792000
      DIT'DEV'STAT3    := IP'CHAN'PGM (CDEVSTAT3);                      05794000
                                                                        05796000
      IOQ'RETRY'COUNT := CP'RETRY'COUNT;                                05798000
      CP'RETRY'COUNT  := ZERO;                                          05800000
                                                                        05802000
    END;                                                                05804000
                                                                        05806000
    << **************************************************** >>          05808000
    << Determine where to return to in the channel program. >>          05810000
    << **************************************************** >>          05812000
                                                                        05814000
    IF CPVA'HALT'CODE = 2 THEN << return to the wait for parallel >>    05816000
    BEGIN                      << poll after the tape command.    >>    05818000
                                                                        05820000
      IF IOQ'FUNCTION'CODE = FC'WRITE THEN                              05822000
                                                                        05824000
        P'CHAN'PGM (CSTART'JVEC) := 85                                  05826000
                                                                        05828000
      ELSE                                                              05830000
                                                                        05832000
        P'CHAN'PGM (CSTART'JVEC) := 5;                                  05834000
                                                                        05836000
      CPVA'HALT'CODE := ZERO;                                           05838000
                                                                        05840000
      GO TO START'CHAN'PGM;                                             05842000
                                                                        05844000
    END                                                                 05846000
                                                                        05848000
    ELSE                                                                05850000
    BEGIN                                                               05852000
                                                                        05854000
      << ******************* >>                                         05856000
      << CPVA halt code = 3. >>                                         05858000
      << ******************* >>                                         05860000
                                                                        05862000
      << *********************************************************** >> 05864000
      << Return to the wait for parallel poll after the DMA transfer >> 05866000
      << in the write record portion of the channel program.         >> 05868000
      << *********************************************************** >> 05870000
                                                                        05872000
      CPVA'HALT'CODE := ZERO;                                           05874000
                                                                        05876000
      P'CHAN'PGM (CSTART'JVEC) := 97;                                   05878000
                                                                        05880000
      GO TO START'CHAN'PGM;                                             05882000
                                                                        05884000
    END;                                                                05886000
                                                                        05888000
  END;                                                                  05890000
                                                                        05892000
END;                                                                    05894000
$PAGE                                                                   05896000
<< ******************************************* >>                       05898000
<< Zero length read is a forward space record. >>                       05900000
<< ******************************************* >>                       05902000
                                                                        05904000
IF IOQ'TRANSFER'COUNT = ZERO    AND                                     05906000
   IOQ'FUNCTION'CODE  = FC'READ THEN                                    05908000
                                                                        05910000
  IOQ'FUNCTION'CODE := FC'NEXT'RECORD;                                  05912000
$PAGE                                                                   05914000
<< ******************************************** >>                      05916000
<< Zero length write is a check for write ring. >>                      05918000
<< ******************************************** >>                      05920000
                                                                        05922000
IF IOQ'TRANSFER'COUNT = ZERO     AND                                    05924000
   IOQ'FUNCTION'CODE  = FC'WRITE THEN                                   05926000
BEGIN                                                                   05928000
                                                                        05930000
  TRANSFER'COUNT := IOQ'TRANSFER'COUNT;                                 05932000
                                                                        05934000
  IF DRIVER'STATE = INITIATOR'STATE THEN << check for write ring.>>     05936000
  BEGIN                                                                 05938000
                                                                        05940000
    IF CP'FILE'PROTECT THEN << no write ring.>>                         05942000
    BEGIN                                                               05944000
                                                                        05946000
      IF IOMESSAGE (1, NO'WRITE'RING'MSG, %10000, DIT'LDEV,,,,,         05948000
                    CONSOLE) THEN << console message successful,>>      05950000
      BEGIN                       << start timeout.             >>      05952000
                                                                        05954000
        DIT'TIMEOUT'WORD  := ZERO                        ; << Reset.>>  05956000
        DIT'TIMEOUT'INDEX := TIMEREQ (%20, @P'DIT, 1000d);              05958000
                                                                        05960000
        DRIVER'STATE := INTERRUPT'WAIT;                                 05962000
                                                                        05964000
        return;                                                         05966000
                                                                        05968000
      END;                                                              05970000
                                                                        05972000
      << IOMESSAGE failed. >>                                           05974000
                                                                        05976000
      MASTERCLEARHPIB (P'DIT); << Halt chan pgm.>>                      05978000
                                                                        05980000
      IOQ'IO'STATUS := SYSTEM'ERROR    ;                                05982000
      DRIVER'STATE  := REQUEST'COMPLETE;                                05984000
                                                                        05986000
      RETURN;                                                           05988000
                                                                        05990000
    END                                                                 05992000
                                                                        05994000
    ELSE << write ring present.>>                                       05996000
    BEGIN                                                               05998000
                                                                        06000000
      IOQ'IO'STATUS := GOOD'IO         ;                                06002000
      DRIVER'STATE  := REQUEST'COMPLETE;                                06004000
                                                                        06006000
      RETURN;                                                           06008000
                                                                        06010000
    END;                                                                06012000
                                                                        06014000
  END                                                                   06016000
                                                                        06018000
  ELSE                                                                  06020000
  BEGIN                                                                 06022000
                                                                        06024000
    CP'FILE'PROTECT := ZERO;                                            06026000
                                                                        06028000
    GO TO COMPLETE'REQUEST;                                             06030000
                                                                        06032000
  END;                                                                  06034000
                                                                        06036000
END;                                                                    06038000
$PAGE                                                                   06040000
<< ****************** >>                                                06042000
<<                    >>                                                06044000
<< REQUEST PROCESSOR. >>                                                06046000
<<                    >>                                                06048000
<< ****************** >>                                                06050000
                                                                        06052000
                                                                        06054000
REQUEST'PROCESSOR:                                                      06056000
                                                                        06058000
                                                                        06060000
<< ************************************* >>                             06062000
<< Validate function and transfer count. >>                             06064000
<< ************************************* >>                             06066000
                                                                        06068000
IF IOQ'FUNCTION'CODE = 13 OR                                            06070000
   IOQ'FUNCTION'CODE = 17 OR                                            06072000
   IOQ'FUNCTION'CODE > 31 OR                                            06074000
   TRANSFER'COUNT > MAXIMUM'TRANSFER THEN                               06076000
BEGIN                                                                   06078000
                                                                        06080000
  IOQ'IO'STATUS := INVALID'REQUEST ;                                    06082000
  DRIVER'STATE  := REQUEST'COMPLETE;                                    06084000
                                                                        06086000
  RETURN;                                                               06088000
                                                                        06090000
END;                                                                    06092000
                                                                        06094000
<< **************** >>                                                  06096000
<< Process request. >>                                                  06098000
<< **************** >>                                                  06100000
                                                                        06102000
CASE * IOQ'FUNCTION'CODE OF                                             06104000
BEGIN                                                                   06106000
$PAGE                                                                   06108000
  << ***************************** >>                                   06110000
  << Read Record, function code 0. >>                                   06112000
  << ***************************** >>                                   06114000
                                                                        06116000
  BEGIN << case 0.>>                                                    06118000
                                                                        06120000
    EOFCHECK (P'IOQ, 0D, 0, 0); << Check for read   >>                  06122000
                                << past EOF allowed.>>                  06124000
    IF <> THEN << EOF, read not allowed.>>                              06126000
    BEGIN                                                               06128000
                                                                        06130000
      DRIVER'STATE := REQUEST'COMPLETE;                                 06132000
                                                                        06134000
      RETURN;                                                           06136000
                                                                        06138000
    END;                                                                06140000
                                                                        06142000
    << ******************************** >>                              06144000
    << Set up chan pgm for read record. >>                              06146000
    << ******************************** >>                              06148000
                                                                        06150000
    IP'CHAN'PGM (CSTART'JVEC  ) := ZERO   ;                             06152000
    IP'CHAN'PGM (CCMD'DSJ0    ) := ZERO   ;                             06154000
    IP'CHAN'PGM (CRD'EXEC     ) := %1400  ;                             06156000
    IP'CHAN'PGM (CEND'DATA    ) := %2007  ;                             06158000
    IP'CHAN'PGM (CEND'DATA'CNT) := 1      ;                             06160000
    IP'CHAN'PGM (CTAPE'CMD    ) := TC'READ;                             06162000
                                                                        06164000
    IF TRANSFER'COUNT < 6 THEN << short read processing.>>              06166000
    BEGIN                                                               06168000
                                                                        06170000
      IP'CHAN'PGM (CRD'BYTE'CNT) := 6   ; << Transfer count.   >>       06172000
      IP'CHAN'PGM (CRD'BANK    ) := ZERO; << Buffer bank       >>       06174000
                                                                        06176000
      IP'CHAN'PGM (CRD'ADR     ) := @P'CHAN'PGM (CSHORT'BUF1)           06178000
        + SYSDB;                            << and address.      >>     06180000
                                                                        06182000
      IP'CHAN'PGM (CSHORT'BUF1 ) := ZERO;                               06184000
      IP'CHAN'PGM (CSHORT'BUF2 ) := ZERO;                               06186000
      IP'CHAN'PGM (CSHORT'BUF3 ) := ZERO;                               06188000
                                                                        06190000
      DIT'SHORT'READ := TRUE;                                           06192000
                                                                        06194000
    END                                                                 06196000
                                                                        06198000
    ELSE << normal read processing.>>                                   06200000
    BEGIN                                                               06202000
                                                                        06204000
      IP'CHAN'PGM (CRD'BYTE'CNT) := TRANSFER'COUNT;                     06206000
      IP'CHAN'PGM (CRD'BANK    ) := BUF'BANK      ;                     06208000
      IP'CHAN'PGM (CRD'ADR     ) := BUF'ADR       ;                     06210000
                                                                        06212000
    END;                                                                06214000
                                                                        06216000
  END; << Case 0.>>                                                     06218000
$PAGE                                                                   06220000
  << ****************************** >>                                  06222000
  << Write Record, function code 1. >>                                  06224000
  << ****************************** >>                                  06226000
                                                                        06228000
  BEGIN << Case 1.>>                                                    06230000
                                                                        06232000
    IF DIT'END'OF'TAPE        AND                                       06234000
       NOT IOQ'WRITE'PAST'EOT THEN << no write after EOT allowed.>>     06236000
    BEGIN                                                               06238000
                                                                        06240000
      IOQ'IO'STATUS := EOT'WRITE       ;                                06242000
      DRIVER'STATE  := REQUEST'COMPLETE;                                06244000
                                                                        06246000
      RETURN;                                                           06248000
                                                                        06250000
    END;                                                                06252000
                                                                        06254000
    << ********************************* >>                             06256000
    << Set up chan pgm for write record. >>                             06258000
    << ********************************* >>                             06260000
                                                                        06262000
    IP'CHAN'PGM (CSTART'JVEC ) := 80            ;                       06264000
    IP'CHAN'PGM (CWR'CMD     ) := %2001         ;                       06266000
    IP'CHAN'PGM (CWR'CMD'CNT ) := 2             ;                       06268000
    IP'CHAN'PGM (CWR'CMD'BANK) := %2000         ;                       06270000
    IP'CHAN'PGM (CWR'CMD'DSJ0) := ZERO          ;                       06272000
    IP'CHAN'PGM (CWR'EXEC    ) := %2000         ;                       06274000
    IP'CHAN'PGM (CWR'BYTE'CNT) := TRANSFER'COUNT;                       06276000
    IP'CHAN'PGM (CWR'BANK    ) := BUF'BANK      ;                       06278000
    IP'CHAN'PGM (CWR'ADR     ) := BUF'ADR       ;                       06280000
    IP'CHAN'PGM (CWR'DSJ0    ) := -72           ;                       06282000
    IP'CHAN'PGM (CWR'DSJ1    ) := -60           ;                       06284000
    IP'CHAN'PGM (CWR'DSJ2    ) := -36           ;                       06286000
                                                                        06288000
    << Set up write command.  Place write command in left byte.>>       06290000
    << Place transfer count / 256 in right byte.  This is so   >>       06292000
    << the device can poll for transfer when there is enough   >>       06294000
    << room in its internal buffer to hold the transfer.       >>       06296000
                                                                        06298000
    IP'CHAN'PGM (CTAPE'CMD).(0:8) := TC'WRITE;                          06300000
    IP'CHAN'PGM (CTAPE'CMD).(8:8) := (TRANSFER'COUNT - 1) / 256;        06302000
                                                                        06304000
  END; << Case 1.>>                                                     06306000
$PAGE                                                                   06308000
  << *************************** >>                                     06310000
  << Open File, function code 2. >>                                     06312000
  << *************************** >>                                     06314000
                                                                        06316000
  BEGIN << Case 2.>>                                                    06318000
                                                                        06320000
    << ******************************************** >>                  06322000
    << Set up chan pgm for enable immediate report. >>                  06324000
    << ******************************************** >>                  06326000
                                                                        06328000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO;                                  06330000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20  ;                                  06332000
                                                                        06334000
    IF IOQ'PARM'2 = DISABLE'IMMED'RPT THEN                              06336000
                                                                        06338000
      IP'CHAN'PGM (CTAPE'CMD) := TC'DISABLE'IMMED                       06340000
                                                                        06342000
    ELSE                                                                06344000
                                                                        06346000
      IP'CHAN'PGM (CTAPE'CMD) := TC'ENABLE'IMMED;                       06348000
                                                                        06350000
  END;  << Case 2.>>                                                    06352000
$PAGE                                                                   06354000
  << **************************** >>                                    06356000
  << Close File, function code 3. >>                                    06358000
  << **************************** >>                                    06360000
                                                                        06362000
  BEGIN << Case 3.>>                                                    06364000
                                                                        06366000
    << ************************** >>                                    06368000
    << Always return good status. >>                                    06370000
    << ************************** >>                                    06372000
                                                                        06374000
    IOQ'IO'STATUS := GOOD'IO         ;                                  06376000
    DRIVER'STATE  := REQUEST'COMPLETE;                                  06378000
                                                                        06380000
  END; << Case 3.>>                                                     06382000
$PAGE                                                                   06384000
  << ****************************** >>                                  06386000
  << Close Device, function code 4. >>                                  06388000
  << ****************************** >>                                  06390000
                                                                        06392000
  BEGIN << Case 4.>>                                                    06394000
                                                                        06396000
    LPDT'ENTRY'INDEX := DIT'LDEV * LPDT'ENTRY'SIZE;                     06398000
    LPDT'EOF'TYPE    := ZERO;                                           06400000
                                                                        06402000
    IF NOT CP'IMMED'RPT'ENABLE THEN                                     06404000
    BEGIN                                                               06406000
                                                                        06408000
      << ******************************************** >>                06410000
      << Set up chan pgm for enable immediate report. >>                06412000
      << ******************************************** >>                06414000
                                                                        06416000
      IP'CHAN'PGM (CSTART'JVEC) := ZERO           ;                     06418000
      IP'CHAN'PGM (CCMD'DSJ0  ) := 20             ;                     06420000
      IP'CHAN'PGM (CTAPE'CMD  ) := TC'ENABLE'IMMED;                     06422000
                                                                        06424000
    END                                                                 06426000
                                                                        06428000
    ELSE                                                                06430000
    BEGIN                                                               06432000
                                                                        06434000
      << *********************************** >>                         06436000
      << Set up chan pgm for rewind/offline. >>                         06438000
      << *********************************** >>                         06440000
                                                                        06442000
      IP'CHAN'PGM (CSTART'JVEC) := ZERO             ;                   06444000
      IP'CHAN'PGM (CCMD'DSJ0  ) := 20               ;                   06446000
      IP'CHAN'PGM (CTAPE'CMD  ) := TC'REWIND'OFFLINE;                   06448000
                                                                        06450000
    END;                                                                06452000
                                                                        06454000
  END; << Case 4.>>                                                     06456000
$PAGE                                                                   06458000
  << ************************ >>                                        06460000
  << Rewind, function code 5. >>                                        06462000
  << ************************ >>                                        06464000
                                                                        06466000
  BEGIN << Case 5.>>                                                    06468000
                                                                        06470000
    IF DIT'REWIND     AND                                               06472000
       DIT'LOAD'POINT THEN << don't bother, its already rewound.>>      06474000
    BEGIN                                                               06476000
                                                                        06478000
      IOQ'IO'STATUS := GOOD'IO         ;                                06480000
      DRIVER'STATE  := REQUEST'COMPLETE;                                06482000
                                                                        06484000
      RETURN;                                                           06486000
                                                                        06488000
    END;                                                                06490000
                                                                        06492000
    << *************************** >>                                   06494000
    << Set up chan pgm for rewind. >>                                   06496000
    << *************************** >>                                   06498000
                                                                        06500000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO     ;                             06502000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20       ;                             06504000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'REWIND;                             06506000
                                                                        06508000
  END; << Case 5.>>                                                     06510000
$PAGE                                                                   06512000
  << ********************************* >>                               06514000
  << Write File Mark, function code 6. >>                               06516000
  << ********************************* >>                               06518000
                                                                        06520000
  BEGIN << Case 6.>>                                                    06522000
                                                                        06524000
    IF DIT'END'OF'TAPE        AND                                       06526000
       NOT IOQ'WRITE'PAST'EOT THEN << no write after EOT allowed.>>     06528000
    BEGIN                                                               06530000
                                                                        06532000
      IOQ'IO'STATUS := EOT'WRITE       ;                                06534000
      DRIVER'STATE  := REQUEST'COMPLETE;                                06536000
                                                                        06538000
      RETURN;                                                           06540000
                                                                        06542000
    END;                                                                06544000
                                                                        06546000
    << ****************************************** >>                    06548000
    << Set up chan pgm for write file mark (EOF). >>                    06550000
    << ****************************************** >>                    06552000
                                                                        06554000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO        ;                          06556000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20          ;                          06558000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'FILE'MARK;                          06560000
                                                                        06562000
  END; << Case 6.>>                                                     06564000
$PAGE                                                                   06566000
  << ************************************ >>                            06568000
  << Forward Space File, function code 7. >>                            06570000
  << ************************************ >>                            06572000
                                                                        06574000
  BEGIN << Case 7.>>                                                    06576000
                                                                        06578000
    << *************************************** >>                       06580000
    << Set up chan pgm for forward space file. >>                       06582000
    << *************************************** >>                       06584000
                                                                        06586000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO        ;                          06588000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20          ;                          06590000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'NEXT'FILE;                          06592000
                                                                        06594000
  END; << Case 7.>>                                                     06596000
$PAGE                                                                   06598000
  << ******************************** >>                                06600000
  << Backspace File, function code 8. >>                                06602000
  << ******************************** >>                                06604000
                                                                        06606000
  BEGIN << Case 8.>>                                                    06608000
                                                                        06610000
    IF DIT'LOAD'POINT THEN << can't backspace at load point.>>          06612000
    BEGIN                                                               06614000
                                                                        06616000
      IOQ'IO'STATUS := BACKSPACE'BOT   ;                                06618000
      DRIVER'STATE  := REQUEST'COMPLETE;                                06620000
                                                                        06622000
      RETURN;                                                           06624000
                                                                        06626000
    END;                                                                06628000
                                                                        06630000
    << *********************************** >>                           06632000
    << Set up chan pgm for backspace file. >>                           06634000
    << *********************************** >>                           06636000
                                                                        06638000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO        ;                          06640000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20          ;                          06642000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'PREV'FILE;                          06644000
                                                                        06646000
  END; << Case 8.>>                                                     06648000
$PAGE                                                                   06650000
  << ******************************** >>                                06652000
  << Rewind/Offline, function code 9. >>                                06654000
  << ******************************** >>                                06656000
                                                                        06658000
  BEGIN << Case 9.>>                                                    06660000
                                                                        06662000
    IF DIT'REWIND          AND                                          06664000
       NOT DIT'UNIT'ONLINE THEN << don't bother, its already there.>>   06666000
    BEGIN                                                               06668000
                                                                        06670000
      IOQ'IO'STATUS := GOOD'IO         ;                                06672000
      DRIVER'STATE  := REQUEST'COMPLETE;                                06674000
                                                                        06676000
      RETURN;                                                           06678000
                                                                        06680000
    END;                                                                06682000
                                                                        06684000
    << *********************************** >>                           06686000
    << Set up chan pgm for rewind/offline. >>                           06688000
    << *********************************** >>                           06690000
                                                                        06692000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO             ;                     06694000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20               ;                     06696000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'REWIND'OFFLINE;                     06698000
                                                                        06700000
  END; << Case 9.>>                                                     06702000
$PAGE                                                                   06704000
  << *************************** >>                                     06706000
  << Gap Tape, function code 10. >>                                     06708000
  << *************************** >>                                     06710000
                                                                        06712000
  BEGIN << Case 10.>>                                                   06714000
                                                                        06716000
    << *********************************** >>                           06718000
    << Set up chan pgm for write tape gap. >>                           06720000
    << *********************************** >>                           06722000
                                                                        06724000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO       ;                           06726000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20         ;                           06728000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'GAP'TAPE;                           06730000
                                                                        06732000
  END; << Case 10.>>                                                    06734000
$PAGE                                                                   06736000
  << *************************************** >>                         06738000
  << Forward Space Record, function code 11. >>                         06740000
  << *************************************** >>                         06742000
                                                                        06744000
  BEGIN << Case 11.>>                                                   06746000
                                                                        06748000
    EOFCHECK (P'IOQ, 0D, 0, 0); << Check for forward space >>           06750000
                                << past EOF allowed.       >>           06752000
    IF <> THEN << EOF, forward space not allowed.>>                     06754000
    BEGIN                                                               06756000
                                                                        06758000
      DRIVER'STATE := REQUEST'COMPLETE;                                 06760000
                                                                        06762000
      RETURN;                                                           06764000
                                                                        06766000
    END;                                                                06768000
                                                                        06770000
    << ***************************************** >>                     06772000
    << Set up chan pgm for forward space record. >>                     06774000
    << ***************************************** >>                     06776000
                                                                        06778000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO          ;                        06780000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20            ;                        06782000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'NEXT'RECORD;                        06784000
                                                                        06786000
  END; << Case 11.>>                                                    06788000
$PAGE                                                                   06790000
  << *********************************** >>                             06792000
  << Backspace Record, function code 12. >>                             06794000
  << *********************************** >>                             06796000
                                                                        06798000
  BEGIN << Case 12.>>                                                   06800000
                                                                        06802000
    EOFCHECK (P'IOQ, 0D, 0, 0); << Check for backspace >>               06804000
                                << past EOF allowed.   >>               06806000
    IF <> THEN << EOF, backspace not allowed.>>                         06808000
    BEGIN                                                               06810000
                                                                        06812000
      DRIVER'STATE := REQUEST'COMPLETE;                                 06814000
                                                                        06816000
      RETURN;                                                           06818000
                                                                        06820000
    END;                                                                06822000
                                                                        06824000
    IF DIT'LOAD'POINT THEN << can't issue backspace at load point.>>    06826000
    BEGIN                                                               06828000
                                                                        06830000
      IOQ'IO'STATUS := BACKSPACE'BOT   ;                                06832000
      DRIVER'STATE  := REQUEST'COMPLETE;                                06834000
                                                                        06836000
      RETURN;                                                           06838000
                                                                        06840000
    END;                                                                06842000
                                                                        06844000
    << ************************************* >>                         06846000
    << Set up chan pgm for backspace record. >>                         06848000
    << ************************************* >>                         06850000
                                                                        06852000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO          ;                        06854000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20            ;                        06856000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'PREV'RECORD;                        06858000
                                                                        06860000
  END; << Case 12.>>                                                    06862000
$PAGE                                                                   06864000
  << *********** >>                                                     06866000
  << Dummy Case. >>                                                     06868000
  << *********** >>                                                     06870000
                                                                        06872000
  BEGIN << Case 13.>>                                                   06874000
                                                                        06876000
    << Not referenced.>>                                                06878000
                                                                        06880000
    << This is a dummy case.  Function code 13 is used by the >>        06882000
    << 7976 for a read backwards request.  This driver does   >>        06884000
    << not support the read backwards function.  This case is >>        06886000
    << here only as a place holder.                           >>        06888000
                                                                        06890000
    ;                                                                   06892000
                                                                        06894000
  END; << Case 13.>>                                                    06896000
$PAGE                                                                   06898000
  << **************************************** >>                        06900000
  << Actual Transfer Count, function code 14. >>                        06902000
  << **************************************** >>                        06904000
                                                                        06906000
  BEGIN << Case 14.>>                                                   06908000
                                                                        06910000
    IF TRANSFER'COUNT < 2 THEN << invalid.>>                            06912000
    BEGIN                                                               06914000
                                                                        06916000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                06918000
      DRIVER'STATE  := REQUEST'COMPLETE;                                06920000
                                                                        06922000
      RETURN;                                                           06924000
                                                                        06926000
    END;                                                                06928000
                                                                        06930000
    TOS := BUF'BANK'ADR;                                                06932000
    TOS := IP'CHAN'PGM (CACT'CNT);                                      06934000
    ASSEMBLE (SSEA);     << Store single word from S into         >>    06936000
                         << the address from S-1 (buffer address) >>    06938000
                         << and S-2 (bank).                       >>    06940000
    DDEL;                << Clean up our stack.>>                       06942000
                                                                        06944000
    GO TO NO'ERROR;                                                     06946000
                                                                        06948000
  END; << Case 14.>>                                                    06950000
$PAGE                                                                   06952000
  << ********************************* >>                               06954000
  << Generic Status, function code 15. >>                               06956000
  << ********************************* >>                               06958000
                                                                        06960000
  << ********************************************************* >>       06962000
  << This request returns generic status of the prior request. >>       06964000
  << ********************************************************* >>       06966000
                                                                        06968000
  BEGIN << Case 15.>>                                                   06970000
                                                                        06972000
    IF TRANSFER'COUNT < 2 THEN << invalid.>>                            06974000
    BEGIN                                                               06976000
                                                                        06978000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                06980000
      DRIVER'STATE  := REQUEST'COMPLETE;                                06982000
                                                                        06984000
      RETURN;                                                           06986000
                                                                        06988000
    END;                                                                06990000
                                                                        06992000
    IF TRANSFER'COUNT > 2 THEN << set maximum byte count.>>             06994000
                                                                        06996000
       TRANSFER'COUNT := 2;                                             06998000
                                                                        07000000
    GENERIC'STATUS := ZERO;                                             07002000
                                                                        07004000
    << ************ >>                                                  07006000
    << Fatal error. >>                                                  07008000
    << ************ >>                                                  07010000
                                                                        07012000
    IF DIT'TAPE'RUNAWAY THEN                                            07014000
                                                                        07016000
      GS'FATAL'ERROR := 1                                               07018000
                                                                        07020000
    ELSE                                                                07022000
                                                                        07024000
    IF DIT'UNRECOVERED'ERR THEN                                         07026000
                                                                        07028000
      GS'FATAL'ERROR := 2                                               07030000
                                                                        07032000
    ELSE                                                                07034000
                                                                        07036000
    IF DIT'TIMING'ERROR THEN                                            07038000
                                                                        07040000
      GS'FATAL'ERROR := 3                                               07042000
                                                                        07044000
    ELSE                                                                07046000
                                                                        07048000
    IF DIT'CMD'REJECT THEN                                              07050000
                                                                        07052000
      GS'FATAL'ERROR := 4                                               07054000
                                                                        07056000
    ELSE                                                                07058000
                                                                        07060000
    IF NOT (DIT'UNIT'FAILURE = ZERO) THEN                               07062000
                                                                        07064000
      GS'FATAL'ERROR := 5                                               07066000
                                                                        07068000
    ELSE                                                                07070000
                                                                        07072000
    IF DIT'DATA'PARITY THEN                                             07074000
                                                                        07076000
      GS'FATAL'ERROR := 6                                               07078000
                                                                        07080000
    ELSE                                                                07082000
                                                                        07084000
    IF DIT'CMD'PARITY THEN                                              07086000
                                                                        07088000
      GS'FATAL'ERROR := 7;                                              07090000
                                                                        07092000
    << ******** >>                                                      07094000
    << Density. >>                                                      07096000
    << ******** >>                                                      07098000
                                                                        07100000
    IF DIT'800'DENSITY THEN                                             07102000
                                                                        07104000
      GS'DENSITY := 1                                                   07106000
                                                                        07108000
    ELSE                                                                07110000
                                                                        07112000
    IF DIT'1600'DENSITY THEN                                            07114000
                                                                        07116000
      GS'DENSITY := 2                                                   07118000
                                                                        07120000
    ELSE                                                                07122000
                                                                        07124000
    IF DIT'6250'DENSITY THEN                                            07126000
                                                                        07128000
      GS'DENSITY := 3;                                                  07130000
                                                                        07132000
    << ************ >>                                                  07134000
    << Unit number. >>                                                  07136000
    << ************ >>                                                  07138000
                                                                        07140000
    GS'UNIT'NUMBER := ZERO;                                             07142000
                                                                        07144000
    << ************ >>                                                  07146000
    << End of file. >>                                                  07148000
    << ************ >>                                                  07150000
                                                                        07152000
    IF DIT'END'OF'FILE THEN                                             07154000
                                                                        07156000
      GS'END'OF'FILE := TRUE;                                           07158000
                                                                        07160000
    << *********** >>                                                   07162000
    << Load point. >>                                                   07164000
    << *********** >>                                                   07166000
                                                                        07168000
    IF DIT'LOAD'POINT THEN                                              07170000
                                                                        07172000
      GS'LOAD'POINT := TRUE;                                            07174000
                                                                        07176000
    << ************ >>                                                  07178000
    << End of tape. >>                                                  07180000
    << ************ >>                                                  07182000
                                                                        07184000
    IF DIT'END'OF'TAPE THEN                                             07186000
                                                                        07188000
      GS'END'OF'TAPE := TRUE;                                           07190000
                                                                        07192000
    << ***************** >>                                             07194000
    << Immediate report. >>                                             07196000
    << ***************** >>                                             07198000
                                                                        07200000
    IF DIT'IMMED'RPT'ENABLE THEN                                        07202000
                                                                        07204000
      GS'IMMED'RPT'ENABLE := TRUE;                                      07206000
                                                                        07208000
    << **************** >>                                              07210000
    << Recovered error. >>                                              07212000
    << **************** >>                                              07214000
                                                                        07216000
    IF DIT'RECOVERED'ERR THEN                                           07218000
                                                                        07220000
      GS'RECOVERED'ERROR := TRUE;                                       07222000
                                                                        07224000
    << ************ >>                                                  07226000
    << Unit online. >>                                                  07228000
    << ************ >>                                                  07230000
                                                                        07232000
    IF DIT'UNIT'ONLINE THEN                                             07234000
                                                                        07236000
      GS'UNIT'ONLINE := TRUE;                                           07238000
                                                                        07240000
    << ************* >>                                                 07242000
    << File protect. >>                                                 07244000
    << ************* >>                                                 07246000
                                                                        07248000
    IF DIT'FILE'PROTECT THEN                                            07250000
                                                                        07252000
      GS'FILE'PROTECT := TRUE;                                          07254000
                                                                        07256000
    << ************************************** >>                        07258000
    << Put generic status into user's buffer. >>                        07260000
    << ************************************** >>                        07262000
                                                                        07264000
    TOS := BUF'BANK'ADR;   << Push address of user's buffer on TOS.>>   07266000
    TOS := GENERIC'STATUS; << Push generic status on TOS.          >>   07268000
    ASSEMBLE (SSEA);       << Put generic status into buffer.      >>   07270000
    DDEL;                  << Clean up our stack.>>                     07272000
                                                                        07274000
    IOQ'IO'STATUS := GOOD'IO         ;                                  07276000
    DRIVER'STATE  := REQUEST'COMPLETE;                                  07278000
                                                                        07280000
    RETURN;                                                             07282000
                                                                        07284000
  END; << Case 15.>>                                                    07286000
$PAGE                                                                   07288000
  << ****************************** >>                                  07290000
  << Set Density, function code 16. >>                                  07292000
  << ****************************** >>                                  07294000
                                                                        07296000
  BEGIN << Case 16.>>                                                   07298000
                                                                        07300000
    << ******************************** >>                              07302000
    << Set up chan pgm for set density. >>                              07304000
    << ******************************** >>                              07306000
                                                                        07308000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO;                                  07310000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20  ;                                  07312000
                                                                        07314000
    IF IOQ'DENSITY = NRZI'800 THEN                                      07316000
                                                                        07318000
      IP'CHAN'PGM (CTAPE'CMD) := TC'DENSITY'800                         07320000
                                                                        07322000
    ELSE                                                                07324000
                                                                        07326000
    IF IOQ'DENSITY = PE'1600 THEN                                       07328000
                                                                        07330000
      IP'CHAN'PGM (CTAPE'CMD) := TC'DENSITY'1600                        07332000
                                                                        07334000
    ELSE                                                                07336000
                                                                        07338000
    IF IOQ'DENSITY = GCR'6250 THEN                                      07340000
                                                                        07342000
      IP'CHAN'PGM (CTAPE'CMD) := TC'DENSITY'6250                        07344000
                                                                        07346000
    ELSE << what are they trying to do?>>                               07348000
    BEGIN                                                               07350000
                                                                        07352000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                07354000
      DRIVER'STATE  := REQUEST'COMPLETE;                                07356000
                                                                        07358000
      RETURN;                                                           07360000
                                                                        07362000
    END;                                                                07364000
                                                                        07366000
  END; << Case 16.>>                                                    07368000
$PAGE                                                                   07370000
  << *********** >>                                                     07372000
  << Dummy Case. >>                                                     07374000
  << *********** >>                                                     07376000
                                                                        07378000
  BEGIN << Case 17.>>                                                   07380000
                                                                        07382000
    << Not referenced.>>                                                07384000
                                                                        07386000
    << This is a dummy case.  Function code 17 is the download >>       07388000
    << diagnostic monitor for the 7976.  This driver does not  >>       07390000
    << support this function (the monitor is resident in the   >>       07392000
    << device).  This case is here only as a place holder.     >>       07394000
                                                                        07396000
    ;                                                                   07398000
                                                                        07400000
  END; << Case 17.>>                                                    07402000
$PAGE                                                                   07404000
  << ************************************** >>                          07406000
  << Download Diagnostic, function code 18. >>                          07408000
  << ************************************** >>                          07410000
                                                                        07412000
  BEGIN << Case 18.>>                                                   07414000
                                                                        07416000
    IF TRANSFER'COUNT > 514 THEN << set maximum transfer count.>>       07418000
                                                                        07420000
      TRANSFER'COUNT := 514;                                            07422000
                                                                        07424000
    << ********************************** >>                            07426000
    << Set up chan pgm for download diag. >>                            07428000
    << ********************************** >>                            07430000
                                                                        07432000
    IP'CHAN'PGM (CSTART'JVEC ) := 92            ;                       07434000
    IP'CHAN'PGM (CWR'EXEC    ) := %2004         ;                       07436000
    IP'CHAN'PGM (CWR'BYTE'CNT) := TRANSFER'COUNT;                       07438000
    IP'CHAN'PGM (CWR'BANK    ) := BUF'BANK      ;                       07440000
    IP'CHAN'PGM (CWR'ADR     ) := BUF'ADR       ;                       07442000
    IP'CHAN'PGM (CWR'DSJ0    ) := -72           ;                       07444000
    IP'CHAN'PGM (CWR'DSJ1    ) := -60           ;                       07446000
    IP'CHAN'PGM (CWR'DSJ2    ) := -60           ;                       07448000
    IP'CHAN'PGM (CTAPE'CMD   ) := TC'WRITE      ;                       07450000
                                                                        07452000
  END; << Case 18.>>                                                    07454000
$PAGE                                                                   07456000
  << ***************************************** >>                       07458000
  << Read Diagnostic Status, function code 19. >>                       07460000
  << ***************************************** >>                       07462000
                                                                        07464000
  BEGIN << Case 19.>>                                                   07466000
                                                                        07468000
    << ************************************* >>                         07470000
    << Set up chan pgm for read diag status. >>                         07472000
    << ************************************* >>                         07474000
                                                                        07476000
    IP'CHAN'PGM (CSTART'JVEC ) := 12            ;                       07478000
    IP'CHAN'PGM (CRD'EXEC    ) := %1403         ;                       07480000
    IP'CHAN'PGM (CRD'BYTE'CNT) := TRANSFER'COUNT;                       07482000
    IP'CHAN'PGM (CRD'BANK    ) := BUF'BANK      ;                       07484000
    IP'CHAN'PGM (CRD'ADR     ) := BUF'ADR       ;                       07486000
    IP'CHAN'PGM (CDIAG'JUMP  ) := ZERO          ;                       07488000
    IP'CHAN'PGM (CDIAG'JVEC  ) := 13            ;                       07490000
    IP'CHAN'PGM (CTAPE'CMD   ) := TC'READ       ;                       07492000
                                                                        07494000
  END; << Case 19.>>                                                    07496000
$PAGE                                                                   07498000
  << *************************** >>                                     07500000
  << Loopback, function code 20. >>                                     07502000
  << *************************** >>                                     07504000
                                                                        07506000
  BEGIN << Case 20.>>                                                   07508000
                                                                        07510000
    << ***************************** >>                                 07512000
    << Set up chan pgm for loopback. >>                                 07514000
    << ***************************** >>                                 07516000
                                                                        07518000
    IP'CHAN'PGM (CSTART'JVEC ) := 92            ;                       07520000
    IP'CHAN'PGM (CRD'EXEC    ) := %3416         ;                       07522000
    IP'CHAN'PGM (CRD'BYTE'CNT) := TRANSFER'COUNT;                       07524000
    IP'CHAN'PGM (CRD'BANK    ) := BUF'BANK      ;                       07526000
    IP'CHAN'PGM (CRD'ADR     ) := BUF'ADR       ;                       07528000
    IP'CHAN'PGM (CLOOP'JUMP  ) := ZERO          ;                       07530000
    IP'CHAN'PGM (CLOOP'JVEC  ) := 18            ;                       07532000
    IP'CHAN'PGM (CWR'EXEC    ) := %4016         ;                       07534000
    IP'CHAN'PGM (CWR'BYTE'CNT) := TRANSFER'COUNT;                       07536000
    IP'CHAN'PGM (CWR'BANK    ) := BUF'BANK      ;                       07538000
    IP'CHAN'PGM (CWR'ADR     ) := BUF'ADR       ;                       07540000
    IP'CHAN'PGM (CWR'DSJ0    ) := -92           ;                       07542000
    IP'CHAN'PGM (CWR'DSJ1    ) := -92           ;                       07544000
    IP'CHAN'PGM (CWR'DSJ2    ) := -92           ;                       07546000
                                                                        07548000
  END; << Case 20.>>                                                    07550000
$PAGE                                                                   07552000
  << *************************** >>                                     07554000
  << Selftest, function code 21. >>                                     07556000
  << *************************** >>                                     07558000
                                                                        07560000
  BEGIN << Case 21.>>                                                   07562000
                                                                        07564000
    IF TRANSFER'COUNT < 1 THEN << invalid.>>                            07566000
    BEGIN                                                               07568000
                                                                        07570000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                07572000
      DRIVER'STATE  := REQUEST'COMPLETE;                                07574000
                                                                        07576000
      RETURN;                                                           07578000
                                                                        07580000
    END;                                                                07582000
                                                                        07584000
    << ***************************** >>                                 07586000
    << Set up chan pgm for selftest. >>                                 07588000
    << ***************************** >>                                 07590000
                                                                        07592000
    IP'CHAN'PGM (CSTART'JVEC ) := 92      ;                             07594000
    IP'CHAN'PGM (CRD'EXEC    ) := %3417   ;                             07596000
    IP'CHAN'PGM (CRD'BYTE'CNT) := 2       ;                             07598000
    IP'CHAN'PGM (CRD'BANK    ) := BUF'BANK;                             07600000
    IP'CHAN'PGM (CRD'ADR     ) := BUF'ADR ;                             07602000
    IP'CHAN'PGM (CTEST'JUMP  ) := ZERO    ;                             07604000
    IP'CHAN'PGM (CTEST'JVEC  ) := 23      ;                             07606000
    IP'CHAN'PGM (CWR'EXEC    ) := %4017   ;                             07608000
    IP'CHAN'PGM (CWR'BYTE'CNT) := 1       ;                             07610000
    IP'CHAN'PGM (CWR'BANK    ) := BUF'BANK + %40000; << Right byte.>>   07612000
    IP'CHAN'PGM (CWR'ADR     ) := BUF'ADR ;                             07614000
    IP'CHAN'PGM (CWR'DSJ0    ) := -92     ;                             07616000
    IP'CHAN'PGM (CWR'DSJ1    ) := -92     ;                             07618000
    IP'CHAN'PGM (CWR'DSJ2    ) := -92     ;                             07620000
                                                                        07622000
  END; << Case 21.>>                                                    07624000
$PAGE                                                                   07626000
  << ********************************* >>                               07628000
  << End Diagnostic, function code 22. >>                               07630000
  << ********************************* >>                               07632000
                                                                        07634000
  BEGIN << Case 22.>>                                                   07636000
                                                                        07638000
    << ***************************** >>                                 07640000
    << Set up chan pgm for end diag. >>                                 07642000
    << ***************************** >>                                 07644000
                                                                        07646000
    IP'CHAN'PGM (CSTART'JVEC   ) := 111 ;                               07648000
    IP'CHAN'PGM (CEND'DIAG     ) := %601;                               07650000
    IP'CHAN'PGM (CEND'DIAG'CODE) := ZERO;                               07652000
                                                                        07654000
  END; << Case 22.>>                                                    07656000
$PAGE                                                                   07658000
  << *************************** >>                                     07660000
  << Identify, function code 23. >>                                     07662000
  << *************************** >>                                     07664000
                                                                        07666000
  BEGIN << Case 23.>>                                                   07668000
                                                                        07670000
    IF TRANSFER'COUNT < 2 THEN << invalid.>>                            07672000
    BEGIN                                                               07674000
                                                                        07676000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                07678000
      DRIVER'STATE  := REQUEST'COMPLETE;                                07680000
                                                                        07682000
      RETURN;                                                           07684000
                                                                        07686000
    END;                                                                07688000
                                                                        07690000
    << ***************************** >>                                 07692000
    << Set up chan pgm for identify. >>                                 07694000
    << ***************************** >>                                 07696000
                                                                        07698000
    IP'CHAN'PGM (CSTART'JVEC) := 80   ;                                 07700000
    IP'CHAN'PGM (CIDENTIFY  ) := %3000;                                 07702000
    IP'CHAN'PGM (CIDENT'CODE) := ZERO ;                                 07704000
    IP'CHAN'PGM (CIDENT'JVEC) := 3    ;                                 07706000
    IP'CHAN'PGM (CIDENT'DSJ0) := -60  ;                                 07708000
                                                                        07710000
  END; << Case 23.>>                                                    07712000
$PAGE                                                                   07714000
  << ******************************* >>                                 07716000
  << Speed Select, function code 24. >>                                 07718000
  << ******************************* >>                                 07720000
                                                                        07722000
  BEGIN << Case 24.>>                                                   07724000
                                                                        07726000
    << ********************************* >>                             07728000
    << Set up chan pgm for speed select. >>                             07730000
    << ********************************* >>                             07732000
                                                                        07734000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO;                                  07736000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20  ;                                  07738000
                                                                        07740000
    IF IOQ'PARM'2 = START'STOP THEN                                     07742000
                                                                        07744000
      IP'CHAN'PGM (CTAPE'CMD) := TC'START'STOP                          07746000
                                                                        07748000
    ELSE                                                                07750000
                                                                        07752000
    IF IOQ'PARM'2 = STREAM THEN                                         07754000
                                                                        07756000
      IP'CHAN'PGM (CTAPE'CMD) := TC'STREAM                              07758000
                                                                        07760000
    ELSE << what are they trying to do?>>                               07762000
    BEGIN                                                               07764000
                                                                        07766000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                07768000
      DRIVER'STATE  := REQUEST'COMPLETE;                                07770000
                                                                        07772000
      RETURN;                                                           07774000
                                                                        07776000
    END;                                                                07778000
                                                                        07780000
  END; << Case 24.>>                                                    07782000
$PAGE                                                                   07784000
  << ******************************** >>                                07786000
  << Device Status, function code 25. >>                                07788000
  << ******************************** >>                                07790000
                                                                        07792000
  << ******************************************************* >>         07794000
  << This request returns device status of the last request. >>         07796000
  << ******************************************************* >>         07798000
                                                                        07800000
  BEGIN << Case 25.>>                                                   07802000
                                                                        07804000
    IF TRANSFER'COUNT < 2 THEN << don't issue request.>>                07806000
    BEGIN                                                               07808000
                                                                        07810000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                07812000
      DRIVER'STATE  := REQUEST'COMPLETE;                                07814000
                                                                        07816000
      RETURN;                                                           07818000
                                                                        07820000
    END;                                                                07822000
                                                                        07824000
    TOS := BUF'BANK'ADR; << Push buffer address on TOS.   >>            07826000
    TOS := IP'CHAN'PGM (CDEVSTAT1);                                     07828000
                         << Push 1st status word on TOS.  >>            07830000
    ASSEMBLE (SSEA);     << Put 1st status word in buffer.>>            07832000
                                                                        07834000
    IOQ'TRANSFER'COUNT := -2;                                           07836000
                                                                        07838000
    IF TRANSFER'COUNT > 2 THEN                                          07840000
    BEGIN                                                               07842000
                                                                        07844000
      TOS := TOS + 1;  << Increment buffer address.     >>              07846000
      TOS := IP'CHAN'PGM (CDEVSTAT2);                                   07848000
                       << Push 2nd status word on TOS.  >>              07850000
      ASSEMBLE (SSEA); << Put 2nd status word in buffer.>>              07852000
                                                                        07854000
      IOQ'TRANSFER'COUNT := -4;                                         07856000
                                                                        07858000
    END;                                                                07860000
                                                                        07862000
    IF TRANSFER'COUNT > 4 THEN                                          07864000
    BEGIN                                                               07866000
                                                                        07868000
      TOS := TOS + 1;  << Increment buffer address.     >>              07870000
      TOS := IP'CHAN'PGM (CDEVSTAT3);                                   07872000
                       << Push 3rd status word on TOS.  >>              07874000
      ASSEMBLE (SSEA); << Put 3rd status word in buffer.>>              07876000
                                                                        07878000
      IOQ'TRANSFER'COUNT := -6;                                         07880000
                                                                        07882000
    END;                                                                07884000
                                                                        07886000
    DDEL; << clean up stack.>>                                          07888000
                                                                        07890000
    IOQ'IO'STATUS := GOOD'IO         ;                                  07892000
    DRIVER'STATE  := REQUEST'COMPLETE;                                  07894000
                                                                        07896000
    RETURN;                                                             07898000
                                                                        07900000
  END; << Case 25.>>                                                    07902000
$PAGE                                                                   07904000
  << ************************************ >>                            07906000
  << Read internal log, function code 26. >>                            07908000
  << ************************************ >>                            07910000
                                                                        07912000
  BEGIN << Case 26.>>                                                   07914000
                                                                        07916000
    IF TRANSFER'COUNT < 4213 THEN << invalid request.>>                 07918000
    BEGIN                                                               07920000
                                                                        07922000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                07924000
      DRIVER'STATE  := REQUEST'COMPLETE;                                07926000
                                                                        07928000
      RETURN;                                                           07930000
                                                                        07932000
    END;                                                                07934000
                                                                        07936000
    << ************************************ >>                          07938000
    << Set up chan pgm for read status log. >>                          07940000
    << ************************************ >>                          07942000
                                                                        07944000
    IP'CHAN'PGM (CSTART'JVEC ) := 12      ;                             07946000
    IP'CHAN'PGM (CRD'EXEC    ) := %1405   ;                             07948000
    IP'CHAN'PGM (CRD'BYTE'CNT) := 4213    ;                             07950000
    IP'CHAN'PGM (CRD'BANK    ) := BUF'BANK;                             07952000
    IP'CHAN'PGM (CRD'ADR     ) := BUF'ADR ;                             07954000
    IP'CHAN'PGM (CLOG'JUMP   ) := ZERO    ;                             07956000
    IP'CHAN'PGM (CLOG'JVEC   ) := 23      ;                             07958000
                                                                        07960000
  END; << Case 26.>>                                                    07962000
$PAGE                                                                   07964000
  << ********************************* >>                               07966000
  << Write firmware, function code 27. >>                               07968000
  << ********************************* >>                               07970000
                                                                        07972000
  BEGIN << Case 27.>>                                                   07974000
                                                                        07976000
    << *********************************** >>                           07978000
    << Set up chan pgm for write firmware. >>                           07980000
    << *********************************** >>                           07982000
                                                                        07984000
    IP'CHAN'PGM (CSTART'JVEC ) := 92            ;                       07986000
    IP'CHAN'PGM (CWR'EXEC    ) := %2006         ;                       07988000
    IP'CHAN'PGM (CWR'BYTE'CNT) := TRANSFER'COUNT;                       07990000
    IP'CHAN'PGM (CWR'BANK    ) := BUF'BANK      ;                       07992000
    IP'CHAN'PGM (CWR'ADR     ) := BUF'ADR       ;                       07994000
    IP'CHAN'PGM (CWR'DSJ0    ) := -72           ;                       07996000
    IP'CHAN'PGM (CWR'DSJ1    ) := -60           ;                       07998000
    IP'CHAN'PGM (CWR'DSJ2    ) := -60           ;                       08000000
                                                                        08002000
  END; << Case 27.>>                                                    08004000
$PAGE                                                                   08006000
  << *************************************** >>                         08008000
  << Read firmware update, function code 28. >>                         08010000
  << *************************************** >>                         08012000
                                                                        08014000
  BEGIN << Case 28.>>                                                   08016000
                                                                        08018000
    << ********************************** >>                            08020000
    << Set up chan pgm for read firmware. >>                            08022000
    << ********************************** >>                            08024000
                                                                        08026000
    IP'CHAN'PGM (CSTART'JVEC ) := 12            ;                       08028000
    IP'CHAN'PGM (CRD'EXEC    ) := %1406         ;                       08030000
    IP'CHAN'PGM (CRD'BYTE'CNT) := TRANSFER'COUNT;                       08032000
    IP'CHAN'PGM (CRD'BANK    ) := BUF'BANK      ;                       08034000
    IP'CHAN'PGM (CRD'ADR     ) := BUF'ADR       ;                       08036000
    IP'CHAN'PGM (CFIRM'JUMP  ) := 0             ;                       08038000
    IP'CHAN'PGM (CFIRM'JVEC  ) := 23            ;                       08040000
                                                                        08042000
  END; << Case 28.>>                                                    08044000
$PAGE                                                                   08046000
  << *********************************** >>                             08048000
  << Immediate Report, function code 29. >>                             08050000
  << *********************************** >>                             08052000
                                                                        08054000
  BEGIN << Case 29.>>                                                   08056000
                                                                        08058000
    << ************************************* >>                         08060000
    << Set up chan pgm for immediate report. >>                         08062000
    << ************************************* >>                         08064000
                                                                        08066000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO;                                  08068000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20  ;                                  08070000
                                                                        08072000
    IF IOQ'PARM'2 = DISABLE'IMMED'RPT THEN                              08074000
                                                                        08076000
      IP'CHAN'PGM (CTAPE'CMD) := TC'DISABLE'IMMED                       08078000
                                                                        08080000
    ELSE                                                                08082000
                                                                        08084000
    IF IOQ'PARM'2 = ENABLE'IMMED'RPT THEN                               08086000
                                                                        08088000
      IP'CHAN'PGM (CTAPE'CMD) := TC'ENABLE'IMMED                        08090000
                                                                        08092000
    ELSE << what are they trying to do?>>                               08094000
    BEGIN                                                               08096000
                                                                        08098000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                08100000
      DRIVER'STATE  := REQUEST'COMPLETE;                                08102000
                                                                        08104000
      RETURN;                                                           08106000
                                                                        08108000
    END;                                                                08110000
                                                                        08112000
  END; << Case 29.>>                                                    08114000
$PAGE                                                                   08116000
  << ************************************ >>                            08118000
  << Get Device Status, function code 30. >>                            08120000
  << ************************************ >>                            08122000
                                                                        08124000
  << *********************************************** >>                 08126000
  << This request returns the current device status. >>                 08128000
  << *********************************************** >>                 08130000
                                                                        08132000
  BEGIN << Case 30.>>                                                   08134000
                                                                        08136000
    IF TRANSFER'COUNT < 2 THEN << don't issue request.>>                08138000
    BEGIN                                                               08140000
                                                                        08142000
      IOQ'IO'STATUS := INVALID'REQUEST ;                                08144000
      DRIVER'STATE  := REQUEST'COMPLETE;                                08146000
                                                                        08148000
      RETURN;                                                           08150000
                                                                        08152000
    END;                                                                08154000
                                                                        08156000
    << ************************************** >>                        08158000
    << Set up chan pgm for get device status. >>                        08160000
    << ************************************** >>                        08162000
                                                                        08164000
    IP'CHAN'PGM (CSTART'JVEC) := ZERO         ;                         08166000
    IP'CHAN'PGM (CCMD'DSJ0  ) := 20           ;                         08168000
    IP'CHAN'PGM (CTAPE'CMD  ) := TC'DEV'STATUS;                         08170000
                                                                        08172000
  END; << Case 30.>>                                                    08174000
$PAGE                                                                   08176000
  << ******************************* >>                                 08178000
  << Device clear, function code 31. >>                                 08180000
  << ******************************* >>                                 08182000
                                                                        08184000
  BEGIN << Case 31.>>                                                   08186000
                                                                        08188000
    << ********************************* >>                             08190000
    << Set up chan pgm for device clear. >>                             08192000
    << ********************************* >>                             08194000
                                                                        08196000
    IP'CHAN'PGM (CSTART'JVEC) := 99   ;                                 08198000
    IP'CHAN'PGM (CWR'DSJ0   ) := ZERO ;                                 08200000
    IP'CHAN'PGM (CWR'DSJ1   ) := ZERO ;                                 08202000
    IP'CHAN'PGM (CWR'DSJ2   ) := ZERO ;                                 08204000
    IP'CHAN'PGM (CCLEAR     ) := %4400;                                 08206000
    IP'CHAN'PGM (CCLEAR'WD2 ) := ZERO ;                                 08208000
    IP'CHAN'PGM (CCLEAR'JUMP) := ZERO ;                                 08210000
    IP'CHAN'PGM (CCLEAR'JVEC) := 1    ;                                 08212000
    IP'CHAN'PGM (CCLEAR'DSJ ) := %2402;                                 08214000
                                                                        08216000
  END; << Case 31.>>                                                    08218000
                                                                        08220000
END;                                                                    08222000
$PAGE                                                                   08224000
<< ********************** >>                                            08226000
<<                        >>                                            08228000
<< START CHANNEL PROGRAM. >>                                            08230000
<<                        >>                                            08232000
<< ********************** >>                                            08234000
                                                                        08236000
                                                                        08238000
START'CHAN'PGM:                                                         08240000
                                                                        08242000
                                                                        08244000
START'HPIB (P'DIT, P'CHAN'PGM, TRUE);                                   08246000
                                                                        08248000
IF < THEN << channel program failed to start.>>                         08250000
BEGIN                                                                   08252000
                                                                        08254000
  MASTERCLEARHPIB (P'DIT); << Halt channel program.>>                   08256000
                                                                        08258000
  IOQ'IO'STATUS := CHAN'PGM'FAILURE;                                    08260000
  DRIVER'STATE  := REQUEST'COMPLETE;                                    08262000
                                                                        08264000
  RETURN;                                                               08266000
                                                                        08268000
END;                                                                    08270000
                                                                        08272000
P'CP'VAR'AREA := ZERO          ; << Reset.>>                            08274000
DIT'REWIND    := ZERO          ; <<   "  .>>                            08276000
DRIVER'STATE  := INTERRUPT'WAIT;                                        08278000
                                                                        08280000
IF IOQ'BACKSPACE'EOF THEN  << status already set.>>                     08282000
                                                                        08284000
  RETURN;                                                               08286000
                                                                        08288000
IOQ'IO'STATUS := COMPLETION'WAIT;                                       08290000
                                                                        08292000
RETURN;                                                                 08294000
                                                                        08296000
$PAGE                                                                   08298000
<< ***************** >>                                                 08300000
<<                   >>                                                 08302000
<< Complete Request. >>                                                 08304000
<<                   >>                                                 08306000
<< ***************** >>                                                 08308000
                                                                        08310000
                                                                        08312000
COMPLETE'REQUEST:                                                       08314000
                                                                        08316000
<< ******************************** >>                                  08318000
<< Delayed channel program failure? >>                                  08320000
<< ******************************** >>                                  08322000
                                                                        08324000
IF IOQ'DELAY'CP'FAIL THEN << delayed channel program failure.>>         08326000
BEGIN                                                                   08328000
                                                                        08330000
  MASTERCLEARHPIB (P'DIT); << Halt channel program.>>                   08332000
                                                                        08334000
  IOQ'IO'STATUS := CHAN'PGM'FAILURE;                                    08336000
  DRIVER'STATE  := REQUEST'COMPLETE;                                    08338000
                                                                        08340000
  RETURN;                                                               08342000
                                                                        08344000
END;                                                                    08346000
                                                                        08348000
<< **************** >>                                                  08350000
<< Channel Failure? >>                                                  08352000
<< **************** >>                                                  08354000
                                                                        08356000
IF CPVA'ERROR'CODE > 5 THEN << DMA failure (value 6) or    >>           08358000
BEGIN                       << execution failure (value 7).>>           08360000
                                                                        08362000
  MASTERCLEARHPIB (P'DIT); << Halt channel program.>>                   08364000
                                                                        08366000
  << Log failure information. >>                                        08368000
                                                                        08370000
  DIT'ERROR'STATUS := [8/3, 8/DIT'ERR'LOG'INDEX];                       08372000
  DIT'DEV'STAT1    := P'CP'VAR'AREA;                                    08374000
  DIT'DEV'STAT2    := ((GETDRT (DRTN, 0)) - @P'CHAN'PGM) - 1000;        08376000
  DIT'DEV'STAT3    := ZERO;                                             08378000
                                                                        08380000
  IOQ'IO'STATUS := CHAN'IO'FAILURE ;                                    08382000
  DRIVER'STATE  := REQUEST'COMPLETE;                                    08384000
                                                                        08386000
  RETURN;                                                               08388000
                                                                        08390000
END;                                                                    08392000
                                                                        08394000
<< ***************** >>                                                 08396000
<< Device powerfail? >>                                                 08398000
<< ***************** >>                                                 08400000
                                                                        08402000
IF CP'POWERED'UP      AND                                               08404000
   NOT CP'UNIT'ONLINE THEN << device has powerfailed.>>                 08406000
BEGIN                                                                   08408000
                                                                        08410000
  MASTERCLEARHPIB (P'DIT); << Halt channel program.>>                   08412000
                                                                        08414000
  IOQ'IO'STATUS := POWER'UP        ;                                    08416000
  DRIVER'STATE  := REQUEST'COMPLETE;                                    08418000
                                                                        08420000
  RETURN;                                                               08422000
                                                                        08424000
END;                                                                    08426000
                                                                        08428000
<< ****************** >>                                                08430000
<< Log device status. >>                                                08432000
<< ****************** >>                                                08434000
                                                                        08436000
DIT'STATUS'WORD := IP'CHAN'PGM (CDEVSTAT1);                             08438000
DIT'DEV'STAT1   := IP'CHAN'PGM (CDEVSTAT1);                             08440000
DIT'DEV'STAT2   := IP'CHAN'PGM (CDEVSTAT2);                             08442000
DIT'DEV'STAT3   := IP'CHAN'PGM (CDEVSTAT3);                             08444000
                                                                        08446000
<< *********** >>                                                       08448000
<< I/O errors? >>                                                       08450000
<< *********** >>                                                       08452000
                                                                        08454000
IF CPVA'HALT'CODE = 1 THEN << possible error has occured.>>             08456000
BEGIN                                                                   08458000
                                                                        08460000
  P'CP'VAR'AREA (CPVA'1'INDEX) := ZERO; << Reset.>>                     08462000
                                                                        08464000
  << *************** >>                                                 08466000
  << Unit not ready? >>                                                 08468000
  << *************** >>                                                 08470000
                                                                        08472000
  IF NOT CP'UNIT'ONLINE THEN                                            08474000
  BEGIN << unit is not ready.>>                                         08476000
                                                                        08478000
    IF IOQ'FUNCTION'CODE = FC'CLOSE'DEVICE THEN << who cares.>>         08480000
    BEGIN                                                               08482000
                                                                        08484000
      IOQ'IO'STATUS := GOOD'IO         ;                                08486000
      DRIVER'STATE  := REQUEST'COMPLETE;                                08488000
                                                                        08490000
      RETURN;                                                           08492000
                                                                        08494000
    END;                                                                08496000
                                                                        08498000
    IF IOMESSAGE (1, NOT'READY'MSG, %10000, DIT'LDEV,,,,, CONSOLE) THEN 08500000
    BEGIN                                                               08502000
                                                                        08504000
      IOQ'IO'STATUS := NOT'READY'WAIT;                                  08506000
      DRIVER'STATE  := OPERATOR'WAIT ;                                  08508000
                                                                        08510000
      RETURN;                                                           08512000
                                                                        08514000
    END;                                                                08516000
                                                                        08518000
    << IOMESSAGE failed.>>                                              08520000
                                                                        08522000
    MASTERCLEARHPIB (P'DIT); << Halt channel program.>>                 08524000
                                                                        08526000
    IOQ'IO'STATUS := SYSTEM'ERROR    ;                                  08528000
    DRIVER'STATE  := REQUEST'COMPLETE;                                  08530000
                                                                        08532000
    RETURN;                                                             08534000
                                                                        08536000
  END;                                                                  08538000
                                                                        08540000
  << ************** >>                                                  08542000
  << No write ring? >>                                                  08544000
  << ************** >>                                                  08546000
                                                                        08548000
  IF IOQ'FUNCTION'CODE = FC'WRITE       OR                              08550000
     IOQ'FUNCTION'CODE = FC'FILE'MARK   OR                              08552000
     IOQ'FUNCTION'CODE = FC'GAP'TAPE    OR                              08554000
     IOQ'FUNCTION'CODE = FC'SET'DENSITY THEN                            08556000
                                                                        08558000
    IF CP'LOAD'POINT THEN                                               08560000
                                                                        08562000
      IF CP'FILE'PROTECT THEN << no write ring, write disabled.>>       08564000
      BEGIN                                                             08566000
                                                                        08568000
        if IOMESSAGE (1, NO'WRITE'RING'MSG, %10000, DIT'LDEV,,,,,       08570000
                      CONSOLE) then << console message successful,>>    08572000
        BEGIN                       << start timeout.             >>    08574000
                                                                        08576000
          DIT'TIMEOUT'WORD  := ZERO; << Reset.>>                        08578000
          DIT'TIMEOUT'INDEX := TIMEREQ (%20, @P'DIT, 1000d);            08580000
                                                                        08582000
          DRIVER'STATE := INTERRUPT'WAIT;                               08584000
                                                                        08586000
          RETURN;                                                       08588000
                                                                        08590000
        END;                                                            08592000
                                                                        08594000
        << IOMESSAGE failed. >>                                         08596000
                                                                        08598000
        MASTERCLEARHPIB (P'DIT); << Halt channel program.>>             08600000
                                                                        08602000
        IOQ'IO'STATUS := SYSTEM'ERROR    ;                              08604000
        DRIVER'STATE  := REQUEST'COMPLETE;                              08606000
                                                                        08608000
        RETURN;                                                         08610000
                                                                        08612000
      END;                                                              08614000
                                                                        08616000
  << ************* >>                                                   08618000
  << Unit failure? >>                                                   08620000
  << ************* >>                                                   08622000
                                                                        08624000
  IF (CP'UNKNOWN'POSITION                         ) LOR                 08626000
     (CP'FORMATTER'ERROR                          ) LOR                 08628000
     (CP'SERVO'ERROR                              ) LOR                 08630000
     (CP'CONTROLLER'FAIL                          ) LOR                 08632000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 6 ) LOR                 08634000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 31) LOR                 08636000
     (CP'CMD'REJECT      LAND CP'CMD'REJ'CODE = 7 ) LOR                 08638000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 41) LOR                 08640000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 43) LOR                 08642000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 47) LOR                 08644000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 49) LOR                 08646000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 57) LOR                 08648000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 58) LOR                 08650000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 59) THEN                08652000
                                                                        08654000
    IOQ'IO'STATUS := UNIT'FAILURE                                       08656000
                                                                        08658000
  ELSE                                                                  08660000
                                                                        08662000
  << *************** >>                                                 08664000
  << Transfer error? >>                                                 08666000
  << *************** >>                                                 08668000
                                                                        08670000
  IF (CP'DATA'PARITY                              ) LOR                 08672000
     (CP'CMD'PARITY                               ) LOR                 08674000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 9 ) LOR                 08676000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 10) LOR                 08678000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 22) LOR                 08680000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 23) LOR                 08682000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 24) LOR                 08684000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 37) LOR                 08686000
     (CP'CMD'REJECT      LAND CP'ERROR'CODE   = 40) LOR                 08688000
     (CP'CMD'REJECT      LAND CP'CMD'REJ'CODE = 3 ) LOR                 08690000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 45) LOR                 08692000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 48) LOR                 08694000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 50) LOR                 08696000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 51) LOR                 08698000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 52) LOR                 08700000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 53) LOR                 08702000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 55) LOR                 08704000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 61) LOR                 08706000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 62) LOR                 08708000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 63) LOR                 08710000
     (CP'UNRECOVERED'ERR LAND CP'ERROR'CODE   = 64) THEN                08712000
                                                                        08714000
    IOQ'IO'STATUS := TRANSFER'ERROR                                     08716000
                                                                        08718000
  ELSE                                                                  08720000
                                                                        08722000
  << ************************ >>                                        08724000
  << Not at BOT, set density? >>                                        08726000
  << ************************ >>                                        08728000
                                                                        08730000
  IF (CP'CMD'REJECT land CP'ERROR'CODE = 16) THEN                       08732000
                                                                        08734000
    IOQ'IO'STATUS := DENSITY'ERROR                                      08736000
                                                                        08738000
  ELSE                                                                  08740000
                                                                        08742000
  << ******************************** >>                                08744000
  << Density requested not available? >>                                08746000
  << ******************************** >>                                08748000
                                                                        08750000
  IF (CP'CMD'REJECT land CP'ERROR'CODE = 7) THEN                        08752000
                                                                        08754000
    IOQ'IO'STATUS := INVALID'REQUEST                                    08756000
                                                                        08758000
  ELSE                                                                  08760000
                                                                        08762000
  << ************* >>                                                   08764000
  << Tape runaway? >>                                                   08766000
  << ************* >>                                                   08768000
                                                                        08770000
  IF CP'TAPE'RUNAWAY THEN                                               08772000
                                                                        08774000
    IOQ'IO'STATUS := TAPE'RUNAWAY                                       08776000
                                                                        08778000
  ELSE                                                                  08780000
                                                                        08782000
  << ************* >>                                                   08784000
  << Timing error? >>                                                   08786000
  << ************* >>                                                   08788000
                                                                        08790000
  IF CP'TIMING'ERROR THEN                                               08792000
                                                                        08794000
    IOQ'IO'STATUS := TIMING'ERROR                                       08796000
                                                                        08798000
  ELSE                                                                  08800000
                                                                        08802000
    << **************** >>                                              08804000
    << No errors found. >>                                              08806000
    << **************** >>                                              08808000
                                                                        08810000
    GO TO NO'ERROR;                                                     08812000
                                                                        08814000
                                                                        08816000
  << ***************** >>                                               08818000
  << Log error status. >>                                               08820000
  << ***************** >>                                               08822000
                                                                        08824000
  DIT'ERROR'STATUS := [8/3, 8/DIT'ERR'LOG'INDEX];                       08826000
                                                                        08828000
  MASTERCLEARHPIB (P'DIT); << halt channel program.  >>                 08830000
                                                                        08832000
  DRIVER'STATE := REQUEST'COMPLETE;                                     08834000
                                                                        08836000
  RETURN;                                                               08838000
                                                                        08840000
END;                                                                    08842000
$PAGE                                                                   08844000
<< ********* >>                                                         08846000
<<           >>                                                         08848000
<< No Error. >>                                                         08850000
<<           >>                                                         08852000
<< ********* >>                                                         08854000
                                                                        08856000
                                                                        08858000
NO'ERROR:                                                               08860000
                                                                        08862000
                                                                        08864000
<< ************************** >>                                        08866000
<< Complete write ring mount. >>                                        08868000
<< ************************** >>                                        08870000
                                                                        08872000
IF DIT'REWIND'OFFLINE THEN << waiting for write ring mount.>>           08874000
BEGIN                                                                   08876000
                                                                        08878000
  DIT'REWIND'OFFLINE := ZERO           ; << Reset.>>                    08880000
  IOQ'IO'STATUS      := WRITE'RING'WAIT;                                08882000
  DRIVER'STATE       := OPERATOR'WAIT  ;                                08884000
                                                                        08886000
  RETURN;                                                               08888000
                                                                        08890000
END;                                                                    08892000
                                                                        08894000
<< **************** >>                                                  08896000
<< Set end of file. >>                                                  08898000
<< **************** >>                                                  08900000
                                                                        08902000
IF CP'END'OF'FILE THEN << set EOF in LPDT.>>                            08904000
BEGIN                                                                   08906000
                                                                        08908000
  LPDT'ENTRY'INDEX := DIT'LDEV * LPDT'ENTRY'SIZE;                       08910000
  LPDT'EOF'TYPE    := 1                         ;                       08912000
                                                                        08914000
END;                                                                    08916000
                                                                        08918000
<< ********************** >>                                            08920000
<< Complete system abort. >>                                            08922000
<< ********************** >>                                            08924000
                                                                        08926000
IF DIT'PENDING'ABORT THEN                                               08928000
BEGIN                                                                   08930000
                                                                        08932000
  IF IOQ'POWERFAIL THEN                                                 08934000
                                                                        08936000
    IOQ'IO'STATUS := POWERFAIL'ABORT                                    08938000
                                                                        08940000
  ELSE                                                                  08942000
                                                                        08944000
    IOQ'IO'STATUS := SYSTEM'ABORT;                                      08946000
                                                                        08948000
  DIT'PENDING'ABORT := FALSE;                                           08950000
                                                                        08952000
  DRIVER'STATE := REQUEST'COMPLETE;                                     08954000
                                                                        08956000
  RETURN;                                                               08958000
                                                                        08960000
END                                                                     08962000
                                                                        08964000
ELSE                                                                    08966000
                                                                        08968000
<< **************************************** >>                          08970000
<< Complete next record or previous record. >>                          08972000
<< **************************************** >>                          08974000
                                                                        08976000
IF IOQ'FUNCTION'CODE = FC'NEXT'RECORD OR                                08978000
   IOQ'FUNCTION'CODE = FC'PREV'RECORD THEN                              08980000
BEGIN                                                                   08982000
                                                                        08984000
  EOFCHECK (P'IOQ, 0D, 0, 0); << Check for forward space past >>        08986000
                              << EOF allowed.                 >>        08988000
  IF <> THEN << EOF, forward space not allowed.>>                       08990000
  BEGIN                                                                 08992000
                                                                        08994000
    DRIVER'STATE := REQUEST'COMPLETE;                                   08996000
                                                                        08998000
    RETURN;                                                             09000000
                                                                        09002000
  END;                                                                  09004000
                                                                        09006000
END                                                                     09008000
                                                                        09010000
ELSE                                                                    09012000
                                                                        09014000
<< *************************** >>                                       09016000
<< Complete rewind operations. >>                                       09018000
<< *************************** >>                                       09020000
                                                                        09022000
IF IOQ'FUNCTION'CODE = FC'REWIND         OR                             09024000
   IOQ'FUNCTION'CODE = FC'REWIND'OFFLINE OR                             09026000
   IOQ'FUNCTION'CODE = FC'CLOSE'DEVICE   THEN                           09028000
                                                                        09030000
  DIT'REWIND := 1                                                       09032000
                                                                        09034000
ELSE                                                                    09036000
                                                                        09038000
<< ************** >>                                                    09040000
<< Complete read. >>                                                    09042000
<< ************** >>                                                    09044000
                                                                        09046000
IF IOQ'FUNCTION'CODE = FC'READ THEN                                     09048000
BEGIN                                                                   09050000
                                                                        09052000
  IF DIT'SHORT'READ THEN                                                09054000
  BEGIN                                                                 09056000
                                                                        09058000
    DIT'SHORT'READ := FALSE;                                            09060000
                                                                        09062000
    BYTES'TRANSFERED := 6 - IP'CHAN'PGM (CRD'BYTE'CNT);                 09064000
                                                                        09066000
    WS'BUF'BANK'ADR  :=                                                 09068000
      double (@IP'CHAN'PGM + CSHORT'BUF1 + SYSDB);                      09070000
                                                                        09072000
    EOFCHECK (P'IOQ, WS'BUF'BANK'ADR, -BYTES'TRANSFERED, 0);            09074000
                                                                        09076000
    IF > THEN << Hardware EOF or EOD/EOJ read.>>                        09078000
    BEGIN     << IOQ status set by EOFCHECK.  >>                        09080000
                                                                        09082000
      DRIVER'STATE := REQUEST'COMPLETE;                                 09084000
                                                                        09086000
      RETURN;                                                           09088000
                                                                        09090000
    END                                                                 09092000
                                                                        09094000
    ELSE                                                                09096000
                                                                        09098000
    IF < THEN << JOB, :JOB, DATA, or :DATA read.  EOJ or EOD missing.>> 09100000
    BEGIN     << Backspace record so next read will re-read record   >> 09102000
              << just read.  This is for job tape processing.        >> 09104000
                                                                        09106000
      IOQ'BACKSPACE'EOF := TRUE;                                        09108000
                                                                        09110000
      IP'CHAN'PGM (CSTART'JVEC) := ZERO          ;                      09112000
      IP'CHAN'PGM (CCMD'DSJ0  ) := 20            ;                      09114000
      IP'CHAN'PGM (CTAPE'CMD  ) := TC'PREV'RECORD;                      09116000
                                                                        09118000
      GO TO START'CHAN'PGM;                                             09120000
                                                                        09122000
    END;                                                                09124000
                                                                        09126000
    IF BYTES'TRANSFERED < TRANSFER'COUNT THEN                           09128000
                                                                        09130000
      TRANSFER'COUNT := BYTES'TRANSFERED;                               09132000
                                                                        09134000
    << Transfer data to user's buffer.>>                                09136000
                                                                        09138000
    TOS := BUF'BANK'ADR;                  << Destination address.>>     09140000
    TOS := WS'BUF'BANK'ADR;               << Source address.     >>     09142000
    TOS := (TRANSFER'COUNT +1 ) &ASR (1); << # of words to move. >>     09144000
                                                                        09146000
    ASSEMBLE (MABS); << Transfer it.>>                                  09148000
                                                                        09150000
  END                                                                   09152000
                                                                        09154000
  ELSE << normal read.>>                                                09156000
  BEGIN                                                                 09158000
                                                                        09160000
    TRANSFER'COUNT := TRANSFER'COUNT - IP'CHAN'PGM (CRD'BYTE'CNT);      09162000
                                                                        09164000
    EOFCHECK (P'IOQ, BUF'BANK'ADR, -TRANSFER'COUNT, 0);                 09166000
                                                                        09168000
    IF <> THEN  << one of the conditions noted above in >>              09170000
    BEGIN       << short read checking has occured.     >>              09172000
                                                                        09174000
      IF < THEN                                                         09176000
                                                                        09178000
        IOQ'BACKSPACE'EOF := TRUE;                                      09180000
                                                                        09182000
      X := IF TRANSFER'COUNT < 127 THEN                                 09184000
                                                                        09186000
             (TRANSFER'COUNT + 3) &ASR (1)                              09188000
                                                                        09190000
           ELSE                                                         09192000
                                                                        09194000
             128;                                                       09196000
                                                                        09198000
      TOS := BUF'BANK'ADR;                                              09200000
                                                                        09202000
      WHILE (X := X - 1) <> ZERO DO << Zero out user's buffer.>>        09204000
      BEGIN                                                             09206000
                                                                        09208000
        TOS := ZERO;                                                    09210000
        ASSEMBLE (SSEA);                                                09212000
        TOS := TOS + 1;                                                 09214000
                                                                        09216000
      END;                                                              09218000
                                                                        09220000
      DDEL; << Clean up our stack.>>                                    09222000
                                                                        09224000
      IF IOQ'BACKSPACE'EOF THEN << backspace record so next read   >>   09226000
      BEGIN                     << will re'read record just read.  >>   09228000
                                << This is for job tape processing.>>   09230000
                                                                        09232000
        IP'CHAN'PGM (CSTART'JVEC) := ZERO          ;                    09234000
        IP'CHAN'PGM (CCMD'DSJ0  ) := 20            ;                    09236000
        IP'CHAN'PGM (CTAPE'CMD  ) := TC'PREV'RECORD;                    09238000
                                                                        09240000
        GO TO START'CHAN'PGM;                                           09242000
                                                                        09244000
      END                                                               09246000
                                                                        09248000
      ELSE                                                              09250000
                                                                        09252000
      BEGIN                                                             09254000
                                                                        09256000
        DRIVER'STATE := REQUEST'COMPLETE;                               09258000
                                                                        09260000
        RETURN;                                                         09262000
                                                                        09264000
      END;                                                              09266000
                                                                        09268000
    END;                                                                09270000
                                                                        09272000
  END;                                                                  09274000
                                                                        09276000
  IF IOQ'TRANSFER'COUNT < ZERO THEN                                     09278000
                                                                        09280000
    IOQ'TRANSFER'COUNT := -TRANSFER'COUNT                               09282000
                                                                        09284000
  else                                                                  09286000
                                                                        09288000
    IOQ'TRANSFER'COUNT := (TRANSFER'COUNT + 1) &ASR (1);                09290000
                                                                        09292000
END                                                                     09294000
                                                                        09296000
ELSE                                                                    09298000
                                                                        09300000
<< *************** >>                                                   09302000
<< Complete write. >>                                                   09304000
<< *************** >>                                                   09306000
                                                                        09308000
IF IOQ'FUNCTION'CODE = FC'WRITE     OR                                  09310000
   IOQ'FUNCTION'CODE = FC'FILE'MARK THEN                                09312000
BEGIN                                                                   09314000
                                                                        09316000
  IF CP'END'OF'TAPE THEN                                                09318000
  BEGIN                                                                 09320000
                                                                        09322000
    IOQ'IO'STATUS := GOOD'EOT'WRITE  ;                                  09324000
    DRIVER'STATE  := REQUEST'COMPLETE;                                  09326000
                                                                        09328000
    RETURN;                                                             09330000
                                                                        09332000
  END;                                                                  09334000
                                                                        09336000
END                                                                     09338000
                                                                        09340000
ELSE                                                                    09342000
                                                                        09344000
<< ************************************ >>                              09346000
<< Complete transfer count or selftest. >>                              09348000
<< ************************************ >>                              09350000
                                                                        09352000
IF IOQ'FUNCTION'CODE = FC'ACT'TRANS'CNT OR                              09354000
   IOQ'FUNCTION'CODE = FC'SELFTEST      THEN                            09356000
                                                                        09358000
  IF IOQ'TRANSFER'COUNT < ZERO THEN                                     09360000
                                                                        09362000
    IOQ'TRANSFER'COUNT := -2                                            09364000
                                                                        09366000
  ELSE                                                                  09368000
                                                                        09370000
    IOQ'TRANSFER'COUNT := 1                                             09372000
                                                                        09374000
ELSE                                                                    09376000
                                                                        09378000
<< *************************************** >>                           09380000
<< Complete diagnostic status or loopback. >>                           09382000
<< *************************************** >>                           09384000
                                                                        09386000
IF IOQ'FUNCTION'CODE = FC'DIAG'STATUS OR                                09388000
   IOQ'FUNCTION'CODE = FC'LOOPBACK    THEN                              09390000
BEGIN                                                                   09392000
                                                                        09394000
  TRANSFER'COUNT := TRANSFER'COUNT - IP'CHAN'PGM (CRD'BYTE'CNT);        09396000
                                                                        09398000
  IF IOQ'TRANSFER'COUNT < ZERO THEN                                     09400000
                                                                        09402000
    IOQ'TRANSFER'COUNT := -TRANSFER'COUNT                               09404000
                                                                        09406000
  ELSE                                                                  09408000
                                                                        09410000
    IOQ'TRANSFER'COUNT := (TRANSFER'COUNT + 1) &ASR (1);                09412000
                                                                        09414000
END                                                                     09416000
                                                                        09418000
ELSE                                                                    09420000
                                                                        09422000
<< ********************************************** >>                    09424000
<< Complete download diagnostic, read status log, >>                    09426000
<< write firmware, or read firmware.              >>                    09428000
<< ********************************************** >>                    09430000
                                                                        09432000
IF IOQ'FUNCTION'CODE = FC'DOWNLOAD'DIAG  OR                             09434000
   IOQ'FUNCTION'CODE = FC'STATUS'LOG     OR                             09436000
   IOQ'FUNCTION'CODE = FC'WRITE'FIRMWARE OR                             09438000
   IOQ'FUNCTION'CODE = FC'READ'FIRMWARE  THEN                           09440000
BEGIN                                                                   09442000
                                                                        09444000
  TRANSFER'COUNT := TRANSFER'COUNT - IP'CHAN'PGM (CWR'BYTE'CNT);        09446000
                                                                        09448000
  IF IOQ'TRANSFER'COUNT < ZERO THEN                                     09450000
                                                                        09452000
    IOQ'TRANSFER'COUNT := -TRANSFER'COUNT                               09454000
                                                                        09456000
  ELSE                                                                  09458000
                                                                        09460000
    IOQ'TRANSFER'COUNT := (TRANSFER'COUNT + 1) &ASR (1);                09462000
                                                                        09464000
END                                                                     09466000
                                                                        09468000
ELSE                                                                    09470000
                                                                        09472000
<< ****************** >>                                                09474000
<< Complete identify. >>                                                09476000
<< ****************** >>                                                09478000
                                                                        09480000
IF IOQ'FUNCTION'CODE = FC'IDENTIFY THEN                                 09482000
BEGIN                                                                   09484000
                                                                        09486000
  TOS := BUF'BANK'ADR;             << Push buffer address on TOS.>>     09488000
  TOS := P'CHAN'PGM (CIDENT'CODE); << Push identity on TOS.      >>     09490000
  ASSEMBLE (SSEA);                 << Put identity into buffer.  >>     09492000
  DDEL;                            << Clean up our stack.        >>     09494000
                                                                        09496000
  IF IOQ'TRANSFER'COUNT < ZERO THEN                                     09498000
                                                                        09500000
    IOQ'TRANSFER'COUNT := -2                                            09502000
                                                                        09504000
  ELSE                                                                  09506000
                                                                        09508000
    IOQ'TRANSFER'COUNT := 1;                                            09510000
                                                                        09512000
END                                                                     09514000
                                                                        09516000
ELSE                                                                    09518000
                                                                        09520000
<< *************************** >>                                       09522000
<< Complete get device status. >>                                       09524000
<< *************************** >>                                       09526000
                                                                        09528000
IF IOQ'FUNCTION'CODE = FC'GET'DEV'STATUS THEN                           09530000
BEGIN                                                                   09532000
                                                                        09534000
  TOS := BUF'BANK'ADR; << Push buffer address on TOS.   >>              09536000
  TOS := IP'CHAN'PGM (CDEVSTAT1);                                       09538000
                       << Push 1st status word on TOS.  >>              09540000
  ASSEMBLE (SSEA);     << Put 1st status word in buffer.>>              09542000
                                                                        09544000
  IOQ'TRANSFER'COUNT := -2;                                             09546000
                                                                        09548000
  IF TRANSFER'COUNT > 2 THEN                                            09550000
  BEGIN                                                                 09552000
                                                                        09554000
    TOS := TOS + 1;  << Increment buffer address.     >>                09556000
    TOS := IP'CHAN'PGM (CDEVSTAT2);                                     09558000
                     << Push 2nd status word on TOS.  >>                09560000
    ASSEMBLE (SSEA); << Put 2nd status word in buffer.>>                09562000
                                                                        09564000
    IOQ'TRANSFER'COUNT := -4;                                           09566000
                                                                        09568000
  END;                                                                  09570000
                                                                        09572000
  IF TRANSFER'COUNT > 4 THEN                                            09574000
  BEGIN                                                                 09576000
                                                                        09578000
    TOS := TOS + 1;  << Increment buffer address.     >>                09580000
    TOS := IP'CHAN'PGM (CDEVSTAT3);                                     09582000
                     << Push 3rd status word on TOS.  >>                09584000
    ASSEMBLE (SSEA); << Put 3rd status word in buffer.>>                09586000
                                                                        09588000
    IOQ'TRANSFER'COUNT := -6;                                           09590000
                                                                        09592000
  END;                                                                  09594000
                                                                        09596000
  DDEL; << clean up stack.>>                                            09598000
                                                                        09600000
END                                                                     09602000
                                                                        09604000
ELSE                                                                    09606000
                                                                        09608000
  << ************************ >>                                        09610000
  << Complete other requests. >>                                        09612000
  << ************************ >>                                        09614000
                                                                        09616000
  IOQ'TRANSFER'COUNT := ZERO;                                           09618000
                                                                        09620000
IF NOT (CP'RETRY'COUNT = 0) THEN                                        09622000
BEGIN                                                                   09624000
                                                                        09626000
  IOQ'RETRY'COUNT := CP'RETRY'COUNT;                                    09628000
  CP'RETRY'COUNT  := ZERO          ;                                    09630000
  IOQ'IO'STATUS   := GOOD'RETRY    ;                                    09632000
                                                                        09634000
END                                                                     09636000
                                                                        09638000
ELSE                                                                    09640000
                                                                        09642000
  IOQ'IO'STATUS := GOOD'IO;                                             09644000
                                                                        09646000
<< ****************** >>                                                09648000
<< Request completed. >>                                                09650000
<< ****************** >>                                                09652000
                                                                        09654000
DRIVER'STATE := REQUEST'COMPLETE;                                       09656000
                                                                        09658000
RETURN;                                                                 09660000
                                                                        09662000
END; << MTDRVR >>                                                       09664000
$PAGE                                                                   09666000
<< Main entry point >>                                                  09668000
                                                                        09670000
ASSEMBLE (PCAL SIODM   ;   << Device monitor.       >>                  09672000
          PCAL MTDRVR  ;   << Driver Initiator.     >>                  09674000
          PCAL MTDRVR  ;   << Driver Completor.     >>                  09676000
          CON  ZERO    ;   << No I/O process.       >>                  09678000
          PCAL MTINIT  ;   << Driver Initialization.>>                  09680000
          CON  1       ;   << One interrupt handler.>>                  09682000
          PCAL GIP'HPIB ); << Interrupt handler.    >>                  09684000
                                                                        09686000
END.                                                                    09688000
