$SET X8=ON                                                              00005000
<< HIOCTAP1 - MODULE 45        >>                                       00010000
<< HP32033C MPE SOURCE E.00.01 >>                                       00015000
<< COPYRIGHT     "(C) copyright HEWLETT-PACKARD co. 1980.           >>  00020000
<<     This program may be used with one computer system at a       >>  00025000
<<     time and shall not otherwise be recorded, transmitted or     >>  00030000
<<     stored in a retrieval system.  Copying or other reproduction >>  00035000
<<     of this program except for archival purposes is prohibited   >>  00040000
<<     without the prior written consent of HEWLETT-PACKARD company.>>  00045000
<< **** Note - Dollar Copyright cannot be used with this module *** >>  00050000
                                                                        00055000
$CONTROL PRIVILEGED, UNCALLABLE, MAP, CODE, LIST, USLINIT               00060000
$TITLE "CS'80 BUFFALO DRIVER - HPIB"                                    00065000
$TP                                                                     00070000
<<********************************************************************  00075000
                                                                        00080000
======================================================================  00085000
|                       Change history                               |  00090000
| Author           Date              Brief Description               |  00095000
|--------------------------------------------------------------------|  00100000
|                                                                    |  00105000
|Satish Janardan  2/10/84  Create the Buffalo Driver.                |  00110000
|                                                                    |  00115000
|Frank Weger      7/18/84  Initialization and FCODE 91 changes.      |  00120000
|                                                                    |  00125000
|                                                                    |  00130000
|                                                                    |  00135000
|                                                                    |  00140000
|                                                                    |  00145000
|                                                                    |  00150000
|                                                                    |  00155000
|                                                                    |  00160000
|                                                                    |  00165000
======================================================================  00170000
$PAGE                                                                   00175000
                                                                        00180000
                               TABLE OF CONTENTS                        00185000
                                                                        00190000
1  PRODUCT IDENTIFICATION                                               00195000
   1.1  Product name, mnemonic, and project number                      00200000
   1.2  Project personnel                                               00205000
   1.3  Project documents                                               00210000
                                                                        00215000
2  DRIVER DESIGN                                                        00220000
   2.1  Design approach                                                 00225000
   2.2  Major modules                                                   00230000
   2.3  Driver creation                                                 00235000
   2.4  Procedure interface                                             00240000
        2.4.1  BUFFALO'INIT                                             00245000
        2.4.2  BUFFALO'DRIVER                                           00250000
   2.5  Procedure overview                                              00255000
        2.5.1  BUFFALO'INIT                                             00260000
        2.5.2  BUFFALO'DRIVER                                           00265000
        5.5.3  External procedures                                      00270000
   2.6  Procedure processing                                            00275000
        2.6.1  BUFFALO'INIT                                             00280000
        2.6.2  BUFFALO'DRIVER                                           00285000
               2.6.2.1  Driver initiator section                        00290000
               2.6.2.2  Driver completor section                        00295000
               2.6.2.3  Immediate report                                00300000
               2.6.2.4  Individual command processing                   00305000
               2.6.2.5  BUFFALO'DRIVER flow diagram                     00310000
               2.6.2.6  Request processing                              00315000
               2.6.2.7  Non-supported functions                         00320000
                                                                        00325000
3  MAJOR DATA STRUCTURES                                                00330000
   3.1  Device reference table (DRT)                                    00335000
   3.2  Device information table (DIT)                                  00340000
   3.3  Interrupt linkage table (ILT)                                   00345000
   3.4  I/O queue request table (IOQ)                                   00350000
                                                                        00355000
4  IOQ I/O STATUS                                                       00360000
                                                                        00365000
5  Generic status layout                                                00370000
                                                                        00375000
6  CS/80 device status                                                  00380000
                                                                        00385000
7  Release considerations                                               00390000
                                                                        00395000
8  Lock/unlock considerations                                           00400000
   8.1  Private volumes                                                 00405000
   8.2  Serial and foreign volumes                                      00410000
                                                                        00415000
9  Logging considerations                                               00420000
                                                                        00425000
10 Unexpected interrupts handling                                       00430000
                                                                        00435000
11 Status considerations                                                00440000
                                                                        00445000
12 Driver schedule                                                      00450000
                                                                        00455000
$PAGE                                                                   00460000
1  PRODUCT IDENTIFICATION                                               00465000
                                                                        00470000
                                                                        00475000
 1.1  Product Name    :  HIOCTAP1 - MPE I/O Cartridge Tape              00480000
                                            Driver (HP-IB)              00485000
      Product Mnemonic:  Buffalo                                        00490000
      Project Number  :  4083                                           00495000
                                                                        00500000
                                                                        00505000
 1.2  PROJECT PERSONNEL                                                 00510000
                                                                        00515000
      Project Manager - Rich Pearson                                    00520000
      Product Manager - Kathyrn Hoshor                                  00525000
      MTS             - Satish Janardan                                 00530000
                                                                        00535000
                                                                        00540000
 1.3  PROJECT DOCUMENTS                                                 00545000
                                                                        00550000
      The Buffalo Book                - Greeley Division                00555000
      CS/80 Instruction Set           - HP Part #5955-3442              00560000
      Buffalo Investigation Report    - Computer Systems Division       00565000
      Buffalo External Specifications - Computer Systems Division       00570000
                                                                        00575000
                                                                        00580000
$PAGE                                                                   00585000
2  DRIVER DESIGN                                                        00590000
                                                                        00595000
                                                                        00600000
 2.1  DESIGN APPROACH                                                   00605000
                                                                        00610000
      HIOCTAP1 will be a modified version of the HIOCTAP0  (LINUS)      00615000
      driver.  Requirements of these drivers are basically the same.    00620000
      The difference is the addition of immediate report for Buffalo.   00625000
      Modifications will be to the extent of utilizing the maximum      00630000
      performance which the Buffalo drive can provide.  These           00635000
      modifications will include changes to insure the driver is        00640000
      well structured and maintainable.                                 00645000
                                                                        00650000
 2.2  MAJOR MODULES                                                     00655000
                                                                        00660000
      The driver consists of a global area, a linkage area "outer       00665000
      block" for INITIAL, and two procedures (BUFFALO'INIT and          00670000
      BUFFALO'DRIVER) which initialize and process requests for         00675000
      particular operations from the device.                            00680000
                                                                        00685000
                                                                        00690000
 2.3  DRIVER CREATION                                                   00695000
                                                                        00700000
      At system start-up, the driver is created by PROGEN.  After system00705000
      start-up, the Input/Output Device Monitor (SIODM) is the creator  00710000
      of the driver.                                                    00715000
                                                                        00720000
      SIODM is invoked through the ATTACHIO process.  During            00725000
      interrupt processing the driver is executed on the Interrupt      00730000
      Control Stack (ICS).  Other processing is performed on the stack  00735000
      of the process which invoked the driver.                          00740000
                                                                        00745000
      For user processes, the driver is invoked through the             00750000
      following processes.  The File System creates the initial         00755000
      request and calls ATTACHIO.  ATTACHIO creates the appropriate     00760000
      request in the Input/Output Queue Table (IOQ).  ATTACHIO then     00765000
      calls the Serial Disc Interface (SDISCIO) which fills in          00770000
      various elements of the IOQ entry for the request.  SDISCIO       00775000
      then calls ATTACHIO again which in turn calls the Input/Output    00780000
      Device Monitor (SIODM).  SIODM freezes the data segment (if any)  00785000
      up appropriate information in the IOQ and creates a channel       00790000
      program to satisfy the request and sends it to the device.        00795000
                                                                        00800000
      When the device completes the request, an interrupt is generated  00805000
      which invokes the General Interrupt Processor (GIP).  GIP then    00810000
      calls ATTACHIO which in turn calls SIODM.  SIODM calls the driver.00815000
      The driver checks for success or failure, marks the appropriate   00820000
      status and returns to SIODM.  SIODM unfreezes the data segment and00825000
      returns to SDISCIO, which returns to ATTACHIO, which returns to   00830000
      the File System.                                                  00835000
                                                                        00840000
      The file system processing can be bypassed by calling ATTACHIO    00845000
      directly.                                                         00850000
                                                                        00855000
$PAGE                                                                   00860000
 2.4  PROCEDURE INTERFACE                                               00865000
                                                                        00870000
                                                                        00875000
  2.4.1  BUFFALO'INIT                                                   00880000
                                                                        00885000
         A single parameter is passed to BUFFALO'INIT when called.      00890000
         This is a pointer to the Device Information Table (DIT)  entry 00895000
         for this particular device.                                    00900000
                                                                        00905000
                                                                        00910000
  2.4.2  BUFFALO'DRIVER                                                 00915000
                                                                        00920000
         There are six parameters passed to BUFFALO'DRIVER.  The first  00925000
         parameter passed is the index to the Input/Output Queue Table  00930000
         (IOQ) entry for the current request.  IOQ elements contain     00935000
         information relevant to the current request.                   00940000
                                                                        00945000
         The second parameter is a pointer to the Device Information    00950000
         Table (DIT)  entry.  DIT elements contain information about its00955000
         associated device.  This is information which must be saved    00960000
         between I/O requests to the driver.  There is one DIT entry per00965000
         physical device on the controller.                             00970000
                                                                        00975000
         The third and fourth parameters make up the absolute memory    00980000
         location of the data segment associated with the request.  The 00985000
         third parameter is the memory bank where the data is to be     00990000
         written to or read from by the device.  The fourth parameter is00995000
         the offset within the memory bank (memory address) where the   01000000
         data is to be written to or read from.                         01005000
                                                                        01010000
         The fifth parameter passed is a pointer to the Channel Program.01015000
         The channel program is actually a part of the Interrupt Linkage01020000
         Table (ILT)  entry for the device controller.  There is one ILT01025000
         entry per device controller.  This entry stores information    01030000
         concerning the device controller and the channel program or the01035000
         device.                                                        01040000
                                                                        01045000
         The last parameter passed is a pointer to the Device Reference 01050000
         Table (DRT)  entry.  This entry contains information for       01055000
         processing hardware interrupts.  There is one DRT entry per    01060000
         device controller.                                             01065000
                                                                        01070000
                                                                        01075000
$PAGE                                                                   01080000
 2.5  PROCEDURE OVERVIEW                                                01085000
                                                                        01090000
                                                                        01095000
  2.5.1  BUFFALO'INIT                                                   01100000
                                                                        01105000
         BUFFALO'INIT is responsible for performing a device clear to   01110000
         reset the device to a known state if this has not been already 01115000
         done.  It places the device into the immediate report enabled  01120000
         state (default).  It also initializes portions of the channel  01125000
         program for later use by BUFFALO'DRIVER.                       01130000
                                                                        01135000
                                                                        01140000
  2.5.2  BUFFALO'DRIVER                                                 01145000
                                                                        01150000
         BUFFALO'DRIVER is the main procedure for the driver.  This     01155000
         procedure is responsible for initiating and completing I/O     01160000
         requests against the device.  BUFFALO'DRIVER is always called  01165000
         by the I/O device monitor SIODM.                               01170000
                                                                        01175000
         BUFFALO'DRIVER determines the reason for the call by examining 01180000
         the IOQ entry for the request and the DIT entry.  When a new   01185000
         request is initiated, BUFFALO'DRIVER examines the function code01190000
         and parameter fields contained in the IOQ to determine what    01195000
         operation is to be performed.  The proper command codes and    01200000
         program branches are then placed in the channel program and its01205000
         execution is begun with a call to the external procedure       01210000
         START'HPIB.                                                    01215000
                                                                        01220000
         Upon completion of the request, an interrupt is generated and  01225000
         BUFFALO'DRIVER is again called.  The driver checks for current 01230000
         activity in progress, and this being the case, transfers to the01235000
         completion section of the driver.  The completion section      01240000
         examines the device status words returned by the channel       01245000
         program for errors or special conditions which might data      01250000
         transfer, or the operation of the device.  These conditions can01255000
         cause error retries and/or special notation back to the caller.01260000
                                                                        01265000
                                                                        01270000
$PAGE                                                                   01275000
  2.5.3  EXTERNAL PROCEDURES                                            01280000
                                                                        01285000
         The following is a brief description of the external procedures01290000
         called by the driver.                                          01295000
                                                                        01300000
         GIP'HPIB is a procedure that handles all General Interrupt     01305000
         Processing.                                                    01310000
                                                                        01315000
         IOMESSAGE is a procedure used for sending messages to the      01320000
         console.                                                       01325000
                                                                        01330000
         SIODM is the procedure known as the I/O Device Monitor process.01335000
         This procedure is the process by which an I/O driver is        01340000
         activated.                                                     01345000
                                                                        01350000
         START'HPIB is the procedure that starts channel program        01355000
         processing.                                                    01360000
                                                                        01365000
         MAINT'REQUEST sends an inter-process communication message to  01370000
         IOMESSAGE to perform maintenance processing on the device.     01375000
                                                                        01380000
         LDEVNOTRDY calls a procedure to print a device not ready       01385000
         message on the console.                                        01390000
                                                                        01395000
         GETDRT is a procedure that returns the value of a specified    01400000
         word in the Device Reference Table entry for the device.       01405000
                                                                        01410000
                                                                        01415000
$PAGE                                                                   01420000
 2.6  PROCEDURE PROCESSING                                              01425000
                                                                        01430000
                                                                        01435000
  2.6.1  BUFFALO'INIT                                                   01440000
                                                                        01445000
         External interrupts are disabled to allow BUFFALO'INIT to run  01450000
         to completion.                                                 01455000
                                                                        01460000
         BUFFALO'INIT next aquires the pointer to the ILT array from the01465000
         DIT array.  From the ILT array, pointers to the channel program01470000
         and channel program status area are acquired.                  01475000
                                                                        01480000
         If the SYSGLOB powerfail word is not zero, the initialized flag01485000
         is set to true, and the device is in the immediate report state01490000
         (driver default), no further processing is performed.          01495000
                                                                        01500000
         The lock flag is set to true if the device is not a private    01505000
         volume and a foreign or serial disc has not been logically and 01510000
         physically mounted.  If the lock flag is set to true, any      01515000
         operator request for release will not be processed without the 01520000
         device being properly unlocked.  BUFFALO'INIT then initializes 01525000
         various parts of the channel perform a device clear on the     01530000
         device and enable immediate report.  The initialized flag is   01535000
         then set to true to inhibit any further BUFFALO'INIT processing01540000
         except where it is appropriately desired.                      01545000
                                                                        01550000
                                                                        01555000
  2.6.2  BUFFALO'DRIVER                                                 01560000
                                                                        01565000
                                                                        01570000
   2.6.2.1  DRIVER INITIATOR SECTION                                    01575000
                                                                        01580000
            This section is responsible for validating a new request and01585000
            issuing the channel program for execution of the request.   01590000
                                                                        01595000
                                                                        01600000
   2.6.2.2  DRIVER COMPLETOR SECTION                                    01605000
                                                                        01610000
            This section is responsible for checking the success or     01615000
            failure of a completed request, logging any device errors,  01620000
            and informing the calling process of the success or failure 01625000
            of the request (through the IOQ).                           01630000
                                                                        01635000
                                                                        01640000
$PAGE                                                                   01645000
   2.6.2.3  IMMEDIATE REPORT                                            01650000
                                                                        01655000
            Immediate report allows one command to be actively          01660000
            processing while other commands are queued and readied for  01665000
            execution within the same controller.  The use of immediate 01670000
            report can significantly contribute to performance          01675000
            improvement since the time spent executing the first command01680000
            is overlapped with the setup of the next command.           01685000
                                                                        01690000
            Immediate report is used only for write requests.  The      01695000
            device will respond with a success status immediately after 01700000
            the DMA transfer from memory to the device's internal buffer01705000
            is complete.  This allows another DMA transfer to be sent to01710000
            the device while the device is transfering the data from the01715000
            internal buffer to tape.                                    01720000
                                                                        01725000
            If immediate report is disabled, any failures of a request  01730000
            will be reported back to the user in the status area for    01735000
            that request.                                               01740000
                                                                        01745000
            If immediate report is enabled, any failure of a transfer of01750000
            data from the internal buffer to tape may not be reported   01755000
            immediately.  The user will be informed that the transfer   01760000
            was successful upon completion of the transfer from memory  01765000
            to the device's internal buffer.  If the device fails to    01770000
            write the data to tape, the failure may That is, since it is01775000
            possible to submit multiple DMA transfers to the device's   01780000
            buffer successfully before a prior one has been completely  01785000
            transferred to the tape, the failure may be indicated in the01790000
            status of a request submitted after the original failure.   01795000
                                                                        01800000
            With immediate report enabled, the user must check status   01805000
            from the last rewind, close file, or close device.  This is 01810000
            necessary to ensure that the last write performed was       01815000
            successful when transferred from the internal buffer to the 01820000
            tape.  Users who do not adhear to this run the risk of      01825000
            missing a failure status for the last record transferred to 01830000
            tape.                                                       01835000
                                                                        01840000
                                                                        01845000
$PAGE                                                                   01850000
   2.6.2.4  INDIVIDUAL COMMAND PROCESSING                               01855000
                                                                        01860000
            Each request will be processed through the initiator section01865000
            and completor section of BUFFALO'DRIVER.  The initiator     01870000
            section is responsible for validating new requests.  If the 01875000
            request is new and has not been initiated, this section     01880000
            creates the channel program necessary to initiate and       01885000
            execute the request and exits.  The channel program is      01890000
            started with a call to the external procedure START'HPIB.   01895000
                                                                        01900000
            The completor section of BUFFALO'DRIVER is responsible for  01905000
            determining the success or failure of the request.  Success 01910000
            or failure is determined by checking the QSTAT returned from01915000
            the report phase of a request.  If QSTAT is zero the request01920000
            completed successfully.  The I/O status for the request is  01925000
            marked as such and BUFFALO'DRIVER exits.  A QSTAT of one    01930000
            indicates failure of the request.  The completor section    01935000
            logs the device status values in the DIT, interrogates the  01940000
            device status to determine the specific reason for the      01945000
            failure, places the appropriate error status in the I/O     01950000
            status for the error and exits.                             01955000
                                                                        01960000
            A QSTAT of two indicates a device power failure occured.    01965000
            Any request which has been initiated but not completed will 01970000
            have a powerfail status placed in the I/O status for the    01975000
            request.                                                    01980000
                                                                        01985000
            With immediate report enabled, the errors may not be        01990000
            reported back in the same IOQ that requested the write.     01995000
                                                                        02000000
                                                                        02005000
$PAGE                                                                   02010000
   2.6.2.5  BUFFALO'DRIVER FLOW DIAGRAM                                 02015000
                                                                        02020000
      Initialize local variables.                                       02025000
        |                                                               02030000
        |                no                                             02035000
      Device initialized ---> call BUFFALO'INIT                         02040000
        |yes                    |                                       02045000
        |<----------------------|                                       02050000
        |              no                                               02055000
      Another request? ---> Execute idle ---> Set driver state.         02060000
        |yes                channel program.      Exit.                 02065000
        |                                                               02070000
        |           yes                                                 02075000
      System abort? ---> Execute device ---> Set                        02080000
        |no              clear channel       driver                     02085000
        |                program.            state.                     02090000
        |                                    Exit.                      02095000
        |                                                               02100000
        |               yes                                             02105000
      Device powerfail? ---> Go PROCESS'COMPLETOR.                      02110000
        |no                                                             02115000
        |          no                                                   02120000
      New request? ---> Go PROCESS'COMPLETOR.                           02125000
        |yes                                                            02130000
        |            no                                                 02135000
      Request valid? ---> Go PROCESS'COMPLETOR.                         02140000
        |yes                                                            02145000
        |                                                               02150000
      Execute channel                                                   02155000
      program for                                                       02160000
      request processing.                                               02165000
        |                                                               02170000
        |                                                               02175000
      Set driver state.                                                 02180000
      Exit.                                                             02185000
                                                                        02190000
                                                                        02195000
      PROCESS'COMPLETOR                                                 02200000
        |                                                               02205000
        |                                                               02210000
      Log device status.                                                02215000
      Set request status.                                               02220000
      Set driver state.                                                 02225000
      Exit.                                                             02230000
                                                                        02235000
                                                                        02240000
$PAGE                                                                   02245000
   2.6.2.6  REQUEST PROCESSING                                          02250000
                                                                        02255000
            The following is a description of how the driver will       02260000
            process each individual function when requested.            02265000
                                                                        02270000
            The device recognizes byte transfers only, therefore, if the02275000
            IOQ transfer count is in words, the driver will convert it  02280000
            to bytes when sent to the device.  A positive transfer count02285000
            indicates a word transfer.  A negative transfer count       02290000
            indicates a byte transfer.                                  02295000
                                                                        02300000
            Any request that transfers more than 6144  bytes of data    02305000
            from or to the device will be processed in multiple         02310000
            transfers of 6144  bytes until the entire transfer count is 02315000
            satisfied.  If a failure occures prior to completion of the 02320000
            entire transfer, the request will be terminated.            02325000
                                                                        02330000
            All new requests will be sent to the device via a call to   02335000
            the external procedure START'HPIB.  A channel program will  02340000
            be initialized and started to initiate and execute the      02345000
            request.                                                    02350000
                                                                        02355000
            If the request has been completed, the I/O status will be   02360000
            placed in the IOQ entry for the request and the request     02365000
            marked complete.                                            02370000
                                                                        02375000
                                                                        02380000
          o LOCATE AND READ (function code 0)                           02385000
                                                                        02390000
              This request transfers data from tape to the host's       02395000
              memory.                                                   02400000
                                                                        02405000
              The maximum transfer count is 32767  words.               02410000
                                                                        02415000
              If the transfer count is zero, the request will locate the02420000
              record on tape only.  There will be no transfer of data.  02425000
                                                                        02430000
                                                                        02435000
          o LOCATE AND WRITE (function code 1)                          02440000
                                                                        02445000
              This command transfers one record from main memory to     02450000
              tape.                                                     02455000
                                                                        02460000
              The maximum transfer count is 32767 words.                02465000
                                                                        02470000
              A transfer count of zero requests a write ring presence   02475000
              check on the device.  If the device is write protected, a 02480000
              message will be sent to the console indicating the device 02485000
              is write protected.                                       02490000
                                                                        02495000
                                                                        02500000
$PAGE                                                                   02505000
          o OPEN FILE (function code 2)                                 02510000
                                                                        02515000
              This request generates a null operation with a good status02520000
              returned in the I/O status.  No channel program will be   02525000
              executed for this request.                                02530000
                                                                        02535000
                                                                        02540000
          o CLOSE FILE (function code 3)                                02545000
                                                                        02550000
              This request generates a null operation with a good status02555000
              returned in the I/O status.  No channel program will be   02560000
              executed for this request.                                02565000
                                                                        02570000
                                                                        02575000
          o CLOSE DEVICE (function code 4)                              02580000
                                                                        02585000
              A channel program will be executed to enable immediate    02590000
              report (driver default).                                  02595000
                                                                        02600000
                                                                        02605000
          o FILL WITH ZEROS (function code 5)                           02610000
                                                                        02615000
              This request fills logical blocks on the tape with zeros  02620000
              (octal 60).                                               02625000
                                                                        02630000
              The maximum transfer count is 32767 words.  A transfer    02635000
              count of zero is invalid.                                 02640000
                                                                        02645000
                                                                        02650000
          o FILL WITH BLANKS (function code 6)                          02655000
                                                                        02660000
              This request fills logical blocks on the tape with spaces 02665000
              (octal 40).                                               02670000
                                                                        02675000
              The maximum transfer count is 32767 words.  A transfer    02680000
              count of zero is invalid.                                 02685000
                                                                        02690000
                                                                        02695000
          o REQUEST DEVICE STATUS (function code 7)                     02700000
                                                                        02705000
              This command will transfer the actual device status from  02710000
              the last completed operation.                             02715000
                                                                        02720000
              The transfer count must be greater than 1  byte and will  02725000
              be invalid if it isn't.  The maximum number of bytes      02730000
              returned is 20.  A transfer count in excess of 20 will not02735000
              be considered an error and the 20 bytes of status will be 02740000
              returned.  (Refer to the CS/80 Instruction Set manual for 02745000
              definitions and layout of the status bytes).              02750000
                                                                        02755000
                                                                        02760000
          o INITIALIZE MEDIA (function code 8)                          02765000
                                                                        02770000
              This request initializes the media.                       02775000
                                                                        02780000
                                                                        02785000
$PAGE                                                                   02790000
          o UNLOAD (function code 9)                                    02795000
                                                                        02800000
              This request rewinds and unloads the tape.  The tape will 02805000
              be unloaded regardless of the state of the lock bit.      02810000
                                                                        02815000
                                                                        02820000
          o WRITE DISC LABEL (function code 11)                         02825000
                                                                        02830000
              This request will write a label to block zero on the      02835000
              tape.                                                     02840000
                                                                        02845000
              The maximum transfer count is 32767 words.  A transfer    02850000
              count of zero is invalid.                                 02855000
                                                                        02860000
                                                                        02865000
          o REQUEST VOLUME LIMIT (function code 13)                     02870000
                                                                        02875000
              This request returns the maximum volume address of the    02880000
              media in two words.                                       02885000
                                                                        02890000
              NOTE:  Buffalo supports only single vector addresses.     02895000
                                                                        02900000
              The transfer count must be a minimum of two words.  A     02905000
              transfer count greater than two words will not be         02910000
              considered an error and the two words of volume limit will02915000
              be returned.                                              02920000
                                                                        02925000
                                                                        02930000
          o LOCATE AND VERIFY (function code 14)                        02935000
                                                                        02940000
              This request verifies the media and returns in two words  02945000
              the address of the first bad sector encountered.          02950000
                                                                        02955000
              Upon making this request, the user's buffer must contain  02960000
              the double word value of the verify length.               02965000
                                                                        02970000
              The transfer count must be a minimum of two words.  A     02975000
              transfer count greater than two words will not be         02980000
              considered an error and the two words of volume limit will02985000
              be returned.                                              02990000
                                                                        02995000
                                                                        03000000
                                                                        03005000
$PAGE                                                                   03010000
          o REQUEST GENERIC STATUS (function code 15)                   03015000
                                                                        03020000
              This request returns the generic status from the last     03025000
              completed operation performed by the device in one word.  03030000
              See the generic status layout later in this document.     03035000
                                                                        03040000
              The transfer count must be a minimum of one word.  A      03045000
              transfer count greater than one word will not be          03050000
              considered an error and the one word of generic status    03055000
              will be returned.                                         03060000
                                                                        03065000
                                                                        03070000
          o LOCK VOLUME (function code 16)                              03075000
                                                                        03080000
              This request locks the volume, disabling the front panel  03085000
              unload function, and returns a good status.  The lock bit 03090000
              in the DIT entry is turned on.  No channel program will be03095000
              executed for this request.                                03100000
                                                                        03105000
                                                                        03110000
          o UNLOCK VOLUME (function code 17)                            03115000
                                                                        03120000
              This request unlocks the volume, enabling the front panel 03125000
              unload function, and returns a good status.  The lock bit 03130000
              in the DIT entry is turned off.  No channel program will  03135000
              be executed for this request.                             03140000
                                                                        03145000
                                                                        03150000
          o READ LOCK BIT (function code 18)                            03155000
                                                                        03160000
              This request returns the volume locked status in one word.03165000
                                                                        03170000
              The transfer count must be a minimum of one word.  A      03175000
              transfer count greater than one word will not be          03180000
              considered an error and the one word of locked status will03185000
              be returned.  No channel program will be executed for this03190000
              request.                                                  03195000
                                                                        03200000
                                                                        03205000
$PAGE                                                                   03210000
          o IMMEDIATE REPORT (function code 29)                         03215000
                                                                        03220000
              This request enables or disables the immediate reporting  03225000
              feature of the device.                                    03230000
                                                                        03235000
              If QPARM2 is zero, immediate report will be disabled.  If 03240000
              QPARM2 is one, immediate report will be enabled.          03245000
                                                                        03250000
                                                                        03255000
          o IDENTIFY (function code 72)                                 03260000
                                                                        03265000
              This request returns Buffalo's identity code in two bytes.03270000
              Buffalo's identity code is 0260 (hex).                    03275000
                                                                        03280000
              Bit Meaning                                               03285000
                                                                        03290000
              0-2      Storage device, value 000                        03295000
              3-6      Value 0001                                       03300000
              7        13037 protocol, value 0                          03305000
              8        Value 0                                          03310000
              9        Value 1                                          03315000
              10-15    Device dependent                                 03320000
                                                                        03325000
              The transfer count must be a minimum of one word.  A      03330000
              transfer count greater than one word will not be          03335000
              considered an error and the one word identity code will be03340000
              returned.                                                 03345000
                                                                        03350000
                                                                        03355000
          o INITIATE DIAGNOSTIC SELFTEST (function code 73)             03360000
                                                                        03365000
              This request will cause Buffalo to perform its power-on   03370000
              selftest.  The loop count must be between zero and 255.   03375000
              Zero will be processed as a request for 255 loops (for    03380000
              Linus compatibility).  Any other value will be considered 03385000
              invalid.                                                  03390000
                                                                        03395000
                                                                        03400000
          o SELFTEST RESULTS (function code 74)                         03405000
                                                                        03410000
              This request will return the status from the selftest.    03415000
              The processing of this request is the same as the REQUEST 03420000
              STATUS function.                                          03425000
                                                                        03430000
                                                                        03435000
          o LOOPBACK WRITE (function code 75)                           03440000
                                                                        03445000
              This request determines if the communication link is      03450000
              operating properly by writting a test pattern (located in 03455000
              the user's buffer) into the device's internal buffer.     03460000
                                                                        03465000
              The transfer count must be greater than zero and less than03470000
              or equal to 600 words.  Any value outside this range is   03475000
              invalid.                                                  03480000
                                                                        03485000
                                                                        03490000
$PAGE                                                                   03495000
          o LOOPBACK READ (function code 76)                            03500000
                                                                        03505000
              This request reads the data written into the internal     03510000
              buffer from the LOOPBACK WRITE function.                  03515000
                                                                        03520000
              The transfer count must be the same as that used for the  03525000
              LOOPBACK Write request.                                   03530000
                                                                        03535000
                                                                        03540000
          o GENERAL PURPOSE COMMAND (function code 77).                 03545000
                                                                        03550000
              This request allows the requestor to create their own     03555000
              command requests to be sent through the initiate and      03560000
              report phases.  It is up to the user to ensure that       03565000
              commands submitted through this request are valid and in  03570000
              the proper sequence.  No execution phase is available for 03575000
              this request.                                             03580000
                                                                        03585000
              The transfer count must be a positive number indicating   03590000
              the number of command bytes to be transferred to the      03595000
              device.                                                   03600000
                                                                        03605000
                                                                        03610000
          o RELEASE (function code 79)                                  03615000
                                                                        03620000
              This request releases the device for a period of time     03625000
              allowing it to service an internal requirement such as    03630000
              cartridge insertion (power on), unload sequence, or       03635000
              sparing.                                                  03640000
                                                                        03645000
                                                                        03650000
          o RELEASE DENIED (function code 80)                           03655000
                                                                        03660000
              This request prohibits the device from releasing itself.  03665000
                                                                        03670000
                                                                        03675000
          o SET RELEASE (function code 81)                              03680000
                                                                        03685000
              This request enables or disables an automatic release by  03690000
              the device during idle time.  It also enables or disables 03695000
              the release timeout interval.  The default for this is a  03700000
              two second timeout interval with automatic release        03705000
              enabled.                                                  03710000
                                                                        03715000
                                                                        03720000
$PAGE                                                                   03725000
          o SET ADDRESS (function code 82)                              03730000
                                                                        03735000
              This request will set the value of the target address.    03740000
              This address is then used by other commands in accessing  03745000
              data on the tape.  Upon completion of a transaction which 03750000
              uses the target address, the target address will point to 03755000
              the block after the last block accessed during that       03760000
              transaction.                                              03765000
                                                                        03770000
              NOTE:  Buffalo supports only single vector addressing.    03775000
                                                                        03780000
                                                                        03785000
          o SPARE BLOCK (function code 88)                              03790000
                                                                        03795000
              This request allows the host to give the device permission03800000
              to become temporarily busy while sparing a block.         03805000
                                                                        03810000
                                                                        03815000
$PAGE                                                                   03820000
          o INITIATE UTILITY (function code 91)                         03825000
                                                                        03830000
              This request directs the device to perform one utility    03835000
              routine.  Buffalo supports the following utilities:       03840000
                                                                        03845000
              1) Pattern Error Rate Test                                03850000
              2) Read Error Rate Test Log                               03855000
              3) Read Error Log                                         03860000
              4) Read Use Log                                           03865000
              5) Read Drive Tables (Manufacturer's and Spare Block)     03870000
              6) Recieve User Pattern (for Error Rate Test)             03875000
              7) Clear Logs                                             03880000
              8) Read Revision Number                                   03885000
              9) Preset Drive                                           03890000
             10) Read Error Summary                                     03895000
                                                                        03900000
              The maximum transfer count is 32767 words.  A transfer    03905000
              count of zero is invalid.                                 03910000
                                                                        03915000
                                                                        03920000
          o CHANNEL INDEPENDENT CLEAR (function code 92)                03925000
                                                                        03930000
              This request places the device into a known reset state.  03935000
              If this request is sent to unit 15, all devices on a      03940000
              shared controller and the controller will be reset, the   03945000
              unit number being left at zero upon completion of this    03950000
              command.                                                  03955000
                                                                        03960000
                                                                        03965000
          o CANCEL (function code 93)                                   03970000
                                                                        03975000
              This function causes the device to gracefully terminate   03980000
              the current transaction, leaving it in the reporting      03985000
              phase.                                                    03990000
                                                                        03995000
                                                                        04000000
          o HP-IB PARITY CHECKING (function code 94)                    04005000
                                                                        04010000
              This request enables or disables parity checking on the   04015000
              secondary command parameter.                              04020000
                                                                        04025000
              Parity checking will always be on except for diagnostic   04030000
              purposes through this function.                           04035000
                                                                        04040000
          o LAST STATUS REQUEST (function code 95)                      04045000
                                                                        04050000
              Same as function code 7.                                  04055000
                                                                        04060000
                                                                        04065000
          o GENERIC DIAG. REQUEST (function code 96)                    04070000
                                                                        04075000
                                                                        04080000
          o CHANNEL INDEPENDENT CLEAR (function code 97)                04085000
                                                                        04090000
              Same as function code 92.                                 04095000
                                                                        04100000
                                                                        04105000
   2.6.2.7  NON-SUPPORTED FUNCTIONS.                                    04110000
                                                                        04115000
            HIOCTAP1 will not support the following individual          04120000
            requests.                                                   04125000
                                                                        04130000
            Read With Three Vector Address                              04135000
            Write With Three Vector Address                             04140000
            Set Return Addressing Mode                                  04145000
            Set Rotational Position Sensing                             04150000
            Set Unit                                                    04155000
            Set Length                                                  04160000
            Set Burst Mode                                              04165000
            Write File Mark                                             04170000
            Selected Device Clear                                       04175000
            Copy Data                                                   04180000
            No Op                                                       04185000
                                                                        04190000
                                                                        04195000
3  MAJOR DATA STRUCTURES                                                04200000
                                                                        04205000
   There are four MPE tables used by the driver.  These are the Device  04210000
   Reference Table (DRT), Device Information Table (DIT), Interrupt     04215000
   Linkage Table (ILT), and Input/Output Queue (IOQ) table.             04220000
                                                                        04225000
                                                                        04230000
