$CONTROL MAP,CODE,USLINIT                                               00010000
  <<   HIOLPRT0, MODULE 36 - HP2608 LP DRIVER HPIB   >>                 00012000
<< HP32002C MPE SOURCE C.00.00 >>                                       00014000
<< COPYRIGHT     "(C) COPYRIGHT HEWLETT-PACKARD CO. 1980.           >>  00016000
<<     THIS PROGRAM MAY BE USED WITH ONE COMPUTER SYSTEM AT A       >>  00018000
<<     TIME AND SHALL NOT OTHERWISE BE RECORDED, TRANSMITTED OR     >>  00020000
<<     STORED IN A RETRIEVAL SYSTEM.  COPYING OR OTHER REPRODUCTION >>  00022000
<<     OF THIS PROGRAM EXCEPT FOR ARCHIVAL PURPOSES IS PROHIBITED   >>  00024000
<<     WITHOUT THE PRIOR WRITTEN CONSENT OF HEWLETT-PACKARD COMPANY.>>  00026000
<< **** Note - Dollar Copyright cannot be used with this module *** >>  00028000
$CONTROL USLINIT,MAP,CODE                                               00030000
$TITLE "HP2608 LINE PRINTER DRIVER - HPIB"                              00032000
$CONTROL PRIVILEGED,UNCALLABLE                                          00034000
$TP                                                                     00036000
                                                                        00038000
<<                                                                      00040000
                                                                        00042000
        HP2608 [HP3000-HPIB] Line Printer Driver - HIOLPRT0             00044000
        ---------------------------------------------------             00046000
                                                                        00048000
                                                                        00050000
Structure of HIOLPRT0:                                                  00052000
                                                                        00054000
HIOLPRT0, together with the SIO Device Monitor (SIODM) constitute a     00056000
standard MPE Type 1 I/O Driver/Monitor.  This means that it does not    00058000
run in its own process, but executes on any stack and therefore must    00060000
run to completion.  During initialization it executes on PROGEN's       00062000
stack, during request initiation it executes on ATTACHIO's stack, and   00064000
during interrupt processing it executes on the Interrupt Control        00066000
Stack (ICS).                                                            00068000
                                                                        00070000
HIOLPRT0 consists of a global area, two procedures, and an "outer       00072000
block" which is really a linkage area for INITIAL.  The global area     00074000
contains an array called INITIAL which is comprised of three parts.     00076000
The first part specifies the size of the other two, the unit extract    00078000
instruction, and various parameters which are used by INITIAL.  This    00080000
section is deleted after INITIAL is through with it.  The other two     00082000
parts are the Device Information Table (DIT) and the Channel Program    00084000
area, which is part of the Interrupt Linkage Table (ILT).  INITIAL      00086000
will put each of these items in the area of memory where it belongs.    00088000
The linkage area specifies the procedure labels (P-labels) of the       00090000
associated monitor (SIODM), the request initiator (LPDRVR), the         00092000
request completor (LPDRVR), the initialization procedure (LPINIT,       00094000
called by PROGEN at system startup), and the interrupt handler (GIP).   00096000
                                                                        00098000
                                                                        00100000
Operation of HIOLPRT0:                                                  00102000
                                                                        00104000
The primary working code of HIOLPRT0 is a procedure LPDRVR.  LPDRVR is  00106000
called with five parameters.  Two of these parameters, BANK and         00108000
BUFFADDR, are the absolute buffer address of the data to be processed.  00110000
The other three, DITP, IOQP, and SIOP are pointers to three arrays.     00112000
DITP is a pointer to the Device Information Table which contains        00114000
information about its associated line printer.  There is one DIT for    00116000
unit on the controller and they contain information which must be       00118000
saved between I/O requests to the driver.  IOQP is a pointer to the     00120000
Input/Output Queue element.  IOQ elements contain information relevent  00122000
to the current request.  SIOP is a pointer to the first element of the  00124000
Channel Program which is actually part of the Interrupt Linkage Table.  00126000
These three elements are described in more detail elsewhere in this     00128000
listing.                                                                00130000
                                                                        00132000
LPDRVR is always called by the SIO device monitor (SIODM) and it        00134000
determines the reason for the call by examining the IOQ and the DIT.    00136000
When a new request is initiated, LPDRVR examines the function code      00138000
and parameter fields contained in the IOQ element to determine the      00140000
task that is desired.  The proper command codes and program branches    00142000
are then placed in the Channel Program and its execution is begun.      00144000
                                                                        00146000
Upon completion of the request, an interrupt is generated and LPDRVR    00148000
is again called.  The code checks for current activity in progress,     00150000
and this being the case, branches to the completion section of the      00152000
driver.  Here several status words are exaimed for errors or special    00154000
conditions which might have occurred during the execution of the        00156000
Channel Program, during the data transfer, or during the operation of   00158000
the line printer.  These conditions can cause error retries and/or      00160000
special notation back to the caller.  A list of the conditions and      00162000
the return codes is provided in this listing.                           00164000
$PAGE                                                                   00166000
                Device Information Table (DIT)                          00168000
                ------------------------------                          00170000
                                                                        00172000
                                                                        00174000
There is one DIT per physical device.  If a physical device represents  00176000
more than one logical device, the logical device number is obtained     00178000
from the IOQ element (however, there is only one device per 2608        00180000
controller.)  The following diagram shows the DIT used for the          00182000
2608 line printer driver.                                               00184000
                                                                        00186000
     0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   MNEMONIC          00188000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    00190000
  0| 0| 0|AC|RQ| 0| 0| 0|IO|IA|NO|ST| 0|   STATE   |   DFLAG            00192000
   +--+--+--+--+--+--+--+--+--+--+--+--+-----------+                    00194000
  1| SYSDB relative pointer to the DIT for the next|   DLINK            00196000
   | device requesting this resource or service    |                    00198000
   +-----------------------------------------------+                    00200000
  2| SYSDB relative pointer to the first IOQ in    |   DIOQP            00202000
   | request list for this device                  |                    00204000
   +--------+--------------+-----------------------+                    00206000
  3|IOT  |    Phys. unit # | Logical device number |   DLDEV            00208000
   +--------+--------------+-----------------------+                    00210000
  4| SYSDB relative pointer to Device Linkage Table|   DDLTP            00212000
   +-----------------------------------------------+                    00214000
  5| SYSDB relative pntr to Interrupt Linkage Table|   DILTP            00216000
   +-----------------------------------------------+                    00218000
  6|VM|     |    TAB    |                 |PS|FL|TP|   DSAVE            00220000
   +-----------------------------------------------+                    00222000
  7| Hardware error pointer. Set when the driver   |   DSERR            00224000
   | detects an error.  Whenever <>0, the driver   |                    00226000
   | monitor logs an I/O error and clears this word|                    00228000
   +--+-----+-----------+-----------------+--+--+--+                    00230000
%10| Bit 0 is set at completion of timer           |   DTIME            00232000
   +--+-----+-----------+-----------------+--+--+--+                    00234000
%11| Holds the time out request entry index while  |   DRQST            00236000
   | a timer is active.                            |                    00238000
   +-----------------------------------------------+                    00240000
%12|          Hardware logged error status         | DLOGERROR          00242000
   +-----------------------------------------------+                    00244000
                                                                        00246000
                                                                        00248000
DFLAG - Flags and request state                                         00250000
  AC  ACTIVE  - A monitor is currently servicing this device.           00252000
  RQ  REQUEST - A service request is pending while the monitor is       00254000
                active.                                                 00256000
  IO  IOPROG  - An I/O Channel Program is running for this device.      00258000
  IA  IAK     - An interrupt or response has occurred for this device.  00260000
  NO  NOTRDY  - Go to state %10 after Idle Channel Program is started.  00262000
  ST  STWAIT  - The device monitor is starting an Idle Channel Program  00264000
                for this device.  There is no IOQ associated with this  00266000
                type of request.                                        00268000
  STATE       - State of the device monitor.  Specifies the next action 00270000
                to be taken in SIODM in servicing the request:          00272000
                  0 - start new request                                 00274000
                  1 - not used                                          00276000
                  2 - call driver initiator procedure                   00278000
                  3 - call driver completor procedure                   00280000
                  4 - not used                                          00282000
                  5 - process request completed                         00284000
                  6 - initiate device recognition sequence              00286000
                  7 - start operator intervention wait                  00288000
                %10 - wait for interrupt (operator intervention)        00290000
                      restart at state 0                                00292000
                %11 - wait for data segment freeze, then state 2        00294000
                %12 - wait for driver initiator to be frozen, then      00296000
                      allocate controller (state 2)                     00298000
                %13 - wait for I/O completion interrupt, then state 3   00300000
                %14 - wait for controller, then call driver initiator   00302000
                %15 - not used                                          00304000
                %16 - wait for initiator make present, then state 2     00306000
                %17 - wait for completor make present, then state 3     00308000
                                                                        00310000
DLDEV - I/O system type, unit and logical device number                 00312000
  IOT I/O TYPE- Type of I/O system                                      00314000
                0 - HP3000 Series II/III                                00316000
                1 - HP3000 Series 33 (HP-IB)                            00318000
                2 - unused                                              00320000
                3 - unsused                                             00322000
                                                                        00324000
DSAVE - Device processing flags                                         00326000
  VM   VFCMOD    - VFC has been modified.                               00328000
  TAB  TABDFAULT - System tab default.                                  00330000
  PS   PRESPACE  - Last request used prespacing.                        00332000
  FL   FULL      - Line printer buffer is full.                         00334000
  TP   TOP       - Printer is at top of form                            00336000
                                                                        00338000
                                                                        00340000
