$CONTROL MAP,CODE,USLINIT                                               00010000
<<hiomdsc2 - module 43>>                                                00015000
<< hp32002c mpe source c.00.00 >>                                       00020000
<< COPYRIGHT     "(C) COPYRIGHT HEWLETT-PACKARD CO. 1980.           >>  00025000
<<     this program may be used with one computer system at a       >>  00030000
<<     time and shall not otherwise be recorded, transmitted or     >>  00035000
<<     stored in a retrieval system.  copying or other reproduction >>  00040000
<<     of this program except for archival purposes is prohibited   >>  00045000
<<     without the prior written consent of hewlett-packard company.>>  00050000
<< **** note - dollar copyright cannot be used with this module *** >>  00055000
                                                               <<04702>>00060000
$control privileged,uncallable                                          00065000
$title "CS'80 DISC DRIVER - HPIB"                                       00070000
$tp                                                                     00075000
<<                                                                      00080000
                                                                        00085000
                                                                        00090000
        cs'80 disc driver 3000 series - hiomdsc2                        00095000
        ----------------------------------------                        00100000
                                                                        00105000
                                                                        00110000
structure of hiomdsc2:                                                  00115000
                                                                        00120000
hiomdsc2, together with the sio device monitor (siodm) constitute a     00125000
standard mpe type 1 i/o driver/monitor.  this means that it does not    00130000
run in its own process, but executes on any stack and therefore must    00135000
run to completion.  during initialization it executes on progen's       00140000
stack, during request initiation it executes on attachio's stack, and   00145000
during interrupt processing it executes on the interrupt control        00150000
stack (ics).                                                            00155000
                                                                        00160000
HIOMDSC2 consists of a global area, two procedures, and an "outer       00165000
block" which is really a linkage area for INITIAL.  The global area     00170000
contains an array called initial which is comprised of three parts.     00175000
the first part specifies the size of the other two, the unit extract    00180000
instruction, and various parameters which are used by initial.  this    00185000
section is deleted after initial is through with it.  the other two     00190000
parts are the device information table (dit) and the channel program    00195000
area, which is part of the interrupt linkage table (ilt).  initial      00200000
will put each of these items in the area of memory where it belongs.    00205000
the linkage area specifies the procedure labels (p-labels) of the       00210000
associated monitor (siodm), the request initiator (csdrvr), the         00215000
request completor (csdrvr), the initialization procedure (csinit,       00220000
called by progen at system startup), and the interrupt handler (gip).   00225000
                                                                        00230000
                                                                        00235000
operation of hiomdsc2:                                                  00240000
                                                                        00245000
the primary working code of hiomdsc2 is a procedure csdrvr.  csdrvr     00250000
is called with six parameters.   two of these parameters, bank and      00255000
buffaddr, are the absolute buffer address of the data to be processed.  00260000
the other three, ditp, ioqp, and siop are pointers to three arrays.     00265000
ditp is a pointer to the device information table which contains        00270000
information about its associated disc drive.  there is one dit for      00275000
each unit on the controller and they contain information which must     00280000
be saved between i/o requests to the driver.  ioqp is a pointer to the  00285000
input/output table which contains information relevent to the current   00290000
request.  siop is a pointer to the first element of the channel pro-    00295000
gram which is actually part of the interrupt linkage table.  the last   00300000
parameter drtn is the device reference table (drt) number of the        00305000
device.  these three elements are described in more detail elsewhere    00310000
in this listing.                                                        00315000
                                                                        00320000
csdrvr is always called by the sio device monitor (siodm) and it        00325000
determines the reason for the call by examining the ioq and the dit.    00330000
when a new request is initiated, csdrvr examines the function code      00335000
and parameter fields contained in the ioq element to determine the      00340000
task that is desired.  the proper command data bytes are then placed    00345000
in the command data buffer and the proper command codes and program     00350000
branches are set up in the channel program and execution is begun.      00355000
                                                                        00360000
upon completion of the request, an interrupt is generated and csdrvr    00365000
is again called.  the code checks for current activity in progress,     00370000
and this being the case, branches to the completion section of the      00375000
driver.  here if necessary, the status words are examined for errors    00380000
and special conditions which might have occurred during the execu-      00385000
tion of the channel program, during the data transfer, or during the    00390000
operation of the disc drive.  these conditions can report special       00395000
notation back to the caller.  a list of the conditions and return       00400000
codes is provided in this listing.                                      00405000
$page                                                                   00410000
                device information table (dit)                          00415000
                ------------------------------                          00420000
                                                                        00425000
                                                                        00430000
there is one dit per physical device. if a physical device represents   00435000
more than one logical device, the logical device number is obtained     00440000
from the ioq element.  for the cs'80 disc controller, there will only   00445000
be one device.  the following diagram shows the dit used by the cs'80   00450000
disc driver.                                                            00455000
                                                                        00460000
     0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15  mnemonic           00465000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    00470000
  0|tm|ds|ac|rq| 0| 0| 0|io|ia|no|st| 0|   state   | dflag              00475000
   +--+--+--+--+--+--+--+--+--+--+--+--+-----------+                    00480000
  1| sysdb relative pointer to the dit for the next| dlink              00485000
   | device requesting this resource or service    |                    00490000
   +-----------------------------------------------+                    00495000
  2| current request sysbase index                 | dcurreqp           00500000
   +-----+-----------------+-----------------------+                    00505000
  3| logical device number                         | dldev       mpev   00510000
   +-----+-----------------+-----------------------+                    00515000
  4| sysdb relative pointer to device linkage table| ddltp              00520000
   +-----------------------------------------------+                    00525000
  5| sysdb relative pointer to intrp linkage table | diltp              00530000
   +-----------------------------------------------+                    00535000
  6| dstat is -1 when a system powerfail occurred  | dstat              00540000
   +-----------------------------------------------+                    00545000
  7| hardware error status.  set when the driver   | dserr              00550000
   | detects an error.  whenever <>0, the driver   |                    00555000
   | monitor logs an i/o error and clears this word|                    00560000
   +-----------------------------------------------+                    00565000
%10| sysbase index of first request in queue       | dqhead *           00570000
   +-----------------------------------------------+                    00575000
%11| sysbase index of last request in queue        | dqtail *           00580000
   +--+--+-----------------------------+-----------+                    00585000
%12|iot  |    physical unit number                 | dunit       mpev   00590000
   +--+--+-----------------------------+-----------+                    00595000
%13| sysdb relative ptr to system buffer element   | dsbufaddr          00600000
   +-----------------------------------------------+                    00605000
%14| high order logical sector address of bad blk  | dbadblk1           00610000
   +-----------------------------------------------+                    00615000
%15| low order logical sector address of bad blk   | dbadblk2           00620000
   +-----------------------------------------------+                    00625000
%16| byte transfer left when bad block occurred    | dbadxfer           00630000
   +-----------------------------------------------+                    00635000
%17| hardware logged error status - cpva (0)       | dlogerror          00640000
   +-----------------------------------------------+                    00645000
%20| channel program aborted relative offset       | dsiopstop          00650000
   +-----------------------------------------------+                    00655000
%21| disc status (20 bytes)-logged on status error | dstatus            00660000
   +-----------------------------------------------+                    00665000
 . |                     .                         |                    00670000
   +-----------------------------------------------+                    00675000
 . |                     .                         |                    00680000
   +-----------------------------------------------+                    00685000
%32|                                               |                    00690000
   +-----------------------------------------------+                    00695000
%33|lk|if|md|                         | substate   | qmisc       mpev   00700000
   +--+--+--+--+-----------------------------------+                    00705000
%34|re|dc|ds|en|                       |local state| rpsword1           00710000
   +--+--+--+--+-----------------------+-----------+                    00715000
%35|          t1           |           t2          | rpsword2           00720000
   +-----------------------+-----------------------+                    00725000
                                                                        00730000
dflag - flags and request state                                         00735000
                                                                        00740000
  tm  term    - set if device is a terminal.                            00745000
  ds  disc    - if tm = 0 and this bit is set then the device is        00750000
                a disc, otherwise device dependent.                     00755000
  ac  active  - a monitor is currently servicing this device.           00760000
  rq  request - a service request is pending while the monitor is       00765000
                active.                                                 00770000
  io  ioprog  - an i/o channel program is running for this device.      00775000
  ia  iak     - an interrupt or response has occurred for this device.  00780000
  no  notrdy  - go to state %10 after idle channel program is started.  00785000
  st  stwait  - the device monitor is starting an idle channel program  00790000
                for this device.  there is no ioq associated with this  00795000
                type of request.                                        00800000
  state       - state of the device monitor.  specifies the next action 00805000
                to be taken in siodm in servicing the request:          00810000
                                                                        00815000
                  0 - start new request                                 00820000
                  1 - not used                                          00825000
                  2 - call driver initiator procedure                   00830000
                  3 - call driver completor procedure                   00835000
                  4 - not used                                          00840000
                  5 - process request completed                         00845000
                  6 - initiate device recognition sequence              00850000
                  7 - start operator intervention wait                  00855000
                %10 - wait for interrupt (operator intervention)        00860000
                      restart at state 0                                00865000
                %11 - wait for data segment freeze, then state 2        00870000
                %12 - wait for driver initiator to be frozen, then      00875000
                      allocate controller (state 2)                     00880000
                %13 - wait for i/o completion interrupt, then state 3   00885000
                %14 - wait for controller, then call driver initiator   00890000
                %15 - not used                                          00895000
                %16 - wait for initiator make present, then state 2     00900000
                %17 - wait for completor make present, then state 3     00905000
                                                                        00910000
dlink - a sysdb relative pointer to the next dit requesting this        00915000
        resource or service.                                            00920000
                                                                        00925000
dcurreqp - a current request sysbase index.                             00930000
                                                                        00935000
dldev - logical device number of this device.                    mpev   00940000
                                                                 mpev   00945000
dunit.(0:2) - i/o system type                                    mpev   00950000
                                                                        00955000
          0 - hp3000 series 2/3                                         00960000
          1 - hp3000 series 33 (hpib)                                   00965000
          2 - unused                                                    00970000
          3 - unused                                                    00975000
                                                                        00980000
dunit.(7:9) - unit number of this device. zero if a single unit. mpev   00985000
                                                                        00990000
                                                                 mpev   00995000
                                                                        01000000
dstat - set to a -1 when a system powerfail has occurred.               01005000
                                                                        01010000
dserr - pointer to status to be logged.                                 01015000
                                                                        01020000
        bits(0:7)  - number of words to be logged.                      01025000
        bits(8:15) - offset relative to ditp(0).                        01030000
                                                                        01035000
dmisc - device dependent processing flags                               01040000
                                                                        01045000
  lock'flg - lock flag denoting unload status of the disc volume.       01050000
                                                                        01055000
         0 - allow operator unload to the volume.                       01060000
         1 - deny operator unload to the volume.                        01065000
                                                                        01070000
  ignore'int'flg - ignore unexpected interrupt flag.                    01075000
                                                                        01080000
  substate - indicates state of the idle channel program:               01085000
                                                                        01090000
         0 - normal idle channel program wait                           01095000
         1 - idle request being serviced wait                           01100000
                                                                        01105000
dsbufaddr - sysdb relative pointer to the system buffer element         01110000
                                                                        01115000
            used to read the dsct. zero, if no element gotten.          01120000
                                                                        01125000
dbadblk1 - high order logical sector address of the bad block           01130000
           for the defective sector table (dsct) entry.                 01135000
                                                                        01140000
dbadblk2 - low order logical sector address of the bad block for        01145000
           the dsct entry.                                              01150000
                                                                        01155000
dbadxfer - byte transfer left when bad block occurred.                  01160000
                                                                        01165000
dlogerror - cpva(0) logged on hardware error status.                    01170000
                                                                        01175000
dsiopstop - stopped channel program relative offset location due        01180000
            to an error in cpva(0).                                     01185000
                                                                        01190000
dstatus - 20 bytes disc status logged on status error.                  01195000
rpsword1 - flages and local state                                       01200000
                                                                        01205000
  re - read revision code done                                          01210000
       set if read revision code level is done                          01215000
  dc - rps revision code                                                01220000
       set if controller is "PEP"ed                                     01225000
  dr - rps desirable                                                    01230000
       set if rps is desirable                                          01235000
  en - rps enabled                                                      01240000
       set if default value for rps is enabled                          01245000
  local state - state of the local request made by driver               01250000
                                                                        01255000
                0 - no local request is being procesed                  01260000
                1 - reading rev code                                    01265000
                2 - setting default rps                                 01270000
                                                                        01275000