$PAGE                                                                   04235000
 3.1  DEVICE REFERENCE TABLE (DRT)                                      04240000
                                                                        04245000
      There is one DRT for each device controller configured on the     04250000
      system.  The contents of the table are used for processing        04255000
      interrupts.                                                       04260000
                                                                        04265000
      word 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   MNEMONIC    04270000
             ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---          04275000
        0    |        Channel Program Pointer (SIOP)         |  DRT0    04280000
             |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|          04285000
        1    | Channel Program Variable Area Pointer (CPVA)  |  DRT1    04290000
             |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|          04295000
        2    |        Interrupt Handler Program Label |  DRT2           04300000
             |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|          04305000
        3    |ST|SH|PF|          Status |WS|GF|DT|WT|  DRT3             04310000
             ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---          04315000
                                                                        04320000
      DRT0 - Channel Program Pointer.                                   04325000
             Absolute address of the current I/O instruction in         04330000
             execution for this device.                                 04335000
                                                                        04340000
      DRT1 - Channel Program Variable Area Pointer.                     04345000
             Absolute address of the base of the Interrupt Linkage Table04350000
             (ILT) Points to first word of the Channel Program Variable 04355000
             Area of the ILT for controller.                            04360000
                                                                        04365000
      DRT2 - Interrupt Handler Program Label.                           04370000
             The external program label of the interrupt service routine04375000
             for the controller.                                        04380000
                                                                        04385000
      DRT3 - Channel Program Status.                                    04390000
             Contains channel program status information which is used  04395000
             by the channel program interpreter.                        04400000
               ST - channel program is running.                         04405000
               SH - SIOP or HIOP instruction pending.                   04410000
               PF - powerfail recovery in progress.                     04415000
               WS - waiting for device status request.                  04420000
               GF - GIC FIFO buffer not empty.                          04425000
               DT - DMA transfer active.                                04430000
               WT - channel program in wait state.                      04435000
                                                                        04440000
                                                                        04445000
$PAGE                                                                   04450000
 3.2  DEVICE INFORMATION TABLE (DIT)                                    04455000
                                                                        04460000
      There is one DIT per physical device.  If a physical device       04465000
      represents more than one logical device, the logical device number04470000
      is obtained from the IOQ array.                                   04475000
                                                                        04480000
    word    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   MNEMONIC   04485000
          ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---             04490000
     0    |TM|DS|AC|RQ| 0| 0| 0|IO|IA|NO|ST| 0|   State   |  DFLAG      04495000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04500000
     1    | SYSDB relative pointer to the DIT for the next|  DLINK      04505000
          | device requesting this resource or service    |             04510000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04515000
     2    |          Pointer to the current IOQ           |  DIOQP      04520000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04525000
     3    |             Logical device number             |  DLDEV      04530000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04535000
     4    | SYSDB relative pointer to Device Linkage Table|  DDLTP      04540000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04545000
     5    | SYSDB relative pntr to Interrupt Linkage Table|  DILTP      04550000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04555000
     6    | Set to -1 when system powerfail occurs.       |  DSTAT      04560000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04565000
     7    | Hardware error status.  Set when the driver   |  DSERR      04570000
          | detects an error.  Whenever <> 0, the driver  |             04575000
          | monitor logs an I/O error and clears this word|             04580000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04585000
     8    |       index of first request in the queue     |  DQHEAD     04590000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04595000
     9    |       index of last request in the queue      |  DQTAIL     04600000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04605000
    10    | IOT |                 | Physical Unit #       |  DUNIT      04610000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04615000
    11    |LK|IG|IM|                          | SUBSTATE  |  DMISC      04620000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04625000
    12    | High order logical sector address of bad block|  DBADBLK1   04630000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04635000
    13    | Low order logical sector address of bad block.|  DBADBLK2   04640000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04645000
    14    | Byte transfer left when bad block occured     |  DBADXFER   04650000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04655000
    15    | Hardware logged error status - CPVA (0).      |  DLOGERROR  04660000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04665000
    16    | Relative offset of channel program abort.     |  CSIOPSTOP  04670000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04675000
    17    | Accum byte count of transfer > 6144 bytes.    |  DBYTECNT   04680000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04685000
    18    |                                               |             04690000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04695000
    19    | Device status (20 bytes), errors logged       |  DSTATUS    04700000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04705000
     .    |                     .                         |             04710000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04715000
     .    |                     .                         |             04720000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04725000
    25    |                     .                         |             04730000
          |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|             04735000
                                                                        04740000
$PAGE                                                                   04745000
      DFLAG - Device flags and request state.                           04750000
              TM    - Set if device is a terminal                       04755000
              DS    - If TM = 0 and this bit is set then device is      04760000
                      a disc, otherwise device dependent.               04765000
              AC    - A monitor is currently servicing this device.     04770000
              RQ    - A service request is pending while the monitor    04775000
                      is active.                                        04780000
              IO    - An I/O channel program is running for this        04785000
                      device.                                           04790000
              IA    - An interrupt or response has occurred for this    04795000
                      device.                                           04800000
              NO    - Not ready, start idle channel program then go to  04805000
                      state %10.                                        04810000
              ST    - The device monitor is starting an idle channel    04815000
                      program for this device.  There is no IOQ         04820000
                      associated with this state.                       04825000
              STATE - State of the device monitor.  Specifies the next  04830000
                      action to be taken by SIODM in servicing the      04835000
                      request:                                          04840000
                      0   - Start a new request.                        04845000
                      1   - Not used.                                   04850000
                      2   - Call driver initiator procedure.            04855000
                      3   - Call driver completor procedure.            04860000
                      4   - Not used.                                   04865000
                      5   - Request complete.                           04870000
                      6   - Initiate device recognition sequence.       04875000
                      7   - Start operator intervention wait.           04880000
                      %10 - Wait for interrupt (operator intervention), 04885000
                            restart at state 0.                         04890000
                      %11 - Wait for data segment freeze, then state 2. 04895000
                      %12 - Wait for driver initiator to be frozen,     04900000
                            then allocate controller (state 2).         04905000
                      %13 - Wait for I/O completion interrupt, then     04910000
                            state 3.                                    04915000
                      %14 - Wait for controller, then call driver       04920000
                            initiator.                                  04925000
                      %15 - Not used.                                   04930000
                      %16 - Wait for initiator make present, then       04935000
                            state 2.                                    04940000
                      %17 - Wait for completor make present, then       04945000
                            state 3.                                    04950000
                                                                        04955000
      DLINK,                                                            04960000
      DQHEAD,                                                           04965000
      DQTAIL,                                                           04970000
      DUNIT - Not used.                                                 04975000
                                                                        04980000
      DMISC - Miscellaneous device information.                         04985000
              LK       - Lock flag denoting unload status of the        04990000
                         device.                                        04995000
                         0 - Allow operator unload of the volume.       05000000
                         1 - Deny operator unload of the volume.        05005000
              IG       - Ignore unexpected interrupt flag.              05010000
              IM       - Immediate report.                              05015000
                         0 - Disabled.                                  05020000
                         1 - Enabled.                                   05025000
              SUBSTATE - Idle channel program state.                    05030000
                         0 - Normal idle channel program wait.          05035000
                         1 - Idle request being serviced wait.          05040000
                                                                        05045000
      DBADBLK1 - High order logical sector address of bad block         05050000
                 encountered.                                           05055000
                                                                        05060000
      DBADBLK2 - Low order logical sector address of bad block          05065000
                 encountered.                                           05070000
                                                                        05075000
      DBADXFER - Byte transfer left when bad block occured.             05080000
                                                                        05085000
      DLOGERROR - CPVA (0) logged on hardware error status.             05090000
                                                                        05095000
      DSIOPSTOP - Relative offset location of channel program when      05100000
                  error in CPVA (0) occured.                            05105000
                                                                        05110000
      DBYTECNT - Accummulative transfer count for transfers greater     05115000
                 than 6144 bytes.                                       05120000
                                                                        05125000
      DSTATUS - 20  bytes of status logged when a status error occurs.  05130000
                (Refer to CS/80 Instruction Set manual for description.)05135000
                                                                        05140000
                                                                        05145000
$PAGE                                                                   05150000
 3.3  INTERRUPT LINKAGE TABLE (ILT)                                     05155000
                                                                        05160000
      There is one ILT for each device controller configured on the     05165000
      system.                                                           05170000
                                                                        05175000
      Word    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   MNEMONIC 05180000
            ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---           05185000
        0   |                    Channel                    |  ICPVA0   05190000
        1   |                    Program                    |  ICPVA1   05195000
        2   |                    Variable                   |  ICPVA2   05200000
        3   |                  Area (ICPVA)                 |  ICPVA3   05205000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05210000
        4   |                   DMA Abort                   |  ICPVA4   05215000
        5   |                    Address                    |  ICPVA5   05220000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05225000
        6   |                       0                       |  ISRQL    05230000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05235000
        7   |LI|     CHANQUE     |     |   CHAN    |  DEV   |  ICNTRL   05240000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05245000
        8   | SYSDB relative pointer to Channel Program area|  ISIOP    05250000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05255000
        9   | SYSDB relative pointer to idle status area.   |  ISTAP    05260000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05265000
       10   | Single instruction that is executed to extract|  IUNIT    05270000
            | the device unit number from the status pointed|           05275000
            | to by ISTAP.                                  |           05280000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05285000
       11   | SYSDB  relative  DIT  pointer  of  the  device|  ICDP     05290000
            | currently using the  channel to perform a data|           05295000
            | operation.                                    |           05300000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05305000
       12   |       SIOPSIZE        |         CQUEN         |  IQUEUE   05310000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05315000
       13   |RW|WP|IG|                          |  HCUNIT   |  IFLAG    05320000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05325000
       14   | SYSDB relative DIT pointer for unit 0  *      |  IDITP0   05330000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05335000
       15   | 20 bytes of idle channel program status area. |  ISTAT    05340000
        .   |                     .                         |           05345000
        .   |                     .                         |           05350000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05355000
       25   |           Channel program area.               |           05360000
        .   |                     .                         |           05365000
        .   |                     .                         |           05370000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05375000
                                                                        05380000
      * This driver does not support more than one unit.                05385000
                                                                        05390000
$PAGE                                                                   05395000
      ICPVA0 - Channel Program Variable Area                            05400000
               ICPVA0 is used by the channel program processor to store 05405000
               status information after I/O  channel aborts.            05410000
      ICPVA1 - Used by the driver to indicate if status should be       05415000
               examined for special conditions or errors.               05420000
      ICPVA2 - Not used.                                                05425000
      ICPVA3 - Not used.                                                05430000
      ICPVA4 & ICPVA5 - Absolute address where a DMA abort occurred.    05435000
      ICNTRL - Controller Information                                   05440000
               LI      - If this bit is set, the controller is sharing  05445000
                         a software channel resource in order to limit  05450000
                         bandwidth.                                     05455000
               CHANQUE - The software channel resource number.          05460000
               CHAN    - Channel number (four most significant bits of  05465000
                         DRTN).                                         05470000
               DEV     - Device number (three least significant bits of 05475000
                         DRTN).                                         05480000
                                                                        05485000
      IQUEUE -                                                          05490000
               SIOPSIZE - Channel program area size,                    05495000
                          (number of words + 1) / 2.                    05500000
               CQUEN    - For a multi-unit controller this field        05505000
                          contains the software controller resource     05510000
                          number.                                       05515000
                                                                        05520000
      IFLAG - Controller and Channel Program state flags.               05525000
              RW     - RUNWAIT, an idle channel program should be       05530000
                       started when there are no active requests to     05535000
                       process.                                         05540000
              WP     - WAITPROG, an idle channel program has been       05545000
                       started for this controller.  This bit is reset  05550000
                       by an interrupt.                                 05555000
              IG     - IGNOREHI, an HIOP  instruction has been issued   05560000
                       against this statement.  Therefore ignore the    05565000
                       interrupt generated by the channel code when this05570000
                       program halts.                                   05575000
              HCUNIT - Highest configured unit number for this          05580000
                       controller.                                      05585000
                                                                        05590000
      ISTAT - 20  bytes resevered for status.                           05595000
$PAGE                                                                   05600000
 3.4  I/O QUEUE REQUEST TABLE (IOQ)                                     05605000
                                                                        05610000
      WORD    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   MNEMONIC 05615000
       (%)  ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---           05620000
        0   |            Request dependent flags            |  QFLAG    05625000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05630000
        1   | SYSDB relative pointer to next IOQ element.   |  QLINK    05635000
            | Points to first word of element.              |           05640000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05645000
        2   |     Logical device number                     |  QLDEV    05650000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05655000
        3   |RS|OP|IM|LF|SP|VE|UR|   RC   |     |    WC     |  QMISC    05660000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05665000
        4   | S| If QFLAG.(3:1) is clear then this is the   |  QDSTN    05670000
            |    DST number of the target data segment.  If |           05675000
            |    S is set, QADDR is DB relative.            |           05680000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05685000
        5   | offset in the data segment or system buffer   |  QADDR    05690000
            | table to the target data buffer.              |           05695000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05700000
        6   |                       | Function code.        |  QFUNC    05705000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05710000
        7   | On initiation, specifies the word count (> 0) |  QCOUNT   05715000
            | or byte count (< 0).  At completion of the    |           05720000
            | request this location contains the actual     |           05725000
            | transmission count in the same units (bytes   |           05730000
            | or words) as in the request.                  |           05735000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05740000
        8   | High order address of location on tape.       |  QPARM1   05745000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05750000
        9   | Low order address of location on tape.        |  QPARM2   05755000
            |--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|           05760000
       10   |                       |  QUALIFIER   | STATUS |  QSTAT    05765000
            ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---           05770000
       11   |         Process Control Block number          |  QPCB     05775000
            ---+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---           05780000
                                                                        05785000
                                                                        05790000
$PAGE                                                                   05795000
      QFLAG - Request dependent flags.                                  05800000
              Bit  0 - ABORT, abort this request and return an error    05805000
                       indication to the caller.                        05810000
                   1 - SPECIAL, apply special handling to this request  05815000
                       (not used).                                      05820000
                   2 - DIAG, this is a request from the diagnostic      05825000
                       subsystem.                                       05830000
                   3 - SYSBUFF, target is an index relative to the SBUF 05835000
                       Table of the data buffer.                        05840000
                   4 - IOWAKE, wake caller on completion of request.    05845000
                   5 - BLOCKED, blocked I/O.  The caller is waited in   05850000
                       ATTACHIO until the request is completed.  Implies05855000
                       IOWAKE.                                          05860000
                   6 - COMPLETED, the request has been completed and    05865000
                       the caller awakened if he had requested (with    05870000
                       IOWAKE).                                         05875000
                   7 - DATAFRZN, set by the memory management routines  05880000
                       (MAM) when a MAKEPRESENT request is successfully 05885000
                       completed and indicates the data segment is      05890000
                       frozen in memory.                                05895000
                   8 - MAMERRORD, an error has occurred while MAM was   05900000
                       trying to make the target data segment present   05905000
                       and freeze it in memory.                         05910000
                   9 - PREQ, (not used).                                05915000
                  10 - SFAIL, delayed failure of SIO instruction.  If a 05920000
                       call to START'HPIB resulted in the request being 05925000
                       added to the the channel queue, this bit         05930000
                       indicates that the SIO instruction failed when   05935000
                       the request was selected for execution.          05940000
                  11 - PFAIL, The request was aborted because of a      05945000
                       system power failure.                            05950000
                                                                        05955000
      QMISC - Driver request dependent flags.                           05960000
              RS - Request status failed.                               05965000
              OP - Operator requested release.                          05970000
              IM - Internal maintenance fault.                          05975000
              LF - Media loaded.                                        05980000
              SP - System powerfail.                                    05985000
              VE - Verify error.                                        05990000
              UR - Unload due to no write ring.                         05995000
              RC - Retry count field.                                   06000000
              WC - Wait code.                                           06005000
                   0 - new request.                                     06010000
                   1 - completion wait.                                 06015000
                   2 - not ready wait.                                  06020000
                   3 - release/release deny wait.                       06025000
                   4 - IOQ defer wait.                                  06030000
                   7 - synchronization wait.                            06035000
                                                                        06040000
$PAGE                                                                   06045000
      QSTAT - STATUS    - General status indicating the final state of  06050000
                          the request.  The following codes are used:   06055000
                          0 - Not started or awaiting completion.       06060000
                          1 - Successful completion.                    06065000
                          2 - End-Of-File detected.                     06070000
                          3 - Unusual, but recoverable, condition detect06075000
                          4 - Irrecoverable error has occurred.         06080000
              QUALIFIER - A code which further defines or qualifies the 06085000
                          general status.  (See Driver Return Status    06090000
                          Codes.)                                       06095000
                                                                        06100000
      QPCB  - The Process Control Block (PCB) number of the process     06105000
              which made this request.  If zero, the request is not     06110000
              associated with any process and the IOQ element is to be  06115000
              returned by the system when the request has completed.    06120000
$PAGE                                                                   06125000
4  IOQ I/O STATUS                                                       06130000
                                                                        06135000
   The following status values are returned by the Buckhorn driver.     06140000
                                                                        06145000
   General Status (13:3)     Qualifying Status (8:5)        Overall     06150000
                                                            Value       06155000
                                                                        06160000
   0 - Pending               1 - Completion wait            %10         06165000
                             3 - Not ready wait             %30         06170000
                                                                        06175000
   1 - Successful            0 - No errors                    1         06180000
                             2 - Retry was necessary        %21         06185000
                                                                        06190000
   3 - Unusual condition     1 - Status interrogation       %13*        06195000
                                 required                               06200000
                             3 - Request aborted            %33         06205000
                             4 - Prior error abort          %43         06210000
                             6 - Powerfail abort            %63         06215000
                           %21 - Device powered up         %213*        06220000
                                                                        06225000
   4 - Irrecoverable error   0 - Invalid request              4         06230000
                             1 - Track/Sector error         %14         06235000
                             2 - I/O timed out before       %24         06240000
                                 complete                               06245000
                             4 - SIO failure                %44         06250000
                             5 - Unit failure               %54         06255000
                             6 - Invalid address            %64         06260000
                           %12 - System error              %124         06265000
                           %14 - Channel failure           %144         06270000
                           %15 - Unitialized media         %154         06275000
                           %16 - No spares available       %164         06280000
                                                                        06285000
   * These status are used for diagnostic reporting only.               06290000
                                                                        06295000
                                                                        06300000
$PAGE                                                                   06305000
5  GENERIC STATUS LAYOUT                                                06310000
                                                                        06315000
   Bit    Meaning                                                       06320000
                                                                        06325000
   15     Immediate report                                              06330000
          0 = Disabled                                                  06335000
          1 = Enabled                                                   06340000
                                                                        06345000
   12-14  Reject Errors                                                 06350000
          000 = No Fatal Error                                          06355000
          001 = Channel Parity Error                                    06360000
          010 = Illegal Opcode                                          06365000
          011 = Illegal Module Address                                  06370000
          100 = Address Bounds Violation                                06375000
          101 = Illegal Parameter Length                                06380000
          110 = Illegal Message Sequence                                06385000
          111 = Illegal Message Length                                  06390000
                                                                        06395000
    8-11  Fault Errors                                                  06400000
          0000 = No Fault Errors                                        06405000
          0001 = Cross Unit Fault                                       06410000
          0010 = Controller Fault                                       06415000
          0011 = Unit Fault                                             06420000
          0100 = Diagnostic Failure                                     06425000
          0101 = Release Required                                       06430000
          0110 = Powerfail                                              06435000
          0111 = Retransmit Data                                        06440000
                                                                        06445000
    4-7   Access Errors                                                 06450000
          0000 = No Access Errors                                       06455000
          0001 = Illegal Parallel Operation                             06460000
          0010 = Unitialized Media                                      06465000
          0011 = No Spares Available                                    06470000
          0100 = Unit Not Ready                                         06475000
          0101 = Write Protected                                        06480000
          0110 = No Data Found                                          06485000
          0111 = Unrecoverable Data Overflow                            06490000
          1000 = Unrecoverable Data                                     06495000
          1001 = End-of-file                                            06500000
          1010 = End-of-volume                                          06505000
                                                                        06510000
    0-3   Information Fields                                            06515000
          0000 = No Information                                         06520000
          0001 = Operator Release Request                               06525000
          0010 = Diagnostic Release Request                             06530000
          0011 = Internal Maintenance Release Request                   06535000
          0100 = Media Wear                                             06540000
          0101 = Auto Sparing Invoked                                   06545000
          0110 = Recoverable Data Overflow                              06550000
          0111 = Marginal Data                                          06555000
          1000 = Recoverable Data                                       06560000
          1001 = Maintenance Track Overflow                             06565000
                                                                        06570000
   Refer to the CS/80 Instruction Set manual for definition of          06575000
   these items.                                                         06580000
                                                                        06585000
                                                                        06590000
$PAGE                                                                   06595000
6.1  CS/80 DEVICE STATUS                                                06600000
                                                                        06605000
   BYTE      STRUCTURE       FIELD                                      06610000
   ----      ---------       -----                                      06615000
                                                                        06620000
   0         VVVVUUUU        ID, VVVV - Volume, UUUU - Unit             06625000
   1         SSSSSSSS        ID, S - Value of the lowest numbered unit  06630000
                                     with status pending.  All ones     06635000
                                     indicate no units have status      06640000
                                     pending.                           06645000
   2-3       RRRRRRRR        Reject Error                               06650000
   4-5       FFFFFFFF        Fault Error                                06655000
   6-7       AAAAAAAA        Access Error                               06660000
   8-9       IIIIIIII        Information Error                          06665000
                                                                        06670000
   P1-P10    PPPPPPPP        Ten Parameter Associated Bytes             06675000
                                                                        06680000
   Reject Errors Field       Bits  0-15   00A00BCD EFG0H000             06685000
   Fault Errors Field        Bits 16-31   0A0B00C0 D0EFG0HI             06690000
   Access Errors Field       Bits 32-47   ABCDEF00 GH0IJ000             06695000
   Information Errors Field  Bits 48-63   ABCDE00F 0GHI0J00             06700000
                                                                        06705000
   Bit Pos.  Bit No.  Usage   [Reject Errors Field]                     06710000
                                                                        06715000
      A           2   Channel Parity Error                              06720000
      B           5   Illegal Opcode                                    06725000
      C           6   Module Addressing Error                           06730000
      D           7   Address Bounds Error                              06735000
      E           8   Parameter Bounds Error                            06740000
      F           9   Illegal Parameter                                 06745000
      G          10   Message Sequence Violation                        06750000
      H          12   Message Length Difference                         06755000
                                                                        06760000
   Bit Pos.  Bit No.  Usage   [Fault Errors Field]                      06765000
                                                                        06770000
      A          17   Cross-Unit (Linus)                                06775000
      B          19   Controller Fault                                  06780000
      C          22   Unit Fault                                        06785000
      D          24   Diagnostic Result Failed                          06790000
                      (P1-P6 = 6 bytes result)                          06795000
      E          26   Release Required for Operator Request             06800000
                      (Load/Unload)                                     06805000
      F          27   Release Required for Diagnostic Request           06810000
                      (HIO, Selftest)                                   06815000
      G          28   Release Required for Internal Maintenance         06820000
                      (Head Alignment, Error Log)                       06825000
      H          30   Power Fail                                        06830000
      I          31   Retransmit/Release Completed                      06835000
                                                                        06840000
$PAGE                                                                   06845000
   Bit Pos.  Bit No.  Usage   [Access Errors Field]                     06850000
                                                                        06855000
      A          32   Illegal Parallel Operation (Not Implemented)      06860000
      B          33   Uninitialized Media                               06865000
      C          34   No Spares Available                               06870000
      D          35   Not Ready                                         06875000
      E          36   Write Protect (Linus)                             06880000
      F          37   No Data Found (Linus)                             06885000
      G          40   Unrecoverable Data Overflow                       06890000
      H          41   Unrecoverable Data                                06895000
                      (P1-P6  = 6 bytes of bad block address)           06900000
      I          43   End of File (Linus)                               06905000
      J          44   End of Volume                                     06910000
                                                                        06915000
   Bit Pos.  Bit No.  Usage   [Information Errors Field]                06920000
                                                                        06925000
      A          48   Release Request for Operator Request              06930000
                      (Load/Unload)                                     06935000
      B          49   Release Request for Diagnostic Request            06940000
                      (HIO, Selftest)                                   06945000
      C          50   Release Request for Internal Maintenance          06950000
                      (Head Alignment, Error Log)                       06955000
      D          51   Media Wearing                                     06960000
      E          52   Data Overrun                                      06965000
      F          55   Auto-sparing Invoked (Linus)                      06970000
      G          57   Recoverable Data Overflow                         06975000
      H          58   Marginal Data                                     06980000
                      (P1-P6  = 6 bytes of marginal block address)      06985000
      I          59   Recoverable Data                                  06990000
                      (P1-P6  = 6 bytes of recoverable block address)   06995000
      J          61   Maintenance Track Overflow                        07000000
                                                                        07005000
   Parameter Usage:                                                     07010000
                                                                        07015000
   Byte -->              |  1  2  3  4  5  6       7   8   9   10     | 07020000
                                                                        07025000
   No Error              | New Target Address |                       | 07030000
   Diagnostic Result (24)| Diagnostic Results |  Device fault log --  | 07035000
   Unrecoverable Data(41)| Address of Block   |  except after a Spare | 07040000
   Marginal Data     (58)| Address of Block   |  indicate length of   | 07045000
   Recoverable Data  (59)| Address of Block   |  unrecoverable field  | 07050000
                                                                        07055000
   * SPECIAL NOTE:  Drive status are not pertinent unless a QSTAT 1     07060000
                    occurred prior to taking status.  Driver will often 07065000
                    do a LOC & WRT with zero length to force the "Not   07070000
                    Ready" condition to appear in status.               07075000
                                                                        07080000
$PAGE                                                                   07085000
6.2   GENERIC STATUS LAYOUT                                             07090000
                                                                        07095000
        Bit     Meaning                                                 07100000
                                                                        07105000
        0-3     Fatal Errors                                            07110000
                0000 = No fatal error.                                  07115000
                0001 = Tape runaway.                                    07120000
                0010 = Multiple tracks in error (MTE).                  07125000
                0011 = Timing error.                                    07130000
                0100 = Command reject.                                  07135000
                0101 = Unit failure.                                    07140000
                0110 = Data parity error.                               07145000
                0111 = Command parity error.                            07150000
                                                                        07155000
        4-6     Density                                                 07160000
                000 = Unrecognized density.                             07165000
                001 = 800 BPI (NRZI).                                   07170000
                010 = 1600 BPI (PE).                                    07175000
                011 = 6250 BPI (GCR).                                   07180000
                                                                        07185000
        7-8     Unit Number                                             07190000
                00 = Unit 0                                             07195000
                01 = Unit 1                                             07200000
                10 = Unit 2                                             07205000
                11 = Unit 3                                             07210000
                                                                        07215000
        9       End-of-file (EOF).                                      07220000
        10      Beginning-of-tape (BOT)/Load Point.                     07225000
        11      End-of-tape (EOT).                                      07230000
        12      Immediate Report Enabled.                               07235000
        13      Single Track in Error (STE).                            07240000
        14      Unit Online.                                            07245000
        15      File Protect (no write ring).                           07250000
                                                                        07255000
                                                                        07260000
$PAGE                                                                   07265000
7  RELEASE CONSIDERATIONS                                               07270000
                                                                        07275000
   Release will always be granted for Internal Maintenance requests (   07280000
   Head Alignment, Error Log).                                          07285000
                                                                        07290000
   Release will always be denied for Diagnostic requests                07295000
   (HIO, Selftest).  Release will be denied for Operator (Load/Unload)  07300000
   request when the disc is in a locked state and granted when the disc 07305000
   is in an unlocked state.                                             07310000
                                                                        07315000
   On a status return, under the fault error field, the internal        07320000
   maintenance status should be the only status generating a release    07325000
   required.  Operator and diagnostic requests generating a release     07330000
   required should never occur and such occurrences will be flagged as  07335000
   errors.                                                              07340000
                                                                        07345000
                                                                        07350000
8  LOCK/UNLOCK CONSIDERATIONS                                           07355000
                                                                        07360000
   The driver maintains a Lock/Unlock bit in the DIT which is set or    07365000
   cleared when various MPE modules call the driver Lock and Unlock     07370000
   function code.  Operator request to unload the volume mounted will be07375000
   denied when the Lock bit is set and allowed only when the Lock bit is07380000
   cleared.                                                             07385000
                                                                        07390000
                                                                        07395000
 8.1  PRIVATE VOLUMES                                                   07400000
                                                                        07405000
      These are locked by the PVSYS module at the first logical mount   07410000
      and are unlocked at the last logical dismount.                    07415000
                                                                        07420000
                                                                        07425000
 8.2  SERIAL AND FOREIGN VOLUMES                                        07430000
                                                                        07435000
      These are locked for each FOPEN to the file and unlocked after    07440000
      each DCLOSE to the file.                                          07445000
                                                                        07450000
      Note:  PVPROC will lock all non-system volumes while processing   07455000
             any unexpected interrupts passed to it by DEVREC.          07460000
                                                                        07465000
                                                                        07470000
$PAGE                                                                   07475000
9  LOGGING CONSIDERATIONS                                               07480000
                                                                        07485000
   CPVA(0) along with the channel program aborted relative offset is    07490000
   logged for the following reasons:                                    07495000
                                                                        07500000
   1) DMA Abort -  DMA transfer aborted by memory errors.               07505000
   2) Channel Program Execution Error -  An error is detected by        07510000
      the CPP while servicing the channel program.                      07515000
                                                                        07520000
   20 bytes of disc status are logged for any errors occurring in the   07525000
   status fields.  (See CS/80 Device Status)                            07530000
                                                                        07535000
   Logging will not occur for the status Data Overrun since this can    07540000
   occur even under normal operating conditions when there are several  07545000
   high speed devices on more than one GIC.                             07550000
                                                                        07555000
   Logging is exempted when the driver is in diagnostics mode.          07560000
                                                                        07565000
                                                                        07570000
10  UNEXPECTED INTERRUPTS HANDLING                                      07575000
                                                                        07580000
    To avoid processing unexpected interrupts from the CS/80 device due 07585000
    to Internal Maintenance (ie.  error logging and head alignments),   07590000
    DEVREC will always issue a request status to the driver with IOQ    07595000
    word QPAR1 = 8 and QPAR2 = 9 once an unexpected interrupt has       07600000
    occurred.  The driver will then return to DEVREC the pattern %10101007605000
    for interrupts it wishes DEVREC to ignore or return the first word  07610000
    of status for interrupts it wishes DEVREC to process.               07615000
                                                                        07620000
    Note:  The driver will set the Ignore Interrupt flag in the DIT     07625000
           for all unexpected interrupts except Operator Request Release07630000
           and Power On condition.  The Ignore Interrupt flag will be   07635000
           cleared after returning the ignore pattern to DEVREC's status07640000
           request.                                                     07645000
                                                                        07650000
                                                                        07655000
11  STATUS CONSIDERATIONS                                               07660000
                                                                        07665000
    While the idle channel program is running, status will be read into 07670000
    the ILT table pointed to by ILT(ISTAP).  While an IOQ is being      07675000
    processed by the driver, status will be read into the DIT table.    07680000
    The driver will always reset the read status pointer back to the ILT07685000
    after processing an IOQ request.  This is neccesary since SIODM will07690000
    not call the driver to reschedule the idle when the idle has not    07695000
    been aborted.  This will occur for the driver functions which do not07700000
    execute a START'HPIB (ie. Lock, Unlock, Fopen, etc.)                07705000
                                                                        07710000
                                                                        07715000
$PAGE                                                                   07720000
              Parameters for CS'80 Buffalo Driver Requests              07725000
              --------------------------------------------              07730000
                                                                        07735000