2608 Line Printer Status                                                00342000
------------------------                                                00344000
                                                                        00346000
  BYTE 1 & BYTE 2:                                                      00348000
  BITS         USE                                                      00350000
                                                                        00352000
    0     ON LINE                                                       00354000
                                                                        00356000
    1     NOT READY                                                     00358000
    2     VFC CHANNEL 9 (BOTTOM OF FORM)                                00360000
    3     VFC CHANNEL 12 (TOP OF FORM)                                  00362000
                                                                        00364000
    4     VFC INITIALIZED                                               00366000
    5     6/8 LINES PER INCH                                            00368000
    6     (NOT USED)                                                    00370000
                                                                        00372000
    7     POWER RESTORED/UNIT RESET                                     00374000
    8     ON LINE                                                       00376000
    9     PRINT MECH ERROR                                              00378000
                                                                        00380000
   10     SELF TEST FAILURE                                             00382000
   11     PAPER ERROR                                                   00384000
   12     SELF TEST MODE                                                00386000
                                                                        00388000
   13     6/8 LPI                                                       00390000
   14     PLATEN/RIBBON ERROR                                           00392000
   15     (NOT USED)                                                    00394000
                                                                        00396000
  BYTE  3:  PRINT MODE                                                  00398000
            BITS 0-7  MODE NUMBER                                       00400000
  BYTE  4:  PRIMARY/SECONDARY                                           00402000
            BITS 0-3  SECONDARY CHARACTER SET CODE                      00404000
            BITS 4-7  PRIMARY CHARACTER SET CODE                        00406000
  BYTE  5:  SELF TEST                                                   00408000
            BITS 0    PASS FAIL                                         00410000
            BITS 1-7  SUBTEST NUMBER                                    00412000
  BYTE  6:  6 LPI DOT ROW COUNT                                         00414000
  BYTE  7:  6 LPI FORM LINE NUMBER                                      00416000
  BYTE  8:  6 LPI FORM LENGTH IN LINES                                  00418000
  BYTE  9:  8 LPI DOT ROW COUNT                                         00420000
  BYTE 10:  8 LPI FORM LINE NUMBER                                      00422000
  BYTE 11:  8 LPI FORM LENGTH IN LINES                                  00424000
  BYTE 12:  FIRMWARE IDENTIFICATION CODE                                00426000
  BYTE 20:  POWER-UP LANGUAGE                                           00428000
            BITS 0-3  SECONDARY CHARACTER SET CODE                      00430000
            BITS 4-7  PRIMARY CHARACTER SET CODE                        00432000
                                                                        00434000
$PAGE                                                                   00436000
                Interrupt Linkage Table (ILT)                           00438000
                -----------------------------                           00440000
                                                                        00442000
                                                                        00444000
There is one ILT for each device controller configured on the system.   00446000
A controller may support more than one unit, however the 2608 controller00448000
only supports one unit.                                                 00450000
                                                                        00452000
     0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   MNEMONIC          00454000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    00456000
  0|         Channel                               |   ICPVA0           00458000
  1|              Program                          |   ICPVA1           00460000
  2|                  Variable                     |   ICPVA2           00462000
  3|                       Area (ICPVA)            |   ICPVA3           00464000
   +-----------------------------------------------+                    00466000
  4|         DMA Abort                             |   ICPVA4           00468000
  5|              Address                          |   ICPVA5           00470000
   +-----------------------------------------------+                    00472000
  6|                      0                        |   ISRQL            00474000
   +--+-----------------+-----+-----------+--------+                    00476000
  7|LI|     CHANQUE     |     |   CHAN    |  DEV   |   ICNTRL           00478000
   +--+-----------------+-----+-----------+--------+                    00480000
%10| SYSDB relative pointer to Channel Program area|   ISIOP            00482000
   +-----------------------------------------------+                    00484000
%11| SYSDB relative pointer to Status Return area. |   ISTAP            00486000
   | (The 2608 driver does not use the Status      |                    00488000
   |  Return area so this entry is 0.)             |                    00490000
   +-----------------------------------------------+                    00492000
%12| single instruction that is executed to extract|   IUNIT            00494000
   | the device unit number from the status pointed|                    00496000
   | to by ISTAP.  (Since there is only one unit   |                    00498000
   | on the controller, this entry is not used.)   |                    00500000
   +-----------------------------------------------+                    00502000
%13| SYSDB relative DIT pointer of the device      |   ICDP             00504000
   | currently using the channel to perform a      |                    00506000
   | data operation.                               |                    00508000
   +-----------------------+-----------------------+                    00510000
%14|       SIOPSIZE        |        CQUEN          |   IQUEUE           00512000
   +--+--+--+--------------+-----------+-----------+                    00514000
%15|RW|WP|IG|                          |  HCUNIT   |   IFLAG            00516000
   +--+--+--+--------------------------+-----------+                    00518000
%16| SYSDB relative DIT pointer for unit 0         |   IDITP0           00520000
   +-----------------------------------------------+                    00522000
%17|             Line Printer                      |                    00524000
   .               Channel                         .                    00526000
   |                 Program                       |                    00528000
   +-----------------------------------------------+                    00530000
                                                                        00532000
                                                                        00534000
ICPVA0 - Channel Program Variable Area                                  00536000
                                                                        00538000
  The first word is used by the channel program processor to store      00540000
  status information after I/O channel aborts.  The next word is used   00542000
  by the driver to indicate if status should be examined for special    00544000
  conditions or errors.  The other two words are not used.              00546000
                                                                        00548000
                                                                        00550000
ICPVA4 - DMA abort address                                              00552000
                                                                        00554000
  If a DMA abort occurs, the absolute address where the abort occurred  00556000
  is stored in this area.                                               00558000
                                                                        00560000
                                                                        00562000
ICNTRL - Contains controller information                                00564000
                                                                        00566000
  LIM     - If this bit is set, the controller is sharing a software    00568000
            channel resource in order to limit bandwidth.               00570000
  CHANQUE - The software channel resource number.                       00572000
  CHAN    - Channel number (four most significant bits of DRTN).        00574000
  DEV     - Device number (three least significant bits of DRTN).       00576000
                                                                        00578000
                                                                        00580000
IQUEUE -                                                                00582000
                                                                        00584000
  SIOPSIZE - (number of words + 1)/2 in the channel program area.       00586000
  CQUEN    - For a multi-unit controller this field contains the        00588000
             software controller resource number.                       00590000
                                                                        00592000
                                                                        00594000
IFLAG - Controller and Channel Program state flags                      00596000
                                                                        00598000
  RUNWAIT  - An Idle Channel Program should be started when there       00600000
             are no active requests to process.  This flag is always    00602000
             0 for the 2608.                                            00604000
  WAITPROG - An Idle Channel Program has been started for this          00606000
             controller.  This bit is reset by an interrupt.            00608000
  IGNOREHI - An HIOP instruction has been issued against this	          00610000
             controller but the channel program was not in a wait       00612000
             statement.  Therefore ignore the interrupt generated by    00614000
             the channel code when this program halts.                  00616000
  HCUNIT   - Highest configured unit number for this controller.        00618000
                                                                        00620000
                                                                        00622000
                                                                        00624000
            Device Reference Table DRT                                  00626000
            --------------------------                                  00628000
                                                                        00630000
There is one DRT per device controller.  The the contents of this table 00632000
are used for processing interrupts.                                     00634000
                                                                        00636000
     Word 0  SIOP   - Absolute address of the current I/O               00638000
                      instruction in execution.                         00640000
     Word 1  DBI    - Absolute address of the base of the ILT           00642000
                      for this controller.                              00644000
     Word 2  PLABLE - The external program label of the interrupt       00646000
                      service routine for this controller.              00648000
     Word 3  CHAN   - Contains channel program status information       00650000
                      which is used by the channel program interpreter. 00652000
$PAGE                                                                   00654000
            I/O QUEUE ELEMENT (IOQ)                                     00656000
            -----------------------                                     00658000
                                                                        00660000
                                                                        00662000
     0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   MNEMONIC          00664000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    00666000
  0|      Request dependent flags (see below)      |   QFLAG            00668000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    00670000
  1| SYSDB relative pointer to next IOQ element.   |   QLINK            00672000
   | Points to first word of element.              |                    00674000
   +-----------------------+-----------------------+                    00676000
  2|                       | Logical device number |   QLDEV            00678000
   +--+--+--+--------+-----+-----------+-----------+                    00680000
  3|PP|PE|MC|TOUTCNTR|                 | WAITCODE  |   QMISC            00682000
   +--+--+--+--------+-----------------+-----------+                    00684000
  4| S| If QFLAG.(3:1) is clear then this is the   |   QDSTN            00686000
   |  | DST number of the target data segment.  If |                    00688000
   |  | S is set, QADDR is DB relative.            |                    00690000
   +--+--------------------------------------------+                    00692000
  5| Offset in the data segment or system buffer   |   QADDR            00694000
   | table to the target data buffer.              |                    00696000
   +-----------------------+-----------------------+                    00698000
  6|                       | Function code for     |   QFUNC            00700000
   |                       | this request.  (See   |                    00702000
   |                       | next section.)        |                    00704000
   +-----------------------+-----------------------+                    00706000
  7| On initiation, specifies the word count (>0)  |   QWBCT            00708000
   | or byte count (<0).  At completion of the     |                    00710000
   | request this location contains the actual     |                    00712000
   | transmission count in the same units (bytes   |                    00714000
   | or words) as in the request.                  |                    00716000
   +-----------------------------------------------+                    00718000
%10| Parameter 1.  Vertical Format specification.  |   QPAR1            00720000
   | (See next section for detail.)                |                    00722000
   +-----------------------------------------------+                    00724000
%11| Parameter 2.  Space Mode Flags.  (See next    |   QPAR2            00726000
   | section for details.)                         |                    00728000
   +-----------------------+--------------+--------+                    00730000
%12|         PCBN          |  QUALIFIER   | STATUS |   QSTAT            00732000
   +-----------------------+--------------+--------+                    00734000
                                                                        00736000
                                                                        00738000
QFLAG - Request dependent flags                                         00740000
                                                                        00742000
  Bit 0  ABORT     - Abort this request and return an error indication  00744000
                     to the caller.                                     00746000
  Bit 1  SPECIAL   - Apply special handling to this request.  (Not used)00748000
  Bit 2  DIAG      - This is a request from the diagnostic subsystem.   00750000
                     (Not used)                                         00752000
  Bit 3  SYSBUFF   - Target is an index relative to the SBUF Table of   00754000
                     the data buffer.                                   00756000
  Bit 4  IOWAKE    - Wake caller on completion of request.              00758000
  Bit 5  BLOCKED   - Blocked I/O.  The caller is waited in ATTACHIO     00760000
                     until the request is completed.  Implies IOWAKE.   00762000
  Bit 6  COMPLETED - The request has been completed and the caller      00764000
                     awakened if he had requested (with IOWAKE).        00766000
  Bit 7  DATAFRZN  - Set by the memory management routines (MAM) when a 00768000
                     MAKEPRESENT request is successfully completed and  00770000
                     indicates the data segment is frozen in memory.    00772000
  Bit 8  MAMERRORD - An error has occurred while MAM was trying to      00774000
                     make the target data segment present and freeze    00776000
                     it in memory.                                      00778000
  Bit 9  PREQ      - (Not used)                                         00780000
  Bit 10 SFAIL     - Delayed failure of SIO instruction.  If a call to  00782000
                     STARTIO resulted in the request being added to     00784000
                     the channel queue, this bit indicates that the SIO 00786000
                     instruction failed when the request was selected   00788000
                     for execution.                                     00790000
  Bit 11 PFAIL     - The request was aborted because of a system power  00792000
                     failure.                                           00794000
                                                                        00796000
                                                                        00798000