rpsword2 - default value for rps                                        01280000
                                                                        01285000
  t1 - time to target in hundreds of microseconds                       01290000
  t2 - window size in hundreds of microseconds                          01295000
          (see cs'80 disc drive status).                                01300000
                                                                        01305000
                                                                        01310000
                                                                        01315000
caution:  * since the "C" mit, word %10 and %11 of the dit for          01320000
            disc devices have been used for dqhead and dqtail           01325000
            pointers for disc request queues. word %10 is also          01330000
            used by the timer procedure to hold a timer request         01335000
            index (dtrlx). unless word %10 of the dit is freed          01340000
            up in a future mit, timers cannot be implemented on         01345000
            any disc drivers.                                           01350000
                                                                        01355000
$page                                                                   01360000
            disc request queue element (ioq)                            01365000
            --------------------------------                            01370000
                                                                        01375000
                                                                        01380000
     0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   mnemonic          01385000
   +-----------------------------------------------+                    01390000
  0|      request dependent flags (see below)      |   qflag            01395000
   +-----------------------------------------------+                    01400000
  1|      request urgency class                    | qurgclass          01405000
   +-----------------------+-----------------------+                    01410000
  2| logical device number                         | qldev       mpev   01415000
   +-----+--+--+--+--+-----+--+--+--+--+-----------+                    01420000
  3|chanf|rs|op|im|sr|rtran|lf|sp|vf|  | waitcode  |   qmisc            01425000
   +-----+--+--+--+--+-----+--+--+--+--+-----------+                    01430000
  4| s|   dst   (if process disc i/o)              |   qdsctn           01435000
   |- - - - - - - - - - - - - - - - - - - - - - - -|                    01440000
   |      dst   (if segment transfer) [s=stack]    |                    01445000
   +--+--------------------------------------------+                    01450000
  5| offset in the data seg (if process disc i/o)  |   qaddr            01455000
   |- - - - - - - - - - - - - - - - - - - - - - - -|                    01460000
   | address in bank (if segment transfer)         |                    01465000
   +-----------------------+-----------------------+                    01470000
  6| unit number           | function code for     | qfunc       mpev   01475000
   |                       | this request.         |                    01480000
   +-----------------------+-----------------------+                    01485000
  7| on initiation, specifies the word count (>0)  |   qwbct            01490000
   | or byte count (<0).  at completion of the     |                    01495000
   | request this location contains the actual     |                    01500000
   | transmission count in the same units (bytes   |                    01505000
   | or words) as in the request.                  |                    01510000
   +-----------------------------------------------+                    01515000
%10| p1 - parameter 1 (usually high order of       |   qpar1            01520000
   | current logical disc address [clda1])         |                    01525000
   +-----------------------------------------------+                    01530000
%11| p2 - parameter 2 (usually low order of        |   qpar2            01535000
   | current logical disc address [clda2])         |                    01540000
   +-----------------------+--------------+--------+                    01545000
%12|                       |  qualifier   | status | qstat       mpev   01550000
   +-----------------------+--------------+--------+                    01555000
%13| pcb number                                    | qpcb        mpev   01560000
%13| sysbase relative indx of previous req in queue| qprevreqp          01565000
   +-----------------------------------------------+                    01570000
%14| sysbase relative indx of next req in queue    | qnextreqp          01575000
   +-----------------------------------------------+                    01580000
%15|        segidentifier (if segment transfer     | qsegident          01585000
   +-----------------------------------------------+                    01590000
%16| displacement of read or wrt from seg base (mm)| qsegdisp           01595000
   +-----------------------------------------------+                    01600000
%17|s |////////////////////////////////////////////|                    01605000
   |w |////////////////////////////////////////////|                    01610000
   |a |////////////////////////////////////////////|                    01615000
   |p |////////////////////////////////////////////|                    01620000
   +-----------------------------------------------+                    01625000
                                                                        01630000
qflag - request dependent flags                                         01635000
                                                                        01640000
  bit 0  abort     - request has been aborted externally.               01645000
  bit 1  mmreq     - request is for a segment transfer.                 01650000
  bit 2  diag      - this is a request from the diagnostic subsystem.   01655000
  bit 3  sbuf      - target is an index relative to the sbuf table of   01660000
                     the data buffer.                                   01665000
  bit 4  iowake    - wake caller on completion of request.              01670000
  bit 5  blocked   - blocked i/o.  the caller is waited in attachio     01675000
                     until the request is completed.  implies iowake.   01680000
  bit 6  completed - the request has been completed and the caller      01685000
                     awakened if he had requested (with iowake).        01690000
  bit 7  datafrzn  - data segment has been present and is frozen.       01695000
  bit 8  mamerrord - an error has occurred while mam was trying to      01700000
                     make the target data segment present and freeze    01705000
                     it in memory.                                      01710000
  bit 9  prequeued - request is queued into disc's request queue        01715000
  bit 10 sfail     - delayed failure of sio instruction.  if a call     01720000
                     to startio resulted in the request being added     01725000
                     to the channel queue, this bit indicates that      01730000
                     the sio instruction failed when the request was    01735000
                     selected for execution.                            01740000
  bit 11 pfail     - the request was aborted because of a system        01745000
                     power failure.                                     01750000
  bit 12 curreq    - request is device's current request.               01755000
  bit 13 disabled  - request is disabled.                               01760000
  bit 14 disatmpt  - attempt to disable this request.                   01765000
  bit 15 msgdone   - a message request reply has completed.             01770000
                                                                        01775000
qldev.qldevn - logical device number                                    01780000
                                                                        01785000
qmisc - driver request dependent flags and counters.                    01790000
                                                                        01795000
  chan'err'flg   - channel error retry flag.                            01800000
  rstat'fail'flg - request status failed flag.                          01805000
  oper'req'flg   - operator requested release flag.                     01810000
  im'fault'flg   - internal maintenance fault flag.                     01815000
  stat'rtry'flg  - status error single retry flag.                      01820000
  rtrans'flg     - retransmit required flag.                            01825000
  load'flg       - media load flag.                                     01830000
  sys'pfail'flg  - system powerfail flag.                               01835000
  ver'err'flg    - verify error flag.                                   01840000
                                                                        01845000
  waitcode       - indicates type of wait:                              01850000
                                                                        01855000
                   0 - new request                                      01860000
                   1 - completion wait                                  01865000
                   2 - not ready wait                                   01870000
                   3 - release/release deny wait                        01875000
                   4 - ioq defer wait                                   01880000
                   5 - dsct read wait                                   01885000
                   6 - dsct write wait                                  01890000
                   7 - synchronization wait                             01895000
                                                                        01900000
qdstn - if system buffer is clear then this is the dst                  01905000
        number of the target data segment. if bit 0 is                  01910000
        set then buffer address is a db offset value                    01915000
        instead of segment relative offset (implemented                 01920000
        for nowait i/o and nobuff).                                     01925000
                                                                        01930000
qaddr - offset in data segment or system buffer table to                01935000
        target data buffer.                                             01940000
                                                                        01945000
qfunc - function code and qualifiers as specified by                    01950000
        driver.                                                         01955000
                                                                        01960000
qstat - pcb number and request completion status.                       01965000
                                                                        01970000
  pcbn    - the process control block (pcb) number of the process       01975000
            which made this request.  if zero, the request is not       01980000
            associated with any process and the ioq element is to       01985000
            be returned by the system when the request has completed.   01990000
                                                                        01995000
  status  - general status indicating the final state of the request.   02000000
                                                                        02005000
            0 - not started or awaiting completion.                     02010000
            1 - successful completion.                                  02015000
            2 - end-of-file detected.                                   02020000
            3 - unusual, but recoverable, condition detected.           02025000
            4 - irrecoverable error has occurred.                       02030000
                                                                        02035000
  qualifier - a code which further defines or qualifies the general     02040000
              status.  (see the section driver return status codes.)    02045000
$page                                                                   02050000
                interrupt linkage table (ilt)                           02055000
                -----------------------------                           02060000
                                                                        02065000
                                                                        02070000
there is one ilt for each device controller configured on the system.   02075000
a controller may support more than one unit, however the cs'80 disc     02080000
driver will only concern itself with the single unit controller.        02085000
                                                                        02090000
     0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   mnemonic          02095000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    02100000
  0|         channel                               |   icpva0           02105000
  1|              program                          |   icpva1           02110000
  2|                  variable                     |   icpva2           02115000
  3|                       area (icpva)            |   icpva3           02120000
   +-----------------------------------------------+                    02125000
  4|         dma abort                             |   icpva4           02130000
  5|              address                          |   icpva5           02135000
   +-----------------------------------------------+                    02140000
  6|                      0                        |   isrql            02145000
   +--+-----------------+-----+-----------+--------+                    02150000
  7|li|     chanque     |     |   chan    |  dev   |   icntrl           02155000
   +--+-----------------+-----+-----------+--------+                    02160000
%10| sysdb relative pointer to channel program area|   isiop            02165000
   +-----------------------------------------------+                    02170000
%11| sysdb relative pointer to idle status area    |   istap            02175000
   +-----------------------------------------------+                    02180000
%12| single instruction that is executed to extract|   iunit            02185000
   | the device unit number from the status pointed|                    02190000
   | to by istap. [since only unit 0 exists on the |                    02195000
   | cs'80 discs, andi 0 is used to return unit 0] |                    02200000
   +-----------------------------------------------+                    02205000
%13| sysdb relative dit pointer of the device      |   icdp             02210000
   | currently using the channel to perform a      |                    02215000
   | data operation.                               |                    02220000
   +-----------------------+-----------------------+                    02225000
%14|       siopsize        |        cquen          |   iqueue           02230000
   +--+--+--+--------------+-----------+-----------+                    02235000
%15|rw|wp|ig|                          |  hcunit   |   iflag            02240000
   +--+--+--+--------------------------+-----------+                    02245000
%16| sysdb relative dit pointer for unit 0         |   iditp0           02250000
   +-----------------------------------------------+                    02255000
%17| 20 bytes status area for idle channel program |   istat            02260000
   +-----------------------------------------------+                    02265000
 . |                    .                          |                    02270000
   +-----------------------------------------------+                    02275000
 . |                    .                          |                    02280000
   +-----------------------------------------------+                    02285000
%31|             cs'80 discs                       |                    02290000
   .               channel                         .                    02295000
   |               program                         |                    02300000
   +-----------------------------------------------+                    02305000
                                                                        02310000
                                                                        02315000
icpva0 - channel program variable area                                  02320000
                                                                        02325000
  the first word is used by the channel program processor to store      02330000
  status information after i/o channel aborts.  the next word is used   02335000
  by the driver to indicate if status should be examined for special    02340000
  conditions or errors.  the other two words are not used.              02345000
                                                                        02350000
                                                                        02355000
icpva4 - dma abort address                                              02360000
                                                                        02365000
  if a dma abort occurs, the absolute address where the abort occurred  02370000
  is stored in this area.                                               02375000
                                                                        02380000
                                                                        02385000
icntrl - contains controller information                                02390000
                                                                        02395000
  lim     - if this bit is set, the controller is sharing a software    02400000
            channel resource in order to limit bandwidth.               02405000
  chanque - the software channel resource number.                       02410000
  chan    - channel number (four most significant bits of drtn).        02415000
  dev     - device number (three least significant bits of drtn).       02420000
                                                                        02425000
                                                                        02430000
iqueue -                                                                02435000
                                                                        02440000
  siopsize - (number of words + 1)/2 in the channel program area.       02445000
  cquen    - for a multi-unit controller this field contains the        02450000
             software controller resource number.                       02455000
                                                                        02460000
                                                                        02465000
iflag - controller and channel program state flags                      02470000
                                                                        02475000
  runwait  - an idle channel program should be started when there       02480000
             are no active requests to process.                         02485000
  waitprog - an idle channel program has been started for this          02490000
             controller.  this bit is reset by an interrupt.            02495000
  ignorehi - an hiop instruction has been issued against this con-      02500000
             troller but the channel program was not in a wait          02505000
             statement.  therefore ignore the interrupt generated by    02510000
             the channel code when this program halts.                  02515000
  hcunit   - highest configured unit number for this controller.        02520000
                                                                        02525000
istat - 20 bytes of status from the idle channel program.               02530000
                                                                        02535000
                                                                        02540000
            device reference table drt                                  02545000
            --------------------------                                  02550000
                                                                        02555000
there is one drt per device controller.  the contents of this           02560000
table are used for processing interrupts.                               02565000
                                                                        02570000
     word 0  siop   - absolute address of the current i/o               02575000
                      instruction in execution.                         02580000
     word 1  dbi    - absolute address of the base of the ilt           02585000
                      for this controller.                              02590000
     word 2  plabel - the external program label of the interrupt       02595000
                      service routine for this controller.              02600000
     word 3  chan   - contains channel program status information       02605000
                      which is used by the channel program interpreter. 02610000
$page                                                                   02615000
         cs'80 disc driver request codes                                02620000
         -------------------------------                                02625000
                                                                        02630000
operation            function    parameters                             02635000
---------            --------    ----------                             02640000
                                                                        02645000
 read                     0      read data record                       02650000
                                                                        02655000
                                 count - transfer count                 02660000
                                                                        02665000
                                 bank & buffaddr contains               02670000
                                 data read.                             02675000
                                                                        02680000
                                 p1,p2 - dbl wrd logical                02685000
                                         sector address                 02690000
                                                                        02695000
 write                    1      write data record                      02700000
                                                                        02705000
                                 count - transfer count                 02710000
                                                                        02715000
                                 bank & buffaddr contains               02720000
                                 data for write.                        02725000
                                                                        02730000
                                 p1,p2 - dbl wrd logical                02735000
                                         sector address                 02740000
                                                                        02745000
 file open                2      no action taken                        02750000
                                                                        02755000
 file close               3      no action taken                        02760000
                                                                        02765000
 device close             4      no action taken                        02770000
                                                                        02775000
 fill with zeros          5      fill specified logical                 02780000
                                 sector address with zeros.             02785000
                                                                        02790000
                                 count - transfer count                 02795000
                                                                        02800000
                                 p1,p2 - dbl wrd logical                02805000
                                         sector address                 02810000
                                                                        02815000
 fill with blanks         6      fill specified logical                 02820000
                                 sector address with blanks.            02825000
                                                                        02830000
                                 count - transfer count                 02835000
                                                                        02840000
                                 p1,p2 - dbl wrd logical                02845000
                                         sector address                 02850000
                                                                        02855000
 request status           7      request disc status                    02860000
                                                                        02865000
                                 count - transfer count                 02870000
                                         (max 20 bytes)                 02875000
                                                                        02880000
                                 bank & buffaddr returns                02885000
                                 the status.                            02890000
                                                                        02895000
 initialize media         8      initialize disc media                  02900000
                                                                        02905000
                                 p1 - initialize options                02910000
                                      [0=retain factory,                02915000
                                         field spares]                  02920000
                                      [1=retain factory                 02925000
                                         spares only]                   02930000
                                 p2 - block interleave                  02935000
                                      byte (binary number)              02940000
                                                                        02945000
 write disc label        11      write label to sector 0.               02950000
                                                                        02955000
                                 count - label count                    02960000
                                                                        02965000
                                 bank & buffaddr contains               02970000
                                 label info. to be written.             02975000
                                                                        02980000
                                 p1,p2 - dbl wrd logical                02985000
                                         sector address.                02990000
                                                                        02995000
 request volume limit    13      return max volume address.             03000000
                                                                        03005000
                                 bank & buffaddr returns                03010000
                                 dbl wrd of logical sector              03015000
                                 address or cylinder,head/              03020000
                                 sector address of the                  03025000
                                 maximum volume limit.                  03030000
                                                                        03035000
                                 p1 - 0 return the single               03040000
                                        vector address                  03045000
                                                                        03050000
                                    - 1 return the three                03055000
                                        vector address                  03060000
                                                                        03065000
 verify                  14      verify disc media                      03070000
                                                                        03075000
                                 count - verify length                  03080000
                                 count - 0 verify entire                03085000
                                           disc                         03090000
                                                                        03095000
                                 bank & buffaddr returns                03100000
                                 dbl wrd logical sector                 03105000
                                 address of 1st bad sector              03110000
                                 encountered (on error).                03115000
                                                                        03120000
                                 p1,p2 - dbl wrd logical                03125000
                                         sector address                 03130000
                                         to begin doing                 03135000
                                         verification.                  03140000
                                                                        03145000
request status           15      request disc status                    03150000
                                 (see function code 7)                  03155000
                                                                        03160000
lock                     16      lock private volume,                   03165000
                                 serial & foreign disc                  03170000
                                 disabling the unload                   03175000
                                 capability.                            03180000
                                                                        03185000
unlock                   17      unlock private volume,                 03190000
                                 serial & foreign disc                  03195000
                                 enabling the unload                    03200000
                                 capability.                            03205000
                                                                        03210000
read lock bit            18      bank & buffaddr contains               03215000
                                 lock bit returned.                     03220000
                                                                        03225000
                                 0 - volume was unlocked.               03230000
                                 1 - volume was lock.                   03235000
                                                                        03240000
                                                                        03245000
                                                                        03250000
[                                   ]                                   03255000
[ note:  count = (+) denotes #words ]                                   03260000
[              = (-) denotes #bytes ]                                   03265000
[                                   ]                                   03270000
$page                                                                   03275000
         cs'80 disc driver diagnostics request codes*                   03280000
         --------------------------------------------                   03285000
                                                                        03290000
operation            function    parameters                             03295000
---------            --------    ----------                             03300000
                                                                        03305000
identify                 72      bank & buffaddr contains               03310000
                                 device id returned.                    03315000
                                                                        03320000
initiate diagnostic      73      init internal diagnostic               03325000
(selftest initiate)                                                     03330000
                                 p1 - 2 bytes loop count                03335000
                                      (#times to do diag)               03340000
                                 p2 - diagnostic section#               03345000
                                                                        03350000
diagnostic result        74      [a request status will                 03355000
(selftest result)                return the diagnostic                  03360000
                                 result should the diag-                03365000
                                 nostic fail].                          03370000
                                                                        03375000
loopback write           75      count - transfer count                 03380000
                                                                        03385000
                                 bank & buffaddr contains               03390000
                                 loopback data for write.               03395000
                                 data sequence must begin               03400000
                                 with a hex ff and each                 03405000
                                 byte which follows must                03410000
                                 equals its predecessor+1               03415000
                                                                        03420000
loopback read            76      count - transfer count                 03425000
                                                                        03430000
                                 bank & buffaddr contains               03435000
                                 loopback data read.                    03440000
                                                                        03445000
general purpose cmd      77      count - #command bytes                 03450000
                                                                        03455000
                                 bank & buffaddr contains               03460000
                                 the command data bytes to              03465000
                                 be sent thru the command               03470000
                                 and reporting msg phase.               03475000
                                                                        03480000
describe                 78      count - describe length                03485000
                                                                        03490000
                                 bank & buffaddr returns                03495000
                                 with the describe data.                03500000
                                                                        03505000
release                  79      release disc                           03510000
                                                                        03515000
release denied           80      prohibits disc release                 03520000
                                                                        03525000
set release              81      set disc release                       03530000
                                                                        03535000
                                 p1 - 1 suppress release                03540000
                                        timeout [t bit=1]               03545000
                                 p2 - 1 release automatically           03550000
                                        during idle time                03555000
                                        [z bit=1]                       03560000
                                                                        03565000
set address              82      bank & buffaddr contains               03570000
                                 dbl wrd of logical sector              03575000
                                 address or cylinder,head/              03580000
                                 sector address.                        03585000
                                                                        03590000
                                 p1 - 0 address is a single             03595000
                                        vector address                  03600000
                                                                        03605000
                                 p1 - 1 address is a three              03610000
                                        vector address                  03615000
                                                                        03620000
set block displacement   83      block offset added to the              03625000
                                 the current address.                   03630000
                                                                        03635000
                                 p1,p2 - dbl wrd logical                03640000
                                         sector address.                03645000
                                                                        03650000
set mask status          84      bank & buffaddr contains               03655000
                                 8 bytes of bit positions               03660000
                                 corresponding to status                03665000
                                 error bits.                            03670000
                                                                        03675000
set ret addressing mode  85      p1 - 0 single vector mode              03680000
                                    - 1 three vector mode               03685000
                                                                        03690000
set retry time           86      set disc retry time                    03695000
                                                                        03700000
                                 p1 - time in 10's of msecs.            03705000
                                      [0 denotes no retries]            03710000
                                                                        03715000
set rps                  87      set rotational position                03720000
                                 sensing                                03725000
                                                                        03730000
                                 p1 - time to target in 100's           03735000
                                      of microseconds                   03740000
                                 p2 - window size in 100's              03745000
                                      of microseconds                   03750000
                                                                        03755000
spare block              88      spare a block                          03760000
                                                                        03765000
                                 bank & buffaddr contains               03770000
                                 dbl wrd of logical sector              03775000
                                 address or cylinder,head/              03780000
                                 sector address of the                  03785000
                                 block to be spared.                    03790000
                                                                        03795000
                                 p1 - 0 address is single               03800000
                                        vector                          03805000
                                    - 1 address is three                03810000
                                        vector                          03815000
                                                                        03820000
                                 p2 - 0 spare retaining                 03825000
                                        data without                    03830000
                                        target sector                   03835000
                                    - 1 spare without                   03840000
                                        retaining data                  03845000
                                    - 4 spare retaining                 03850000
                                        data with target                03855000
                                        sector                          03860000
                                                                        03865000
read with 3-vector addr  89      read record at the three               03870000
                                 vector disc address.                   03875000
                                                                        03880000
                                 count - transfer count                 03885000
                                                                        03890000
                                 bank & buffaddr contains               03895000
                                 the data read.                         03900000
                                                                        03905000
                                 p1 - cylinder address                  03910000
                                 p2 - head/sector address               03915000
                                                                        03920000
write with 3-vector addr 90      write record at the three              03925000
                                 vector disc address.                   03930000
                                                                        03935000
                                 count - transfer count                 03940000
                                                                        03945000
                                 bank & buffaddr contains the           03950000
                                 data to be written.                    03955000
                                                                        03960000
                                 p1 - cylinder address                  03965000
                                 p2 - head/sector address               03970000
                                                                        03975000
initiate utility         91     ----------------------------            03980000
                                |case 1: no exec message   |            03985000
                                |                          |            03990000
                                |count - not applicable    |            03995000
                                |bank & buffaddr contains: |            04000000
                                |                          |            04005000
                                |word   0: util byte cnt[n]|            04010000
                                |word 1-n: util parm bytes |            04015000
                                |          if byte cnt <> 0|            04020000
                                |                          |            04025000
                                |p1 - 0 no exec message    |            04030000
                                ----------------------------            04035000
                                                                        04040000
                                ----------------------------            04045000
                                |case 2: send exec message |            04050000
                                |                          |            04055000
                                |count - exec msg length   |            04060000
                                |bank & buffaddr contains: |            04065000
                                |                          |            04070000
                                |word 0-count: utility data|            04075000
                                |       bytes to be sent to|            04080000
                                |       the device.        |            04085000
                                |                          |            04090000
                                |p1 - 1 send exec message  |            04095000
                                ----------------------------            04100000
                                                                        04105000
                                ----------------------------            04110000
                                |case 3: rcv exec message  |            04115000
                                |                          |            04120000
                                |count - exec msg length   |            04125000
                                |bank & buffaddr contains: |            04130000
                                |                          |            04135000
                                |word   0: util byte cnt[n]|            04140000
                                |word 1-n: util parm bytes |            04145000
                                |          if byte cnt <> 0|            04150000
                                |                          |            04155000
                                |bank & buffaddr+10 return:|            04160000
                                |                          |            04165000
                                |word 0-n: util data infor.|            04170000
                                |          (optional)      |            04175000
                                |                          |            04180000
                                |p1 - 2 rcv exec message   |            04185000
                                ----------------------------            04190000
                                                                        04195000
                                ----------------------------            04200000
                                |for all cases]            |            04205000
                                |                          |            04210000
                                |p1 - exec msg qualifier   |            04215000
                                |p2 - utility number       |            04220000
                                ----------------------------            04225000
                                                                        04230000
device clear             92      clear device/enable parity             04235000
                                                                        04240000
cancel                   93      terminate transaction                  04245000
                                                                        04250000
parity checking          94      hpib parity checking                   04255000
                                                                        04260000
                                 p1 - 0 disables checking               04265000
                                    - 1 enables checking                04270000
                                                                        04275000
                                                                        04280000
                                                                        04285000
[                                   ]                                   04290000
[ note:  count = (+) denotes #words ]                                   04295000
[              = (-) denotes #bytes ]                                   04300000
[                                   ]                                   04305000
                                                                        04310000
                                                                        04315000
                                                                        04320000
*diagnostic function:  these functions will be primarily used           04325000
                       by the mpe online diagnostic package.            04330000
                       the diagnostic request bit in the first          04335000
                       word (qflag) of the disc request queue           04340000
                       should be set to allow the diagnostic            04345000
                       caller to handle its own status. other-          04350000
                       wise the driver will assume that it had          04355000
                       been called by an mpe os module and will         04360000
                       provide for status handling and error            04365000
                       logging to take place.                           04370000
$page                                                                   04375000
                                                                        04380000
cs'80 disc drive status                                                 04385000
-----------------------                                                 04390000
                                                                        04395000
byte      structure       field                                         04400000
----      ---------       -----                                         04405000
                                                                        04410000
0         vvvvuuuu        id (vvvv=volume, uuuu=unit  )                 04415000
1         ssssssss        id (s=unit requiring service)                 04420000
                             (         0 - unit 0     )                 04425000
                             (17 (octal) - ctrl unit  )                 04430000
                             (   all 1's - no unit    )                 04435000
2-3       rrrrrrrr        reject error                                  04440000
4-5       ffffffff        fault error                                   04445000
6-7       aaaaaaaa        access error                                  04450000
8-9       iiiiiiii        information error                             04455000
                                                                        04460000
p1-p10    pppppppp        ten parameter associated bytes                04465000
                                                                        04470000
reject errors field       bits  0-15   00a00bcd efg0h000                04475000
fault errors field        bits 16-31   0a0b00c0 d0efg0hi                04480000
access errors field       bits 32-47   abcdef00 gh0ij000                04485000
information errors field  bits 48-63   abcde00f 0ghi0j00                04490000
                                                                        04495000
                                                                        04500000
bit pos.  bit no.  usage   [reject errors field]                        04505000
--------  -------  -----                                                04510000
                                                                        04515000
   a           2   channel parity error                                 04520000
   b           5   illegal opcode                                       04525000
   c           6   module addressing error                              04530000
   d           7   address bounds error                                 04535000
   e           8   parameter bounds error                               04540000
   f           9   illegal parameter                                    04545000
   g          10   message sequence violation                           04550000
   h          12   message length difference                            04555000
                                                                        04560000
                                                                        04565000
bit pos.  bit no.  usage   [fault errors field]                         04570000
--------  -------  -----                                                04575000
                                                                        04580000
   a          17   cross-unit (linus)                                   04585000
   b          19   controller fault                                     04590000
   c          22   unit fault                                           04595000
   d          24   diagnostic result failed                             04600000
                   (p1-p6 = 6 bytes result)                             04605000
   e          26   release required for operator request                04610000
                   (load/unload)                                        04615000
                   [not set for cs'80 discs]                            04620000
   f          27   release required for diagnostic request              04625000
                   (hio, selftest)                                      04630000
                   [not set for cs'80 discs]                            04635000
   g          28   release required for internal maintenance            04640000
                   (head alignment, error log)                          04645000
   h          30   power fail                                           04650000
   i          31   retransmit/release completed                         04655000
                                                                        04660000
                                                                        04665000
bit pos.  bit no.  usage   [access errors field]                        04670000
--------  -------  -----                                                04675000
                                                                        04680000
   a          32   illegal parallel operation (not implemented)         04685000
   b          33   uninitialized media                                  04690000
   c          34   no spares available                                  04695000
   d          35   not ready                                            04700000
   e          36   write protect (linus)                                04705000
   f          37   no data found (linus)                                04710000
   g          40   unrecoverable data overflow                          04715000
   h          41   unrecoverable data                                   04720000
                   (p1-p6  = 6 bytes of bad block address)              04725000
   i          43   end of file (linus)                                  04730000
   j          44   end of volume                                        04735000
                                                                        04740000
                                                                        04745000
bit pos.  bit no.  usage   [information errors field]                   04750000
--------  -------  -----                                                04755000
                                                                        04760000
   a          48   release request for operator request                 04765000
                   (load/unload)                                        04770000
   b          49   release request for diagnostic request               04775000
                   (hio, selftest)                                      04780000
   c          50   release request for internal maintenance             04785000
                   (head alignment, error log)                          04790000
   d          51   media wearing                                        04795000
   e          52   data overrun                                         04800000
   f          55   auto-sparing invoked (linus)                         04805000
   g          57   recoverable data overflow                            04810000
   h          58   marginal data                                        04815000
                   (p1-p6  = 6 bytes of marginal block address)         04820000
   i          59   recoverable data                                     04825000
                   (p1-p6  = 6 bytes of recoverable block address)      04830000
   j          61   maintenance track overflow                           04835000
                                                                        04840000
                                                                        04845000
parameter usage:                                                        04850000
----------------                                                        04855000
                                                                        04860000
byte -->              |  1  2  3  4  5  6       7   8   9   10     |    04865000
                                                                        04870000
no error              | new target address |                       |    04875000
diagnostic result (24)| diagnostic results |  device fault log --  |    04880000
unrecoverable data(41)| address of block   |  except after a spare |    04885000
marginal data     (58)| address of block   |  indicate length of   |    04890000
recoverable data  (59)| address of block   |  unrecoverable field  |    04895000
                                                                        04900000
* special note:  drive status are not pertinent unless a qstat 1        04905000
                 occurred prior to taking status.  driver will          04910000
                 often do a loc & wrt with zero length to force         04915000
                 the "Not Ready" condition to appear in status.         04920000
$page                                                                   04925000
                  disc release considerations                           04930000
                  ---------------------------                           04935000
                                                                        04940000
                                                                        04945000
 a.  system disc:                                                       04950000
                                                                        04955000
     - release will always be granted for internal maintenance          04960000
       requests (head alignment, error log).                            04965000
                                                                        04970000
     - release will always be denied for operator (load/unload)         04975000
       and diagnostic (hio, selftest) requests. formal shutdown         04980000
       procedures are required prior to servicing these requests.       04985000
                                                                        04990000
 b.  private volumes, serial & foreign discs:                           04995000
                                                                        05000000
     - release will always be granted for internal maintenance          05005000
       requests (head alignment, error log).                            05010000
                                                                        05015000
     - release will always be denied for diagnostic requests            05020000
       (hio, selftest). release will be denied for operator             05025000
       (load/unload) request when the disc is in a locked               05030000
       state and granted when the disc is in an unlocked state.         05035000
                                                                        05040000
                                                                        05045000
 note 1:  the hp7911/12 will be supported only as a system              05050000
          disc. it will not be supported as a private volume,           05055000
          serial or foreign disc. the hp7911/12 will not have           05060000
          the operator request (load/unload) and hio capabilities.      05065000
                                                                        05070000
 note 2:  on a status return, under the fault error field, the          05075000
          internal maintenance status should be the only status         05080000
          generating a release required. operator and diagnostic        05085000
          nostic requests generating a release required should          05090000
          never occur and such occurrences will be flagged as           05095000
          errors.                                                       05100000
                                                                        05105000
 note 3:  prior to the abi chip release, an unsolicit reporting         05110000
          message can cause the next transaction to fail due            05115000
          to a parallel poll being generated by the unsolicit           05120000
          reporting message and the next transaction being pro-         05125000
          cessed with the wrong poll. the firmware will handle          05130000
          this by setting the retransmit/release completed bit          05135000
          in the status field, thus resulting in a request retry        05140000
          in the driver. since the driver does not ever use the         05145000
          auto-release option for release requests, the release         05150000
          completed status definition is not applicable to the          05155000
          driver.                                                       05160000
$page                                                                   05165000
                  disc lock & unlock considerations                     05170000
                  ---------------------------------                     05175000
                                                                        05180000
                                                                        05185000
     the driver maintains a lock/unlock bit in the dit which            05190000
     is set or cleared when various mpe modules call the driver         05195000
     lock and unlock function code. operator request to unload          05200000
     the volume mounted will be denied when the lock bit is set         05205000
     and allowed only when the lock bit is cleared.                     05210000
                                                                        05215000
 a.  system disc:                                                       05220000
                                                                        05225000
   - driver initialization section will lock a system disc.             05230000
     a system disc can only be unloaded after a formal                  05235000
     shutdown.                                                          05240000
                                                                        05245000
 b.  private volumes:                                                   05250000
                                                                        05255000
   - these are locked by the pvsys module at the first logical          05260000
     mount and are unlocked at the last logical dismount.               05265000
                                                                        05270000
 c.  serial & foreign discs:                                            05275000
                                                                        05280000
   - these are locked for each fopen to the file and unlocked           05285000
     after each dclose to the file.                                     05290000
                                                                        05295000
                                                                        05300000
 note:  pvproc will lock all non-system discs while processing          05305000
        any unexpected interrupts passed to it by devrec.               05310000
$page                                                                   05315000
                  dsct entry considerations                             05320000
                  -------------------------                             05325000
                                                                        05330000
                                                                        05335000
 a.  entries (logical sector address of bad sectors) will be            05340000
     be made in the defective sector table (dsct) for the               05345000
     following conditions:                                              05350000
                                                                        05355000
   - marginal data                                                      05360000
   - unrecoverable data                                                 05365000
   - unrecoverable data overflow                                        05370000
                                                                        05375000
     the driver will also log these status in the i/o error             05380000
     log file and return a track/sector error status.                   05385000
                                                                        05390000
 b.  the driver will log the following conditions in the i/o            05395000
     error log file but will not make any entry into the dsct           05400000
     of return a bad status to the system.                              05405000
                                                                        05410000
   - recoverable data                                                   05415000
   - recoverable data overflow                                          05420000
                                                                        05425000
 note 1:  dynamic sparing is not done in the driver since an            05430000
          unsuccessful spare may require a whole track to be            05435000
          deleted, possibly resulting in lost files.                    05440000
                                                                        05445000
 note 2:  marginal data error denotes that the data sector is           05450000
          rapidly deterioriating.                                       05455000
                                                                        05460000
          recoverable data/recoverable data overflow error can          05465000
          result from noise possibly due to bad power.                  05470000
                                                                        05475000
 note 3:  under normal conditions, the frequency of marginal            05480000
          and recoverable data is one every 3-6 months. the             05485000
          frequency for unrecoverable data is one every year.           05490000
                                                                        05495000
 c.  on reboot, initial will attempt once more to read the              05500000
     unrecoverable data entry with maximum retries. if the              05505000
     read fails, initial will spare the bad sector. if the              05510000
     read is successful, initial will run some error rate               05515000
     tests on the bad area. from these results, initial will            05520000
     determine whether the sector needs to be spared or not.            05525000
     in both cases, the entry will be removed from the dsct.            05530000
$page                                                                   05535000
                  defective sector table                                05540000
                  ----------------------                                05545000
                                                                        05550000
          to reside on sector 1 of the disc:                            05555000
                                                                        05560000
       -----------------------------------------------                  05565000
     0 |  number of entries in the table             |                  05570000
       -----------------------------------------------                  05575000
     1 |  index to the first entry  (6)              |                  05580000
       -----------------------------------------------                  05585000
     2 |  entry size  (2)                            |                  05590000
       -----------------------------------------------                  05595000
     3 |  maximum number of entries  (61)            |                  05600000
       -----------------------------------------------                  05605000
     4 |             (not used)                      |                  05610000
       -----------------------------------------------                  05615000
     5 |             (not used)                      |                  05620000
       -----------------------------------------------                  05625000
     6 |  first defective sector entry               |                  05630000
       | [doubleword logical sector address]         |                  05635000
       -----------------------------------------------                  05640000
     8 |                  .                          |                  05645000
       |                                             |                  05650000
       -----------------------------------------------                  05655000
    10 |                  .                          |                  05660000
       |                                             |                  05665000
       -----------------------------------------------                  05670000
    12 |                  .                          |                  05675000
       |                                             |                  05680000
       -----------------------------------------------                  05685000
    .  |                  .                          |                  05690000
       |                                             |                  05695000
       -----------------------------------------------                  05700000
    .  |                  .                          |                  05705000
       |                                             |                  05710000
       -----------------------------------------------                  05715000
    .  |                  .                          |                  05720000
       |                                             |                  05725000
       -----------------------------------------------                  05730000
   126 |  maximum defective sector entry             |                  05735000
       |                                             |                  05740000
       -----------------------------------------------                  05745000
                                                                        05750000
                                                                        05755000
    note:  the dsct exists for system discs, private volumes            05760000
           and serial discs. it does not exist for foreign              05765000
           discs. although there is a dsct on a serial disc,            05770000
           the serial disc interface and the vinit program              05775000
           neither reference this table nor empties it. its             05780000
           only use is during a serial disc conversion to a             05785000
           private volume under vinit, it aids in identifying           05790000
           already existing suspect entries.                            05795000
$page                                                                   05800000
                  logging considerations                                05805000
                  ----------------------                                05810000
                                                                        05815000
                                                                        05820000
 a.  cpva(0) along with the channel program aborted relative            05825000
     offset is logged for the following reasons:                        05830000
                                                                        05835000
     1)  dma abort - dma transfer aborted by memory errors.             05840000
     2)  channel program execution error - an error is                  05845000
         detected by the cpp while servicing the channel                05850000
         program.                                                       05855000
                                                                        05860000
 b.  20 bytes of disc status are logged for any errors occur-           05865000
     ring in the status fields. (see cs'80 disc drive status)           05870000
                                                                        05875000
 c.  logging will not occur for the status data overrun since           05880000
     this can occur even under normal operating conditions when         05885000
     there are several high speed devices on more than one gic.         05890000
                                                                        05895000
 d.  logging is exempted when the driver is in diagnostics mode.        05900000
                                                                        05905000
                                                                        05910000
                                                                        05915000
                  unexpected interrupts handling                        05920000
                  ------------------------------                        05925000
                                                                        05930000
                                                                        05935000
 to avoid processing unexpected interrupts from the cs'80 discs         05940000
 due to internal maintenance (ie. error logging and head align-         05945000
 ments), devrec will always issue a request status to the driver        05950000
 with drq word qpar1=8 and qpar2=9 once an unexpected interrupt         05955000
 has occurred. the driver will then return to devrec the pattern        05960000
 %101010 for interrupts it wishes devrec to ignore or return the        05965000
 first word of status for interrupts it wishes devrec to process.       05970000
                                                                        05975000
 note:  the driver will set the ignore interrupt flag in the            05980000
        dit for all unexpected interrupts except operator               05985000
        request release and power on condition. the ignore              05990000
        interrupt flag will be cleared after returning the              05995000
        ignore pattern to devrec's status request.                      06000000
                                                                        06005000
                                                                        06010000
                                                                        06015000
                  status considerations                                 06020000
                  ---------------------                                 06025000
                                                                        06030000
                                                                        06035000
 while the idle channel program is running, status will be              06040000
 read into the ilt table pointed to by ilt(istap). while an             06045000
 ioq is being processed by the driver, status will be read              06050000
 into the dit table. the driver will always reset the read              06055000
 status pointer back to the ilt after processing an ioq                 06060000
 request. this is necessary since siodm will not call the               06065000
 driver to reschedule the idle when the idle has not been               06070000
 aborted. this will occur for driver functions which do not             06075000
 execute a start'hpib (ie. lock, unlock, fopen, etc.)                   06080000
$page                                                                   06085000
                       driver return status codes                       06090000
                       --------------------------                       06095000
                                                                        06100000
                                                                        06105000
 general status (13:3)       qualifying status (8:5)      overall (8:8) 06110000
                                                                        06115000
 0 - pending                1 - waiting for completion         %10      06120000
                            3 - not ready wait                 %30      06125000
                                                                        06130000
 1 - successful             0 - no errors                       %1      06135000
                                                                        06140000
 3 - unusual condition      1 - status interrogation required  %13*     06145000
                          %21 - device powered up             %213*     06150000
                                                                        06155000
 4 - irrecoverable error    0 - invalid request                 %4      06160000
                            1 - track/sector error             %14      06165000
                            2 - i/o timed out before complete  %24      06170000
                            4 - sio failure                    %44      06175000
                            5 - unit failure                   %54      06180000
                            6 - invalid disc address           %64      06185000
                          %12 - system error                  %124      06190000
                          %14 - channel failure               %144      06195000
                          %16 - no spares available           %164      06200000
                                                                        06205000
                                                                        06210000
                                                                        06215000
                                                                        06220000
                                                                        06225000
                                                                        06230000
                                                                        06235000
                                                                        06240000
                                                                        06245000
*note:  these status are used for diagnostic reporting only.            06250000
                                                                        06255000
                                                                        06260000
                                                                        06265000
                                                                        06270000
                                                                        06275000
                                                                        06280000
                                                                        06285000
                                                                        06290000
                                                                        06295000
>>                                                                      06300000
$page                                                                   06305000
begin                                                                   06310000
$include incllpdt                                              <<06838>>06315000
$page                                                          <<06838>>06320000
$include inclsbh                                               <<06838>>06325000
$page                                                          <<06838>>06330000
$include incldrq                                               <<06838>>06335000
$page                                                          <<06838>>06340000
  equate                                                                06345000
                                                                        06350000
       << cs'80 disc subtypes >>                                        06355000
                                                                        06360000
    hp7935    =  8,                                                     06365000
    hp7911    =  1,                                                     06370000
    hp7912    =  2,                                                     06375000
                                                                        06380000
       << ditp parameters >>                                            06385000
                                                                        06390000
    dit'size  = 30,  << dit table size >>                      <<06838>>06395000
    dldev     =  3,  << logical device >>                      <<06838>>06400000
    diltp     =  5,  << interrupt linkage table pointer >>              06405000
    dstat     =  6,  << device powerfail status >>                      06410000
    dserr     =  7,  << dit error log length/offset >>                  06415000
    dunit     = 10,  << (0:3):= 2 hpib, (7:9) unit >>          <<06838>>06420000
    dsbufaddr = 11,  << sbuf element used to read dsct >>               06425000
    dbadblk1  = 12,  << high order addr of bad sector >>                06430000
    dbadblk2  = 13,  << low order addr of bad sector >>                 06435000
    dbadxfer  = 14,  << byte xfer left after bad blk >>                 06440000
    dlogerror = 15,  << dit hardware error logged status >>             06445000
    dsiopstop = 16,  << dit cp stopped relative offset >>               06450000
    dstatus   = 17,  << disc status-logged on status error >>           06455000
    dmisc     = 27,  << device dependent word >>               <<06838>>06460000
                                                                        06465000
    ddbadblk  =  6,  << dblwrd offset of suspect sector >>              06470000
                                                               <<06838>>06475000
   <<    rps info   >>                                         <<06838>>06480000
                                                               <<06838>>06485000
    doing'read'rev'code = 1, << local request state >>         <<06838>>06490000
    doing'set'rps = 2,       << local request state >>         <<06838>>06495000
    pep793x = 64,          << pep date code for 793x, 791x >>  <<06838>>06500000
    rps'wordone = 28,        << rps word one info >>           <<06838>>06505000
    rps'wordtwo = 29,        << rps word two info >>           <<06838>>06510000
    rps'status'func = 99,    << func to read rps setting >>    <<08900>>06515000
                                                                        06520000
       << ioqp parameters >>                                            06525000
                                                                        06530000
    qmisc     =  3,  << flags pertaining to this request >>             06535000
    qfunc     =  6,  << request function code >>                        06540000
    qwbct     =  7,  << +word/-byte count >>                            06545000
    qpar1     =  8,  << parameter 1 >>                                  06550000
    qpar2     =  9,  << parameter 2 >>                                  06555000
    qstat     = 10,  << request status and pcb number >>                06560000
                                                                        06565000
       << iltp parameters >>                                            06570000
                                                                        06575000
    isiop     =  8,  << channel program area pointer >>                 06580000
    istap     =  9,  << status area pointer >>                          06585000
                                                                        06590000
       << cs'80 secondaries >>                                          06595000
                                                                        06600000
    wrt'cmd'sec      =   %2005,  << wrt w/cmd msg sec >>                06605000
    read'trans'sec   =   %3402,  << read w/trans msg sec >>             06610000
    wrt'trans'sec    =   %4002,  << wrt w/trans msg sec >>              06615000
    read'exec'sec    =   %1416,  << read w/exec msg sec >>              06620000
    wrt'exec'sec     =   %2016,  << wrt w/exec msg sec >>               06625000
                                                                        06630000
       << cs'80 disc driver command data bytes >>                       06635000
                                                                        06640000
    cdb'blk'displ      =  %22,  << set block disp command >>            06645000
    cdb'cancel         =  %11,  << cancel command >>                    06650000
    cdb'clear          =  %10,  << clear command >>                     06655000
    cdb'describe       =  %65,  << describe command >>                  06660000
    cdb'init'diag      =  %63,  << init diagnostic command >>           06665000
    cdb'init'media     =  %67,  << initialize media command >>          06670000
    cdb'init'util      =  %60,  << no executing msg >>                  06675000
    cdb'nop            =  %64,  << no operation command >>              06680000
    cdb'parity'op      =    1,  << parity opcode command >>             06685000
    cdb'read           =    0,  << locate & read command >>             06690000
    cdb'read'loopbk    =   %2,  << read loopback command >>             06695000
    cdb'release        =  %16,  << release command >>                   06700000
    cdb'release'deny   =  %17,  << release denied command >>            06705000
    cdb'req'status     =  %15,  << request status command >>            06710000
    cdb'set'length     =  %30,  << set length command >>                06715000
    cdb'set'mask       =  %76,  << set status mask cmd >>               06720000
    cdb'set'release    =  %73,  << set release command >>               06725000
    cdb'set'retadr     = %110,  << set ret addr mode cmd >>             06730000
    cdb'set'retry      =  %72,  << set retry time command >>            06735000
    cdb'set'rps        =  %71,  << set rps command >>                   06740000
    cdb'set'sngl'vec   =  %20,  << set sngl vec addr cmd >>             06745000
    cdb'set'3'vec      =  %21,  << set 3 vector addr cmd >>             06750000
    cdb'set'unit       =  %40,  << set unit# command >>                 06755000
    cdb'set'vol        = %100,  << set vol# command >>                  06760000
    cdb'spare'blk      =   %6,  << spare block command >>               06765000
    cdb'verify         =   %4,  << verify command >>                    06770000
    cdb'write          =   %2,  << locate & write command >>            06775000
    cdb'wrt'loopbk     =   %3,  << write loopback command >>            06780000
                                                                        06785000
       << channel program offsets relative to siop >>                   06790000
                                                                        06795000
    firstbranch   = 7,             << main branch to sections>><<03717>>06800000
    branchpt      = firstbranch+1, << branchpt offset >>       <<03689>>06805000
    idle          = branchpt+1,    << idle cp offset >>        <<03689>>06810000
    idle'wait     = idle+5,        << idle when dev not rdy>>  <<03717>>06815000
    syncdsj       = idle'wait+14,  << get insync w. cs80 cmds>><<03717>>06820000
    dxfer         = syncdsj+9,     << data xfer sec. offset >> <<03717>>06825000
    rstat         = dxfer+21,      << read status offset >>    <<03689>>06830000
    diag          = rstat+23,      << diag section offset >>   <<03689>>06835000
    pon           = diag+14,       << power on offset >>       <<03689>>06840000
    ident         = pon+11,        << idfy section offset >>   <<03689>>06845000
    stat'cdb      = ident+4,       << status cdb offset >>     <<03689>>06850000
    loc'wrt'cdb   = stat'cdb+1,    << loc & wrt cdb offset >>  <<03689>>06855000
    initflg       = loc'wrt'cdb+4, << init flag offset >>      <<03689>>06860000
    fill'wrd      = initflg+1,     << fill word offset >>      <<03689>>06865000
    desc'area     = fill'wrd+1,    << describe area offset >>  <<03689>>06870000
    cdb'area'wrd  = desc'area+10,  << cdb area wrd offst >>    <<03689>>06875000
    cpgm'size     = cdb'area'wrd+10,<< length of chan pgm >>   <<03717>>06880000
    cpgm'sized2   = (cpgm'size+2)/2, << len of chan pgm /2 >>  <<03717>>06885000
    init'ary'size = 4+dit'size+cpgm'size, << len of init aray>><<03717>>06890000
                                                                        06895000
       << channel program entries & area byte offset >>                 06900000
                                                                        06905000
    cpbase        = firstbranch+2,   << cp base >>             <<03689>>06910000
    idlecp        = idle-cpbase,     << idle cp entry >>                06915000
    idle'waitcp   = idle'wait-cpbase, << offset to wait inst >><<03717>>06920000
    syncdsjcp     = syncdsj-cpbase,   << offset from 1st jump>><<03689>>06925000
    dxfercp       = dxfer-cpbase,    << data xfer entry >>              06930000
    rstatcp       = rstat-cpbase,    << request stat entry >>           06935000
    diagcp        = diag-cpbase,     << diag function entry >>          06940000
    poncp         = pon-cpbase,      << power on entry >>               06945000
    identcp       = ident-cpbase,    << identify entry >>               06950000
                                                                        06955000
    desc'area'byte = desc'area*2,    << desc area byte offst >>         06960000
    cdb'area'byte  = cdb'area'wrd*2, << cdb area byte offst >>          06965000
                                                               <<07449>>06970000
   <<   byte command area offsets   >>                         <<07449>>06975000
                                                               <<07449>>06980000
  cdb'byte'1     =  cdb'area'byte+1,                           <<07449>>06985000
  cdb'byte'2     =  cdb'area'byte+2,                           <<07449>>06990000
  cdb'byte'3     =  cdb'area'byte+3,                           <<07449>>06995000
  cdb'byte'4     =  cdb'area'byte+4,                           <<07449>>07000000
  cdb'byte'5     =  cdb'area'byte+5,                           <<07449>>07005000
  cdb'byte'6     =  cdb'area'byte+6,                           <<07449>>07010000
  cdb'byte'7     =  cdb'area'byte+7,                           <<07449>>07015000
  cdb'byte'8     =  cdb'area'byte+8,                           <<07449>>07020000
  cdb'byte'9     =  cdb'area'byte+9,                           <<07449>>07025000
  cdb'byte'10    =  cdb'area'byte+10,                          <<07449>>07030000
  cdb'byte'11    =  cdb'area'byte+11,                          <<07449>>07035000
  cdb'byte'12    =  cdb'area'byte+12,                          <<07449>>07040000
  cdb'byte'13    =  cdb'area'byte+13,                          <<07449>>07045000
  cdb'byte'14    =  cdb'area'byte+14,                          <<07449>>07050000
                                                               <<07449>>07055000
                                                               <<07449>>07060000
                                                                        07065000
    wrd'sngl'vec'limit  = desc'area+15,  << single vec addr >> <<03760>>07070000
    wrd'three'vec'limit = desc'area+12,      << 3-vec addr >>  <<03760>>07075000
    three'vec'limit = desc'area'byte+24,   << 3-vec addr >>             07080000
                                                               <<03760>>07085000
                                                               <<03760>>07090000
                                                                        07095000
       << channel program sections offsets >>                           07100000
                                                                        07105000
    idle11        = idle'wait+11,  << cmd buffer abs addr >>   <<03728>>07110000
    dxfer1        = dxfer+1,    << cmd buffer length >>                 07115000
    dxfer4        = dxfer+4,    << cmd buffer abs addr >>               07120000
    dxfer5        = dxfer+5,    << wait command >>                      07125000
    dxfer6        = dxfer+6,    << wait command >>                      07130000
    dxfer7        = dxfer+7,    << exec msg secondary >>                07135000
    dxfer8        = dxfer+8,    << #bytes to read/wrt >>                07140000
    dxfer10       = dxfer+10,   << data bank >>                         07145000
    dxfer11       = dxfer+11,   << data buffer abs addr >>              07150000
    dxfer12       = dxfer+12,   << wait command >>                      07155000
    dxfer13       = dxfer+13,   << wait command >>                      07160000
    rstat4        = rstat+4,    << cmd buffer abs addr >>               07165000
    rstat11       = rstat+11,   << data buffer abs addr >>              07170000
    diag1         = diag+1,     << cmd buffer length >>                 07175000
    diag3         = diag+3,     << cmd buffer bank >>                   07180000
    diag4         = diag+4,     << cmd buffer abs addr >>               07185000
    diag5         = diag+5,     << wait command >>                      07190000
    diag6         = diag+6,     << wait command >>                      07195000
    ident1        = ident+1,    << id return byte addr >>               07200000
    ident2        = ident+2,    << ident int/hlt or jmp >>              07205000
    ident3        = ident+3,    << ident int/hlt or jmp >>              07210000
                                                                        07215000
       << dit status offset >>                                          07220000
                                                                        07225000
    id'field      = dstatus,    << identification field >>              07230000
    reject'field  = dstatus+1,  << reject errors field >>               07235000
    fault'field   = dstatus+2,  << fault errors field >>                07240000
    access'field  = dstatus+3,  << access errors field >>               07245000
    infor'field   = dstatus+4,  << information field >>                 07250000
    parm'field    = dstatus+5,  << parameter field >>                   07255000
                                                                        07260000
       << idle cp status offset >>                                      07265000
                                                                        07270000
    i'fault'field  = 2,  << idle fault errors field >>                  07275000
    i'access'field = 3,  << idle access errors field >>                 07280000
    i'infor'field  = 4,  << idle information field >>                   07285000
                                                                        07290000
       << completion status >>                                          07295000
                                                                        07300000
    goodio         =    1,  << successful i/o completion >>             07305000
    invalidop      =    4,  << invalid operation requested >>           07310000
    stat'reqrd     =  %13,  << status interrog required >>              07315000
    trkscterr      =  %14,  << unrecov trk/sector error >>              07320000
    timouterr      =  %24,  << timed out error >>                       07325000
    siofail        =  %44,  << sio failure >>                           07330000
    uniterr        =  %54,  << unit failure >>                          07335000
    invalidskadr   =  %64,  << invalid disc address >>                  07340000
    syserr         = %124,  << system error >>                          07345000
    chanfail       = %144,  << i/o channel error >>                     07350000
    no'spare'err   = %164,  << no spare available >>                    07355000
    device'pon     = %213,  << device powered on >>                     07360000
                                                                        07365000
       << driver states >>                                              07370000
                                                                        07375000
    cmpltion'wait  = 1,  << waiting for i/o completion intrpt >>        07380000
    not'rdy'wait   = 2,  << not ready wait in progress >>               07385000
    rel'wait       = 3,  << rel/rel deny completion wait >>             07390000
    ioq'defer'wait = 4,  << ioq being deferred wait >>                  07395000
    dsct'read'wait = 5,  << defective sector table read wait >>         07400000
    dsct'wrt'wait  = 6,  << defective sector table wrt wait >>          07405000
    sync'wait      = 7,  << driver/firmware sync wait >>                07410000
                                                                        07415000
    idle'req'wait  = 1,  << idle request completion wait >>             07420000
                                                                        07425000
       << siodm states >>                                               07430000
                                                                        07435000
    intrptwait  = %13,  << wait for i/o completion >>                   07440000
    notready    =   7,  << unit not ready >>                            07445000
    requestdone =   5,  << request done >>                              07450000
                                                                        07455000
       << iomessage parameters >>                                       07460000
                                                                        07465000
    opconsole      =  0,  << output msg to sys console >>               07470000
    sys'deny'msg   = 25,  << sysdisc unload denied msg >>               07475000
    nsys'deny'msg  = 26,  << non-sysdisc unload deny msg >>             07480000
    sys'dsct'msg   = 27,  << sysdisc dsct full msg >>                   07485000
    pv'dsct'msg    = 28,  << pv dsct full msg >>                        07490000
                                                                        07495000
       << miscellaneous equates >>                                      07500000
                                                                        07505000
    cpva'timeout  = %160004,<< cpva returned if gic timeout >> <<03689>>07510000
    ctrl'unit     = %17,    << controller unit >>                       07515000
    describe      = 21,     << describe function code >>                07520000
    diag'result   = 17,     << diag result function code >>             07525000
    dsct'dadr     = 1,      << dsct disc address >>                     07530000
    dsct'size     = 256,    << #bytes in dsct >>                        07535000
    init'media    = 8,      << init'media function code >>              07540000
    identify      = 15,     << identify function code >>                07545000
    max'desc'byte = 37,     << max# describe bytes >>                   07550000
    read'rev'func = 39,     << read rev code func >>           <<06838>>07555000
    req'stat      = 7,      << request status function code >>          07560000
    req'vol'limit = 10,     << req vol limit function code >>           07565000
    set'rps'default = 40,   << set rps default func >>         <<06838>>07570000
    syslpdt       = %10,    << db relative base of lpdt >>              07575000
    sysdb         = %1000,  << address of sysdb area >>                 07580000
    type          = 3,      << cs'80 discs type >>                      07585000
    verify        = 11,     << verify function code >>                  07590000
  endeq           =  0;                                                 07595000
                                                                        07600000
       << miscellaneous declarations >>                                 07605000
                                                                        07610000
                                                               <<06838>>07615000
$page                                                                   07620000
                                                                        07625000
       << i/o status bit definitions >>                                 07630000
                                                                        07635000
                                                                        07640000
  define                                                                07645000
                                                                        07650000
       << dmisc bit definitions >>                                      07655000
                                                                        07660000
    lock'flg       = ( 0:1)#, << lock flg for vol mounted >>            07665000
    ignore'int'flg = ( 1:1)#, << ignore unexpected intrp flag >>        07670000
    processing'md = ( 2:1)#,  << marginal data flag >>         <<04985>>07675000
                                                                        07680000
    substate   = (12:4)#, <<  indicates state of idle cp  >>            07685000
                          <<                              >>            07690000
                          <<  0 - normal idle cp wait     >>            07695000
                          <<  1 - idle request being      >>            07700000
                          <<      serviced wait           >>            07705000
                          <<                              >>            07710000
                                                                        07715000
       << qmisc bit definitions >>                                      07720000
                                                                        07725000
    chan'err'flg   = ( 0:2)#, << channel error retry flag >>            07730000
    rstat'fail'flg = ( 2:1)#, << request status failed flag >>          07735000
    oper'req'flg   = ( 3:1)#, << operator request release flag >>       07740000
    im'fault'flg   = ( 4:1)#, << int maintenance fault flag >>          07745000
    retry'count    = ( 5:3)#, << retry count in qmisc >>       <<03689>>07750000
    stat'rtry'flg  = ( 5:1)#, << stat error single retry flag >>        07755000
    rtrans'flg     = ( 6:2)#, << retransmit required flag >>            07760000
    load'flg       = ( 8:1)#, << media load flag >>                     07765000
    sys'pfail'flg  = ( 9:1)#, << system powerfail flag >>               07770000
    ver'err'flg    = (10:1)#, << verify error flag >>          <<03626>>07775000
                                                                        07780000
    waitcode   = (12:4)#, <<  indicates type of wait  >>                07785000
                          <<                          >>                07790000
                          <<  0 - new request         >>                07795000
                          <<  1 - completion wait     >>                07800000
                          <<  2 - not ready wait      >>                07805000
                          <<  3 - rel/rel deny wait   >>                07810000
                          <<  4 - ioq defer wait      >>                07815000
                          <<  5 - dsct read wait      >>                07820000
                          <<  6 - dsct write wait     >>                07825000
                          <<  7 - sync wait           >>                07830000
                          <<                          >>                07835000
                                                                        07840000
       << status error reporting fields >>                              07845000
                                                                        07850000
    not'rdy         = ( 3:1)#,   << device not ready bit >>             07855000
    unit'attn       = ( 8:8)#,   << unit attention bit >>               07860000
                                                                        07865000
    chan'parity     = ( 2:1)=1#, << channel parity bit >>               07870000
    illeg'opcode    = ( 5:1)=1#, << illegal opcode bit >>               07875000
    mod'addr'err    = ( 6:1)=1#, << module addr error bit >>            07880000
    addr'bound      = ( 7:1)=1#, << address bounds bit >>               07885000
    parm'bound      = ( 8:1)=1#, << parameter bounds bit >>             07890000
    illeg'parm      = ( 9:1)=1#, << illegal parameter bit >>            07895000
    msg'seq'viol    = (10:1)=1#, << msg seq violation bit >>            07900000
    msg'len'diff    = (12:1)=1#, << msg length differ bit >>            07905000
                                                                        07910000
    cross'unit      = ( 1:1)=1#, << error during copy oper >>           07915000
    ctrl'fault      = ( 3:1)=1#, << controller fault bit >>             07920000
    unit'fault      = ( 6:1)=1#, << unit fault bit >>                   07925000
    diag'failed     = ( 8:1)=1#, << diag failed bit >>                  07930000
    oper'rel'reqrd  = (10:1)=1#, << oper rel required bit >>            07935000
    diag'rel'reqrd  = (11:1)=1#, << diag rel required bit >>            07940000
    int'maint'reqrd = (12:1)=1#, << int maint required bit >>           07945000
    power'fail      = (14:1)=1#, << power fail bit >>                   07950000
    retransmit      = (15:1)=1#, << retransmit/rel cmplt bit >>         07955000
                                                                        07960000
    illeg'par'oper  = ( 0:1)=1#, << illegal // operation bit >>         07965000
    uninit'media    = ( 1:1)=1#, << uninitialized media bit >>          07970000
    no'spare'avail  = ( 2:1)=1#, << no spare available bit >>           07975000
    dev'not'rdy     = ( 3:1)=1#, << device not ready bit >>             07980000
    wrt'protect     = ( 4:1)=1#, << write protect bit >>                07985000
    no'data'found   = ( 5:1)=1#, << no data found bit >>                07990000
    unrecov'data'ov = ( 8:1)=1#, << unrecov data overflow bit >>        07995000
    unrecov'data    = ( 9:1)=1#, << unrecov data bit >>                 08000000
    end'of'file     = (11:1)=1#, << end of file bit >>                  08005000
    end'of'volume   = (12:1)=1#, << end of volume bit >>                08010000
                                                                        08015000
    oper'rel'reqst  = ( 0:1)=1#, << operator rel request bit >>         08020000
    diag'rel'reqst  = ( 1:1)=1#, << diag rel request bit >>             08025000
    int'maint'reqst = ( 2:1)=1#, << int maint request bit >>            08030000
    media'wearing   = ( 3:1)=1#, << media wearing out bit >>            08035000
    data'overrun    = ( 4:1)=1#, << data overrun bit >>                 08040000
    def'blk'spare   = ( 7:1)=1#, << defective blk auto spared >>        08045000
    recov'data'ov   = ( 9:1)=1#, << recov data overflow bit >>          08050000
    marginal'data   = (10:1)=1#, << marginal data bit >>                08055000
    recov'data      = (11:1)=1#, << recov data bit >>                   08060000
    maint'trk'ov    = (13:1)=1#, << maint trk overflow bit >>           08065000
                                                                        08070000
       << miscellaneous bit definitions >>                              08075000
                                                                        08080000
    diagbit    = ( 2:1)#, << qflag, diagnostic bit >>                   08085000
    dldevn     = ( 8:8)#, << logical device number of dit >>            08090000
    errorcode  = ( 0:3)#, << cpvap, error code >>                       08095000
    func       = ( 8:8)#, << qfunc, function code >>                    08100000
    iostat     = ( 8:8)#, << qstat, request status returned >>          08105000
    pvbit      = ( 4:1)#, << private volume bit in lpdt >>              08110000
    sabit      = ( 4:1)#, << wrt instruction single address bit >>      08115000
    sfbit      = (10:2)#, << serial/foreign bit in lpdt >>              08120000
    sfail      = (10:1)#, << qflag, failure on delayed start sio >>     08125000
    stype      = (12:4)#, << disc subtype in lpdt >>                    08130000
    timedout   = (13:1)#, << cpvap, transfer aborted-timed out >>       08135000
                                                               <<06838>>08140000
       << rps word info in the dit >>                          <<06838>>08145000
                                                               <<06838>>08150000
    local'state     = (12:4)#, << local request status >>      <<06838>>08155000
    read'rev'code'done  = (0:1)#, << revision code>>           <<06838>>08160000
    rps'datecode   = (1:1)#,  << have pep firmware >>          <<06838>>08165000
    rps'desirable  = (2:1)#,  << rps should be turned on >>    <<06838>>08170000
    rps'enabled    = (3:1)#,  << the on-off of rps >>          <<06838>>08175000
                                                                        08180000
       << statement defines >>                                          08185000
                                                                        08190000
    abs        = absolute#,                                    <<03717>>08195000
    disable    = assemble (sed 0)#,                                     08200000
    log'status = ditp(dserr) := [8/10,8/dstatus]#,                      08205000
   setdb'sys =     begin                                       <<07449>>08210000
                   tos := %1000d;                              <<07449>>08215000
                   assemble( xchd; ddel);                      <<07449>>08220000
                   end#,                                       <<07449>>08225000
   setdb'siop=     begin                                       <<07449>>08230000
                   tos := abs'siop'addr;                       <<07449>>08235000
                   assemble( xchd; ddel);                      <<07449>>08240000
                   end#,                                       <<07449>>08245000
  enddef       = 0#;                                                    08250000
                                                               <<07449>>08255000
byte array siodb'byte'array(*) = db+0;  << when db=abs'siop >> <<07449>>08260000
integer array siopdb(*)  = db+0;  << when db=abs'siop >>       <<07449>>08265000
                                                               <<07449>>08270000
                                                                        08275000
  logical                                                               08280000
    powerfail     = db + %72,  << sysdb rel powerfail word >>           08285000
    sysup         = db + %73;  << sysdb rel system up word >>           08290000
                                                                        08295000
                                                                        08300000
                                                               <<07449>>08305000
        <<  db direct declarations for channel program  >>     <<07449>>08310000
   integer                                                     <<07449>>08315000
                                                               <<07449>>08320000
   siodb'firstbranch     =   db  +    firstbranch    ,         <<07449>>08325000
   siodb'branchpt        =   db  +    branchpt       ,         <<07449>>08330000
   siodb'idle            =   db  +    idle           ,         <<07449>>08335000
   siodb'idle'wait       =   db  +    idle'wait      ,         <<07449>>08340000
   siodb'syncdsj         =   db  +    syncdsj        ,         <<07449>>08345000
   siodb'dxfer           =   db  +    dxfer          ,         <<07449>>08350000
   siodb'rstat           =   db  +    rstat          ,         <<07449>>08355000
   siodb'diag            =   db  +    diag           ,         <<07449>>08360000
   siodb'pon             =   db  +    pon            ,         <<07449>>08365000
   siodb'ident           =   db  +    ident          ,         <<07449>>08370000
   siodb'stat'cdb        =   db  +    stat'cdb       ,         <<07449>>08375000
   siodb'loc'wrt'cdb     =   db  +    loc'wrt'cdb    ,         <<07449>>08380000
   siodb'initflg         =   db  +    initflg        ,         <<07449>>08385000
   siodb'fill'wrd        =   db  +    fill'wrd       ,         <<07449>>08390000
   siodb'desc'area       =   db  +    desc'area      ,         <<07449>>08395000
   siodb'cdb'area'wrd    =   db  +    cdb'area'wrd   ,         <<07449>>08400000
   siodb'cpgm'size       =   db  +    cpgm'size      ,         <<07449>>08405000
   siodb'init'ary'size   =   db  +    init'ary'size  ,         <<07449>>08410000
                                                               <<07449>>08415000
                                                               <<07449>>08420000
                                                               <<07449>>08425000
   siodb'cpbase          =   db  +    cpbase         ,         <<07449>>08430000
   siodb'idlecp          =   db  +    idlecp         ,         <<07449>>08435000
   siodb'idle'wacp       =   db  +    idle'waitcp    ,         <<07449>>08440000
   siodb'syncdsjcp       =   db  +    syncdsjcp      ,         <<07449>>08445000
   siodb'dxfercp         =   db  +    dxfercp        ,         <<07449>>08450000
   siodb'rstatcp         =   db  +    rstatcp        ,         <<07449>>08455000
   siodb'diagcp          =   db  +    diagcp         ,         <<07449>>08460000
   siodb'poncp           =   db  +    poncp          ,         <<07449>>08465000
   siodb'identcp         =   db  +    identcp        ,         <<07449>>08470000
   siodb'wrd'sngl'vec'limit = db  +   wrd'sngl'vec'limit   ,   <<07449>>08475000
   siodb'wrd'three'vec'limit= db  +   wrd'three'vec'limit  ,   <<07449>>08480000
                                                               <<07449>>08485000
                                                               <<07449>>08490000
                                                               <<07449>>08495000
                                                               <<07449>>08500000
                                                               <<07449>>08505000
                                                               <<07449>>08510000
   siodb'idle11          =   db  +    idle11         ,         <<07449>>08515000
   siodb'dxfer1          =   db  +    dxfer1         ,         <<07449>>08520000
   siodb'dxfer4          =   db  +    dxfer4         ,         <<07449>>08525000
   siodb'dxfer5          =   db  +    dxfer5         ,         <<07449>>08530000
   siodb'dxfer6          =   db  +    dxfer6         ,         <<07449>>08535000
   siodb'dxfer7          =   db  +    dxfer7         ,         <<07449>>08540000
   siodb'dxfer8          =   db  +    dxfer8         ,         <<07449>>08545000
   siodb'dxfer10         =   db  +    dxfer10        ,         <<07449>>08550000
   siodb'dxfer11         =   db  +    dxfer11        ,         <<07449>>08555000
   siodb'dxfer12         =   db  +    dxfer12        ,         <<07449>>08560000
   siodb'dxfer13         =   db  +    dxfer13        ,         <<07449>>08565000
   siodb'rstat4          =   db  +    rstat4         ,         <<07449>>08570000
   siodb'rstat11         =   db  +    rstat11        ,         <<07449>>08575000
   siodb'diag1           =   db  +    diag1          ,         <<07449>>08580000
   siodb'diag3           =   db  +    diag3          ,         <<07449>>08585000
   siodb'diag4           =   db  +    diag4          ,         <<07449>>08590000
   siodb'diag5           =   db  +    diag5          ,         <<07449>>08595000
   siodb'diag6           =   db  +    diag6          ,         <<07449>>08600000
   siodb'ident1          =   db  +    ident1         ,         <<07449>>08605000
   siodb'ident2          =   db  +    ident2         ,         <<07449>>08610000
   siodb'ident3          =   db  +    ident3      ;            <<07449>>08615000
                                                               <<07449>>08620000
$page                                                                   08625000
<<                                                                      08630000
        *********************************                               08635000
        *                               *                               08640000
        *   driver db area definition   *                               08645000
        *                               *                               08650000
        *********************************                               08655000
>>                                                                      08660000
                                                                        08665000
        array initial(0:init'ary'size) = db :=                 <<03717>>08670000
        [8/dit'size,8/%61], << disc dit size, core resident >> <<06838>>08675000
                      << idle channel program, driver type 1 >>         08680000
                 0,   << not used >>                                    08685000
           %037400,   << unit extract instruction - andi 0 >>           08690000
         [8/cpgm'sized2,8/10],<< cp size/2, 10 wrds:stat >>    <<03717>>08695000
                                                                        08700000
        << disc dit >>                                                  08705000
            %40000,   << dflag >>                                       08710000
                 0,   << dlink >>                                       08715000
                 0,   << dioqp >>                                       08720000
                 0,   << dldev >>                              <<06838>>08725000
                 0,   << ddltp >>                                       08730000
                 0,   << diltp >>                                       08735000
                 0,   << dstat >>                                       08740000
                 0,   << dserr >>                                       08745000
                 0,   << dqhead >>                                      08750000
                 0,   << dqtail >>                                      08755000
           %040000,   << hp-ib device - dunit >>               <<06838>>08760000
                 0,   << dsbufaddr >>                                   08765000
                 0,   << dbadblk1  >>                                   08770000
                 0,   << dbadblk2  >>                                   08775000
                 0,   << dbadxfer  >>                                   08780000
                 0,   << dlogerror >>                                   08785000
                 0,   << dsiopstop >>                                   08790000
         0,0,0,0,0,   << dstatus   >>                                   08795000
         0,0,0,0,0,                                                     08800000
                 0,          << dummy >>                       <<06838>>08805000
               0,0,          << rpswords >>                    <<06838>>08810000
                                                                        08815000
                                                                        08820000
        <<----------------->>                                           08825000
        << channel program >>                                           08830000
        <<----------------->>                                           08835000
                                                                        08840000
  << change dsj to identify for performance reason >>          <<06838>>08845000
<< 0>>  <<identify >>       %3000,  <<  check pwr on  >>       <<06838>>08850000
<< 1>>                          0,  << id return byte   >>     <<06838>>08855000
<< 2>>                          0,  << branch  >>              <<06838>>08860000
<< 3>>                          3,                             <<06838>>08865000
<< 4>>                          0,                             <<06838>>08870000
                                                               <<03689>>08875000
<< 0>>  << fill >>            0,0,  << unused never xeqed >>   <<03717>>08880000
                                                               <<03689>>08885000
                                                               <<03689>>08890000
<< 0>>  << jump >>              0,  << branch point to cp section >>    08895000
<< 1>>                          0,                                      08900000
                                                                        08905000
                                                                        08910000
        <<------------------------------------------------->>           08915000
        << idle cp - on hard error, requests status and on >>           08920000
        <<           power on returns an idle pon status   >>           08925000
        <<------------------------------------------------->>           08930000
                                                                        08935000
<< 0>>  << dsj  >>          %2402,  << dsj to check pwr on  >> <<03717>>08940000
<< 1>>                          0,  << return byte   >>        <<03717>>08945000
<< 2>>                          0,  << normal return  >>       <<03717>>08950000
<< 3>>                          7,  << hard-err request stat >><<03717>>08955000
<< 4>>                         21,  << idle pwr on occured >>  <<03717>>08960000
                                                                        08965000
<< 0>>  << wait >>          %1000,  << wait for // poll response >>     08970000
<< 1>>                          0,                                      08975000
                                                                        08980000
<< 2>>  << qstat >>         %2402,  << reporting msg secondary >>       08985000
<< 3>>                          0,  << return byte >>                   08990000
<< 4>>                         12,  << normal completion >>             08995000
<< 5>>                          0,  << hard error - req status >>       09000000
<< 6>>                         14,  << idle power on occurred >>        09005000
                                                                        09010000
<< 7>>  << loc & wrt >>     %2005,  << command msg secondary >>         09015000
<< 8>>                          7,  << cmd buffer length (byte) >>      09020000
<< 9>>                          0,  << burst >>                         09025000
<<10>>                     %42000,  << cmd buffer bank >>               09030000
<<11>>                          0,  << cmd buffer abs addr >>           09035000
                                                                        09040000
<<12>>  << wait >>          %1000,  << wait for // poll response >>     09045000
<<13>>                          0,                                      09050000
                                                                        09055000
        << sync dsj >>                                         <<03717>>09060000
<<14>>  << qstat >>         %2402,  << reporting msg secondary >>       09065000
<<15>>                          0,  << return byte >>                   09070000
<<16>>                          0,  << normal completion >>             09075000
<<17>>                         25,  << hard error - req status >>       09080000
<<18>>                          2,  << power on occurred >>             09085000
                                                                        09090000
<<19>>  << int/hlt0 >>       %601,  << interrupt/halt >>                09095000
<<20>>                          0,  << code of 0 in cpva(1) >>          09100000
                                                                        09105000
<<21>>  << int/hlt4 >>       %601,  << interrupt/halt >>                09110000
<<22>>                          4,  << code of 4 in cpva(1) >>          09115000
                                                                        09120000
                                                                        09125000
        <<------------------------------------------------->>           09130000
        << [dxfer] real-time & some general purpose cmds   >>           09135000
        << command - execution - reporting message section >>           09140000
        <<------------------------------------------------->>           09145000
                                                                        09150000
                                                                        09155000
<< 0>>  << write ctrl >>    %2005,  << command msg secondary >>         09160000
<< 1>>                          0,  << cmd buffer length (byte) >>      09165000
<< 2>>                          0,  << burst >>                         09170000
<< 3>>                      %2000,  << cmd buffer bank >>               09175000
<< 4>>                          0,  << cmd buffer abs addr >>           09180000
                                                                        09185000
<< 5>>  << wait >>          %1000,  << wait for // poll response >>     09190000
<< 6>>                          0,                                      09195000
                                                                        09200000
<< 7>>  << rd/wrt ctrl >>   %1416,  << execution msg secondary >>       09205000
<< 8>>                          0,  << #bytes to read/write >>          09210000
<< 9>>                          0,  << burst >>                         09215000
<<10>>                          0,  << data bank >>                     09220000
<<11>>                          0,  << data buffer abs addr >>          09225000
                                                                        09230000
<<12>>  << wait >>          %1000,  << wait for // poll response >>     09235000
<<13>>                          0,                                      09240000
                                                                        09245000
<<14>>  << qstat >>         %2402,  << reporting msg secondary >>       09250000
<<15>>                          0,  << return byte >>                   09255000
<<16>>                          0,  << normal completion >>             09260000
<<17>>                          2,  << hard error - req status >>       09265000
<<18>>                         39,  << power on occurred >>             09270000
                                                                        09275000
<<19>>  << int/hlt0 >>       %601,  << interrupt/halt >>                09280000
<<20>>                          0,  << code of 0 in cpva(1) >>          09285000
                                                                        09290000
                                                                        09295000
        <<------------------------------------------------->>           09300000
        << [rstat] status interrogation section            >>           09305000
        << command - execution - reporting message section >>           09310000
        <<------------------------------------------------->>           09315000
                                                                        09320000
                                                                        09325000
<< 0>>  << write ctrl >>    %2005,  << command msg secondary >>         09330000
<< 1>>                          1,  << cmd buffer length (byte) >>      09335000
<< 2>>                          0,  << burst >>                         09340000
<< 3>>                     %42000,  << cmd buffer bank >>               09345000
<< 4>>  << stat cdb >>          0,  << cmd buffer abs addr >>           09350000
                                                                        09355000
<< 5>>  << wait >>          %1000,  << wait for // poll response >>     09360000
<< 6>>                          0,                                      09365000
                                                                        09370000
<< 7>>  << read ctrl >>     %1416,  << execution msg secondary >>       09375000
<< 8>>                         20,  << #status bytes to read >>         09380000
<< 9>>                          0,  << burst >>                         09385000
<<10>>                      %2000,  << data bank >>                     09390000
<<11>>  << stat area >>         0,  << data buffer abs addr >>          09395000
                                                                        09400000
<<12>>  << wait >>          %1000,  << wait for // poll response >>     09405000
<<13>>                          0,                                      09410000
                                                                        09415000
<<14>>  << qstat >>         %2402,  << reporting msg secondary >>       09420000
<<15>>                          0,  << return byte >>                   09425000
<<16>>                          0,  << normal completion >>             09430000
<<17>>                          2,  << hard error - req status >>       09435000
<<18>>                         18,  << power on occurred >>             09440000
                                                                        09445000
<<19>>  << int/hlt1 >>       %601,  << interrupt/halt >>                09450000
<<20>>                          1,  << code of 1 in cpva(1) >>          09455000
                                                                        09460000
<<21>>  << int/hlt3 >>       %601,  << interrupt/halt >>                09465000
<<22>>                          3,  << code of 3 in cpva(1) >>          09470000
                                                                        09475000
                                                                        09480000
        <<------------------------------------------------->>           09485000
        << [diag] complementary, gp, diag, trans commands  >>           09490000
        << command/trans - reporting message section       >>           09495000
        <<------------------------------------------------->>           09500000
                                                                        09505000
                                                                        09510000
<< 0>>  << write ctrl >>    %2005,  << cmd/trans msg secondary >>       09515000
<< 1>>                          0,  << cmd buffer length (byte) >>      09520000
<< 2>>                          0,  << burst >>                         09525000
<< 3>>  << sel dev clr >>   %2000,  << cmd buffer bank >>               09530000
<< 4>>                          0,  << cmd buffer abs addr >>           09535000
                                                                        09540000
<< 5>>  << wait >>          %1000,  << wait for // poll response >>     09545000
<< 6>>                          0,                                      09550000
                                                                        09555000
<< 7>>  << qstat >>         %2402,  << reporting msg secondary >>       09560000
<< 8>>                          0,  << return byte >>                   09565000
<< 9>>                          0,  << normal completion >>             09570000
<<10>>                        -35,  << hard error - req status >>       09575000
<<11>>                          2,  << power on occurred >>             09580000
                                                                        09585000
<<12>>  << int/hlt0 >>       %601,  << interrupt/halt >>                09590000
<<13>>                          0,  << code of 0 in cpva(1) >>          09595000
                                                                        09600000
                                                                        09605000
        <<------------------------------------------------->>           09610000
        << [pon] sel dev clear/parity enabled on power on  >>           09615000
        <<------------------------------------------------->>           09620000
                                                                        09625000
                                                                        09630000
<< 0>>                      %4401,  << sel dev clr/parity on >>         09635000
<< 1>>                          0,                                      09640000
                                                                        09645000
<< 2>>                      %0000,  << dont wait for // pool >><<03717>>09650000
<< 3>>                          0,                                      09655000
                                                                        09660000
<< 4>>                      %2402,  << reporting msg secondary >>       09665000
<< 5>>                          0,  << return byte >>                   09670000
<< 6>>                          0,  << normal completion >>             09675000
<< 7>>                        -46,  << hard error - req status >>       09680000
<< 8>>                         -9,  << power on occurred >>             09685000
                                                                        09690000
<< 9>>  << int/hlt2 >>       %601,  << interrupt/halt >>                09695000
<<10>>                          2,  << code of 2 in cpva(1) >>          09700000
                                                                        09705000
                                                                        09710000
        <<------------------------------------------------->>           09715000
        << [ident] channel instruction identify            >>           09720000
        <<------------------------------------------------->>           09725000
                                                                        09730000
                                                                        09735000
<< 0>>  << identify >>      %3000,                                      09740000
<< 1>>                          0,  << id return byte >>                09745000
                                                                        09750000
<< 2>>                       %601,  << interrupt/halt >>                09755000
<< 3>>                          0,  << code of 0 in cpva(1) >>          09760000
                                                                        09765000
                                                                        09770000
        <<------------------------------------------------->>           09775000
        << miscellaneous storage and constants area        >>           09780000
        <<------------------------------------------------->>           09785000
                                                                        09790000
                                                                        09795000
<<  0>> << status'cdb >>      %15,  << cdb for req status >>            09800000
                                                                        09805000
<<  0>> << loc & wrt cdb >>   %40,  << set unit >>                      09810000
<<  1>>                    %14000,  << set length zero >>               09815000
<<  2>>                         0,                                      09820000
<<  3>>                         2,  << loc & wrt >>                     09825000
                                                                        09830000
<<  0>> << initflg >>           0,  << initialization flag >>           09835000
<<  0>> << fill word >>         0,  << for fill w/zeros, blanks >>      09840000
                                                                        09845000
<<  0>> << desc area >> 0,0,0,0,0,  << describe area >>                 09850000
<<  5>>                 0,0,0,0,0,                                      09855000
                                                                        09860000
<<  0>> << cdb area >>  0,0,0,0,0,  << cdb area/desc area >>            09865000
<<  5>>                 0,0,0,0,0;                                      09870000
                                                                        09875000
$page                                                                   09880000
<<                                                                      09885000
         ***************************************                        09890000
         *                                     *                        09895000
         *   external procedure declarations   *                        09900000
         *                                     *                        09905000
         ***************************************                        09910000
>>                                                                      09915000
                                                                        09920000
   integer procedure getdrt(drtn,offset);                               09925000
     value drtn,offset;                                                 09930000
     integer drtn,offset;                                               09935000
     option external;                                                   09940000
                                                                        09945000
   integer procedure getsbuf(type);                                     09950000
     value type;                                                        09955000
     integer type;                                                      09960000
     option external;                                                   09965000
                                                                        09970000
   procedure gip'hpib;                                                  09975000
     option external;                                                   09980000
                                                                        09985000
   procedure help;                                                      09990000
     option external;                                                   09995000
                                                                        10000000
   logical procedure iomessage(setno,msgno,mask,p1,p2,p3,p4,p5,         10005000
                               dest,reply,offset,ditp,iotype);          10010000
     value setno,msgno,mask,p1,p2,p3,p4,p5,dest,reply,offset,           10015000
           ditp,iotype;                                                 10020000
     integer setno,msgno,mask,p1,p2,p3,p4,p5,dest,reply,offset;         10025000
     integer iotype;                                                    10030000
     integer pointer ditp;                                              10035000
     option variable, external;                                         10040000
                                                                        10045000
   procedure ldevnotrdy(ditp);                                          10050000
     value ditp;                                                        10055000
     pointer ditp;                                                      10060000
     option external;                                                   10065000
                                                                        10070000
                                                               <<03689>>10075000
   procedure disc'not'resp(ditp);                              <<03689>>10080000
     value ditp;                                               <<03689>>10085000
     pointer ditp;                                             <<03689>>10090000
     option external;                                          <<03689>>10095000
                                                               <<03689>>10100000
   procedure maint'request(ldev,type,subtype);                          10105000
     value ldev,type,subtype;                                           10110000
     integer ldev,type,subtype;                                         10115000
     option external;                                                   10120000
                                                                        10125000
   procedure siodm(ditp,flags);                                         10130000
     value ditp,flags;   logical flags;                                 10135000
     pointer ditp;   option external;                                   10140000
                                                                        10145000
   procedure start'hpib(ditp,siop,qflag);                               10150000
     value ditp,siop,qflag;   logical qflag;                            10155000
     pointer ditp,siop;   option external;                              10160000
                                                                        10165000
   procedure returnsbuf(sbufp);                                         10170000
     value sbufp;                                                       10175000
     integer sbufp;                                                     10180000
     option external;                                                   10185000
$page                                                                   10190000
<<       *********************************************                  10195000
         *                                           *                  10200000
         *   cs'80 driver initialization procedure   *                  10205000
         *                                           *                  10210000
         *********************************************                  10215000
>>                                                                      10220000
                                                                        10225000
   procedure csinit(ditp);                                              10230000
     integer array ditp;                                                10235000
                                                                        10240000
<<---------------------------------------------------->>                10245000
<<                                                    >>                10250000
<<   this procedure initializes the cs'80 channel     >>                10255000
<<   program area and sends out a device clear to     >>                10260000
<<   reset the drive to a known state.                >>                10265000
<<                                                    >>                10270000
<<---------------------------------------------------->>                10275000
                                                                        10280000
     begin                                                              10285000
                                                                        10290000
       integer pointer                                                  10295000
         iltp,      << ilt pointer >>                                   10300000
         siop,      << channel program pointer >>                       10305000
         istat;     << idle cp status pointer >>                        10310000
                                                                        10315000
       integer                                                          10320000
         lpdt2;     << lpdt - word 2 >>                                 10325000
                                                                        10330000
       logical                                                 <<06838>>10335000
         lpdt'index;                                           <<06838>>10340000
                                                               <<06838>>10345000
       disable;   << on entry - want csinit to complete >>              10350000
                                                                        10355000
       @iltp := ditp(diltp);        << iltp    >>                       10360000
       @siop := iltp(isiop);        << siop    >>                       10365000
       @istat := iltp(istap);       << istat   >>                       10370000
       ditp(rps'wordone) := ditp(rps'wordtwo) := 0;            <<06838>>10375000
       ditp(rps'wordone).rps'desirable := 1;                   <<06838>>10380000
                                                                        10385000
       if powerfail <> 0 then   << bypass init on powerfail >>          10390000
         return;                                                        10395000
                                                                        10400000
       if not logical(siop(initflg)) then                               10405000
         begin                                                          10410000
         lpdt'index:= ditp(dldev)*                             <<06838>>10415000
           size'of'lpdt'entry;                                 <<06838>>10420000
         lpdt2:= lpdt(lpdt'index+1);                           <<06838>>10425000
           ditp(dmisc).lock'flg := if lpdt2.pvbit=0 and                 10430000
             lpdt2.sfbit=0 then 1 else 0;                               10435000
                                                                        10440000
           siop(idle11) := @siop + sysdb + loc'wrt'cdb;                 10445000
           siop(dxfer4) := @siop + sysdb + cdb'area'wrd;                10450000
           siop(rstat4) := @siop + sysdb + stat'cdb;                    10455000
           siop(rstat11) := @istat + sysdb;                             10460000
                                                                        10465000
           siop(branchpt) := poncp;                                     10470000
           start'hpib(ditp,siop,false);                                 10475000
           ditp(dmisc).substate := idle'req'wait;                       10480000
                                                                        10485000
           siop(initflg) := true;                                       10490000
         end;                                                           10495000
                                                                        10500000
     end;                                                               10505000
<<---------------------------------------------------->>       <<06838>>10510000
<<                                                    >>       <<06838>>10515000
<<    check'date'code -- check if the current drive   >>       <<06838>>10520000
<<    has the pep firmware                            >>       <<06838>>10525000
<<                                                    >>       <<06838>>10530000
<<---------------------------------------------------->>       <<06838>>10535000
                                                               <<06838>>10540000
   procedure check'date'code(ditp,siop);                       <<06838>>10545000
     value ditp;                                               <<06838>>10550000
     integer pointer ditp;                                     <<06838>>10555000
     integer array  siop;                                      <<06838>>10560000
   begin                                                       <<06838>>10565000
     equate                                                    <<06838>>10570000
       init'util'rec'msg = 50,                                 <<06838>>10575000
       read'rev          = 195;                                <<06838>>10580000
                                                               <<06838>>10585000
     ditp(rps'wordone).local'state :=                          <<06838>>10590000
       if ditp(rps'wordone).read'rev'code'done = 1 then 0      <<06838>>10595000
       else doing'read'rev'code;                               <<06838>>10600000
     siop(cdb'area'wrd).(0:8) := cdb'set'unit;                 <<06838>>10605000
     siop(cdb'area'wrd).(8:8) := cdb'nop;                      <<06838>>10610000
     siop(cdb'area'wrd+1).(0:8) := init'util'rec'msg;          <<06838>>10615000
     siop(cdb'area'wrd+1).(8:8) := read'rev;                   <<06838>>10620000
                                                               <<06838>>10625000
     siop(dxfer1) := 4;                                        <<06838>>10630000
     siop(dxfer7) := read'exec'sec;                            <<06838>>10635000
     siop(dxfer8) := 10;                                       <<06838>>10640000
     siop(dxfer10).(8:8) := 0;                                 <<06838>>10645000
     siop(dxfer11) := @siop+sysdb+desc'area;                   <<06838>>10650000
     siop(branchpt) := dxfercp;                                <<06838>>10655000
                                                               <<06838>>10660000
     end;                                                      <<06838>>10665000
$page                                                                   10670000
<<       **********************************************                 10675000
         *                                            *                 10680000
         *   cs'80 disc driver procedure  -  csdrvr   *                 10685000
         *                                            *                 10690000
         **********************************************                 10695000
>>                                                                      10700000
                                                                        10705000
   integer procedure csdrvr(ioqp,ditp,bank,buffaddr,siop,drtn);         10710000
                                                                        10715000
<<--------------------------------------------------------->>           10720000
<<                                                         >>           10725000
<<   this procedure initiates and completes i/o requests   >>           10730000
<<   for the cs'80 discs connected to the hp-ib and con-   >>           10735000
<<   trolled by the general i/o channel (gic).             >>           10740000
<<                                                         >>           10745000
<<   mode returns in csdrvr -                              >>           10750000
<<     5 - request completed                               >>           10755000
<<     7 - not ready wait                                  >>           10760000
<<   %13 - wait for completion                             >>           10765000
<<                                                         >>           10770000
<<--------------------------------------------------------->>           10775000
                                                                        10780000
   value ditp,ioqp,bank,buffaddr,drtn;                                  10785000
   integer bank,buffaddr,drtn,ioqp;                            <<06838>>10790000
   integer pointer ditp;                                       <<06838>>10795000
   integer array siop;                                                  10800000
   option privileged,uncallable;                                        10805000
                                                                        10810000
   begin                                                                10815000
                                                                        10820000
     logical array                                                      10825000
       ditpl(*)= ditp;                                         <<06838>>10830000
                                                                        10835000
     logical pointer siop'base;                                <<06838>>10840000
     logical temp;                                             <<06838>>10845000
     logical x= x;                                             <<06838>>10850000
                                                                        10855000
     integer pointer                                                    10860000
       iltp,              << ilt pointer >>                             10865000
       cpvap = iltp,      << cp variable area ptr >>                    10870000
       istat,             << idle cp status ptr >>                      10875000
       idle'siop,         << idle cp start address >>                   10880000
       dsct;              << defective sector table ptr >>              10885000
                                                                        10890000
     double                                                             10895000
     abs'siop'addr,       << double absolute sio addr >>       <<07449>>10900000
       buffaddrd = q- 7;  << bank and buffer address >>                 10905000
                                                                        10910000
     double                                                    <<04702>>10915000
       ver'len;               << byte length of a verify >>    <<04702>>10920000
                                                               <<04702>>10925000
     logical                                                   <<04702>>10930000
       l1'ver'len=ver'len,    << first word of ver. len. >>    <<04702>>10935000
       l2'ver'len=ver'len+1;  << 2'nd  word of ver. len. >>    <<04702>>10940000
                                                               <<04702>>10945000
     double pointer                                                     10950000
       ddsct = dsct,                                                    10955000
       dditp = ditp,                                                    10960000
       dsiop = siop;                                                    10965000
                                                                        10970000
     logical                                                            10975000
     abs'cdb'area'wrd,    << command area address >>           <<07449>>10980000
     abs'dstat'addr,      << dstatus absolute address >>       <<07449>>10985000
       count,             << buffer transfer count >>                   10990000
       clda1,             << current logical disc addr1 >>              10995000
       clda2;             << current logical disc addr2 >>              11000000
                                                                        11005000
     integer                                                            11010000
       mstate = csdrvr,   << monitor state return >>                    11015000
       fcode,             << function code >>                           11020000
       index,             << index >>                                   11025000
       parm,              << parameter >>                               11030000
       sysdisc,           << system disc flag >>                        11035000
       sdisc,             << serial disc flag >>                        11040000
       foreign,           << foreign disc flag >>                       11045000
       subtype,           << disc subtype >>                            11050000
       no'entries,        << #entries in dsct >>                        11055000
       first'entry,       << first entry in dsct >>                     11060000
       max'entries;       << max #entries in dsct >>                    11065000
                                                                        11070000
     logical                                                   <<06838>>11075000
       indexl= index,                                          <<06838>>11080000
       lpdt'index;                                             <<06838>>11085000
                                                               <<06838>>11090000
       equate sbuf'dstn = %10;                                 <<06838>>11095000
       equate sbuf'dtrk'entry= 0;                              <<06838>>11100000
       equate sbuf'bank = sbuf'dstn* 4+ 2;                     <<06838>>11105000
       equate sbuf'addr = sbuf'dstn* 4+ 3;                     <<06838>>11110000
       logical sbuf'entry'index;                               <<06838>>11115000
define sbuf'num'dtrk = sbf(sbuf'entry'index+ sbuf'dtrk'entry)#;<<06838>>11120000
       logical pointer dst = 2;                                <<06838>>11125000
                                                               <<06838>>11130000
       logical drq'entry'index;                                <<06838>>11135000
$page                                                                   11140000
<<****************************************************>>                11145000
<<                                                    >>                11150000
<<   cs'80 disc driver subroutines                    >>                11155000
<<                                                    >>                11160000
<<****************************************************>>                11165000
                                                                        11170000
<<------------------------------------------------------>>     <<06838>>11175000
<<                                                      >>     <<06838>>11180000
<<   siopb -- subroutine to store the cs80              >>     <<06838>>11185000
<<            command bytes into the channel            >>     <<06838>>11190000
<<            program area.                             >>     <<06838>>11195000
<<                                                      >>     <<06838>>11200000
<<------------------------------------------------------>>     <<06838>>11205000
                                                               <<06838>>11210000
   subroutine siopb(byte'offset,abyte);                        <<06838>>11215000
     value byte'offset,abyte;                                  <<06838>>11220000
     logical byte'offset,abyte;                                <<06838>>11225000
                                                               <<06838>>11230000
     begin                                                     <<06838>>11235000
     setdb'siop;                                               <<07449>>11240000
     siodb'byte'array(byte'offset) := abyte;                   <<07449>>11245000
     setdb'sys;                                                <<07449>>11250000
                                                               <<07449>>11255000
     end;                                                      <<06838>>11260000
                                                               <<06838>>11265000
<<---------------------------------------------------->>                11270000
<<                                                    >>                11275000
<<   set'byte'count -- subroutine to determine the    >>                11280000
<<                     transfer count in bytes.       >>                11285000
<<                                                    >>                11290000
<<---------------------------------------------------->>                11295000
                                                                        11300000
     subroutine set'byte'count;                                         11305000
                                                                        11310000
       begin                                                            11315000
         tos:= drq'count;                                      <<06838>>11320000
         if < then   << byte count >>                                   11325000
           count := -tos                                                11330000
         else   << word count >>                                        11335000
           count := tos & lsl(1);  << make byte >>                      11340000
       end;                                                             11345000
                                                                        11350000
<<---------------------------------------------------->>                11355000
<<                                                    >>                11360000
<<   set'cmd'bytes -- subroutine to set up the        >>                11365000
<<                    command data bytes for read     >>                11370000
<<                    and write operations.           >>                11375000
<<                                                    >>                11380000
<<---------------------------------------------------->>                11385000
                                                                        11390000
     subroutine set'cmd'bytes;                                          11395000
                                                                        11400000
       begin                                                            11405000
         setdb'siop;                                           <<07449>>11410000
         siodb'byte'array(cdb'area'byte) := cdb'set'unit;      <<07449>>11415000
                                                               <<07449>>11420000
         siodb'byte'array(cdb'byte'1) := cdb'set'sngl'vec;     <<07449>>11425000
         siodb'byte'array(cdb'byte'2) := 0;                    <<07449>>11430000
         siodb'byte'array(cdb'byte'3) := 0;                    <<07449>>11435000
         siodb'byte'array(cdb'byte'4) := clda1.(0:8);          <<07449>>11440000
         siodb'byte'array(cdb'byte'5) := clda1.(8:8);          <<07449>>11445000
         siodb'byte'array(cdb'byte'6) := clda2.(0:8);          <<07449>>11450000
         siodb'byte'array(cdb'byte'7) := clda2.(8:8);          <<07449>>11455000
                                                               <<07449>>11460000
         siodb'byte'array(cdb'byte'8) := cdb'set'length;       <<07449>>11465000
         siodb'byte'array(cdb'byte'9) := 0;                    <<07449>>11470000
         siodb'byte'array(cdb'byte'10) := 0;                   <<07449>>11475000
         siodb'byte'array(cdb'byte'11) := count.(0:8);         <<07449>>11480000
         siodb'byte'array(cdb'byte'12) := count.(8:8);         <<07449>>11485000
         setdb'sys;                                            <<07449>>11490000
       end;                                                             11495000
                                                                        11500000
<<---------------------------------------------------->>                11505000
<<                                                    >>                11510000
<<   log'cpvap -- log channel error word (cpva 0)     >>                11515000
<<             -- log cp relative offset location     >>                11520000
<<                                                    >>                11525000
<<---------------------------------------------------->>                11530000
                                                                        11535000
       subroutine log'cpvap;                                            11540000
                                                                        11545000
       begin                                                            11550000
         ditp(dserr) := [8/2,8/dlogerror];                              11555000
         ditp(dlogerror) := cpvap;                                      11560000
         ditp(dsiopstop) := getdrt(drtn,0) - (@siop + sysdb);           11565000
       end;                                                             11570000
                                                                        11575000
<<---------------------------------------------------->>                11580000
<<                                                    >>                11585000
<<   clear'status -- clear 20 bytes of status in dit  >>                11590000
<<                                                    >>                11595000
<<---------------------------------------------------->>                11600000
                                                                        11605000
       subroutine clear'status;                                         11610000
                                                                        11615000
       begin                                                            11620000
         index := dstatus;                                              11625000
         do ditp(index) := 0 until                                      11630000
           (index := index + 1) > dstatus + 9;                          11635000
       end;                                                             11640000
                                                                        11645000
<<---------------------------------------------------->>                11650000
<<                                                    >>                11655000
<<   update'xfer'cnt -- update transfer count         >>                11660000
<<                                                    >>                11665000
<<---------------------------------------------------->>                11670000
                                                                        11675000
       subroutine update'xfer'cnt;                                      11680000
                                                                        11685000
       begin                                                            11690000
         if siop(dxfer8) <> 0 then                                      11695000
           begin                                                        11700000
             count := drq'count;                               <<07101>>11705000
             if < then                                                  11710000
               drq'count:= integer(count) + siop(dxfer8)       <<07101>>11715000
             else                                                       11720000
               drq'count:= (integer(count) & lsl(1) -          <<07101>>11725000
                              siop(dxfer8)) / 2;                        11730000
           end;                                                         11735000
       end;                                                             11740000
                                                                        11745000
<<---------------------------------------------------->>                11750000
<<                                                    >>                11755000
<<   return'sysbuf -- return system buffer element    >>                11760000
<<                                                    >>                11765000
<<---------------------------------------------------->>                11770000
                                                                        11775000
       subroutine return'sysbuf;                                        11780000
                                                                        11785000
       begin                                                            11790000
         tos := ditp(dsbufaddr);                                        11795000
         if <> then                                                     11800000
           begin                                                        11805000
             returnsbuf(*);                                             11810000
             ditp(dsbufaddr) := 0;                                      11815000
           end else del;                                                11820000
       end;                                                             11825000
                                                                        11830000
                                                               <<04702>>11835000
<<---------------------------------------------------->>       <<04702>>11840000
<<                                                    >>       <<04702>>11845000
<<   release request/required handling:               >>       <<04702>>11850000
<<                                                    >>       <<04702>>11855000
<<---------------------------------------------------->>       <<04702>>11860000
                                                               <<04702>>11865000
logical subroutine release'necessary;                          <<04702>>11870000
  begin                                                        <<04702>>11875000
         release'necessary := false;                           <<04702>>11880000
         if ditp(fault'field).int'maint'reqrd or               <<04702>>11885000
            ditp(infor'field).oper'rel'reqst or                <<04702>>11890000
            ditp(infor'field).diag'rel'reqst or                <<04702>>11895000
            ditp(infor'field).int'maint'reqst then             <<04702>>11900000
                                                               <<04702>>11905000
            begin                                              <<04702>>11910000
                                                               <<04702>>11915000
              if drq'qmisc.retry'count= 7 then                 <<06838>>11920000
                goto uniterror;                                <<04702>>11925000
              drq'qmisc.retry'count:=                          <<06838>>11930000
              drq'qmisc.retry'count+ 1;                        <<06838>>11935000
                                                               <<04702>>11940000
              release'necessary := true;                       <<04702>>11945000
              if fcode=verify and                              <<04702>>11950000
                ditp(access'field).unrecov'data then           <<04702>>11955000
                                                               <<04702>>11960000
                begin                                          <<04702>>11965000
                  tos := buffaddrd;                            <<04702>>11970000
                  tos := ditp(parm'field+1);   << bad blk >>   <<04702>>11975000
                  tos := ditp(parm'field+2);   << address >>   <<04702>>11980000
                  assemble(sdea;ddel);                         <<06838>>11985000
                  ditp(dbadxfer) := 0;                         <<04702>>11990000
                  drq'qmisc.ver'err'flg:= 1;                   <<06838>>11995000
                end;                                           <<04702>>12000000
                                                               <<04702>>12005000
              siop(diag) := wrt'cmd'sec;                       <<04702>>12010000
              siop(diag1) := 2;   << cdb byte count >>         <<04702>>12015000
              siop(diag3) := %2000;                            <<04702>>12020000
              siop(diag4) := @siop + sysdb + cdb'area'wrd;     <<04702>>12025000
              siop(diag5) := %1000;                            <<04702>>12030000
              siop(diag6) := 0;                                <<04702>>12035000
              siopb(cdb'area'byte, cdb'set'unit + ctrl'unit);  <<04702>>12040000
                                                               <<04702>>12045000
              siopb(cdb'area'byte+1,                           <<04702>>12050000
                if ditp(fault'field).int'maint'reqrd or        <<04702>>12055000
                   ditp(infor'field).int'maint'reqst or        <<04702>>12060000
                   ditp(infor'field).oper'rel'reqst and        <<04702>>12065000
                   ditp(access'field).dev'not'rdy or           <<04702>>12070000
                   ditp(infor'field).oper'rel'reqst and        <<04702>>12075000
                   ditp(dmisc).lock'flg <> 1 then              <<04702>>12080000
                     cdb'release                               <<04702>>12085000
                   else                                        <<04702>>12090000
                     cdb'release'deny);  << end subr. call >>  <<04702>>12095000
                                                               <<04702>>12100000
              if ditp(infor'field).oper'rel'reqst then         <<04702>>12105000
                drq'qmisc.oper'req'flg:= 1;                    <<06838>>12110000
              if ditp(fault'field).int'maint'reqrd then        <<04702>>12115000
                drq'qmisc.im'fault'flg:= 1;                    <<06838>>12120000
              if ditp(access'field).dev'not'rdy then           <<04702>>12125000
                drq'qmisc.load'flg:= 1;                        <<06838>>12130000
                                                               <<04702>>12135000
              siop(branchpt) := diagcp;  << schedule release >><<04702>>12140000
              start'hpib(ditp,siop,true); << or release deny >><<04702>>12145000
              if < then                                        <<04702>>12150000
                goto sioerror;                                 <<04702>>12155000
              drq'qmisc.waitcode:= rel'wait;                   <<06838>>12160000
              mstate := intrptwait;                            <<04702>>12165000
            end;                                               <<04702>>12170000
                                                               <<04702>>12175000
end;   << release'necessary >>                                 <<04702>>12180000
                                                               <<06838>>12185000
                                                               <<06838>>12190000
<<---------------------------------------------------->>       <<06838>>12195000
<<                                                    >>       <<06838>>12200000
<<   set'rps -- enable rps                            >>       <<06838>>12205000
<<                                                    >>       <<06838>>12210000
<<---------------------------------------------------->>       <<06838>>12215000
                                                               <<06838>>12220000
       subroutine set'rps;                                     <<06838>>12225000
                                                               <<06838>>12230000
       begin                                                   <<06838>>12235000
         siop(diag1) := 4;                                     <<06838>>12240000
         siop(cdb'area'wrd).(0:8) := cdb'set'unit;             <<06838>>12245000
         siop(cdb'area'wrd).(8:8) := cdb'set'rps;              <<06838>>12250000
         siop(cdb'area'wrd+1).(0:8) := ditp(rps'wordtwo).(0:8);<<06838>>12255000
         siop(cdb'area'wrd+1).(8:8) := ditp(rps'wordtwo).(8:8);<<06838>>12260000
                                                               <<06838>>12265000
         siop(branchpt) := diagcp;                             <<06838>>12270000
       end;                                                    <<06838>>12275000
                                                               <<06838>>12280000
$page                                                                   12285000
<<****************************************************>>                12290000
<<                                                    >>                12295000
<<   cs'80 disc driver initiator section              >>                12300000
<<                                                    >>                12305000
<<****************************************************>>                12310000
                                                               <<06838>>12315000
do'external'request:                                           <<06838>>12320000
                                                               <<06838>>12325000
                                                               <<06838>>12330000
     @siop'base:= @siop;                                       <<06838>>12335000
                                                               <<06838>>12340000
     @iltp := ditp(diltp);         << iltp        >>                    12345000
     drq'entry'index:= ioqp;       << drq offset  >>           <<06838>>12350000
     fcode:= drq'func;             << fcode       >>           <<06838>>12355000
     @istat := iltp(istap);        << istat       >>                    12360000
     @idle'siop := @siop + idle;   << idle'siop   >>                    12365000
     abs'dstat'addr := @ditp + sysdb + dstatus;                <<07449>>12370000
     abs'cdb'area'wrd := @siop + sysdb + cdb'area'wrd;         <<07449>>12375000
     abs'siop'addr := double(logical(@siop + sysdb));          <<07449>>12380000
     @dsct := 0;                   << dsct        >>                    12385000
                                                                        12390000
     count := 0;                   << count       >>                    12395000
     clda1 := 0;                   << clda1       >>                    12400000
     clda2 := 0;                   << clda2       >>                    12405000
                                                                        12410000
     index := 0;                   << index       >>                    12415000
     parm := 0;                    << parm        >>                    12420000
     sysdisc := 0;                 << sysdisc     >>                    12425000
     sdisc := 0;                   << sdisc       >>                    12430000
     foreign := 0;                 << foreign     >>                    12435000
     subtype := 0;                 << subtype     >>                    12440000
     no'entries := 0;              << no'entries  >>                    12445000
     first'entry := 0;             << first'entry >>                    12450000
     max'entries := 0;             << max'entries >>                    12455000
                                                                        12460000
<<---------------------------------------------------->>                12465000
<<   assure that initialization section called        >>                12470000
<<---------------------------------------------------->>                12475000
                                                                        12480000
     if not logical(siop(initflg)) then                                 12485000
       begin                                                            12490000
         csinit(ditp);                                                  12495000
         if mstate= 2 then if drq'entry'index <> 0 then        <<06838>>12500000
           begin                                                        12505000
             drq'qmisc.waitcode:= ioq'defer'wait;              <<06838>>12510000
             mstate := intrptwait;                                      12515000
             return;                                                    12520000
           end;                                                         12525000
       end;                                                             12530000
                                                                        12535000
<<---------------------------------------------------->>                12540000
<<   system disc or non-system disc and subtype       >>                12545000
<<---------------------------------------------------->>                12550000
                                                                        12555000
     lpdt'index:= ditp(dldev)*                                 <<06838>>12560000
       size'of'lpdt'entry;                                     <<06838>>12565000
     parm:= lpdt(lpdt'index+1);                                <<06838>>12570000
                                                                        12575000
     sysdisc := if parm.pvbit=0 and parm.sfbit=0 then                   12580000
       1 else 0;   << system disc >>                                    12585000
     sdisc := if parm.sfbit=2 then                                      12590000
       1 else 0;   << serial disc >>                                    12595000
     foreign := if parm.sfbit=3 then                                    12600000
       1 else 0;   << foreign disc >>                                   12605000
                                                                        12610000
     subtype := parm.stype;   << disc subtype >>                        12615000
                                                                        12620000
<<---------------------------------------------------->>                12625000
<<   no ioq - service special conditions or           >>                12630000
<<          - schedule an idle channel program        >>                12635000
<<---------------------------------------------------->>                12640000
                                                                        12645000
     if mstate= 2 then if drq'entry'index = 0 then             <<06838>>12650000
                                                                        12655000
       begin                                                            12660000
                                                                        12665000
        if cpvap.errorcode=6 or    <<  dma abort    >>         <<03689>>12670000
          cpvap.errorcode=7 then   << channel abort >>         <<03689>>12675000
           go to idle'not'ready;                               <<03689>>12680000
         if cpvap(1).(12:4) = 1 then   << status diagnosis >>           12685000
                                                                        12690000
           begin                                                        12695000
             cpvap(1).(12:4) := 0;                                      12700000
                                                                        12705000
             if istat(i'fault'field).power'fail then                    12710000
               goto idle'pon;                                           12715000
                                                                        12720000
             if istat(i'fault'field).int'maint'reqrd or                 12725000
                istat(i'infor'field).oper'rel'reqst or                  12730000
                istat(i'infor'field).diag'rel'reqst or                  12735000
                istat(i'infor'field).int'maint'reqst then               12740000
                                                                        12745000
               begin   << release/release deny request >>               12750000
                 siop(diag) := wrt'cmd'sec;                             12755000
                 siop(diag1) := 2;                                      12760000
                 siop(diag3) := %2000;                                  12765000
                 siop(diag4) := @siop + sysdb + cdb'area'wrd;           12770000
                 siop(diag5) := %1000;                                  12775000
                 siop(diag6) := 0;                                      12780000
                                                                        12785000
                 siopb(cdb'area'byte, cdb'set'unit             <<03717>>12790000
                   + ctrl'unit);                               <<03717>>12795000
                 siopb(cdb'area'byte+1,                        <<03717>>12800000
                   if istat(i'fault'field).int'maint'reqrd or           12805000
                      istat(i'infor'field).int'maint'reqst or           12810000
                      istat(i'infor'field).oper'rel'reqst and           12815000
                      istat(i'access'field).dev'not'rdy or              12820000
                      istat(i'infor'field).oper'rel'reqst and           12825000
                      ditp(dmisc).lock'flg <> 1 then                    12830000
                        cdb'release                                     12835000
                      else                                              12840000
                        cdb'release'deny);                     <<03717>>12845000
                                                                        12850000
                 if istat(i'infor'field).oper'rel'reqst and             12855000
                   ditp(dmisc).lock'flg = 1 and                         12860000
                   istat(i'access'field).not'rdy = 0 then               12865000
                                                                        12870000
                   begin                                                12875000
                     if sysdisc=1 then index := sys'deny'msg            12880000
                       else index := nsys'deny'msg;                     12885000
                     iomessage(1,index,%10000,ditp(dldev),     <<06838>>12890000
                               ,,,,opconsole);                          12895000
                   end;                                                 12900000
                                                                        12905000
                 if istat(i'infor'field).oper'rel'reqst or     <<03689>>12910000
                    istat(i'access'field).dev'not'rdy  then    <<03689>>12915000
                   ditp(dmisc).ignore'int'flg := 0                      12920000
                 else                                                   12925000
                   ditp(dmisc).ignore'int'flg := 1;                     12930000
                                                                        12935000
                 siop(branchpt) := diagcp;                              12940000
                 start'hpib(ditp,siop,true);                            12945000
                 ditp(dmisc).substate := idle'req'wait;                 12950000
                 mstate := requestdone;                                 12955000
                 return;                                                12960000
               end;                                                     12965000
                                                                        12970000
             if istat(i'infor'field).maint'trk'ov then                  12975000
               begin                                                    12980000
                 maint'request(ditp(dldev),type,subtype);      <<06838>>12985000
                 goto idle'cp;                                          12990000
               end;                                                     12995000
                                                                        13000000
           end;                                                         13005000
                                                                        13010000
         if cpvap(1).(12:4) = 4 then   << idle pon occurred >>          13015000
  idle'pon:                                                             13020000
           begin                                                        13025000
             cpvap(1).(12:4) := 0;                                      13030000
             siop(branchpt) := poncp;   << device clear >>              13035000
             << must start. dsj qstat locked to 2 must s.d.c.>><<03773>>13040000
             start'hpib(ditp,siop(firstbranch),true);          <<03773>>13045000
             ditp(dmisc).ignore'int'flg := 0;                           13050000
             ditp(dmisc).substate := idle'req'wait;                     13055000
             mstate := requestdone;                                     13060000
             return;                                                    13065000
           end;                                                         13070000
                                                                        13075000
  idle'cp:                                                              13080000
         if ditp(dmisc).substate = idle'req'wait then                   13085000
           ditp(dmisc).substate := 0    << idle wait done >>   <<03689>>13090000
          else ditp(dmisc).ignore'int'flg := 1;                <<03689>>13095000
         siop(rstat11) := @istat + sysdb;                               13100000
                                                                        13105000
         cpvap(1).(12:4) := 0;                                          13110000
         start'hpib(ditp,siop(idle'wait),false);               <<03760>>13115000
         mstate := requestdone;                                         13120000
         return;                                                        13125000
                                                                        13130000
       end;                                                             13135000
                                                                        13140000
<<---------------------------------------------------->>                13145000
<<   idle request currently being serviced, defer     >>                13150000
<<   current request until idle request completed     >>                13155000
<<---------------------------------------------------->>                13160000
                                                                        13165000
     if mstate=2 and ditp(dmisc).substate=idle'req'wait then            13170000
       begin                                                            13175000
         drq'qmisc.waitcode:= ioq'defer'wait;                  <<06838>>13180000
         mstate := intrptwait;                                          13185000
         return;                                                        13190000
       end;                                                             13195000
                                                                        13200000
<<---------------------------------------------------->>                13205000
<<   map from external to internal function code      >>                13210000
<<                                                    >>                13215000
<<   function code 15 --> internal code 7             >>                13220000
<<   function code 11 --> internal code 9             >>                13225000
<<                                                    >>                13230000
<<   function code 13-14 --> internal code 10-11      >>                13235000
<<   function code 16-18 --> internal code 12-14      >>                13240000
<<   function code 72-94 --> internal code 15-37      >>                13245000
<<---------------------------------------------------->>                13250000
                                                                        13255000
     if (9 <= fcode <= 10) then goto invalidfunc;                       13260000
     if fcode=12 then goto invalidfunc;                                 13265000
                                                                        13270000
     if fcode=11 then fcode := 9 else                                   13275000
     if (13 <= fcode <= 14) then fcode := fcode - 3 else                13280000
     if fcode=15 then fcode := 7 else                                   13285000
     if (16 <= fcode <= 18) then fcode := fcode - 4 else                13290000
     if (72 <= fcode <= 99) then fcode := fcode - 57;          <<06838>>13295000
     if not (0 <= fcode <= 42) then goto invalidfunc;          <<06838>>13300000
                                                                        13305000
<<---------------------------------------------------->>                13310000
<<   ioq deferred request completion - redo request   >>                13315000
<<---------------------------------------------------->>                13320000
                                                                        13325000
    if drq'qmisc.waitcode= ioq'defer'wait then                 <<06838>>13330000
       begin                                                            13335000
         ditp(dmisc).substate := 0;   << reset substate >>              13340000
         if istat(i'infor'field).maint'trk'ov then                      13345000
           maint'request(ditp(dldev),type,subtype);            <<06838>>13350000
         goto retry'request;                                            13355000
       end;                                                             13360000
                                                                        13365000
<<---------------------------------------------------->>                13370000
<<   not ready completion - go to completor section   >>                13375000
<<---------------------------------------------------->>                13380000
                                                                        13385000
     if drq'qmisc.waitcode= not'rdy'wait then                  <<06838>>13390000
       goto continuator;                                                13395000
                                                                        13400000
$page                                                                   13405000
<<---------------------------------------------------->>                13410000
<<   initiator call - initialize or reset variables   >>                13415000
<<                    possibly changed in last req.   >>                13420000
<<                  - case to a driver function code  >>                13425000
<<---------------------------------------------------->>                13430000
                                                                        13435000
if mstate=2 then                                                        13440000
                                                                        13445000
  begin                                                                 13450000
                                                               <<06838>>13455000
do'local'request:                                              <<06838>>13460000
                                                               <<06838>>13465000
    if ditp(rps'wordone).read'rev'code'done = 0 then           <<06838>>13470000
        fcode := read'rev'func;                                <<06838>>13475000
    if ditp(rps'wordone).rps'desirable = 1 and                 <<06838>>13480000
       ditp(rps'wordone).rps'datecode = 1 and                  <<06838>>13485000
       ditp(rps'wordone).rps'enabled = 0 then                  <<06838>>13490000
       begin                                                   <<06838>>13495000
         fcode := set'rps'default;                             <<06838>>13500000
         ditp(rps'wordone).local'state := doing'set'rps;       <<06838>>13505000
       end;                                                    <<06838>>13510000
                                                                        13515000
    if fcode <> req'stat or                                             13520000
       fcode <> diag'result then clear'status;                          13525000
  << initialize marginal data flag >>                          <<04985>>13530000
    ditp(dmisc).processing'md := false;                        <<04985>>13535000
                                                                        13540000
  retry'request:                                                        13545000
                                                               <<07449>>13550000
    setdb'siop;                                                <<07449>>13555000
    siodb'rstat11 := abs'dstat'addr;                           <<07449>>13560000
    siodb'dxfer := wrt'cmd'sec;                                <<07449>>13565000
    siodb'dxfer5 := siodb'dxfer12 := %1000;                    <<07449>>13570000
    siodb'dxfer6 := siodb'dxfer13 := 0;                        <<07449>>13575000
    siodb'dxfer10 := 0;                                        <<07449>>13580000
    siodb'diag := wrt'cmd'sec;                                 <<07449>>13585000
    siodb'diag3 := %2000;                                      <<07449>>13590000
    siodb'diag4 := abs'cdb'area'wrd;                           <<07449>>13595000
    siodb'diag5 := %1000;                                      <<07449>>13600000
    siodb'diag6 := 0;                                          <<07449>>13605000
    siodb'ident2 := %601;                                      <<07449>>13610000
    siodb'ident3 := 0;                                         <<07449>>13615000
                                                               <<07449>>13620000
    index := cdb'area'wrd;                                     <<07449>>13625000
    do siopdb(index) := 0 until   << zero cdb area >>          <<07449>>13630000
      (index := index + 1) > cdb'area'wrd+9;                   <<07449>>13635000
    setdb'sys;                                                 <<07449>>13640000
                                                               <<07449>>13645000
$page                                                                   13650000
    case fcode of                                                       13655000
     begin                                                              13660000
                                                                        13665000
<<--------------------------------------------------------->>           13670000
<<                                                         >>           13675000
<<   fcode   function                    internal fcode    >>           13680000
<<   -----   --------                    --------------    >>           13685000
<<                                                         >>           13690000
<<      0    read                              0           >>           13695000
<<      1    write                             1           >>           13700000
<<      2    file open                         2           >>           13705000
<<      3    file close                        3           >>           13710000
<<      4    device close                      4           >>           13715000
<<      5    fill with zero                    5           >>           13720000
<<      6    file with blanks                  6           >>           13725000
<<   7,15    request status                    7           >>           13730000
<<      8    initialize media                  8           >>           13735000
<<     11    write disc label                  9           >>           13740000
<<     13    request volume limit             10           >>           13745000
<<     14    verify                           11           >>           13750000
<<     16    lock                             12           >>           13755000
<<     17    unlock                           13           >>           13760000
<<     18    read lock bit                    14           >>           13765000
<<                                                         >>           13770000
<<     72    identify                         15           >>           13775000
<<     73    initiate diagnostic              16           >>           13780000
<<     74    diagnostic result                17           >>           13785000
<<     75    loopback write                   18           >>           13790000
<<     76    loopback read                    19           >>           13795000
<<     77    general purpose command          20           >>           13800000
<<     78    describe                         21           >>           13805000
<<     79    release                          22           >>           13810000
<<     80    release denied                   23           >>           13815000
<<     81    set release                      24           >>           13820000
<<     82    set address                      25           >>           13825000
<<     83    set block displacement           26           >>           13830000
<<     84    set mask status                  27           >>           13835000
<<     85    set return addressing mode       28           >>           13840000
<<     86    set retry time                   29           >>           13845000
<<     87    set rps                          30           >>           13850000
<<     88    spare block                      31           >>           13855000
<<     89    read at physical address         32           >>           13860000
<<     90    write at physical address        33           >>           13865000
<<     91    initiate utility                 34           >>           13870000
<<     92    device clear                     35           >>           13875000
<<     93    cancel transaction               36           >>           13880000
<<     94    parity checking                  37           >>           13885000
<<                                                         >>           13890000
<<--------------------------------------------------------->>           13895000
                                                                        13900000
$page                                                                   13905000
<<---------------------------------------------------->>                13910000
<<                                                    >>                13915000
<<   read [function code = 0]                         >>                13920000
<<                                                    >>                13925000
<<   count - transfer count                           >>                13930000
<<   bank & buffaddr - contains data read             >>                13935000
<<   p1 - high order dbl word logical sector address  >>                13940000
<<   p2 - low order dbl word logical sector address   >>                13945000
<<                                                    >>                13950000
<<---------------------------------------------------->>                13955000
                                                                        13960000
     begin                                                              13965000
                                                                        13970000
       << p1 = ioqp(qpar1) = clda1 >>                                   13975000
       << p2 = ioqp(qpar2) = clda2 >>                                   13980000
                                                                        13985000
       clda1:= drq'parm1;     <<logical sector addr1 >>        <<06838>>13990000
       clda2:= drq'parm2;     <<logical sector addr2 >>        <<06838>>13995000
                                                                        14000000
       set'byte'count;                                                  14005000
       set'cmd'bytes;                                                   14010000
                                                               <<07449>>14015000
       setdb'siop;                                             <<07449>>14020000
       siodb'dxfer1 := 14;   << cdb byte count >>              <<07449>>14025000
                                                               <<07449>>14030000
       if count=0 then   << no transfer count >>               <<07449>>14035000
                                                               <<07449>>14040000
         begin                                                 <<07449>>14045000
           siodb'dxfer5 := 0;   << bypass exec msg >>          <<07449>>14050000
           siodb'dxfer6 := 5;   << jump *+5 >>                 <<07449>>14055000
         end                                                   <<07449>>14060000
                                                               <<07449>>14065000
       else   << set up executing message >>                   <<07449>>14070000
                                                               <<07449>>14075000
         begin                                                 <<07449>>14080000
           siodb'dxfer7 := read'exec'sec;                      <<07449>>14085000
           siodb'dxfer8 := count;   << data byte count >>      <<07449>>14090000
           siodb'dxfer10.(8:8) := bank;   << data bank >>      <<07449>>14095000
           siodb'dxfer11 := buffaddr;<< data buffer abs adr >> <<07449>>14100000
         end;                                                  <<07449>>14105000
                                                               <<07449>>14110000
       siodb'byte'array(cdb'byte'13) := cdb'read;              <<07449>>14115000
                                                               <<07449>>14120000
       siodb'branchpt := dxfercp;                              <<07449>>14125000
       setdb'sys;                                              <<07449>>14130000
                                                               <<07449>>14135000
     end;                                                      <<07449>>14140000
$page                                                          <<07449>>14145000
<<---------------------------------------------------->>       <<07449>>14150000
<<                                                    >>       <<07449>>14155000
<<   write [function code = 1]                        >>       <<07449>>14160000
<<                                                    >>       <<07449>>14165000
<<   count - transfer count                           >>       <<07449>>14170000
<<   bank & buffaddr - contains data for write        >>       <<07449>>14175000
<<   p1 - high order dbl word logical sector address  >>       <<07449>>14180000
<<   p2 - low order dbl word logical sector address   >>       <<07449>>14185000
<<                                                    >>       <<07449>>14190000
<<---------------------------------------------------->>       <<07449>>14195000
                                                               <<07449>>14200000
     begin                                                     <<07449>>14205000
                                                               <<07449>>14210000
       << p1 = ioqp(qpar1) = clda1 >>                          <<07449>>14215000
       << p2 = ioqp(qpar2) = clda2 >>                          <<07449>>14220000
                                                               <<07449>>14225000
       clda1 := drq'parm1;     << logical sector addr1 >>      <<07449>>14230000
       clda2 := drq'parm2;     << logical sector addr2 >>      <<07449>>14235000
                                                               <<07449>>14240000
       << write to disc label (sector 0) invalid >>            <<07449>>14245000
                                                               <<07449>>14250000
       if foreign=0 and clda1=0 and clda2=0 then               <<07449>>14255000
         goto invalidfunc;                                     <<07449>>14260000
                                                               <<07449>>14265000
       set'byte'count;                                         <<07449>>14270000
       set'cmd'bytes;                                          <<07449>>14275000
                                                               <<07449>>14280000
       setdb'siop;                                             <<07449>>14285000
       siodb'dxfer1 := 14;   << cdb byte count >>              <<07449>>14290000
                                                               <<07449>>14295000
       if count=0 then   << no transfer count >>               <<07449>>14300000
                                                               <<07449>>14305000
         begin                                                 <<07449>>14310000
           siodb'dxfer5 := 0;   << bypass exec msg >>          <<07449>>14315000
           siodb'dxfer6 := 5;   << jump *+5 >>                 <<07449>>14320000
         end                                                   <<07449>>14325000
                                                               <<07449>>14330000
       else   << set up executing message >>                   <<07449>>14335000
                                                               <<07449>>14340000
         begin                                                 <<07449>>14345000
           siodb'dxfer7 := wrt'exec'sec;                       <<07449>>14350000
           siodb'dxfer8 := count;   << data byte count >>      <<07449>>14355000
           siodb'dxfer10.(8:8) := bank;   << data bank >>      <<07449>>14360000
           siodb'dxfer11 := buffaddr;<< data buffer abs adr >> <<07449>>14365000
         end;                                                  <<07449>>14370000
                                                               <<07449>>14375000
       siodb'byte'array(cdb'byte'13) := cdb'write;             <<07449>>14380000
                                                               <<07449>>14385000
       siodb'branchpt := dxfercp;                              <<07449>>14390000
       setdb'sys;                                              <<07449>>14395000
                                                               <<07449>>14400000
     end;                                                               14405000
$page                                                                   14410000
<<---------------------------------------------------->>                14415000
<<                                                    >>                14420000
<<   file open [function code = 2]                    >>                14425000
<<                                                    >>                14430000
<<---------------------------------------------------->>                14435000
                                                                        14440000
     begin                                                              14445000
       goto goodxfer;                                                   14450000
     end;                                                               14455000
                                                                        14460000
                                                                        14465000
<<---------------------------------------------------->>                14470000
<<                                                    >>                14475000
<<   file close [function code = 3]                   >>                14480000
<<                                                    >>                14485000
<<---------------------------------------------------->>                14490000
                                                                        14495000
     begin                                                              14500000
       goto goodxfer;                                                   14505000
     end;                                                               14510000
                                                                        14515000
                                                                        14520000
<<---------------------------------------------------->>                14525000
<<                                                    >>                14530000
<<   device close [function code = 4]                 >>                14535000
<<                                                    >>                14540000
<<---------------------------------------------------->>                14545000
                                                                        14550000
     begin                                                              14555000
       goto goodxfer;                                                   14560000
     end;                                                               14565000
                                                                        14570000
$page                                                                   14575000
<<---------------------------------------------------->>                14580000
<<                                                    >>                14585000
<<   fill with zeros [function code = 5]              >>                14590000
<<                                                    >>                14595000
<<   count - transfer count                           >>                14600000
<<   p1 - high order dbl word logical sector address  >>                14605000
<<   p2 - low order dbl word logical sector address   >>                14610000
<<                                                    >>                14615000
<<---------------------------------------------------->>                14620000
                                                                        14625000
     begin                                                              14630000
                                                                        14635000
       << p1 = ioqp(qpar1) = clda1 >>                                   14640000
       << p2 = ioqp(qpar2) = clda2 >>                                   14645000
                                                                        14650000
       clda1:= drq'parm1;     <<logical sector addr1 >>        <<06838>>14655000
       clda2:= drq'parm2;     <<logical sector addr2 >>        <<06838>>14660000
                                                                        14665000
       << write to disc label (sector 0) invalid >>                     14670000
                                                                        14675000
       if foreign=0 and clda1=0 and clda2=0 then                        14680000
         goto invalidfunc;                                              14685000
                                                                        14690000
       set'byte'count;                                                  14695000
       if count=0 then goto invalidfunc;                                14700000
       set'cmd'bytes;                                                   14705000
                                                                        14710000
       siop(dxfer1) := 14;   << cdb byte count >>                       14715000
       siop(dxfer7) := wrt'exec'sec;                                    14720000
       siop(dxfer8) := count;   << fill byte count >>                   14725000
       siop(dxfer10).sabit := 1;   << wrt from single addr >>           14730000
       siop(dxfer10).(8:8) := 0;                                        14735000
       siop(dxfer11) := @siop + sysdb + fill'wrd;                       14740000
                                                                        14745000
       siop(fill'wrd) := 0;   << fill word of 0 >>                      14750000
       siopb(cdb'area'byte+13, cdb'write);                     <<03717>>14755000
                                                                        14760000
       siop(branchpt) := dxfercp;                                       14765000
                                                                        14770000
     end;                                                               14775000
                                                                        14780000
$page                                                                   14785000
<<---------------------------------------------------->>                14790000
<<                                                    >>                14795000
<<   fill with blanks [function code = 6]             >>                14800000
<<                                                    >>                14805000
<<   count - transfer count                           >>                14810000
<<   p1 - high order dbl word logical sector address  >>                14815000
<<   p2 - low order dbl word logical sector address   >>                14820000
<<                                                    >>                14825000
<<---------------------------------------------------->>                14830000
                                                                        14835000
     begin                                                              14840000
                                                                        14845000
       << p1 = ioqp(qpar1) = clda1 >>                                   14850000
       << p2 = ioqp(qpar2) = clda2 >>                                   14855000
                                                                        14860000
       clda1:= drq'parm1;     <<logical sector addr1 >>        <<06838>>14865000
       clda2:= drq'parm2;     <<logical sector addr2 >>        <<06838>>14870000
                                                                        14875000
       << write to disc label (sector 0) invalid >>                     14880000
                                                                        14885000
       if foreign=0 and clda1=0 and clda2=0 then                        14890000
         goto invalidfunc;                                              14895000
                                                                        14900000
       set'byte'count;                                                  14905000
       if count=0 then goto invalidfunc;                                14910000
       set'cmd'bytes;                                                   14915000
                                                                        14920000
       siop(dxfer1) := 14;   << cdb byte count >>                       14925000
       siop(dxfer7) := wrt'exec'sec;                                    14930000
       siop(dxfer8) := count;   << fill byte count >>                   14935000
       siop(dxfer10).sabit := 1;   << wrt from single addr >>           14940000
       siop(dxfer10).(8:8) := 0;                                        14945000
       siop(dxfer11) := @siop + sysdb + fill'wrd;                       14950000
                                                                        14955000
       siop(fill'wrd) := %20040;   << fill word of blanks >>            14960000
       siopb(cdb'area'byte+13, cdb'write);                     <<03717>>14965000
                                                                        14970000
       siop(branchpt) := dxfercp;                                       14975000
                                                                        14980000
     end;                                                               14985000
                                                                        14990000
$page                                                                   14995000
<<---------------------------------------------------->>                15000000
<<                                                    >>                15005000
<<   request status [function code = 7 & 15]          >>                15010000
<<                                                    >>                15015000
<<   count - status length (max 20 bytes)             >>                15020000
<<   bank & buffaddr - returns the status or %101010  >>                15025000
<<   p1 - 8 (denotes a call from devrec)              >>                15030000
<<   p2 - 9 (denotes a call from devrec)              >>                15035000
<<                                                    >>                15040000
<<---------------------------------------------------->>                15045000
                                                                        15050000
     begin                                                              15055000
                                                                        15060000
     << p1 = ioqp(qpar1) >>                                             15065000
     << p2 = ioqp(qpar2) >>                                             15070000
                                                                        15075000
  req'status:                                                           15080000
                                                                        15085000
       set'byte'count;                                                  15090000
       if count=0 then goto invalidfunc;                                15095000
                                                                        15100000
       if ditp(dmisc).ignore'int'flg=1 and                              15105000
         drq'parm1=8 and drq'parm2= 9 then                     <<06838>>15110000
                                                                        15115000
           begin                                                        15120000
             ditp(dmisc).ignore'int'flg := 0;                           15125000
             tos := buffaddrd;                                          15130000
             tos := %101010;                                            15135000
             assemble (ssea);                                           15140000
             goto goodxfer;                                             15145000
           end;                                                         15150000
                                                                        15155000
       tos := 0;                                                        15160000
       tos := @siop + sysdb + desc'area;                                15165000
       tos := 0;                                                        15170000
       tos := @ditp + sysdb + dstatus;                                  15175000
       tos := 10;                                                       15180000
       assemble (mabs);   << save last status in desc area >>           15185000
       clear'status;                                                    15190000
                                                                        15195000
       siop(diag1) := 7;   << do seek to force status >>                15200000
                                                                        15205000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>15210000
       siopb(cdb'area'byte+1, cdb'set'length);                 <<03717>>15215000
       siopb(cdb'area'byte+2, 0);                              <<03717>>15220000
       siopb(cdb'area'byte+3, 0);                              <<03717>>15225000
       siopb(cdb'area'byte+4, 0);                              <<03717>>15230000
       siopb(cdb'area'byte+5, 0);                              <<03717>>15235000
       siopb(cdb'area'byte+6, cdb'write);                      <<03717>>15240000
                                                                        15245000
       siop(ident2) := 0;     << identify 1st to  >>                    15250000
       siop(ident3) := -29;   << det ctrl hook up >>                    15255000
       siop(branchpt) := identcp;                                       15260000
                                                                        15265000
     end;                                                               15270000
$page                                                                   15275000
<<---------------------------------------------------->>                15280000
<<                                                    >>                15285000
<<   initialize media [function code = 8]             >>                15290000
<<                                                    >>                15295000
<<   p1 - 0 retain factory, field spares              >>                15300000
<<      - 1 retain factory spares only                >>                15305000
<<   p2 - block interleave byte (binary number)       >>                15310000
<<                                                    >>                15315000
<<---------------------------------------------------->>                15320000
                                                                        15325000
     begin                                                              15330000
                                                                        15335000
       << p1 = ioqp(qpar1) >>                                           15340000
       << p2 = ioqp(qpar2) >>                                           15345000
                                                                        15350000
       siop(diag1) := 4;                                                15355000
       if not (0 <= integer(drq'parm1) <= 2) then              <<06838>>15360000
         goto invalidfunc;                                              15365000
                                                                        15370000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>15375000
       siopb(cdb'area'byte+1, cdb'init'media);                 <<03717>>15380000
       siopb(cdb'area'byte+2, drq'parm1.(8:8));                <<06838>>15385000
       siopb(cdb'area'byte+3, drq'parm2.(8:8));                <<06838>>15390000
                                                                        15395000
       siop(branchpt) := diagcp;                                        15400000
                                                                        15405000
     end;                                                               15410000
$page                                                                   15415000
<<---------------------------------------------------->>                15420000
<<                                                    >>                15425000
<<   write disc label [function code = 11]            >>                15430000
<<                                                    >>                15435000
<<   count - transfer count                           >>                15440000
<<   bank & buffaddr - contains disc label info       >>                15445000
<<   p1 - high order dbl word logical sector address  >>                15450000
<<   p2 - low order dbl word logical sector address   >>                15455000
<<                                                    >>                15460000
<<---------------------------------------------------->>                15465000
                                                                        15470000
     begin                                                              15475000
                                                                        15480000
       << p1 = ioqp(qpar1) = clda1 >>                                   15485000
       << p2 = ioqp(qpar2) = clda2 >>                                   15490000
                                                                        15495000
       clda1:= drq'parm1;     <<logical sector addr1 >>        <<06838>>15500000
       clda2:= drq'parm2;     <<logical sector addr2 >>        <<06838>>15505000
                                                                        15510000
       set'byte'count;                                                  15515000
       set'cmd'bytes;                                                   15520000
                                                                        15525000
       if count=0 then goto invalidfunc;                                15530000
                                                                        15535000
       siop(dxfer1) := 14;   << cdb byte count >>                       15540000
       siop(dxfer7) := wrt'exec'sec;                                    15545000
       siop(dxfer8) := count;   << data byte count >>                   15550000
       siop(dxfer10).(8:8) := bank;   << data bank >>                   15555000
       siop(dxfer11) := buffaddr;   << data buffer abs adr >>           15560000
                                                                        15565000
       siopb(cdb'area'byte+13, cdb'write);                     <<03717>>15570000
                                                                        15575000
       siop(branchpt) := dxfercp;                                       15580000
                                                                        15585000
     end;                                                               15590000
$page                                                                   15595000
<<---------------------------------------------------->>                15600000
<<                                                    >>                15605000
<<   request volume limit [function code = 13]        >>                15610000
<<                                                    >>                15615000
<<   bank & buffaddr - returns a dbl wrd address of   >>                15620000
<<                     the maximum volume limit       >>                15625000
<<   p1 - 0 return a single vector address            >>                15630000
<<      - 1 return a three vector address             >>                15635000
<<                                                    >>                15640000
<<---------------------------------------------------->>                15645000
                                                                        15650000
     begin                                                              15655000
                                                                        15660000
       << p1 = ioqp(qpar1) >>                                           15665000
                                                                        15670000
       if not (0 <= integer(drq'parm1) <= 1) then              <<06838>>15675000
         goto invalidfunc;                                              15680000
                                                                        15685000
       siop(dxfer1) := 2;   << cdb byte count >>                        15690000
       siop(dxfer7) := read'exec'sec;                                   15695000
       siop(dxfer8) := max'desc'byte;   << max# desc bytes >>           15700000
       siop(dxfer10).(8:8) := 0;   << describe area >>                  15705000
       siop(dxfer11) := @siop + sysdb + desc'area;                      15710000
                                                                        15715000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>15720000
       siopb(cdb'area'byte+1, cdb'describe);                   <<03717>>15725000
                                                                        15730000
       siop(branchpt) := dxfercp;                                       15735000
                                                                        15740000
     end;                                                               15745000
$page                                                                   15750000
<<---------------------------------------------------->>                15755000
<<                                                    >>                15760000
<<   verify [function code = 14]                      >>                15765000
<<                                                    >>                15770000
<<   count - unused.  must be none zero        byte   >>       <<04702>>15775000
<<   bank & buffaddr - passes in buffer verify length >>       <<04702>>15780000
<<   bank & buffaddr - returns a dbl wrd address of   >>       <<04702>>15785000
<<                     1st bad sector encountered     >>       <<04702>>15790000
<<   p1 - high order dbl word logical sector address  >>                15795000
<<   p2 - low order dbl word logical sector address   >>                15800000
<<                                                    >>                15805000
<<---------------------------------------------------->>                15810000
                                                                        15815000
     begin                                                              15820000
                                                                        15825000
       << p1 = ioqp(qpar1) = clda1 >>                                   15830000
       << p2 = ioqp(qpar2) = clda2 >>                                   15835000
                                                                        15840000
       clda1:= drq'parm1;     <<logical sector addr1 >>        <<06838>>15845000
       clda2:= drq'parm2;     <<logical sector addr2 >>        <<06838>>15850000
                                                                        15855000
       set'cmd'bytes;                                          <<04702>>15860000
       tos := buffaddrd;      << get bank & offset of buffer >><<04702>>15865000
       assemble(ldea;dxch,ddel); <<  first 2 words of buffer >><<04702>>15870000
       ver'len := tos;   << store verify byte length >>        <<04702>>15875000
       index := cdb'area'byte + 9;   << offset of length >>    <<04702>>15880000
       siopb(index,l1'ver'len.(0:8)); <<put len in cmnd seq.>> <<04702>>15885000
       siopb(index+1,l1'ver'len.(8:8));                        <<04702>>15890000
       siopb(index+2,l2'ver'len.(0:8));                        <<04702>>15895000
       siopb(index+3,l2'ver'len.(8:8));                        <<04702>>15900000
                                                               <<04702>>15905000
       siop(diag1) := 14;   << cdb byte count >>                        15910000
       siopb(cdb'area'byte+13, cdb'verify);                    <<03717>>15915000
                                                                        15920000
       siop(branchpt) := diagcp;                                        15925000
                                                                        15930000
     end;                                                               15935000
$page                                                                   15940000
<<---------------------------------------------------->>                15945000
<<                                                    >>                15950000
<<   lock [function code = 16]                        >>                15955000
<<                                                    >>                15960000
<<---------------------------------------------------->>                15965000
                                                                        15970000
     begin                                                              15975000
                                                                        15980000
       ditp(dmisc).lock'flg := 1;                                       15985000
       goto goodxfer;                                                   15990000
                                                                        15995000
     end;                                                               16000000
$page                                                                   16005000
<<---------------------------------------------------->>                16010000
<<                                                    >>                16015000
<<   unlock [function code = 17]                      >>                16020000
<<                                                    >>                16025000
<<---------------------------------------------------->>                16030000
                                                                        16035000
     begin                                                              16040000
                                                                        16045000
       ditp(dmisc).lock'flg := 0;                                       16050000
       goto goodxfer;                                                   16055000
                                                                        16060000
     end;                                                               16065000
$page                                                                   16070000
<<---------------------------------------------------->>                16075000
<<                                                    >>                16080000
<<   read lock bit [function code = 18]               >>                16085000
<<                                                    >>                16090000
<<---------------------------------------------------->>                16095000
                                                                        16100000
     begin                                                              16105000
                                                                        16110000
       tos := buffaddrd;                                                16115000
       tos := ditp(dmisc).lock'flg;   << lock bit >>                    16120000
       assemble (ssea);                                                 16125000
       goto goodxfer;                                                   16130000
                                                                        16135000
     end;                                                               16140000
$page                                                                   16145000
<<---------------------------------------------------->>                16150000
<<                                                    >>                16155000
<<   identify [function code = 72]                    >>                16160000
<<                                                    >>                16165000
<<---------------------------------------------------->>                16170000
                                                                        16175000
     begin                                                              16180000
                                                                        16185000
       siop(ident1) := 0;   << zero return byte >>                      16190000
       siop(branchpt) := identcp;                                       16195000
                                                                        16200000
     end;                                                               16205000
$page                                                                   16210000
<<---------------------------------------------------->>                16215000
<<                                                    >>                16220000
<<   initiate diagnostic [function code = 73]         >>                16225000
<<   (selftest initiate)                              >>                16230000
<<                                                    >>                16235000
<<   p1 - 2 bytes loop count (execution count)        >>                16240000
<<   p2 - diagnostic section#                         >>                16245000
<<                                                    >>                16250000
<<---------------------------------------------------->>                16255000
                                                                        16260000
     begin                                                              16265000
                                                                        16270000
       << p1 = ioqp(qpar1) >>                                           16275000
       << p2 = ioqp(qpar2) >>                                           16280000
                                                                        16285000
       if drq'parm1= 0 then                                    <<06838>>16290000
         goto invalidfunc;                                              16295000
                                                                        16300000
       siop(diag1) := 5;                                                16305000
                                                                        16310000
       siopb(cdb'area'byte, cdb'set'unit + ctrl'unit);         <<03717>>16315000
       siopb(cdb'area'byte+1, cdb'init'diag);                  <<03717>>16320000
       siopb(cdb'area'byte+2, drq'parm1.(0:8));                <<06838>>16325000
       siopb(cdb'area'byte+3, drq'parm1.(8:8));                <<06838>>16330000
       siopb(cdb'area'byte+4, drq'parm2.(8:8));                <<06838>>16335000
                                                                        16340000
       siop(branchpt) := diagcp;                                        16345000
                                                                        16350000
     end;                                                               16355000
$page                                                                   16360000
<<---------------------------------------------------->>                16365000
<<                                                    >>                16370000
<<   diagnostic result [function code = 74 = 7]       >>                16375000
<<   (selftest result)                                >>                16380000
<<                                                    >>                16385000
<<---------------------------------------------------->>                16390000
                                                                        16395000
     begin                                                              16400000
                                                                        16405000
       goto req'status;   << results part of status >>                  16410000
                                                                        16415000
     end;                                                               16420000
$page                                                                   16425000
<<---------------------------------------------------->>                16430000
<<                                                    >>                16435000
<<   loopback write [function code = 75]              >>                16440000
<<                                                    >>                16445000
<<   count - transfer count                           >>                16450000
<<   bank & buffaddr - contains loopbk data for wrt.  >>                16455000
<<                     must begin w/hex ff followed   >>                16460000
<<                     by bytes equal to its prede-   >>                16465000
<<                     cessor plus one                >>                16470000
<<                                                    >>                16475000
<<---------------------------------------------------->>                16480000
                                                                        16485000
     begin                                                              16490000
                                                                        16495000
       set'byte'count;                                                  16500000
       if count=0 then goto invalidfunc;                                16505000
                                                                        16510000
       siop(dxfer) := wrt'trans'sec;                                    16515000
       siop(dxfer1) := 5;   << cdb byte count >>                        16520000
       siop(dxfer7) := wrt'trans'sec;                                   16525000
       siop(dxfer8) := count;   << data byte count >>                   16530000
       siop(dxfer10).(8:8) := bank;   << data bank >>                   16535000
       siop(dxfer11) := buffaddr;   << data buffer abs adr >>           16540000
       siop(dxfer5) := siop(dxfer12) := 0;   << no wait >>              16545000
                                                                        16550000
       siopb(cdb'area'byte, cdb'wrt'loopbk);                   <<03717>>16555000
       siopb(cdb'area'byte+1, 0);                              <<03717>>16560000
       siopb(cdb'area'byte+2, 0);                              <<03717>>16565000
       siopb(cdb'area'byte+3, count.(0:8));                    <<03717>>16570000
       siopb(cdb'area'byte+4, count.(8:8));                    <<03717>>16575000
                                                                        16580000
       siop(branchpt) := dxfercp;                                       16585000
                                                                        16590000
     end;                                                               16595000
$page                                                                   16600000
<<---------------------------------------------------->>                16605000
<<                                                    >>                16610000
<<   loopback read [function code = 76]               >>                16615000
<<                                                    >>                16620000
<<   count - transfer count                           >>                16625000
<<   bank & buffaddr - contains loopbk data read      >>                16630000
<<                                                    >>                16635000
<<---------------------------------------------------->>                16640000
                                                                        16645000
     begin                                                              16650000
                                                                        16655000
       set'byte'count;                                                  16660000
       if count=0 then goto invalidfunc;                                16665000
                                                                        16670000
       siop(dxfer) := wrt'trans'sec;                                    16675000
       siop(dxfer1) := 5;   << cdb byte count >>                        16680000
       siop(dxfer7) := read'trans'sec;                                  16685000
       siop(dxfer8) := count;   << data byte count >>                   16690000
       siop(dxfer10).(8:8) := bank;   << data bank >>                   16695000
       siop(dxfer11) := buffaddr;   << data buffer abs adr >>           16700000
       siop(dxfer5) := siop(dxfer12) := 0;   << no wait >>              16705000
                                                                        16710000
       siopb(cdb'area'byte, cdb'read'loopbk);                  <<03717>>16715000
       siopb(cdb'area'byte+1, 0);                              <<03717>>16720000
       siopb(cdb'area'byte+2, 0);                              <<03717>>16725000
       siopb(cdb'area'byte+3, count.(0:8));                    <<03717>>16730000
       siopb(cdb'area'byte+4, count.(8:8));                    <<03717>>16735000
                                                                        16740000
       siop(branchpt) := dxfercp;                                       16745000
                                                                        16750000
     end;                                                               16755000
$page                                                                   16760000
<<---------------------------------------------------->>                16765000
<<                                                    >>                16770000
<<   general purpose command [function code = 77]     >>                16775000
<<                                                    >>                16780000
<<   count - number of command bytes                  >>                16785000
<<   bank & buffaddr - contains command data bytes    >>                16790000
<<                     to be sent thru the command    >>                16795000
<<                     & reporting message phase      >>                16800000
<<                                                    >>                16805000
<<---------------------------------------------------->>                16810000
                                                                        16815000
     begin                                                              16820000
                                                                        16825000
       set'byte'count;                                                  16830000
                                                                        16835000
       siop(diag1) := count;                                            16840000
       siop(diag3).(8:8) := bank;                                       16845000
       siop(diag4) := buffaddr;                                         16850000
                                                                        16855000
       siop(branchpt) := diagcp;                                        16860000
                                                                        16865000
     end;                                                               16870000
$page                                                                   16875000
<<---------------------------------------------------->>                16880000
<<                                                    >>                16885000
<<   describe [function code = 78]                    >>                16890000
<<                                                    >>                16895000
<<   count - describe length (max 37 bytes)           >>                16900000
<<   bank & buffaddr - returns data from describe     >>                16905000
<<                                                    >>                16910000
<<---------------------------------------------------->>                16915000
                                                                        16920000
     begin                                                              16925000
                                                                        16930000
       set'byte'count;                                                  16935000
       if count=0 then goto invalidfunc;                                16940000
                                                                        16945000
       siop(dxfer1) := 2;   << cdb byte count >>                        16950000
       siop(dxfer7) := read'exec'sec;                                   16955000
       siop(dxfer8) := max'desc'byte;   << max# desc bytes >>           16960000
       siop(dxfer10).(8:8) := 0;   << describe area >>                  16965000
       siop(dxfer11) := @siop + sysdb + desc'area;                      16970000
                                                                        16975000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>16980000
       siopb(cdb'area'byte+1, cdb'describe);                   <<03717>>16985000
                                                                        16990000
       siop(branchpt) := dxfercp;                                       16995000
                                                                        17000000
     end;                                                               17005000
$page                                                                   17010000
<<---------------------------------------------------->>                17015000
<<                                                    >>                17020000
<<   release [function code = 79]                     >>                17025000
<<                                                    >>                17030000
<<---------------------------------------------------->>                17035000
                                                                        17040000
     begin                                                              17045000
                                                                        17050000
       siop(diag1) := 2;                                                17055000
                                                                        17060000
       siopb(cdb'area'byte, cdb'set'unit + ctrl'unit);         <<03717>>17065000
       siopb(cdb'area'byte+1, cdb'release);                    <<03717>>17070000
                                                                        17075000
       siop(branchpt) := diagcp;                                        17080000
                                                                        17085000
     end;                                                               17090000
$page                                                                   17095000
<<---------------------------------------------------->>                17100000
<<                                                    >>                17105000
<<   release denied [function code = 80]              >>                17110000
<<                                                    >>                17115000
<<---------------------------------------------------->>                17120000
                                                                        17125000
     begin                                                              17130000
                                                                        17135000
       siop(diag1) := 2;                                                17140000
                                                                        17145000
       siopb(cdb'area'byte, cdb'set'unit + ctrl'unit);         <<03717>>17150000
       siopb(cdb'area'byte+1, cdb'release'deny);               <<03717>>17155000
                                                                        17160000
       siop(branchpt) := diagcp;                                        17165000
                                                                        17170000
     end;                                                               17175000
$page                                                                   17180000
<<---------------------------------------------------->>                17185000
<<                                                    >>                17190000
<<   set release [function code = 81]                 >>                17195000
<<                                                    >>                17200000
<<   p1 - 0 enable release timeout [t=0]              >>                17205000
<<        1 suppress release timeout [t=1]            >>                17210000
<<   p2 - 0 auto release during idle time [z=0]       >>                17215000
<<        1 no auto release during idle time [z=1]    >>                17220000
<<                                                    >>                17225000
<<---------------------------------------------------->>                17230000
                                                                        17235000
     begin                                                              17240000
                                                                        17245000
       << p1 = ioqp(qpar1) >>                                           17250000
       << p2 = ioqp(qpar2) >>                                           17255000
                                                                        17260000
       siop(diag1) := 3;                                                17265000
                                                                        17270000
       parm := 0;                                                       17275000
       if drq'parm1= 1 then                                    <<06838>>17280000
         parm.(0:1) := 1;   << suppress release timeout >>              17285000
       if drq'parm2= 1 then                                    <<06838>>17290000
         parm.(1:1) := 1;   << release during idle time >>              17295000
                                                                        17300000
       siopb(cdb'area'byte, cdb'set'unit + ctrl'unit);         <<03717>>17305000
       siopb(cdb'area'byte+1, cdb'set'release);                <<03717>>17310000
       siopb(cdb'area'byte+2, parm.(0:8));  << tz000000 >>     <<03717>>17315000
                                                                        17320000
       siop(branchpt) := diagcp;                                        17325000
                                                                        17330000
     end;                                                               17335000
$page                                                                   17340000
<<---------------------------------------------------->>                17345000
<<                                                    >>                17350000
<<   set address [function code = 82]                 >>                17355000
<<                                                    >>                17360000
<<   bank & buffaddr - contains a dbl wrd address     >>                17365000
<<   p1 - 0 single vector address                     >>                17370000
<<      - 1 three vector address                      >>                17375000
<<                                                    >>                17380000
<<---------------------------------------------------->>                17385000
                                                                        17390000
     begin                                                              17395000
                                                                        17400000
       << p1 = ioqp(qpar1) >>                                           17405000
                                                                        17410000
       if not (0 <= integer(drq'parm1) <= 1) then              <<06838>>17415000
         goto invalidfunc;                                              17420000
                                                                        17425000
       tos := buffaddrd;                                                17430000
       assemble (ldea);   << fetch dbl wrd addr >>                      17435000
       clda2 := tos;                                                    17440000
       clda1 := tos;                                                    17445000
                                                                        17450000
       siop(diag1) := 8;                                                17455000
                                                                        17460000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>17465000
                                                                        17470000
       if drq'parm1= 0 then                                    <<06838>>17475000
                                                                        17480000
         begin                                                          17485000
           siopb(cdb'area'byte+1, cdb'set'sngl'vec);           <<03717>>17490000
           siopb(cdb'area'byte+2, 0);                          <<03717>>17495000
           siopb(cdb'area'byte+3, 0);                          <<03717>>17500000
           siopb(cdb'area'byte+4, clda1.(0:8));                <<03717>>17505000
           siopb(cdb'area'byte+5, clda1.(8:8));                <<03717>>17510000
           siopb(cdb'area'byte+6, clda2.(0:8));                <<03717>>17515000
           siopb(cdb'area'byte+7, clda2.(8:8));                <<03717>>17520000
         end                                                            17525000
                                                                        17530000
       else   << three vector addr >>                                   17535000
                                                                        17540000
         begin                                                          17545000
           siopb(cdb'area'byte+1, cdb'set'3'vec);              <<03717>>17550000
           siopb(cdb'area'byte+2, 0);                          <<03717>>17555000
           siopb(cdb'area'byte+3, clda1.(0:8));                <<03717>>17560000
           siopb(cdb'area'byte+4, clda1.(8:8));                <<03717>>17565000
           siopb(cdb'area'byte+5, clda2.(0:8));                <<03717>>17570000
           siopb(cdb'area'byte+6, 0);                          <<03717>>17575000
           siopb(cdb'area'byte+7, clda2.(8:8));                <<03717>>17580000
         end;                                                           17585000
                                                                        17590000
       siop(branchpt) := diagcp;                                        17595000
                                                                        17600000
     end;                                                               17605000
$page                                                                   17610000
<<---------------------------------------------------->>                17615000
<<                                                    >>                17620000
<<   set block displacement [function code = 83]      >>                17625000
<<                                                    >>                17630000
<<   p1 - high order dbl word logical sector address  >>                17635000
<<   p2 - low order dbl word logical sector address   >>                17640000
<<                                                    >>                17645000
<<---------------------------------------------------->>                17650000
                                                                        17655000
     begin                                                              17660000
                                                                        17665000
       << p1 = ioqp(qpar1) = clda1 >>                                   17670000
       << p2 = ioqp(qpar2) = clda2 >>                                   17675000
                                                                        17680000
       clda1:= drq'parm1;     <<logical sector addr1 >>        <<06838>>17685000
       clda2:= drq'parm2;     <<logical sector addr2 >>        <<06838>>17690000
                                                                        17695000
       siop(diag1) := 8;                                                17700000
                                                                        17705000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>17710000
       siopb(cdb'area'byte+1, cdb'blk'displ);                  <<03717>>17715000
       siopb(cdb'area'byte+2, 0);                              <<03717>>17720000
       siopb(cdb'area'byte+3, 0);                              <<03717>>17725000
       siopb(cdb'area'byte+4, clda1.(0:8));                    <<03717>>17730000
       siopb(cdb'area'byte+5, clda1.(8:8));                    <<03717>>17735000
       siopb(cdb'area'byte+6, clda2.(0:8));                    <<03717>>17740000
       siopb(cdb'area'byte+7, clda2.(8:8));                    <<03717>>17745000
                                                                        17750000
       siop(branchpt) := diagcp;                                        17755000
                                                                        17760000
     end;                                                               17765000
$page                                                                   17770000
<<---------------------------------------------------->>                17775000
<<                                                    >>                17780000
<<   set mask status [function code = 84]             >>                17785000
<<                                                    >>                17790000
<<   bank & buffaddr - contains 8 bytes of bit        >>                17795000
<<                     positions corresponding to     >>                17800000
<<                     the status error bits          >>                17805000
<<                                                    >>                17810000
<<---------------------------------------------------->>                17815000
                                                                        17820000
     begin                                                              17825000
                                                                        17830000
       siop(diag1) := 10;                                               17835000
                                                                        17840000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>17845000
       siopb(cdb'area'byte+1, cdb'set'mask);                   <<03717>>17850000
                                                                        17855000
       tos := 0;   << destination - cdb area >>                         17860000
       tos := @siop + sysdb + cdb'area'wrd+1;                           17865000
       tos := bank;   << source >>                                      17870000
       tos := buffaddr;                                                 17875000
       tos := 4;   << 8 bytes status mask >>                            17880000
       assemble (mabs);   << move using abs addr >>                     17885000
                                                                        17890000
       siop(branchpt) := diagcp;                                        17895000
                                                                        17900000
     end;                                                               17905000
$page                                                                   17910000
<<---------------------------------------------------->>                17915000
<<                                                    >>                17920000
<<   set return addressing mode [function code = 85]  >>                17925000
<<                                                    >>                17930000
<<   p1 - 0 single vector mode                        >>                17935000
<<      - 1 three vector mode                         >>                17940000
<<                                                    >>                17945000
<<---------------------------------------------------->>                17950000
                                                                        17955000
     begin                                                              17960000
                                                                        17965000
       << p1 = ioqp(qpar1) >>                                           17970000
                                                                        17975000
       if not (0 <= integer(drq'parm1) <= 1) then              <<06838>>17980000
         goto invalidfunc;                                              17985000
                                                                        17990000
       siop(diag1) := 3;                                                17995000
                                                                        18000000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>18005000
       siopb(cdb'area'byte+1, cdb'set'retadr);                 <<03717>>18010000
       siopb(cdb'area'byte+2, if drq'parm1= 0 then             <<06838>>18015000
         0 else 1);   << single or three vector mode >>        <<03717>>18020000
                                                                        18025000
       siop(branchpt) := diagcp;                                        18030000
                                                                        18035000
     end;                                                               18040000
$page                                                                   18045000
<<---------------------------------------------------->>                18050000
<<                                                    >>                18055000
<<   set retry time [function code = 86]              >>                18060000
<<                                                    >>                18065000
<<   p1 - time in 10's of milliseconds                >>                18070000
<<                                                    >>                18075000
<<---------------------------------------------------->>                18080000
                                                                        18085000
     begin                                                              18090000
                                                                        18095000
       << p1 = ioqp(qpar1) >>                                           18100000
                                                                        18105000
       siop(diag1) := 4;                                                18110000
                                                                        18115000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>18120000
       siopb(cdb'area'byte+1, cdb'set'retry);                  <<03717>>18125000
       siopb(cdb'area'byte+2, drq'parm1.(0:8));                <<06838>>18130000
       siopb(cdb'area'byte+3, drq'parm1.(8:8));                <<06838>>18135000
                                                                        18140000
       siop(branchpt) := diagcp;                                        18145000
                                                                        18150000
     end;                                                               18155000
$page                                                                   18160000
<<---------------------------------------------------->>                18165000
<<                                                    >>                18170000
<<   set rps [function code = 87]                     >>                18175000
<<                                                    >>                18180000
<<   p1 - time to target in 100's microseconds        >>                18185000
<<   p2 - window size in 100's of microseconds        >>                18190000
<<                                                    >>                18195000
<<---------------------------------------------------->>                18200000
                                                                        18205000
     begin                                                              18210000
                                                                        18215000
       << p1 = ioqp(qpar1) >>                                           18220000
       << p2 = ioqp(qpar2) >>                                           18225000
                                                                        18230000
       siop(diag1) := 4;                                                18235000
                                                                        18240000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>18245000
       siopb(cdb'area'byte+1, cdb'set'rps);                    <<03717>>18250000
       siopb(cdb'area'byte+2, drq'parm1.(8:8));                <<06838>>18255000
       siopb(cdb'area'byte+3, drq'parm2.(8:8));                <<06838>>18260000
                                                                        18265000
       siop(branchpt) := diagcp;                                        18270000
                                                                        18275000
     end;                                                               18280000
$page                                                                   18285000
<<---------------------------------------------------->>                18290000
<<                                                    >>                18295000
<<   spare block [function code = 88]                 >>                18300000
<<                                                    >>                18305000
<<   bank & buffaddr - contains dbl wrd address of    >>                18310000
<<                     sector to be spared            >>                18315000
<<   p1 - 0 single vector address                     >>                18320000
<<      - 1 three vector address                      >>                18325000
<<   p2 - 0 spare retaining data (no target sector)   >>                18330000
<<        1 spare without retaining data              >>                18335000
<<        4 spare retaining data (target included)    >>                18340000
<<                                                    >>                18345000
<<---------------------------------------------------->>                18350000
                                                                        18355000
     begin                                                              18360000
                                                                        18365000
       << p1 = ioqp(qpar1) >>                                           18370000
       << p2 = ioqp(qpar2) >>                                           18375000
                                                                        18380000
       if not (0 <= integer(drq'parm1) <= 1) then              <<06838>>18385000
         goto invalidfunc;                                              18390000
                                                                        18395000
       if not (0 <= integer(drq'parm2) <= 4) then              <<06838>>18400000
         goto invalidfunc;                                              18405000
                                                                        18410000
       tos := buffaddrd;                                                18415000
       assemble (ldea);   << fetch dbl wrd address >>                   18420000
       clda2 := tos;                                                    18425000
       clda1 := tos;                                                    18430000
                                                                        18435000
       siop(diag1) := 10;                                               18440000
                                                                        18445000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>18450000
                                                                        18455000
       if drq'parm1= 0 then   << spare w/sngl vec addr >>      <<06838>>18460000
                                                                        18465000
         begin                                                          18470000
           siopb(cdb'area'byte+1, cdb'set'sngl'vec);           <<03717>>18475000
           siopb(cdb'area'byte+2, 0);                          <<03717>>18480000
           siopb(cdb'area'byte+3, 0);                          <<03717>>18485000
           siopb(cdb'area'byte+4, clda1.(0:8));                <<03717>>18490000
           siopb(cdb'area'byte+5, clda1.(8:8));                <<03717>>18495000
           siopb(cdb'area'byte+6, clda2.(0:8));                <<03717>>18500000
           siopb(cdb'area'byte+7, clda2.(8:8));                <<03717>>18505000
         end                                                            18510000
                                                                        18515000
       else   << spare w/three vec addr >>                              18520000
                                                                        18525000
         begin                                                          18530000
           siopb(cdb'area'byte+1, cdb'set'3'vec);              <<03717>>18535000
           siopb(cdb'area'byte+2, 0);                          <<03717>>18540000
           siopb(cdb'area'byte+3, clda1.(0:8));                <<03717>>18545000
           siopb(cdb'area'byte+4, clda1.(8:8));                <<03717>>18550000
           siopb(cdb'area'byte+5, clda2.(0:8));                <<03717>>18555000
           siopb(cdb'area'byte+6, 0);                          <<03717>>18560000
           siopb(cdb'area'byte+7, clda2.(8:8));                <<03717>>18565000
         end;                                                           18570000
                                                                        18575000
       siopb(cdb'area'byte+8, cdb'spare'blk);                  <<03717>>18580000
       siopb(cdb'area'byte+9, drq'parm2.(8:8));                <<06838>>18585000
                                                                        18590000
       siop(branchpt) := diagcp;                                        18595000
                                                                        18600000
     end;                                                               18605000
$page                                                                   18610000
<<---------------------------------------------------->>                18615000
<<                                                    >>                18620000
<<   read with 3-vector address [function code = 89]  >>                18625000
<<                                                    >>                18630000
<<   count - transfer count                           >>                18635000
<<   bank & buffaddr - contains data read             >>                18640000
<<   p1 - cylinder address                            >>                18645000
<<   p2 - head/sector address                         >>                18650000
<<                                                    >>                18655000
<<---------------------------------------------------->>                18660000
                                                                        18665000
     begin                                                              18670000
                                                                        18675000
       << p1 = ioqp(qpar1) >>                                           18680000
       << p2 = ioqp(qpar2) >>                                           18685000
                                                                        18690000
       set'byte'count;                                                  18695000
                                                                        18700000
       siop(dxfer1) := 14;   << cdb byte count >>                       18705000
                                                                        18710000
       if count=0 then   << no transfer count >>                        18715000
                                                                        18720000
         begin                                                          18725000
           siop(dxfer5) := 0;   << bypass exec msg >>                   18730000
           siop(dxfer6) := 5;   << jump *+5 >>                          18735000
         end                                                            18740000
                                                                        18745000
       else   << set up executing message >>                            18750000
                                                                        18755000
         begin                                                          18760000
           siop(dxfer7) := read'exec'sec;                               18765000
           siop(dxfer8) := count;   << data byte count >>               18770000
           siop(dxfer10).(8:8) := bank;   << data bank >>               18775000
           siop(dxfer11) := buffaddr;   << data buffer abs adr >>       18780000
         end;                                                           18785000
                                                                        18790000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>18795000
                                                                        18800000
       siopb(cdb'area'byte+1, cdb'set'3'vec);                  <<03717>>18805000
       siopb(cdb'area'byte+2, 0);                              <<03717>>18810000
       siopb(cdb'area'byte+3, drq'parm1.(0:8));                <<06838>>18815000
       siopb(cdb'area'byte+4, drq'parm1.(8:8));                <<06838>>18820000
       siopb(cdb'area'byte+5, drq'parm2.(0:8));                <<06838>>18825000
       siopb(cdb'area'byte+6, 0);                              <<03717>>18830000
       siopb(cdb'area'byte+7, drq'parm2.(8:8));                <<06838>>18835000
                                                                        18840000
       siopb(cdb'area'byte+8, cdb'set'length);                 <<03717>>18845000
       siopb(cdb'area'byte+9, 0);                              <<03717>>18850000
       siopb(cdb'area'byte+10, 0);                             <<03717>>18855000
       siopb(cdb'area'byte+11, count.(0:8));                   <<03717>>18860000
       siopb(cdb'area'byte+12, count.(8:8));                   <<03717>>18865000
       siopb(cdb'area'byte+13, cdb'read);                      <<03717>>18870000
                                                                        18875000
       siop(branchpt) := dxfercp;                                       18880000
                                                                        18885000
     end;                                                               18890000
$page                                                                   18895000
<<---------------------------------------------------->>                18900000
<<                                                    >>                18905000
<<   write with 3-vector address [function code = 90] >>                18910000
<<                                                    >>                18915000
<<   count - transfer count                           >>                18920000
<<   bank & buffaddr - contains data for write        >>                18925000
<<   p1 - cylinder address                            >>                18930000
<<   p2 - head/sector address                         >>                18935000
<<                                                    >>                18940000
<<---------------------------------------------------->>                18945000
                                                                        18950000
     begin                                                              18955000
                                                                        18960000
       << p1 = ioqp(qpar1) >>                                           18965000
       << p2 = ioqp(qpar2) >>                                           18970000
                                                                        18975000
       set'byte'count;                                                  18980000
                                                                        18985000
       siop(dxfer1) := 14;   << cdb byte count >>                       18990000
                                                                        18995000
       if count=0 then   << no transfer count >>                        19000000
                                                                        19005000
         begin                                                          19010000
           siop(dxfer5) := 0;   << bypass exec msg >>                   19015000
           siop(dxfer6) := 5;   << jump *+5 >>                          19020000
         end                                                            19025000
                                                                        19030000
       else   << set up executing message >>                            19035000
                                                                        19040000
         begin                                                          19045000
           siop(dxfer7) := wrt'exec'sec;                                19050000
           siop(dxfer8) := count;   << data byte count >>               19055000
           siop(dxfer10).(8:8) := bank;   << data bank >>               19060000
           siop(dxfer11) := buffaddr;   << data buffer abs adr >>       19065000
         end;                                                           19070000
                                                                        19075000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>19080000
                                                                        19085000
       siopb(cdb'area'byte+1, cdb'set'3'vec);                  <<03717>>19090000
       siopb(cdb'area'byte+2, 0);                              <<03717>>19095000
       siopb(cdb'area'byte+3, drq'parm1.(0:8));                <<06838>>19100000
       siopb(cdb'area'byte+4, drq'parm1.(8:8));                <<06838>>19105000
       siopb(cdb'area'byte+5, drq'parm2.(0:8));                <<06838>>19110000
       siopb(cdb'area'byte+6, 0);                              <<03717>>19115000
       siopb(cdb'area'byte+7, drq'parm2.(8:8));                <<06838>>19120000
                                                                        19125000
       siopb(cdb'area'byte+8, cdb'set'length);                 <<03717>>19130000
       siopb(cdb'area'byte+9, 0);                              <<03717>>19135000
       siopb(cdb'area'byte+10, 0);                             <<03717>>19140000
       siopb(cdb'area'byte+11, count.(0:8));                   <<03717>>19145000
       siopb(cdb'area'byte+12, count.(8:8));                   <<03717>>19150000
       siopb(cdb'area'byte+13, cdb'write);                     <<03717>>19155000
                                                                        19160000
       siop(branchpt) := dxfercp;                                       19165000
                                                                        19170000
     end;                                                               19175000
$page                                                                   19180000
<<---------------------------------------------------->>                19185000
<<                                                    >>                19190000
<<   initiate utility [function code = 91]            >>                19195000
<<                                                    >>                19200000
<<   count - executing message length                 >>                19205000
<<   bank & buffaddr - contains utility byte count    >>                19210000
<<                     with utility parameter bytes   >>                19215000
<<                     to follow (optional).          >>                19220000
<<   bank & buffaddr+10 - returns utility data        >>                19225000
<<                        information (optional).     >>                19230000
<<   p1 - 0 no executing message                      >>                19235000
<<      - 1 send executing message to the device      >>                19240000
<<      - 2 receive executing message from device     >>                19245000
<<   p2 - utility number                              >>                19250000
<<                                                    >>                19255000
<<  *note:  see cs'80 driver req code documentation   >>                19260000
<<          for a more thorough description           >>                19265000
<<                                                    >>                19270000
<<---------------------------------------------------->>                19275000
                                                                        19280000
     begin                                                              19285000
                                                                        19290000
       << p1 = ioqp(qpar1) >>                                           19295000
       << p2 = ioqp(qpar2) >>                                           19300000
                                                                        19305000
       if not (0 <= integer(drq'parm1) <= 2) then              <<06838>>19310000
         goto invalidfunc;                   <<  msg qualifier  >>      19315000
                                                                        19320000
       set'byte'count;                                                  19325000
                                                                        19330000
       if (1 <= integer(drq'parm1) <= 2) and count= 0 then     <<06838>>19335000
         goto invalidfunc;                                              19340000
                                                                        19345000
       siopb(cdb'area'byte, cdb'set'unit);                     <<03717>>19350000
       siopb(cdb'area'byte+1, cdb'nop);                        <<03717>>19355000
       siopb(cdb'area'byte+2, cdb'init'util+drq'parm1.(8:8));  <<06838>>19360000
       siopb(cdb'area'byte+3, drq'parm2.(8:8));                <<06838>>19365000
                                                                        19370000
       if drq'parm1 <> 1 then  << fetch util parm bytes >>     <<06838>>19375000
         begin                                                          19380000
           tos := buffaddrd;                                            19385000
           assemble (lsea);                                             19390000
           index := tos;   << #util parm bytes >>                       19395000
           if <> then                                                   19400000
             begin                                                      19405000
               if index > 18 then   << exceed max bytes allow >>        19410000
                 goto invalidfunc;                                      19415000
               parm := index/2;   << #util parm wrds >>                 19420000
               if (index mod 2) = 1 then   << have odd byte? >>         19425000
                 parm := parm + 1;   << #words to move >>               19430000
               tos := 0;   << destination - cdb area >>                 19435000
               tos := @siop + sysdb + cdb'area'wrd+2;                   19440000
               tos := bank;   << source >>                              19445000
               tos := buffaddr+1;                                       19450000
               tos := parm;  << #words to move >>                       19455000
               assemble (mabs);   << move using abs addr >>             19460000
            end;                                                        19465000
         end;                                                           19470000
                                                                        19475000
       case drq'parm1 of                                       <<06838>>19480000
                                                                        19485000
         begin                                                          19490000
                                                                        19495000
           begin   << no exec msg >>                                    19500000
                                                                        19505000
             siop(diag1) := 4 + index;                                  19510000
             siop(branchpt) := diagcp;                                  19515000
                                                                        19520000
           end;                                                         19525000
                                                                        19530000
           begin   << send exec msg to device >>                        19535000
                                                                        19540000
             siop(dxfer1) := 4;                                         19545000
             siop(dxfer7) := wrt'exec'sec;                              19550000
             siop(dxfer8) := count;   << exec msg count >>              19555000
             siop(dxfer10).(8:8) := bank;                               19560000
             siop(dxfer11) := buffaddr;                                 19565000
             siop(branchpt) := dxfercp;                                 19570000
                                                                        19575000
           end;                                                         19580000
                                                                        19585000
           begin   << receive exec msg from device >>                   19590000
                                                                        19595000
             siop(dxfer1) := 4 + index;                                 19600000
             siop(dxfer7) := read'exec'sec;                             19605000
             siop(dxfer8) := count;   << exec msg count >>              19610000
             siop(dxfer10).(8:8) := bank;                               19615000
             siop(dxfer11) := buffaddr+10;                              19620000
             siop(branchpt) := dxfercp;                                 19625000
                                                                        19630000
           end;                                                         19635000
                                                                        19640000
         end;                                                           19645000
                                                                        19650000
     end;                                                               19655000
$page                                                                   19660000
<<---------------------------------------------------->>                19665000
<<                                                    >>                19670000
<<   clear device [function code = 92]                >>                19675000
<<                                                    >>                19680000
<<---------------------------------------------------->>                19685000
                                                                        19690000
     begin                                                              19695000
                                                                        19700000
       siop(diag3) := %4401;   << sel dev clr w/parity enabled >>       19705000
       siop(diag4) := 0;                                                19710000
                                                                        19715000
       siop(branchpt) := diagcp + 3;                                    19720000
       go to must'start'cpgm;                                  <<03717>>19725000
     end;                                                               19730000
$page                                                                   19735000
<<---------------------------------------------------->>                19740000
<<                                                    >>                19745000
<<   cancel transaction [function code = 93]          >>                19750000
<<                                                    >>                19755000
<<---------------------------------------------------->>                19760000
                                                                        19765000
     begin                                                              19770000
                                                                        19775000
       siop(diag) := wrt'trans'sec;                                     19780000
       siop(diag1) := 1;                                                19785000
                                                                        19790000
       siopb(cdb'area'byte, cdb'cancel);                       <<03717>>19795000
                                                                        19800000
       siop(branchpt) := diagcp;                                        19805000
                                                                        19810000
     end;                                                               19815000
$page                                                                   19820000
<<---------------------------------------------------->>                19825000
<<                                                    >>                19830000
<<   parity checking [function code = 94]             >>                19835000
<<   p1 - 0 (disable parity checking)                 >>                19840000
<<      - 1 (enable parity checking)                  >>                19845000
<<                                                    >>                19850000
<<---------------------------------------------------->>                19855000
                                                                        19860000
     begin                                                              19865000
                                                                        19870000
       << p1 = ioqp(qpar1) >>                                           19875000
                                                                        19880000
       if not (0 <= integer(drq'parm1) <= 1) then              <<06838>>19885000
         goto invalidfunc;                                              19890000
                                                                        19895000
       siop(diag) := wrt'trans'sec;                                     19900000
       siop(diag1) := 2;                                                19905000
       siop(diag5) := 0;   << bypass wait & dsj >>                      19910000
       siop(diag6) := 5;                                                19915000
                                                                        19920000
       siopb(cdb'area'byte, cdb'parity'op);                    <<03717>>19925000
       siopb(cdb'area'byte+1, if drq'parm1= 0 then             <<06838>>19930000
         0 else 1);   << enable or disable parity check >>     <<03717>>19935000
                                                                        19940000
       siop(branchpt) := diagcp;                                        19945000
                                                                        19950000
     end;                                                               19955000
                                                                        19960000
                                                               <<06838>>19965000
                                                               <<06838>>19970000
<<---------------------------------------------------->>       <<06838>>19975000
<<                                                    >>       <<06838>>19980000
<<  return status [function code = 95]                >>       <<06838>>19985000
<<                                                    >>       <<06838>>19990000
<<                                                    >>       <<06838>>19995000
<<                                                    >>       <<06838>>20000000
<<---------------------------------------------------->>       <<06838>>20005000
                                                               <<06838>>20010000
     begin                                                     <<06838>>20015000
     end;                                                      <<06838>>20020000
                                                               <<06838>>20025000
                                                               <<06838>>20030000
<<---------------------------------------------------->>       <<06838>>20035000
<<                                                    >>       <<06838>>20040000
<<  read date code [function 96]                      >>       <<06838>>20045000
<<  it is also a local request,                       >>       <<06838>>20050000
<<  initiate utility of read rev code                 >>       <<06838>>20055000
<<                                                    >>       <<06838>>20060000
<<---------------------------------------------------->>       <<06838>>20065000
                                                               <<06838>>20070000
     begin                                                     <<06838>>20075000
                                                               <<06838>>20080000
       check'date'code(ditp,siop);                             <<06838>>20085000
                                                               <<06838>>20090000
     end;                                                      <<06838>>20095000
                                                               <<06838>>20100000
<<---------------------------------------------------->>       <<06838>>20105000
<<                                                    >>       <<06838>>20110000
<<  set rps with default value [function 97]          >>       <<06838>>20115000
<<  it is also a local request                        >>       <<06838>>20120000
<<                                                    >>       <<06838>>20125000
<<---------------------------------------------------->>       <<06838>>20130000
                                                               <<06838>>20135000
      begin                                                    <<06838>>20140000
        ditp(rps'wordone).rps'desirable := 1;                  <<06838>>20145000
        ditp(rps'wordone).rps'enabled := 1;                    <<06838>>20150000
        if ditp(rps'wordone).rps'datecode = 0 then             <<06838>>20155000
           begin                                               <<06838>>20160000
             ditp(rps'wordtwo) := 0;                           <<06838>>20165000
             ditp(rps'wordone).rps'enabled := 0;               <<06838>>20170000
           end;                                                <<06838>>20175000
                                                               <<06838>>20180000
        set'rps;                                               <<06838>>20185000
                                                               <<06838>>20190000
      end;                                                     <<06838>>20195000
                                                               <<06838>>20200000
<<--------------------------------------------------->>        <<06838>>20205000
<<                                                   >>        <<06838>>20210000
<<   disable rps       [function 98]                 >>        <<06838>>20215000
<<                                                   >>        <<06838>>20220000
<<--------------------------------------------------->>        <<06838>>20225000
                                                                        20230000
    begin                                                      <<06838>>20235000
        ditp(rps'wordone).rps'enabled := 0;                    <<06838>>20240000
        ditp(rps'wordone).rps'desirable := 0;                  <<06838>>20245000
        siop(diag1) := 4;                                      <<06838>>20250000
        siop(cdb'area'wrd).(0:8) := cdb'set'unit;              <<06838>>20255000
        siop(cdb'area'wrd).(8:8) := cdb'set'rps;               <<06838>>20260000
        siop(cdb'area'wrd+1).(0:8) := 0;                       <<06838>>20265000
        siop(cdb'area'wrd+1).(8:8) := 0;                       <<06838>>20270000
        siop(branchpt) := diagcp;                              <<06838>>20275000
   end;                                                        <<06838>>20280000
                                                               <<06838>>20285000
                                                               <<06838>>20290000
<<--------------------------------------------------->>        <<06838>>20295000
<<                                                   >>        <<06838>>20300000
<<   read rps'enabled bit [function 99]              >>        <<06838>>20305000
<<                                                   >>        <<06838>>20310000
<<--------------------------------------------------->>        <<06838>>20315000
                                                               <<06838>>20320000
  begin                                                        <<06838>>20325000
                                                               <<06838>>20330000
     tos := buffaddrd;                                         <<06838>>20335000
     tos := ditp(rps'wordone).rps'enabled;                     <<06838>>20340000
     assemble (ssea);                                          <<06838>>20345000
     go to goodxfer;                                           <<06838>>20350000
   end;                                                        <<06838>>20355000
                                                               <<06838>>20360000
      end;   << of case statement >>                           <<06838>>20365000
                                                               <<06838>>20370000
                                                               <<06838>>20375000
<<---------------------------------------------------->>                20380000
<<                                                    >>                20385000
<<   start channel program section                    >>                20390000
<<                                                    >>                20395000
<<---------------------------------------------------->>                20400000
                                                                        20405000
  start'chanp:                                                          20410000
                                                                        20415000
     cpvap := 0;   << clear channel status word >>                      20420000
     start'hpib(ditp,siop,true);                                        20425000
                                                                        20430000
     if < then   << sio failure >>                                      20435000
       goto sioerror;                                                   20440000
     drq'qmisc.waitcode:= cmpltion'wait;                       <<06838>>20445000
     mstate := intrptwait;                                              20450000
     return;                                                            20455000
     help;   << link to help - never gets executed >>                   20460000
                                                                        20465000
  end;   << end of initiation section >>                                20470000
                                                                        20475000
$page                                                                   20480000
<<****************************************************>>                20485000
<<                                                    >>                20490000
<<   cs'80 driver continuator section                 >>                20495000
<<                                                    >>                20500000
<<****************************************************>>                20505000
                                                                        20510000
  continuator:                                                          20515000
                                                                        20520000
     if ditp(dstat) = -1 then   << system powerfail >>                  20525000
       begin                                                            20530000
         ditp(dstat) := 0;                                              20535000
         drq'qmisc.sys'pfail'flg:= 1;                          <<06838>>20540000
         goto retry'request;                                            20545000
       end;                                                             20550000
                                                                        20555000
     if cpvap.errorcode=6 or    <<  dma abort    >>                     20560000
       cpvap.errorcode=7 then   << channel abort >>                     20565000
                                                                        20570000
       begin                                                            20575000
         if drq'qmisc.chan'err'flg= 3 then                     <<06838>>20580000
           if cpvap.errorcode=7 and cpvap.timedout=1 then               20585000
             if fcode=req'stat  or  (drq'func=rps'status'func) <<08900>>20590000
               then go to timeout << needed to get sys up >>   <<03760>>20595000
               else go to drive'not'ready                      <<03760>>20600000
           else goto chanerror;                                         20605000
         drq'qmisc.chan'err'flg:=    << retry 3 >>             <<06838>>20610000
         drq'qmisc.chan'err'flg+ 1;  << times   >>             <<06838>>20615000
         log'cpvap;                                                     20620000
         cpvap := 0;                                                    20625000
         siop(branchpt) := syncdsjcp;                          <<03689>>20630000
         start'hpib(ditp,siop(firstbranch),true);              <<03689>>20635000
         if < then                                                      20640000
           goto sioerror;                                               20645000
         drq'qmisc.waitcode:= sync'wait;                       <<06838>>20650000
         mstate := intrptwait;                                          20655000
         return;                                                        20660000
       end;                                                             20665000
                                                               <<06838>>20670000
     if ditp(rps'wordone).local'state <> 0 then                <<06838>>20675000
       begin                                                   <<06838>>20680000
         case ditp(rps'wordone).local'state of                 <<06838>>20685000
           begin                                               <<06838>>20690000
                                                               <<06838>>20695000
<<------------------------------------------------->>          <<06838>>20700000
<<                                                 >>          <<06838>>20705000
<<   case 0 - not used                             >>          <<06838>>20710000
<<                                                 >>          <<06838>>20715000
<<------------------------------------------------->>          <<06838>>20720000
           begin                                               <<06838>>20725000
           end;                                                <<06838>>20730000
                                                               <<06838>>20735000
<<------------------------------------------------->>          <<06838>>20740000
<<                                                 >>          <<06838>>20745000
<<   case 1 -  doing'read'rev'code                 >>          <<06838>>20750000
<<                                                 >>          <<06838>>20755000
<<------------------------------------------------->>          <<06838>>20760000
           begin                                               <<06838>>20765000
             ditp(rps'wordone).local'state := 0;               <<06838>>20770000
             ditp(rps'wordone).read'rev'code'done := 1;        <<06838>>20775000
             if (subtype = 1 or subtype = 2 or subtype = 4     <<06838>>20780000
                 or subtype = 8) and                           <<06838>>20785000
                 (siop(desc'area).(8:8) >= pep793x)            <<06838>>20790000
               then begin                                      <<06838>>20795000
                      ditp(rps'wordone).rps'datecode := 1;     <<06838>>20800000
                      ditp(rps'wordtwo).(0:8) := 9;            <<06838>>20805000
                      ditp(rps'wordtwo).(8:8) := 3;            <<06838>>20810000
                    end;                                       <<06838>>20815000
             if ditp(rps'wordone).rps'desirable = 1 and        <<06838>>20820000
                ditp(rps'wordone).rps'datecode = 1             <<06838>>20825000
             then begin                                        <<06838>>20830000
                    fcode := set'rps'default;                  <<06838>>20835000
                    ditp(rps'wordone).local'state :=           <<06838>>20840000
                         doing'set'rps;                        <<06838>>20845000
                    go to do'local'request;                    <<06838>>20850000
                  end;                                         <<06838>>20855000
           end; << of case 1 >>                                <<06838>>20860000
                                                               <<06838>>20865000
<<------------------------------------------------>->>         <<06838>>20870000
<<                                                 >>          <<06838>>20875000
<<   case 2 -  doing'set'rps                       >>          <<06838>>20880000
<<                                                 >>          <<06838>>20885000
<<------------------------------------------------->>          <<06838>>20890000
                                                               <<06838>>20895000
           begin                                               <<06838>>20900000
             ditp(rps'wordone).local'state := 0;               <<06838>>20905000
             ditp(rps'wordone).rps'enabled := 1;               <<06838>>20910000
           end;  << of case 2 >>                               <<06838>>20915000
                                                               <<06838>>20920000
           end;  << of case stat >>                            <<06838>>20925000
                                                               <<06838>>20930000
        mstate := 2;                                           <<06838>>20935000
       go to do'external'request;                              <<06838>>20940000
   end; << of processing local request >>                      <<06838>>20945000
                                                                        20950000
     if drq'sfail then  << failure on delayed start i/o >>     <<06838>>20955000
       goto sioerror;                                                   20960000
                                                                        20965000
<<====================================================>>                20970000
<<                                                    >>                20975000
<<   i/o status interrogation completion              >>                20980000
<<                                                    >>                20985000
<<====================================================>>                20990000
                                                                        20995000
     if cpvap(1).(12:4) = 1 then   << status diagnosis >>               21000000
                                                                        21005000
       begin                                                            21010000
                                                                        21015000
         cpvap(1).(12:4) := 0;                                          21020000
                                                                        21025000
         if ditp(fault'field).power'fail then                           21030000
           begin                                                        21035000
start'poncp:                                                   <<03689>>21040000
             siop(branchpt) := poncp;                                   21045000
             <<  do the clear.  unqueued startsio  >>          <<03689>>21050000
must'start'cpgm:                                                        21055000
             cpvap := 0;   << clear channel status word >>     <<03689>>21060000
             start'hpib(ditp,siop(firstbranch),true);          <<03747>>21065000
             if < then   << sio failure >>                     <<03689>>21070000
               goto sioerror;                                  <<03689>>21075000
             drq'qmisc.waitcode:= cmpltion'wait;               <<06838>>21080000
             mstate := intrptwait;                             <<03689>>21085000
             return;                                           <<03689>>21090000
           end;                                                         21095000
                                                                        21100000
         if fcode = req'stat or   << update last status >>              21105000
           fcode = diag'result then                                     21110000
                                                                        21115000
           begin                                                        21120000
               siop(desc'area+3).not'rdy                       <<03689>>21125000
                := ditp(access'field).not'rdy;                 <<03689>>21130000
             goto req'stat'cmplt;                                       21135000
           end;                                                         21140000
                                                                        21145000
         if drq'diag then  << diagnostic completion >>         <<06838>>21150000
           goto diag'stat'cmplt;                                        21155000
                                                                        21160000
         if ditp(id'field).unit'attn <> %377 and                        21165000
            ditp(id'field).unit'attn <> %17 and                         21170000
            ditp(id'field).unit'attn <> 0 then                          21175000
            goto uniterror;                                             21180000
        if release'necessary then return;                      <<04702>>21185000
                                                                        21190000
         if ditp(reject'field).chan'parity or                           21195000
            ditp(reject'field).illeg'opcode or                          21200000
            ditp(reject'field).mod'addr'err or                          21205000
            ditp(reject'field).parm'bound or                            21210000
            ditp(reject'field).illeg'parm or                            21215000
            ditp(reject'field).msg'seq'viol or                          21220000
            ditp(reject'field).msg'len'diff or                          21225000
                                                                        21230000
            ditp(fault'field).cross'unit or                             21235000
            ditp(fault'field).oper'rel'reqrd or                         21240000
            ditp(fault'field).diag'rel'reqrd or                         21245000
            ditp(fault'field).ctrl'fault or                    <<03689>>21250000
            ditp(fault'field).unit'fault or                    <<03689>>21255000
            ditp(fault'field).diag'failed or                   <<03689>>21260000
                                                                        21265000
            ditp(access'field).illeg'par'oper or                        21270000
            ditp(access'field).uninit'media or                          21275000
            ditp(access'field).wrt'protect or                           21280000
            ditp(access'field).no'data'found or                         21285000
            ditp(access'field).end'of'file or                           21290000
            ditp(access'field).dev'not'rdy or                  <<03773>>21295000
                                                                        21300000
           (hp7911 <= subtype <= hp7912) and                            21305000
           (ditp(access'field).dev'not'rdy or                           21310000
            ditp(infor'field).oper'rel'reqst or                         21315000
            ditp(infor'field).diag'rel'reqst) then                      21320000
                                                                        21325000
            begin                                                       21330000
              if drq'qmisc.retry'count= 7 then                 <<06838>>21335000
                goto uniterror;                                         21340000
              drq'qmisc.retry'count:=                          <<06838>>21345000
                drq'qmisc.retry'count+ 1;                      <<06838>>21350000
              if ditp(reject'field).msg'seq'viol and                    21355000
                drq'qmisc.sys'pfail'flg= 1 then                <<06838>>21360000
                goto retry'request;                                     21365000
              log'status;                                               21370000
                                                               <<03717>>21375000
         if ditp(fault'field).ctrl'fault or                    <<03717>>21380000
            ditp(fault'field).unit'fault or                    <<03717>>21385000
            ditp(access'field).dev'not'rdy or                  <<03773>>21390000
            ditp(fault'field).diag'failed then                 <<03717>>21395000
            goto start'poncp;                                  <<03717>>21400000
                                                               <<03717>>21405000
              goto retry'request;   << retry status >>                  21410000
            end;                    << error once   >>                  21415000
                                                                        21420000
         if ditp(fault'field).ctrl'fault or                             21425000
            ditp(fault'field).unit'fault or                             21430000
            ditp(fault'field).diag'failed then                          21435000
            goto uniterror;                                             21440000
                                                                        21445000
         if ditp(fault'field).retransmit then                           21450000
           begin                                                        21455000
             if drq'qmisc.rtrans'flg= 3 then                   <<06838>>21460000
               goto uniterror;                                          21465000
             drq'qmisc.rtrans'flg:=                            <<06838>>21470000
               drq'qmisc.rtrans'flg+ 1;                        <<06838>>21475000
             goto retry'request;                                        21480000
           end;                                                         21485000
                                                                        21490000
         if ditp(access'field).no'spare'avail then                      21495000
            goto no'spare'error;                                        21500000
                                                                        21505000
         if ditp(reject'field).addr'bound or                            21510000
            ditp(access'field).end'of'volume then                       21515000
            goto invalidadr;                                            21520000
                                                                        21525000
                                                                        21530000
<<---------------------------------------------------->>                21535000
<<   drive not ready - schedule idle cp until ready   >>                21540000
<<---------------------------------------------------->>                21545000
drive'not'ready:                                               <<03689>>21550000
                                                                        21555000
         if ditp(access'field).dev'not'rdy                     <<03689>>21560000
            or (cpvap = cpva'timeout)     then                 <<03689>>21565000
           begin                                                        21570000
             drq'qmisc.waitcode:= not'rdy'wait;                <<06838>>21575000
idle'not'ready:     <<  must not reference ioq before return >><<03689>>21580000
             siop(branchpt) := idle'waitcp; << must wait only>><<03717>>21585000
             if sysup then                                              21590000
                                                                        21595000
               begin                                                    21600000
                 if ditp(access'field).dev'not'rdy             <<03689>>21605000
                  then     << put out only not ready message >><<03689>>21610000
                   ldevnotrdy(ditp)  << not rdy msg to cons >> <<03689>>21615000
                  else     << put out the not responding msg >><<03689>>21620000
                   disc'not'resp(ditp);  << not resp to io   >><<03689>>21625000
                 << dvr must start after dsj once error is >>  <<03689>>21630000
                 << found or dvr will loop if drive is off >>  <<03689>>21635000
                 start'hpib(ditp,siop(firstbranch),false);     <<03689>>21640000
                 if < then                                              21645000
                   goto sioerror;                                       21650000
                mstate:= if drq'entry'index= 0 then requestdone<<06838>>21655000
                                     else notready;            <<03689>>21660000
               end                                                      21665000
                                                                        21670000
             else   << system not up - siodm rejects mstate 7 >>        21675000
                                                                        21680000
               begin                                                    21685000
                 start'hpib(ditp,siop(firstbranch),false);     <<03689>>21690000
                 if < then                                              21695000
                   goto sioerror;                                       21700000
                mstate:= if drq'entry'index= 0 then requestdone<<06838>>21705000
                                     else intrptwait;          <<03689>>21710000
               end;                                                     21715000
                                                                        21720000
             return;                                                    21725000
           end;                                                         21730000
                                                                        21735000
<<---------------------------------------------------->>                21740000
<<   defective sector table entry for suspect sector  >>                21745000
<<---------------------------------------------------->>                21750000
                                                                        21755000
         if ditp(access'field).unrecov'data'ov or                       21760000
            ditp(access'field).unrecov'data or                 <<03637>>21765000
            ditp(infor'field).marginal'data then               <<03637>>21770000
                                                                        21775000
           begin                                                        21780000
             if ditp(infor'field).marginal'data then           <<04985>>21785000
              ditp(dmisc).processing'md := 1;                  <<04985>>21790000
             ditp(dbadblk1) := ditp(parm'field+1);   << bad blk >>      21795000
             ditp(dbadblk2) := ditp(parm'field+2);   << address >>      21800000
             ditp(dbadxfer) := siop(dxfer8);       << xfer left >>      21805000
                                                                        21810000
             if fcode = verify then   << verify function >>             21815000
               begin                                                    21820000
                 tos := buffaddrd;                                      21825000
                 tos := dditp(ddbadblk);                                21830000
                 assemble (sdea);   << return bad sector addr >>        21835000
                 goto trkscterror;                                      21840000
               end;                                                     21845000
                                                                        21850000
             log'status;                                                21855000
             if foreign = 1 then   << foreign disc >>                   21860000
               goto trkscterror;   << bypass dsct  >>                   21865000
                                                                        21870000
             if ditp(dsbufaddr) = 0 then                                21875000
               begin                                                    21880000
                 index := getsbuf(2);                                   21885000
                                                               <<*8005>>21890000
                                                               <<*8005>>21895000
                 ditp(dsbufaddr) := index;                              21900000
                 if = then   << none available >>              <<*8005>>21905000
                   goto trkscterror;                           <<*8005>>21910000
               end;                                                     21915000
                                                                        21920000
             clda1 := 0;                                                21925000
             clda2 := dsct'dadr;   << dsct disc address >>              21930000
             count := dsct'size;   << #bytes in dsct >>                 21935000
                                                                        21940000
             set'cmd'bytes;                                             21945000
                                                                        21950000
             siop(dxfer) := wrt'cmd'sec;                                21955000
             siop(dxfer5) := siop(dxfer12) := %1000;                    21960000
             siop(dxfer6) := siop(dxfer13) := 0;                        21965000
             siop(dxfer7) := read'exec'sec;                             21970000
             siop(dxfer8) := count;                                     21975000
             siop(dxfer10):= dst(sbuf'bank);                   <<06838>>21980000
             siop(dxfer11):= dst(sbuf'addr)+ ditpl(dsbufaddr); <<06838>>21985000
                                                                        21990000
             siopb(cdb'area'byte+13, cdb'read);                <<03728>>21995000
                                                                        22000000
             siop(branchpt) := dxfercp;                                 22005000
             start'hpib (ditp,siop,true);                               22010000
             if < then                                                  22015000
               goto sioerror;                                           22020000
             drq'qmisc.waitcode:= dsct'read'wait;              <<06838>>22025000
             mstate := intrptwait;                                      22030000
             return;                                                    22035000
           end;                                                         22040000
                                                                        22045000
<<---------------------------------------------------->>                22050000
<<   log informational status                         >>                22055000
<<---------------------------------------------------->>                22060000
                                                                        22065000
         if ditp(infor'field).media'wearing or                          22070000
            ditp(infor'field).def'blk'spare or                          22075000
            ditp(infor'field).recov'data'ov or                          22080000
            ditp(infor'field).recov'data or                             22085000
            ditp(infor'field).maint'trk'ov then                         22090000
            log'status;                                                 22095000
                                                                        22100000
<<---------------------------------------------------->>                22105000
<<   maintenance trk ov - schedule logging process    >>                22110000
<<---------------------------------------------------->>                22115000
                                                                        22120000
         if ditp(infor'field).maint'trk'ov then                         22125000
           maint'request(ditp(dldev),type,subtype);            <<06838>>22130000
                                                                        22135000
       end;                                                             22140000
                                                                        22145000
<<====================================================>>                22150000
<<                                                    >>                22155000
<<   power on completion                              >>                22160000
<<                                                    >>                22165000
<<====================================================>>                22170000
                                                                        22175000
     if cpvap(1).(12:4) = 2 then   << pon - redo ioq >>                 22180000
       begin                                                            22185000
         ditp(rps'wordone).rps'enabled := 0;                   <<06838>>22190000
         cpvap(1).(12:4) := 0;                                          22195000
         if drq'diag then                                      <<06838>>22200000
           goto diag'pon'cmplt                                          22205000
         else                                                           22210000
           goto retry'request;                                          22215000
       end;                                                             22220000
                                                                        22225000
<<====================================================>>                22230000
<<                                                    >>                22235000
<<   problem interrogating status                     >>                22240000
<<                                                    >>                22245000
<<====================================================>>                22250000
                                                                        22255000
     if cpvap(1).(12:4) = 3 then   << retry once >>                     22260000
       begin                                                            22265000
         cpvap(1).(12:4) := 0;                                          22270000
         if drq'qmisc.rstat'fail'flg= 1 then                   <<06838>>22275000
           goto uniterror;   << retry failed >>                         22280000
         drq'qmisc.rstat'fail'flg:= 1;                         <<06838>>22285000
         siop(branchpt) := rstatcp;   << retry read status >>           22290000
         start'hpib(ditp,siop,true);                                    22295000
         if < then                                                      22300000
           goto sioerror;                                               22305000
         mstate := intrptwait;                                          22310000
         return;                                                        22315000
       end;                                                             22320000
                                                                        22325000
<<====================================================>>                22330000
<<                                                    >>                22335000
<<   power on requiring device clear completion       >>                22340000
<<                                                    >>                22345000
<<====================================================>>                22350000
                                                                        22355000
     if cpvap(1).(12:4) = 4 then   << issue dev clr >>                  22360000
       begin                                                            22365000
         ditp(rps'wordone).rps'enabled := 0;                   <<06838>>22370000
         cpvap(1).(12:4) := 0;                                          22375000
         siop(branchpt) := poncp;                                       22380000
         goto start'poncp;                                     <<03689>>22385000
       end;                                                             22390000
                                                                        22395000
<<====================================================>>                22400000
<<                                                    >>                22405000
<<   not ready completion                             >>                22410000
<<                                                    >>                22415000
<<====================================================>>                22420000
                                                                        22425000
     if drq'qmisc.waitcode= not'rdy'wait then                  <<06838>>22430000
       goto retry'request;                                              22435000
                                                                        22440000
<<====================================================>>                22445000
<<                                                    >>                22450000
<<   release/release denied completion                >>                22455000
<<                                                    >>                22460000
<<====================================================>>                22465000
                                                                        22470000
     if drq'qmisc.waitcode= rel'wait then                      <<06838>>22475000
       begin                                                            22480000
         if drq'qmisc.oper'req'flg= 1 and                      <<06838>>22485000
           drq'qmisc.load'flg <> 1 and                         <<06838>>22490000
           ditp(dmisc).lock'flg = 1 then                                22495000
                                                                        22500000
           begin                                                        22505000
             if sysdisc=1 then index := sys'deny'msg                    22510000
               else index := nsys'deny'msg;                             22515000
             if not iomessage(1,index,%10000,                           22520000
               ditp(dldev),,,,,opconsole) then                 <<06838>>22525000
               goto syserror;                                           22530000
           end;                                                         22535000
                                                                        22540000
         if (fcode=init'media or fcode=verify) and             <<03626>>22545000
           drq'qmisc.im'fault'flg <> 1 then                    <<06838>>22550000
                                                               <<03626>>22555000
           begin                                               <<03626>>22560000
             if fcode=verify and                               <<03626>>22565000
               drq'qmisc.ver'err'flg= 1 then                   <<06838>>22570000
               goto trkscterror                                <<03626>>22575000
             else goto goodxfer;                               <<03626>>22580000
           end;                                                <<03626>>22585000
                                                                        22590000
         goto retry'request;                                            22595000
       end;                                                             22600000
                                                                        22605000
<<====================================================>>                22610000
<<                                                    >>                22615000
<<   defective sector table read completion           >>                22620000
<<                                                    >>                22625000
<<====================================================>>                22630000
                                                                        22635000
     if drq'qmisc.waitcode= dsct'read'wait then                <<06838>>22640000
       begin                                                            22645000
       sbuf'entry'index:= ditp(dsbufaddr);                     <<06838>>22650000
       no'entries:= sbuf'num'dtrk;                             <<06838>>22655000
       first'entry:= sbh(sbuf'entry'index+1) /                 <<06838>>22660000
         sbh(sbuf'entry'index+2);                              <<06838>>22665000
       max'entries:= sbh(sbuf'entry'index+ 3);                 <<06838>>22670000
                                                                        22675000
         if sdisc <> 1 and no'entries = max'entries then                22680000
           begin   << dsct full >>                                      22685000
             if sysdisc=1 then index := sys'dsct'msg                    22690000
               else index := pv'dsct'msg;                               22695000
                 iomessage(1,index,%10000,ditp(dldev),         <<06838>>22700000
                       ,,,,opconsole);                                  22705000
             goto trkscterror;                                          22710000
           end;                                                         22715000
                                                                        22720000
         for index := first'entry until                                 22725000
                      first'entry + no'entries-1 do                     22730000
if ditpl(dbadblk1)= sbh(sbuf'entry'index+ indexl&lsl(1)) land  <<06838>>22735000
 ditpl(dbadblk2)= sbh(sbuf'entry'index+ indexl&lsl(1)+1) then  <<06838>>22740000
             goto trkscterror;   << duplicate entry >>                  22745000
         sbh(sbuf'entry'index+ indexl&lsl(1)):= ditp(dbadblk1);<<06838>>22750000
sbh(sbuf'entry'index+ indexl&lsl(1)+1):= ditp(dbadblk2);       <<06838>>22755000
         sbuf'num'dtrk:= sbuf'num'dtrk+ 1;                     <<06838>>22760000
                                                                        22765000
         clda1 := 0;                                                    22770000
         clda2 := dsct'dadr;   << disc addr of def sec table >>         22775000
         count := dsct'size;   << #bytes in the dsct >>                 22780000
                                                                        22785000
         set'cmd'bytes;   << set up cp to wrt out dsct >>               22790000
                                                                        22795000
         siop(dxfer7) := wrt'exec'sec;                                  22800000
         siop(dxfer8) := count;                                         22805000
         siop(dxfer10):= dst(sbuf'bank);                       <<06838>>22810000
         siop(dxfer11):= dst(sbuf'addr)+ ditpl(dsbufaddr);     <<06838>>22815000
                                                                        22820000
         siopb(cdb'area'byte+13, cdb'write);                   <<03728>>22825000
                                                                        22830000
         siop(branchpt) := dxfercp;                                     22835000
         start'hpib (ditp,siop,true);                                   22840000
         if < then                                                      22845000
           goto sioerror;                                               22850000
         drq'qmisc.waitcode:= dsct'wrt'wait;                   <<06838>>22855000
         mstate := intrptwait;                                          22860000
         return;                                                        22865000
       end;                                                             22870000
                                                                        22875000
<<====================================================>>                22880000
<<                                                    >>                22885000
<<   defective sector table write completion          >>                22890000
<<                                                    >>                22895000
<<====================================================>>                22900000
                                                                        22905000
      if drq'qmisc.waitcode= dsct'wrt'wait then                <<06838>>22910000
        if ditp(dmisc).processing'md =1 then                   <<04985>>22915000
           begin                                               <<04985>>22920000
             ditp(dmisc).processing'md := 0;                   <<04985>>22925000
             go to goodxfer;                                   <<04985>>22930000
           end                                                 <<04985>>22935000
       else                                                    <<04985>>22940000
             go to trkscterror;                                <<04985>>22945000
                                                                        22950000
<<====================================================>>                22955000
<<                                                    >>                22960000
<<   driver/firmware synchronization completion       >>                22965000
<<                                                    >>                22970000
<<====================================================>>                22975000
                                                                        22980000
      if drq'qmisc.waitcode= sync'wait then                    <<06838>>22985000
       goto retry'request;                                              22990000
                                                                        22995000
<<====================================================>>                23000000
<<                                                    >>                23005000
<<   function dependencies completion                 >>                23010000
<<                                                    >>                23015000
<<====================================================>>                23020000
                                                                        23025000
<<---------------------------------------------------->>                23030000
<<   status return & describe completion              >>                23035000
<<---------------------------------------------------->>                23040000
                                                                        23045000
  req'stat'cmplt:                                                       23050000
                                                                        23055000
     if fcode = req'stat or                                             23060000
       fcode = diag'result or                                           23065000
       fcode = describe then                                            23070000
                                                                        23075000
       begin                                                            23080000
         count:= drq'count;                                    <<06838>>23085000
         if < then   << make word count >>                              23090000
           count := (1-count)/2;                                        23095000
                                                                        23100000
         if (fcode = req'stat or fcode = diag'result) and               23105000
           count > 10 then count := 10;   << max 10 wrds >>             23110000
                                                                        23115000
                                                               <<04957>>23120000
                                                                        23125000
         tos := bank;   << user's area >>                               23130000
         tos := buffaddr;                                               23135000
         tos := 0;      << describe area >>                             23140000
         tos := @siop + sysdb + desc'area;                              23145000
         tos := count;  << #words to move >>                            23150000
         assemble (mabs);                                               23155000
       end;                                                             23160000
                                                                        23165000
<<---------------------------------------------------->>                23170000
<<   request volume limit completion                  >>                23175000
<<---------------------------------------------------->>                23180000
                                                                        23185000
     if fcode=req'vol'limit then                                        23190000
       begin                                                            23195000
         if drq'parm1= 0 then                                  <<06838>>23200000
                                                                        23205000
           begin                                                        23210000
             clda1 := siop(wrd'sngl'vec'limit+1);              <<03717>>23215000
                                                               <<03717>>23220000
             clda2 := siop(wrd'sngl'vec'limit+2);              <<03717>>23225000
                                                               <<03717>>23230000
           end                                                          23235000
                                                                        23240000
         else   << three vector addr >>                                 23245000
                                                                        23250000
           begin                                                        23255000
             clda1.(0:8) := siop(wrd'three'vec'limit  ).(8:8); <<03760>>23260000
             clda1.(8:8) := siop(wrd'three'vec'limit+1).(0:8); <<03760>>23265000
             clda2.(0:8) := siop(wrd'three'vec'limit+1).(8:8); <<03760>>23270000
             clda2.(8:8) := siop(wrd'three'vec'limit+2).(8:8); <<03760>>23275000
                                                               <<03760>>23280000
                                                               <<03717>>23285000
           end;                                                         23290000
                                                                        23295000
         tos := buffaddrd;                                              23300000
         tos := clda1;   << volume limit >>                             23305000
         tos := clda2;                                                  23310000
         assemble (sdea);   << store dbl word >>                        23315000
       end;                                                             23320000
                                                                        23325000
<<---------------------------------------------------->>                23330000
<<   identify completion                              >>                23335000
<<---------------------------------------------------->>                23340000
                                                                        23345000
     if fcode=identify then                                             23350000
       begin                                                            23355000
         tos := buffaddrd;                                              23360000
         tos := siop(ident1);  << device id >>                          23365000
         assemble (ssea);                                               23370000
       end;                                                             23375000
                                                                        23380000
                                                                        23385000
$page                                                                   23390000
                                                                        23395000
  goodxfer:                                                             23400000
     drq'stat:= goodio;                                        <<06838>>23405000
     goto exit;                                                         23410000
                                                                        23415000
  chanerror:                                                            23420000
     drq'stat:= chanfail;                                      <<06838>>23425000
     if not drq'diag then log'cpvap;                           <<06838>>23430000
     cpvap := 0;                                                        23435000
     goto exit;                                                         23440000
                                                                        23445000
  diag'stat'cmplt:                                                      23450000
     drq'stat:= stat'reqrd;                                    <<06838>>23455000
     goto exit;                                                         23460000
                                                                        23465000
  diag'pon'cmplt:                                                       23470000
     drq'stat:= device'pon;                                    <<06838>>23475000
     goto exit;                                                         23480000
                                                                        23485000
  invalidfunc:                                                          23490000
     drq'stat:= invalidop;                                     <<06838>>23495000
     goto exit;                                                         23500000
                                                                        23505000
  invalidadr:                                                           23510000
     drq'stat:= invalidskadr;                                  <<06838>>23515000
     goto exit;                                                         23520000
                                                                        23525000
  no'spare'error:                                                       23530000
     drq'stat:= no'spare'err;                                  <<06838>>23535000
     goto exit;                                                         23540000
                                                                        23545000
  trkscterror:                                                          23550000
     drq'stat:= trkscterr;                                     <<06838>>23555000
     siop(dxfer8) := ditp(dbadxfer);                                    23560000
     goto exit;                                                         23565000
                                                                        23570000
  sioerror:                                                             23575000
     drq'stat:= siofail;                                       <<06838>>23580000
     goto exit;                                                         23585000
                                                                        23590000
  syserror:                                                             23595000
     drq'stat:= syserr;                                        <<06838>>23600000
     goto exit;                                                         23605000
                                                                        23610000
  timeout:                                                              23615000
     drq'stat:= timouterr;                                     <<06838>>23620000
     if not drq'diag then log'cpvap;                           <<06838>>23625000
     cpvap := 0;                                                        23630000
     goto exit;                                                         23635000
                                                                        23640000
  uniterror:                                                            23645000
     drq'stat:= uniterr;                                       <<06838>>23650000
     log'status;                                                        23655000
     goto exit;                                                         23660000
                                                                        23665000
  exit:                                                                 23670000
     siop(rstat11) := @istat + sysdb;                          <<03626>>23675000
     update'xfer'cnt;                                                   23680000
     return'sysbuf;                                                     23685000
     mstate := requestdone;                                             23690000
                                                                        23695000
  end;   << of the cs'80 disc driver >>                                 23700000
                                                                        23705000
$page                                                                   23710000
   assemble(                                                            23715000
     pcal siodm;     << monitor >>                                      23720000
     pcal csdrvr;    << initiator >>                                    23725000
     pcal csdrvr;    << completor >>                                    23730000
     con  0;         << no io process >>                                23735000
     pcal csinit;    << initialization >>                               23740000
     con  1;         << one interrupt handler >>                        23745000
     pcal gip'hpib); << interrupt handler >>                            23750000
   end.                                                                 23755000