[ Note:  Count = (+) denotes #words ]                                   07740000
[              = (-) denotes #bytes ]                                   07745000
[                                   ]                                   07750000
                                                                        07755000
OPERATION            FUNCTION    PARAMETERS                             07760000
---------            --------    ----------                             07765000
                                                                        07770000
 Read                     0      Count - Transfer count                 07775000
                                                                        07780000
                                 Bank & Buffaddr contains               07785000
                                 data read.                             07790000
                                                                        07795000
                                 P1,P2 - Dbl wrd logical                07800000
                                         block address                  07805000
                                                                        07810000
 Write                    1      Count - Transfer count                 07815000
                                                                        07820000
                                 Bank & Buffaddr contains               07825000
                                 data for write.                        07830000
                                                                        07835000
                                 P1,P2 - Dbl wrd logical                07840000
                                         block address                  07845000
                                                                        07850000
 File Open                2      No parameters                          07855000
                                                                        07860000
 File Close               3      No parameters                          07865000
                                                                        07870000
 Device Close             4      No parameters                          07875000
                                                                        07880000
 Fill With Zeros          5      Count - Transfer count                 07885000
                                                                        07890000
                                 P1,P2 - Dbl wrd logical                07895000
                                         block address                  07900000
                                                                        07905000
 Fill With Blanks         6      Count - Transfer count                 07910000
                                                                        07915000
                                 P1,P2 - Dbl wrd logical                07920000
                                         block address                  07925000
                                                                        07930000
 Request Status           7      Count - Transfer count                 07935000
                                         (max status size 20 bytes)     07940000
                                                                        07945000
                                 Bank & Buffaddr for the return         07950000
                                 of the status.                         07955000
                                                                        07960000
 Initialize Media         8      P1 - Initialize Options                07965000
                                      [0=Retain factory,                07970000
                                         field spares]                  07975000
                                      [1=Retain factory                 07980000
                                         spares only]                   07985000
                                      [0=Retain]                        07990000
                                      [2=]                              07995000
                                                                        08000000
                            ???  P2 - Block Interleave                  08005000
                                      byte (binary number)              08010000
                                                                        08015000
 Unload Cartridge         9      No parameters                          08020000
                                                                        08025000
                                                                        08030000
 Write Disc Label        11      Count - Label count                    08035000
                                                                        08040000
                                 Bank & Buffaddr contains               08045000
                                 label info. to be written.             08050000
                                                                        08055000
                                 P1,P2 - Dbl wrd logical                08060000
                                         block address.                 08065000
                                                                        08070000
 Request Volume Limit    13      Bank & Buffaddr returns                08075000
                                 dbl wrd of size of tape                08080000
                                 mounted on the drive.                  08085000
                                                                        08090000
 Verify                  14      Count - Verify length                  08095000
                                         [0=Verify entire disc]         08100000
                                                                        08105000
                                 Bank & Buffaddr returns                08110000
                                 dbl wrd logical block                  08115000
                                 address of 1st bad block               08120000
                                 encountered with a error.              08125000
                                                                        08130000
                                 P1,P2 - Dbl wrd logical block address  08135000
                                         to begin doing verification.   08140000
                                                                        08145000
Generic Status           15      No parameters                          08150000
                                                                        08155000
Lock                     16      No parameters                          08160000
                                                                        08165000
Unlock                   17      No parameters                          08170000
                                                                        08175000
Read lock bit            18      Bank & Buffaddr returns                08180000
                                 the state of the DITs                  08185000
                                 lock flag.                             08190000
                                                                        08195000
Identify                 72      Bank & Buffaddr contains               08200000
                                 device ID returned.                    08205000
                                                                        08210000
Initiate Diag Selftest   73      P1 - 2 bytes loop count                08215000
                                      (#times to do diag)               08220000
                                 P2 - Selftest section                  08225000
                                      number to execute                 08230000
                                                                        08235000
Read Selftest Results    74      Bank & Buffaddr contains               08240000
                                 selftest results.                      08245000
                                                                        08250000
Loopback Write           75      Count - Transfer count                 08255000
                                                                        08260000
                                 Bank & Bankaddr contains               08265000
                                 loopback data for write.               08270000
                                 [Data sequence must begin              08275000
                                 with a Hex FF and each                 08280000
                                 byte which follows must                08285000
                                 equals its predecessor+1]              08290000
                                                                        08295000
Loopback Read            76      Count - Transfer count                 08300000
                                                                        08305000
                                 Bank & Buffaddr contains               08310000
                                 loopback data read.                    08315000
                                                                        08320000
General purpose command  77      Count - #Command bytes                 08325000
                                                                        08330000
                                 Bank & Buffaddr contains               08335000
                                 the command data bytes to              08340000
                                 be sent thru the command               08345000
                                 and reporting msg phase.               08350000
                                                                        08355000
Release                  79      No parameters                          08360000
                                                                        08365000
Release Denied           80      No parameters                          08370000
                                                                        08375000
Set Release              81      P1 - 1 Suppress release                08380000
                                        timeout [T bit=1]               08385000
                                 P2 - 1 Release automatically           08390000
                                        during idle time                08395000
                                        [Z bit=1]                       08400000
                                                                        08405000
Set Address              82      Bank & Buffaddr contains               08410000
                                 dbl wrd of logical block               08415000
                                 address.                               08420000
                                                                        08425000
Spare Block              88      Bank & Buffaddr contains               08430000
                                 dbl wrd of logical block               08435000
                                 address of the block to be             08440000
                                 spared.                                08445000
                                                                        08450000
                                 P2 - 0 Spare retaining                 08455000
                                        data without                    08460000
                                        target block                    08465000
                                    - 1 Spare without                   08470000
                                        retaining data                  08475000
                                    - 4 Spare retaining                 08480000
                                        data with target                08485000
                                        block                           08490000
                                                                        08495000
Initiate Utility         91     ----------------------------            08500000
                                |Case 1: No Exec Message   |            08505000
                                |                          |            08510000
                                |Count - Not Applicable    |            08515000
                                |Bank & Buffaddr contains: |            08520000
                                |                          |            08525000
                                |Word   0: Util byte cnt[N]|            08530000
                                |Word 1-N: Util parm bytes |            08535000
                                |          if byte cnt <> 0|            08540000
                                |                          |            08545000
                                |P1 - 0 No exec message    |            08550000
                                ----------------------------            08555000
                                                                        08560000
                                ----------------------------            08565000
                                |Case 2: Send Exec Message |            08570000
                                |                          |            08575000
                                |Count - Exec msg length   |            08580000
                                |Bank & Buffaddr contains: |            08585000
                                |                          |            08590000
                                |Word 0-Count: Utility data|            08595000
                                |       bytes to be sent to|            08600000
                                |       the device.        |            08605000
                                |                          |            08610000
                                |P1 - 1 Send exec message  |            08615000
                                ----------------------------            08620000
                                                                        08625000
                                ----------------------------            08630000
                                |Case 3: Rcv Exec Message  |            08635000
                                |                          |            08640000
                                |Count - Exec msg length   |            08645000
                                |Bank & Buffaddr contains: |            08650000
                                |                          |            08655000
                                |Word   0: Util byte cnt[N]|            08660000
                                |Word 1-N: Util parm bytes |            08665000
                                |          if byte cnt <> 0|            08670000
                                |                          |            08675000
                                |Bank & Buffaddr+10 return:|            08680000
                                |                          |            08685000
                                |Word 0-N: Util data infor.|            08690000
                                |          (optional)      |            08695000
                                |                          |            08700000
                                |P1 - 2 Rcv exec message   |            08705000
                                ----------------------------            08710000
                                                                        08715000
                                ----------------------------            08720000
                                |For All Cases]            |            08725000
                                |                          |            08730000
                                |P1 - Exec msg qualifier   |            08735000
                                |P2 - Utility number       |            08740000
                                ----------------------------            08745000
                                                                        08750000
Device Clear             92      No parameters                          08755000
                                                                        08760000
Cancel                   93      No parameters                          08765000
                                                                        08770000
Parity Checking          94      P1 - 0 Disables checking               08775000
                                    - 1 Enables checking                08780000
                                                                        08785000
                                                                        08790000
DIAGNOSTIC FUNCTIONS:  Will primarily be used by the MPE online         08795000
                       diagnostic package.  The diagnostic request      08800000
                       bit in the first word (QFLAG) of the disc        08805000
                       request queue should be set to allow the         08810000
                       diagnostic caller to handle its own status.      08815000
                       Otherwise the driver will assume that it had     08820000
                       been called by an MPE OS module and will         08825000
                       provide status and error logging will take       08830000
                       place.                                           08835000
                                                                        08840000
>>                                                                      08845000
                                                                        08850000
BEGIN                                                                   08855000
$INCLUDE INCLLPDT                                                       08860000
$PAGE                                                                   08865000
$INCLUDE INCLSBH                                                        08870000
<<=================================================================>>   08875000
<<                                                                 >>   08880000
<<                         END INCLSBH                             >>   08885000
<<                                                                 >>   08890000
<<=================================================================>>   08895000
$PAGE                                                                   08900000
$INCLUDE INCLIOQ                                                        08905000
<<=================================================================>>   08910000
<<                                                                 >>   08915000
<<                          END INCLIOQ                            >>   08920000
<<                                                                 >>   08925000
<<=================================================================>>   08930000
$PAGE                                                                   08935000
DEFINE                                                                  08940000
   << QMISC bit definitions >>                                          08945000
                                                                        08950000
   IOQ'RSTAT'FAIL = IOQ'QMISC.( 0:1)#, << Request status failed flag >> 08955000
   IOQ'OPER'REQ   = IOQ'QMISC.( 1:1)#, << Operator req release flg   >> 08960000
   IOQ'IM'FAULT   = IOQ'QMISC.( 2:1)#, << Inter maintenance fault flg>> 08965000
   IOQ'MEDIA'LOAD = IOQ'QMISC.( 3:1)#, << Media load flag            >> 08970000
   IOQ'SYS'PFAIL  = IOQ'QMISC.( 4:1)#, << System powerfail flag      >> 08975000
   IOQ'VERIFY'ERR = IOQ'QMISC.( 5:1)#, << Verify error flag          >> 08980000
   IOQ'UNLOAD'RING= IOQ'QMISC.( 6:1)#, << No write ring              >> 08985000
   IOQ'RETRY'COUNT= IOQ'QMISC.( 7:3)#, << Retry count in QMISC       >> 08990000
                                                                        08995000
   IOQ'WAITCODE   = IOQ'QMISC.(12:4)#; << Indicates type of wait     >> 09000000
                                       <<                            >> 09005000
                                       << 0 - New request            >> 09010000
                                       << 1 - Completion             >> 09015000
                                       << 2 - Not ready              >> 09020000
                                       << 3 - Release/Release deny   >> 09025000
                                       << 4 - IOQ defer              >> 09030000
                                       << 5 - Sync. with device      >> 09035000
                                       << 6 - No write ring          >> 09040000
                                       << 7 - Abort IOQ              >> 09045000
$PAGE                                                                   09050000
  << **************************************** >>                        09055000
  << Device Information Table (DIT) Elements. >>                        09060000
  << **************************************** >>                        09065000
                                                                        09070000
EQUATE                                                                  09075000
                                                                        09080000
   << ********** >>                                                     09085000
   << DIT words. >>                                                     09090000
   << ********** >>                                                     09095000
                                                                        09100000
   DIT'SIZE  = 29,  << Size of DIT                          >>          09105000
   DLDEV     =  3,  << Logical device                       >>          09110000
   DILTP     =  5,  << Interrupt linkage table pointer      >>          09115000
   DSTAT     =  6,  << Device powerfail status              >>          09120000
   DSERR     =  7,  << DIT error log lenght/offset          >>          09125000
   DUNIT     = 10,                                                      09130000
   DMISC     = 11,  << Device dependent word                >>          09135000
   DBADBLK1  = 12,  << High order addr of bad block         >>          09140000
   DBADBLK2  = 13,  << Low order addr of bad block          >>          09145000
   DBADXFER  = 14,  << Byte xfer left after bad block       >>          09150000
   DLOGERROR = 15,  << DIT hardware error logged status     >>          09155000
   DSIOPSTOP = 16,  << DIT CP stopped relative offset       >>          09160000
   DBYTECNT  = 17,  << Accum byte count > 6144 bytes        >>          09165000
   DSTATUS   = 19,  << Buffalo status                       >>          09170000
                                                                        09175000
   << DIT status offset >>                                              09180000
                                                                        09185000
   ID'FIELD      = DSTATUS,    << Identification field      >>          09190000
   REJECT'FIELD  = DSTATUS+1,  << Reject errors field       >>          09195000
   FAULT'FIELD   = DSTATUS+2,  << Fault errors field        >>          09200000
   ACCESS'FIELD  = DSTATUS+3,  << Access errors field       >>          09205000
   INFOR'FIELD   = DSTATUS+4,  << Information field         >>          09210000
   PARM'FIELD    = DSTATUS+5;  << Parameter fields          >>          09215000
$PAGE                                                                   09220000
DEFINE                                                                  09225000
                                                                        09230000
   << ********* >>                                                      09235000
   << DIT bits. >>                                                      09240000
   << ********* >>                                                      09245000
                                                                        09250000
   DLDEV'LD'BITS          = (0:16)#,                                    09255000
   DMISC'LK'BIT           = ( 0:1)#,                                    09260000
   DMISC'IG'BIT           = ( 1:1)#,                                    09265000
   DMISC'IM'BIT           = ( 2:1)#,                                    09270000
   DMISC'SS'BITS          = (12:4)#, << SUBSTATE of the driver   >>     09275000
                                                                        09280000
   ID'FIELD'UA'BITS       = ( 8:8)#, << Unit attention bits      >>     09285000
                                                                        09290000
   REJECT'FIELD'CP'BIT    = ( 2:1)#, << Channel parity bit       >>     09295000
   REJECT'FIELD'IO'BIT    = ( 5:1)#, << Illegal opcode bit       >>     09300000
   REJECT'FIELD'MD'BIT    = ( 6:1)#, << Module addr error bit    >>     09305000
   REJECT'FIELD'AB'BIT    = ( 7:1)#, << Addr bounds bit          >>     09310000
   REJECT'FIELD'PB'BIT    = ( 8:1)#, << Parameter bounds bit     >>     09315000
   REJECT'FIELD'IP'BIT    = ( 9:1)#, << Illegal parameter bit    >>     09320000
   REJECT'FIELD'MS'BIT    = (10:1)#, << Msg seq violation bit    >>     09325000
   REJECT'FIELD'ML'BIT    = (12:1)#, << Msg length differ bit    >>     09330000
                                                                        09335000
   FAULT'FIELD'CU'BIT     = ( 1:1)#, << Error during copy oper   >>     09340000
   FAULT'FIELD'CF'BIT     = ( 3:1)#, << Controller fault bit     >>     09345000
   FAULT'FIELD'UF'BIT     = ( 6:1)#, << Unit fault bit           >>     09350000
   FAULT'FIELD'DF'BIT     = ( 8:1)#, << Diag failed bit          >>     09355000
   FAULT'FIELD'OR'BIT     = (10:1)#, << Oper rel required bit    >>     09360000
   FAULT'FIELD'DR'BIT     = (11:1)#, << Diag rel required bit    >>     09365000
   FAULT'FIELD'IM'BIT     = (12:1)#, << Int maint required bit   >>     09370000
   FAULT'FIELD'PF'BIT     = (14:1)#, << Power fail bit           >>     09375000
   FAULT'FIELD'RE'BIT     = (15:1)#, << Rrtransmit/Rel cmplt bit >>     09380000
                                                                        09385000
   ACCESS'FIELD'IP'BIT    = ( 0:1)#, << Illegal /  operation bit >>     09390000
   ACCESS'FIELD'UM'BIT    = ( 1:1)#, << Uninitialized media bit  >>     09395000
   ACCESS'FIELD'NS'BIT    = ( 2:1)#, << No spare available bit   >>     09400000
   ACCESS'FIELD'DN'BIT    = ( 3:1)#, << Device not ready bit     >>     09405000
   ACCESS'FIELD'WP'BIT    = ( 4:1)#, << Write protect bit        >>     09410000
   ACCESS'FIELD'ND'BIT    = ( 5:1)#, << No data found bit        >>     09415000
   ACCESS'FIELD'UO'BIT    = ( 8:1)#, << Unrecov data overflow bit>>     09420000
   ACCESS'FIELD'UD'BIT    = ( 9:1)#, << Unrecov data bit         >>     09425000
   ACCESS'FIELD'EF'BIT    = (11:1)#, << End of file bit          >>     09430000
   ACCESS'FIELD'EV'BIT    = (12:1)#, << End of volume bit        >>     09435000
                                                                        09440000
   INFOR'FIELD'OR'BIT     = ( 0:1)#, << Operator rel request bit >>     09445000
   INFOR'FIELD'DR'BIT     = ( 1:1)#, << Diag rel request bit     >>     09450000
   INFOR'FIELD'IM'BIT     = ( 2:1)#, << Int maint request bit    >>     09455000
   INFOR'FIELD'MW'BIT     = ( 3:1)#, << Media wearing out bit    >>     09460000
   INFOR'FIELD'DO'BIT     = ( 4:1)#, << Data overrun bit         >>     09465000
   INFOR'FIELD'DB'BIT     = ( 7:1)#, << Defective blk auto spared>>     09470000
   INFOR'FIELD'RO'BIT     = ( 9:1)#, << Recov data overflow bit  >>     09475000
   INFOR'FIELD'MD'BIT     = (10:1)#, << Marginal data bit        >>     09480000
   INFOR'FIELD'RD'BIT     = (11:1)#, << Recov data bit           >>     09485000
   INFOR'FIELD'MT'BIT     = (13:1)#, << Maint track overflow bit >>     09490000
$PAGE                                                                   09495000
   << ************* >>                                                  09500000
   << DIT elements. >>                                                  09505000
   << ************* >>                                                  09510000
                                                                        09515000
   DIT'ADDR1'BAD'BLOCK  =  P'DIT (DBADBLK1    )                     #,  09520000
   DIT'ADDR2'BAD'BLOCK  =  P'DIT (DBADBLK2    )                     #,  09525000
   DIT'BAD'TRANSFER     =  P'DIT (DBADXFER    )                     #,  09530000
   DIT'ILT'PTR          =  P'DIT (DILTP       )                     #,  09535000
   DIT'LDEV             =  P'DIT (DLDEV       )                     #,  09540000
   DIT'LOG'ERROR        =  P'DIT (DLOGERROR   )                     #,  09545000
   DIT'SAVE'WORD        =  P'DIT (DSTAT       )                     #,  09550000
   DIT'SIOP'STOP        =  P'DIT (DSIOPSTOP   )                     #,  09555000
   DIT'ERROR'STATUS     =  P'DIT (DSERR       )                     #,  09560000
   DIT'LOCK'FLG         =  P'DIT (DMISC       ).DMISC'LK'BIT        #,  09565000
   DIT'IGNORE'INT       =  P'DIT (DMISC       ).DMISC'IG'BIT        #,  09570000
   DIT'IMMEDIATE'MODE   =  P'DIT (DMISC       ).DMISC'IM'BIT        #,  09575000
   DIT'SUBSTATE         =  P'DIT (DMISC       ).DMISC'SS'BITS       #,  09580000
$PAGE                                                                   09585000
   DIT'FIRST'STAT'WORD  =  P'DIT (ID'FIELD    )                     #,  09590000
   DIT'UNIT'ATTENTION   =  P'DIT (ID'FIELD    ).ID'FIELD'UA'BITS    #,  09595000
                                                                        09600000
   DIT'CHAN'PARITY'ERR  =  P'DIT (REJECT'FIELD).REJECT'FIELD'CP'BIT #,  09605000
   DIT'ILL'OPCODE       =  P'DIT (REJECT'FIELD).REJECT'FIELD'IO'BIT #,  09610000
   DIT'MODULE'ADDR'ERR  =  P'DIT (REJECT'FIELD).REJECT'FIELD'MD'BIT #,  09615000
   DIT'ADDR'BOUNDS      =  P'DIT (REJECT'FIELD).REJECT'FIELD'AB'BIT #,  09620000
   DIT'PARAMETER'BOUND  =  P'DIT (REJECT'FIELD).REJECT'FIELD'PB'BIT #,  09625000
   DIT'ILL'PARAMETER    =  P'DIT (REJECT'FIELD).REJECT'FIELD'IP'BIT #,  09630000
   DIT'ILL'MSG'SEQ      =  P'DIT (REJECT'FIELD).REJECT'FIELD'MS'BIT #,  09635000
   DIT'MSG'LENGTH'ERR   =  P'DIT (REJECT'FIELD).REJECT'FIELD'ML'BIT #,  09640000
                                                                        09645000
   DIT'COPY'ERR         =  P'DIT (FAULT'FIELD ).FAULT'FIELD'CU'BIT #,   09650000
   DIT'CONTROLLER'FAULT =  P'DIT (FAULT'FIELD ).FAULT'FIELD'CF'BIT #,   09655000
   DIT'UNIT'FAULT       =  P'DIT (FAULT'FIELD ).FAULT'FIELD'UF'BIT #,   09660000
   DIT'DIAG'FAIL        =  P'DIT (FAULT'FIELD ).FAULT'FIELD'DF'BIT #,   09665000
   DIT'OPR'REL'REQ      =  P'DIT (FAULT'FIELD ).FAULT'FIELD'OR'BIT #,   09670000
   DIT'DIAG'REL'REQ     =  P'DIT (FAULT'FIELD ).FAULT'FIELD'DR'BIT #,   09675000
   DIT'INT'MAINT'REQ    =  P'DIT (FAULT'FIELD ).FAULT'FIELD'IM'BIT #,   09680000
   DIT'DEV'POWERFAIL    =  P'DIT (FAULT'FIELD ).FAULT'FIELD'PF'BIT #,   09685000
   DIT'RETRANSMIT       =  P'DIT (FAULT'FIELD ).FAULT'FIELD'RE'BIT #,   09690000
                                                                        09695000
   DIT'ILL'OPERATION    =  P'DIT (ACCESS'FIELD).ACCESS'FIELD'IP'BIT #,  09700000
   DIT'UNINIT'MEDIA     =  P'DIT (ACCESS'FIELD).ACCESS'FIELD'UM'BIT #,  09705000
   DIT'SPARE'UNAVAIL    =  P'DIT (ACCESS'FIELD).ACCESS'FIELD'NS'BIT #,  09710000
   DIT'DEV'NOT'RDY      =  P'DIT (ACCESS'FIELD).ACCESS'FIELD'DN'BIT #,  09715000
   DIT'WRITE'PROTECT    =  P'DIT (ACCESS'FIELD).ACCESS'FIELD'WP'BIT #,  09720000
   DIT'NO'DATA'FOUND    =  P'DIT (ACCESS'FIELD).ACCESS'FIELD'ND'BIT #,  09725000
   DIT'DATA'OVERFLOW    =  P'DIT (ACCESS'FIELD).ACCESS'FIELD'UO'BIT #,  09730000
   DIT'UNRECOV'DATA     =  P'DIT (ACCESS'FIELD).ACCESS'FIELD'UD'BIT #,  09735000
   DIT'END'OF'FILE      =  P'DIT (ACCESS'FIELD).ACCESS'FIELD'EF'BIT #,  09740000
   DIT'END'OF'VOLUME    =  P'DIT (ACCESS'FIELD).ACCESS'FIELD'EV'BIT #,  09745000
                                                                        09750000
   DIT'I'OPR'REL'REQ    =  P'DIT (INFOR'FIELD ).INFOR'FIELD'OR'BIT #,   09755000
   DIT'I'DIAG'REL'REQ   =  P'DIT (INFOR'FIELD ).INFOR'FIELD'DR'BIT #,   09760000
   DIT'I'INT'MAINT'REQ  =  P'DIT (INFOR'FIELD ).INFOR'FIELD'IM'BIT #,   09765000
   DIT'MEDIA'WEAR'OUT   =  P'DIT (INFOR'FIELD ).INFOR'FIELD'MW'BIT #,   09770000
   DIT'DATA'OVERRUN     =  P'DIT (INFOR'FIELD ).INFOR'FIELD'DO'BIT #,   09775000
   DIT'DEFECT'BLK'SPARE =  P'DIT (INFOR'FIELD ).INFOR'FIELD'DB'BIT #,   09780000
   DIT'NO'DATA'OVERFLOW =  P'DIT (INFOR'FIELD ).INFOR'FIELD'RO'BIT #,   09785000
   DIT'MARGINAL'DATA    =  P'DIT (INFOR'FIELD ).INFOR'FIELD'MD'BIT #,   09790000
   DIT'RECOV'DATA       =  P'DIT (INFOR'FIELD ).INFOR'FIELD'RD'BIT #,   09795000
   DIT'MAINT'TRACK      =  P'DIT (INFOR'FIELD ).INFOR'FIELD'MT'BIT #,   09800000
                                                                        09805000
   DIT'PARM'FIELD1      =  P'DIT (PARM'FIELD+1)                     #,  09810000
   DIT'PARM'FIELD2      =  P'DIT (PARM'FIELD+2)                     #;  09815000
$PAGE                                                                   09820000
EQUATE                                                                  09825000
                                                                        09830000
  << *************** >>                                                 09835000
  << Function Codes. >>                                                 09840000
  << *************** >>                                                 09845000
                                                                        09850000
  FC'READ           = 0 ,                                               09855000
  FC'WRITE          = 1 ,                                               09860000
  FC'OPEN'FILE      = 2 ,                                               09865000
  FC'CLOSE'FILE     = 3 ,                                               09870000
  FC'CLOSE'DEVICE   = 4 ,                                               09875000
  FC'REQ'LAST'STAT  = 5 , << Request status from last I/O. >>           09880000
  FC'INIT'MEDIA     = 6 , << Initialize the media.         >>           09885000
  FC'UNLOAD'CART    = 7 ,                                               09890000
  FC'REQ'VOL'LIMIT  = 8 , << Request the size of volume.   >>           09895000
  FC'LOC'N'VERIFY   = 9 , << Locate and verify the media.  >>           09900000
  FC'REQ'GENERIC    = 10, << Request generic status.       >>           09905000
  FC'LOCK           = 11, << Lock the volume from release. >>           09910000
  FC'UNLOCK         = 12,                                               09915000
  FC'READ'LOCK'BIT  = 13,                                               09920000
  FC'IMMEDIATE'MODE = 14,                                               09925000
  FC'IDENTIFY       = 15,                                               09930000
  FC'INIT'SELFTEST  = 16, << Perform diagnostic selftest.  >>           09935000
  FC'LOOPBACK'WRITE = 17,                                               09940000
  FC'LOOPBACK'READ  = 18,                                               09945000
  FC'RELEASE        = 19,                                               09950000
  FC'RELEASE'DENIED = 20,                                               09955000
  FC'SET'RELEASE    = 21,                                               09960000
  FC'SET'ADDRESS    = 22,                                               09965000
  FC'SPARE'BLOCK    = 23, << Allow drive to do sparing.    >>           09970000
  FC'INITIATE'UTIL  = 24,                                               09975000
  FC'DEVICE'CLEAR   = 25,                                               09980000
  FC'CANCEL'TRAN    = 26,                                               09985000
  FC'PARITY'CHECK   = 27, << Enable/disable parity on cmds.>>           09990000
  FC'GENERIC'DIAG   = 28, << Generic diagnostic commands.  >>           09995000
$PAGE                                                                   10000000
  << ************************ >>                                        10005000
  << IO Status Return Values. >>                                        10010000
  << ************************ >>                                        10015000
                                                                        10020000
  WRITE'RING'WAIT  =  %40,                                              10025000
                                                                        10030000
  GOOD'IO          =    1,                                              10035000
  GOOD'RETRY       =  %21,                                              10040000
                                                                        10045000
  READ'LAST'STAT   =  %13, << Status interrog required       >>         10050000
  SYSTEM'ABORT     =  %33,                                              10055000
  PRIOR'ERR'ABORT  =  %43,                                              10060000
  POWERFAIL'ABORT  =  %63,                                              10065000
  BACKSPACE'BOT    =  %73, << BOT and backspace requested.   >>         10070000
  DEV'POWER'ON     = %213, << Device powered on              >>         10075000
                                                                        10080000
  INVALID'REQUEST  =    4,                                              10085000
  TRACK'SECT'ERROR =  %14, << Unrecov track/sector error     >>         10090000
  TIMEOUT'ERROR    =  %24, << Timed out error                >>         10095000
  CHAN'PGM'FAILURE =  %44,                                              10100000
  UNIT'FAILURE     =  %54,                                              10105000
  INVALID'ADDR     =  %64, << Invalid address                >>         10110000
  SYSTEM'ERROR     = %124,                                              10115000
  CHAN'IO'FAILURE  = %144,                                              10120000
  UNINIT'MEDIA'ERR = %154, << Uninitialized media            >>         10125000
  NO'SPARE'ERR     = %164; << No spare abailable             >>         10130000
$PAGE                                                                   10135000
EQUATE                                                                  10140000
   << ********* >>                                                      10145000
   << ILT words >>                                                      10150000
   << ********* >>                                                      10155000
                                                                        10160000
   << Idle CP status offset >>                                          10165000
                                                                        10170000
   ILT'FAULT'FIELD  = 2,       << Idle fault errors field         >>    10175000
   ILT'ACCESS'FIELD = 3,       << Idle access errors field        >>    10180000
   ILT'INFOR'FIELD  = 4;       << Idle information field          >>    10185000
                                                                        10190000
DEFINE                                                                  10195000
   << ********* >>                                                      10200000
   << ILT bits  >>                                                      10205000
   << ********* >>                                                      10210000
                                                                        10215000
   ILT'DN'BITS      = ( 7:9)#, << DRT extract from ILT(ILT'CNTRL) >>    10220000
                                                                        10225000
   CPVA'EC'BITS     = ( 0:3)#, << CPVAP, error code               >>    10230000
   CPVA'ST'BITS     = (12:4)#, << CPVAP, status from the CP       >>    10235000
                                                                        10240000
   << ************ >>                                                   10245000
   << ILT elements >>                                                   10250000
   << ************ >>                                                   10255000
                                                                        10260000
   ILT'DRT'NUMBER       = P'ILT(ILT'CNTRL).ILT'DN'BITS#,                10265000
                                                                        10270000
   CPVA'ERRORCODE       = P'CPVA(0).CPVA'EC'BITS#,                      10275000
   CPVA'STATUS          = P'CPVA(1).CPVA'ST'BITS#;                      10280000
$PAGE                                                                   10285000
DEFINE                                                                  10290000
  << ************************ >>                                        10295000
  << Generic Status Elements. >>                                        10300000
  << ************************ >>                                        10305000
                                                                        10310000
  GS'FATAL'ERROR      = GENERIC'STATUS.( 0:4)#,                         10315000
  GS'DENSITY          = GENERIC'STATUS.( 4:3)#,                         10320000
  GS'UNIT'NUMBER      = GENERIC'STATUS.( 7:2)#,                         10325000
  GS'END'OF'FILE      = GENERIC'STATUS.( 9:1)#,                         10330000
  GS'LOAD'POINT       = GENERIC'STATUS.(10:1)#,                         10335000
  GS'END'OF'TAPE      = GENERIC'STATUS.(11:1)#,                         10340000
  GS'IMMED'RPT'ENABLE = GENERIC'STATUS.(12:1)#,                         10345000
  GS'RECOVERED'ERR    = GENERIC'STATUS.(13:1)#,                         10350000
  GS'UNIT'ONLINE      = GENERIC'STATUS.(14:1)#,                         10355000
  GS'FILE'PROTECT     = GENERIC'STATUS.(15:1)#;                         10360000
$PAGE                                                                   10365000
EQUATE                                                                  10370000
                                                                        10375000
   << CS'80 Buffalo drive type and subtype >>                           10380000
                                                                        10385000
   TYPE'BUFFALO      = 3,                                               10390000
   SUBTYPE'BUFFALO   = 3,                                               10395000
                                                                        10400000
   << ILTP parameters >>                                                10405000
                                                                        10410000
   ILT'CNTRL =  7,  << DRT word                             >>          10415000
   ILT'SIOP  =  8,  << Channel program area pointer         >>          10420000
   ILT'STAP  =  9,  << Status area pointer                  >>          10425000
                                                                        10430000
   << CS'80 Secondaries commands >>                                     10435000
                                                                        10440000
   WRT'CMD'SEC      =   %2005,  << wrt w/cmd msg sec        >>          10445000
   READ'TRANS'SEC   =   %3402,  << read w/trans msg sec     >>          10450000
   WRT'TRANS'SEC    =   %4002,  << wrt w/trans msg sec      >>          10455000
   READ'EXEC'SEC    =   %1416,  << read w/exec msg sec      >>          10460000
   WRT'EXEC'SEC     =   %2016,  << wrt w/exec msg sec       >>          10465000
                                                                        10470000
   << CS'80 Buffalo driver command data bytes >>                        10475000
   << List is in alphabete order              >>                        10480000
                                                                        10485000
   CDB'CANCEL         =  %11,  << Cancel command            >>          10490000
   CDB'CI'CLEAR       =  %10,  << Channel independent clear >>          10495000
   CDB'DESCRIBE       =  %65,  << Describe command          >>          10500000
   CDB'INIT'DIAG      =  %63,  << Init diagnostic command   >>          10505000
   CDB'INIT'MEDIA     =  %67,  << Initialize media command  >>          10510000
   CDB'INIT'UTIL      =  %60,  << No executing message      >>          10515000
   CDB'JUMP'SPARE     =    4,  << Jump spare parameter      >>          10520000
   CDB'NOP            =  %64,  << No operation command      >>          10525000
   CDB'PARITY'OP      =    1,  << Parity opcode command     >>          10530000
   CDB'READ           =    0,  << Locate & read command     >>          10535000
   CDB'READ'LOOPBK    =   %2,  << Read loopback command     >>          10540000
   CDB'RELEASE        =  %16,  << Release command           >>          10545000
   CDB'RELEASE'DENY   =  %17,  << Release denied command    >>          10550000
   CDB'REQ'STATUS     =  %15,  << Request status command    >>          10555000
   CDB'SET'LENGTH     =  %30,  << Set length command        >>          10560000
   CDB'SET'OPTIONS    =  %70,  << Set options command       >>          10565000
   CDB'SET'MASK       =  %76,  << Set status mask cmd       >>          10570000
   CDB'SET'RELEASE    =  %73,  << Set release command       >>          10575000
   CDB'SET'RETADR     = %110,  << Set return addr mode cmd  >>          10580000
   CDB'SET'RETRY      =  %72,  << Set retry time command    >>          10585000
   CDB'SET'SNGL'VEC   =  %20,  << Set single vec addr cmd   >>          10590000
   CDB'SET'UNIT       =  %40,  << Set unit number command   >>          10595000
   CDB'SET'VOL        = %100,  << Set volume number command >>          10600000
   CDB'SKIP'SPARE     =    6,  << Skip spare parameter      >>          10605000
   CDB'SPARE'BLK      =   %6,  << Spare block command       >>          10610000
   CDB'UNLOAD         = %112,  << Unload command            >>          10615000
   CDB'VERIFY         =   %4,  << Verify command            >>          10620000
   CDB'WRITE          =   %2,  << Locate & write command    >>          10625000
   CDB'WRT'LOOPBK     =   %3,  << Write loopback command    >>          10630000
$PAGE                                                                   10635000
   << Channel program offsets relative to SIOP >>                       10640000
                                                                        10645000
   FIRST'ID      = 0,             << Initialization offset  >> <<f9010>>10650000
   FIRSTBRANCH   = FIRST'ID+4,                                 <<f9010>>10655000
   BRANCHPT      = FIRSTBRANCH+1, << Branch offset          >>          10660000
   IDLE          = BRANCHPT+1,   << Idle CP offset          >>          10665000
   IDLE'WAIT     = IDLE+5,       << Idle when dev not ready >>          10670000
   SYNCDSJ       = IDLE'WAIT+14, << Get insync w. CS80 cmds >>          10675000
   IDENT         = SYNCDSJ+9,    << Identify section offset >>          10680000
   DXFER         = IDENT+4,      << Data xfer sec. offset   >>          10685000
   RSTAT         = DXFER+21,     << Read status offset      >>          10690000
   DIAG          = RSTAT+23,     << Read status offset      >>          10695000
   PON           = DIAG+14,      << Power on offset         >>          10700000
   STAT'CDB      = PON+19,       << Identify section offset?>>          10705000
   LOC'WRT'CDB   = STAT'CDB+1,   << Loc & write CDB offset  >>          10710000
   PON'CDB'1     = LOC'WRT'CDB+4,<< CI clear and parity on  >>          10715000
   PON'CDB'2     = PON'CDB'1+1,  << Enable immediate rpt mod>>          10720000
   INITFLG       = PON'CDB'2+1,  << Init flag offset        >>          10725000
   FILL'WRD      = INITFLG+1,    << Fill word offset        >>          10730000
   DESC'AREA     = FILL'WRD+1,   << Describe area offset    >>          10735000
   CDB'AREA'WRD  = DESC'AREA+10, << CDB storage area offset >>          10740000
   CPGM'SIZE     = CDB'AREA'WRD+10, << Length of CP          >>         10745000
   CPGM'SIZED2   = (CPGM'SIZE+2)/2, << Length of CP / 2      >>         10750000
   INIT'ARY'SIZE = 4+DIT'SIZE+CPGM'SIZE,<< Len of init array>>          10755000
                                                                        10760000
   DESC'AREA'BYTE = DESC'AREA*2,    << Desc area byte offset>>          10765000
   CDB'AREA'BYTE  = CDB'AREA'WRD*2, << CDB area byte offset >>          10770000
                                    << Valid only for single>>          10775000
                                    << vector addresses.    >>          10780000
   VOLUME'LIMIT   = (DESC'AREA'BYTE + 30) / 2,                          10785000
$PAGE                                                                   10790000
   << Entries points to the channel program sections.>>                 10795000
                                                                        10800000
   CP'BASE         = FIRSTBRANCH+2,    << CP base              >>       10805000
   ENTER'IDLE      = IDLE-CP'BASE,     << Idle CP entry        >>       10810000
   ENTER'IDLE'WAIT = IDLE'WAIT-CP'BASE,<< Idle wait CP entry   >>       10815000
   ENTER'SYNC'DSJ  = SYNCDSJ-CP'BASE,  << Offset from 1st jump >>       10820000
   ENTER'DATA'XFER = DXFER-CP'BASE,    << Data xfer entry      >>       10825000
   ENTER'STAT'REQ  = RSTAT-CP'BASE,    << Request status entry >>       10830000
   ENTER'DIAG      = DIAG-CP'BASE,     << Diag function entry  >>       10835000
   ENTER'POWER'ON  = PON-CP'BASE,      << Power on (up) entry  >>       10840000
   ENTER'IDENTIFY  = IDENT-CP'BASE;    << Identify entry       >>       10845000