QMISC - Driver request dependent flags and counters.                    00800000
                                                                        00802000
  PRE'TO'POST - Pre to post spacing change flag.                        00804000
  PEJECT      - Last operation was a page eject.                        00806000
  MASTERCLR   - Master clear done to clear powerfail bit in status.     00808000
                Master clear needs to be done from not ready conditon.  00810000
  TOUTCNTR    - Channel time-out retry counter.                         00812000
  WAITCODE    - Indicates type of wait:                                 00814000
                  0 - new request                                       00816000
                  1 - completion wait                                   00818000
                  2 - not ready wait                                    00820000
                                                                        00822000
                                                                        00824000
QSTAT - PCB number and request completion status.                       00826000
                                                                        00828000
  PCBN    - The Process Control Block (PCB) number of the process       00830000
            which made this request.  If zero, the request is not       00832000
            associated with any process and the IOQ element is to       00834000
            be returned by the system when the request has completed.   00836000
  STATUS  - General status indicating the final state of the request.   00838000
            The following codes are used:                               00840000
              0 - Not started or awaiting completion.                   00842000
              1 - Successful completion.                                00844000
              2 - End-of-file detected.                                 00846000
              3 - Unusual, but recoverable, condition detected.         00848000
              4 - Irrecoverable error has occurred.                     00850000
  QUALIFIER - A code which further defines or qualifies the general     00852000
              status.  (See the section Driver Return Status Codes.)    00854000
                                                                        00856000
$PAGE                                                                   00858000
         2608 Line Printer Request Codes                                00860000
         -------------------------------                                00862000
                                                                        00864000
Operation     Function               Parameters                         00866000
                                                                        00868000
  WRITE          1      P1 - Vertical Format Specification              00870000
                                1 - use 1st data char as format spec    00872000
                                                                        00874000
                              %53 - "+", print and suppress spacing     00876000
                              %55 - "-", print and triple space         00878000
                              %60 - "0", print and double space         00880000
                              %61 - "1", print and top of form          00882000
                                                                        00884000
                              %200-%277, print and space N-%200 lines   00886000
                              %300-%317, print with channel N-%277      00888000
                                                                        00890000
                              %320 - fill line printer buffer only      00892000
                                                                        00894000
                              All others, print and single space.       00896000
                                                                        00898000
                        P2 - Space Mode Flags                           00900000
                             (15:1) - Prespace flag                     00902000
                                if set, print then fill buffer          00904000
                                if clear, fill buffer then print        00906000
                             (14:1) - No page stepover flag             00908000
                                if set, single and double space         00910000
                                  without stepover (66 lines/page)      00912000
                                if clear, single and double space       00914000
                                  with stepover (60 lines/page)         00916000
                                                                        00918000
  FILE OPEN      2      Page eject if not at top of form                00920000
                                                                        00922000
  FILE CLOSE     3      Page eject if not at top of form                00924000
                                                                        00926000
  DEVICE CLOSE   4      Page eject if not at top of form                00928000
                                                                        00930000
  READ STATUS  %17      Read I/O status                                 00932000
                          Count - buffer must be at least 2 bytes       00934000
                                                                        00936000
  VFC SET     %100      Load VFC RAM                                    00938000
                          Count - form length in words                  00940000
                                  (0 loads RAM from internal ROM)       00942000
                          P1 - 6 for 6 LPI or 8 for 8 LPI               00944000
                               any other value defaults to 6 LPI        00946000
                                                                        00948000
  TAB SET     %101      Sets logical column definition                  00950000
                          P1 - 0 to 15, any other value defaults to 15  00952000
                                                                        00954000
$PAGE                                                                   00956000
                       DRIVER RETURN STATUS CODES                       00958000
                       --------------------------                       00960000
                                                                        00962000
                                                                        00964000
 GENERAL STATUS (13:3)       QUALIFYING STATUS (8:5)      OVERALL (8:8) 00966000
  0 - PENDING               1 - WAITING FOR COMPLETION         %10      00968000
                            3 - NOT READY WAIT                 %30      00970000
                                                                        00972000
  1 - SUCCESSFUL            0 - NO ERRORS                        1      00974000
                                                                        00976000
  2 - END OF FILE           (NOT USED)                                  00978000
                                                                        00980000
 3 - UNUSUAL CONDITION      3 - REQUEST ABORTED                %33      00982000
                            6 - POWERFAIL ABORT                %63      00984000
                          %21 - DEVICE POWERED UP             %213      00986000
                          %27 - VFC EXTERNALLY RESET          %273      00988000
                                                                        00990000
 4 - IRRECOVERABLE ERROR    0 - INVALID REQUEST                  4      00992000
                            2 - I/O TIMED OUT BEFORE COMPLETION%24      00994000
                            4 - SIO FAILURE                    %44      00996000
                            5 - UNIT FAILURE                   %54      00998000
                          %12 - SYSTEM ERROR                  %124      01000000
                          %14 - CHANNEL FAILURE               %144      01002000
                                                                        01004000
                                                                        01006000
>>                                                                      01008000
$PAGE                                                                   01010000
BEGIN                                                                   01012000
  EQUATE                                                                01014000
                 << DITP PARAMETERS >>                                  01016000
                                                                        01018000
    DILTP     =  5,  << INTERRUPT LINKAGE TABLE POINTER >>              01020000
    DLDEV     =  3,  << LOGICAL DEVICE AND UNIT NUMBERS >>              01022000
    DLOGERROR =  10, << DIT HARDWARE LOGGED ERROR STATUS >>    <<01346>>01024000
    DRQST     =  9,  << DRIVER REQUEST FLAGS >>                <<01301>>01026000
    DSAVE     =  6,  << DRIVER FLAGS >>                        <<01301>>01028000
    DSERR     =  7,  << DIT HARDWARE ERROR COUNT & INDEX >>    <<01346>>01030000
    DTIME     =  8,  << TIME-OUT REQUEST ENTRY INDEX >>        <<01301>>01032000
                                                                        01034000
                                                                        01036000
                 << IOQP PARAMETERS >>                                  01038000
                                                                        01040000
    QFUNC     =  6,  << REQUEST FUNCTION CODE >>                        01042000
    QLINK     =  1,  << POINTER TO NEXT IOQ REQUEST >>                  01044000
    QMISC     =  3,  << FLAGS PERTAINING TO THIS REQUEST >>             01046000
    QPAR1     =  8,  << CARRIAGE CONTROL SPECIFICATION >>               01048000
    QPAR2     =  9,  << PRESPACE AND STEPOVER REQUEST FLAGS >>          01050000
    QSTAT     = 10,  << REQUEST STATUS AND PCB NUMBER >>                01052000
    QWBCT     =  7,  << WORD/BYTE COUNT >>                              01054000
                                                                        01056000
                                                                        01058000
          << CHANNEL PROGRAM ADDRESSES RELATIVE TO SIOP >>              01060000
                                                                        01062000
    BADDR     = 23,  << WRITE INSTRUCTION BUFFER ADDRESS >>             01064000
    BCOUNT    = 20,  << WRITE INSTRUCTION BYTE COUNT >>                 01066000
    BUFFJMP   = 18,  << SWITCH FOR BUFFER FILL >>                       01068000
    DSJ'RB1   =  3,  << FIRST DSJ RETURN BYTE >>                        01070000
    DSJ'RB2   = 36,  << SECOND DSJ RETURN BYTE >>                       01072000
    MEMX      = 22,  << WRITE INSTRUCTION BANK NUMBER >>                01074000
    POST'CTL  = 72,  << POST-SPACE CONTROL >>                  <<01201>>01076000
    POSTJMP   = 27,  << SWITCH FOR POST SPACING >>                      01078000
    PRE'CTL   = 71,  << PRESPACE CONTROL >>                    <<01201>>01080000
    PREJMP    =  9,  << SWITCH FOR PRESPACING >>                        01082000
    RSTATCMD  = 73,  << READ STATUS COMMAND WORD >>            <<01201>>01084000
    SBANK     = 67,  << STATUS READ BANK >>                    <<01201>>01086000
    SBCOUNT   = 65,  << # STATUS BYTES >>                      <<01201>>01088000
    STATADR   = 68,  << STATUS READ ADDR >>                    <<01201>>01090000
    STATCODE  = 75,  << STATUS BYTE CODE >>                    <<01201>>01092000
    STATUS    = 74,  << I/O STATUS BUFFER >>                   <<01201>>01094000
    WRTCTL1   = 10,  << PRESPACE WRITE CONTROL INSTRUCTION >>           01096000
    WRTCTL2   = 28,  << POST-SPACE WRITE CONTROL INSTRUCTION >>         01098000
                                                                        01100000
                                                                        01102000
               << COMPLETION STATUSES >>                                01104000
                                                                        01106000
    ABORTED   =  %33,  << REQUEST ABORTED >>                            01108000
    CHANFAIL  = %144,  << I/O CHANNEL ERROR >>                          01110000
    GOODIO    =    1,  << SUCCESSFUL I/O COMPLETION >>                  01112000
    INVALIDOP =    4,  << INVALID OPERATION REQUESTED >>                01114000
    PFABORT   =  %63,  << REQUEST ABORTED DUE TO POWER FAILURE >>       01116000
    POWERUP   = %213,  << UNIT RESET DUE TO POWER FAIL OR RESET >>      01118000
    SIOFAIL   =  %44,  << SIO FAILURE >>                                01120000
    SYSERROR  = %124,  << SYSTEM ERROR >>                               01122000
    VFCRESET  = %273,  << VFC HAS BEEN MANUALLY RESET >>                01124000
$PAGE                                                                   01126000
                                                                        01128000
                << DRIVER STATES >>                                     01130000
                                                                        01132000
    CMPLTIONWAIT  = 1,  << WAITING FOR I/O COMPLETION INTERRUPT >>      01134000
    NOTRDYWAIT    = 2,  << NOT READY WAIT IN PROGRESS >>                01136000
                                                                        01138000
                                                                        01140000
                << SIODM STATES >>                                      01142000
                                                                        01144000
    INTRPTWAIT  = %13,  << WAIT FOR I/O COMPLETION >>                   01146000
    NOTREADY    =   7,  << UNIT NOT READY >>                            01148000
    REQUESTDONE =   5,  << REQUEST DONE >>                              01150000
                                                                        01152000
                                                                        01154000
            << IOMESSAGE PARAMETERS >>                                  01156000
                                                                        01158000
     DOWNLOADMSG  = 22,  << VFC DOWNLOADED MESSAGE >>          <<00761>>01160000
     NOTRDYMSG    = 11,  << NOT READY MESSAGE >>                        01162000
     OPCONSOLE    =  0,  << OUTPUT MESSAGE TO SYSTEM CONSOLE >>         01164000
     POWERUPMSG   = 13,  << POWER RESTORED/UNIT RESET MESSAGE>><<00761>>01166000
     VFCRESETMSG  = 15,  << VFC RESET MESSAGE >>               <<00761>>01168000
                                                                        01170000
                                                                        01172000
            << MISCELLANEOUS EQUATES >>                                 01174000
                                                                        01176000
    DCLOSE     =     4,  << DEVICE CLOSE FUNCTION >>                    01178000
    FOPEN      =     2,  << FILE OPEN FUNCTION >>                       01180000
    FCLOSE     =     3,  << FILE CLOSE FUNCTION >>                      01182000
    FULL'      =    14,  << LINE PRINTER BUFFER FULL >>                 01184000
    IOTIMER    =   %20,  << IO TIMER PARAMETER >>                       01186000
    ISIOP      =     8,  << ILT CHANNEL PROGRAM AREA POINTER >>         01188000
    PARITYERROR=    -1,  << PARITY ERROR LOGGING VALUE >>               01190000
    PRESPACE'  =    13,  << LAST REQUEST USED PRESPACING >>             01192000
    SYSDB      = %1000,  << ADDRESS OF SYSDB AREA >>                    01194000
  ENDEQ        =     0;                                                 01196000
$PAGE                                                                   01198000
                                                                        01200000
             << I/O STATUS BIT DEFINITIONS >>                           01202000
                                                                        01204000
     DEFINE                                                             01206000
       RDYBITS    = ( 0:2)#, << ONLINE/NOT READY BITS >>                01208000
       VFCRSET    = ( 4:1)#, << VFC RESET BIT >>                        01210000
       PON        = ( 7:1)#, << UNIT POWERED UP OR WAS RESET >>         01212000
                                                                        01214000
                                                                        01216000
               << QMISC BIT DEFINITIONS >>                              01218000
                                                                        01220000
       PRE'TO'POST= ( 0:1)#, << PRE TO POST SPACING CHANGE FLAG >>      01222000
       PEJECT     = ( 1:1)#, << LAST OPERATION WAS A PAGE EJECT >>      01224000
       MASTERCLR  = ( 2:1)#, << MASTER CLEAR IN PROGRESS >>    <<00761>>01226000
       TOUTCNTR   = ( 3:3)#, << CHANNEL TIME-OUT RETRY COUNTER >>       01228000
       WAITCODE   = (12:4)#, << INDICATES TYPE OF WAIT >>               01230000
                             <<   0 - NEW REQUEST      >>               01232000
                             <<   1 - COMPLETION WAIT  >>               01234000
                             <<   2 - NOT READY WAIT   >>               01236000
                                                                        01238000
                                                                        01240000
            << DSAVE BIT DEFINITIONS >>                                 01242000
                                                                        01244000
       VFCMOD     = ( 0:1)#, << VFC HAS BEEN MODIFIED >>                01246000
       TABDFAULT  = ( 3:4)#, << SYSTEM TAB DEFAULT >>                   01248000
       PRESPACE   = (13:1)#, << LAST REQUEST USED PRESPACING >>         01250000
       FULL       = (14:1)#, << LINE PRINTER BUFFER IS FULL >>          01252000
       TOP        = (15:1)#, << PRINTER IS AT TOP-OF-FORM (TOF) >>      01254000
                                                                        01256000
                                                                        01258000
             << MISCELLANEOUS BIT DEFINITIONS >>                        01260000
                                                                        01262000
       CMD        = (12:4)#, << SECONDARY COMMAND >>                    01264000
       DLDEVN     = ( 8:8)#, << LOGICAL DEVICE NUMBER OF DIT >>         01266000
       ERRORCODE  = ( 0:3)#, << CPVAP, ERROR CODE >>                    01268000
       FUNC       = ( 8:8)#, << QFUNC, FUNCTION CODE >>                 01270000
       IAK        = ( 8:1)#, << DFLAG, TIMER REQUEST POPPED >>          01272000
       IOSTAT     = ( 8:8)#, << QSTAT, REQUEST STATUS RETURNED >>       01274000
       LRBIT      = ( 1:1)#, << WRITE INSTRUCTION LEFT/RIGHT BYTE BIT >>01276000
       PFAIL      = (11:1)#, << QFLAG, ABORT SET DUE TO POWER FAIL >>   01278000
       SFAIL      = (10:1)#, << QFLAG, FAILURE ON DELAYED START SIO >>  01280000
       STEPOVER   = (14:1)#, << IF SET THEN NO PAGE STEPOVER >>         01282000
       TIMEDOUT   = (13:1)#, << CPVAP, TRANSFER ABORTED DUE TO TO >>    01284000
       LOADMEMORY = ASSEMBLE(LSEA)#,                                    01286000
       STOREMEMORY= ASSEMBLE(SSEA)#,                           <<00761>>01288000
     ENDDEF       = 0#;                                                 01290000
                                                                        01292000
                                                                        01294000
                                                                        01296000
$PAGE                                                                   01298000
<<      *********************************                               01300000
        *                               *                               01302000
        *   DRIVER DB AREA DEFINITION   *                               01304000
        *                               *                               01306000
        *********************************       >>                      01308000
                                                                        01310000
                                                                        01312000
     ARRAY INITIAL(0:99) = DB :=                               <<01346>>01314000
       [8/11,8/1],<<DIT SIZE,NOT CORE RES/NO IDLE CP/DVR TYPE>><<01346>>01316000
                0,   << NOT USED >>                                     01318000
                0,   << UNIT EXTRACT INSTRUCTION - NOT USED >>          01320000
       [8/38,8/0],   << CHANNEL PROG SIZE/2, STATUS RETURN AREA SIZE >> 01322000
                                                                        01324000
       << LP DIT >>                                                     01326000
                0,   << DFLAG >>                                        01328000
                0,   << DLINK >>                                        01330000
                0,   << DIOQP >>                                        01332000
          %040000,   << DLDEV - HP-IB DEVICE >>                <<01301>>01334000
                0,   << DDLTP >>                                        01336000
                0,   << DILTP >>                                        01338000
                0,   << DSAVE >>                               <<01301>>01340000
                0,   << DSERR >>                                        01342000
                0,   << DTIME >>                               <<01301>>01344000
                0,   << DRQST >>                               <<01301>>01346000
                0,   << DLOGERROR >>                           <<01346>>01348000
                                                                        01350000
                                                                        01352000
       << CHANNEL PROGRAM >>                                            01354000
                                                                        01356000
<< 0>> << WAIT >>           %1000,  << MAKE SURE UNIT IS RESPONDING >>  01358000
<< 1>>                          0,                                      01360000
                                                                        01362000
<< 2>> << DSJ >>            %2403,  << CHECK PRINTER'S CONDITION >>     01364000
<< 3>>                          0,     << RETURN BYTE >>                01366000
<< 4>>                          0,     << JUMP *+0, READY FOR COMMAND >>01368000
<< 5>>                         35,     << JUMP *+35, READ STATUS >>     01370000
<< 6>>                          0,     << JUMP *+0, PARITY ERROR SEEN >>01372000
<< 7>>                         35,     << JUMP *+35, READ STATUS & PE >>01374000
                                                                        01376000
<< 8>> << JUMP >>               0,  << JUMP *+0 FOR PRESPACE REQUEST >> 01378000
<< 9>>                          0,  << JUMP *+7 OTHERWISE >>            01380000
                                                                        01382000
<<10>> << WRITE CONTROL >>  %2010,  << PRESPACE WRITE CONTROL/SET VFC >>01384000
<<11>>                          1,                                      01386000
<<12>>                          0,                                      01388000
<<13>>                     %42000,                                      01390000
<<14>>                          0,                                      01392000
                                                                        01394000
<<15>> << WAIT >>           %1000,  << WAIT FOR UNIT TO PARALLEL POLL >>01396000
<<16>>                          0,                                      01398000
                                                                        01400000
<<17>> << JUMP >>               0,  << JUMP *+0 FOR BUFFER FILL >>      01402000
<<18>>                          0,  << JUMP *+7 OTHERWISE >>            01404000
                                                                        01406000
<<19>> << WRITE DATA >>     %2000,  << WRITE OUT DATA BUFFER >>         01408000
<<20>>                          0,                                      01410000
<<21>>                          0,                                      01412000
<<22>>                          0,                                      01414000
<<23>>                          0,                                      01416000
                                                                        01418000
<<24>> << WAIT >>           %1000,  << WAIT FOR UNIT TO PARALLEL POLL >>01420000
<<25>>                          0,                                      01422000
                                                                        01424000
<<26>> << JUMP >>               0,  << JUMP *+0 FOR POSTSPACE REQUEST >>01426000
<<27>>                          0,  << JUMP *+7 OTHERWISE >>            01428000
                                                                        01430000
<<28>> << WRITE CONTROL >>  %2010,  << POSTSPACE WRITE CONTROL >>       01432000
<<29>>                          1,                                      01434000
<<30>>                          0,                                      01436000
<<31>>                     %42000,                                      01438000
<<32>>                          0,                                      01440000
                                                                        01442000