$PAGE                                                                   10850000
DEFINE                                                                  10855000
   << Channel program sections offsets >>                               10860000
                                                                        10865000
   CP'FIRST'BRANCH         = SIOP(BRANCHPT   )        #,                10870000
   CP'IDLE'CDB'OFFSET      = SIOP(IDLE   + 16)        #,                10875000
   CP'IDENT'HPIB'ID        = SIOP(IDENT  +  1)        #,                10880000
   CP'DXFER'WRITE'READ     = SIOP(DXFER  +  0)        #,                10885000
   CP'DXFER'CDB'LENGTH     = SIOP(DXFER  +  1)        #,                10890000
   CP'DXFER'CDB'BANK       = SIOP(DXFER  +  3).( 8: 8)#,                10895000
   CP'DXFER'CDB'OFFSET     = SIOP(DXFER  +  4)        #,                10900000
   CP'DXFER'WAIT'5         = SIOP(DXFER  +  5)        #,                10905000
   CP'DXFER'WAIT'6         = SIOP(DXFER  +  6)        #,                10910000
   CP'DXFER'CMD'TO'EXEC    = SIOP(DXFER  +  7)        #,                10915000
   CP'DXFER'DATA'SIZE      = SIOP(DXFER  +  8)        #,                10920000
   CP'DXFER'DATA'TYPE      = SIOP(DXFER  + 10).( 0: 8)#,                10925000
   CP'DXFER'DONT'C'ADDR    = SIOP(DXFER  + 10).( 4: 1)#,                10930000
   CP'DXFER'DATA'BANK      = SIOP(DXFER  + 10).( 8: 8)#,                10935000
   CP'DXFER'DATA'OFFSET    = SIOP(DXFER  + 11)        #,                10940000
   CP'DXFER'12'WAIT        = SIOP(DXFER  + 12)        #,                10945000
   CP'DXFER'13'WAIT        = SIOP(DXFER  + 13)        #,                10950000
   CP'RSTAT'CDB'OFFSET     = SIOP(RSTAT  +  4)        #,                10955000
   CP'RSTAT'STAT'AREA      = SIOP(RSTAT  + 11)        #,                10960000
   CP'DIAG'CMD'TO'EXEC     = SIOP(DIAG   +  0)        #,                10965000
   CP'DIAG'CDB'LENGTH      = SIOP(DIAG   +  1)        #,                10970000
   CP'DIAG'CDB'BANK        = SIOP(DIAG   +  3).( 8: 8)#,                10975000
   CP'DIAG'CDB'OFFSET      = SIOP(DIAG   +  4)        #,                10980000
   CP'DIAG'WAIT'5          = SIOP(DIAG   +  5)        #,                10985000
   CP'DIAG'WAIT'6          = SIOP(DIAG   +  6)        #,                10990000
   CP'PON'CDB'OFFSET       = SIOP(PON    +  4)        #,                10995000
   CP'PON'CDB'2'OFFSET     = SIOP(PON    + 16)        #,                11000000
   CP'INIT'DVR'FLAG        = SIOP(INITFLG    )        #,                11005000
   CP'FILL'WORD            = SIOP(FILL'WRD   )        #;                11010000
$PAGE                                                                   11015000
EQUATE                                                                  11020000
   << Buffalo driver states kept in IOQ'QMISC >>               <<f9010>>11025000
                                                                        11030000
   CMPLTION'WAIT  = 1,  << Waiting for I/O completion intrpt>>          11035000
   NOT'RDY'WAIT   = 2,  << Not ready wait in progress       >>          11040000
   REL'WAIT       = 3,  << Rel/Rel denied completion wait   >>          11045000
   IOQ'DEFER'WAIT = 4,  << IOQ being deferred wait          >>          11050000
   SYNC'WAIT      = 5,  << Driver/firmware sync wait        >>          11055000
   OPINTRVNWAIT   = 6,  << Unit not ready wait for operator >>          11060000
   ABORT'IOQ'WAIT = 7,  << Abort current I/O wait           >>          11065000
                                                                        11070000
   << Buffalo driver state kept in DIT'DMISC >>                <<f9010>>11075000
   NORMAL'IDLE    = 0,                                         <<f9010>>11080000
   IDLE'REQ'WAIT  = 1,  << Idle request completion wait     >>          11085000
                                                                        11090000
   << SIODM monitor states kept in DIT'DFLAG >>                <<f9010>>11095000
                                                                        11100000
   INITIATOR'STATE  =   2,                                              11105000
   COMPLETOR'STATE  =   3,                                              11110000
   REQUEST'COMPLETE =   5,  << Request done                 >>          11115000
   NOT'READY        =   7,  << Unit not ready               >>          11120000
   INTERRUPT'WAIT   = %13,  << Waiting for I/O completion   >>          11125000
                                                                        11130000
   << I/O message parameters >>                                         11135000
                                                                        11140000
   CONSOLE           =   0, << Output msg to system console >>          11145000
   NSYS'DENY'MSG     =  26, << Non-sysdisc unload denied msg>>          11150000
   NOT'READY'MSG     =  11, << Not ready message index.     >>          11155000
   NO'WRITE'RING'MSG = 220, << No write ring message index. >>          11160000
                                                                        11165000
$PAGE                                                                   11170000
   << ***********************************. >>                           11175000
   << Misc Pointers And Program Constants. >>                           11180000
   << ************************************ >>                           11185000
                                                                        11190000
   CPVA'TIMEOUT       = %160004,<< CPVA returned if GIC timeout>>       11195000
   CTRL'UNIT          = %17,    << Controller unit             >>       11200000
   MAX'DESC'BYTE      = 37,     << Max# descrive bytes         >>       11205000
   SIX'K'BYTES        = 6144,   << 6K bytes                    >>       11210000
   SYSDB              = %1000,  << Address of SYSDB area       >>       11215000
   DEV'STAT'WORD'SIZE = 10,                                             11220000
   DMA'ABORT          = 6,                                              11225000
   CHANNEL'ABORT      = 7,                                              11230000
   RETRY'LIMIT        = 7,                                              11235000
   WAIT'INSTR         = %1000,   << HPIB wait instruction      >>       11240000
   BLANKS             = %20040,  << Word filled with spaces    >>       11245000
   IGNORE'INTERRUPT   = %101010, << Ignore the interrupt       >>       11250000
   ZERO               = 0,                                              11255000
   ONE                = 1,                                              11260000
   TWO                = 2,                                              11265000
   THREE              = 3,                                              11270000
   FOUR               = 4;                                              11275000
$PAGE                                                                   11280000
DEFINE                                                                  11285000
   HELL'FROZE'OVER = 1 > 2#,                                            11290000
                                                                        11295000
   << Statement defines >>                                              11300000
                                                                        11305000
   DISABLE    = ASSEMBLE (SED 0)#,                                      11310000
   SETDB'SYS  = BEGIN                                                   11315000
                TOS := %1000D;                                          11320000
                ASSEMBLE ( XCHD; DDEL );                                11325000
                END#,                                                   11330000
   SETDB'SIOP = BEGIN                                                   11335000
                TOS := ABS'SIOP'ADDR;                                   11340000
                ASSEMBLE ( XCHD; DDEL );                                11345000
                END#,                                                   11350000
   LOG'STATUS = DIT'ERROR'STATUS := [8/10,8/DSTATUS]#;                  11355000
                                                                        11360000
LOGICAL                                                                 11365000
   SPU'POWERFAIL = DB + %72,  << SYSDB rel powerfail word   >>          11370000
   SYSTEM'UP     = DB + %73;  << SYSDB rel system up word   >>          11375000
                                                                        11380000
BYTE ARRAY                                                              11385000
   SIODB'BYTE'ARRAY(*) = DB + 0;  << When DB = ABS'SIOP >>              11390000
$PAGE                                                                   11395000
<<                                                                      11400000
        ******************************************                      11405000
        *                                        *                      11410000
        *   Buffalo driver DB area definitions   *                      11415000
        *                                        *                      11420000
        ******************************************                      11425000
>>                                                                      11430000
                                                                        11435000
   ARRAY INITIAL(0:INIT'ARY'SIZE) = DB :=                               11440000
   [8/DIT'SIZE,8/%21], << Disc DIT size, core resident        >>        11445000
                       << Idle channel program, driver type 1 >>        11450000
                 ZERO, << Not used                            >>        11455000
                    0, << Unit extract instruction - NOP >>    <<f9010>>11460000
   [8/CPGM'SIZED2,8/10],<<CP size/2,10 words of status        >>        11465000
                                                                        11470000
   <<--------------->>                                                  11475000
   << Buffalo's DIT >>                                                  11480000
   <<--------------->>                                                  11485000
                                                                        11490000
   << 0  >>    ZERO,   << DFLAG                >>                       11495000
   << 1  >>    ZERO,   << DLINK                >>                       11500000
   << 2  >>    ZERO,   << DIOQP                >>                       11505000
   << 3  >>    ZERO,   << DLDEV                >>                       11510000
   << 4  >>    ZERO,   << DDLTP                >>                       11515000
   << 5  >>    ZERO,   << DILTP                >>                       11520000
   << 6  >>    ZERO,   << DSTAT                >>                       11525000
   << 7  >>    ZERO,   << DSERR                >>                       11530000
   << 8  >>    ZERO,   << DQHEAD               >>                       11535000
   << 9  >>    ZERO,   << DQTAIL               >>                       11540000
   << 10 >>    ZERO,   << DUNIT                >>                       11545000
   << 11 >>  %20000,   << DMISC(Immediate mode)>>                       11550000
   << 12 >>    ZERO,   << DBADBLK1             >>                       11555000
   << 13 >>    ZERO,   << DBADBLK2             >>                       11560000
   << 14 >>    ZERO,   << DBADXFER             >>                       11565000
   << 15 >>    ZERO,   << DLOGERROR            >>                       11570000
   << 16 >>    ZERO,   << DSIOPSTOP            >>                       11575000
   << 17 >> ZERO,ZERO, << DBYTECNT             >>                       11580000
          0,0,0,0,0,   << DSTATUS              >>                       11585000
          0,0,0,0,0,                                                    11590000
$PAGE                                                                   11595000
   <<--------------------------------------------------->>              11600000
   << Buffalo channel program (CP)                      >>              11605000
   <<--------------------------------------------------->>              11610000
                                                                        11615000
<< 0>>  << JUMP >>         0, << Initialization entry>>        <<f9010>>11620000
<< 1>>                     0,                                  <<f9010>>11625000
                                                               <<f9010>>11630000
<< 0>>  << IDENTIFY >> %3000, << Check for device present>>    <<f9010>>11635000
<< 1>>                     0,                                  <<f9010>>11640000
                                                               <<f9010>>11645000
<< 0>>  << JUMP >>         0, << Branch point to CP sect>>              11650000
<< 1>>                     0,                                           11655000
                                                                        11660000
   <<-------------------------------------------------->>               11665000
   << Idle CP - On hard error, requests status and on  >>               11670000
   <<           power on returns an idle PON status    >>               11675000
   <<-------------------------------------------------->>               11680000
                                                                        11685000
<< 0>>  << DSJ  >>     %2402, << DSJ to check power on >>               11690000
<< 1>>                     0, << Return byte           >>               11695000
<< 2>>                     0, << Normal return         >>               11700000
<< 3>>                     7, << Hard error /req status>>               11705000
<< 4>>                    21, << Idle power on occured >>               11710000
                                                                        11715000
<< 0>>  << WAIT >>     %1000, << Wait for PPOLL        >>               11720000
<< 1>>                     0,                                           11725000
                                                                        11730000
<< 2>>  << DSJ >>      %2402, << Reporting msg secondary>>              11735000
<< 3>>                     0, << Return byte           >>               11740000
<< 4>>                    12, << Normal completion     >>               11745000
<< 5>>                     0, << Hard error /req status>>               11750000
<< 6>>                    14, << Idle power on occurred>>               11755000
                                                                        11760000
<< 7>>  << LOC & WRT >>%2005, << Command msg secondary >>               11765000
<< 8>>                     7, << Cmd buffer length     >>               11770000
<< 9>>                     0, << No burst              >>               11775000
<<10>>                %42000, << Cmd buffer bank       >>               11780000
<<11>>                     0, << Cmd buffer abs addr   >>               11785000
                                                                        11790000
<<12>>  << WAIT >>     %1000, << Wait for PPOLL        >>               11795000
<<13>>                     0,                                           11800000
                                                                        11805000
<<14>>  << DSJ >>      %2402, << Reporting msg secondary>>              11810000
<<15>>                     0, << Return byte           >>               11815000
<<16>>                     0, << Normal completion     >>               11820000
<<17>>                    29, << Hard error /req status>>               11825000
<<18>>                     2, << Power on occurred     >>               11830000
                                                                        11835000
<<19>>  << INT/HLT0 >>  %601, << Interrupt/halt        >>               11840000
<<20>>                     0, << Code of 0 in CPVA(1)  >>               11845000
                                                                        11850000
<<21>>  << INT/HLT4 >>  %601, << Interrupt/halt        >>               11855000
<<22>>                     4, << Code of 4 in CPVA(1)  >>               11860000
$PAGE                                                                   11865000
   <<-------------------------------------------------->>               11870000
   <<         Identify instruction                     >>               11875000
   <<-------------------------------------------------->>               11880000
                                                                        11885000
<< 0>>  << IDENTIFY >> %3000,                                           11890000
<< 1>>                     0, << Id return byte        >>               11895000
                                                                        11900000
<< 2>>                  %601, << Interrupt/halt        >>               11905000
<< 3>>                     0, << Code of 0 in CPVA(1)  >>               11910000
$PAGE                                                                   11915000
   <<-------------------------------------------------->>               11920000
   << [DXFER] Real-time & some general purpose cmds    >>               11925000
   << Command - Execution - Reporting message sections >>               11930000
   <<-------------------------------------------------->>               11935000
                                                                        11940000
<< 0>>  << WRITE CTRL>>%2005, << Command msg secondary >>               11945000
<< 1>>                     0, << Cmd buffer length     >>               11950000
<< 2>>                     0, << No burst              >>               11955000
<< 3>>                 %2000, << Cmd buffer bank       >>               11960000
<< 4>>                     0, << Cmd buffer abs addr   >>               11965000
                                                                        11970000
<< 5>>  << WAIT >>     %1000, << Wait for PPOLL        >>               11975000
<< 6>>                     0,                                           11980000
                                                                        11985000
<< 7>>  <<RD/WRT CTRL>>%1416, << Execution msg secondary>>              11990000
<< 8>>                     0, << #bytes to read/write  >>               11995000
<< 9>>                     0, << No Burst              >>               12000000
<<10>>                     0, << Data bank             >>               12005000
<<11>>                     0, << Data buffer abs addr  >>               12010000
                                                                        12015000
<<12>>  << WAIT >>     %1000, << Wait for PPOLL        >>               12020000
<<13>>                     0,                                           12025000
                                                                        12030000
<<14>>  << DSJ >>      %2402, << Reporting msg secondary>>              12035000
<<15>>                     0, << Return byte           >>               12040000
<<16>>                     0, << Normal completion     >>               12045000
<<17>>                     2, << Hard error /req status>>               12050000
<<18>>                    39, << Power on occurred     >>               12055000
                                                                        12060000
<<19>>  << INT/HLT0 >>  %601, << Interrupt/halt        >>               12065000
<<20>>                     0, << Code of 0 in CPVA(1)  >>               12070000
$PAGE                                                                   12075000
   <<-------------------------------------------------->>               12080000
   << [RSTAT] Status interrogation section             >>               12085000
   << Command - Execution - Reporting message sections >>               12090000
   <<-------------------------------------------------->>               12095000
                                                                        12100000
<< 0>>  << WRITE CTRL>>%2005, << Command msg secondary >>               12105000
<< 1>>                     1, << Cmd buffer length     >>               12110000
<< 2>>                     0, << No Burst              >>               12115000
<< 3>>                %42000, << Cmd buffer bank       >>               12120000
<< 4>>  << STAT CDB >>     0, << Cmd buffer abs addr   >>               12125000
                                                                        12130000
<< 5>>  << WAIT >>     %1000, << Wait for PPOLL        >>               12135000
<< 6>>                     0,                                           12140000
                                                                        12145000
<< 7>>  << READ CTRL >>%1416, << Execution msg secondary>>              12150000
<< 8>>                    20, << #status bytes to read >>               12155000
<< 9>>                     0, << No Burst              >>               12160000
<<10>>                 %2000, << Data bank             >>               12165000
<<11>>  << STAT AREA >>    0, << Data buffer abs addr  >>               12170000
                                                                        12175000
<<12>>  << WAIT >>     %1000, << Wait for PPOLL        >>               12180000
<<13>>                     0,                                           12185000
                                                                        12190000
<<14>>  << DSJ >>      %2402, << Reporting msg secondary>>              12195000
<<15>>                     0, << Return byte           >>               12200000
<<16>>                     0, << Normal completion     >>               12205000
<<17>>                     2, << Hard error /req status>>               12210000
<<18>>                    18, << Power on occurred     >>               12215000
                                                                        12220000
<<19>>  << INT/HLT1 >>  %601, << Interrupt/halt        >>               12225000
<<20>>                     1, << Code of 1 in CPVA(1)  >>               12230000
                                                                        12235000
<<21>>  << INT/HLT3 >>  %601, << Interrupt/halt        >>               12240000
<<22>>                     3, << Code of 3 in CPVA(1)  >>               12245000
$PAGE                                                                   12250000
   <<-------------------------------------------------->>               12255000
   << [DIAG] complementary, GP, diag, trans commands   >>               12260000
   << Command/Trans - Reporting message sections       >>               12265000
   <<-------------------------------------------------->>               12270000
                                                                        12275000
<< 0>>  << WRITE CTRL>>%2005, << Cmd/trans msg secondary>>              12280000
<< 1>>                     0, << Cmd buffer length     >>               12285000
<< 2>>                     0, << No Burst              >>               12290000
<< 3>>                 %2000, << Cmd buffer bank       >>               12295000
<< 4>>                     0, << Cmd buffer abs addr   >>               12300000
                                                                        12305000
<< 5>>  << WAIT >>     %1000, << Wait for PPOLL        >>               12310000
<< 6>>                     0,                                           12315000
                                                                        12320000
<< 7>>  << DSJ >>      %2402, << Reporting msg secondary>>              12325000
<< 8>>                     0, << Return byte           >>               12330000
<< 9>>                     0, << Normal completion     >>               12335000
<<10>>                   -35, << Hard error /req status>>               12340000
<<11>>                     2, << Power on occurred     >>               12345000
                                                                        12350000
<<12>>  << INT/HLT0 >>  %601, << Interrupt/halt        >>               12355000
<<13>>                     0, << Code of 0 in CPVA(1)  >>               12360000
$PAGE                                                                   12365000
   <<-------------------------------------------------->>               12370000
   << [PON] Channel independent clear on the device    >>               12375000
   << should be done, and parity on.                   >>               12380000
   <<-------------------------------------------------->>               12385000
                                                                        12390000
<< 0>>  << WRITE TRAN>>%4002, << Trans msg secondary   >>               12395000
<< 1>>                     2, << Cmd buffer length     >>               12400000
<< 2>>                     0, << No Burst              >>               12405000
<< 3>>  <<CI CLEAR >>  %2000, << Cmd buffer bank       >>               12410000
<< 4>>                     0, << Cmd buffer abs addr   >>               12415000
                                                                        12420000
<< 5>>  << WAIT >>     %1000, << Wait for PPOLL        >>               12425000
<< 6>>                     0,                                           12430000
                                                                        12435000
<< 7>>  << DSJ >>      %2402, << Reporting msg secondary>>              12440000
<< 8>>                     0, << Return byte           >>               12445000
<< 9>>                     0, << Normal completion     >>               12450000
<<10>>                   -49, << Hard error /req status>>               12455000
<<11>>                   -12, << Power on occurred     >>               12460000
                                                                        12465000
<<12>>  << WRITE TRAN>>%4002, << Trans msg secondary   >>               12470000
<<13>>                     2, << Cmd buffer length     >>               12475000
<<14>>                     0, << No Burst              >>               12480000
<<15>>                 %2000, << Cmd buffer bank       >>               12485000
<<16>>                     0, << Cmd buffer abs addr   >>               12490000
                                                                        12495000
<<17>>  << INT/HLT0 >>  %601, << Interrupt/halt        >>               12500000
<<18>>                     2, << Code of 2 in CPVA(1)  >>               12505000
$PAGE                                                                   12510000
   <<-------------------------------------------------->>               12515000
   <<  Miscellaneous storage and constants area        >>               12520000
   <<-------------------------------------------------->>               12525000
                                                                        12530000
<< =============================================== >>                   12535000
<<               STAT'CDB area                     >>                   12540000
<< =============================================== >>                   12545000
                                                                        12550000
<<  0>> << STATUS'CDB >> %15, << CDB for request status>>               12555000
                                                                        12560000
<< =============================================== >>                   12565000
<<              LOC'WRT'CDB area                   >>                   12570000
<< =============================================== >>                   12575000
                                                                        12580000
<<  0>> <<LOC & WRT CDB>>%40, << Set unit              >>               12585000
<<  1>>               %14000, << Set length zero       >>               12590000
<<  2>>                    0,                                           12595000
<<  3>>                    2, << locate & write        >>               12600000
                                                                        12605000
<< =============================================== >>                   12610000
<<                PON'CDB'1 area                   >>                   12615000
<< =============================================== >>                   12620000
                                                                        12625000
<<  0>> <<PON CDB>>   %20010, << CI clear              >>               12630000
                                                                        12635000
<< =============================================== >>                   12640000
<<                PON'CDB'2 area                   >>                   12645000
<< =============================================== >>                   12650000
                                                                        12655000
<<  0>>                 %401, << Set parity on commands>>               12660000
                                                                        12665000
<<  0>> << INITFLG >>      0, << Initialization flag   >>               12670000
                                                                        12675000
<<  0>> << FILL WORD >>    0, << Fill W/zeros, blanks  >>               12680000
                                                                        12685000
<< =============================================== >>                   12690000
<<                 DESC'AREA area                  >>                   12695000
<< =============================================== >>                   12700000
                                                                        12705000
<<  0>> << DESC >> 0,0,0,0,0, << Describe area         >>               12710000
<<  5>> << AREA >> 0,0,0,0,0,                                           12715000
                                                                        12720000
<< =============================================== >>                   12725000
<<                CDB'AREA'WRD area                >>                   12730000
<< =============================================== >>                   12735000
                                                                        12740000
<<  0>> << CDB  >> 0,0,0,0,0, << CDB area/desc area    >>               12745000
<<  5>> << AREA >> 0,0,0,0,0;                                           12750000
                                                                        12755000
$PAGE                                                                   12760000
<<                                                                      12765000
         ***************************************                        12770000
         *                                     *                        12775000
         *   External procedure declarations   *                        12780000
         *                                     *                        12785000
         ***************************************                        12790000
>>                                                                      12795000
                                                                        12800000
INTEGER PROCEDURE GETDRT(DRTN,OFFSET);                                  12805000
   VALUE DRTN,OFFSET;                                                   12810000
   INTEGER DRTN,OFFSET;                                                 12815000
   OPTION EXTERNAL;                                                     12820000
                                                                        12825000
PROCEDURE GIP'HPIB;                                                     12830000
   OPTION EXTERNAL;                                                     12835000
                                                                        12840000
LOGICAL PROCEDURE IOMESSAGE(SETNO,MSGNO,MASK,P1,P2,P3,P4,P5,            12845000
                            DEST,REPLY,OFFSET,P'DIT,IOTYPE);            12850000
   VALUE SETNO,MSGNO,MASK,P1,P2,P3,P4,P5,DEST,REPLY,OFFSET,             12855000
         P'DIT,IOTYPE;                                                  12860000
   INTEGER SETNO,MSGNO,MASK,P1,P2,P3,P4,P5,DEST,REPLY,OFFSET;           12865000
   INTEGER IOTYPE;                                                      12870000
   INTEGER POINTER P'DIT;                                               12875000
   OPTION VARIABLE, EXTERNAL;                                           12880000
                                                                        12885000
PROCEDURE LDEVNOTRDY(P'DIT);                                            12890000
   VALUE P'DIT;                                                         12895000
   POINTER P'DIT;                                                       12900000
   OPTION EXTERNAL;                                                     12905000
                                                                        12910000
PROCEDURE MAINT'REQUEST(LDEV,TYPE,SUBTYPE);                             12915000
   VALUE LDEV,TYPE,SUBTYPE;                                             12920000
   INTEGER LDEV,TYPE,SUBTYPE;                                           12925000
   OPTION EXTERNAL;                                                     12930000
                                                                        12935000
PROCEDURE SIODM(P'DIT,FLAGS);                                           12940000
   VALUE P'DIT,FLAGS;                                                   12945000
   LOGICAL FLAGS;                                                       12950000
   POINTER P'DIT;                                                       12955000
   OPTION EXTERNAL;                                                     12960000
                                                                        12965000
PROCEDURE START'HPIB(P'DIT,SIOP,QFLAG);                                 12970000
   VALUE P'DIT,SIOP,QFLAG;                                              12975000
   LOGICAL QFLAG;                                                       12980000
   POINTER P'DIT,SIOP;                                                  12985000
   OPTION EXTERNAL;                                                     12990000
                                                                        12995000
PROCEDURE PUTDRT(DRT,OFFSET,NUM);                                       13000000
   VALUE DRT,OFFSET,NUM;                                                13005000
   INTEGER DRT,OFFSET,NUM;                                              13010000
   OPTION EXTERNAL;                                                     13015000
$PAGE                                                                   13020000
<<                                                                      13025000
         *********************************************                  13030000
         *                                           *                  13035000
         *   CS'80 driver initialization procedure   *                  13040000
         *                                           *                  13045000
         *********************************************                  13050000
>>                                                                      13055000
                                                                        13060000
<<---------------------------------------------------->>                13065000
<<                                                    >>                13070000
<<   This procedure initializes the cs'80 channel     >>                13075000
<<   program area and sends out a device clear to     >>                13080000
<<   reset the drive to a known state.                >>                13085000
<<                                                    >>                13090000
<<---------------------------------------------------->>                13095000
                                                                        13100000
PROCEDURE BUFFALO'INIT(P'DIT);                                          13105000
   VALUE P'DIT;                                                         13110000
   INTEGER POINTER P'DIT;                                               13115000
                                                                        13120000
BEGIN                                                                   13125000
                                                                        13130000
INTEGER POINTER                                                         13135000
   P'ILT,                              << ILT pointer               >>  13140000
   SIOP;                               << channel program pointer   >>  13145000
                                                                        13150000
LOGICAL                                                                 13155000
   LPDT'INDEX;                                                          13160000
                                                                        13165000
DISABLE;                               << On entry-want BUFFALO'INIT>>  13170000
                                       << to complete               >>  13175000
                                                                        13180000
@P'ILT := P'DIT(DILTP);                << pointer to the ILT        >>  13185000
@SIOP  := P'ILT(ILT'SIOP);             << pointer to the SIOP       >>  13190000
                                                                        13195000
IF SPU'POWERFAIL <> ZERO THEN          << Bypass init on SPU        >>  13200000
   RETURN;                             << powerfail                 >>  13205000
                                                                        13210000
LPDT'INDEX   := DIT'LDEV * SIZE'OF'LPDT'ENTRY;                          13215000
DIT'LOCK'FLG := IF LPDT'NON'SYS'DOMAIN    = ZERO        AND             13220000
                   LPDT'RDY'SER'FRN'DISC  = ZERO        AND             13225000
                   LPDT'SERIAL'OR'FOREIGN = LPDT'SERIAL THEN            13230000
                                                                        13235000
                   ONE                                                  13240000
                ELSE                                                    13245000
                   ZERO;                                                13250000
                                                                        13255000
CP'IDLE'CDB'OFFSET   := @SIOP  + SYSDB + LOC'WRT'CDB;                   13260000
CP'DXFER'CDB'OFFSET  := @SIOP  + SYSDB + CDB'AREA'WRD;                  13265000
CP'RSTAT'CDB'OFFSET  := @SIOP  + SYSDB + STAT'CDB;                      13270000
CP'RSTAT'STAT'AREA   := @P'DIT + SYSDB + DSTATUS;                       13275000
CP'DIAG'CDB'OFFSET   := @SIOP  + SYSDB + CDB'AREA'WRD;                  13280000
CP'PON'CDB'OFFSET    := @SIOP  + SYSDB + PON'CDB'1;                     13285000
CP'PON'CDB'2'OFFSET  := @SIOP  + SYSDB + PON'CDB'2;                     13290000
CP'FIRST'BRANCH      := ENTER'POWER'ON;                                 13295000
                                       << For series 33 and 64      >>  13300000
                                       << microcode bug             >>  13305000
PUTDRT(ILT'DRT'NUMBER,THREE,ZERO);                                      13310000
START'HPIB(P'DIT,SIOP,FALSE);                                           13315000
DIT'SUBSTATE     := IDLE'REQ'WAIT;                                      13320000
                                                                        13325000
CP'INIT'DVR'FLAG := TRUE;                                               13330000
                                                                        13335000
END;                                                                    13340000
$PAGE                                                                   13345000
<<                                                                      13350000
         **************************************************             13355000
         *                                                *             13360000
         * CS'80 disc driver procedure  -  BUFFALO'DRIVER *             13365000
         *                                                *             13370000
         **************************************************             13375000
>>                                                                      13380000
                                                                        13385000
<<--------------------------------------------------------->>           13390000
<<                                                         >>           13395000
<<   This procedure initiates and completes i/o requests   >>           13400000
<<   for the CS'80 discs connected to the HP-IB and con-   >>           13405000
<<   trolled by the general I/O channel (GIC).             >>           13410000
<<                                                         >>           13415000
<<   Mode returns in BUFFALO'DRIVER -                      >>           13420000
<<     5 - Request completed                               >>           13425000
<<     7 - Not ready wait                                  >>           13430000
<<   %13 - Wait for completion                             >>           13435000
<<                                                         >>           13440000
<<--------------------------------------------------------->>           13445000
                                                                        13450000
INTEGER PROCEDURE BUFFALO'DRIVER(P'IOQ,P'DIT,BANK,BUFFADDR,SIOP,DRTN);  13455000
   VALUE P'DIT,P'IOQ,BANK,BUFFADDR,DRTN;                                13460000
   INTEGER BANK,BUFFADDR,DRTN,P'IOQ;                                    13465000
   INTEGER POINTER P'DIT;                                               13470000
   INTEGER ARRAY SIOP;                                                  13475000
   OPTION PRIVILEGED,UNCALLABLE;                                        13480000
                                                                        13485000
BEGIN                                                                   13490000
                                                                        13495000
LOGICAL POINTER                                                         13500000
   SIOP'BASE;                                                           13505000
                                                                        13510000
INTEGER POINTER                                                         13515000
   P'ILT,                              << ILT pointer               >>  13520000
   P'CPVA = P'ILT;                     << CP variable area ptr      >>  13525000
                                                                        13530000
DOUBLE                                                                  13535000
   TRANSFER'COUNT,                     << Buffer transfer count     >>  13540000
   BYTES'LEFT,                                                          13545000
   ABS'SIOP'ADDR,                                                       13550000
   VER'LEN,                            << Byte length of a verify   >>  13555000
   BANK'N'BUFF'ADDR = Q - 7;           << Bank and buffer address   >>  13560000
                                                                        13565000
DOUBLE POINTER                                                          13570000
   DIT'TRANSFERED'COUNT,                                                13575000
   DP'DIT = P'DIT;                                                      13580000
                                                                        13585000
INTEGER                                                                 13590000
   DRIVER'STATE = BUFFALO'DRIVER,      << Driver return state       >>  13595000
   FCODE,                              << Function code             >>  13600000
   INDEX,                                                               13605000
   I,                                                                   13610000
   ADDRESS'OFFSET;                                                      13615000
                                                                        13620000
LOGICAL                                                                 13625000
   GENERIC'STATUS,                                                      13630000
   IOQ'ENTRY'INDEX,                                                     13635000
   LPDT'INDEX,                                                          13640000
   L'TRANSFER'COUNT = TRANSFER'COUNT + ONE,                             13645000
   L'BYTES'LEFT = BYTES'LEFT + ONE,                                     13650000
   PARM,                                                                13655000
   L1'VER'LEN = VER'LEN,               << First word of ver. len.   >>  13660000
   L2'VER'LEN = VER'LEN + ONE;         << 2'nd  word of ver. len.   >>  13665000
$PAGE                                                                   13670000
<<****************************************************>>                13675000
<<                                                    >>                13680000
<<   CS'80 disc driver subroutines                    >>                13685000
<<                                                    >>                13690000
<<****************************************************>>                13695000
                                                                        13700000
<<---------------------------------------------------->>                13705000
<<   SIOP'BYTE -- Subroutine to store the CS'80       >>                13710000
<<       command bytes into the channel program area. >>                13715000
<<---------------------------------------------------->>                13720000
                                                                        13725000
SUBROUTINE SIOP'BYTE(BYTE'OFFSET,ABYTE);                                13730000
   VALUE BYTE'OFFSET,ABYTE;                                             13735000
   LOGICAL BYTE'OFFSET,ABYTE;                                           13740000
                                                                        13745000
BEGIN << Of "subroutine SIOP'BYTE" >>                                   13750000
                                                                        13755000
SETDB'SIOP;                                                             13760000
SIODB'BYTE'ARRAY(BYTE'OFFSET) := ABYTE;                                 13765000
SETDB'SYS;                                                              13770000
                                                                        13775000
END; << Of "subroutine SIOP'BYTE" >>                                    13780000
                                                                        13785000
<<---------------------------------------------------->>                13790000
<<   UPDATE'XFER'CNT -- Update transfer count         >>                13795000
<<---------------------------------------------------->>                13800000
                                                                        13805000
SUBROUTINE UPDATE'XFER'CNT;                                             13810000
                                                                        13815000
BEGIN << Of "subroutine UPDATE'XFER'CNT" >>                             13820000
                                                                        13825000
IF DIT'TRANSFERED'COUNT = 0D THEN                                       13830000
   IF INTEGER(IOQ'COUNT) < ZERO THEN                                    13835000
                                       << Return byte count         >>  13840000
      IOQ'COUNT := -INTEGER(TRANSFER'COUNT -                            13845000
                      DOUBLE(CP'DXFER'DATA'SIZE))                       13850000
   ELSE                                                                 13855000
                                       << Return word count         >>  13860000
      IOQ'COUNT := INTEGER((TRANSFER'COUNT -                            13865000
                      DOUBLE(CP'DXFER'DATA'SIZE) + 1D) / 2D)            13870000
ELSE                                                                    13875000
   BEGIN                                                                13880000
   IF INTEGER(IOQ'COUNT) < ZERO THEN                                    13885000
                                       << Return byte count         >>  13890000
      IOQ'COUNT := -INTEGER(DIT'TRANSFERED'COUNT -                      13895000
                      DOUBLE(CP'DXFER'DATA'SIZE))                       13900000
   ELSE                                                                 13905000
                                       << Return word count         >>  13910000
      IOQ'COUNT := INTEGER((DIT'TRANSFERED'COUNT -                      13915000
                      DOUBLE(CP'DXFER'DATA'SIZE) + 1D) / 2D);           13920000
                                                                        13925000
   DIT'TRANSFERED'COUNT := 0D;         << Reset the count to zero.  >>  13930000
   END; << Of else "if DIT'TRANSFERED'COUNT = 0D ..." >>                13935000
                                                                        13940000
CP'DXFER'DATA'SIZE  := ZERO;           << Reset the transfer count >>   13945000
                                                                        13950000
END; << Of "subroutine UPDATE'XFER'CNT" >>                              13955000
$PAGE                                                                   13960000
<<****************************************************>>                13965000
<<****************************************************>>                13970000
<<                                                    >>                13975000
<<   CS'80 disc driver initiator section              >>                13980000
<<                                                    >>                13985000
<<****************************************************>>                13990000
<<****************************************************>>                13995000
                                                                        14000000
@SIOP'BASE            := @SIOP;                                         14005000
ABS'SIOP'ADDR         := DOUBLE(LOGICAL(@SIOP + SYSDB));                14010000
IOQ'ENTRY'INDEX       := P'IOQ;        << IOQ offset                >>  14015000
@P'ILT                := DIT'ILT'PTR;  << ILT pointer               >>  14020000
LPDT'INDEX            := DIT'LDEV * SIZE'OF'LPDT'ENTRY;                 14025000
@DIT'TRANSFERED'COUNT := @P'DIT + DBYTECNT;                             14030000
$PAGE                                                                   14035000
<<---------------------------------------------------->>                14040000
<<  Assure that the initialization section was called.>>                14045000
<<---------------------------------------------------->>                14050000
                                                                        14055000
IF NOT LOGICAL( CP'INIT'DVR'FLAG ) THEN                                 14060000
   BEGIN                                                                14065000
   BUFFALO'INIT(P'DIT);                                                 14070000
   IF IOQ'ENTRY'INDEX <> ZERO THEN                                      14075000
      BEGIN                                                             14080000
      IOQ'WAITCODE := IOQ'DEFER'WAIT;                                   14085000
      DRIVER'STATE := INTERRUPT'WAIT;                                   14090000
      END; << Of "if IOQ'ENTRY'INDEX <> ZERO ..." >>                    14095000
   RETURN;                                                              14100000
   END; << Of "if NOT LOGICAL(SIOP..." >>                               14105000
$PAGE                                                                   14110000
<<---------------------------------------------------->>                14115000
<<   No IOQ - Service special conditions asssociated  >>                14120000
<<            with the idle CP or schedule an         >>                14125000
<<            idle channel program.                   >>                14130000
<<---------------------------------------------------->>                14135000
                                                                        14140000
IF DRIVER'STATE    = INITIATOR'STATE AND                                14145000
   IOQ'ENTRY'INDEX = ZERO            THEN                               14150000
                                                                        14155000
   BEGIN                                                                14160000
                                                                        14165000
   <<---------------------------------------------------->>             14170000
   << Must not reference IOQ before return               >>             14175000
   <<---------------------------------------------------->>             14180000
                                                                        14185000
                                       << The idle CP aborted.      >>  14190000
   IF CPVA'ERRORCODE = DMA'ABORT     OR   << DMA abort              >>  14195000
      CPVA'ERRORCODE = CHANNEL'ABORT THEN << Channel abort          >>  14200000
                                                                        14205000
      BEGIN                                                             14210000
                                       << Not rdy msg to console    >>  14215000
      IF SYSTEM'UP THEN LDEVNOTRDY(P'DIT);                              14220000
                                                                        14225000
                                       << Schedule idle wait CP     >>  14230000
      CP'FIRST'BRANCH := ENTER'IDLE'WAIT;                               14235000
      START'HPIB(P'DIT,SIOP(FIRSTBRANCH),FALSE);               <<f9010>>14240000
      DRIVER'STATE    := REQUEST'COMPLETE;                              14245000
      DIT'SUBSTATE    := NORMAL'IDLE;                          <<f9010>>14250000
      P'CPVA          := 0;                                    <<f9010>>14255000
                                                                        14260000
      RETURN;                                                           14265000
      END; << Of "if CPVA'ERRORCODE = DMA'ABORT OR ..." >>              14270000
$PAGE                                                                   14275000
                                       << Status received by the    >>  14280000
                                       << idle CP should be         >>  14285000
                                       << diagnosticed              >>  14290000
   IF CPVA'STATUS = ONE THEN                                            14295000
      BEGIN                                                             14300000
      CPVA'STATUS := ZERO;                                              14305000
                                                                        14310000
      IF DIT'DEV'POWERFAIL = ONE THEN                                   14315000
         BEGIN                         << Clear the device          >>  14320000
         CP'FIRST'BRANCH    := ENTER'POWER'ON;                          14325000
         START'HPIB(P'DIT,SIOP,TRUE);                                   14330000
                                                                        14335000
         DIT'IMMEDIATE'MODE := ONE;    << Immediate reporting will  >>  14340000
                                       << be enabled.               >>  14345000
                                                                        14350000
         DIT'IGNORE'INT     := ZERO;                                    14355000
         DIT'SUBSTATE       := IDLE'REQ'WAIT;                           14360000
         DRIVER'STATE       := REQUEST'COMPLETE;                        14365000
                                                                        14370000
         RETURN;                                                        14375000
         END; << Of "if DIT'DEV'POWERFAIL = ONE..." >>                  14380000
                                                                        14385000
      IF DIT'INT'MAINT'REQ   = ONE OR                                   14390000
         DIT'I'OPR'REL'REQ   = ONE OR                                   14395000
         DIT'I'DIAG'REL'REQ  = ONE OR                                   14400000
         DIT'I'INT'MAINT'REQ = ONE THEN                                 14405000
                                                                        14410000
         BEGIN                         << Release/Release deny      >>  14415000
                                       << request                   >>  14420000
         CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                            14425000
         CP'DIAG'CDB'LENGTH  := TWO;                                    14430000
                                                                        14435000
         SIOP'BYTE(CDB'AREA'BYTE + 0 , CDB'SET'UNIT + CTRL'UNIT);       14440000
         SIOP'BYTE(CDB'AREA'BYTE + 1 ,                                  14445000
            IF DIT'INT'MAINT'REQ   =  ONE OR                            14450000
               DIT'I'INT'MAINT'REQ =  ONE OR                            14455000
               DIT'I'OPR'REL'REQ   =  ONE AND                           14460000
               DIT'DEV'NOT'RDY     =  ONE OR                            14465000
               DIT'I'OPR'REL'REQ   =  ONE AND                           14470000
               DIT'LOCK'FLG        <> ONE THEN                          14475000
                  CDB'RELEASE                                           14480000
            ELSE                                                        14485000
                  CDB'RELEASE'DENY);                                    14490000
                                                                        14495000
                                       << Send message to console  >>   14500000
                                       << that the device will not >>   14505000
                                       << be released.             >>   14510000
         IF DIT'I'OPR'REL'REQ = ONE  AND                                14515000
            DIT'LOCK'FLG      = ONE  AND                                14520000
            DIT'DEV'NOT'RDY   = ZERO THEN                               14525000
                                                                        14530000
            IOMESSAGE(1,NSYS'DENY'MSG,%10000,DIT'LDEV,,,,,CONSOLE);     14535000
                                                                        14540000
         IF DIT'I'OPR'REL'REQ = ONE OR                                  14545000
            DIT'DEV'NOT'RDY   = ONE THEN                                14550000
                                                                        14555000
            DIT'IGNORE'INT := ZERO                                      14560000
         ELSE                                                           14565000
            DIT'IGNORE'INT := ONE;                                      14570000
                                                                        14575000
         CP'FIRST'BRANCH := ENTER'DIAG;                                 14580000
         START'HPIB(P'DIT,SIOP,TRUE);                                   14585000
         DIT'SUBSTATE    := IDLE'REQ'WAIT;                              14590000
         DRIVER'STATE    := REQUEST'COMPLETE;                           14595000
                                                                        14600000
         RETURN;                                                        14605000
         END; << Of "if DIT'INT'MAINT'REQ = ONE..." >>                  14610000
                                                                        14615000
      IF DIT'MAINT'TRACK = ONE THEN                                     14620000
         BEGIN                                                          14625000
         MAINT'REQUEST(DIT'LDEV,TYPE'BUFFALO,LPDT'SUBTYPE);             14630000
                                                                        14635000
         IF DIT'SUBSTATE = IDLE'REQ'WAIT THEN                           14640000
            DIT'SUBSTATE   := ZERO     << Idle wait done           >>   14645000
         ELSE                                                           14650000
            DIT'IGNORE'INT := ONE;                                      14655000
                                                                        14660000
         CP'FIRST'BRANCH := ENTER'IDLE;                                 14665000
         START'HPIB(P'DIT,SIOP,FALSE);                                  14670000
         DIT'SUBSTATE    := IDLE'REQ'WAIT;                              14675000
         DRIVER'STATE    := REQUEST'COMPLETE;                           14680000
                                                                        14685000
         RETURN;                                                        14690000
         END; << Of "if DIT'MAINT'TRACK = ONE..." >>                    14695000
      END; << Of "if CPVA'STATUS = ONE..." >>                           14700000
$PAGE                                                                   14705000
   IF CPVA'STATUS = FOUR THEN          << Idle PON occurred         >>  14710000
      BEGIN                            << Do a device clear         >>  14715000
      CPVA'STATUS        := ZERO;                                       14720000
      CP'FIRST'BRANCH    := ENTER'POWER'ON;                             14725000
      START'HPIB(P'DIT,SIOP,TRUE);                                      14730000
                                                                        14735000
      DIT'IMMEDIATE'MODE := ONE;       << Immediate reporting will  >>  14740000
                                       << be enabled.               >>  14745000
      DIT'IGNORE'INT     := ZERO;                                       14750000
      DIT'SUBSTATE       := IDLE'REQ'WAIT;                              14755000
      DRIVER'STATE       := REQUEST'COMPLETE;                           14760000
                                                                        14765000
      RETURN;                                                           14770000
      END; << Of "if CPVA'STATUS = FOUR ..." >>                         14775000