<<33>> << WAIT >>           %1000,  << WAIT FOR UNIT TO PARALLEL POLL >>01444000
<<34>>                          0,                                      01446000
                                                                        01448000
<<35>> << DSJ >>            %2403,  << CHECK PRINTER'S STATE >>         01450000
<<36>>                          0,     << RETURN BYTE >>                01452000
<<37>>                          0,     << JUMP *+0, READY FOR COMMAND >>01454000
<<38>>                          2,     << JUMP *+2, READ STATUS >>      01456000
<<39>>                          0,     << JUMP *+0, PARITY ERROR SEEN >>01458000
<<40>>                          2,     << JUMP *+2, READ STATUS & PE >> 01460000
                                                                        01462000
<<41>> << INT/HLT >>         %601,  << INTERRUPT/HALT AND PUT HALT >>   01464000
<<42>>                          1,     <<CODE OF 1 IN CPVA WORD 1 >>    01466000
                                                                        01468000
<<43>> << WRITE COMMAND >>  %2012,  << READ STATUS COMMAND >>           01470000
<<44>>                          1,                                      01472000
<<45>>                          0,                                      01474000
<<46>>                     %42000,                                      01476000
<<47>>                          0,                                      01478000
                                                                        01480000
<<48>> << WAIT >>           %1000,  << WAIT FOR PARALLEL POLL>><<00761>>01482000
<<49>>                          0,                             <<00761>>01484000
                                                                        01486000
<<50>> << READ STATUS >>    %1412,  << READ STATUS BYTE >>              01488000
<<51>>                          2,                                      01490000
<<52>>                          0,                                      01492000
<<53>>                      %2000,                                      01494000
<<54>>                          0,                                      01496000
                                                                        01498000
<<55>> << INT/HLT >>         %601,  << INTERRUPT/HALT AND PUT HALT >>   01500000
<<56>>                          2,  <<   CODE OF 2 IN CPVA WORD 1  >>   01502000
                                                               <<01201>>01504000
<<57>> << WRITE CONTROL >>  %2012,  << STATUS READ COMMAND >>  <<01201>>01506000
<<58>>                          1,                             <<01201>>01508000
<<59>>                          0,                             <<01201>>01510000
<<60>>                     %42000,                             <<01201>>01512000
<<61>>                          0,  << STATUS BYTE CODE ADR >> <<01201>>01514000
                                                               <<01201>>01516000
<<62>> << WAIT >>           %1000,  << WAIT FOR // POLL >>     <<01201>>01518000
<<63>>                          0,                             <<01201>>01520000
                                                               <<01201>>01522000
<<64>> << READ STATUS >>    %1412,  << READ STATUS BYTES >>    <<01201>>01524000
<<65>>                          0,  << #BYTES >>               <<01201>>01526000
<<66>>                          0,                             <<01201>>01528000
<<67>>                          0,  << BANK >>                 <<01201>>01530000
<<68>>                          0,  << ADDRESS >>              <<01201>>01532000
                                                               <<01201>>01534000
<<69>> << JUMP >>               0,  << JMP *-38, DSJ CHECK >>  <<01201>>01536000
<<70>>                    %177732,                             <<01201>>01538000
                                                               <<01201>>01540000
<<71>> << BUFFERS >>            0,  << PRESPACE CONTROL >>     <<01201>>01542000
<<72>>                          0,  << POSTSPACE CONTROL >>    <<01201>>01544000
<<73>>                          2,  << READ 2 STATUS BYTES >>  <<01201>>01546000
<<74>>                          0,  << STATUS >>               <<01201>>01548000
<<75>>                          0;  << STATUS BYTE CODE >>     <<01201>>01550000
$PAGE                                                                   01552000
<<       ***************************************                        01554000
         *                                     *                        01556000
         *   EXTERNAL PROCEDURE DECLARATIONS   *                        01558000
         *                                     *                        01560000
         ***************************************     >>                 01562000
                                                                        01564000
                                                                        01566000
   PROCEDURE ABORTTIMEREQ(TRLX);                                        01568000
     VALUE TRLX;   INTEGER TRLX;                                        01570000
     OPTION EXTERNAL;                                                   01572000
                                                                        01574000
   PROCEDURE GIP'HPIB;                                         <<01301>>01576000
     OPTION EXTERNAL;                                                   01578000
                                                                        01580000
   PROCEDURE HELP;                                                      01582000
     OPTION EXTERNAL;                                                   01584000
                                                                        01586000
   LOGICAL PROCEDURE IOMESSAGE(SETNO,MSGNO,MASK,P1,P2,P3,P4,P5,DEST,    01588000
                               REPLY,OFFSET,DITP,IOTYPE);               01590000
     VALUE  SETNO,MSGNO,MASK,P1,P2,P3,P4,P5,DEST,REPLY,OFFSET,          01592000
            DITP,IOTYPE;                                                01594000
     INTEGER  SETNO,MSGNO,MASK,P1,P2,P3,P4,P5,DEST,REPLY,OFFSET,IOTYPE; 01596000
     INTEGER POINTER  DITP;                                             01598000
     OPTION VARIABLE, EXTERNAL;                                         01600000
                                                                        01602000
   PROCEDURE SIODM(DITP,FLAGS);                                         01604000
     VALUE DITP,FLAGS;   LOGICAL FLAGS;                                 01606000
     POINTER DITP;   OPTION EXTERNAL;                                   01608000
                                                                        01610000
   PROCEDURE MASTERCLEARHPIB(DITP);                            <<01301>>01612000
     ARRAY DITP;   OPTION EXTERNAL;                                     01614000
                                                                        01616000
   PROCEDURE START'HPIB(DITP,SIOP,QFLAG);                      <<01301>>01618000
     VALUE DITP,SIOP,QFLAG;   LOGICAL QFLAG;                            01620000
     POINTER DITP,SIOP;   OPTION EXTERNAL;                              01622000
                                                                        01624000
   INTEGER PROCEDURE TIMEREQ(CODE,REQ,TIME);                            01626000
     VALUE CODE,REQ,TIME;                                               01628000
     INTEGER CODE,REQ;   DOUBLE TIME;                                   01630000
     OPTION EXTERNAL;                                                   01632000
$PAGE                                                                   01634000
<<       ******************************************                     01636000
         *                                        *                     01638000
         *   LP DRIVER INITIALIZATION PROCEDURE   *                     01640000
         *                                        *                     01642000
         ******************************************     >>              01644000
                                                                        01646000
                                                                        01648000
   PROCEDURE LPINIT(DITP);                                              01650000
     INTEGER ARRAY DITP;                                                01652000
                                                                        01654000
<<                                                                      01656000
       THIS PROCEDURE INITIALIZES THE PRESPACING, POST-SPACING, AND     01658000
       STATUS BUFFER ADDRESSES IN THE CHANNEL PROGRAM.                  01660000
>>                                                                      01662000
     BEGIN                                                              01664000
       INTEGER POINTER ILTP = Q+1;                                      01666000
       INTEGER POINTER SIOP = Q+2;                                      01668000
       INTEGER SIOBASE = Q+3;                                           01670000
                                                                        01672000
                                                                        01674000
       TOS := DITP(DILTP);      << ILTP    >>                           01676000
       TOS := ILTP(ISIOP);      << SIOP    >>                           01678000
       TOS := @SIOP + SYSDB;    << SIOBASE >>                           01680000
                                                                        01682000
       SIOP(14) := SIOBASE + PRE'CTL;                                   01684000
       SIOP(32) := SIOBASE + POST'CTL;                                  01686000
       SIOP(47) := SIOBASE + RSTATCMD;                                  01688000
       SIOP(54) := SIOBASE + STATUS;                           <<00761>>01690000
       SIOP(61) := SIOBASE + STATCODE;                         <<01201>>01692000
     END;                                                               01694000
$PAGE                                                                   01696000
<<       ************************************************               01698000
         *                                              *               01700000
         *   LINE PRINTER DRIVER PROCEDURE  -  LPDRVR   *               01702000
         *                                              *               01704000
         ************************************************     >>        01706000
                                                                        01708000
                                                                        01710000
                                                                        01712000
   INTEGER PROCEDURE LPDRVR(IOQP,DITP,BANK,BUFFADDR,SIOP,DRTN);<<01301>>01714000
<<                                                                      01716000
       THIS PROCEDURE INITIATES AND COMPLETES I/O REQUESTS              01718000
       FOR THE HP 2608 LINE PRINTER CONNECTED TO THE HP-IB              01720000
       AND CONTROLLED BY THE GIC.                                       01722000
                                                                        01724000
       MODE RETURNS IN LPDRVR -                                         01726000
           5 - REQUEST COMPLETED                                        01728000
           7 - NOT READY WAIT                                           01730000
         %13 - WAIT FOR COMPLETION                              >>      01732000
                                                                        01734000
   VALUE  DITP,IOQP,BANK,BUFFADDR,SIOP,DRTN;                   <<01301>>01736000
   INTEGER  BANK,BUFFADDR,DRTN;                                <<01301>>01738000
   INTEGER POINTER  DITP,IOQP,SIOP;                                     01740000
   OPTION  PRIVILEGED,UNCALLABLE;                                       01742000
                                                                        01744000
   BEGIN                                                                01746000
     LOGICAL ARRAY                                                      01748000
       DITPL(*) = DITP, IOQPL(*) = IOQP;                                01750000
                                                                        01752000
     DOUBLE                                                             01754000
       BUFFADDRD = Q-7;    << BANK AND BUFFER ADDRESS >>       <<01301>>01756000
                                                                        01758000
     INTEGER POINTER                                                    01760000
       CPVAP = Q+1,    << HOLDS CHANNEL I/O STATUS >>                   01762000
       IDLESIOP = Q+2,    << POINTS TO START OF IDLE CHAN PROG >>       01764000
       STATSIOP = Q+7,    << POINTS TO STATUS READ LOGIC >>    <<01226>>01766000
       FILLSIOP = Q+8;    << POINTS TO FILL BUFFER >>          <<01226>>01768000
                                                                        01770000
     INTEGER                                                            01772000
       COUNT    = Q+3,    << BUFFER BYTE COUNT >>                       01774000
       PARAM    = Q+4,    << CONTROL PARAMETER >>                       01776000
       PRINTCTL = Q+5,    << PRINT CONTROL BYTE >>                      01778000
       FCODE    = Q+6,    << FUNCTION CODE >>                           01780000
       S0       = S-0;                                                  01782000
                                                                        01784000