$PAGE                                                                   14780000
   IF DIT'SUBSTATE = IDLE'REQ'WAIT THEN                                 14785000
      DIT'SUBSTATE   := ZERO           << Idle wait done            >>  14790000
   ELSE                                                                 14795000
      DIT'IGNORE'INT := ONE;                                            14800000
                                                                        14805000
   CPVA'STATUS     := ZERO;                                             14810000
   CP'FIRST'BRANCH := ENTER'IDLE;                                       14815000
   START'HPIB(P'DIT,SIOP,FALSE);                                        14820000
   DRIVER'STATE    := REQUEST'COMPLETE;                                 14825000
                                                                        14830000
   RETURN;                                                              14835000
   END; << Of "if IOQ'ENTRY'INDEX = ZERO ..." >>                        14840000
$PAGE                                                                   14845000
<<---------------------------------------------------->>                14850000
<<   Idle request currently being serviced, defer     >>                14855000
<<   current request until idle request completed     >>                14860000
<<---------------------------------------------------->>                14865000
                                                                        14870000
IF DRIVER'STATE = INITIATOR'STATE AND                                   14875000
   DIT'SUBSTATE = IDLE'REQ'WAIT THEN                                    14880000
   BEGIN                                                                14885000
   IOQ'WAITCODE := IOQ'DEFER'WAIT;                                      14890000
   DRIVER'STATE := INTERRUPT'WAIT;                                      14895000
                                                                        14900000
   RETURN;                                                              14905000
   END; << Of "if DRIVER'STATE = INITIATOR'STATE ..." >>                14910000
$PAGE                                                                   14915000
<<---------------------------------------------------->>                14920000
<<   Convert the transfer count to bytes.             >>                14925000
<<---------------------------------------------------->>                14930000
                                                                        14935000
IF INTEGER(IOQ'COUNT) < ZERO THEN                                       14940000
   TRANSFER'COUNT := - DOUBLE(IOQ'COUNT)                                14945000
ELSE                                                                    14950000
   TRANSFER'COUNT := DOUBLE(IOQ'COUNT) * 2D;                            14955000
$PAGE                                                                   14960000
<<---------------------------------------------------->>                14965000
<<   Map from external to internal function code      >>                14970000
<<                                                    >>                14975000
<<   Function code 0 -4  --> Internal code 0 -4       >>                14980000
<<   Function code 5     --> Internal code 1          >>                14985000
<<   Function code 6     --> Internal code 1          >>                14990000
<<   Function code 7 -9  --> Internal code 5 -7       >>                14995000
<<   Function code 11    --> Internal code 1          >>                15000000
<<   Function code 13-18 --> Internal code 8 -13      >>                15005000
<<   Function code 29    --> Internal code 14         >>                15010000
<<   Function code 72-73 --> Internal code 15-16      >>                15015000
<<   Function code 74    --> Internal code 5          >>                15020000
<<   Function code 75-76 --> Internal code 17-18      >>                15025000
<<   Function code 79-82 --> Internal code 19-22      >>                15030000
<<   Function code 88    --> Internal code 23         >>                15035000
<<   Function code 91-94 --> Internal code 24-27      >>                15040000
<<   Function code 95    --> Internal code 5          >>                15045000
<<   Function code 100   --> Internal code 28         >>                15050000
<<   Function code 101   --> Internal code 25         >>                15055000
<<---------------------------------------------------->>                15060000
                                                                        15065000
IF 0  <= INTEGER(IOQ'FUNC) <= 4  THEN                                   15070000
   FCODE := INTEGER(IOQ'FUNC)                                           15075000
ELSE IF INTEGER(IOQ'FUNC) = 5  THEN                                     15080000
   FCODE := 1                                                           15085000
ELSE IF INTEGER(IOQ'FUNC) = 6  THEN                                     15090000
   FCODE := 1                                                           15095000
ELSE IF 7  <= INTEGER(IOQ'FUNC) <= 9  THEN                              15100000
   FCODE := INTEGER(IOQ'FUNC) - 7 + 5                                   15105000
ELSE IF INTEGER(IOQ'FUNC) = 11 THEN                                     15110000
   FCODE := 1                                                           15115000
ELSE IF 13 <= INTEGER(IOQ'FUNC) <= 18 THEN                              15120000
   FCODE := INTEGER(IOQ'FUNC) - 13 + 8                                  15125000
ELSE IF INTEGER(IOQ'FUNC) = 29 THEN                                     15130000
   FCODE := 14                                                          15135000
ELSE IF 72 <= INTEGER(IOQ'FUNC) <= 73 THEN                              15140000
   FCODE := INTEGER(IOQ'FUNC) - 72 + 15                                 15145000
ELSE IF INTEGER(IOQ'FUNC) = 74 THEN                                     15150000
   FCODE := 5                                                           15155000
ELSE IF 75 <= INTEGER(IOQ'FUNC) <= 76 THEN                              15160000
   FCODE := INTEGER(IOQ'FUNC) - 75 + 17                                 15165000
ELSE IF 79 <= INTEGER(IOQ'FUNC) <= 82 THEN                              15170000
   FCODE := INTEGER(IOQ'FUNC) - 79 + 19                                 15175000
ELSE IF INTEGER(IOQ'FUNC) = 88 THEN                                     15180000
   FCODE := 23                                                          15185000
ELSE IF 91 <= INTEGER(IOQ'FUNC) <= 94 THEN                              15190000
   FCODE := INTEGER(IOQ'FUNC) - 91 + 24                                 15195000
ELSE IF INTEGER(IOQ'FUNC) = 95 THEN                                     15200000
   FCODE := 5                                                           15205000
ELSE IF INTEGER(IOQ'FUNC) = 100 THEN                                    15210000
   FCODE := 28                                                          15215000
ELSE IF INTEGER(IOQ'FUNC) = 101 THEN                                    15220000
   FCODE := 25                                                          15225000
ELSE                                                                    15230000
   BEGIN                               << Exit with invalid func.   >>  15235000
   IOQ'STAT     := INVALID'REQUEST;                                     15240000
   IOQ'COUNT    := ZERO;                                                15245000
   DRIVER'STATE := REQUEST'COMPLETE;                                    15250000
                                                                        15255000
   RETURN;                                                              15260000
   END; << Of the long if (case) statement >>                           15265000
$PAGE                                                                   15270000
<<---------------------------------------------------->>                15275000
<<   IOQ deferred request completion - redo request   >>                15280000
<<---------------------------------------------------->>                15285000
                                                                        15290000
IF IOQ'WAITCODE = IOQ'DEFER'WAIT THEN                                   15295000
   BEGIN                                                                15300000
   DIT'SUBSTATE := ZERO;               << Reset substate            >>  15305000
   IF DIT'MAINT'TRACK = ONE THEN                                        15310000
      MAINT'REQUEST(DIT'LDEV,TYPE'BUFFALO,LPDT'SUBTYPE);                15315000
   GOTO RETRY'REQUEST;                                                  15320000
   END; << Of "if IOQ'WAITCODE = IOQ'DEFER'WAIT..." >>                  15325000
                                                                        15330000
<<---------------------------------------------------->>                15335000
<<   Not ready completion - Go to completor section   >>                15340000
<<---------------------------------------------------->>                15345000
                                                                        15350000
IF IOQ'WAITCODE = NOT'RDY'WAIT THEN                                     15355000
   GOTO CONTINUATOR;                                                    15360000
                                                                        15365000
$PAGE                                                                   15370000
<<---------------------------------------------------->>                15375000
<<   Initiator call - initialize or reset variables   >>                15380000
<<                    possibly changed in last req.   >>                15385000
<<                  - case to a driver function code  >>                15390000
<<---------------------------------------------------->>                15395000
                                                                        15400000
IF (DRIVER'STATE   = INITIATOR'STATE) LOR                               15405000
                                       << More data to process for  >>  15410000
                                       << the read function.        >>  15415000
   ((CPVA'STATUS   = ZERO)                 LAND                         15420000
   (TRANSFER'COUNT > DIT'TRANSFERED'COUNT) LAND                         15425000
   (FCODE          = FC'READ))        LOR                               15430000
                                       << More data to process for  >>  15435000
                                       << the write function.       >>  15440000
   ((CPVA'STATUS   = ZERO)                 LAND                         15445000
   (TRANSFER'COUNT > DIT'TRANSFERED'COUNT) LAND                         15450000
   (FCODE          = FC'WRITE))       THEN                              15455000
                                                                        15460000
   BEGIN                                                                15465000
                                                                        15470000
                                       << Perform only on a retry.  >>  15475000
   IF HELL'FROZE'OVER THEN                                              15480000
      BEGIN                                                             15485000
RETRY'REQUEST:                                                          15490000
                                                                        15495000
                                       << Do the whole read/write   >>  15500000
                                       << process over again.       >>  15505000
      IF FCODE = FC'READ  OR                                            15510000
         FCODE = FC'WRITE THEN                                          15515000
                                                                        15520000
         DIT'TRANSFERED'COUNT := 0D;                                    15525000
                                                                        15530000
      END; << Of "if HELL'FROZE'OVER ..." >>                            15535000
                                                                        15540000
$PAGE                                                                   15545000
CASE FCODE OF                                                           15550000
   BEGIN << Of "case FCODE..." >>                                       15555000
                                                                        15560000
<<--------------------------------------------------------->>           15565000
<<                                                         >>           15570000
<<    CODE   Function                    Internal FCODE    >>           15575000
<<    ----   --------                    --------------    >>           15580000
<<                                                         >>           15585000
<<      0    Read                              0           >>           15590000
<<      1    Write                             1           >>           15595000
<<      2    File open                         2           >>           15600000
<<      3    File close                        3           >>           15605000
<<      4    Device close                      4           >>           15610000
<<      5    Fill with zero                    1           >>           15615000
<<      6    File with blanks                  1           >>           15620000
<<      7    Request last status               5           >>           15625000
<<      8    Initialize media                  6           >>           15630000
<<      9    Unload                            7           >>           15635000
<<     11    Write disc label                  1           >>           15640000
<<     13    Request volume limit              8           >>           15645000
<<     14    Locate and verify                 9           >>           15650000
<<     15    Request generic status           10           >>           15655000
<<     16    Lock                             11           >>           15660000
<<     17    Unlock                           12           >>           15665000
<<     18    Read lock bit                    13           >>           15670000
<<     29    Immediate mode                   14           >>           15675000
<<     72    Identify                         15           >>           15680000
<<     73    Initiate diagnostic selftest     16           >>           15685000
<<     74    Selftest result                   5           >>           15690000
<<     75    Loopback write                   17           >>           15695000
<<     76    Loopback read                    18           >>           15700000
<<     79    Release                          19           >>           15705000
<<     80    Release denied                   20           >>           15710000
<<     81    Set release                      21           >>           15715000
<<     82    Set address                      22           >>           15720000
<<     88    Spare block                      23           >>           15725000
<<     91    Initiate utility                 24           >>           15730000
<<     92    Device clear                     25           >>           15735000
<<     93    Cancel transaction               26           >>           15740000
<<     94    Parity checking                  27           >>           15745000
<<     95    Last status request               5           >>           15750000
<<    100    Generic diagnostic request       28           >>           15755000
<<    101    Channel independent clear        25           >>           15760000
<<                                                         >>           15765000
<<--------------------------------------------------------->>           15770000
$PAGE                                                                   15775000
<<---------------------------------------------------->>                15780000
<<                                                    >>                15785000
<<   Read [function code = 0]                         >>                15790000
<<                                                    >>                15795000
<<   TRANSFER'COUNT - transfer count                  >>                15800000
<<   BANK & BUFFADDR - contains data read             >>                15805000
<<   P1 - high order dbl word logical sector address  >>                15810000
<<   P2 - low order dbl word logical sector address   >>                15815000
<<                                                    >>                15820000
<<---------------------------------------------------->>                15825000
                                                                        15830000
   BEGIN << Of case 0 >>                                                15835000
                                                                        15840000
   CP'DXFER'WRITE'READ  := WRT'CMD'SEC;                                 15845000
   CP'DXFER'WAIT'5      := WAIT'INSTR;                                  15850000
   CP'DXFER'WAIT'6      := ZERO;                                        15855000
   CP'DXFER'12'WAIT     := WAIT'INSTR;                                  15860000
   CP'DXFER'13'WAIT     := ZERO;                                        15865000
   CP'DXFER'CMD'TO'EXEC := READ'EXEC'SEC;                               15870000
                                                                        15875000
   <<---------------------------------------------------->>             15880000
   << On the first read operation, set the address of    >>             15885000
   << where to read the data from on the tape, and the   >>             15890000
   << unit number.                                       >>             15895000
   <<---------------------------------------------------->>             15900000
                                                                        15905000
   IF DIT'TRANSFERED'COUNT = 0D THEN                                    15910000
      BEGIN                            << first read operation      >>  15915000
      SETDB'SIOP;                                                       15920000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 0 ) := CDB'SET'UNIT;             15925000
                                                                        15930000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 1 ) := CDB'SET'SNGL'VEC;         15935000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 2 ) := ZERO;                     15940000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 3 ) := ZERO;                     15945000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 4 ) := IOQ'PARM1.(0:8);          15950000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 5 ) := IOQ'PARM1.(8:8);          15955000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 6 ) := IOQ'PARM2.(0:8);          15960000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 7 ) := IOQ'PARM2.(8:8);          15965000
                                                                        15970000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 15) := CDB'READ;                 15975000
      SETDB'SYS;                                                        15980000
      I := 8;                                                           15985000
                                                                        15990000
      CP'DXFER'CDB'LENGTH  := 16;      << CDB byte count            >>  15995000
      CP'DXFER'DATA'TYPE   := ZERO;                                     16000000
      CP'DXFER'DATA'BANK   := BANK;    << data bank                 >>  16005000
      CP'DXFER'DATA'OFFSET := BUFFADDR; << data buffer abs adr      >>  16010000
      END << Of 'if DIT'TRANSFERED'COUNT = 0D ...' >>                   16015000
   ELSE                                                                 16020000
      BEGIN                                                             16025000
      SETDB'SIOP;                                                       16030000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 7 ) := CDB'READ;                 16035000
      SETDB'SYS;                                                        16040000
      I := 0;                                                           16045000
      CP'DXFER'CDB'LENGTH  := 8;       << CDB byte count            >>  16050000
      END; << Of else "if DIT'TRANSFERED'COUNT = 0D ..." >>             16055000
                                                                        16060000
   <<---------------------------------------------------->>             16065000
   << Set auto jump sparing method, and set              >>             16070000
   << immediate report mode.                             >>             16075000
   <<---------------------------------------------------->>             16080000
                                                                        16085000
   SIOP'BYTE(CDB'AREA'BYTE + I + 0 , CDB'SET'OPTIONS);                  16090000
   PARM := CDB'JUMP'SPARE;                                              16095000
                                                                        16100000
   IF DIT'IMMEDIATE'MODE = ONE THEN                                     16105000
      PARM.(12:1) := ONE;                                               16110000
   SIOP'BYTE(CDB'AREA'BYTE + I + 1 , PARM);                             16115000
                                                                        16120000
   <<---------------------------------------------------->>             16125000
   << Determine the amount of data to read.  Maximum read>>             16130000
   << at a time is 6K bytes.                             >>             16135000
   <<---------------------------------------------------->>             16140000
                                                                        16145000
   BYTES'LEFT := TRANSFER'COUNT - DIT'TRANSFERED'COUNT;                 16150000
   IF BYTES'LEFT < DOUBLE(SIX'K'BYTES) THEN                             16155000
      BEGIN                                                             16160000
      SETDB'SIOP;                                                       16165000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 2) := CDB'SET'LENGTH;        16170000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 3) := ZERO;                  16175000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 4) := ZERO;                  16180000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 5) := L'BYTES'LEFT.(0:8);    16185000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 6) := L'BYTES'LEFT.(8:8);    16190000
      SETDB'SYS;                                                        16195000
                                                                        16200000
      IF BYTES'LEFT = 0D THEN          << No data to read           >>  16205000
         BEGIN                                                          16210000
         CP'DXFER'WAIT'5      := ZERO; << Bypass exec msg           >>  16215000
         CP'DXFER'WAIT'6      := 5;    << Jump *+5                  >>  16220000
         END << Of "if BYTES'LEFT = 0D..." >>                           16225000
                                                                        16230000
      ELSE                                                              16235000
         BEGIN                                                          16240000
         CP'DXFER'DATA'SIZE := L'BYTES'LEFT; << Set up read count   >>  16245000
         END; << Else of "if BYTES'LEFT = 0D..." >>                     16250000
      DIT'TRANSFERED'COUNT := TRANSFER'COUNT;                           16255000
      END << Of "if BYTES'LEFT < DOUBLE(SIX'K'BYTES) ..." >>            16260000
   ELSE                                                                 16265000
      BEGIN                                                             16270000
      SETDB'SIOP;                                                       16275000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 2) := CDB'SET'LENGTH;        16280000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 3) := ZERO;                  16285000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 4) := ZERO;                  16290000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 5) := SIX'K'BYTES.(0:8);     16295000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 6) := SIX'K'BYTES.(8:8);     16300000
      SETDB'SYS;                                                        16305000
                                                                        16310000
      CP'DXFER'DATA'SIZE   := SIX'K'BYTES; << Set up read count     >>  16315000
      DIT'TRANSFERED'COUNT := DIT'TRANSFERED'COUNT +                    16320000
                              DOUBLE(SIX'K'BYTES);                      16325000
      END; << Of else "if BYTES'LEFT < DOUBLE(SIX'K'BYTES) ..." >>      16330000
                                                                        16335000
   CP'FIRST'BRANCH := ENTER'DATA'XFER;                                  16340000
                                                                        16345000
   END; << Of case 0 >>                                                 16350000
$PAGE                                                                   16355000
<<---------------------------------------------------->>                16360000
<<                                                    >>                16365000
<<   Write [function code = 1] and                    >>                16370000
<<   Fill with zeros [function code = 5] and          >>                16375000
<<   Fill with blanks [function code = 6] and         >>                16380000
<<   Write disc label [function code = 11]            >>                16385000
<<                                                    >>                16390000
<<   TRANSFER'COUNT - transfer count                  >>                16395000
<<   BANK & BUFFADDR - contains data for write        >>                16400000
<<   P1 - high order dbl word logical sector address  >>                16405000
<<   P2 - low order dbl word logical sector address   >>                16410000
<<                                                    >>                16415000
<<---------------------------------------------------->>                16420000
                                                                        16425000
   BEGIN << Of case 1 >>                                                16430000
                                                                        16435000
                                       << Transfer count should not >>  16440000
                                       << be zero for Fill with zero>>  16445000
                                       << Fill with space, or       >>  16450000
                                       << Write disc label.         >>  16455000
   IF (IOQ'FUNC       = 5 OR                                            16460000
       IOQ'FUNC       = 6 OR                                            16465000
       IOQ'FUNC       = 11) AND                                         16470000
      TRANSFER'COUNT  = 0D  THEN                                        16475000
      BEGIN                            << Exit with invalid func.   >>  16480000
      IOQ'STAT      := INVALID'REQUEST;                                 16485000
      IOQ'COUNT     := ZERO;                                            16490000
      DRIVER'STATE  := REQUEST'COMPLETE;                                16495000
      RETURN;                                                           16500000
      END; << Of "if IOQ'FUNC = 5 ..." >>                               16505000
                                                                        16510000
   CP'DXFER'WRITE'READ  := WRT'CMD'SEC;                                 16515000
   CP'DXFER'WAIT'5      := WAIT'INSTR;                                  16520000
   CP'DXFER'WAIT'6      := ZERO;                                        16525000
   CP'DXFER'12'WAIT     := WAIT'INSTR;                                  16530000
   CP'DXFER'13'WAIT     := ZERO;                                        16535000
   CP'DXFER'CMD'TO'EXEC := WRT'EXEC'SEC;                                16540000
                                                                        16545000
   <<---------------------------------------------------->>             16550000
   << On the first write operation, set the address of   >>             16555000
   << where to write the data on the tape, and the unit  >>             16560000
   << number.                                            >>             16565000
   <<---------------------------------------------------->>             16570000
                                                                        16575000
   IF DIT'TRANSFERED'COUNT = 0D THEN                                    16580000
      BEGIN                            << first write operation     >>  16585000
      SETDB'SIOP;                                                       16590000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 0 )  := CDB'SET'UNIT;            16595000
                                                                        16600000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 1 )  := CDB'SET'SNGL'VEC;        16605000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 2 )  := ZERO;                    16610000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 3 )  := ZERO;                    16615000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 4 )  := IOQ'PARM1.(1:8);         16620000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 5 )  := IOQ'PARM1.(8:8);         16625000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 6 )  := IOQ'PARM2.(0:8);         16630000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 7 )  := IOQ'PARM2.(8:8);         16635000
                                                                        16640000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 15)  := CDB'WRITE;               16645000
      SETDB'SYS;                                                        16650000
      I := 8;                                                           16655000
                                                                        16660000
      CP'DXFER'CDB'LENGTH  := 16;      << CDB byte count            >>  16665000
                                       << For the write function    >>  16670000
                                       << send out the user's data  >>  16675000
                                       << else send zeros or spaces >>  16680000
      IF IOQ'FUNC = ONE OR                                              16685000
         IOQ'FUNC = 11  THEN                                            16690000
         BEGIN                                                          16695000
         CP'DXFER'DATA'TYPE   := ZERO;                                  16700000
         CP'DXFER'DATA'BANK   := BANK; << Data bank                 >>  16705000
         CP'DXFER'DATA'OFFSET := BUFFADDR; << Data buffer abs adr   >>  16710000
         END << Of "if IOQ'FUNC = ONE ..." >>                           16715000
      ELSE                                                              16720000
         BEGIN                                                          16725000
         CP'DXFER'DATA'TYPE   := ZERO;                                  16730000
         CP'DXFER'DONT'C'ADDR := ONE;   << Wrt from single addr     >>  16735000
         CP'DXFER'DATA'BANK   := ZERO;                                  16740000
         CP'DXFER'DATA'OFFSET := @SIOP + SYSDB + FILL'WRD;              16745000
         CP'FILL'WORD         := IF IOQ'FUNC = 5 THEN                   16750000
                                    ZERO << Fill word of zeros      >>  16755000
                                 ELSE                                   16760000
                                    BLANKS; << Fill word of blanks  >>  16765000
         END; << Of else "if IOQ'FUNC = ONE ..." >>                     16770000
      END << Of "if DIT'TRANSFERED'COUNT = 0D ..." >>                   16775000
   ELSE                                                                 16780000
      BEGIN                                                             16785000
      SETDB'SIOP;                                                       16790000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 7 )  := CDB'WRITE;               16795000
      SETDB'SYS;                                                        16800000
      I := 0;                                                           16805000
      CP'DXFER'CDB'LENGTH  :=  8;      << CDB byte count            >>  16810000
      END; << Of else "if DIT'TRANSFERED'COUNT = 0D ..." >>             16815000
                                                                        16820000
   <<---------------------------------------------------->>             16825000
   << Set the sparing method given by the user, and set  >>             16830000
   << immediate report mode.                             >>             16835000
   <<---------------------------------------------------->>             16840000
                                                                        16845000
   SIOP'BYTE(CDB'AREA'BYTE + I + 0 , CDB'SET'OPTIONS);                  16850000
   PARM := ZERO;                                                        16855000
   IF IOQ'PARM1.(0:1) = ONE THEN                                        16860000
      PARM.(13:3) := CDB'SKIP'SPARE                                     16865000
   ELSE                                                                 16870000
      PARM.(13:3) := CDB'JUMP'SPARE;                                    16875000
                                                                        16880000
   IF DIT'IMMEDIATE'MODE = ONE THEN                                     16885000
      PARM.(12:1) := ONE;                                               16890000
   SIOP'BYTE(CDB'AREA'BYTE + I + 1 , PARM);                             16895000
                                                                        16900000
   <<---------------------------------------------------->>             16905000
   << Determine the amount of data to write.  Maximum on >>             16910000
   << a single write operation is 6K bytes.              >>             16915000
   <<---------------------------------------------------->>             16920000
                                                                        16925000
   BYTES'LEFT := TRANSFER'COUNT - DIT'TRANSFERED'COUNT;                 16930000
   IF BYTES'LEFT < DOUBLE(SIX'K'BYTES) THEN                             16935000
      BEGIN                                                             16940000
      SETDB'SIOP;                                                       16945000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 2) := CDB'SET'LENGTH;        16950000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 3) := ZERO;                  16955000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 4) := ZERO;                  16960000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 5) := L'BYTES'LEFT.(0:8);    16965000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 6) := L'BYTES'LEFT.(8:8);    16970000
      SETDB'SYS;                                                        16975000
                                                                        16980000
      IF BYTES'LEFT = 0D THEN          << No data to write          >>  16985000
         BEGIN                                                          16990000
         CP'DXFER'WAIT'5      := ZERO; << Bypass exec msg           >>  16995000
         CP'DXFER'WAIT'6      := 5;    << Jump *+5                  >>  17000000
         END << Of "if BYTES'LEFT = 0D..." >>                           17005000
      ELSE                                                              17010000
         BEGIN                                                          17015000
         CP'DXFER'DATA'SIZE := L'BYTES'LEFT; << Set up write count  >>  17020000
         END; << Of else "if BYTES'LEFT = 0D ..." >>                    17025000
                                                                        17030000
      DIT'TRANSFERED'COUNT := TRANSFER'COUNT;                           17035000
      END << Of "if BYTES'LEFT < DOUBLE(SIX'K'BYTES) ..." >>            17040000
   ELSE                                                                 17045000
      BEGIN                                                             17050000
      SETDB'SIOP;                                                       17055000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 2) := CDB'SET'LENGTH;        17060000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 3) := ZERO;                  17065000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 4) := ZERO;                  17070000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 5) := SIX'K'BYTES.(0:8);     17075000
      SIODB'BYTE'ARRAY(CDB'AREA'BYTE + I + 6) := SIX'K'BYTES.(8:8);     17080000
      SETDB'SYS;                                                        17085000
                                                                        17090000
      CP'DXFER'DATA'SIZE   := SIX'K'BYTES; << Set up write count    >>  17095000
      DIT'TRANSFERED'COUNT := DIT'TRANSFERED'COUNT +                    17100000
                              DOUBLE(SIX'K'BYTES);                      17105000
      END; << Of else "if BYTES'LEFT < DOUBLE(SIX'K'BYTES) ..." >>      17110000
                                                                        17115000
   CP'FIRST'BRANCH := ENTER'DATA'XFER;                                  17120000
                                                                        17125000
   END; << Of case 1 >>                                                 17130000
$PAGE                                                                   17135000
<<---------------------------------------------------->>                17140000
<<                                                    >>                17145000
<<   File open [function code = 2]                    >>                17150000
<<                                                    >>                17155000
<<---------------------------------------------------->>                17160000
                                                                        17165000
                                                                        17170000
   BEGIN << Of case 2 >>                                                17175000
                                       << Exit with a good transfer >>  17180000
   IOQ'STAT      := GOOD'IO;                                            17185000
   IOQ'COUNT     := ZERO;                                               17190000
   DRIVER'STATE  := REQUEST'COMPLETE;                                   17195000
                                                                        17200000
   RETURN;                                                              17205000
   END; << Of case 2 >>                                                 17210000
$PAGE                                                                   17215000
<<---------------------------------------------------->>                17220000
<<                                                    >>                17225000
<<   File close [function code = 3]                   >>                17230000
<<                                                    >>                17235000
<<---------------------------------------------------->>                17240000
                                                                        17245000
                                                                        17250000
   BEGIN << Of case 3 >>                                                17255000
                                       << Exit with a good transfer >>  17260000
   IOQ'STAT      := GOOD'IO;                                            17265000
   IOQ'COUNT     := ZERO;                                               17270000
   DRIVER'STATE  := REQUEST'COMPLETE;                                   17275000
                                                                        17280000
   RETURN;                                                              17285000
   END; << Of case 3 >>                                                 17290000
$PAGE                                                                   17295000
<<---------------------------------------------------->>                17300000
<<                                                    >>                17305000
<<   Device close [function code = 4]                 >>                17310000
<<                                                    >>                17315000
<<   Immediate report mode default.                   >>                17320000
<<                                                    >>                17325000
<<---------------------------------------------------->>                17330000
                                                                        17335000
                                                                        17340000
   BEGIN << Of case 4 >>                                                17345000
                                                                        17350000
   DIT'IMMEDIATE'MODE := ONE;          << Enable immediate reporting>>  17355000
                                                                        17360000
   IOQ'STAT           := GOOD'IO;      << Exit with a good transfer >>  17365000
   IOQ'COUNT          := ZERO;                                          17370000
   DRIVER'STATE       := REQUEST'COMPLETE;                              17375000
                                                                        17380000
   RETURN;                                                              17385000
   END; << Of case 4 >>                                                 17390000
$PAGE                                                                   17395000
<<---------------------------------------------------->>                17400000
<<                                                    >>                17405000
<<   Request status [function code = 7] and           >>                17410000
<<   Selftest result [function code = 74] and         >>                17415000
<<   Request last status [function code = 95]         >>                17420000
<<                                                    >>                17425000
<<   TRANSFER'COUNT - status length (max 20 bytes)    >>                17430000
<<   BANK & BUFFADDR - return the status              >>                17435000
<<                                                    >>                17440000
<<   For special request from PVPROC, (indicated by   >>                17445000
<<   P1 = 8, P2 = 9, and function = 7) handle this    >>                17450000
<<   request in a special way.                        >>                17455000
<<                                                    >>                17460000
<<---------------------------------------------------->>                17465000
                                                                        17470000
   BEGIN << Of case 5 >>                                                17475000
                                                                        17480000
   IF TRANSFER'COUNT = 0D THEN                                          17485000
      BEGIN                            << Exit with invalid func.   >>  17490000
      IOQ'STAT      := INVALID'REQUEST;                                 17495000
      IOQ'COUNT     := ZERO;                                            17500000
      DRIVER'STATE  := REQUEST'COMPLETE;                                17505000
                                                                        17510000
      RETURN;                                                           17515000
      END;                                                              17520000
                                                                        17525000
                                       << Special request from      >>  17530000
                                       << PVPROC.                   >>  17535000
   IF IOQ'FUNC  = 7 AND                                                 17540000
      IOQ'PARM1 = 8 AND                                                 17545000
      IOQ'PARM2 = 9 THEN                                                17550000
                                                                        17555000
      IF DIT'IGNORE'INT = ONE THEN                                      17560000
         BEGIN                                                          17565000
                                       << Return special val %101010>>  17570000
         DIT'IGNORE'INT := ZERO;                                        17575000
         TOS            := BANK'N'BUFF'ADDR;                            17580000
         TOS            := IGNORE'INTERRUPT;                            17585000
         ASSEMBLE (SSEA);                                               17590000
                                       << Exit with a good transfer >>  17595000
         IOQ'STAT     := GOOD'IO;                                       17600000
         IOQ'COUNT    := ONE;                                           17605000
         DRIVER'STATE := REQUEST'COMPLETE;                              17610000
                                                                        17615000
         RETURN;                                                        17620000
         END  << Of "if DIT'IGNORE'INT = ONE ..." >>                    17625000
      ELSE                                                              17630000
         BEGIN                                                          17635000
                                       << Return first word of stat >>  17640000
         TOS := BANK'N'BUFF'ADDR;                                       17645000
         TOS := DIT'FIRST'STAT'WORD;                                    17650000
         ASSEMBLE (SSEA);                                               17655000
                                       << Exit with a good transfer >>  17660000
         IOQ'STAT     := GOOD'IO;                                       17665000
         IOQ'COUNT    := ONE;                                           17670000
         DRIVER'STATE := REQUEST'COMPLETE;                              17675000
                                                                        17680000
         RETURN;                                                        17685000
         END; << Of else "if DIT'IGNORE'INT = ONE ..." >>               17690000
                                                                        17695000
                                       << Max 10 wrds               >>  17700000
   IF TRANSFER'COUNT > DOUBLE(DEV'STAT'WORD'SIZE) THEN                  17705000
      IOQ'COUNT        := DEV'STAT'WORD'SIZE;                           17710000
                                                                        17715000
   CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                                  17720000
   CP'DIAG'CDB'LENGTH  := 7;           << Do seek to force status   >>  17725000
                                                                        17730000
   SETDB'SIOP;                                                          17735000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 0 ) := CDB'SET'UNIT;                17740000
                                                                        17745000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 1 ) := CDB'SET'LENGTH;              17750000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 2 ) := ZERO;                        17755000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 3 ) := ZERO;                        17760000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 4 ) := ZERO;                        17765000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 5 ) := ZERO;                        17770000
                                                                        17775000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 6 ) := CDB'WRITE;                   17780000
   SETDB'SYS;                                                           17785000
                                                                        17790000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       17795000
                                                                        17800000
   END; << Of case 5 >>                                                 17805000
$PAGE                                                                   17810000
<<---------------------------------------------------->>                17815000
<<                                                    >>                17820000
<<   Initialize media [function code = 8]             >>                17825000
<<                                                    >>                17830000
<<   P1 - 00000CWZ                                    >>                17835000
<<      C = 1 - Run certification utility on tape     >>                17840000
<<      W = 1 - Every 512 block is allocated as spare >>                17845000
<<      Z = 1 - Reset sparing table to initial spares >>                17850000
<<                 as defined by W bit.               >>                17855000
<<   P2 - Block interleave byte (binary number)       >>                17860000
<<                                                    >>                17865000
<<---------------------------------------------------->>                17870000
                                                                        17875000
   BEGIN << Of case 6 >>                                                17880000
                                                                        17885000
   IF NOT (ZERO <= INTEGER(IOQ'PARM1) <= FOUR) THEN                     17890000
      BEGIN                            << Exit with invalid func.   >>  17895000
      IOQ'STAT      := INVALID'REQUEST;                                 17900000
      IOQ'COUNT     := ZERO;                                            17905000
      DRIVER'STATE  := REQUEST'COMPLETE;                                17910000
                                                                        17915000
      RETURN;                                                           17920000
      END;                                                              17925000
                                                                        17930000
   CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                                  17935000
   CP'DIAG'CDB'LENGTH  := FOUR;                                         17940000
                                                                        17945000
   SETDB'SIOP;                                                          17950000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 0 ) := CDB'SET'UNIT;                17955000
                                                                        17960000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 1 ) := CDB'INIT'MEDIA;              17965000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 2 ) := IOQ'PARM1.(8:8);             17970000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 3 ) := IOQ'PARM2.(8:8);             17975000
   SETDB'SYS;                                                           17980000
                                                                        17985000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       17990000
                                                                        17995000
   END; << Of case 6 >>                                                 18000000
$PAGE                                                                   18005000
<<---------------------------------------------------->>                18010000
<<                                                    >>                18015000
<<       Unload [function code = 9]                   >>                18020000
<<                                                    >>                18025000
<<---------------------------------------------------->>                18030000
                                                                        18035000
   BEGIN << Of case 7 >>                                                18040000
                                                                        18045000
   CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                                  18050000
   CP'DIAG'CDB'LENGTH  := 2;                                            18055000
                                                                        18060000
   SIOP'BYTE(CDB'AREA'BYTE + 0 , CDB'SET'UNIT);                         18065000
   SIOP'BYTE(CDB'AREA'BYTE + 1 , CDB'UNLOAD);                           18070000
                                                                        18075000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       18080000
                                                                        18085000
   END; << Of case 7 >>                                                 18090000
$PAGE                                                                   18095000
<<---------------------------------------------------->>                18100000
<<                                                    >>                18105000
<<   Request volume limit [function code = 13]        >>                18110000
<<                                                    >>                18115000
<<   BANK & BUFFADDR - Returns a dbl wrd address of   >>                18120000
<<                     the maximum volume limit       >>                18125000
<<                                                    >>                18130000
<<---------------------------------------------------->>                18135000
                                                                        18140000
   BEGIN << Of case 8 >>                                                18145000
                                                                        18150000
   CP'DIAG'CMD'TO'EXEC  := WRT'CMD'SEC;                                 18155000
   CP'DXFER'CDB'LENGTH  := TWO;        << CDB byte count            >>  18160000
   CP'DXFER'WAIT'5      := WAIT'INSTR;                                  18165000
   CP'DXFER'WAIT'6      := ZERO;                                        18170000
   CP'DXFER'12'WAIT     := WAIT'INSTR;                                  18175000
   CP'DXFER'13'WAIT     := ZERO;                                        18180000
   CP'DXFER'CMD'TO'EXEC := READ'EXEC'SEC;                               18185000
   CP'DXFER'DATA'SIZE   := MAX'DESC'BYTE; << Max# DESC bytes        >>  18190000
   CP'DXFER'DATA'TYPE   := ZERO;                                        18195000
   CP'DXFER'DATA'BANK   := ZERO;       << Describe area             >>  18200000
   CP'DXFER'DATA'OFFSET := @SIOP + SYSDB + DESC'AREA;                   18205000
                                                                        18210000
   SIOP'BYTE(CDB'AREA'BYTE + 0 , CDB'SET'UNIT);                         18215000
   SIOP'BYTE(CDB'AREA'BYTE + 1 , CDB'DESCRIBE);                         18220000
                                                                        18225000
   CP'FIRST'BRANCH     := ENTER'DATA'XFER;                              18230000
                                                                        18235000
   END; << Of case 8 >>                                                 18240000
$PAGE                                                                   18245000
<<---------------------------------------------------->>                18250000
<<                                                    >>                18255000
<<   Locate and verify [function code = 14]           >>                18260000
<<                                                    >>                18265000
<<   BANK & BUFFADDR - Entry   a dbl wrd address of   >>                18270000
<<                     verify length                  >>                18275000
<<   BANK & BUFFADDR - Returns a dbl wrd address of   >>                18280000
<<                     1st bad sector encountered     >>                18285000
<<   P1 - high order dbl word logical sector address  >>                18290000
<<   P2 - low order dbl word logical sector address   >>                18295000
<<                                                    >>                18300000
<<---------------------------------------------------->>                18305000
                                                                        18310000
   BEGIN << Of case 9 >>                                                18315000
                                                                        18320000
   SETDB'SIOP;                                                          18325000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 0)  := CDB'SET'UNIT;                18330000
                                                                        18335000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 1)  := CDB'SET'SNGL'VEC;            18340000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 2)  := ZERO;                        18345000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 3)  := ZERO;                        18350000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 4)  := IOQ'PARM1.(0:8);             18355000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 5)  := IOQ'PARM1.(8:8);             18360000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 6)  := IOQ'PARM2.(0:8);             18365000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 7)  := IOQ'PARM2.(8:8);             18370000
                                                                        18375000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 8)  := CDB'SET'LENGTH;              18380000
   SETDB'SYS;                                                           18385000
                                                                        18390000
   TOS     := BANK'N'BUFF'ADDR;        << Get bank &offset of buffer>>  18395000
   ASSEMBLE(LDEA;DXCH,DDEL);           << Get frst 2 words of buffer>>  18400000
   VER'LEN := TOS;                     << Store verify byte length  >>  18405000
                                                                        18410000
   CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                                  18415000
   CP'DIAG'CDB'LENGTH  := 14;          << CDB byte count            >>  18420000
                                                                        18425000
                                       << Put len in cmnd seq.      >>  18430000
   SIOP'BYTE(CDB'AREA'BYTE +  9, L1'VER'LEN.(0:8));                     18435000
   SIOP'BYTE(CDB'AREA'BYTE + 10, L1'VER'LEN.(8:8));                     18440000
   SIOP'BYTE(CDB'AREA'BYTE + 11, L2'VER'LEN.(0:8));                     18445000
   SIOP'BYTE(CDB'AREA'BYTE + 12, L2'VER'LEN.(8:8));                     18450000
   SIOP'BYTE(CDB'AREA'BYTE + 13, CDB'VERIFY);                           18455000
                                                                        18460000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       18465000
                                                                        18470000
   END; << Of case 9 >>                                                 18475000
$PAGE                                                                   18480000
<<---------------------------------------------------->>                18485000
<<                                                    >>                18490000
<<   Request generic status [function = 15]           >>                18495000
<<                                                    >>                18500000
<< This request returns generic status of the prior   >>                18505000
<< request.                                           >>                18510000
<<---------------------------------------------------->>                18515000
                                                                        18520000
   BEGIN << Of case 10 >>                                               18525000
                                                                        18530000
   IF TRANSFER'COUNT < 2D THEN         << Exit with invalid func.   >>  18535000
      BEGIN                                                             18540000
      IOQ'STAT     := INVALID'REQUEST;                                  18545000
      IOQ'COUNT    := ZERO;                                             18550000
      DRIVER'STATE := REQUEST'COMPLETE;                                 18555000
                                                                        18560000
      RETURN;                                                           18565000
      END;                                                              18570000
                                                                        18575000
   GENERIC'STATUS := ZERO;                                              18580000
                                                                        18585000
   << ************ >>                                                   18590000
   << Fatal error. >>                                                   18595000
   << ************ >>                                                   18600000
                                                                        18605000
   IF     DIT'CONTROLLER'FAULT = ONE THEN                               18610000
      GS'FATAL'ERROR := TWO                                             18615000
                                                                        18620000
   ELSE IF DIT'ILL'OPCODE      = ONE AND                                18625000
           DIT'ILL'OPERATION   = ONE AND                                18630000
           DIT'ILL'PARAMETER   = ONE AND                                18635000
           DIT'MSG'LENGTH'ERR  = ONE AND                                18640000
           DIT'ILL'MSG'SEQ     = ONE AND                                18645000
           DIT'PARAMETER'BOUND = ONE AND                                18650000
           DIT'ADDR'BOUNDS     = ONE AND                                18655000
           DIT'MODULE'ADDR'ERR = ONE THEN                               18660000
      GS'FATAL'ERROR := FOUR                                            18665000
                                                                        18670000
   ELSE IF DIT'UNIT'FAULT      = ONE THEN                               18675000
      GS'FATAL'ERROR := 5                                               18680000
                                                                        18685000
   ELSE IF DIT'NO'DATA'FOUND   = ONE THEN                               18690000
      GS'FATAL'ERROR := 6                                               18695000
                                                                        18700000
   ELSE IF DIT'CHAN'PARITY'ERR = ONE THEN                               18705000
      GS'FATAL'ERROR := 7;                                              18710000
                                                                        18715000
   << ************ >>                                                   18720000
   << Unit number. >>                                                   18725000
   << ************ >>                                                   18730000
                                                                        18735000
   GS'UNIT'NUMBER := ZERO;                                              18740000
                                                                        18745000
   << ************ >>                                                   18750000
   << End of file. >>                                                   18755000
   << ************ >>                                                   18760000
                                                                        18765000
   GS'END'OF'FILE := FALSE;                                             18770000
                                                                        18775000
   << *********** >>                                                    18780000
   << Load point. >>                                                    18785000
   << *********** >>                                                    18790000
                                                                        18795000
   GS'LOAD'POINT := FALSE;                                              18800000
                                                                        18805000
   << ************ >>                                                   18810000
   << End of tape. >>                                                   18815000
   << ************ >>                                                   18820000
                                                                        18825000
   IF DIT'END'OF'VOLUME = ONE THEN                                      18830000
      GS'END'OF'TAPE := TRUE;                                           18835000
                                                                        18840000
   << ***************** >>                                              18845000
   << Immediate report. >>                                              18850000
   << ***************** >>                                              18855000
                                                                        18860000
   IF DIT'IMMEDIATE'MODE = ONE THEN                                     18865000
      GS'IMMED'RPT'ENABLE := TRUE;                                      18870000
                                                                        18875000
   << **************** >>                                               18880000
   << Recovered error. >>                                               18885000
   << **************** >>                                               18890000
                                                                        18895000
   IF DIT'RECOV'DATA       = ONE AND                                    18900000
      DIT'MARGINAL'DATA    = ONE AND                                    18905000
      DIT'NO'DATA'OVERFLOW = ONE THEN                                   18910000
      GS'RECOVERED'ERROR := TRUE;                                       18915000
                                                                        18920000
   << ************ >>                                                   18925000
   << Unit online. >>                                                   18930000
   << ************ >>                                                   18935000
                                                                        18940000
   IF DIT'DEV'NOT'RDY = ZERO THEN                                       18945000
      GS'UNIT'ONLINE := TRUE;                                           18950000
                                                                        18955000
   << ************* >>                                                  18960000
   << File protect. >>                                                  18965000
   << ************* >>                                                  18970000
                                                                        18975000
   IF DIT'WRITE'PROTECT = ONE THEN                                      18980000
      GS'FILE'PROTECT := FALSE;                                         18985000
                                                                        18990000
   << ************************************** >>                         18995000
   << Put generic status into user's buffer. >>                         19000000
   << ************************************** >>                         19005000
                                                                        19010000
                                       << Return the generic status >>  19015000
   TOS := BANK'N'BUFF'ADDR;            << User's buffer address     >>  19020000
   TOS := GENERIC'STATUS;              << Generic status            >>  19025000
   ASSEMBLE (SSEA);                                                     19030000
                                                                        19035000
   IOQ'STAT     := GOOD'IO;                                             19040000
   IOQ'COUNT    := ONE;                                                 19045000
   DRIVER'STATE := REQUEST'COMPLETE;                                    19050000
                                                                        19055000
   RETURN;                                                              19060000
   END; << Of case 10 >>                                                19065000
$PAGE                                                                   19070000
<<---------------------------------------------------->>                19075000
<<                                                    >>                19080000
<<   Lock [function code = 16]                        >>                19085000
<<                                                    >>                19090000
<<---------------------------------------------------->>                19095000
                                                                        19100000
   BEGIN << Of case 11 >>                                               19105000
                                                                        19110000
   DIT'LOCK'FLG := ONE;                                                 19115000
                                                                        19120000
                                       << Exit with a good transfer >>  19125000
   IOQ'STAT     := GOOD'IO;                                             19130000
   IOQ'COUNT    := ZERO;                                                19135000
   DRIVER'STATE := REQUEST'COMPLETE;                                    19140000
                                                                        19145000
   RETURN;                                                              19150000
   END; << Of case 11 >>                                                19155000
$PAGE                                                                   19160000
<<---------------------------------------------------->>                19165000
<<                                                    >>                19170000
<<   Unlock [function code = 17]                      >>                19175000
<<                                                    >>                19180000
<<---------------------------------------------------->>                19185000
                                                                        19190000
   BEGIN << Of case 12 >>                                               19195000
                                                                        19200000
   DIT'LOCK'FLG := ZERO;                                                19205000
                                                                        19210000
                                       << Exit with a good transfer >>  19215000
   IOQ'STAT     := GOOD'IO;                                             19220000
   IOQ'COUNT    := ZERO;                                                19225000
   DRIVER'STATE := REQUEST'COMPLETE;                                    19230000
                                                                        19235000
   RETURN;                                                              19240000
   END; << Of case 12 >>                                                19245000
$PAGE                                                                   19250000
<<---------------------------------------------------->>                19255000
<<                                                    >>                19260000
<<   Read lock bit [function code = 18]               >>                19265000
<<                                                    >>                19270000
<<       BANK & BUFFADDR - contain lock bit state     >>                19275000
<<                                                    >>                19280000
<<---------------------------------------------------->>                19285000
                                                                        19290000
   BEGIN << Of case 13 >>                                               19295000
                                                                        19300000
                                       << Return the lock bit value >>  19305000
   TOS := BANK'N'BUFF'ADDR;                                             19310000
   TOS := DIT'LOCK'FLG;                                                 19315000
   ASSEMBLE(SSEA);                                                      19320000
                                                                        19325000
                                       << Exit with a good transfer >>  19330000
   IOQ'STAT     := GOOD'IO;                                             19335000
   IOQ'COUNT    := ONE;                                                 19340000
   DRIVER'STATE := REQUEST'COMPLETE;                                    19345000
                                                                        19350000
   RETURN;                                                              19355000
   END; << Of case 13 >>                                                19360000
$PAGE                                                                   19365000
<<---------------------------------------------------->>                19370000
<<                                                    >>                19375000
<<   Immediate report mode [function code = 29]       >>                19380000
<<                                                    >>                19385000
<<   P2 - 1 Enable immediate report mode              >>                19390000
<<      - 0 Disable immediate report mode             >>                19395000
<<                                                    >>                19400000
<<---------------------------------------------------->>                19405000
                                                                        19410000
   BEGIN << Of case 14 >>                                               19415000
                                                                        19420000
   IF NOT (ZERO <= INTEGER(IOQ'PARM2) <= ONE) THEN                      19425000
      BEGIN                            << Exit with invalid func.   >>  19430000
      IOQ'STAT     := INVALID'REQUEST;                                  19435000
      IOQ'COUNT    := ZERO;                                             19440000
      DRIVER'STATE := REQUEST'COMPLETE;                                 19445000
                                                                        19450000
      RETURN;                                                           19455000
      END;                                                              19460000
                                                                        19465000
   DIT'IMMEDIATE'MODE := IOQ'PARM2;                                     19470000
                                       << Exit with a good transfer >>  19475000
   IOQ'STAT           := GOOD'IO;                                       19480000
   IOQ'COUNT          := ZERO;                                          19485000
   DRIVER'STATE       := REQUEST'COMPLETE;                              19490000
                                                                        19495000
   RETURN;                                                              19500000
   END; << Of case 14 >>                                                19505000
$PAGE                                                                   19510000
<<---------------------------------------------------->>                19515000
<<                                                    >>                19520000
<<   Identify [function code = 72]                    >>                19525000
<<                                                    >>                19530000
<<---------------------------------------------------->>                19535000
                                                                        19540000
   BEGIN << Of case 15 >>                                               19545000
                                                                        19550000
   IF TRANSFER'COUNT < 2D THEN         << Invalid transfer count    >>  19555000
      BEGIN                                                             19560000
      IOQ'STAT     := INVALID'REQUEST;                                  19565000
      IOQ'COUNT    := ZERO;                                             19570000
      DRIVER'STATE := REQUEST'COMPLETE;                                 19575000
                                                                        19580000
      RETURN;                                                           19585000
      END;                                                              19590000
                                                                        19595000
   CP'FIRST'BRANCH := ENTER'IDENTIFY;                                   19600000
                                                                        19605000
   END; << Of case 15 >>                                                19610000
$PAGE                                                                   19615000
<<---------------------------------------------------->>                19620000
<<                                                    >>                19625000
<<   Initiate diag. selftest [function code = 73]     >>                19630000
<<                                                    >>                19635000
<<   P1 - 2 bytes loop count (execution count)        >>                19640000
<<   P2 - diagnostic section number                   >>                19645000
<<                                                    >>                19650000
<<---------------------------------------------------->>                19655000
                                                                        19660000
   BEGIN << Of case 16 >>                                               19665000
                                                                        19670000
   CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                                  19675000
   CP'DIAG'CDB'LENGTH  := 5;                                            19680000
                                                                        19685000
   SETDB'SIOP;                                                          19690000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 0 ) := CDB'SET'UNIT + CTRL'UNIT;    19695000
                                                                        19700000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 1 ) := CDB'INIT'DIAG;               19705000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 2 ) := IOQ'PARM1.(0:8);             19710000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 3 ) := IOQ'PARM1.(8:8);             19715000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 4 ) := IOQ'PARM2.(8:8);             19720000
   SETDB'SYS;                                                           19725000
                                                                        19730000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       19735000
                                                                        19740000
   END; << Of case 16 >>                                                19745000
$PAGE                                                                   19750000
<<---------------------------------------------------->>                19755000
<<                                                    >>                19760000
<<   Loopback write [function code = 75]              >>                19765000
<<                                                    >>                19770000
<<   TRANSFER'COUNT - transfer count                  >>                19775000
<<   BANK & BUFFADDR - contains loopbk data for wrt.  >>                19780000
<<                     must begin w/hex FF followed   >>                19785000
<<                     by bytes equal to its prede-   >>                19790000
<<                     cessor plus one                >>                19795000
<<                                                    >>                19800000
<<---------------------------------------------------->>                19805000
                                                                        19810000
   BEGIN << Of case 17 >>                                               19815000
                                                                        19820000
   IF TRANSFER'COUNT = 0D    OR                                         19825000
      TRANSFER'COUNT > 1200D THEN                                       19830000
      BEGIN                            << Exit with invalid func.   >>  19835000
      IOQ'STAT      := INVALID'REQUEST;                                 19840000
      IOQ'COUNT     := ZERO;                                            19845000
      DRIVER'STATE  := REQUEST'COMPLETE;                                19850000
                                                                        19855000
      RETURN;                                                           19860000
      END;                                                              19865000
                                                                        19870000
   CP'DXFER'WRITE'READ  := WRT'TRANS'SEC;                               19875000
   CP'DXFER'CDB'LENGTH  := 5;          << CDB byte count            >>  19880000
   CP'DXFER'WAIT'5      := ZERO;                                        19885000
   CP'DXFER'WAIT'6      := ZERO;                                        19890000
   CP'DXFER'12'WAIT     := ZERO;                                        19895000
   CP'DXFER'13'WAIT     := ZERO;                                        19900000
   CP'DXFER'CMD'TO'EXEC := WRT'TRANS'SEC;                               19905000
   CP'DXFER'DATA'SIZE   := L'TRANSFER'COUNT;                            19910000
   CP'DXFER'DATA'TYPE   := ZERO;                                        19915000
   CP'DXFER'DATA'BANK   := BANK;                                        19920000
   CP'DXFER'DATA'OFFSET := BUFFADDR;   << Data buffer abs adr       >>  19925000
                                                                        19930000
   SIOP'BYTE(CDB'AREA'BYTE + 0 , CDB'WRT'LOOPBK);                       19935000
   SIOP'BYTE(CDB'AREA'BYTE + 1 , ZERO);                                 19940000
   SIOP'BYTE(CDB'AREA'BYTE + 2 , ZERO);                                 19945000
   SIOP'BYTE(CDB'AREA'BYTE + 3 , L'TRANSFER'COUNT.(0:8));               19950000
   SIOP'BYTE(CDB'AREA'BYTE + 4 , L'TRANSFER'COUNT.(8:8));               19955000
                                                                        19960000
   CP'FIRST'BRANCH     := ENTER'DATA'XFER;                              19965000
                                                                        19970000
   END; << Of case 17 >>                                                19975000
$PAGE                                                                   19980000
<<---------------------------------------------------->>                19985000
<<                                                    >>                19990000
<<   Loopback read [function code = 76]               >>                19995000
<<                                                    >>                20000000
<<   TRANSFER'COUNT - transfer count                  >>                20005000
<<   BANK & BUFFADDR - contains loopback data read    >>                20010000
<<                                                    >>                20015000
<<---------------------------------------------------->>                20020000
                                                                        20025000
   BEGIN << Of case 18 >>                                               20030000
                                                                        20035000
   IF TRANSFER'COUNT = 0D    OR                                         20040000
      TRANSFER'COUNT > 1200D THEN                                       20045000
      BEGIN                            << Exit with invalid func.   >>  20050000
      IOQ'STAT     := INVALID'REQUEST;                                  20055000
      IOQ'COUNT    := ZERO;                                             20060000
      DRIVER'STATE := REQUEST'COMPLETE;                                 20065000
                                                                        20070000
      RETURN;                                                           20075000
      END;                                                              20080000
                                                                        20085000
   CP'DXFER'WRITE'READ  := WRT'TRANS'SEC;                               20090000
   CP'DXFER'CDB'LENGTH  := 5;          << CDB byte count            >>  20095000
   CP'DXFER'WAIT'5      := ZERO;                                        20100000
   CP'DXFER'WAIT'6      := ZERO;                                        20105000
   CP'DXFER'12'WAIT     := ZERO;                                        20110000
   CP'DXFER'13'WAIT     := ZERO;                                        20115000
   CP'DXFER'CMD'TO'EXEC := READ'TRANS'SEC;                              20120000
   CP'DXFER'DATA'SIZE   := L'TRANSFER'COUNT;                            20125000
   CP'DXFER'DATA'TYPE   := ZERO;                                        20130000
   CP'DXFER'DATA'BANK   := BANK;                                        20135000
   CP'DXFER'DATA'OFFSET := BUFFADDR;   << Data buffer abs adr       >>  20140000
                                                                        20145000
   SIOP'BYTE(CDB'AREA'BYTE + 0 , CDB'READ'LOOPBK);                      20150000
   SIOP'BYTE(CDB'AREA'BYTE + 1 , ZERO);                                 20155000
   SIOP'BYTE(CDB'AREA'BYTE + 2 , ZERO);                                 20160000
   SIOP'BYTE(CDB'AREA'BYTE + 3 , L'TRANSFER'COUNT.(0:8));               20165000
   SIOP'BYTE(CDB'AREA'BYTE + 4 , L'TRANSFER'COUNT.(8:8));               20170000
                                                                        20175000
   CP'FIRST'BRANCH     := ENTER'DATA'XFER;                              20180000
                                                                        20185000
   END; << Of case 18 >>                                                20190000
$PAGE                                                                   20195000
<<---------------------------------------------------->>                20200000
<<                                                    >>                20205000
<<   Release [function code = 79]                     >>                20210000
<<                                                    >>                20215000
<<---------------------------------------------------->>                20220000
                                                                        20225000
   BEGIN << Of case 19 >>                                               20230000
                                                                        20235000
   CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                                  20240000
   CP'DIAG'CDB'LENGTH  := TWO;                                          20245000
                                                                        20250000
   SIOP'BYTE(CDB'AREA'BYTE + 0 , CDB'SET'UNIT + CTRL'UNIT);             20255000
   SIOP'BYTE(CDB'AREA'BYTE + 1 , CDB'RELEASE);                          20260000
                                                                        20265000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       20270000
                                                                        20275000
   END; << Of case 19 >>                                                20280000
$PAGE                                                                   20285000
<<---------------------------------------------------->>                20290000
<<                                                    >>                20295000
<<   Release denied [function code = 80]              >>                20300000
<<                                                    >>                20305000
<<---------------------------------------------------->>                20310000
                                                                        20315000
   BEGIN << Of case 20 >>                                               20320000
                                                                        20325000
   CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                                  20330000
   CP'DIAG'CDB'LENGTH  := TWO;                                          20335000
                                                                        20340000
   SIOP'BYTE(CDB'AREA'BYTE + 0 , CDB'SET'UNIT + CTRL'UNIT);             20345000
   SIOP'BYTE(CDB'AREA'BYTE + 1 , CDB'RELEASE'DENY);                     20350000
                                                                        20355000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       20360000
                                                                        20365000
   END; << Of case 20 >>                                                20370000
$PAGE                                                                   20375000
<<---------------------------------------------------->>                20380000
<<                                                    >>                20385000
<<   Set release [function code = 81]                 >>                20390000
<<                                                    >>                20395000
<<   P1 - 0 enable release timeout [T=0]              >>                20400000
<<        1 suppress release timeout [T=1]            >>                20405000
<<   P2 - 0 auto release during idle time [Z=0]       >>                20410000
<<        1 no auto release during idle time [Z=1]    >>                20415000
<<                                                    >>                20420000
<<---------------------------------------------------->>                20425000
                                                                        20430000
   BEGIN << Of case 21 >>                                               20435000
                                                                        20440000
   CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                                  20445000
   CP'DIAG'CDB'LENGTH  := THREE;                                        20450000
                                                                        20455000
   PARM          := ZERO;                                               20460000
   IF IOQ'PARM1 = ONE THEN                                              20465000
      PARM.(0:1) := ONE;               << Suppress release timeout  >>  20470000
   IF IOQ'PARM2 = ONE THEN                                              20475000
      PARM.(1:1) := ONE;               << Dont release during idle  >>  20480000
                                       << timeout                   >>  20485000
                                                                        20490000
   SIOP'BYTE(CDB'AREA'BYTE + 0 , CDB'SET'UNIT + CTRL'UNIT);             20495000
   SIOP'BYTE(CDB'AREA'BYTE + 1 , CDB'SET'RELEASE);                      20500000
   SIOP'BYTE(CDB'AREA'BYTE + 2 , PARM.(0:8));                           20505000
                                                                        20510000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       20515000
                                                                        20520000
   END; << Of case 21 >>                                                20525000
$PAGE                                                                   20530000
<<---------------------------------------------------->>                20535000
<<                                                    >>                20540000
<<   Set address [function code = 82]                 >>                20545000
<<                                                    >>                20550000
<<   BANK & BUFFADDR - Contains a dbl wrd address     >>                20555000
<<                     of the block to be addressed.  >>                20560000
<<                                                    >>                20565000
<<---------------------------------------------------->>                20570000
                                                                        20575000
   BEGIN << Of case 22 >>                                               20580000
                                                                        20585000
   CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                                  20590000
   CP'DIAG'CDB'LENGTH  := 8;                                            20595000
                                                                        20600000
                                       << Get the block address.    >>  20605000
   TOS            := BANK'N'BUFF'ADDR; << Get bank &offset of buffer>>  20610000
   ASSEMBLE(LDEA;DXCH,DDEL);           << Get frst 2 words of buffer>>  20615000
   ADDRESS'OFFSET := TOS;                                               20620000
   PARM           := TOS;                                               20625000
                                                                        20630000
   SETDB'SIOP;                                                          20635000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 0 ) := CDB'SET'UNIT;                20640000
                                                                        20645000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 1 ) := CDB'SET'SNGL'VEC;            20650000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 2 ) := ZERO;                        20655000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 3 ) := ZERO;                        20660000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 4 ) := PARM.(0:8);                  20665000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 5 ) := PARM.(8:8);                  20670000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 6 ) := ADDRESS'OFFSET.(0:8);        20675000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 7 ) := ADDRESS'OFFSET.(8:8);        20680000
   SETDB'SYS;                                                           20685000
                                                                        20690000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       20695000
                                                                        20700000
   END; << Of case 22 >>                                                20705000
$PAGE                                                                   20710000
<<---------------------------------------------------->>                20715000
<<                                                    >>                20720000
<<   Spare block [function code = 88]                 >>                20725000
<<                                                    >>                20730000
<<   BANK & BUFFADDR - contains dbl wrd address of    >>                20735000
<<                     the block to be spared         >>                20740000
<<   P2 - 0 Spare retaining data (no target sector)   >>                20745000
<<        1 Spare without retaining data              >>                20750000
<<        4 Spare retaining data (target included)    >>                20755000
<<                                                    >>                20760000
<<---------------------------------------------------->>                20765000
                                                                        20770000
   BEGIN << Of case 23 >>                                               20775000
                                                                        20780000
   IF NOT (ZERO <= INTEGER(IOQ'PARM2) <= FOUR) THEN                     20785000
      BEGIN                            << Exit with invalid func.   >>  20790000
      IOQ'STAT     := INVALID'REQUEST;                                  20795000
      IOQ'COUNT    := ZERO;                                             20800000
      DRIVER'STATE := REQUEST'COMPLETE;                                 20805000
                                                                        20810000
      RETURN;                                                           20815000
      END;                                                              20820000
                                                                        20825000
                                       << Get the block address.    >>  20830000
   TOS            := BANK'N'BUFF'ADDR; << Get bank &offset of buffer>>  20835000
   ASSEMBLE(LDEA;DXCH,DDEL);           << Get frst 2 words of buffer>>  20840000
   ADDRESS'OFFSET := TOS;                                               20845000
   PARM           := TOS;                                               20850000
                                                                        20855000
   CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                                  20860000
   CP'DIAG'CDB'LENGTH  := 10;                                           20865000
                                                                        20870000
   SETDB'SIOP;                                                          20875000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 0 ) := CDB'SET'UNIT;                20880000
                                                                        20885000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 1 ) := CDB'SET'SNGL'VEC;            20890000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 2 ) := ZERO;                        20895000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 3 ) := ZERO;                        20900000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 4 ) := PARM.(0:8);                  20905000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 5 ) := PARM.(8:8);                  20910000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 6 ) := ADDRESS'OFFSET.(0:8);        20915000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 7 ) := ADDRESS'OFFSET.(8:8);        20920000
                                                                        20925000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 8 ) := CDB'SPARE'BLK;               20930000
   SIODB'BYTE'ARRAY(CDB'AREA'BYTE + 9 ) := IOQ'PARM2.(8:8);             20935000
   SETDB'SYS;                                                           20940000
                                                                        20945000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       20950000
                                                                        20955000
   END; << Of case 23 >>                                                20960000
$PAGE                                                                   20965000
<<---------------------------------------------------->>                20970000
<<                                                    >>                20975000
<<   Initiate utility [function code = 91]            >>                20980000
<<                                                    >>                20985000
<<   TRANSFER'COUNT - Executing message length        >>                20990000
<<   BANK & BUFFADDR - Contains utility byte count    >>                20995000
<<                     with utility parameter bytes   >>                21000000
<<                     to follow (optional).          >>                21005000
<<   BANK & BUFFADDR+10 - Returns utility data        >>                21010000
<<                        information (optional).     >>                21015000
<<   P1 - 0 No executing message                      >>                21020000
<<      - 1 Send executing message to the device      >>                21025000
<<      - 2 Receive executing message from device     >>                21030000
<<   P2 - Utility number                              >>                21035000
<<                                                    >>                21040000
<<  *NOTE:  See Buffalo Driver ERS documentation      >>                21045000
<<          for a more thorough description           >>                21050000
<<                                                    >>                21055000
<<---------------------------------------------------->>                21060000
                                                                        21065000
   BEGIN << Of case 24 >>                                               21070000
                                                                        21075000
                                       << Exit with invalid func.  >>   21080000
   IF NOT (ZERO <= INTEGER(IOQ'PARM1) <= TWO) THEN                      21085000
      BEGIN                                                             21090000
      IOQ'STAT     := INVALID'REQUEST;                                  21095000
      IOQ'COUNT    := ZERO;                                             21100000
      DRIVER'STATE := REQUEST'COMPLETE;                                 21105000
                                                                        21110000
      RETURN;                                                           21115000
      END;                                                              21120000
                                                                        21125000
                                       << Invalid transfer count    >>  21130000
   IF TRANSFER'COUNT = 0D THEN                                          21135000
      BEGIN                                                             21140000
      IOQ'STAT     := INVALID'REQUEST;                                  21145000
      IOQ'COUNT    := ZERO;                                             21150000
      DRIVER'STATE := REQUEST'COMPLETE;                                 21155000
                                                                        21160000
      RETURN;                                                           21165000
      END;                                                              21170000
                                                                        21175000
   SIOP'BYTE(CDB'AREA'BYTE + 0 , CDB'SET'UNIT);                         21180000
   SIOP'BYTE(CDB'AREA'BYTE + 1 , CDB'NOP);                              21185000
   SIOP'BYTE(CDB'AREA'BYTE + 2 , CDB'INIT'UTIL + IOQ'PARM1.(8:8));      21190000
   SIOP'BYTE(CDB'AREA'BYTE + 3 , IOQ'PARM2.(8:8));                      21195000
                                                                        21200000
   IF IOQ'PARM1 <> ONE THEN            << Fetch util parm bytes     >>  21205000
      BEGIN                                                             21210000
      TOS := BANK'N'BUFF'ADDR;                                          21215000
      ASSEMBLE (LSEA);                                                  21220000
      INDEX := TOS;                    << #Util parm bytes          >>  21225000
      ASSEMBLE (DEL;DEL);                                               21230000
      IF INDEX <> ZERO THEN                                             21235000
         BEGIN                                                          21240000
         IF INDEX > 18 THEN            << Exceed max bytes allow    >>  21245000
            BEGIN                                                       21250000
            IOQ'STAT     := INVALID'REQUEST;                            21255000
            IOQ'COUNT    := ZERO;                                       21260000
            DRIVER'STATE := REQUEST'COMPLETE;                           21265000
                                                                        21270000
            RETURN;                                                     21275000
            END;                                                        21280000
         PARM := (INDEX + ONE) / TWO;  << Convert byte cnt to words >>  21285000
                                       << Destination of CDB area   >>  21290000
         TOS := 0;                                             <<f9010>>21295000
         TOS := @SIOP + SYSDB + CDB'AREA'WRD + TWO;                     21300000
         TOS := BANK'N'BUFF'ADDR + %1D;<< Source                    >>  21305000
         TOS := PARM;                  << #Words to move            >>  21310000
         ASSEMBLE (MABS);              << Move using abs addr       >>  21315000
         END; << Of "if <> THEN ..." >>                                 21320000
      END; << Of "if IOQ'PARM1 <> ONE ..." >>                           21325000
                                                                        21330000
   CASE IOQ'PARM1 OF                                                    21335000
                                                                        21340000
      BEGIN                                                             21345000
      BEGIN << No exec msg >>                                           21350000
                                                                        21355000
      CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                               21360000
      CP'DIAG'CDB'LENGTH  := FOUR + INDEX;                              21365000
      CP'FIRST'BRANCH     := ENTER'DIAG;                                21370000
                                                                        21375000
      END; << No exec msg >>                                            21380000
                                                                        21385000
      BEGIN << Send exec msg to device >>                               21390000
                                                                        21395000
      CP'DXFER'WRITE'READ  := WRT'CMD'SEC;                              21400000
      CP'DXFER'CDB'LENGTH  := FOUR;                                     21405000
      CP'DXFER'WAIT'5      := WAIT'INSTR;                               21410000
      CP'DXFER'WAIT'6      := ZERO;                                     21415000
      CP'DXFER'12'WAIT     := WAIT'INSTR;                               21420000
      CP'DXFER'13'WAIT     := ZERO;                                     21425000
      CP'DXFER'CMD'TO'EXEC := WRT'EXEC'SEC;                             21430000
                                              << Exec msg count     >>  21435000
      CP'DXFER'DATA'SIZE   := INTEGER(TRANSFER'COUNT);                  21440000
      CP'DXFER'DATA'TYPE   := ZERO;                                     21445000
      CP'DXFER'DATA'BANK   := BANK;                                     21450000
      CP'DXFER'DATA'OFFSET := BUFFADDR;                                 21455000
      CP'FIRST'BRANCH      := ENTER'DATA'XFER;                          21460000
                                                                        21465000
      END; << Send exec msg to device >>                                21470000
                                                                        21475000
      BEGIN << Receive exec msg from device >>                          21480000
                                                                        21485000
      CP'DXFER'WRITE'READ  := WRT'CMD'SEC;                              21490000
      CP'DXFER'CDB'LENGTH  := FOUR + INDEX;                             21495000
      CP'DXFER'WAIT'5      := WAIT'INSTR;                               21500000
      CP'DXFER'WAIT'6      := ZERO;                                     21505000
      CP'DXFER'12'WAIT     := WAIT'INSTR;                               21510000
      CP'DXFER'13'WAIT     := ZERO;                                     21515000
      CP'DXFER'CMD'TO'EXEC := READ'EXEC'SEC;                            21520000
                                              << Exec msg count     >>  21525000
      CP'DXFER'DATA'SIZE   := INTEGER(TRANSFER'COUNT);                  21530000
      CP'DXFER'DATA'TYPE   := ZERO;                                     21535000
      CP'DXFER'DATA'BANK   := BANK;                                     21540000
      CP'DXFER'DATA'OFFSET := BUFFADDR+10;                              21545000
      CP'FIRST'BRANCH      := ENTER'DATA'XFER;                          21550000
                                                                        21555000
      END; << Send exec msg to device >>                                21560000
      END; << Of "case IOQ'PARM1 of ..." >>                             21565000
                                                                        21570000
   END; << Of case 24 >>                                                21575000