$PAGE                                                                   01786000
   << INITIALIZE LOCAL POINTERS AND VARIABLES >>                        01788000
                                                                        01790000
     TOS := DITP(DILTP);     << CPVAP >>                                01792000
     TOS := @SIOP+33;        << IDLESIOP >>                             01794000
     TOS := IOQP(QWBCT);     << COUNT >>                       <<00761>>01796000
     TOS := 0;               << PARAM >>                                01798000
     TOS := 0;               << PRINTCTL >>                             01800000
     TOS := IOQP(QFUNC).FUNC;  << FCODE >>                              01802000
     TOS := @SIOP+57;        << STATSIOP >>                    <<01201>>01804000
     TOS := @SIOP+15;        << FILLSIOP >>                    <<01226>>01806000
                                                                        01808000
     IF @IOQP = 0 THEN GOTO EXIT;  << NOTHING TO DO >>         <<02696>>01810000
                                                                        01812000
     IF IOQP(QMISC).WAITCODE = CMPLTIONWAIT THEN                        01814000
       ABORTTIMEREQ(DITP(DRQST));                              <<01301>>01816000
                                                                        01818000
     TOS := IOQP;                                                       01820000
     IF < THEN      << ABORT PROCESS >>                                 01822000
       BEGIN                                                            01824000
         TOS := IF IOQPL.PFAIL THEN PFABORT ELSE ABORTED;               01826000
         GOTO BADIO;                                                    01828000
         HELP;     << LINK >>                                           01830000
       END;                                                             01832000
                                                                        01834000
                                                               <<01513>>01836000
                                                               <<01513>>01838000
          << CHECK FOR RETURN FROM NOT READY CONDITION >>      <<01513>>01840000
                                                               <<01513>>01842000
                                                               <<01513>>01844000
     IF IOQP(QMISC).WAITCODE = NOTRDYWAIT THEN                 <<01513>>01846000
                                                               <<01513>>01848000
       BEGIN                                                   <<01513>>01850000
         IOQP(QMISC).MASTERCLR := 0;   << PON OCCURRED? >>     <<01513>>01852000
         IF <> OR SIOP(STATUS).PON = 1 THEN                    <<01513>>01854000
           GOTO PONINIT;   << YES - DO PON INITIATION >>       <<01513>>01856000
         IF SIOP(DSJ'RB1) <> 7 THEN                            <<01513>>01858000
                                                               <<01513>>01860000
           BEGIN   << LINE PARTIALLY PRINTED >>                <<01513>>01862000
             IF DITP(DSAVE).(PRESPACE':2)=3 OR                 <<01513>>01864000
             IOQP(QMISC).PRE'TO'POST=1 THEN                    <<01513>>01866000
                                                               <<01513>>01868000
               BEGIN   << RESTART FILL BUFFER >>               <<01513>>01870000
                 IF SIOP(BCOUNT)=0 THEN   << COUNT EXPIRED >>  <<01513>>01872000
                   GO TO PRINTDONE;   << DON'T RESTART >>      <<01513>>01874000
                 SIOP(MEMX).(8:8) := BANK;                     <<01513>>01876000
                 SIOP(BADDR) := BUFFADDR;                      <<01513>>01878000
                 IOQP(QMISC).PRE'TO'POST := 0;                 <<01513>>01880000
                 START'HPIB(DITP,FILLSIOP,FALSE);              <<01513>>01882000
                 GO TO PRINTCONT;                              <<01513>>01884000
               END                                             <<01513>>01886000
                                                               <<01513>>01888000
             ELSE GOTO PRINTDONE;   << REQ DONE OTHERWISE >>   <<01513>>01890000
           END;                                                <<01513>>01892000
       END;                                                    <<01513>>01894000
                                                               <<01513>>01896000
                                                               <<01513>>01898000
     IF IOQP(QMISC).WAITCODE=CMPLTIONWAIT THEN  << PROCESS INTERRUPT >> 01900000
       GOTO LPCONT;                                                     01902000
                                                                        01904000
                                                                        01906000
     SIOP(PREJMP) := SIOP(BUFFJMP) := SIOP(POSTJMP) := 7;  << INIT CP >>01908000
     SIOP(WRTCTL1).CMD := %10;  << INIT WRITE CTL TO PRINT COMMAND >>   01910000
     SIOP(WRTCTL2).CMD := %10;  << INIT WRITE CTL TO PRINT COMMAND >>   01912000
                                                                        01914000
                                                                        01916000
                                                                        01918000
          << CHECK FOR FOPEN, FCLOSE, AND DCLOSE  (FCODE = 2,3, OR 4) >>01920000
                                                                        01922000
     IF FCODE = DCLOSE THEN                                             01924000
       BEGIN                                                            01926000
         IF DITP(DSAVE).(FULL':2) <> 1 THEN  << EJECT A PAGE >><<02696>>01928000
           BEGIN                                                        01930000
             SIOP(PREJMP) := 0;                                         01932000
             SIOP(PRE'CTL) := %200;                                     01934000
           END;                                                         01936000
         DITP(DSAVE).(13:3) := 1;   << SET TOF FLAG >>                  01938000
         IOQP(QMISC).PEJECT := 1;                                       01940000
         GOTO STARTPRINT;                                               01942000
       END                                                              01944000
                                                                        01946000
                                                                        01948000
     ELSE  IF FCODE=FCLOSE THEN                                         01950000
       BEGIN                                                            01952000
         IF DITP(DSAVE).(FULL':2) = 1 THEN                     <<02696>>01954000
           GOTO PRINTDONE;  << EMPTY BUFFER & ALREADY AT TOP >><<02696>>01956000
         IOQP(QMISC).PEJECT := 1;   << SET PAGE EJECT FLAG >>           01958000
         PRINTCTL := %200;                                              01960000
         GOTO PRINTSETUP;   << TO ISSUE PAGE EJECT >>                   01962000
       END                                                              01964000
                                                                        01966000
                                                                        01968000
     ELSE IF FCODE=FOPEN THEN                                           01970000
       BEGIN                                                            01972000
         IF DITP(DSAVE).(FULL':2) <> 1 THEN                    <<02696>>01974000
           BEGIN                                                        01976000
             DITP(DSAVE).FULL := 0;  << SET BUFFER EMPTY >>    <<02696>>01978000
             IOQP(QMISC).PEJECT := 1;                                   01980000
             SIOP(POST'CTL) := %200;                                    01982000
             SIOP(POSTJMP) := 0;                                        01984000
             GOTO STARTPRINT;                                           01986000
           END ELSE                                            <<01513>>01988000
             GOTO PRINTDONE;                                   <<01513>>01990000
       END                                                              01992000
                                                                        01994000
                                                                        01996000
          << CHECK FOR FWRITE  (FCODE = 1) >>                           01998000
   ELSE IF FCODE = 1 THEN                                               02000000
     BEGIN                                                              02002000
                                                                        02004000
                                                                        02006000
     IF DITP(DSAVE).(PRESPACE':2)=3 AND NOT IOQPL(QPAR2) THEN           02008000
       BEGIN                                                            02010000
         SIOP(PREJMP) := 0;                                             02012000
         IF IOQPL(QPAR2).STEPOVER THEN  << NO AUTO EJECT >>    <<02696>>02014000
           SIOP(PRE'CTL) := 1  << SINGLE SPACE W/O STEPOVER >> <<02696>>02016000
         ELSE  << AUTO PAGE EJECT >>                           <<02696>>02018000
         SIOP(PRE'CTL) := %202;         << ISSUE SINGLE SPACE WITH >>   02020000
         IOQP(QMISC).PRE'TO'POST := 1;  << STEPOVER TO CLEAR LP BUFF >> 02022000
       END;                                                             02024000
                                                                        02026000
     TOS := IOQP(QWBCT);                                                02028000
     IF < THEN             << BYTE COUNT >>                             02030000
       COUNT := -TOS         << MAKE POSITIVE >>                        02032000
     ELSE                  << WORD COUNT >>                             02034000
       COUNT := TOS&ASL(1);  << CHANGE TO BYTE COUNT >>                 02036000
                                                                        02038000
     IF IOQP(QPAR1) = 1 THEN   << IMBEDDED CONTROL >>                   02040000
       BEGIN                                                            02042000
         IF COUNT = 0 THEN    << INVALID OPERATION >>                   02044000
           BEGIN                                                        02046000
             TOS := INVALIDOP;                                          02048000
             GOTO IODONE;                                               02050000
           END;                                                         02052000
         TOS := BUFFADDRD;    << LOAD BANK AND BUFF ADDRESS >>          02054000
         LOADMEMORY;             << LOAD FIRST WORD >>                  02056000
         PARAM := TOS&LSR(8);    << ISOLATE AND SAVE CONTROL PARAM >>   02058000
         COUNT := COUNT - 1;     << DECREMENT BYTE COUNT >>             02060000
       END                                                              02062000
     ELSE                      << CONTROL IN PARAM WORD >>              02064000
       PARAM := IOQP(QPAR1);                                            02066000
                                                                        02068000
     DITP(DSAVE).PRESPACE := IF IOQPL(QPAR2)                            02070000
       THEN 1 ELSE 0;                 << SET PRESPACE FLAG >>           02072000
                                                                        02074000
                                                                        02076000
                                                                        02078000
        << INITIALIZE PRINT CONTROL BYTE >>                             02080000
                                                                        02082000
     IF IOQPL(QPAR2).STEPOVER THEN  << SINGLE SPACE WITHOUT STEPOVER >> 02084000
       PRINTCTL := 1                                                    02086000
     ELSE                           << SINGLE SPACE WITH STEPOVER >>    02088000
       PRINTCTL := %202;                                                02090000
                                                                        02092000
                                                                        02094000
        << SETUP PRINT CONTROL BYTE >>                                  02096000
                                                                        02098000
     IF PARAM = "+" THEN            << SUPPRESS SPACING >>              02100000
       PRINTCTL := 0                                                    02102000
                                                                        02104000
     ELSE IF PARAM = "0" THEN       << DOUBLE SPACE >>                  02106000
       PRINTCTL := PRINTCTL + 1                                         02108000
                                                                        02110000
     ELSE IF PARAM = "-" THEN       << TRIPLE SPACE >>                  02112000
       PRINTCTL := PRINTCTL + 2                                         02114000
                                                                        02116000
     ELSE IF PARAM = "1" THEN       << TOP OF FORM >>                   02118000
       BEGIN                                                            02120000
         IF COUNT=0 AND DITP(DSAVE).(FULL':2)=1 THEN                    02122000
           GOTO PRINTDONE;  << EMPTY BUFFER AND ALREADY AT TOP >>       02124000
         PRINTCTL := %200;                                              02126000
         IOQP(QMISC).PEJECT := 1;   << SET PAGE EJECT FLAG >>           02128000
       END                                                              02130000
                                                                        02132000
     ELSE IF %200 <= PARAM <= %277 THEN  << SLEW N LINES >>             02134000
       PRINTCTL := PARAM - %200                                         02136000
                                                                        02138000
     ELSE IF %300 <= PARAM <= %317 THEN  << SELECT CHANNEL N >>         02140000
       PRINTCTL := PARAM - %100                                         02142000
                                                                        02144000
     ELSE IF PARAM = %320 THEN      << BUFFER FILL ONLY >>              02146000
       BEGIN                                                            02148000
         PRINTCTL := -1;                                                02150000
         IF IOQP(QMISC).PRE'TO'POST=0 AND COUNT=0 THEN                  02152000
           GOTO PRINTDONE;                                              02154000
       END;                                                             02156000
                                                                        02158000
$PAGE                                                                   02160000
<<  SETUP CHANNEL PROGRAM FOR BUFFER FILL AND PRINT CONTROL  >>         02162000
                                                                        02164000
  PRINTSETUP:                                                           02166000
     IF PRINTCTL >= 0 THEN    << SETUP PRINT CONTROL >>                 02168000
       BEGIN                                                            02170000
         DITP(DSAVE).FULL := 0;                                         02172000
         IF DITP(DSAVE).PRESPACE=1 THEN    << PRESPACE >>               02174000
           BEGIN                                                        02176000
             SIOP(PREJMP) := 0;                                         02178000
             SIOP(PRE'CTL) := PRINTCTL;                                 02180000
           END                                                          02182000
         ELSE                              << POST-SPACE >>             02184000
           BEGIN                                                        02186000
             SIOP(POSTJMP) := 0;                                        02188000
             SIOP(POST'CTL) := PRINTCTL;                                02190000
           END;                                                         02192000
       END;                                                             02194000
                                                                        02196000
                                                                        02198000
     IF COUNT <> 0 THEN        << SETUP BUFFER FILL >>                  02200000
       BEGIN                                                            02202000
         SIOP(BUFFJMP) := 0;                                            02204000
         SIOP(BCOUNT) := COUNT;                                         02206000
         SIOP(MEMX).(8:8) := BANK;                                      02208000
         SIOP(MEMX).LRBIT := IF IOQP(QPAR1)=1   << IMBEDDED CONTROL >>  02210000
           THEN 1 ELSE 0;               << START WITH RIGHT BYTE >>     02212000
         SIOP(BADDR) := BUFFADDR;                                       02214000
         DITP(DSAVE).FULL := IF DITPL(DSAVE).PRESPACE                   02216000
           THEN 1 ELSE 0;    << IF PRESPACING INDICATE BUFF IS FULL >>  02218000
       END;                                                             02220000
                                                                        02222000
                                                                        02224000
                                                                        02226000
<<  START CHANNEL PROGRAM  >>                                           02228000
                                                                        02230000
  STARTPRINT:                                                           02232000
     CPVAP := 0;                << CLEAR CHANNEL STATUS WORD >>         02234000
     SIOP(DSJ'RB1) := 7;        << INITIALIZE DSJ RTN BYTES >> <<00761>>02236000
     SIOP(DSJ'RB2) := 0;                                                02238000
     SIOP(STATUS) := 0;         << CLEAR CP STATUS WORD >>              02240000
                                                                        02242000
     START'HPIB(DITP,SIOP,TRUE);   << START CHANNEL PROGRAM >> <<01301>>02244000
PRINTCONT:                                                     <<00761>>02246000
     IF < THEN      << SIO FAILURE >>                                   02248000
       BEGIN                                                            02250000
         TOS := SIOFAIL;                                                02252000
         GOTO BADIO;                                                    02254000
       END;                                                             02256000
                                                                        02258000
     IOQP(QMISC).WAITCODE := CMPLTIONWAIT;  << SET REQUEST STATE >>     02260000
     DITP(DTIME) := 0;                                         <<01301>>02262000
     DITP(DRQST) := TIMEREQ(IOTIMER,@DITP,2000D);              <<01301>>02264000
     LPDRVR := INTRPTWAIT;                                              02266000
     RETURN;                                                            02268000
                                                                        02270000
                                                                        02272000
     END      << OF WRITE LOGIC (FUNCTION CODE = 1) >>                  02274000
                                                               <<01201>>02276000
                                                               <<01201>>02278000
       << READ STATUS (FUNCTION CODE = %17) >>                 <<01201>>02280000
                                                               <<01201>>02282000
  ELSE  IF FCODE = %17 THEN                                    <<01201>>02284000
    BEGIN   << READ STATUS PROCESSING >>                       <<01201>>02286000
      TOS := IOQP(QWBCT);  << GET COUNT >>                     <<01201>>02288000
      IF < THEN  << NEGATIVE BYTE COUNT >>                     <<01201>>02290000
        COUNT := -TOS   << MAKE POSITIVE >>                    <<01201>>02292000
      ELSE  << POSITIVE WORD COUNT >>                          <<01201>>02294000
        COUNT := TOS & ASL(1);  << CHANGE TO BYTE >>           <<01201>>02296000
                                                               <<01201>>02298000
      IF COUNT < 1 THEN  << INVALID REQUEST >>                 <<01201>>02300000
        BEGIN                                                  <<01201>>02302000
          TOS := INVALIDOP;                                    <<01201>>02304000
          GOTO BADIO;                                          <<01201>>02306000
        END;                                                   <<01201>>02308000
      IF COUNT > 16 THEN  << EXCEED MAX STATUS >>              <<01201>>02310000
        COUNT := 16;  << SET MAX STATUS AVAIL >>               <<01201>>02312000
                                                               <<01201>>02314000
      SIOP(STATCODE) := SIOP(SBCOUNT) := COUNT;                <<01201>>02316000
      SIOP(SBANK).LRBIT := 0;  << START W/LEFT BYTE >>         <<01201>>02318000
      SIOP(SBANK).(8:8) := BANK;  << SET BANK >>               <<01201>>02320000
      SIOP(STATADR) := BUFFADDR;  << SET ABS ADR >>            <<01201>>02322000
                                                               <<01201>>02324000
      SIOP(STATUS) := 0;                                       <<01201>>02326000
      START'HPIB(DITP,STATSIOP,FALSE);  << START CHAN PROG >>  <<01368>>02328000
      GOTO PRINTCONT;   << FOR WRAP-UP >>                      <<01201>>02330000
                                                               <<01201>>02332000
    END   << OF READ STATUS PROCESSING >>                      <<01201>>02334000
                                                               <<01201>>02336000
                                                               <<01201>>02338000
       << SET VFC (FUNCTION CODE = %100) >>                             02340000
                                                                        02342000
                                                                        02344000
   ELSE  IF FCODE = %100 THEN                                           02346000
     BEGIN   << SET VFC PROCESSING >>                                   02348000
       COUNT := IOQP(QWBCT)&ASL(1);   << CHANGE TO BYTE COUNT >>        02350000
       IF COUNT<0 OR COUNT>254 THEN                                     02352000
         BEGIN                                                          02354000
           TOS := INVALIDOP;                                            02356000
           GOTO IODONE;                                                 02358000
         END;                                                           02360000
                                                                        02362000
       SIOP(PRE'CTL) := IOQP(QWBCT);  << DATA BYTE = BUFF LENGTH >>     02364000
       IF IOQP(QPAR1)=8 THEN   << SET 8 LPI INDICATOR IN DATA BYTE >>   02366000
         SIOP(PRE'CTL) := SIOP(PRE'CTL) + %200;                         02368000
       SIOP(PREJMP) := 0;                                               02370000
       SIOP(WRTCTL1).CMD := 2;  << SET WRITE CONTROL TO VFC COMMAND>>   02372000
      DITP(DSAVE).VFCMOD := 0;                                 <<00761>>02374000
                                                                        02376000
       IF COUNT <> 0 THEN    << SETUP BUFFER TRANSFER >>                02378000
         BEGIN                                                          02380000
           SIOP(BUFFJMP) := 0;                                          02382000
           SIOP(BCOUNT) := COUNT;                                       02384000
           SIOP(MEMX) := BANK;                                          02386000
           SIOP(BADDR) := BUFFADDR;                                     02388000
          DITP(DSAVE).VFCMOD := 1;   << VFC MODIFIED >>        <<00761>>02390000
         END;                                                           02392000
       GOTO STARTPRINT;                                                 02394000
                                                                        02396000
    END  << OF SET VFC LOGIC >>                                         02398000
$PAGE                                                                   02400000
                                                                        02402000
       << TAB SET (FUNCTION CODE = %101) >>                             02404000
                                                                        02406000
   ELSE  IF FCODE = %101 THEN                                           02408000
     BEGIN    << TAB SET PROCESSING >>                                  02410000
       IF IOQP(QPAR1)>15 THEN TOS := 15                                 02412000
         ELSE TOS := IOQP(QPAR1);                                       02414000
       SIOP(PRE'CTL) := TOS;                                            02416000
       SIOP(PREJMP) := 0;                                               02418000
       SIOP(WRTCTL1).CMD := 7;   << SET UP CLEAR COMMAND >>             02420000
       DITP(DSAVE).TABDFAULT := SIOP(PRE'CTL);                 <<01513>>02422000
       GOTO STARTPRINT;                                                 02424000
                                                                        02426000
    END  << OF TAB SET LOGIC >>                                         02428000
                                                                        02430000
   ELSE   << FALL THROUGH >>                                            02432000
                                                                        02434000
                                                                        02436000
                                                                        02438000
  PRINTDONE:                                                            02440000
     TOS := GOODIO;                                                     02442000
                                                                        02444000
  IODONE:                                                               02446000
     IOQP(QSTAT).IOSTAT := TOS;    << STORE RETURN STATUS >>            02448000
                                                               <<02696>>02450000
  EXIT:                                                        <<02696>>02452000
     LPDRVR := REQUESTDONE;                                             02454000
     RETURN;                                                            02456000
                                                                        02458000
  CHANERROR:                                                            02460000
     TOS := CHANFAIL;                                                   02462000
     DITP(DSERR):= [8/1,8/DLOGERROR];                          <<01346>>02464000
     DITP(DLOGERROR) := CPVAP;    << LOG ERROR STATUS >>       <<01346>>02466000
                                                                        02468000
  BADIO:                                                                02470000
     DITP(DSAVE).(13:3) := 0;    << CLEAR DRIVER FLAGS >>               02472000
     MASTERCLEARHPIB(DITP);                                    <<01301>>02474000
     GOTO IODONE;                                                       02476000
                                                                        02478000
$PAGE                                                                   02480000
<<  LINE PRINTER CONTINUATOR SECTION  >>                                02482000
                                                                        02484000
  LPCONT:                                                               02486000
     IF CPVAP.ERRORCODE = 6 THEN   << DMA ABORT >>                      02488000
       GOTO CHANERROR;                                                  02490000
                                                                        02492000
     IF CPVAP.ERRORCODE = 7 THEN   << CHANNEL ABORT >>                  02494000
       BEGIN                                                            02496000
         IF CPVAP.TIMEDOUT = 0 THEN   << BAD CHANNEL >>                 02498000
           GOTO CHANERROR;                                              02500000
                                                                        02502000
         TOS := IOQP(QMISC).TOUTCNTR+1;   << TIMED-OUT COUNTER >>       02504000
         IF S0 > 3 THEN      << CHANNEL FAILURE >>                      02506000
           GOTO CHANERROR                                               02508000
         ELSE                                                           02510000
           IOQP(QMISC).TOUTCNTR := TOS;   << UPDATE COUNTER >>          02512000
         GOTO STARTPRINT;                                               02514000
       END;                                                             02516000
                                                                        02518000
     IF IOQPL.SFAIL THEN     << FAILURE ON DELAYED START I/O >>         02520000
       BEGIN                                                            02522000
         TOS := SIOFAIL;                                                02524000
         GOTO BADIO;                                                    02526000
       END;                                                             02528000
                                                                        02530000
     DITP(DTIME).(0:1) := 0;                                   <<01301>>02532000
     IF <> THEN   << TIMER POPPED >>                                    02534000
       BEGIN                                                            02536000
                                                                        02538000
   LPNOTREADY:                                                          02540000
         IF IOMESSAGE(1,NOTRDYMSG,%10000,DITP(DLDEV).DLDEVN,            02542000
                      ,,,,OPCONSOLE) THEN                               02544000
           BEGIN                                                        02546000
             START'HPIB(DITP,IDLESIOP,FALSE);                  <<01301>>02548000
             IF < THEN                                                  02550000
               BEGIN                                                    02552000
                 TOS := SIOFAIL;                                        02554000
                 GOTO BADIO;                                            02556000
               END;                                                     02558000
             IOQP(QMISC).WAITCODE := NOTRDYWAIT;  <<SET REQUEST STATE >>02560000
             LPDRVR := NOTREADY;                                        02562000
             RETURN;                                                    02564000
           END;                                                         02566000
                                                                        02568000
         TOS := SYSERROR;   << INDICATE FAILURE BECAUSE THERE >>        02570000
         GOTO BADIO;        << ARE NO MESSAGE LINK BUFFERS >>           02572000
       END;                                                             02574000
     IF SIOP(DSJ'RB1) > 1  OR                                           02576000
        SIOP(DSJ'RB2) > 1  THEN    << PARITY ERROR WAS DETECTED >>      02578000
        BEGIN                                                  <<01346>>02580000
        DITP(DSERR):= [8/1,8/DLOGERROR];                       <<01346>>02582000
        DITP(DLOGERROR):=  PARITYERROR;  <<LOG PARITY ERROR>>  <<01346>>02584000
        END;                                                   <<01346>>02586000
$PAGE                                                                   02588000
                                                                        02590000
      << CHECK FOR READ STATUS REQUEST >>                               02592000
                                                                        02594000
     IF FCODE = %17 THEN                                       <<00761>>02596000
       GOTO PRINTDONE;                                         <<01201>>02598000
                                                               <<01201>>02600000
                                                                        02602000
        << CHECK FOR MASTER CLEAR COMPLETION >>                         02604000
                                                                        02606000
     IOQP(QMISC).MASTERCLR := 0;                               <<00761>>02608000
     IF <> THEN   << MASTER CLEAR WAS PERFORMED >>             <<00761>>02610000
       BEGIN                                                   <<00761>>02612000
         IF IOMESSAGE(1,POWERUPMSG,%10000,DITP(DLDEV).DLDEVN,  <<00761>>02614000
                      ,,,,OPCONSOLE) THEN                      <<00761>>02616000
           BEGIN                                               <<00761>>02618000
             DITP(DSAVE).VFCMOD := 0; << NO LONGER CUSTOM>>    <<00761>>02620000
             TOS := POWERUP;                                   <<00761>>02622000
             GOTO IODONE;                                      <<00761>>02624000
           END;                                                <<00761>>02626000
         TOS := SYSERROR;  << INDICATE FAILURE AS THERE >>     <<00761>>02628000
         GOTO BADIO;       << ARE NO MESSAGE LINK BUFFS >>     <<00761>>02630000
       END;                                                    <<00761>>02632000
                                                                        02634000
                                                                        02636000
                                                                        02638000
           << CHECK I/O STATUS IF REQUIRED >>                           02640000
                                                                        02642000
     IF CPVAP(1).(14:2) = 2 THEN   << STATUS DIAGNOSIS IS REQUIRED >>   02644000
       BEGIN                                                            02646000
         IF SIOP(STATUS).RDYBITS <> 2 THEN  << UNIT NOTREADY >>         02648000
           BEGIN                                               <<01513>>02650000
           IF SIOP(STATUS).PON = 1 THEN  << PON OCCURRED >>    <<01513>>02652000
             IOQP(QMISC).MASTERCLR := 1;  << SET MC FLG >>     <<01513>>02654000
           GOTO LPNOTREADY;                                    <<01513>>02656000
           END;                                                <<01513>>02658000
                                                                        02660000
                                                                        02662000
         IF SIOP(STATUS).PON = 1 THEN  << UNIT HAS JUST POWERED UP >>   02664000
  PONINIT:                                                     <<01513>>02666000
           BEGIN                                                        02668000
             SIOP(WRTCTL1).CMD := 5;   << ISSUE MASTER CLEAR >><<00761>>02670000
             SIOP(PRE'CTL)     := 0;                           <<00761>>02672000
             SIOP(WRTCTL2).CMD := 7;   << ISSUE TABSET >>      <<00761>>02674000
             SIOP(POST'CTL)    := DITP(DSAVE).TABDFAULT;       <<00761>>02676000
             SIOP(PREJMP)      := 0;     << SET UP SWITCHES >> <<00761>>02678000
             SIOP(BUFFJMP)     := 7;                           <<00761>>02680000
             SIOP(POSTJMP)      := 0;                          <<00761>>02682000
             IOQP(QMISC).MASTERCLR := 1;  << SET MC FLAG >>    <<00761>>02684000
             GOTO STARTPRINT;                                  <<00761>>02686000
           END;                                                         02688000
                                                                        02690000
         IF SIOP(STATUS).VFCRSET = 1 AND FCODE <> %100         <<01513>>02692000
           AND DITP(DSAVE).VFCMOD = 1 THEN   << VFC RESET >>   <<01513>>02694000
           BEGIN   << NOTIFY USER >>                           <<01513>>02696000
             IF IOMESSAGE(1,VFCRESETMSG,%10000,                <<01513>>02698000
             DITP(DLDEV).DLDEVN,,,,,OPCONSOLE) THEN            <<01513>>02700000
               BEGIN   << VFC NO LONGER CUSTOM >>              <<01513>>02702000
                 DITP(DSAVE).VFCMOD := 0;                      <<01513>>02704000
                 TOS := VFCRESET;                              <<01513>>02706000
                 GOTO IODONE;                                  <<01513>>02708000
               END;                                            <<01513>>02710000
             TOS := SYSERROR;   << FAILURE OCCURRED >>         <<01513>>02712000
             GOTO BADIO;        << NO MESSAGE LINK BUFFERS >>  <<01513>>02714000
           END;                                                <<01513>>02716000
                                                                        02718000
         IF SIOP(DSJ'RB1).(11:5)=1 THEN GOTO STARTPRINT;                02720000
       END;                                                             02722000
                                                                        02724000
     DITP(DSAVE).TOP := IOQP(QMISC).PEJECT;  << SET TOP IF PE WAS DONE>>02726000
                                                                        02728000
     IF FCODE=%100 OR FCODE=%101 THEN  << OUTPT DOWNLOAD MSG >><<01513>>02730000
       BEGIN                                                   <<00761>>02732000
         IF NOT IOMESSAGE(1,DOWNLOADMSG,%10000,                <<00761>>02734000
           DITP(DLDEV).DLDEVN,,,,,OPCONSOLE) THEN              <<00761>>02736000
           BEGIN                                               <<00761>>02738000
             TOS := SYSERROR;                                  <<00761>>02740000
             GOTO BADIO;                                       <<00761>>02742000
           END;                                                <<00761>>02744000
       END;                                                    <<00761>>02746000
                                                                        02748000
                                                                        02750000
                                                               <<01226>>02752000
     GOTO PRINTDONE;     << GOT HERE - REQUEST COMPLETED >>    <<01226>>02754000
                                                               <<01226>>02756000
   END;                                                                 02758000
$PAGE                                                                   02760000
   ASSEMBLE(                                                            02762000
     PCAL SIODM;     << MONITOR >>                                      02764000
     PCAL LPDRVR;    << INITIATOR >>                                    02766000
     PCAL LPDRVR;    << COMPLETOR >>                                    02768000
     CON  0;         << NO IO PROCESS >>                                02770000
     PCAL LPINIT;    << INITIALIZATION >>                               02772000
     CON  1;         << ONE INTERRUPT HANDLER >>                        02774000
     PCAL GIP'HPIB); << INTERRUPT HANDLER >>                   <<01301>>02776000
   END.                                                                 02778000