$PAGE                                                                   21580000
<<---------------------------------------------------->>                21585000
<<                                                    >>                21590000
<<   Clear device [function code = 92] and            >>                21595000
<<   Channel independant clear [function code = 101]  >>                21600000
<<                                                    >>                21605000
<<  P1 = -IOQ'FUNC - Add set unit command             >>                21610000
<<  P2 - The unit number between 0 and 15.            >>                21615000
<<---------------------------------------------------->>                21620000
                                                                        21625000
   BEGIN << Of case 25 >>                                               21630000
                                                                        21635000
   CP'DIAG'CMD'TO'EXEC := WRT'TRANS'SEC;                                21640000
   CP'DIAG'CDB'LENGTH  := TWO;         << Just cancel cmd           >>  21645000
                                                                        21650000
   SIOP'BYTE(CDB'AREA'BYTE + 0, CDB'SET'UNIT);                          21655000
   SIOP'BYTE(CDB'AREA'BYTE + 1, CDB'CI'CLEAR);                          21660000
                                                                        21665000
   IF IOQ'PARM1 = -IOQ'FUNC THEN       << Change unit number?       >>  21670000
                                       << Valid unit ?              >>  21675000
      IF ZERO <= INTEGER(IOQ'PARM2) <= 15 THEN                          21680000
         SIOP'BYTE(CDB'AREA'BYTE, CDB'SET'UNIT + IOQ'PARM2)             21685000
      ELSE                             << Bad unit #                >>  21690000
         BEGIN                         << Exit with invalid func.   >>  21695000
         IOQ'STAT      := INVALID'REQUEST;                              21700000
         IOQ'COUNT     := ZERO;                                         21705000
         DRIVER'STATE  := REQUEST'COMPLETE;                             21710000
                                                                        21715000
         RETURN;                                                        21720000
         END; << Of else "if ZERO <= INTEGER(IOQ'PARM2) ..." >>         21725000
                                                                        21730000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       21735000
                                                                        21740000
   END; << Of case 25 >>                                                21745000
$PAGE                                                                   21750000
<<---------------------------------------------------->>                21755000
<<                                                    >>                21760000
<<   Cancel transaction [function code = 93]          >>                21765000
<<                                                    >>                21770000
<<                                                    >>                21775000
<<  P1 = -IOQ'FUNC - Add set unit command             >>                21780000
<<  P2 - The unit number between 0 and 15             >>                21785000
<<---------------------------------------------------->>                21790000
                                                                        21795000
   BEGIN << Of case 26 >>                                               21800000
                                                                        21805000
   CP'DIAG'CMD'TO'EXEC := WRT'TRANS'SEC;                                21810000
   CP'DIAG'CDB'LENGTH  := TWO;         << 2 cmd bytes               >>  21815000
                                                                        21820000
   SIOP'BYTE(CDB'AREA'BYTE + 0, CDB'SET'UNIT);                          21825000
   SIOP'BYTE(CDB'AREA'BYTE + 1, CDB'CANCEL);                            21830000
                                                                        21835000
   IF IOQ'PARM1 = -IOQ'FUNC THEN       << Change unit number?       >>  21840000
                                       << Valid unit ?              >>  21845000
      IF ZERO <= INTEGER(IOQ'PARM2) <= 15 THEN                          21850000
         SIOP'BYTE(CDB'AREA'BYTE, CDB'SET'UNIT + IOQ'PARM2)             21855000
      ELSE                             << Bad unit #                >>  21860000
         BEGIN                         << Exit with invalid func.   >>  21865000
         IOQ'STAT      := INVALID'REQUEST;                              21870000
         IOQ'COUNT     := ZERO;                                         21875000
         DRIVER'STATE  := REQUEST'COMPLETE;                             21880000
                                                                        21885000
         RETURN;                                                        21890000
         END; << Of else "if ZERO <= INTEGER(IOQ'PARM2) ..." >>         21895000
                                                                        21900000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       21905000
                                                                        21910000
   END; << Of case 26 >>                                                21915000
$PAGE                                                                   21920000
<<---------------------------------------------------->>                21925000
<<                                                    >>                21930000
<<   Parity checking [function code = 94]             >>                21935000
<<                                                    >>                21940000
<<   P1 - 0 disable parity checking                   >>                21945000
<<      - 1 enable parity checking                    >>                21950000
<<                                                    >>                21955000
<<---------------------------------------------------->>                21960000
                                                                        21965000
   BEGIN << Of case 27 >>                                               21970000
                                                                        21975000
   IF NOT (ZERO <= INTEGER(IOQ'PARM1) <= ONE) THEN                      21980000
      BEGIN                            << Exit with invalid func.   >>  21985000
      IOQ'STAT     := INVALID'REQUEST;                                  21990000
      IOQ'COUNT    := ZERO;                                             21995000
      DRIVER'STATE := REQUEST'COMPLETE;                                 22000000
                                                                        22005000
      RETURN;                                                           22010000
      END;                                                              22015000
                                                                        22020000
   CP'DIAG'CMD'TO'EXEC := WRT'TRANS'SEC;                                22025000
   CP'DIAG'CDB'LENGTH  := THREE;                                        22030000
   CP'DIAG'WAIT'5      := 0;           << Bypass Wait and DSJ inst. >>  22035000
   CP'DIAG'WAIT'6      := 6;                                            22040000
                                                                        22045000
   SIOP'BYTE(CDB'AREA'BYTE + 0, CDB'SET'UNIT);                          22050000
   SIOP'BYTE(CDB'AREA'BYTE + 1, CDB'PARITY'OP);                         22055000
                                                                        22060000
                                       << Enable or disable parity  >>  22065000
                                       << checking                  >>  22070000
   SIOP'BYTE(CDB'AREA'BYTE + 2, IF IOQ'PARM1 = ZERO THEN                22075000
                                   ZERO                                 22080000
                                ELSE                                    22085000
                                   ONE);                                22090000
                                                                        22095000
   CP'FIRST'BRANCH := ENTER'DIAG;                                       22100000
                                                                        22105000
   END; << Of case 27 >>                                                22110000
$PAGE                                                                   22115000
<<---------------------------------------------------->>                22120000
<<                                                    >>                22125000
<<   Generic diagnostic request [function code = 100] >>                22130000
<<                                                    >>                22135000
<<   TRANSFER'COUNT - execution message length        >>                22140000
<<            (Set to -1 if not used)                 >>                22145000
<<   BANK & BUFFADDR - buffer containing the execution>>                22150000
<<                     message and data bytes.        >>                22155000
<<   P1 - 0 no execution message                      >>                22160000
<<      - 1 send execution message to the device      >>                22165000
<<      - 2 total length of message (exec + data)     >>                22170000
<<   P2 - number of command bytes to be send          >>                22175000
<<                                                    >>                22180000
<<    If sending an execution msg, the command bytes  >>                22185000
<<    follow the data to be sent in the buffer.  In   >>                22190000
<<    this case, the cmd bytes must start on a word   >>                22195000
<<    boundtry - If they do not, we round to the      >>                22200000
<<    next even byte.                                 >>                22205000
<<---------------------------------------------------->>                22210000
                                                                        22215000
   BEGIN << Of case 28 >>                                               22220000
                                                                        22225000
   IF NOT IOQ'DIAG THEN                                                 22230000
      BEGIN                            << Exit with invalid func.   >>  22235000
      IOQ'STAT     := INVALID'REQUEST;                                  22240000
      IOQ'COUNT    := ZERO;                                             22245000
      DRIVER'STATE := REQUEST'COMPLETE;                                 22250000
                                                                        22255000
      RETURN;                                                           22260000
      END;                                                              22265000
                                                                        22270000
   CASE IOQ'PARM1 OF                                                    22275000
      BEGIN                                                             22280000
                                                                        22285000
      BEGIN << No exection msg >>                                       22290000
                                                                        22295000
      CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                               22300000
      CP'DIAG'CDB'LENGTH  := IOQ'PARM2; << CMD bytes length         >>  22305000
      CP'DIAG'CDB'BANK    := BANK;      << CMB byte location        >>  22310000
      CP'DIAG'CDB'OFFSET  := BUFFADDR;                                  22315000
      CP'FIRST'BRANCH     := ENTER'DIAG;                                22320000
                                                                        22325000
      END;  << No exection msg >>                                       22330000
                                                                        22335000
      BEGIN << Send exection msg >>                                     22340000
                                                                        22345000
                                       << Compute word offset to    >>  22350000
                                       << nearest word boundry      >>  22355000
      IF INTEGER(IOQ'COUNT) < ZERO THEN                                 22360000
         ADDRESS'OFFSET    := (ONE - INTEGER(IOQ'COUNT)) / TWO          22365000
      ELSE                                                              22370000
         ADDRESS'OFFSET    := INTEGER(IOQ'COUNT);                       22375000
                                                                        22380000
      CP'DXFER'WRITE'READ  := WRT'CMD'SEC;                              22385000
      CP'DXFER'CDB'LENGTH  := INTEGER(IOQ'PARM2) -                      22390000
                              INTEGER(TRANSFER'COUNT);                  22395000
      CP'DXFER'CDB'BANK    := BANK;                                     22400000
      CP'DXFER'CDB'OFFSET  := BUFFADDR + ADDRESS'OFFSET;                22405000
      CP'DXFER'WAIT'5      := WAIT'INSTR;                               22410000
      CP'DXFER'WAIT'6      := ZERO;                                     22415000
      CP'DXFER'12'WAIT     := WAIT'INSTR;                               22420000
      CP'DXFER'13'WAIT     := ZERO;                                     22425000
      CP'DXFER'CMD'TO'EXEC := WRT'EXEC'SEC;                             22430000
                                              << Exec msg length    >>  22435000
      CP'DXFER'DATA'SIZE   := INTEGER(TRANSFER'COUNT);                  22440000
      CP'DXFER'DATA'TYPE   := ZERO;                                     22445000
      CP'DXFER'DATA'BANK   := BANK;                                     22450000
      CP'DXFER'DATA'OFFSET := BUFFADDR;                                 22455000
      CP'FIRST'BRANCH      := ENTER'DATA'XFER;                          22460000
                                                                        22465000
      END;  << Send exection msg >>                                     22470000
                                                                        22475000
      BEGIN << Receive exection msg >>                                  22480000
                                                                        22485000
      CP'DXFER'WRITE'READ  := WRT'CMD'SEC;                              22490000
      CP'DXFER'CDB'LENGTH  := IOQ'PARM2;                                22495000
      CP'DXFER'CDB'BANK    := BANK;                                     22500000
      CP'DXFER'CDB'OFFSET  := BUFFADDR;                                 22505000
      CP'DXFER'WAIT'5      := WAIT'INSTR;                               22510000
      CP'DXFER'WAIT'6      := ZERO;                                     22515000
      CP'DXFER'12'WAIT     := WAIT'INSTR;                               22520000
      CP'DXFER'13'WAIT     := ZERO;                                     22525000
      CP'DXFER'CMD'TO'EXEC := READ'EXEC'SEC;                            22530000
                                              << Exec msg count     >>  22535000
      CP'DXFER'DATA'SIZE   := INTEGER(TRANSFER'COUNT);                  22540000
      CP'DXFER'DATA'TYPE   := ZERO;                                     22545000
      CP'DXFER'DATA'BANK   := BANK;                                     22550000
      CP'DXFER'DATA'OFFSET := BUFFADDR;                                 22555000
      CP'FIRST'BRANCH      := ENTER'DATA'XFER;                          22560000
                                                                        22565000
      END;  << Receive exection msg>>                                   22570000
      END; << Of case IOQ'PARM1 >>                                      22575000
                                                                        22580000
   END; << Of case 28 >>                                                22585000
                                                                        22590000
   END; << OF "case FCODE..." >>                                        22595000
$PAGE                                                                   22600000
<<---------------------------------------------------->>                22605000
<<                                                    >>                22610000
<<   Start channel program section                    >>                22615000
<<                                                    >>                22620000
<<---------------------------------------------------->>                22625000
                                                                        22630000
   P'CPVA      := ZERO;                << Clear channel status words>>  22635000
   CPVA'STATUS := ZERO;                                                 22640000
                                                                        22645000
                                       << Clear the DIT status area >>  22650000
   INDEX := DSTATUS;                                                    22655000
   DO                                                                   22660000
     P'DIT(INDEX) := ZERO                                               22665000
   UNTIL (INDEX := INDEX + 1) > DSTATUS + (DEV'STAT'WORD'SIZE-1);       22670000
                                                                        22675000
   START'HPIB(P'DIT,SIOP,TRUE);                                         22680000
   IF > THEN                                                            22685000
      BEGIN                            << Exit with a SIO error     >>  22690000
      LOG'STATUS;                                                       22695000
      IOQ'STAT     := CHAN'PGM'FAILURE;                                 22700000
      UPDATE'XFER'CNT;                                                  22705000
      DRIVER'STATE := REQUEST'COMPLETE;                                 22710000
                                                                        22715000
      RETURN;                                                           22720000
      END; << Of "if > then ..." >>                                     22725000
                                                                        22730000
   IOQ'WAITCODE    := CMPLTION'WAIT;                                    22735000
   DRIVER'STATE    := INTERRUPT'WAIT;                                   22740000
                                                                        22745000
   RETURN;                                                              22750000
   END;   << End of initiation section >>                               22755000
$PAGE                                                                   22760000
<<*******************************************************************>> 22765000
<<*******************************************************************>> 22770000
<<                                                                   >> 22775000
<<                  CS'80 driver continuator section                 >> 22780000
<<                                                                   >> 22785000
<<*******************************************************************>> 22790000
<<*******************************************************************>> 22795000
                                                                        22800000
CONTINUATOR:                                                            22805000
                                                                        22810000
IF DIT'SAVE'WORD = -ONE THEN           << System powerfail          >>  22815000
   BEGIN                                                                22820000
   DIT'SAVE'WORD := ZERO;                                               22825000
   IOQ'SYS'PFAIL := ONE;                                                22830000
   GOTO RETRY'REQUEST;                                                  22835000
   END; << Of "if DIT'SAVE'WORD = -ONE ..." >>                          22840000
$PAGE                                                                   22845000
<<---------------------------------------------------->>                22850000
<<   Reset the location of where command bytes can    >>                22855000
<<   be found for diagnostics commands.               >>                22860000
<<---------------------------------------------------->>                22865000
                                                                        22870000
IF FCODE = FC'GENERIC'DIAG THEN                                         22875000
   BEGIN                                                                22880000
   CP'DIAG'CDB'BANK    := ZERO;        << CMB byte location         >>  22885000
   CP'DIAG'CDB'OFFSET  := @SIOP + SYSDB + CDB'AREA'WRD;                 22890000
   CP'DXFER'CDB'BANK   := ZERO;                                         22895000
   CP'DXFER'CDB'OFFSET := @SIOP + SYSDB + CDB'AREA'WRD;                 22900000
   END; << Of "if FCODE = FC'GENERIC'DIAG ..." >>                       22905000
$PAGE                                                                   22910000
                                       << Abort current IOQ         >>  22915000
IF IOQ'ABORT    =  ONE             AND                                  22920000
   IOQ'WAITCODE <> ABORT'IOQ'WAIT  THEN                                 22925000
                                                                        22930000
   BEGIN                                                                22935000
                                       << Do a channel independent  >>  22940000
                                       << clear to abort the        >>  22945000
                                       << current IOQ.              >>  22950000
   CP'FIRST'BRANCH := ENTER'POWER'ON;                                   22955000
   START'HPIB(P'DIT,SIOP,TRUE);                                         22960000
   IF > THEN                                                            22965000
      BEGIN                            << Exit with a SIO error     >>  22970000
      LOG'STATUS;                                                       22975000
      IOQ'STAT     := CHAN'PGM'FAILURE;                                 22980000
      UPDATE'XFER'CNT;                                                  22985000
      DRIVER'STATE := REQUEST'COMPLETE;                                 22990000
                                                                        22995000
      RETURN;                                                           23000000
      END; << Of "if > then ..." >>                                     23005000
                                                                        23010000
   DIT'IMMEDIATE'MODE := ONE;          << Immediate reporting will  >>  23015000
                                       << be enabled.               >>  23020000
   IOQ'WAITCODE       := ABORT'IOQ'WAIT;                                23025000
   DRIVER'STATE       := INTERRUPT'WAIT;                                23030000
                                                                        23035000
   RETURN;                                                              23040000
   END; << Of "if IOQ'ABORT = ONE ..." >>                               23045000
$PAGE                                                                   23050000
<<====================================================>>                23055000
<<                                                    >>                23060000
<<          Current I/O aborted do to the DMA         >>                23065000
<<                                                    >>                23070000
<<====================================================>>                23075000
                                                                        23080000
IF CPVA'ERRORCODE = DMA'ABORT THEN     << DMA abort                 >>  23085000
   IF IOQ'RETRY'COUNT = RETRY'LIMIT THEN                                23090000
      BEGIN                            << Exit with a channel errer >>  23095000
                                                                        23100000
      IF DIT'DEV'NOT'RDY = ONE THEN                                     23105000
         BEGIN                                                          23110000
                                       << Schedule idle wait CP     >>  23115000
         CP'FIRST'BRANCH := ENTER'IDLE'WAIT;                            23120000
         IOQ'WAITCODE    := NOT'RDY'WAIT;                               23125000
                                                                        23130000
         IF SYSTEM'UP THEN                                              23135000
            LDEVNOTRDY(P'DIT);         << Not rdy msg to console    >>  23140000
         START'HPIB(P'DIT,SIOP,TRUE);                                   23145000
         IF > THEN                                                      23150000
            BEGIN                      << Exit with a SIO error     >>  23155000
            LOG'STATUS;                                                 23160000
            IOQ'STAT      := CHAN'PGM'FAILURE;                          23165000
            UPDATE'XFER'CNT;                                            23170000
            DRIVER'STATE  := REQUEST'COMPLETE;                          23175000
                                                                        23180000
            RETURN;                                                     23185000
            END; << Of "if > then ..." >>                               23190000
                                                                        23195000
         DRIVER'STATE := NOT'READY;                                     23200000
                                                                        23205000
         RETURN;                                                        23210000
         END << Of "if DIT'DEV'NOT'RDY = ONE ..." >>                    23215000
      ELSE                                                              23220000
         BEGIN                         << Exit with a channel errer >>  23225000
                                       << If not diag req log error >>  23230000
         IF NOT IOQ'DIAG THEN                                           23235000
            BEGIN                                                       23240000
            DIT'ERROR'STATUS := [8/2,8/DLOGERROR];                      23245000
            DIT'LOG'ERROR    := P'CPVA;                                 23250000
            DIT'SIOP'STOP    := GETDRT(DRTN,0) - (@SIOP + SYSDB);       23255000
            END;                                                        23260000
         P'CPVA       := ZERO;                                          23265000
         IOQ'STAT     := CHAN'IO'FAILURE;                               23270000
         UPDATE'XFER'CNT;                                               23275000
         DRIVER'STATE := REQUEST'COMPLETE;                              23280000
                                                                        23285000
         RETURN;                                                        23290000
         END; << Of else "if DIT'DEV'NOT'RDY = ONE ..." >>              23295000
      END  << Of "if IOQ'RETRY'COUNT = RETRY'LIMIT ..." >>              23300000
   ELSE                                                                 23305000
      BEGIN                            << Retry 7 times             >>  23310000
                                                                        23315000
      IOQ'RETRY'COUNT  := IOQ'RETRY'COUNT + ONE;                        23320000
      DIT'ERROR'STATUS := [8/2,8/DLOGERROR];                            23325000
      DIT'LOG'ERROR    := P'CPVA;                                       23330000
      DIT'SIOP'STOP    := GETDRT(DRTN,0) - (@SIOP + SYSDB);             23335000
      P'CPVA           := ZERO;                                         23340000
      CP'FIRST'BRANCH  := ENTER'SYNC'DSJ;                               23345000
      START'HPIB(P'DIT,SIOP,TRUE);                                      23350000
      IF > THEN                                                         23355000
         BEGIN                         << Exit with a SIO error     >>  23360000
         LOG'STATUS;                                                    23365000
         IOQ'STAT      := CHAN'PGM'FAILURE;                             23370000
         UPDATE'XFER'CNT;                                               23375000
         DRIVER'STATE  := REQUEST'COMPLETE;                             23380000
                                                                        23385000
         RETURN;                                                        23390000
         END; << Of "if < then ..." >>                                  23395000
                                                                        23400000
      IOQ'WAITCODE := SYNC'WAIT;                                        23405000
      DRIVER'STATE := INTERRUPT'WAIT;                                   23410000
                                                                        23415000
      RETURN;                                                           23420000
      END; << Of else "if IOQ'RETRY'COUNT = RETRY'LIMIT ..." >>         23425000
$PAGE                                                                   23430000
<<====================================================>>                23435000
<<                                                    >>                23440000
<<      Current I/O aborted do to the Channel         >>                23445000
<<                                                    >>                23450000
<<====================================================>>                23455000
                                                                        23460000
IF CPVA'ERRORCODE = CHANNEL'ABORT THEN << Channel abort             >>  23465000
   IF IOQ'RETRY'COUNT = RETRY'LIMIT THEN                                23470000
      BEGIN                                                             23475000
                                                                        23480000
      IF DIT'DEV'NOT'RDY = ONE          OR                              23485000
         P'CPVA          = CPVA'TIMEOUT THEN                            23490000
                                                                        23495000
         BEGIN                                                          23500000
         IF FCODE = FC'REQ'LAST'STAT THEN                               23505000
            BEGIN                                                       23510000
                                       << Make word count           >>  23515000
            TRANSFER'COUNT := (TRANSFER'COUNT + 1D) / 2D;               23520000
                                                                        23525000
            TOS := BANK'N'BUFF'ADDR;   << User's area               >>  23530000
            TOS := ZERO;               << Describe area             >>  23535000
            TOS := @P'DIT + SYSDB + DSTATUS;                            23540000
            TOS := INTEGER(TRANSFER'COUNT); << #words to move       >>  23545000
            ASSEMBLE (MABS);                                            23550000
                                                                        23555000
                                       << Exit with a good transfer >>  23560000
            IOQ'STAT     := TIMEOUT'ERROR;                     <<f9010>>23565000
            IOQ'COUNT    := INTEGER(TRANSFER'COUNT);                    23570000
            DRIVER'STATE := REQUEST'COMPLETE;                           23575000
            P'CPVA       := 0;                                 <<f9010>>23580000
            CPVA'STATUS  := 0;                                 <<f9010>>23585000
                                                                        23590000
            RETURN;                                                     23595000
            END << Of "if FCODE = FC'REQ'LAST'STAT ..." >>              23600000
         ELSE                                                           23605000
            BEGIN                       << Schedule idle wait CP     >> 23610000
            CP'FIRST'BRANCH := ENTER'IDLE'WAIT;                         23615000
            IOQ'WAITCODE    := NOT'RDY'WAIT;                            23620000
                                                                        23625000
            IF SYSTEM'UP THEN                                           23630000
               LDEVNOTRDY(P'DIT);      << Not rdy msg to console    >>  23635000
            START'HPIB(P'DIT,SIOP(FIRSTBRANCH),TRUE);          <<f9010>>23640000
            IF > THEN                                                   23645000
               BEGIN                   << Exit with a SIO error     >>  23650000
               LOG'STATUS;                                              23655000
               IOQ'STAT     := CHAN'PGM'FAILURE;                        23660000
               UPDATE'XFER'CNT;                                         23665000
               DRIVER'STATE := REQUEST'COMPLETE;                        23670000
                                                                        23675000
               RETURN;                                                  23680000
               END; << Of "if > then ..." >>                            23685000
                                                                        23690000
            DRIVER'STATE := NOT'READY;                                  23695000
                                                                        23700000
            RETURN;                                                     23705000
            END; << Of "if FCODE = FC'REQ'LAST'STAT ..." >>             23710000
         END << Of "if DIT'DEV'NOT'RDY = ONE ..." >>                    23715000
      ELSE                                                              23720000
         BEGIN                         << Exit with a channel errer >>  23725000
                                       << If not diag req log error >>  23730000
         IF NOT IOQ'DIAG THEN                                           23735000
            BEGIN                                                       23740000
            DIT'ERROR'STATUS := [8/2,8/DLOGERROR];                      23745000
            DIT'LOG'ERROR    := P'CPVA;                                 23750000
            DIT'SIOP'STOP    := GETDRT(DRTN,0) - (@SIOP + SYSDB);       23755000
            END;                                                        23760000
         P'CPVA       := ZERO;                                          23765000
         IOQ'STAT     := CHAN'IO'FAILURE;                               23770000
         UPDATE'XFER'CNT;                                               23775000
         DRIVER'STATE := REQUEST'COMPLETE;                              23780000
                                                                        23785000
         RETURN;                                                        23790000
         END; << Of else "if DIT'DEV'NOT'RDY = ONE ..." >>              23795000
      END << Of "if IOQ'RETRY'COUNT = RETRY'LIMIT ..." >>               23800000
   ELSE                                                                 23805000
      BEGIN                                                             23810000
                                       << Retry 7 times             >>  23815000
      IOQ'RETRY'COUNT  := IOQ'RETRY'COUNT + ONE;                        23820000
      DIT'ERROR'STATUS := [8/2,8/DLOGERROR];                            23825000
      DIT'LOG'ERROR    := P'CPVA;                                       23830000
      DIT'SIOP'STOP    := GETDRT(DRTN,0) - (@SIOP + SYSDB);             23835000
      P'CPVA           := ZERO;                                         23840000
      CP'FIRST'BRANCH  := ENTER'SYNC'DSJ;                               23845000
      START'HPIB(P'DIT,SIOP,TRUE);                                      23850000
      IF > THEN                                                         23855000
         BEGIN                         << Exit with a SIO error     >>  23860000
         LOG'STATUS;                                                    23865000
         IOQ'STAT     := CHAN'PGM'FAILURE;                              23870000
         UPDATE'XFER'CNT;                                               23875000
         DRIVER'STATE := REQUEST'COMPLETE;                              23880000
                                                                        23885000
         RETURN;                                                        23890000
         END; << Of "if < then ..." >>                                  23895000
                                                                        23900000
      IOQ'WAITCODE := SYNC'WAIT;                                        23905000
      DRIVER'STATE := INTERRUPT'WAIT;                                   23910000
                                                                        23915000
      RETURN;                                                           23920000
      END; << Of else "if IOQ'RETRY'COUNT = RETRY'LIMIT ..." >>         23925000
$PAGE                                                                   23930000
IF IOQ'SFAIL THEN                      << Failure on delayed start  >>  23935000
                                       << I/O                       >>  23940000
   BEGIN                               << Exit with a SIO error     >>  23945000
   LOG'STATUS;                                                          23950000
   IOQ'STAT     := CHAN'PGM'FAILURE;                                    23955000
   UPDATE'XFER'CNT;                                                     23960000
   DRIVER'STATE := REQUEST'COMPLETE;                                    23965000
                                                                        23970000
   RETURN;                                                              23975000
   END; << Of "if IOQ'SFAIL then ..." >>                                23980000
$PAGE                                                                   23985000
<<====================================================>>                23990000
<<                                                    >>                23995000
<<   I/O status interrogation completion              >>                24000000
<<                                                    >>                24005000
<<====================================================>>                24010000
                                                                        24015000
IF CPVA'STATUS = ONE THEN              << Status diagnosis          >>  24020000
   BEGIN                                                                24025000
                                                                        24030000
   CPVA'STATUS := ZERO;                                                 24035000
                                                                        24040000
   IF DIT'DEV'POWERFAIL = ONE THEN                                      24045000
      BEGIN                                                             24050000
                                                                        24055000
      CP'FIRST'BRANCH := ENTER'POWER'ON;                                24060000
                                       << Do the clear. unqueued    >>  24065000
                                       << STARTSIO                  >>  24070000
      START'HPIB(P'DIT,SIOP,FALSE);                                     24075000
      IF > THEN                                                         24080000
         BEGIN                         << Exit with a SIO error     >>  24085000
         LOG'STATUS;                                                    24090000
         IOQ'STAT     := CHAN'PGM'FAILURE;                              24095000
         UPDATE'XFER'CNT;                                               24100000
         DRIVER'STATE := REQUEST'COMPLETE;                              24105000
                                                                        24110000
         RETURN;                                                        24115000
         END; << OF "if > then ..." >>                                  24120000
                                                                        24125000
      DIT'IMMEDIATE'MODE := ONE;       << Immediate reporting will  >>  24130000
                                       << be enabled.               >>  24135000
      IOQ'WAITCODE       := CMPLTION'WAIT;                              24140000
      DRIVER'STATE       := INTERRUPT'WAIT;                             24145000
                                                                        24150000
      RETURN;                                                           24155000
      END; << Of "if DIT'DEV'POWERFAIL = ONE ..." >>                    24160000
$PAGE                                                                   24165000
                                       << Update last status        >>  24170000
   IF FCODE = FC'REQ'LAST'STAT THEN                                     24175000
      BEGIN                                                             24180000
                                       << Make word count           >>  24185000
      TRANSFER'COUNT := (TRANSFER'COUNT + 1D) / 2D;                     24190000
                                                                        24195000
      TOS := BANK'N'BUFF'ADDR;         << User's area               >>  24200000
      TOS := ZERO;                     << Describe area             >>  24205000
      TOS := @P'DIT + SYSDB + DSTATUS;                                  24210000
      TOS := INTEGER(TRANSFER'COUNT);  << #words to move            >>  24215000
      ASSEMBLE (MABS);                                                  24220000
                                                                        24225000
      IOQ'STAT     := GOOD'IO;         << Exit with a good transfer >>  24230000
      IOQ'COUNT    := INTEGER(TRANSFER'COUNT);                          24235000
      DRIVER'STATE := REQUEST'COMPLETE;                                 24240000
                                                                        24245000
      RETURN;                                                           24250000
      END; << Of "if FCODE = FC'REQ'LAST'STAT ..." >>                   24255000
$PAGE                                                                   24260000
   IF IOQ'DIAG THEN                    << Diagnostic completion     >>  24265000
      BEGIN                            << Exit with a diag completio>>  24270000
      IOQ'STAT     := READ'LAST'STAT;                                   24275000
      UPDATE'XFER'CNT;                                                  24280000
      DRIVER'STATE := REQUEST'COMPLETE;                                 24285000
                                                                        24290000
      RETURN;                                                           24295000
      END; << OF "if IOQ'DIAG then ..." >>                              24300000
$PAGE                                                                   24305000
   IF DIT'UNINIT'MEDIA = ONE THEN                                       24310000
      BEGIN                            << Exit with un-init media   >>  24315000
      LOG'STATUS;                                                       24320000
      IOQ'STAT     := UNINIT'MEDIA'ERR;                                 24325000
      UPDATE'XFER'CNT;                                                  24330000
      DRIVER'STATE := REQUEST'COMPLETE;                                 24335000
                                                                        24340000
      RETURN;                                                           24345000
      END; << Of "if DIT'UNINIT'METIA = ONE ..." >>                     24350000
$PAGE                                                                   24355000
   IF DIT'UNIT'ATTENTION <> %377 AND                                    24360000
      DIT'UNIT'ATTENTION <> %17  AND                                    24365000
      DIT'UNIT'ATTENTION <> ZERO THEN                                   24370000
                                                                        24375000
      BEGIN                            << Exit with a unit error    >>  24380000
      LOG'STATUS;                                                       24385000
      IOQ'STAT     := UNIT'FAILURE;                                     24390000
      UPDATE'XFER'CNT;                                                  24395000
      DRIVER'STATE := REQUEST'COMPLETE;                                 24400000
                                                                        24405000
      RETURN;                                                           24410000
      END; << Of "if DIT'UNIT'ATTENTION <> %377 ..." >>                 24415000
$PAGE                                                                   24420000
   IF DIT'CHAN'PARITY'ERR  = ONE OR                                     24425000
      DIT'ILL'OPCODE       = ONE OR                                     24430000
      DIT'MODULE'ADDR'ONE  = ONE OR                                     24435000
      DIT'PARAMETER'BOUND  = ONE OR                                     24440000
      DIT'ILL'PARAMETER    = ONE OR                                     24445000
      DIT'ILL'MSG'SEQ      = ONE OR                                     24450000
      DIT'MSG'LENGTH'ERR   = ONE OR                                     24455000
                                                                        24460000
      DIT'COPY'ERR         = ONE OR                                     24465000
      DIT'CONTROLLER'FAULT = ONE OR                                     24470000
      DIT'UNIT'FAULT       = ONE OR                                     24475000
      DIT'DIAG'FAIL        = ONE OR                                     24480000
      DIT'OPR'REL'REQ      = ONE OR                                     24485000
      DIT'DIAG'REL'REQ     = ONE OR                                     24490000
                                                                        24495000
      DIT'ILL'OPERATION    = ONE OR                                     24500000
      DIT'NO'DATA'FOUND    = ONE OR                                     24505000
      DIT'END'OF'FILE      = ONE THEN                                   24510000
                                                                        24515000
      IF IOQ'RETRY'COUNT = RETRY'LIMIT THEN                             24520000
                                       << Reached the retry limit.  >>  24525000
         BEGIN                         << Exit with a unit error    >>  24530000
         LOG'STATUS;                                                    24535000
         IOQ'STAT     := UNIT'FAILURE;                                  24540000
         UPDATE'XFER'CNT;                                               24545000
         DRIVER'STATE := REQUEST'COMPLETE;                              24550000
                                                                        24555000
         RETURN;                                                        24560000
         END  << Of "if IOQ'RETRY'COUNT = RETRY'LIMIT ..." >>           24565000
      ELSE                                                              24570000
         BEGIN                                                          24575000
         IOQ'RETRY'COUNT := IOQ'RETRY'COUNT + ONE;                      24580000
         IF DIT'ILL'MSG'SEQ = ONE AND                                   24585000
            IOQ'SYS'PFAIL   = ONE THEN                                  24590000
                                                                        24595000
            GOTO RETRY'REQUEST                                          24600000
         ELSE                                                           24605000
            BEGIN                                                       24610000
            LOG'STATUS;                                                 24615000
            GOTO RETRY'REQUEST;        << Retry status              >>  24620000
            END; << Of else "if DIT'ILL'MSG'SEQ = ONE ..." >>           24625000
         END; << Of else "if IOQ'RETRY'COUNT = RETRY'LIMIT ..." >>      24630000
$PAGE                                                                   24635000
<<------------------------------------------------>>                    24640000
<<     Drive was write protected                  >>                    24645000
<<------------------------------------------------>>                    24650000
                                                                        24655000
   IF DIT'WRITE'PROTECT = ONE THEN                                      24660000
      BEGIN                                                             24665000
      IOQ'UNLOAD'RING     := ONE;                                       24670000
      CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                               24675000
      CP'DIAG'CDB'LENGTH  := TWO;      << Byte count                >>  24680000
      SIOP'BYTE(CDB'AREA'BYTE + 0 , CDB'SET'UNIT);                      24685000
      SIOP'BYTE(CDB'AREA'BYTE + 1 , CDB'UNLOAD);                        24690000
      CP'FIRST'BRANCH     := ENTER'DIAG;                                24695000
                                                                        24700000
      IF NOT IOMESSAGE(1,NO'WRITE'RING'MSG,%10000,DIT'LDEV,             24705000
                           ,,,,CONSOLE) THEN                            24710000
         BEGIN                         << Exit with a sys error     >>  24715000
         LOG'STATUS;                                                    24720000
         IOQ'STAT     := SYSTEM'ERROR;                                  24725000
         UPDATE'XFER'CNT;                                               24730000
         DRIVER'STATE := REQUEST'COMPLETE;                              24735000
                                                                        24740000
         RETURN;                                                        24745000
         END; << Of "if NOT IOMESSAGE(1,NO'WRITE'RING'MSG, ..." >>      24750000
                                                                        24755000
      P'CPVA := ZERO;                  << Clear channel status word >>  24760000
      START'HPIB(P'DIT,SIOP,TRUE);                                      24765000
      IF > THEN                                                         24770000
         BEGIN                         << Exit with a SIO error     >>  24775000
         LOG'STATUS;                                                    24780000
         IOQ'STAT     := CHAN'PGM'FAILURE;                              24785000
         UPDATE'XFER'CNT;                                               24790000
         DRIVER'STATE := REQUEST'COMPLETE;                              24795000
                                                                        24800000
         RETURN;                                                        24805000
         END; << Of "if > then ..." >>                                  24810000
                                                                        24815000
      IOQ'WAITCODE := CMPLTION'WAIT;                                    24820000
      DRIVER'STATE := INTERRUPT'WAIT;                                   24825000
                                                                        24830000
      RETURN;                                                           24835000
      END; << Of "if DIT'WRITE'PROTECT = ONE ..." >>                    24840000
$PAGE                                                                   24845000
   IF DIT'RETRANSMIT = ONE THEN                                         24850000
      IF IOQ'RETRY'COUNT = RETRY'LIMIT THEN                             24855000
                                       << Reach the retry limit.    >>  24860000
         BEGIN                         << Exit with a unit error    >>  24865000
         LOG'STATUS;                                                    24870000
         IOQ'STAT     := UNIT'FAILURE;                                  24875000
         UPDATE'XFER'CNT;                                               24880000
         DRIVER'STATE := REQUEST'COMPLETE;                              24885000
                                                                        24890000
         RETURN;                                                        24895000
         END << Of "if IOQ'RETRY'COUNT = RETRY'LIMIT ..." >>            24900000
      ELSE                                                              24905000
         BEGIN                                                          24910000
         IOQ'RETRY'COUNT := IOQ'RETRY'COUNT + ONE;                      24915000
         GOTO RETRY'REQUEST;                                            24920000
         END; << Of else "if IOQ'RETRY'COUNT = RETRY'LIMIT ..." >>      24925000
$PAGE                                                                   24930000
   IF DIT'SPARE'UNAVAIL = ONE THEN                                      24935000
      BEGIN                            << Exit with a no spare err  >>  24940000
      LOG'STATUS;                                                       24945000
      IOQ'STAT     := NO'SPARE'ERR;                                     24950000
      UPDATE'XFER'CNT;                                                  24955000
      DRIVER'STATE := REQUEST'COMPLETE;                                 24960000
                                                                        24965000
      RETURN;                                                           24970000
      END; << Of "if DIT'SPARE'UNAVAIL = ONE ..." >>                    24975000
$PAGE                                                                   24980000
   IF DIT'ADDR'BOUNDS   = ONE OR                                        24985000
      DIT'END'OF'VOLUME = ONE THEN                                      24990000
                                                                        24995000
      BEGIN                            << Exit with a invalid addr  >>  25000000
      LOG'STATUS;                                                       25005000
      IOQ'STAT     := INVALID'ADDR;                                     25010000
      UPDATE'XFER'CNT;                                                  25015000
      DRIVER'STATE := REQUEST'COMPLETE;                                 25020000
                                                                        25025000
      RETURN;                                                           25030000
      END; << Of "if DIT'ADDR'BOUNDS = ONE ..." >>                      25035000
$PAGE                                                                   25040000
<<---------------------------------------------------->>                25045000
<<   Release request/required handling:               >>                25050000
<<---------------------------------------------------->>                25055000
                                                                        25060000
   IF DIT'INT'MAINT'REQ   = ONE OR                                      25065000
      DIT'I'OPR'REL'REQ   = ONE OR                                      25070000
      DIT'I'DIAG'REL'REQ  = ONE OR                                      25075000
      DIT'I'INT'MAINT'REQ = ONE THEN                                    25080000
                                                                        25085000
      BEGIN                                                             25090000
      IF FCODE            = FC'LOC'N'VERIFY AND                         25095000
         DIT'UNRECOV'DATA = ONE THEN                                    25100000
                                                                        25105000
         BEGIN                                                          25110000
                                       << Return the bad block addr >>  25115000
         TOS := BANK'N'BUFF'ADDR;                                       25120000
         TOS := DIT'PARM'FIELD1;       << Bad blk address           >>  25125000
         TOS := DIT'PARM'FIELD2;                                        25130000
         ASSEMBLE (SDEA);                                               25135000
                                                                        25140000
         DIT'BAD'TRANSFER := ZERO;                                      25145000
         IOQ'VERIFY'ERR   := ONE;                                       25150000
         END; << Of 'if FCODE = FC'LOC'N'VERIFY ..." >>                 25155000
                                                                        25160000
      CP'DIAG'CMD'TO'EXEC := WRT'CMD'SEC;                               25165000
      CP'DIAG'CDB'LENGTH  := TWO;      << CDB byte count            >>  25170000
      SIOP'BYTE(CDB'AREA'BYTE + 0 , CDB'SET'UNIT + CTRL'UNIT);          25175000
                                                                        25180000
      SIOP'BYTE(CDB'AREA'BYTE + 1 ,                                     25185000
         IF DIT'INT'MAINT'REQ   =  ONE OR                               25190000
            DIT'I'INT'MAINT'REQ =  ONE OR                               25195000
            DIT'I'OPR'REL'REQ   =  ONE AND                              25200000
            DIT'DEV'NOT'RDY     =  ONE OR                               25205000
            DIT'I'OPR'REL'REQ   =  ONE AND                              25210000
            DIT'LOCK'FLG        <> ONE THEN                             25215000
               CDB'RELEASE                                              25220000
         ELSE                                                           25225000
               CDB'RELEASE'DENY);                                       25230000
                                                                        25235000
      IF DIT'I'OPR'REL'REQ = ONE THEN                                   25240000
         IOQ'OPER'REQ := ONE;                                           25245000
                                                                        25250000
      IF DIT'I'INT'MAINT'REQ = ONE THEN                                 25255000
         IOQ'IM'FAULT := ONE;                                           25260000
                                                                        25265000
      IF DIT'DEV'NOT'RDY = ONE THEN                                     25270000
         IOQ'MEDIA'LOAD := ONE;                                         25275000
                                                                        25280000
      CP'FIRST'BRANCH := ENTER'DIAG;   << Schedule release          >>  25285000
      START'HPIB(P'DIT,SIOP,TRUE);     << or release deny           >>  25290000
      IF > THEN                                                         25295000
         BEGIN                         << Exit with a SIO error     >>  25300000
         IOQ'STAT     := CHAN'PGM'FAILURE;                              25305000
         LOG'STATUS;                                                    25310000
         UPDATE'XFER'CNT;                                               25315000
         DRIVER'STATE := REQUEST'COMPLETE;                              25320000
                                                                        25325000
         RETURN;                                                        25330000
         END; << Of "if > then ..." >>                                  25335000
                                                                        25340000
      IOQ'WAITCODE := REL'WAIT;                                         25345000
      DRIVER'STATE := INTERRUPT'WAIT;                                   25350000
                                                                        25355000
      RETURN;                                                           25360000
      END; << Of "if DIT'INT'MAINT'REQ = ONE ..." >>                    25365000
$PAGE                                                                   25370000
<<---------------------------------------------------->>                25375000
<<   Drive not ready - schedule idle CP until ready   >>                25380000
<<---------------------------------------------------->>                25385000
                                                                        25390000
   IF DIT'DEV'NOT'RDY = ONE          OR                                 25395000
      P'CPVA          = CPVA'TIMEOUT THEN                               25400000
                                                                        25405000
                                       << Inform user-NOTRDY        >>  25410000
      IF FCODE = FC'REQ'LAST'STAT THEN                                  25415000
         BEGIN                                                          25420000
                                       << Make word count           >>  25425000
         TRANSFER'COUNT := (TRANSFER'COUNT + 1D) / 2D;                  25430000
                                                                        25435000
         TOS := BANK'N'BUFF'ADDR;      << User's area               >>  25440000
         TOS := ZERO;                  << Describe area             >>  25445000
         TOS := @P'DIT + SYSDB + DSTATUS;                               25450000
         TOS := INTEGER(TRANSFER'COUNT); << #words to move          >>  25455000
         ASSEMBLE (MABS);                                               25460000
                                                                        25465000
         IOQ'STAT     := TIMEOUT'ERROR;                        <<f9010>>25470000
         IOQ'COUNT    := INTEGER(TRANSFER'COUNT);                       25475000
         DRIVER'STATE := REQUEST'COMPLETE;                              25480000
         P'CPVA       := 0;                                    <<f9010>>25485000
         CPVA'STATUS  := 0;                                    <<f9010>>25490000
                                                                        25495000
         RETURN;                                                        25500000
         END  << Of "if FCODE = FC'REQ'LAST'STAT ..." >>                25505000
      ELSE                                                              25510000
         BEGIN                                                          25515000
         IOQ'WAITCODE    := NOT'RDY'WAIT;                               25520000
                                       << Schedule idle wait CP     >>  25525000
         CP'FIRST'BRANCH := ENTER'IDLE'WAIT;                            25530000
                                                                        25535000
         IF SYSTEM'UP THEN                                              25540000
            LDEVNOTRDY(P'DIT);         << Not rdy msg to console    >>  25545000
                                                                        25550000
         START'HPIB(P'DIT,SIOP(FIRSTBRANCH),TRUE);             <<f9010>>25555000
         IF > THEN                                                      25560000
            BEGIN                      << Exit with a SIO error     >>  25565000
            LOG'STATUS;                                                 25570000
            IOQ'STAT     := CHAN'PGM'FAILURE;                           25575000
            UPDATE'XFER'CNT;                                            25580000
            DRIVER'STATE := REQUEST'COMPLETE;                           25585000
                                                                        25590000
            RETURN;                                                     25595000
            END; << Of "if > then ..." >>                               25600000
                                                                        25605000
         DRIVER'STATE := NOT'READY;                                     25610000
                                                                        25615000
         RETURN;                                                        25620000
         END; << Of else "if FCODE = FC'REQ'LAST'STAT ..." >>           25625000
$PAGE                                                                   25630000
<<---------------------------------------------------->>                25635000
<<   Data not recoverable                             >>                25640000
<<---------------------------------------------------->>                25645000
                                                                        25650000
   IF DIT'DATA'OVERFLOW = ONE OR                                        25655000
      DIT'UNRECOV'DATA  = ONE THEN                                      25660000
                                                                        25665000
      BEGIN                                                             25670000
      DIT'ADDR1'BAD'BLOCK := DIT'PARM'FIELD1; << Bad blk address    >>  25675000
      DIT'ADDR2'BAD'BLOCK := DIT'PARM'FIELD2;                           25680000
                                          << Xfer left             >>   25685000
      DIT'BAD'TRANSFER    := CP'DXFER'DATA'SIZE;                        25690000
                                                                        25695000
      IF FCODE = FC'LOC'N'VERIFY THEN  << Verify function           >>  25700000
         BEGIN                                                          25705000
                                       << Return bad sector addr    >>  25710000
         TOS := BANK'N'BUFF'ADDR;                                       25715000
         TOS := DP'DIT(DBADBLK1);                                       25720000
         ASSEMBLE (SDEA);                                               25725000
         END;                                                           25730000
                                       << Exit with a Trk Sct err   >>  25735000
      LOG'STATUS;                                                       25740000
      IOQ'STAT     := TRACK'SECT'ERROR;                                 25745000
      UPDATE'XFER'CNT;                                                  25750000
      DRIVER'STATE := REQUEST'COMPLETE;                                 25755000
                                                                        25760000
      RETURN;                                                           25765000
      END;                                                              25770000
$PAGE                                                                   25775000
<<---------------------------------------------------->>                25780000
<<   Log informational status                         >>                25785000
<<---------------------------------------------------->>                25790000
                                                                        25795000
   IF DIT'MEDIA'WEAR'OUT   = ONE OR                                     25800000
      DIT'DEFECT'BLK'SPARE = ONE OR                                     25805000
      DIT'MARGINAL'DATA    = ONE OR                                     25810000
      DIT'NO'DATA'OVERFLOW = ONE OR                                     25815000
      DIT'RECOV'DATA       = ONE OR                                     25820000
      DIT'MAINT'TRACK      = ONE THEN                                   25825000
                                                                        25830000
      LOG'STATUS;                                                       25835000
$PAGE                                                                   25840000
<<---------------------------------------------------->>                25845000
<<   Maintenance trk ov - schedule logging process    >>                25850000
<<---------------------------------------------------->>                25855000
                                                                        25860000
   IF DIT'MAINT'TRACK = ONE THEN                                        25865000
      MAINT'REQUEST(DIT'LDEV,TYPE'BUFFALO,LPDT'SUBTYPE);                25870000
                                                                        25875000
   END; << Of 'if CPVA'STATUS = ONE...' >>                              25880000
$PAGE                                                                   25885000
<<====================================================>>                25890000
<<                                                    >>                25895000
<<   Power on completion                              >>                25900000
<<                                                    >>                25905000
<<====================================================>>                25910000
                                                                        25915000
IF CPVA'STATUS = TWO THEN              << PON - redo IOQ            >>  25920000
   BEGIN                                                                25925000
   CPVA'STATUS := ZERO;                                                 25930000
   IF IOQ'DIAG THEN                    << Diag request              >>  25935000
      BEGIN                            << Exit with a power on statu>>  25940000
      IOQ'STAT     := DEV'POWER'ON;                                     25945000
      UPDATE'XFER'CNT;                                                  25950000
      DRIVER'STATE := REQUEST'COMPLETE;                                 25955000
                                                                        25960000
      RETURN;                                                           25965000
      END << Of "if IOQ'DIAG then ..." >>                               25970000
   ELSE IF IOQ'RETRY'COUNT = RETRY'LIMIT THEN                           25975000
      BEGIN                            << Exit with a power on statu>>  25980000
      IOQ'STAT     := DEV'POWER'ON;                                     25985000
      UPDATE'XFER'CNT;                                                  25990000
      DRIVER'STATE := REQUEST'COMPLETE;                                 25995000
                                                                        26000000
      RETURN;                                                           26005000
      END << Of "if IOQ'RETRY'COUNT = RETRY'LIMIT ..." >>               26010000
   ELSE                                                                 26015000
      BEGIN                                                             26020000
      IOQ'RETRY'COUNT := IOQ'RETRY'COUNT + ONE;                         26025000
      GOTO RETRY'REQUEST;                                               26030000
      END; << Of else "if IOQ'RETRY'COUNT = RETRY'LIMIT ..." >>         26035000
   END;                                                                 26040000
$PAGE                                                                   26045000
<<====================================================>>                26050000
<<                                                    >>                26055000
<<   Problem interrogating status                     >>                26060000
<<                                                    >>                26065000
<<====================================================>>                26070000
                                                                        26075000
IF CPVA'STATUS = THREE THEN            << Retry once                >>  26080000
   BEGIN                                                                26085000
   CPVA'STATUS := ZERO;                                                 26090000
   IF IOQ'RSTAT'FAIL = ONE THEN                                         26095000
                                       << Retry failed              >>  26100000
      BEGIN                            << Exit with a unit error    >>  26105000
      LOG'STATUS;                                                       26110000
      IOQ'STAT     := UNIT'FAILURE;                                     26115000
      UPDATE'XFER'CNT;                                                  26120000
      DRIVER'STATE := REQUEST'COMPLETE;                                 26125000
                                                                        26130000
      RETURN;                                                           26135000
      END; << Of "if IOQ'RSTAT'FAIL = ONE ..." >>                       26140000
                                                                        26145000
   IOQ'RSTAT'FAIL  := ONE;                                              26150000
   CP'FIRST'BRANCH := ENTER'STAT'REQ;  << Retry read status        >>   26155000
   START'HPIB(P'DIT,SIOP,TRUE);                                         26160000
   IF > THEN                                                            26165000
      BEGIN                            << Exit with a SIO error     >>  26170000
      LOG'STATUS;                                                       26175000
      IOQ'STAT     := CHAN'PGM'FAILURE;                                 26180000
      UPDATE'XFER'CNT;                                                  26185000
      DRIVER'STATE := REQUEST'COMPLETE;                                 26190000
                                                                        26195000
      RETURN;                                                           26200000
      END; << Of "if > then ..." >>                                     26205000
                                                                        26210000
   DRIVER'STATE := INTERRUPT'WAIT;                                      26215000
                                                                        26220000
   RETURN;                                                              26225000
   END; << Of "if CPVA'STATUS = THREE ..." >>                           26230000
$PAGE                                                                   26235000
<<====================================================>>                26240000
<<                                                    >>                26245000
<<   Power on during the idle channel program         >>                26250000
<<                                                    >>                26255000
<<====================================================>>                26260000
                                                                        26265000
IF CPVA'STATUS = FOUR THEN             << Issue dev clr             >>  26270000
   BEGIN                                                                26275000
   CPVA'STATUS     := ZERO;                                             26280000
   CP'FIRST'BRANCH := ENTER'POWER'ON;                                   26285000
                                       << Do the clear. unqueued    >>  26290000
                                       << STARTSIO                  >>  26295000
   START'HPIB(P'DIT,SIOP,FALSE);                                        26300000
   IF > THEN                                                            26305000
      BEGIN                            << Exit with a SIO error     >>  26310000
      LOG'STATUS;                                                       26315000
      IOQ'STAT     := CHAN'PGM'FAILURE;                                 26320000
      UPDATE'XFER'CNT;                                                  26325000
      DRIVER'STATE := REQUEST'COMPLETE;                                 26330000
                                                                        26335000
      RETURN;                                                           26340000
      END; << Of "if > then ..." >>                                     26345000
                                                                        26350000
   DIT'IMMEDIATE'MODE := ONE;          << Immediate reporting will  >>  26355000
                                       << be enabled.               >>  26360000
   IOQ'WAITCODE       := CMPLTION'WAIT;                                 26365000
   DRIVER'STATE       := INTERRUPT'WAIT;                                26370000
                                                                        26375000
   RETURN;                                                              26380000
   END; << Of "if CPVA'STATUS = FOUR ..." >>                            26385000
$PAGE                                                                   26390000
<<====================================================>>                26395000
<<                                                    >>                26400000
<<       Clear due to IOQ abort completion            >>                26405000
<<                                                    >>                26410000
<<====================================================>>                26415000
                                                                        26420000
IF IOQ'WAITCODE = ABORT'IOQ'WAIT THEN                                   26425000
   BEGIN                               << Exit with a good transfer >>  26430000
   IOQ'STAT     := GOOD'IO;                                             26435000
   UPDATE'XFER'CNT;                                                     26440000
   DRIVER'STATE := REQUEST'COMPLETE;                                    26445000
                                                                        26450000
   RETURN;                                                              26455000
   END; << Of "if IOQ'WAITCODE = ABORT'IOQ'WAIT ..." >>                 26460000
$PAGE                                                                   26465000
<<====================================================>>                26470000
<<                                                    >>                26475000
<<   Not ready completion                             >>                26480000
<<                                                    >>                26485000
<<====================================================>>                26490000
                                                                        26495000
IF IOQ'WAITCODE = NOT'RDY'WAIT THEN                                     26500000
   GOTO RETRY'REQUEST;                                                  26505000
$PAGE                                                                   26510000
<<====================================================>>                26515000
<<                                                    >>                26520000
<<   Release/release denied completion                >>                26525000
<<                                                    >>                26530000
<<====================================================>>                26535000
                                                                        26540000
IF IOQ'WAITCODE = REL'WAIT THEN                                         26545000
   BEGIN                                                                26550000
   IF IOQ'OPER'REQ   =  ONE LAND                                        26555000
      IOQ'MEDIA'LOAD <> ONE LAND                                        26560000
      DIT'LOCK'FLG   =  ONE THEN                                        26565000
                                                                        26570000
      BEGIN                                                             26575000
      IF NOT IOMESSAGE(1,NSYS'DENY'MSG,%10000,                          26580000
         DIT'LDEV,,,,,CONSOLE) THEN                                     26585000
                                                                        26590000
         BEGIN                         << Exit with a sys error     >>  26595000
         LOG'STATUS;                                                    26600000
         IOQ'STAT     := SYSTEM'ERROR;                                  26605000
         UPDATE'XFER'CNT;                                               26610000
         DRIVER'STATE := REQUEST'COMPLETE;                              26615000
                                                                        26620000
         RETURN;                                                        26625000
         END;                                                           26630000
      END; << Of "if IOQ'OPER'REQ = ONE ..." >>                         26635000
                                                                        26640000
   IF (FCODE = FC'INIT'MEDIA    OR                                      26645000
       FCODE = FC'LOC'N'VERIFY) AND                                     26650000
      IOQ'IM'FAULT <> ONE       THEN                                    26655000
                                                                        26660000
      BEGIN                                                             26665000
      IF FCODE          = FC'LOC'N'VERIFY AND                           26670000
         IOQ'VERIFY'ERR = ONE             THEN                          26675000
                                                                        26680000
         BEGIN                         << Exit with a Trk Sct error >>  26685000
         LOG'STATUS;                                                    26690000
         IOQ'STAT     := TRACK'SECT'ERROR;                              26695000
         UPDATE'XFER'CNT;                                               26700000
         DRIVER'STATE := REQUEST'COMPLETE;                              26705000
                                                                        26710000
         RETURN;                                                        26715000
         END << OF "if FCODE = FC'LOC'N'VERIFY ..." >>                  26720000
      ELSE                                                              26725000
         BEGIN                         << Exit with a good transfer >>  26730000
         IOQ'STAT     := GOOD'IO;                                       26735000
         UPDATE'XFER'CNT;                                               26740000
         DRIVER'STATE := REQUEST'COMPLETE;                              26745000
                                                                        26750000
         RETURN;                                                        26755000
         END; << Of else "if FCODE = FC'LOC'N'VERIFY ..." >>            26760000
      END; << Of "if (FCODE = FC'INIT'MEDIA ..." >>                     26765000
                                                                        26770000
   GOTO RETRY'REQUEST;                                                  26775000
   END; << Of "if IOQ'WAITCODE = REL'WAIT ..." >>                       26780000
$PAGE                                                                   26785000
<<====================================================>>                26790000
<<                                                    >>                26795000
<<           No write ring completion                 >>                26800000
<<                                                    >>                26805000
<<====================================================>>                26810000
                                                                        26815000
                                                                        26820000
IF IOQ'UNLOAD'RING <> ZERO THEN                                         26825000
   BEGIN                                                                26830000
   IOQ'UNLOAD'RING := ZERO;                                             26835000
   IOQ'STAT        := WRITE'RING'WAIT;                                  26840000
   DRIVER'STATE    := OPINTRVNWAIT;                                     26845000
                                                                        26850000
   RETURN                                                               26855000
   END; << Of "if IOQ'UNLOAD'RING <> ZERO ..." >>                       26860000
$PAGE                                                                   26865000
<<====================================================>>                26870000
<<                                                    >>                26875000
<<   Driver/firmware synchronization completion       >>                26880000
<<                                                    >>                26885000
<<====================================================>>                26890000
                                                                        26895000
IF IOQ'WAITCODE = SYNC'WAIT THEN                                        26900000
   GOTO RETRY'REQUEST;                                                  26905000
$PAGE                                                                   26910000
<<====================================================>>                26915000
<<                                                    >>                26920000
<<   Function dependencies completion                 >>                26925000
<<                                                    >>                26930000
<<====================================================>>                26935000
                                                                        26940000
<<---------------------------------------------------->>                26945000
<<   Return the device status.                        >>                26950000
<<---------------------------------------------------->>                26955000
                                                                        26960000
IF FCODE = FC'REQ'LAST'STAT THEN                                        26965000
   BEGIN                                                                26970000
                                       << Make word count           >>  26975000
   TRANSFER'COUNT := (TRANSFER'COUNT + 1D) / 2D;                        26980000
                                                                        26985000
   TOS := BANK'N'BUFF'ADDR;            << User's area               >>  26990000
   TOS := ZERO;                        << Describe area             >>  26995000
   TOS := @P'DIT + SYSDB + DSTATUS;                                     27000000
   TOS := INTEGER(TRANSFER'COUNT);     << #words to move            >>  27005000
   ASSEMBLE (MABS);                                                     27010000
                                                                        27015000
   IOQ'STAT     := GOOD'IO;            << Exit with a good transfer >>  27020000
   IOQ'COUNT    := INTEGER(TRANSFER'COUNT);                             27025000
   DRIVER'STATE := REQUEST'COMPLETE;                                    27030000
                                                                        27035000
   RETURN;                                                              27040000
   END; << Of "if FCODE = FC'REQ'LAST'STAT ..." >>                      27045000
$PAGE                                                                   27050000
<<---------------------------------------------------->>                27055000
<<   Return the volume limit.                         >>                27060000
<<---------------------------------------------------->>                27065000
                                                                        27070000
IF FCODE = FC'REQ'VOL'LIMIT THEN                                        27075000
   BEGIN                                                                27080000
                                       << Return the volume limit   >>  27085000
   TOS := BANK'N'BUFF'ADDR;                                             27090000
   TOS := SIOP(VOLUME'LIMIT + 1);      << Volume limit              >>  27095000
   TOS := SIOP(VOLUME'LIMIT + TWO);                                     27100000
   ASSEMBLE (SDEA);                    << Store dbl word            >>  27105000
                                                                        27110000
                                       << Exit with a good transfer >>  27115000
   IOQ'STAT     := GOOD'IO;                                             27120000
   IOQ'COUNT    := TWO;                                                 27125000
   DRIVER'STATE := REQUEST'COMPLETE;                                    27130000
                                                                        27135000
   RETURN;                                                              27140000
   END; << Of "if FCODE = FC'REQ'VOL'LIMIT ..." >>                      27145000
$PAGE                                                                   27150000
<<---------------------------------------------------->>                27155000
<<   Return the HP-IB Identify code                   >>                27160000
<<---------------------------------------------------->>                27165000
                                                                        27170000
IF FCODE = FC'IDENTIFY THEN                                             27175000
   BEGIN                                                                27180000
                                       << Return the device's id    >>  27185000
   TOS := BANK'N'BUFF'ADDR;                                             27190000
   TOS := CP'IDENT'HPIB'ID;            << Device id                 >>  27195000
   ASSEMBLE(SSEA);                                                      27200000
                                                                        27205000
                                       << Exit with a good transfer >>  27210000
   IOQ'STAT     := GOOD'IO;                                             27215000
   IOQ'COUNT    := ONE;                                                 27220000
   DRIVER'STATE := REQUEST'COMPLETE;                                    27225000
                                                                        27230000
   RETURN;                                                              27235000
   END; << Of "if FCODE = FC'IDENTIFY ..." >>                           27240000
$PAGE                                                                   27245000
<<---------------------------------------------------->>                27250000
<<   Return good status that parity was set.          >>                27255000
<<---------------------------------------------------->>                27260000
                                                                        27265000
IF FCODE = FC'PARITY'CHECK THEN                                         27270000
   BEGIN                                                                27275000
                                                                        27280000
   CP'DIAG'WAIT'5 := WAIT'INSTR;       << Reset the wait instr.     >>  27285000
   CP'DIAG'WAIT'6 := ZERO;                                              27290000
                                                                        27295000
   IOQ'STAT       := GOOD'IO;          << Exit with a good transfer >>  27300000
   IOQ'COUNT      := ONE;                                               27305000
   DRIVER'STATE   := REQUEST'COMPLETE;                                  27310000
                                                                        27315000
   RETURN;                                                              27320000
   END; << Of "if FCODE = FC'IDENTIFY ..." >>                           27325000
$PAGE                                                                   27330000
IF FCODE = FC'UNLOAD'CART    OR                                         27335000
   FCODE = FC'INIT'SELFTEST  OR                                         27340000
   FCODE = FC'RELEASE        OR                                         27345000
   FCODE = FC'RELEASE'DENIED OR                                         27350000
   FCODE = FC'SET'RELEASE    OR                                         27355000
   FCODE = FC'SET'ADDRESS    OR                                         27360000
   FCODE = FC'SPARE'BLOCK    OR                                         27365000
   FCODE = FC'DEVICE'CLEAR   OR                                         27370000
   FCODE = FC'CANCEL'TRAN    THEN                                       27375000
                                                                        27380000
   BEGIN                                                                27385000
                                       << Exit with a good transfer >>  27390000
   IOQ'STAT     := GOOD'IO;                                             27395000
   IOQ'COUNT    := ZERO;                                                27400000
   DRIVER'STATE := REQUEST'COMPLETE;                                    27405000
                                                                        27410000
   RETURN;                                                              27415000
   END  << Of "if FCODE = FC'INIT'SELFTEST ..." >>                      27420000
ELSE                                                                    27425000
   BEGIN                                                                27430000
                                       << Exit with a good transfer >>  27435000
   IOQ'STAT     := GOOD'IO;                                             27440000
   UPDATE'XFER'CNT;                                                     27445000
   DRIVER'STATE := REQUEST'COMPLETE;                                    27450000
                                                                        27455000
   RETURN;                                                              27460000
   END; << Of else "if FCODE = FC'INIT'SELFTEST ..." >>                 27465000
                                                                        27470000
END; << Of the CS'80 disc driver >>                                     27475000
$PAGE                                                                   27480000
ASSEMBLE(                                                               27485000
   PCAL SIODM;          << Monitor               >>                     27490000
   PCAL BUFFALO'DRIVER; << Initiator             >>                     27495000
   PCAL BUFFALO'DRIVER; << Completor             >>                     27500000
   CON  ZERO;           << No I/O process        >>                     27505000
   PCAL BUFFALO'INIT;   << Initialization        >>                     27510000
   CON  ONE;            << One interrupt handler >>                     27515000
   PCAL GIP'HPIB);      << Interrupt handler     >>                     27520000
END.                                                                    27525000
