$CONTROL MAP,CODE,USLINIT                                               00010000
  <<    HIOLPRT2 [MODULE 21] -- HP2619A 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
$TITLE "HP2619A LINE PRINTER DRIVER - HPIB"                             00030000
$CONTROL PRIVILEGED,UNCALLABLE                                          00032000
$TP                                                                     00034000
     <<*********************************************************>>      00036000
     <<                                                         >>      00038000
     <<  HIOLPRT2 [MODULE 21] -- HP2619A LP DRIVER [HPIB]       >>      00040000
     <<                                                         >>      00042000
     <<  COPYRIGHT (C) 1980, HEWLETT PACKARD CO.  THIS PROGRAM  >>      00044000
     <<  MAY BE USED WITH ONE COMPUTER SYSTEM AT AT TIME AND    >>      00046000
     <<  SHALL NOT OTHERWISE BE RECORDED, TRANSMITTED OR STORED >>      00048000
     <<  IN A RETRIEVAL SYSTEM.  COPYING OR OTHER REPRODUCTION  >>      00050000
     <<  OF THIS PROGRAM EXCEPT FOR ARCHIVAL PURPOSES IS PRO-   >>      00052000
     <<  HIBITED WITHOUT THE PRIOR WRITTEN CONSENT OF HEWLETT-  >>      00054000
     <<  PACKARD COMPANY.                                       >>      00056000
     <<                                                         >>      00058000
     <<*********************************************************>>      00060000
                                                                        00062000
COMMENT                                                        <<04744>>00064000
                                                                        00066000
                                                                        00068000
        HP2619A Line Printer Driver 3000 Series - HIOLPRT2              00070000
        ----------------------------------------------------            00072000
                                                                        00074000
                                                                        00076000
Structure of HIOLPRT2:                                                  00078000
                                                                        00080000
HIOLPRT2, together with the SIO Device Monitor (SIODM) constitute a     00082000
standard MPE Type 1 I/O Driver/Monitor.  This means that it does not    00084000
run in its own process, but executes on any stack and therefore must    00086000
run to completion.  During initialization it executes on PROGEN's       00088000
stack, during request initiation it executes on ATTACHIO's stack, and   00090000
during interrupt processing it executes on the Interrupt Control        00092000
Stack (ICS).                                                            00094000
                                                                        00096000
HIOLPRT2 consists of a global area, two procedures, and an "outer       00098000
block" which is really a linkage area for INITIAL.  The global area     00100000
contains an array called INITIAL which is comprised of three parts.     00102000
The first part specifies the size of the other two, the unit extract    00104000
instruction, and various parameters which are used by INITIAL.  This    00106000
section is deleted after INITIAL is through with it.  The other two     00108000
parts are the Device Information Table (DIT) and the Channel Program    00110000
area, which is part of the Interrupt Linkage Table (ILT).  INITIAL      00112000
will put each of these items in the area of memory where it belongs.    00114000
The linkage area specifies the procedure labels (P-labels) of the       00116000
associated monitor (SIODM), the request initiator (LPDRVR), the         00118000
request completor (LPDRVR), the initialization procedure (LPINIT,       00120000
called by PROGEN at system startup), and the interrupt handler (GIP).   00122000
                                                                        00124000
                                                                        00126000
Operation of HIOLPRT2:                                                  00128000
                                                                        00130000
The primary working code of HIOLPRT2 is a procedure LPDRVR.  LPDRVR     00132000
is called with six parameters.   Two of these parameters, BANK and      00134000
BUFFADDR, are the absolute buffer address of the data to be processed.  00136000
The other three, DITP, IOQP, and SIOP are pointers to three arrays.     00138000
DITP is a pointer to the Device Information Table which contains        00140000
information about its associated line printer.  There is one DIT for    00142000
each unit on the controller and they contain information which must     00144000
be saved between I/O requests to the driver.  IOQP is a pointer to the  00146000
Input/Output Table which contains information relevent to the current   00148000
request.  SIOP is a pointer to the first element of the channel pro-    00150000
gram which is actually part of the Interrupt Linkage Table.  The last   00152000
parameter DRTN is the Device Reference Table (DRT) number of the        00154000
device.  These three elements are described in more detail elsewhere    00156000
in this listing.                                                        00158000
                                                                        00160000
LPDRVR is always called by the SIO device monitor (SIODM) and it        00162000
determines the reason for the call by examining the IOQ and the DIT.    00164000
When a new request is initiated, LPDRVR examines the function code      00166000
and parameter fields contained in the IOQ element to determine the      00168000
task that is desired.  The proper command codes and program branches    00170000
are then placed in the Channel Program and its execution is begun.      00172000
                                                                        00174000
Upon completion of the request, an interrupt is generated and LPDRVR    00176000
is again called.  The code checks for current activity in progress,     00178000
and this being the case, branches to the completion section of the      00180000
driver.  Here several status words are examined for errors or special   00182000
conditions which might have occurred during the execution of the        00184000
Channel Program, during the data transfer, or during the operation of   00186000
the line printer.  These conditions can cause error retries and/or      00188000
special notation back to the caller.  A list of the conditions and      00190000
the return codes is provided in this listing.                           00192000
                                                               <<04744>>00194000
Fix History                                                    <<04744>>00196000
-----------                                                    <<04744>>00198000
                                                               <<04744>>00200000
8-4-82 Sotoji Watanabe (submitted by Dave Cassafer) -          <<04744>>00202000
       Selection of VFC channel 9-12 will be changed to        <<04744>>00204000
       single space if subtype = 3 (Katakana printer).         <<04744>>00206000
                                                               <<04744>>00208000
       Dave Cassafer - change timeout from 2 to 5 sec.         <<04744>>00210000
       because kanji printers need the extra time for          <<04744>>00212000
       data transfer.                                          <<04744>>00214000
$PAGE                                                                   00216000
                Device Information Table (DIT)                          00218000
                ------------------------------                          00220000
                                                                        00222000
                                                                        00224000
There is one DIT per physical device.  If a physical device represents  00226000
more than one logical device, the logical device number is obtained     00228000
from the IOQ element (however, there is only one device per HP2619A     00230000
controller.)  The following diagram shows the DIT used for the HP2619A  00232000
line printer driver.                                                    00234000
                                                                        00236000
     0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   MNEMONIC          00238000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    00240000
  0| 0| 0|AC|RQ| 0| 0| 0|IO|IA|NO|ST| 0|   STATE   |   DFLAG            00242000
   +--+--+--+--+--+--+--+--+--+--+--+--+-----------+                    00244000
  1| SYSDB relative pointer to the DIT for the next|   DLINK            00246000
   | device requesting this resource or service    |                    00248000
   +-----------------------------------------------+                    00250000
  2| SYSDB relative pointer to the first IOQ in    |   DIOQP            00252000
   | request list for this device                  |                    00254000
   +-----+-----------------+-----------------------+                    00256000
  3|IOT  |    Phys. unit # | Logical device number |   DLDEV            00258000
   +-----+-----------------+-----------------------+                    00260000
  4| SYSDB relative pointer to Device Linkage Table|   DDLTP            00262000
   +-----------------------------------------------+                    00264000
  5| SYSDB relative pointer to Intrp Linkage Table |   DILTP            00266000
   +-----------------------------------------------+                    00268000
  6|                                |BJ|AB|PS|FL|TP|   DSAVE            00270000
   +-----------------------------------------------+                    00272000
  7| Hardware error status.  Set when the driver   |   DSERR            00274000
   | detects an error.  Whenever <>0, the driver   |                    00276000
   | monitor logs an I/O error and clears this word|                    00278000
   +-----------------------------------------------+                    00280000
%10| Bit 0 is set at completion of timer           |   DTIME            00282000
   +-----------------------------------------------+                    00284000
%11| Holds the time out request entry index while  |   DRQST            00286000
   | a timer is active.                            |                    00288000
   +-----------------------------------------------+                    00290000
%12|          Hardware logged error status         | DLOGERROR          00292000
   +-----------------------------------------------+                    00294000
                                                                        00296000
                                                                        00298000
DFLAG - Flags and request state                                         00300000
  AC  ACTIVE  - A monitor is currently servicing this device.           00302000
  RQ  REQUEST - A service request is pending while the monitor is       00304000
                active.                                                 00306000
  IO  IOPROG  - An I/O Channel Program is running for this device.      00308000
  IA  IAK     - An interrupt or response has occurred for this device.  00310000
  NO  NOTRDY  - Go to state %10 after Idle Channel Program is started.  00312000
  ST  STWAIT  - The device monitor is starting an Idle Channel Program  00314000
                for this device.  There is no IOQ associated with this  00316000
                type of request.                                        00318000
  STATE       - State of the device monitor.  Specifies the next action 00320000
                to be taken in SIODM in servicing the request:          00322000
                                                                        00324000
                  0 - start new request                                 00326000
                  1 - not used                                          00328000
                  2 - call driver initiator procedure                   00330000
                  3 - call driver completor procedure                   00332000
                  4 - not used                                          00334000
                  5 - process request completed                         00336000
                  6 - initiate device recognition sequence              00338000
                  7 - start operator intervention wait                  00340000
                %10 - wait for interrupt (operator intervention)        00342000
                      restart at state 0                                00344000
                %11 - wait for data segment freeze, then state 2        00346000
                %12 - wait for driver initiator to be frozen, then      00348000
                      allocate controller (state 2)                     00350000
                %13 - wait for I/O completion interrupt, then state 3   00352000
                %14 - wait for controller, then call driver initiator   00354000
                %15 - not used                                          00356000
                %16 - wait for initiator make present, then state 2     00358000
                %17 - wait for completor make present, then state 3     00360000
                                                                        00362000
DLDEV - I/O system type, unit and logical device number                 00364000
    0 - HP3000 Series 2/3                                               00366000
    1 - HP3000 Series 33 (HPIB)                                         00368000
    2 - Unused                                                          00370000
    3 - Unused                                                          00372000
                                                                        00374000
DSAVE - Device processing flags                                         00376000
  BJ   BETJOB    - Between jobs flg, if set suppress Powerfail msg.     00378000
  AB   ABORT     - Abort (caused by Pfail or Operator) has occurred.    00380000
  PS   PRESPACE  - Last request used prespacing.                        00382000
  FL   FULL      - Line printer buffer is full.                         00384000
  TP   TOP       - Printer is at top of form.                           00386000
                                                                        00388000
DSERR - Pointer to status to be logged.                                 00390000
        Bits(0:7)  - Number of words to be logged.                      00392000
        Bits(8:15) - Offset relative to DITP(0).                        00394000
                                                                        00396000
                                                                        00398000
HP2619A Line Printer Status                                             00400000
---------------------------                                             00402000
                                                                        00404000
  BITS         USE                                                      00406000
                                                                        00408000
    0     ON LINE          [MSB]                                        00410000
    1     I/O BUFFER READY                                              00412000
    2     (RESERVED)                                                    00414000
    3     PROTOCOL ERROR                                                00416000
    4     PARITY ERROR IN A COMMAND ON THE HPIB                         00418000
    5     (RESERVED)                                                    00420000
    6     PAPER OUT/PAPER JAM/GATE OPEN/PLATEN OPEN/ETC.                00422000
    7     POWER FAIL       [LSB]                                        00424000
                                                                        00426000
$PAGE                                                                   00428000
                Interrupt Linkage Table (ILT)                           00430000
                -----------------------------                           00432000
                                                                        00434000
                                                                        00436000
There is one ILT for each device controller configured on the system.   00438000
A controller may support more than one unit, however the HP2619A con-   00440000
troller currently only supports one unit.                               00442000
                                                                        00444000
     0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   MNEMONIC          00446000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    00448000
  0|         Channel                               |   ICPVA0           00450000
  1|              Program                          |   ICPVA1           00452000
  2|                  Variable                     |   ICPVA2           00454000
  3|                       Area (ICPVA)            |   ICPVA3           00456000
   +-----------------------------------------------+                    00458000
  4|         DMA Abort                             |   ICPVA4           00460000
  5|              Address                          |   ICPVA5           00462000
   +-----------------------------------------------+                    00464000
  6|                      0                        |   ISRQL            00466000
   +--+-----------------+-----+-----------+--------+                    00468000
  7|LI|     CHANQUE     |     |   CHAN    |  DEV   |   ICNTRL           00470000
   +--+-----------------+-----+-----------+--------+                    00472000
%10| SYSDB relative pointer to Channel Program area|   ISIOP            00474000
   +-----------------------------------------------+                    00476000
%11| SYSDB relative pointer to Status Return area. |   ISTAP            00478000
   | (The HP2619A driver does not use the Status   |                    00480000
   |  Return area so this entry is 0.)             |                    00482000
   +-----------------------------------------------+                    00484000
%12| single instruction that is executed to extract|   IUNIT            00486000
   | the device unit number from the status pointed|                    00488000
   | to by ISTAP.  (Since there is only one unit   |                    00490000
   | on the controller, this entry is not used.)   |                    00492000
   +-----------------------------------------------+                    00494000
%13| SYSDB relative DIT pointer of the device      |   ICDP             00496000
   | currently using the channel to perform a      |                    00498000
   | data operation.                               |                    00500000
   +-----------------------+-----------------------+                    00502000
%14|       SIOPSIZE        |        CQUEN          |   IQUEUE           00504000
   +--+--+--+--------------+-----------+-----------+                    00506000
%15|RW|WP|IG|                          |  HCUNIT   |   IFLAG            00508000
   +--+--+--+--------------------------+-----------+                    00510000
%16| SYSDB relative DIT pointer for unit 0         |   IDITP0           00512000
   +-----------------------------------------------+                    00514000
%17|             Line Printer                      |                    00516000
   .               Channel                         .                    00518000
   |                 Program                       |                    00520000
   +-----------------------------------------------+                    00522000
                                                                        00524000
                                                                        00526000
ICPVA0 - Channel Program Variable Area                                  00528000
                                                                        00530000
  The first word is used by the channel program processor to store      00532000
  status information after I/O channel aborts.  The next word is used   00534000
  by the driver to indicate if status should be examined for special    00536000
  conditions or errors.  The other two words are not used.              00538000
                                                                        00540000
                                                                        00542000
ICPVA4 - DMA abort address                                              00544000
                                                                        00546000
  If a DMA abort occurs, the absolute address where the abort occurred  00548000
  is stored in this area.                                               00550000
                                                                        00552000
                                                                        00554000
ICNTRL - Contains controller information                                00556000
                                                                        00558000
  LIM     - If this bit is set, the controller is sharing a software    00560000
            channel resource in order to limit bandwidth.               00562000
  CHANQUE - The software channel resource number.                       00564000
  CHAN    - Channel number (four most significant bits of DRTN).        00566000
  DEV     - Device number (three least significant bits of DRTN).       00568000
                                                                        00570000
                                                                        00572000
IQUEUE -                                                                00574000
                                                                        00576000
  SIOPSIZE - (number of words + 1)/2 in the channel program area.       00578000
  CQUEN    - For a multi-unit controller this field contains the        00580000
             software controller resource number.                       00582000
                                                                        00584000
                                                                        00586000
IFLAG - Controller and Channel Program state flags                      00588000
                                                                        00590000
  RUNWAIT  - An Idle Channel Program should be started when there       00592000
             are no active requests to process.  This flag is always    00594000
             0 for the HP2619A.                                         00596000
  WAITPROG - An Idle Channel Program has been started for this          00598000
             controller.  This bit is reset by an interrupt.            00600000
  IGNOREHI - An HIOP instruction has been issued against this con-      00602000
             troller but the channel program was not in a wait          00604000
             statement.  Therefore ignore the interrupt generated by    00606000
             the channel code when this program halts.                  00608000
  HCUNIT   - Highest configured unit number for this controller.        00610000
                                                                        00612000
                                                                        00614000
                                                                        00616000
            Device Reference Table DRT                                  00618000
            --------------------------                                  00620000
                                                                        00622000
There is one DRT per device controller.  The the contents of this       00624000
table are used for processing interrupts.                               00626000
                                                                        00628000
     Word 0  SIOP   - Absolute address of the current I/O               00630000
                      instruction in execution.                         00632000
     Word 1  DBI    - Absolute address of the base of the ILT           00634000
                      for this controller.                              00636000
     Word 2  PLABLE - The external program label of the interrupt       00638000
                      service routine for this controller.              00640000
     Word 3  CHAN   - Contains channel program status information       00642000
                      which is used by the channel program interpreter. 00644000
$PAGE                                                                   00646000
            I/O QUEUE ELEMENT (IOQ)                                     00648000
            -----------------------                                     00650000
                                                                        00652000
                                                                        00654000
     0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   MNEMONIC          00656000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    00658000
  0|      Request dependent flags (see below)      |   QFLAG            00660000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    00662000
  1| SYSDB relative pointer to next IOQ element.   |   QLINK            00664000
   | Points to first word of element.              |                    00666000
   +-----------------------+-----------------------+                    00668000
  2|                       | Logical device number |   QLDEV            00670000
   +--+--+--+--+--+--------+-----------+-----------+                    00672000
  3|PP|PE|PO|TO|BF|                    | WAITCODE  |   QMISC            00674000
   +--+--+--+--+--+--------------------+-----------+                    00676000
  4| S| If QFLAG.(3:1) is clear then this is the   |   QDSTN            00678000
   |  | DST number of the target data segment.  If |                    00680000
   |  | S is set, QADDR is DB relative.            |                    00682000
   +--+--------------------------------------------+                    00684000
  5| Offset in the data segment or system buffer   |   QADDR            00686000
   | table to the target data buffer.              |                    00688000
   +-----------------------+-----------------------+                    00690000
  6|                       | Function code for     |   QFUNC            00692000
   |                       | this request.  (See   |                    00694000
   |                       | next section.)        |                    00696000
   +-----------------------+-----------------------+                    00698000
  7| On initiation, specifies the word count (>0)  |   QWBCT            00700000
   | or byte count (<0).  At completion of the     |                    00702000
   | request this location contains the actual     |                    00704000
   | transmission count in the same units (bytes   |                    00706000
   | or words) as in the request.                  |                    00708000
   +-----------------------------------------------+                    00710000
%10| Parameter 1.  Vertical Format specification.  |   QPAR1            00712000
   | (See next section for detail.)                |                    00714000
   +-----------------------------------------------+                    00716000
%11| Parameter 2.  Space Mode Flags.  (See next    |   QPAR2            00718000
   | section for details.)                         |                    00720000
   +-----------------------+--------------+--------+                    00722000
%12|         PCBN          |  QUALIFIER   | STATUS |   QSTAT            00724000
   +-----------------------+--------------+--------+                    00726000
                                                                        00728000
                                                                        00730000
QFLAG - Request dependent flags                                         00732000
                                                                        00734000
  Bit 0  ABORT     - Abort this request and return an error indication  00736000
                     to the caller.                                     00738000
  Bit 1  SPECIAL   - Apply special handling to this request.  (Not used)00740000
  Bit 2  DIAG      - This is a request from the diagnostic subsystem.   00742000
  Bit 3  SYSBUFF   - Target is an index relative to the SBUF Table of   00744000
                     the data buffer.                                   00746000
  Bit 4  IOWAKE    - Wake caller on completion of request.              00748000
  Bit 5  BLOCKED   - Blocked I/O.  The caller is waited in ATTACHIO     00750000
                     until the request is completed.  Implies IOWAKE.   00752000
  Bit 6  COMPLETED - The request has been completed and the caller      00754000
                     awakened if he had requested (with IOWAKE).        00756000
  Bit 7  DATAFRZN  - Set by the memory management routines (MAM) when a 00758000
                     MAKEPRESENT request is successfully completed and  00760000
                     indicates the data segment is frozen in memory.    00762000
  Bit 8  MAMERRORD - An error has occurred while MAM was trying to      00764000
                     make the target data segment present and freeze    00766000
                     it in memory.                                      00768000
  Bit 9  PREQ      - (Not used)                                         00770000
  Bit 10 SFAIL     - Delayed failure of SIO instruction.  If a call to  00772000
                     STARTIO resulted in the request being added to     00774000
                     the channel queue, this bit indicates that the SIO 00776000
                     instruction failed when the request was selected   00778000
                     for execution.                                     00780000
  Bit 11 PFAIL     - The request was aborted because of a system power  00782000
                     failure.                                           00784000
                                                                        00786000
                                                                        00788000
QMISC - Driver request dependent flags and counters.                    00790000
                                                                        00792000
  PRE'TO'POST - Pre to post spacing change flag.                        00794000
  PEJECT      - Last operation was a page eject.                        00796000
  POWER ON    - Power on in process.                                    00798000
  TOUT        - Channel timed out flag.                                 00800000
  BUF'FILL    - Buffer fill operation in process.                       00802000
  WAITCODE    - Indicates type of wait:                                 00804000
                                                                        00806000
                  0 - new request                                       00808000
                  1 - completion wait                                   00810000
                  2 - not ready wait                                    00812000
                  3 - initiation wait                                   00814000
                                                                        00816000
                                                                        00818000
QSTAT - PCB number and request completion status.                       00820000
                                                                        00822000
  PCBN    - The Process Control Block (PCB) number of the process       00824000
            which made this request.  If zero, the request is not       00826000
            associated with any process and the IOQ element is to       00828000
            be returned by the system when the request has completed.   00830000
  STATUS  - General status indicating the final state of the request.   00832000
            The following codes are used:                               00834000
                                                                        00836000
              0 - Not started or awaiting completion.                   00838000
              1 - Successful completion.                                00840000
              2 - End-of-file detected.                                 00842000
              3 - Unusual, but recoverable, condition detected.         00844000
              4 - Irrecoverable error has occurred.                     00846000
                                                                        00848000
  QUALIFIER - A code which further defines or qualifies the general     00850000
              status.  (See the section Driver Return Status Codes.)    00852000
                                                                        00854000
$PAGE                                                                   00856000
         2619 Line Printer Request Codes                                00858000
         -------------------------------                                00860000
                                                                        00862000
OPERATION  FUNCTION  PARAMETERS                                         00864000
---------  --------  ----------                                         00866000
                                                                        00868000
 WRITE          1    P1  [Vertical Format Specification]                00870000
                                                                        00872000
                       1 - use 1st Data Character as Format             00874000
                           Specification                                00876000
                                                                        00878000
                     %53 - "+", Print and Suppress Spacing              00880000
                     %55 - "-", Print and Triple Space                  00882000
                     %60 - "0", Print and Double Space                  00884000
                     %61 - "1", Print and Top of Form                   00886000
                                                                        00888000
                     %200-%277, Print and Space N-%200 Lines            00890000
                     %300-%312, Print with Channel N-%277               00892000
                                                                        00894000
                     %320 - Fill Line Printer Buffer Only               00896000
                                                                        00898000
                     All Others - Print and Single Space                00900000
                                                                        00902000
                                                                        00904000
                     P2  [Space Mode Flags]                             00906000
                                                                        00908000
                     (15:1)   - Prespace Flag                           00910000
                     If Set   - Print then Fill Buffer                  00912000
                     If Clear - Fill Buffer then Print                  00914000
                                                                        00916000
                     (14:1)    - No page stepover flag                  00918000
                     If Set    - Single and Double Space without        00920000
                                 Stepover (66 lines/page)               00922000
                     If Clear  - Single and Double Space with           00924000
                                 Stepover (60 lines/page)               00926000
                                                                        00928000
 FILE OPEN      2    Page Eject If Not at Top of Form                   00930000
                                                                        00932000
 FILE CLOSE     3    Page Eject If Not at Top of Form                   00934000
                                                                        00936000
 DEVICE CLOSE   4    Page Eject If Not at Top of Form                   00938000
                                                                        00940000
 READ STATUS  %17    Read I/O Status                                    00942000
                     Count - Buffer Size                                00944000
                                                                        00946000
                                                                        00948000
*IDENTIFY    %110    Return ID value in Bank & Buffaddr                 00950000
                                                                        00952000
*SELF TEST:                                                             00954000
  INITIATE   %111    Subtest number to execute in Bank & Buffaddr       00956000
                     (subtest# ranges from 0 to 7)                      00958000
  STATUS     %112    Subtest result returned in Bank & Buffaddr         00960000
                                                                        00962000
*LOOPBACK TEST:                                                         00964000
  WRT DATA   %113    Data to LP in Bank & Buffaddr [PING]               00966000
  READ DATA  %114    Data from LP read into Bank & Buffaddr [PONG]      00968000
                     Count - Buffer Size (256 bytes max)                00970000
                                                                        00972000
                                                                        00974000
                                                                        00976000
                                                                        00978000
                                                                        00980000
                                                                        00982000
*DIAGNOSTIC FUNCTION:  The Diagnostic Request Bit in the 1st word       00984000
                       (QFLAG) of the IOQ table must be set before      00986000
                       any diagnostic functions can be executed.        00988000
                                                                        00990000
                                                                        00992000
$PAGE                                                                   00994000
                  LOGGING CONSIDERATIONS                                00996000
                  ----------------------                                00998000
                                                                        01000000
 DMA Abort & Channel Program Abort - CPVA(0) is logged.                 01002000
 Parity Error - A value ot -1 is logged.                                01004000
 Protocol Error - Status is logged to denote a unit failure.            01006000
                                                                        01008000
 [In the case of a channel program abort due to a channel hard-         01010000
 ware timeout, status is checked to determine if this was caused        01012000
 by parity error. If so, the parity error value -1 is logged            01014000
 instead of CPVA(0)]                                                    01016000
                                                                        01018000
                                                                        01020000
                  PARALLEL POLL CONSIDERATIONS                          01022000
                  ----------------------------                          01024000
                                                                        01026000
    On Power On (PON) Condition, the controller (driver) will get an    01028000
 Affirmative Response to Parallel Poll (ARPP) the first time due to     01030000
 the PON condition.  Afterwards, the controller (driver) will not get   01032000
 an ARPP unless there is a buffer available to accept data, the prin-   01034000
 ter is online and no problems exist.                                   01036000
                                                                        01038000
  For PON with Offline Condition:                                       01040000
                                                                        01042000
     The first ARPP cause status to be read, afterward the idle chan-   01044000
  nel program is run until the second ARPP is received.                 01046000
                                                                        01048000
  For PON with Online Conditon:                                         01050000
                                                                        01052000
     The first ARPP cause status to be read, afterward the idle chan-   01054000
  nel program is ran through one pass to assure synchronization bet-    01056000
  ween the firmware and the driver.                                     01058000
                                                                        01060000
  For Power Off When IOQ is Issued:                                     01062000
                                                                        01064000
     The driver will time out and the idle channel program is run.      01066000
  When power finally gets turned on, the condition specified above      01068000
  will occur in respect to PON being online or offline.                 01070000
                                                                        01072000
  For Regular Offline Condition:                                        01074000
                                                                        01076000
     The driver will not get an ARPP unless there is a buffer avail-    01078000
  able to accept data, the printer is online, and no error conditions   01080000
  exist (ie. paper out, paper jam, platen open, etc).                   01082000
                                                                        01084000
                                                                        01086000
                  ABORT/POWERFAIL CONSIDERATIONS                        01088000
                  ------------------------------                        01090000
                                                                        01092000
    On an abort caused either by a powerfail or an operator abort, a    01094000
Device Clear must be sent to the line printer to clear out the last     01096000
request and reset the firmware to a known state. This is necessary,     01098000
since an abort has high priority and can interrupt the channel pro-     01100000
gram prior to it completing.                                            01102000
$PAGE                                                                   01104000
                                                                        01106000
                  EXTRA HANDSHAKE REQUIREMENT                           01108000
                  ---------------------------                           01110000
                                                                        01112000
    At any point in the driver when a "2" is returned from a DSJ        01114000
 denoting I/O status should be interrogated, an extra wait [WAIT,       01116000
 DSJ] for an ARPP (denoting that a buffer is available to receive       01118000
 the next secondary) is required. This assures that the firmware        01120000
 will not get out of synchronization with the driver. Omission of       01122000
 this extra handshake can result in the protocol error bit being        01124000
 set in the status word. Under the driver completion section, this      01126000
 extra handshake is done under the following conditions:                01128000
                                                                        01130000
    - PON condition (flagged with DSJ 2)                                01132000
    - Alarm condition which cleared up showing a clean status           01134000
      but retained the DSJ 2 condition (ie. user opens and              01136000
      closes the yoke between jobs)                                     01138000
    - Buffer ready bit not set in the status word possibly due          01140000
      to noise on the bus                                               01142000
                                                                        01144000
                                                                        01146000
$PAGE                                                                   01148000
                       DRIVER RETURN STATUS CODES                       01150000
                       --------------------------                       01152000
                                                                        01154000
                                                                        01156000
 General Status (13:3)       Qualifying Status (8:5)      Overall (8:8) 01158000
                                                                        01160000
 0 - Pending                1 - Waiting For Completion         %10      01162000
                            3 - Not Ready Wait                 %30      01164000
                                                                        01166000
 1 - Successful             0 - No Errors                       %1      01168000
                                                                        01170000
 2 - End of File            (Not Used)                                  01172000
                                                                        01174000
 3 - Unusual Condition      3 - Request Aborted                %33      01176000
                            6 - Powerfail Abort                %63      01178000
                          %21 - Device Powered Up             %213      01180000
                                                                        01182000
 4 - Irrecoverable Error    0 - Invalid Request                 %4      01184000
                            2 - I/O Timed Out Before Complete  %24      01186000
                            4 - SIO Failure                    %44      01188000
                            5 - Unit Failure                   %54      01190000
                          %12 - System Error                  %124      01192000
                          %14 - Channel Failure               %144      01194000
                          %21 - Parity Error                  %214      01196000
                                                                        01198000
                                                                        01200000
ENDCOMMENT;                                                    <<04744>>01202000
$PAGE                                                                   01204000
BEGIN                                                                   01206000
  EQUATE                                                                01208000
                                                                        01210000
       << DITP PARAMETERS >>                                            01212000
                                                                        01214000
    DILTP     =  5,  << INTERRUPT LINKAGE TABLE POINTER >>              01216000
    DLDEV     =  3,  << LOGICAL DEVICE AND UNIT NUMBERS >>              01218000
    DLOGERROR = 10,  << DIT HARDWARE LOGGED ERROR STATUS >>             01220000
    DRQST     =  9,  << DRIVER REQUEST FLAGS >>                         01222000
    DSAVE     =  6,  << DRIVER FLAGS >>                                 01224000
    DSERR     =  7,  << DIT HARDWARE COUNT & INDEX >>                   01226000
    DTIME     =  8,  << TIME-OUT REQUEST ENTRY INDEX >>                 01228000
                                                                        01230000
       << IOQP PARAMETERS >>                                            01232000
                                                                        01234000
    QFUNC     =  6,  << REQUEST FUNCTION CODE >>                        01236000
    QLINK     =  1,  << POINTER TO NEXT IOQ REQUEST >>                  01238000
    QMISC     =  3,  << FLAGS PERTAINING TO THIS REQUEST >>             01240000
    QPAR1     =  8,  << CARRIAGE CONTROL SPECIFICATION >>               01242000
    QPAR2     =  9,  << PRESPACE AND STEPOVER REQUEST FLAGS >>          01244000
    QSTAT     = 10,  << REQUEST STATUS AND PCB NUMBER >>                01246000
    QWBCT     =  7,  << WORD/BYTE COUNT >>                              01248000
                                                                        01250000
       << CHANNEL PROGRAM ADDRESSES RELATIVE TO SIOP >>                 01252000
                                                                        01254000
    BADDR      =  47,  << WRITE INSTRUCTION BUFFER ADDRESS >>           01256000
    BCOUNT     =  44,  << WRITE INSTRUCTION BYTE COUNT >>               01258000
    BUFFJMP    =  42,  << SWITCH FOR BUFFER FILL >>                     01260000
    DIAGJMP    = 116,  << DIAGNOSTIC COMPLETE JMP >>                    01262000
    DSBANK     = 113,  << DIAG/STATUS BANK ADDR  >>                     01264000
    DSCOUNT    = 111,  << DIAG/STATUS BYTE COUNT >>                     01266000
    DSTATADR   = 114,  << DIAG/STATUS BUFFER ADDR >>                    01268000
    DSB'ESC    = 127,  << DISABLE ESC SEQ BYTE >>                       01270000
    ENB'ESC    = 126,  << ENABLE ESC SEQ BYTE >>                        01272000
    ESC'ADR    = 121,  << ESC SEQ ADDRESS >>                            01274000
    ESC'ALPHA  = 124,  << ESC SEQ ALPHA TERMINATOR >>                   01276000
    ESC'PARM   = 123,  << ESC SEQ PARAMETER >>                          01278000
    INIT       = 117,  << START OF INITIALIZATION ROUTINE >>            01280000
    MEMX       =  46,  << WRITE INSTRUCTION BANK NUMBER >>              01282000
    POST'CNT   =  76,  << POSTSPACE COUNT >>                            01284000
    POST'DADR  =  91,  << POSTSPACE DISABLE ESC SEQ ADR >>              01286000
    POST'DCNT  =  89,  << POSTSPACE DISABLE ESC SEQ CNT >>              01288000
    POST'ESC   =  79,  << POSTSPACE ESC SEQ ADDRESS >>                  01290000
    POSTJMP    =  61,  << SWITCH FOR POST SPACING >>                    01292000
    PRE'CNT    =  16,  << PRESPACE COUNT >>                             01294000
    PRE'DADR   =  31,  << PRESPACE DISABLE ESC SEQ ADR >>               01296000
    PRE'DCNT   =  29,  << PRESPACE DISABLE ESC SEQ CNT >>               01298000
    PRE'ESC    =  19,  << PRESPACE ESC SEQ ADDRESS >>                   01300000
    PREJMP     =   1,  << SWITCH FOR PRESPACING >>                      01302000
    RWCTL      = 110,  << DIAG/STATUS READ/WRT CTRL >>                  01304000
    STATUS     = 125,  << I/O STATUS BUFFER >>                          01306000
                                                                        01308000
       << CHANNEL PROGRAM ENTRIES RELATIVE TO SIOP >>                   01310000
                                                                        01312000
    BRANCHPT      =   1,  << BRANCH POINT TO CP ENTRY POINTS >>         01314000
    DSTATSIOP     = 108,  << DIAG/STATUS ENTRY POINT >>                 01316000
    FILLSIOP      =  41,  << OFFLINE RESTART ENTRY POINT >>             01318000
    IDLESIOP      =  91,  << IDLE CP ENTRY POINT >>                     01320000
    IDSIOP        = 111,  << IDENTIFY ENTRY POINT >>                    01322000
    INITSIOP      = 115,  << INITIATION ENTRY POINT >>                  01324000
    PRE'DSBSIOP   =  26,  << PRESPACE DISABLE ESC SEQ ENTRY >>          01326000
    POST'DSBSIOP  =  86,  << POSTSPACE DISABLE ESC SEQ ENTRY >>         01328000
    POST'ENBSIOP  =  60,  << POSTSPACE ENABLE ESC SEQ ENTRY >>          01330000
    STATSIOP      = 101,  << STATUS INTERROGATION ENTRY POINT >>        01332000
                                                                        01334000
       << COMPLETION STATUSES >>                                        01336000
                                                                        01338000
    ABORTED   =  %33,  << REQUEST ABORTED >>                            01340000
    CHANFAIL  = %144,  << I/O CHANNEL ERROR >>                          01342000
    GOODIO    =    1,  << SUCCESSFUL I/O COMPLETION >>                  01344000
    INVALIDOP =    4,  << INVALID OPERATION REQUESTED >>                01346000
    PARITY    = %214,  << PARITY ERROR >>                               01348000
    PFABORT   =  %63,  << REQUEST ABORTED DUE TO POWER FAILURE >>       01350000
    POWERUP   = %213,  << UNIT RESET DUE TO POWER FAIL OR RESET >>      01352000
    SIOFAIL   =  %44,  << SIO FAILURE >>                                01354000
    SYSERROR  = %124,  << SYSTEM ERROR >>                               01356000
    TIMOUTERR =  %24,  << TIMED OUT ERROR >>                            01358000
    UNITERR   =  %54,  << UNIT FAILURE >>                               01360000
$PAGE                                                                   01362000
                                                                        01364000
       << DRIVER STATES >>                                              01366000
                                                                        01368000
    CMPLTIONWAIT  = 1,  << WAITING FOR I/O COMPLETION INTERRUPT >>      01370000
    NOTRDYWAIT    = 2,  << NOT READY WAIT IN PROGRESS >>                01372000
    INITIOWAIT    = 3,  << INIT UNIT VIA DEV CLEAR IN PROGRESS >>       01374000
                                                                        01376000
       << SIODM STATES >>                                               01378000
                                                                        01380000
    INTRPTWAIT  = %13,  << WAIT FOR I/O COMPLETION >>                   01382000
    NOTREADY    =   7,  << UNIT NOT READY >>                            01384000
    REQUESTDONE =   5,  << REQUEST DONE >>                              01386000
                                                                        01388000
       << IOMESSAGE PARAMETERS >>                                       01390000
                                                                        01392000
    NOTRDYMSG    = 11,  << NOT READY MESSAGE >>                         01394000
    OPCONSOLE    =  0,  << OUTPUT MESSAGE TO SYSTEM CONSOLE >>          01396000
    POWERUPMSG   = 13,  << POWER RESTORED/UNIT RESET MESSAGE >>         01398000
                                                                        01400000
       << MISCELLANEOUS EQUATES >>                                      01402000
                                                                        01404000
    DCLOSE      =     4,  << DEVICE CLOSE FUNCTION >>                   01406000
    FOPEN       =     2,  << FILE OPEN FUNCTION >>                      01408000
    FCLOSE      =     3,  << FILE CLOSE FUNCTION >>                     01410000
    FULL'       =    14,  << LINE PRINTER BUFFER FULL >>                01412000
    HP2617J     =     3,  << Device subtype for HP2613/17J>>   <<04744>>01414000
    IOTIMER     =   %20,  << IO TIMER PARAMETER >>                      01416000
    ISIOP       =     8,  << ILT CHANNEL PROGRAM AREA POINTER >>        01418000
    PARITYERR   =    -1,  << PARITY ERROR LOGGING VALUE >>              01420000
    PRESPACE'   =    13,  << LAST REQUEST USED PRESPACING >>            01422000
    SYSDB       = %1000,  << ADDRESS OF SYSDB AREA >>                   01424000
    SYSLPDT     =   %10,  << DB relative base of LPDT >>       <<04744>>01426000
  ENDEQ         =     0;                                                01428000
                                                               <<04744>>01430000
    << Useful declarations >>                                  <<04744>>01432000
DOUBLE ARRAY LPDTD(@) = DB + SYSLPDT;                          <<04744>>01434000
$PAGE                                                                   01436000
                                                                        01438000
       << I/O STATUS BIT DEFINITIONS >>                                 01440000
                                                                        01442000
     DEFINE                                                             01444000
       ONLINE     = ( 0:1)#, << ONLINE BIT >>                           01446000
       PROTOBIT   = ( 3:1)#, << PROTOCOL ERROR BIT >>                   01448000
       PARITYBIT  = ( 4:1)#, << PARITY ERROR BIT >>                     01450000
       PAPERBIT   = ( 6:1)#, << PAPER ERROR BIT >>                      01452000
       PON        = ( 7:1)#, << UNIT POWERED UP OR WAS RESET >>         01454000
                                                                        01456000
       << QMISC BIT DEFINITIONS >>                                      01458000
                                                                        01460000
       BUF'FILL   = ( 5:1)#, << BUFF FILL OPERATION IN PROCESS >>       01462000
       PRE'TO'POST= ( 0:1)#, << PRE TO POST SPACING CHANGE FLAG >>      01464000
       PEJECT     = ( 1:1)#, << LAST OPERATION WAS A PAGE EJECT >>      01466000
       PONBIT     = ( 2:1)#, << POWER ON IN PROGRESS >>                 01468000
       TOUT       = ( 3:1)#, << CHANNEL TIMED OUT ONCE FLAG >>          01470000
       WAITCODE   = (12:4)#, << INDICATES TYPE OF WAIT >>               01472000
                             <<   0 - NEW REQUEST      >>               01474000
                             <<   1 - COMPLETION WAIT  >>               01476000
                             <<   2 - NOT READY WAIT   >>               01478000
                             <<   3 - INITIATION WAIT  >>               01480000
                                                                        01482000
       << DSAVE BIT DEFINITIONS >>                                      01484000
                                                                        01486000
       BETJOB     = (11:1)#, << BETWEEN PRINTING A JOB >>               01488000
       ABORTBIT   = (12:1)#, << PFAIL/OPER ABORT OCCURRED >>            01490000
       PRESPACE   = (13:1)#, << LAST REQUEST USED PRESPACING >>         01492000
       FULL       = (14:1)#, << LINE PRINTER BUFFER IS FULL >>          01494000
       TOP        = (15:1)#, << PRINTER IS AT TOP-OF-FORM (TOF) >>      01496000
                                                                        01498000
       << MISCELLANEOUS BIT DEFINITIONS >>                              01500000
                                                                        01502000
       CMD        = (12:4)#, << SECONDARY COMMAND >>                    01504000
       DCODE      = ( 0:8)#, << COMMAND CODE >>                         01506000
       DIAG       = ( 2:1)#, << QFLAG, DIAGNOSTIC BIT >>                01508000
       DLDEVN     = ( 8:8)#, << LOGICAL DEVICE NUMBER OF DIT >>         01510000
       ERRORCODE  = ( 0:3)#, << CPVAP, ERROR CODE >>                    01512000
       FUNC       = ( 8:8)#, << QFUNC, FUNCTION CODE >>                 01514000
       IOSTAT     = ( 8:8)#, << QSTAT, REQUEST STATUS RETURNED >>       01516000
       LRBIT      = ( 1:1)#, << WRT INSTRUCTION LEFT/RIGHT BYTE BIT >>  01518000
       PFAIL      = (11:1)#, << QFLAG, ABORT SET DUE TO POWER FAIL >>   01520000
       SFAIL      = (10:1)#, << QFLAG, FAILURE ON DELAYED START SIO >>  01522000
       STEPOVER   = (14:1)#, << IF SET THEN NO PAGE STEPOVER >>         01524000
       TIMEDOUT   = (13:1)#, << CPVAP, TRANSFER ABORTED-TIMED OUT >>    01526000
       LOADMEMORY = ASSEMBLE(LSEA)#,                                    01528000
       STOREMEMORY= ASSEMBLE(SSEA)#,                                    01530000
     ENDDEF       = 0#;                                                 01532000
                                                                        01534000
                                                                        01536000
$PAGE                                                                   01538000
<<                                                                      01540000
        *********************************                               01542000
        *                               *                               01544000
        *   DRIVER DB AREA DEFINITION   *                               01546000
        *                               *                               01548000
        *********************************                               01550000
>>                                                                      01552000
                                                                        01554000
        ARRAY INITIAL(0:142) = DB :=                                    01556000
        [8/11,8/1],   << LP DIT SIZE, NOT CORE RESIDENT >>              01558000
                      << NO IDLE CHANNEL PROGRAM, DRIVER TYPE >>        01560000
                 0,   << NOT USED >>                                    01562000
                 0,   << UNIT EXTRACT INSTRUCTION - NOT USED >>         01564000
        [8/64,8/0],   << CHANNEL PROGRAM SIZE/2 >>                      01566000
                                                                        01568000
        << LP DIT >>                                                    01570000
                 0,   << DFLAG >>                                       01572000
                 0,   << DLINK >>                                       01574000
                 0,   << DIOQP >>                                       01576000
           %040000,   << DLDEV - HPIB DEVICE >>                         01578000
                 0,   << DDLTP >>                                       01580000
                 0,   << DILTP >>                                       01582000
                 0,   << DSAVE >>                                       01584000
                 0,   << DSERR >>                                       01586000
                 0,   << DTIME >>                                       01588000
                 0,   << DRQST >>                                       01590000
                 0,   << DLOGERROR >>                                   01592000
                                                                        01594000
                                                                        01596000
        << CHANNEL PROGRAM >>                                           01598000
                                                                        01600000
                                                                        01602000
<< 0>>  << JUMP >>              0,  << BRANCH POINT TO CP SECTION >>    01604000
<< 1>>                          0,  << JMP *+0 PRE, JMP *+26 POST >>    01606000
                                                                        01608000
                                                                        01610000
        << PRESPACE MODE SECTION >>                                     01612000
                                                                        01614000
                                                                        01616000
<< 2>>  << WRITE CTRL >>    %2002,  << ENABLE ALL ESCAPE SEQUENCES >>   01618000
<< 3>>                          1,                                      01620000
<< 4>>                          0,                                      01622000
<< 5>>                     %42000,                                      01624000
<< 6>>                          0,                                      01626000
                                                                        01628000
<< 7>>  << WAIT >>          %1000,  << MAKE SURE UNIT IS RESPONDING >>  01630000
<< 8>>                          0,                                      01632000
                                                                        01634000
<< 9>>  << DSJ >>           %2403,  << CHECK PRINTER'S CONDITION >>     01636000
<<10>>                          0,  << RETURN BYTE >>                   01638000
<<11>>                          0,  << PRINTER RDY TO ACCEPT DATA >>    01640000
<<12>>                         88,  << INVALID BYTE-READ STATUS >>      01642000
<<13>>                         88,  << READ STATUS REQUIRED >>          01644000
<<14>>                         88,  << INVALID BYTE-READ STATUS >>      01646000
                                                                        01648000
<<15>>  << WRITE DATA >>    %2000,  << WRITE OUT ESCAPE SEQUENCE >>     01650000
<<16>>                          0,                                      01652000
<<17>>                          0,                                      01654000
<<18>>                          0,                                      01656000
<<19>>                          0,                                      01658000
                                                                        01660000
<<20>>  << WAIT >>          %1000,  << MAKE SURE UNIT IS RESPONDING >>  01662000
<<21>>                          0,                                      01664000
                                                                        01666000
<<22>>  << DSJ >>           %2403,  << CHECK PRINTER'S CONDITION >>     01668000
<<23>>                          0,  << RETURN BYTE >>                   01670000
<<24>>                          0,  << PRINTER RDY TO ACCEPT DATA >>    01672000
<<25>>                         75,  << INVALID BYTE-READ STATUS >>      01674000
<<26>>                         75,  << READ STATUS REQUIRED >>          01676000
<<27>>                         75,  << INVALID BYTE-READ STATUS >>      01678000
                                                                        01680000
<<28>>  << WRITE CTRL >>    %2002,  << DISABLE ALL ESCAPE SEQUENCE >>   01682000
<<29>>                          1,                                      01684000
<<30>>                          0,                                      01686000
<<31>>                     %44000,                                      01688000
<<32>>                          0,                                      01690000
                                                                        01692000
<<33>>  << WAIT >>          %1000,  << WAIT FOR UNIT TO // POLL >>      01694000
<<34>>                          0,                                      01696000
                                                                        01698000
<<35>>  << DSJ >>           %2403,  << CHECK PRINTER'S CONDITION >>     01700000
<<36>>                          0,  << RETURN BYTE >>                   01702000
<<37>>                          0,  << PRINTER RDY TO ACCEPT DATA >>    01704000
<<38>>                         62,  << INVALID BYTE-READ STATUS >>      01706000
<<39>>                         62,  << READ STATUS REQUIRED >>          01708000
<<40>>                         62,  << INVALID BYTE-READ STATUS >>      01710000
                                                                        01712000
                                                                        01714000
        << WRITE OUT DATA SECTION >>                                    01716000
                                                                        01718000
                                                                        01720000
<<41>>  << JUMP >>              0,  << JMP *+0 TO FILL BUFFER >>        01722000
<<42>>                          0,  << JMP *+17 OTHERWISE >>            01724000
                                                                        01726000
<<43>>  << WRITE DATA >>    %2000,  << WRITE OUT DATA BUFFER >>         01728000
<<44>>                          0,                                      01730000
<<45>>                        128,                                      01732000
<<46>>                    %100000,                                      01734000
<<47>>                          0,                                      01736000
                                                                        01738000
<<48>>  << JUMP >>              0,                                      01740000
<<49>>                          2,  << JMP *+2, END OF TRANSFER >>      01742000
                                                                        01744000
<<50>>  << JUMP >>              0,                                      01746000
<<51>>                    %177755,  << JMP *-19, END OF BURST >>        01748000
                                                                        01750000
<<52>>  << WAIT >>          %1000,  << WAIT FOR UNIT TO // POLL >>      01752000
<<53>>                          0,                                      01754000
                                                                        01756000
<<54>>  << DSJ >>           %2403,  << CHECK PRINTER'S CONDITION >>     01758000
<<55>>                          0,  << RETURN BYTE >>                   01760000
<<56>>                          0,  << PRINTER RDY TO ACCEPT DATA >>    01762000
<<57>>                         43,  << INVALID BYTE-READ STATUS >>      01764000
<<58>>                         43,  << READ STATUS REQUIRED >>          01766000
<<59>>                         43,  << INVALID BYTE-READ STATUS >>      01768000
                                                                        01770000
                                                                        01772000
        << POSTSPACE MODE SECTION >>                                    01774000
                                                                        01776000
                                                                        01778000
<<60>>  << JUMP >>              0,  << JMP *+0 FOR POSTSPACE REQ >>     01780000
<<61>>                          0,  << JMP *+39 OTHERWISE >>            01782000
                                                                        01784000
<<62>>  << WRITE CTRL >>    %2002,  << ENABLE ALL ESCAPE SEQUENCES >>   01786000
<<63>>                          1,                                      01788000
<<64>>                          0,                                      01790000
<<65>>                     %42000,                                      01792000
<<66>>                          0,                                      01794000
                                                                        01796000
<<67>>  << WAIT >>          %1000,  << MAKE SURE UNIT IS RESPONDING >>  01798000
<<68>>                          0,                                      01800000
                                                                        01802000
<<69>>  << DSJ >>           %2403,  << CHECK PRINTER'S CONDITION >>     01804000
<<70>>                          0,  << RETURN BYTE >>                   01806000
<<71>>                          0,  << PRINTER RDY TO ACCEPT DATA >>    01808000
<<72>>                         28,  << INVALID BYTE-READ STATUS >>      01810000
<<73>>                         28,  << READ STATUS REQUIRED >>          01812000
<<74>>                         28,  << INVALID BYTE-READ STATUS >>      01814000
                                                                        01816000
<<75>>  << WRITE DATA >>    %2000,  << WRITE OUT ESCAPE SEQUENCE >>     01818000
<<76>>                          0,                                      01820000
<<77>>                          0,                                      01822000
<<78>>                          0,                                      01824000
<<79>>                          0,                                      01826000
                                                                        01828000
<<80>>  << WAIT >>          %1000,  << MAKE SURE UNIT IS RESPONDING >>  01830000
<<81>>                          0,                                      01832000
                                                                        01834000
<<82>>  << DSJ >>           %2403,  << CHECK PRINTER'S CONDITION >>     01836000
<<83>>                          0,  << RETURN BYTE >>                   01838000
<<84>>                          0,  << PRINTER RDY TO ACCEPT DATA >>    01840000
<<85>>                         15,  << INVALID BYTE-READ STATUS >>      01842000
<<86>>                         15,  << READ STATUS REQUIRED >>          01844000
<<87>>                         15,  << INVALID BYTE-READ STATUS >>      01846000
                                                                        01848000
<<88>>  << WRITE CTRL >>    %2002,  << DISABLE ALL ESCAPE SEQUENCE >>   01850000
<<89>>                          1,                                      01852000
<<90>>                          0,                                      01854000
<<91>>                     %44000,                                      01856000
<<92>>                          0,                                      01858000
                                                                        01860000
                                                                        01862000
        << IDLE CHANNEL PROGRAM SECTION >>                              01864000
                                                                        01866000
                                                                        01868000
<<93>>  << WAIT >>          %1000,  << WAIT FOR UNIT TO // POLL >>      01870000
<<94>>                          0,                                      01872000
                                                                        01874000
<<95>>  << DSJ >>           %2403,  << CHECK PRINTER'S STATE >>         01876000
<<96>>                          0,  << RETURN BYTE >>                   01878000
<<97>>                          0,  << PRINTER RDY TO ACCEPT DATA >>    01880000
<<98>>                          2,  << INVALID BYTE-READ STATUS >>      01882000
<<99>>                          2,  << READ STATUS REQUIRED >>          01884000
<<100>>                         2,  << INVALID BYTE-READ STATUS >>      01886000
                                                                        01888000
<<101>> << INT/HLT >>        %601,  << INTERRUPT/HALT >>                01890000
<<102>>                         1,  << CODE OF 1 IN CPVA(1) >>          01892000
                                                                        01894000
                                                                        01896000
        << I/O STATUS INTERROGATION SECTION >>                          01898000
                                                                        01900000
                                                                        01902000
<<103>> << READ STATUS >>   %1416,  << READ STATUS BYTES >>             01904000
<<104>>                         1,  << #BYTES >>                        01906000
<<105>>                         0,                                      01908000
<<106>>                     %2000,                                      01910000
<<107>>                         0,                                      01912000
                                                                        01914000
<<108>> << INT/HALT >>       %601,  << INTERRUPT/HALT >>                01916000
<<109>>                         2,  << CODE OF 2 IN CPVA(1) >>          01918000
                                                                        01920000
                                                                        01922000
         << DIAGNOSTICS AND READ STATUS SECTION >>                      01924000
                                                                        01926000
                                                                        01928000
<<110>> << RD/WRT CTRL >>   %2002,  << SEND DIAG/STATUS CMD BYTE >>     01930000
<<111>>                         0,                                      01932000
<<112>>                         0,                                      01934000
<<113>> << IDENTIFY >>          0,                                      01936000
<<114>>                         0,                                      01938000
                                                                        01940000
<<115>> << JUMP >>              0,                                      01942000
<<116>>                         0,  << JUMP * - 16/24 >>                01944000
                                                                        01946000
                                                                        01948000
        << INITIALIZATION SECTION >>                                    01950000
                                                                        01952000
                                                                        01954000
<<117>> << CLEAR >>         %4401,  << CLEAR DEV W/PARITY CHECK >>      01956000
<<118>>                         0,                                      01958000
                                                                        01960000
<<119>> << INT/HLT >>        %601,  << INTERRUPT/HALT >>                01962000
<<120>>                         0,  << CODE OF 0 IN CPVA(1) >>          01964000
                                                                        01966000
                                                                        01968000
        << CONTROL CODES, ESCAPE SEQUENCES, & MISC. STORAGES >>         01970000
                                                                        01972000
                                                                        01974000
<<121>> << ESC'ADR >>     %015446,  << ESC & >>                         01976000
<<122>>                   %066040,  << l [space] >>                     01978000
<<123>> << ESC'PARM >>    %020040,  << #SLEW, VFC CHAN# >>              01980000
<<124>> << ESC'ALPHA >>   %020040,  << "U", "V" >>                      01982000
<<125>> << STATUS >>            0,  << STATUS BUFFER >>                 01984000
<<126>> << ENB'ESC >>        %200,  << ENABLE ESC SEQ BYTE >>           01986000
<<127>> << DSB'ESC >>        %202;  << DISABLE ESC SEQ BYTE >>          01988000
$PAGE                                                                   01990000
<<                                                                      01992000
         ***************************************                        01994000
         *                                     *                        01996000
         *   EXTERNAL PROCEDURE DECLARATIONS   *                        01998000
         *                                     *                        02000000
         ***************************************                        02002000
>>                                                                      02004000
                                                                        02006000
   PROCEDURE ABORTTIMEREQ(TRLX);                                        02008000
     VALUE TRLX;   INTEGER TRLX;                                        02010000
     OPTION EXTERNAL;                                                   02012000
                                                                        02014000
   PROCEDURE GIP'HPIB;                                                  02016000
     OPTION EXTERNAL;                                                   02018000
                                                                        02020000
   PROCEDURE HELP;                                                      02022000
     OPTION EXTERNAL;                                                   02024000
                                                                        02026000
   LOGICAL PROCEDURE IOMESSAGE(SETNO,MSGNO,MASK,P1,P2,P3,P4,P5,         02028000
                               DEST,REPLY,OFFSET,DITP,IOTYPE);          02030000
     VALUE SETNO,MSGNO,MASK,P1,P2,P3,P4,P5,DEST,REPLY,OFFSET,           02032000
           DITP,IOTYPE;                                                 02034000
     INTEGER SETNO,MSGNO,MASK,P1,P2,P3,P4,P5,DEST,REPLY,OFFSET;         02036000
     INTEGER IOTYPE;                                                    02038000
     INTEGER POINTER DITP;                                              02040000
     OPTION VARIABLE, EXTERNAL;                                         02042000
                                                                        02044000
   PROCEDURE SIODM(DITP,FLAGS);                                         02046000
     VALUE DITP,FLAGS;   LOGICAL FLAGS;                                 02048000
     POINTER DITP;   OPTION EXTERNAL;                                   02050000
                                                                        02052000
   PROCEDURE MASTERCLEARHPIB(DITP);                                     02054000
     ARRAY DITP;   OPTION EXTERNAL;                                     02056000
                                                                        02058000
   PROCEDURE START'HPIB(DITP,SIOP,QFLAG);                               02060000
     VALUE DITP,SIOP,QFLAG;   LOGICAL QFLAG;                            02062000
     POINTER DITP,SIOP;   OPTION EXTERNAL;                              02064000
                                                                        02066000
   INTEGER PROCEDURE TIMEREQ(CODE,REQ,TIME);                            02068000
     VALUE CODE,REQ,TIME;                                               02070000
     INTEGER CODE,REQ;   DOUBLE TIME;                                   02072000
     OPTION EXTERNAL;                                                   02074000
$PAGE                                                                   02076000
   DOUBLE PROCEDURE INT2ASC(NUMBER,COUNT);                              02078000
                                                                        02080000
<<---------------------------------------------------->>                02082000
<<                                                    >>                02084000
<<   THIS PROCEDURE CONVERTS AN INTEGER NUMBER TO     >>                02086000
<<   ITS ASCII EQUIVALENT.                            >>                02088000
<<                                                    >>                02090000
<<     NUMBER = DECIMAL NUMBER                        >>                02092000
<<     COUNT  = NUMBER OF ASCII CHAR TO RETURN        >>                02094000
<<                                                    >>                02096000
<<   FUNCTION RET: 2 ASCII WORDS FOR INTEGER VALUE    >>                02098000
<<                                                    >>                02100000
<<---------------------------------------------------->>                02102000
                                                                        02104000
     VALUE NUMBER,COUNT;                                                02106000
     INTEGER NUMBER,COUNT;                                              02108000
                                                                        02110000
     BEGIN                                                              02112000
                                                                        02114000
     DOUBLE ASCBUF = Q + 1;                                             02116000
                                                                        02118000
     BYTE ARRAY                                                         02120000
       BSCBUF(*) = ASCBUF;                                              02122000
                                                                        02124000
     INTEGER XREG = X;                                                  02126000
                                                                        02128000
     TOS := %20040;  << INIT RET BUFFER AREA >>                         02130000
     TOS := %20040;                                                     02132000
                                                                        02134000
     TOS := NUMBER;  << GET INTEGER NUMBER >>                           02136000
     XREG := COUNT;  << NUMBER OF ASCII CHAR >>                         02138000
                                                                        02140000
     DO BEGIN                                                           02142000
       TOS := 10;  << BASE 10 >>                                        02144000
       ASSEMBLE(DIV,DECX);  << NUMBER/10 >>                             02146000
       BSCBUF(XREG) := TOS + %60;                                       02148000
       ASSEMBLE (TEST);                                                 02150000
       END                                                              02152000
     UNTIL = ;                                                          02154000
                                                                        02156000
     INT2ASC := ASCBUF;  << RET. ASCII VALUES >>                        02158000
                                                                        02160000
     END;                                                               02162000
                                                                        02164000
$PAGE                                                                   02166000
<<       ******************************************                     02168000
         *                                        *                     02170000
         *   LP DRIVER INITIALIZATION PROCEDURE   *                     02172000
         *                                        *                     02174000
         ******************************************                     02176000
>>                                                                      02178000
                                                                        02180000
                                                                        02182000
   PROCEDURE LPINIT(DITP);                                              02184000
     INTEGER ARRAY DITP;                                                02186000
                                                                        02188000
<<---------------------------------------------------->>                02190000
<<                                                    >>                02192000
<<   THIS PROCEDURE INITIALIZES THE RESTRICTED MODE   >>                02194000
<<   ADDRESSES AND THE STATUS BUFFER ADDRESSES IN     >>                02196000
<<   THE CHANNEL PROGRAM.                             >>                02198000
<<                                                    >>                02200000
<<---------------------------------------------------->>                02202000
                                                                        02204000
     BEGIN                                                              02206000
       INTEGER POINTER ILTP   = Q+1;                                    02208000
       INTEGER POINTER SIOP   = Q+2;                                    02210000
       INTEGER SIOBASE        = Q+3;                                    02212000
       INTEGER POINTER INITCP = Q+4;                                    02214000
                                                                        02216000
       TOS := DITP(DILTP);      << ILTP    >>                           02218000
       TOS := ILTP(ISIOP);      << SIOP    >>                           02220000
       TOS := @SIOP + SYSDB;    << SIOBASE >>                           02222000
       TOS := @SIOP + INIT;     << INITCP >>                            02224000
                                                                        02226000
       SIOP(6) := SIOP(66) := SIOBASE + ENB'ESC;                        02228000
       SIOP(32) := SIOP(92) := SIOBASE + DSB'ESC;                       02230000
       SIOP(107) := SIOBASE + STATUS;                                   02232000
                                                                        02234000
     END;                                                               02236000
$PAGE                                                                   02238000
<<       ************************************************               02240000
         *                                              *               02242000
         *   LINE PRINTER DRIVER PROCEDURE  -  LPDRVR   *               02244000
         *                                              *               02246000
         ************************************************               02248000
>>                                                                      02250000
                                                                        02252000
   INTEGER PROCEDURE LPDRVR(IOQP,DITP,BANK,BUFFADDR,SIOP,DRTN);         02254000
                                                                        02256000
<<--------------------------------------------------------->>           02258000
<<                                                         >>           02260000
<<   THIS PROCEDURE INITIATES AND COMPLETES I/O REQUESTS   >>           02262000
<<   FOR THE HP2619A LINE PRINTER CONNECTED TO THE HP-IB   >>           02264000
<<   AND CONTROLLED BY THE GIC.                            >>           02266000
<<                                                         >>           02268000
<<   MODE RETURNS IN LPDRVR -                              >>           02270000
<<     5 - REQUEST COMPLETED                               >>           02272000
<<     7 - NOT READY WAIT                                  >>           02274000
<<   %13 - WAIT FOR COMPLETION                             >>           02276000
<<                                                         >>           02278000
<<--------------------------------------------------------->>           02280000
                                                                        02282000
   VALUE DITP,IOQP,BANK,BUFFADDR,SIOP,DRTN;                             02284000
   INTEGER BANK,BUFFADDR,DRTN;                                          02286000
   INTEGER POINTER DITP,IOQP,SIOP;                                      02288000
   OPTION PRIVILEGED,UNCALLABLE;                                        02290000
                                                                        02292000
   BEGIN                                                                02294000
     LOGICAL ARRAY                                                      02296000
       DITPL(*) = DITP, IOQPL(*) = IOQP;                                02298000
                                                                        02300000
     DOUBLE                                                             02302000
       BUFFADDRD = Q- 7,   << BANK AND BUFFER ADDRESS >>                02304000
       ASCIIAREA = Q+ 6;   << ASCII CTRL BYTE AREA >>                   02306000
                                                                        02308000
     INTEGER POINTER                                                    02310000
       CPVAP    = Q+1;    << HOLDS CHANNEL I/O STATUS >>                02312000
                                                                        02314000
     INTEGER                                                            02316000
       COUNT    = Q+2,    << BUFFER BYTE COUNT >>                       02318000
       PARAM    = Q+3,    << CONTROL PARAMETER >>                       02320000
       PRINTCTL = Q+4,    << PRINT CONTROL BYTE >>                      02322000
       FCODE    = Q+5,    << FUNCTION CODE >>                           02324000
       S0       = S-0;                                                  02326000
                                                               <<04744>>02328000
     INTEGER                                                   <<04744>>02330000
       SUBTYPE  = Q+8;    << Printer subtype >>                <<04744>>02332000
                                                                        02334000
    INTEGER ARRAY                                                       02336000
      TEMP(*)   = ASCIIAREA;                                            02338000
                                                                        02340000
    BYTE ARRAY                                                          02342000
      BTEMP(*)  = TEMP;                                                 02344000
                                                                        02346000
                                                                        02348000
$PAGE                                                                   02350000
<<---------------------------------------------------->>                02352000
<<                                                    >>                02354000
<<   INITIALIZE LOCAL POINTERS AND VARIABLES          >>                02356000
<<                                                    >>                02358000
<<---------------------------------------------------->>                02360000
                                                                        02362000
     TOS := DITP(DILTP);       << CPVAP >>                              02364000
     TOS := IOQP(QWBCT);       << COUNT >>                              02366000
     TOS := 0;                 << PARAM >>                              02368000
     TOS := 0;                 << PRINTCTL >>                           02370000
     TOS := IOQP(QFUNC).FUNC;  << FCODE >>                              02372000
     TOS := %20040;            << TEMP(1) >>                            02374000
     TOS := %20040;            << TEMP(2) >>                            02376000
     TOS := LPDTD(DITP(DLDEV).DLDEVN); << DLDEV.LDEVN >>       <<04744>>02378000
     DELB;                             << Delete DITP >>       <<04744>>02380000
     TOS := TOS.(12:4);                << LPDT.SUBTYPE>>       <<04744>>02382000
                                                                        02384000
     IF @IOQP = 0 THEN GO TO EXIT;  << NOTHING TO DO >>        <<02697>>02386000
                                                                        02388000
     IF IOQP(QMISC).WAITCODE = CMPLTIONWAIT THEN                        02390000
       ABORTTIMEREQ(DITP(DRQST));                                       02392000
                                                                        02394000
     IF IOQP < 0 THEN   << ABORT PROCESS >>                             02396000
       BEGIN                                                            02398000
         IF DITP(DSAVE).ABORTBIT <> 0 THEN   << ABORT OCCURRED >>       02400000
           BEGIN   << CLEAN UP EXCESS IOQ'S RETURNING ABORT STATUS >>   02402000
             DITP(DSAVE).(13:3) := 0;   << CLEAR DRIVER FLAGS >>        02404000
             TOS := IF IOQPL.PFAIL THEN PFABORT ELSE ABORTED;           02406000
             GOTO IODONE;                                               02408000
           END;                                                         02410000
         DITP(DSAVE).ABORTBIT := 1;  << SET ABORT FLG >>                02412000
         GOTO INITDEV;   << DO INITIALIZATION >>                        02414000
         HELP;   << LINK FOR DEBUGGER HELP >>                           02416000
       END                                                              02418000
                                                                        02420000
     ELSE DITP(DSAVE).ABORTBIT := 0;   << RESET ABORT FLG >>            02422000
                                                                        02424000
<<---------------------------------------------------->>                02426000
<<                                                    >>                02428000
<<   CHECK FOR RETURN FROM NOTREADY CONDITION         >>                02430000
<<                                                    >>                02432000
<<---------------------------------------------------->>                02434000
                                                                        02436000
     IF IOQP(QMISC).WAITCODE = NOTRDYWAIT THEN                          02438000
       BEGIN                                                            02440000
         IF SIOP(STATUS).PON = 1 THEN   << PON JUST OCCUR >>            02442000
           BEGIN                                                        02444000
           IOQP(QMISC).PONBIT := 1;                                     02446000
           DITP(DSAVE).BETJOB := 0;   << IN BETWEEN JOB >>              02448000
           GOTO IDLECP;   << CHECK FOR ONLINE OR OFFLINE >>             02450000
           END;                                                         02452000
         IOQP(QMISC).PONBIT := 0;                                       02454000
         IF <> THEN   << PON OCCURRED PREVIOUSLY >>                     02456000
           BEGIN                                                        02458000
             IOQP(QMISC).PONBIT := 1;   << SET PON FLG >>               02460000
             GOTO INITDEV;   << DO INITIALIZATION >>                    02462000
           END;                                                         02464000
         GOTO RESTART;                                                  02466000
       END;                                                             02468000
                                                                        02470000
     IF IOQP(QMISC).WAITCODE = CMPLTIONWAIT THEN                        02472000
       GOTO LPCONT;   << COMPLETION INTERRUPT >>                        02474000
                                                                        02476000
     IF IOQP(QMISC).WAITCODE = INITIOWAIT THEN                          02478000
       BEGIN                                                            02480000
         IOQP(QMISC).PONBIT := 0;                                       02482000
         IF <> THEN   << POWER UP/RESET WAS PERFORMED >>                02484000
           BEGIN                                                        02486000
             IF IOQPL.DIAG THEN   << DIAGNOSTIC COMPLETION >>           02488000
               BEGIN                                                    02490000
                 TOS := POWERUP;                                        02492000
                 GOTO IODONE;                                           02494000
               END ELSE                                                 02496000
                                                                        02498000
             IF IOMESSAGE(1,POWERUPMSG,%10000,DITP(DLDEV).DLDEVN,       02500000
                          ,,,,OPCONSOLE) THEN                           02502000
               BEGIN                                                    02504000
                 IF DITP(DSAVE).BETJOB = 1 THEN                         02506000
                   GOTO LPINIT   << SUPPRESS POWER FAIL MSG >>          02508000
                 ELSE                                                   02510000
                   BEGIN   << REPORT POWER FAIL STATUS >>               02512000
                     TOS := POWERUP;                                    02514000
                     GOTO IODONE;                                       02516000
                   END;                                                 02518000
               END;                                                     02520000
                                                                        02522000
             TOS := SYSERROR;   << INDICATE FAILURE AS THERE >>         02524000
             GOTO IODONE;       << ARE NO MESSAGE LINK BUFFS >>         02526000
           END                                                          02528000
                                                                        02530000
         ELSE                                                           02532000
           BEGIN   << BADIO COMPLETION >>                               02534000
             LPDRVR := REQUESTDONE;                                     02536000
             RETURN;                                                    02538000
           END;                                                         02540000
       END;                                                             02542000
                                                                        02544000
     GOTO LPINIT;                                                       02546000
                                                                        02548000
<<---------------------------------------------------->>                02550000
<<                                                    >>                02552000
<<   PRINTER INITIALIZATION - DEVICE CLEAR TO CLEAR   >>                02554000
<<      BUFFERS AND RESET FIRMWIRE TO A KNOWN STATE   >>                02556000
<<                                                    >>                02558000
<<---------------------------------------------------->>                02560000
                                                                        02562000
  INITDEV:                                                              02564000
     SIOP(BRANCHPT) := INITSIOP;   << INIT CP ENTRY >>                  02566000
     START'HPIB(DITP,SIOP,TRUE);                                        02568000
     IF < THEN                                                          02570000
       BEGIN                                                            02572000
         TOS := SIOFAIL;                                                02574000
         GOTO IODONE;                                                   02576000
       END;                                                             02578000
     IOQP(QMISC).WAITCODE := INITIOWAIT;                                02580000
     LPDRVR := INTRPTWAIT;                                              02582000
     RETURN;                                                            02584000
$PAGE                                                                   02586000
<<****************************************************>>                02588000
<<                                                    >>                02590000
<<   LINE PRINTER INITIALIZATION SECTION              >>                02592000
<<                                                    >>                02594000
<<****************************************************>>                02596000
                                                                        02598000
  LPINIT:                                                               02600000
     SIOP(PREJMP) := 26;   << INIT W/PRESPACE BYPASSED IN CP >>         02602000
     SIOP(POSTJMP) := 39;   << INIT W/POSTSPACE BYPASSED IN CP >>       02604000
     SIOP(BUFFJMP) := 17;   << INIT W/BUFFER WRT BYPASSED IN CP >>      02606000
                                                                        02608000
     SIOP(PRE'DCNT) := 1;   << INIT PRESPACE DSB ESC SEQ CNT >>         02610000
     SIOP(PRE'DADR).LRBIT := 1;   << INIT TO START W/RT BYTE >>         02612000
     SIOP(POST'DCNT) := 1;   << INIT POSTSPACE DSB ESC SEQ CNT >>       02614000
     SIOP(POST'DADR).LRBIT := 1;   << INIT TO START W/RT BYTE >>        02616000
                                                                        02618000
     SIOP(PRE'ESC) := SIOP(POST'ESC) := @SIOP+SYSDB+ESC'ADR;            02620000
     SIOP(PRE'CNT) := SIOP(POST'CNT) := 8;   << #ESC BYTES >>           02622000
     SIOP(ESC'PARM) := SIOP(ESC'ALPHA) := %20040;   << INIT AREA >>     02624000
                                                                        02626000
<<---------------------------------------------------->>                02628000
<<                                                    >>                02630000
<<   FILE OPEN [FOPEN WITH FCODE = 2]                 >>                02632000
<<   FILE CLOSE [FCLOSE WITH FCODE = 3]               >>                02634000
<<   DEVICE CLOSE [DCLOSE WITH FCODE = 4]             >>                02636000
<<                                                    >>                02638000
<<---------------------------------------------------->>                02640000
                                                                        02642000
     IF FCODE=DCLOSE OR FCODE=FOPEN OR FCODE=FCLOSE THEN                02644000
                                                                        02646000
       BEGIN                                                            02648000
         IF DITP(DSAVE).(FULL':2) = 1 THEN                     <<02697>>02650000
           GO TO PRINTDONE; << EMPTY BUFFER & ALREADY AT TOP >><<02697>>02652000
         SIOP(PREJMP) := 0;                                             02654000
         SIOP(ESC'PARM) := %20061;   << TOF-SELECT CHAN 1 >>            02656000
         SIOP(ESC'ALPHA) := %20126;   << ESC CODE V >>                  02658000
         SIOP(PRE'CNT) := 8;   << ESC SEQ COUNT >>                      02660000
         DITP(DSAVE).FULL := 0;  << SET BUFFER EMPTY >>        <<02697>>02662000
         IF FCODE=DCLOSE THEN                                           02664000
           DITP(DSAVE).(13:3) := 1;   << SET TOF FLAG >>                02666000
         IOQP(QMISC).PEJECT := 1;                                       02668000
         GOTO STARTPRINT;                                               02670000
       END                                                              02672000
                                                                        02674000
<<---------------------------------------------------->>                02676000
<<                                                    >>                02678000
<<   FILE WRITE [FWRITE WITH FCODE = 1]               >>                02680000
<<                                                    >>                02682000
<<---------------------------------------------------->>                02684000
                                                                        02686000
   ELSE IF FCODE = 1 THEN                                               02688000
                                                                        02690000
     BEGIN                                                              02692000
     IF DITP(DSAVE).(PRESPACE':2)=3 AND NOT IOQPL(QPAR2) THEN           02694000
       BEGIN                                                            02696000
         SIOP(PREJMP) := 0;                                             02698000
         IF IOQPL(QPAR2).STEPOVER THEN                         <<02697>>02700000
           BEGIN  << NO AUTO PAGE EJECT >>                     <<02697>>02702000
             SIOP(ESC'PARM) := %20061;  << SINGLE SPACE SLEW >><<02697>>02704000
             SIOP(ESC'ALPHA) := %20125;  << ESC CODE U >>      <<02697>>02706000
           END                                                 <<02697>>02708000
         ELSE                                                  <<02697>>02710000
           BEGIN  << AUTO PAGE EJECT >>                        <<02697>>02712000
         SIOP(ESC'PARM) := %20063;   << SINGLE SPACE CHAN 3 >>          02714000
         SIOP(ESC'ALPHA) := %20126;   << ESC CODE V >>                  02716000
           END;                                                <<02697>>02718000
         SIOP(PRE'CNT) := 8;   << ESC SEQ COUNT >>                      02720000
         DITP(DSAVE).FULL := 0;   << SET BUFFER EMPTY >>                02722000
         IOQP(QMISC).PRE'TO'POST := 1;                                  02724000
         GOTO STARTPRINT;                                               02726000
       END;                                                             02728000
                                                                        02730000
     TOS := IOQP(QWBCT);                                                02732000
     IF < THEN   << BYTE COUNT >>                                       02734000
       COUNT := -TOS   << MAKE POSITIVE >>                              02736000
     ELSE   << WORD COUNT >>                                            02738000
       COUNT := TOS&ASL(1);   << CHANGE TO BYTE COUNT >>                02740000
                                                                        02742000
     IF IOQP(QPAR1) = 1 THEN   << IMBEDDED CONTROL >>                   02744000
       BEGIN                                                            02746000
         IF COUNT = 0 THEN   << INVALID OPERATION >>                    02748000
           BEGIN                                                        02750000
             TOS := INVALIDOP;                                          02752000
             GOTO IODONE;                                               02754000
           END;                                                         02756000
         TOS := BUFFADDRD;   << LOAD BANK AND BUFF ADDRESS >>           02758000
         LOADMEMORY;   << LOAD FIRST WORD >>                            02760000
         PARAM := TOS&LSR(8);   << ISOLATE AND SAVE CONTROL PARAM >>    02762000
         COUNT := COUNT - 1;   << DECREMENT BYTE COUNT >>               02764000
       END                                                              02766000
     ELSE                                                               02768000
       PARAM := IOQP(QPAR1);   << CONTROL IN PARAM WORD >>              02770000
                                                                        02772000
     DITP(DSAVE).PRESPACE := IF IOQPL(QPAR2)                            02774000
       THEN 1 ELSE 0;   << SET PRESPACE FLAG >>                         02776000
                                                                        02778000
<<---------------------------------------------------->>                02780000
<<                                                    >>                02782000
<<   INITALIZE PRINT CONTROL BYTE                     >>                02784000
<<                                                    >>                02786000
<<---------------------------------------------------->>                02788000
                                                                        02790000
     IF IOQPL(QPAR2).STEPOVER THEN                                      02792000
       PRINTCTL := 1   << SINGLE SPACE WITHOUT STEPOVER >>              02794000
     ELSE                                                               02796000
       PRINTCTL := %102;   << SINGLE SPACE WITH STEPOVER >>             02798000
                                                                        02800000
     << SETUP PRINT CONTROL BYTE >>                                     02802000
                                                                        02804000
     IF PARAM = "+" THEN   << SUPPRESS SPACING >>                       02806000
       PRINTCTL := 0                                                    02808000
                                                                        02810000
     ELSE IF PARAM = "0" THEN   << DOUBLE SPACE >>                      02812000
       PRINTCTL := PRINTCTL + 1                                         02814000
                                                                        02816000
     ELSE IF PARAM = "-" THEN   << TRIPLE SPACE >>                      02818000
       PRINTCTL := PRINTCTL + 2                                         02820000
                                                                        02822000
     ELSE IF PARAM = "1" THEN   << TOP OF FORM >>                       02824000
       BEGIN                                                            02826000
         IF COUNT=0 AND DITP(DSAVE).(FULL':2)=1 THEN                    02828000
           GOTO PRINTDONE;   << EMPTY BUFFER AND ALREADY AT TOP >>      02830000
         PRINTCTL := %100;                                              02832000
         IOQP(QMISC).PEJECT := 1;   << SET PAGE EJECT FLAG >>           02834000
       END                                                              02836000
                                                                        02838000
     ELSE IF %200 <= PARAM <= %277 THEN   << SLEW N LINES >>            02840000
       PRINTCTL := PARAM - %200                                         02842000
                                                                        02844000
     ELSE IF %300 <= PARAM <= %313 THEN   << SELECT CHANNEL N >>        02846000
      IF SUBTYPE <> HP2617J OR PARAM <= %307 THEN              <<04744>>02848000
       PRINTCTL := PARAM - %200                                         02850000
      ELSE  << This ELSE is just a place keeper to keep the  >><<04744>>02852000
            << original structure of this section of code    >><<04744>>02854000
            << intact.  If (subtype = HP2617J) and           >><<04744>>02856000
            << (%310 <= PARAM <= %313) then PRINTCTL will be >><<04744>>02858000
            << unchanged from its earlier initialization to  >><<04744>>02860000
            << single space and control goes to PRINTSETUP:  >><<04744>>02862000
                                                                        02864000
     ELSE IF PARAM = %320 THEN   << BUFFER FILL ONLY >>                 02866000
       BEGIN                                                            02868000
         PRINTCTL := -1;                                                02870000
         IF COUNT=0 THEN GOTO PRINTDONE;                                02872000
         IOQP(QMISC).BUF'FILL := 1;   << SET BUF FILL FLAG >>           02874000
       END;                                                             02876000
                                                                        02878000
$PAGE                                                                   02880000
<<---------------------------------------------------->>                02882000
<<                                                    >>                02884000
<<   SET CHAN PROG FOR BUFFER FILL & PRINT CONTROL    >>                02886000
<<                                                    >>                02888000
<<---------------------------------------------------->>                02890000
                                                                        02892000
  PRINTSETUP:                                                           02894000
     IF PRINTCTL >= 0 THEN   << SETUP PRINT CONTROL >>                  02896000
       BEGIN                                                            02898000
         DITP(DSAVE).FULL := 0;                                         02900000
         IF PRINTCTL >= %100 THEN                                       02902000
                                                                        02904000
           BEGIN   << SET ESC CODE FOR VFC CHAN SELECT >>               02906000
           SIOP(ESC'ALPHA) := %20126;   << V >>                         02908000
           PRINTCTL := PRINTCTL - %77;                                  02910000
           END                                                          02912000
                                                                        02914000
         ELSE   << SET ESC CODE FOR SLEWING >>                          02916000
           SIOP(ESC'ALPHA) := %20125;   << U >>                         02918000
                                                                        02920000
         ASCIIAREA := INT2ASC(PRINTCTL,2);                              02922000
         SIOP(ESC'PARM) := TEMP;   << ASCII PARAMETER >>                02924000
                                                                        02926000
         IF DITP(DSAVE).PRESPACE=1 THEN   << PRESPACE >>                02928000
           SIOP(PREJMP) := 0                                            02930000
                                                                        02932000
         ELSE                             << POSTSPACE >>               02934000
           SIOP(POSTJMP) := 0;                                          02936000
       END;                                                             02938000
                                                                        02940000
                                                                        02942000
     IF COUNT <> 0 THEN   << SETUP BUFFER FILL >>                       02944000
       BEGIN                                                            02946000
         SIOP(BUFFJMP) := 0;                                            02948000
         SIOP(BCOUNT) := COUNT;                                         02950000
         SIOP(MEMX).(8:8) := BANK;                                      02952000
         SIOP(MEMX).LRBIT := IF IOQP(QPAR1)=1   << IMBEDDED CONTROL >>  02954000
           THEN 1 ELSE 0;   << START WITH RIGHT BYTE >>                 02956000
         SIOP(BADDR) := BUFFADDR;                                       02958000
         DITP(DSAVE).FULL := IF DITPL(DSAVE).PRESPACE                   02960000
           THEN 1 ELSE 0;   << IF PRESPACING INDICATE BUFF IS FULL >>   02962000
       END;                                                             02964000
                                                                        02966000
<<---------------------------------------------------->>                02968000
<<                                                    >>                02970000
<<   START CHANNEL PROGRAM                            >>                02972000
<<                                                    >>                02974000
<<---------------------------------------------------->>                02976000
                                                                        02978000
  STARTPRINT:                                                           02980000
     CPVAP := 0;           << CLEAR CHANNEL STATUS WORD >>              02982000
     SIOP(STATUS) := 0;    << CLEAR CP STATUS WORD >>                   02984000
                                                                        02986000
     START'HPIB(DITP,SIOP,TRUE);   << START CHANNEL PROGRAM >>          02988000
                                                                        02990000
PRINTCONT:                                                              02992000
     IF < THEN   << SIO FAILURE >>                                      02994000
       BEGIN                                                            02996000
         TOS := SIOFAIL;                                                02998000
         GOTO BADIO;                                                    03000000
       END;                                                             03002000
                                                                        03004000
     IOQP(QMISC).WAITCODE := CMPLTIONWAIT;   << SET REQUEST STATE >>    03006000
     DITP(DTIME) := 0;                                                  03008000
     IF IOQPL.DIAG THEN   << LENGTHEN TIMER FOR DIAGNOSTICS >>          03010000
       DITP(DRQST) := TIMEREQ(IOTIMER,@DITP,50000D)                     03012000
     ELSE                                                               03014000
       DITP(DRQST) := TIMEREQ(IOTIMER,@DITP,5000D);            <<04744>>03016000
       <<Timer was changed from 2 to 5 sec for KANJI printers>><<04744>>03018000
     LPDRVR := INTRPTWAIT;                                              03020000
     RETURN;                                                            03022000
                                                                        03024000
     END   << OF WRITE LOGIC (FUNCTION CODE = 1) >>                     03026000
                                                                        03028000
$PAGE                                                                   03030000
<<---------------------------------------------------->>                03032000
<<                                                    >>                03034000
<<   READ STATUS [FCODE = %17]                        >>                03036000
<<                                                    >>                03038000
<<---------------------------------------------------->>                03040000
                                                                        03042000
  ELSE  IF FCODE = %17 THEN                                             03044000
                                                                        03046000
    BEGIN   << READ STATUS PROCESSING >>                                03048000
      TOS := IOQP(QWBCT);   << GET COUNT >>                             03050000
      IF < THEN   << NEGATIVE BYTE COUNT >>                             03052000
        COUNT := -TOS   << MAKE POSITIVE >>                             03054000
      ELSE   << POSITIVE WORD COUNT >>                                  03056000
        COUNT := TOS & ASL(1);   << CHANGE TO BYTE >>                   03058000
                                                                        03060000
      IF COUNT < 1 THEN   << INVALID REQUEST >>                         03062000
        BEGIN                                                           03064000
          TOS := INVALIDOP;                                             03066000
          GOTO BADIO;                                                   03068000
        END;                                                            03070000
                                                                        03072000
      IF COUNT > 1 THEN   << EXCEED MAX STATUS >>                       03074000
        COUNT := 1;   << SET MAX STATUS AVAIL >>                        03076000
                                                                        03078000
      SIOP(RWCTL).DCODE := 3;   << READ CODE >>                         03080000
      SIOP(RWCTL).CMD := %16;   << READ STATUS SECONDARY >>             03082000
      SIOP(DSCOUNT) := COUNT;                                           03084000
      SIOP(DSBANK).(0:8) := 0;   << NO SPECIAL OPTIONS >>               03086000
      SIOP(DSBANK).(8:8) := BANK;   << SET BANK >>                      03088000
      SIOP(DSTATADR) := BUFFADDR;   << SET ABS ADR >>                   03090000
                                                                        03092000
      CPVAP := 0;                                                       03094000
      SIOP(STATUS) := 0;                                                03096000
      SIOP(BRANCHPT) := DSTATSIOP;   << READ STATUS ENTRY >>            03098000
      SIOP(DIAGJMP) := -16;  << COMPLETE W/INTRP HLT >>                 03100000
      START'HPIB(DITP,SIOP,TRUE);   << START CHAN PROG >>               03102000
      GOTO PRINTCONT;   << FOR WRAP-UP >>                               03104000
                                                                        03106000
    END   << OF READ STATUS PROCESSING >>                               03108000
                                                                        03110000
$PAGE                                                                   03112000
<<---------------------------------------------------->>                03114000
<<                                                    >>                03116000
<<   IDENTIFY [FCODE=%110]                            >>                03118000
<<                                                    >>                03120000
                                                                        03122000
<<---------------------------------------------------->>                03124000
                                                                        03126000
   ELSE IF FCODE = %110 AND IOQPL.DIAG THEN                             03128000
                                                                        03130000
     BEGIN                                                              03132000
       SIOP(DSBANK) := %3000;   << IDENTIFY CMD CODE >>                 03134000
       SIOP(DSTATADR) := 0;   << INITIALIZE RETURN ID >>                03136000
                                                                        03138000
       CPVAP := 0;                                                      03140000
       SIOP(STATUS) := 0;                                               03142000
       SIOP(BRANCHPT) := IDSIOP;   << BRANCH-IDENTIFY SECTION >>        03144000
       SIOP(DIAGJMP) := -16;  << COMPLETE W/INTRP HLT >>                03146000
       START'HPIB(DITP,SIOP,TRUE);   << START CHAN PROG >>              03148000
       GOTO PRINTCONT;                                                  03150000
                                                                        03152000
     END   << OF IDENTIFY >>                                            03154000
                                                                        03156000
$PAGE                                                                   03158000
<<---------------------------------------------------->>                03160000
<<                                                    >>                03162000
<<   SELF TEST INITIATE [FCODE = %111]                >>                03164000
<<   SELF TEST RESULT   [FCODE = %112]                >>                03166000
<<                                                    >>                03168000
<<---------------------------------------------------->>                03170000
                                                                        03172000
   ELSE IF (FCODE = %111 OR FCODE = %112) AND IOQPL.DIAG THEN           03174000
                                                                        03176000
     BEGIN                                                              03178000
       IF FCODE=%111 THEN                                               03180000
         BEGIN                                                          03182000
         SIOP(RWCTL).DCODE := %10;  << WRITE CTRL CODE >>               03184000
         SIOP(DIAGJMP) := -24;  << WAIT, DSJ W/INTRP HLT >>             03186000
         END                                                            03188000
       ELSE                                                             03190000
         BEGIN                                                          03192000
         SIOP(RWCTL).DCODE := 7;   << READ CTRL CODE >>                 03194000
         SIOP(DIAGJMP) := -16;  << COMPLETE W/INTRP HLT >>              03196000
         END;                                                           03198000
                                                                        03200000
       SIOP(RWCTL).CMD := %17;   << SELF TEST SECONDARY >>              03202000
       SIOP(DSCOUNT) := 1;   << 1 BYTE WITH SUBTEST# >>                 03204000
       SIOP(DSBANK).(0:8) := %100;   << START W/RIGHT BYTE >>           03206000
                                                                        03208000
       IF FCODE=%111 THEN   << CHECK SUBTEST# FOR INITIATE >>           03210000
         BEGIN                                                          03212000
           TOS := BUFFADDRD;  << LOAD BANK & BUFFER ADDR >>             03214000
           LOADMEMORY;  << LOAD FIRST WORD >>                           03216000
           PARAM := TOS;  << SUBTEST# >>                                03218000
           IF PARAM < 0 OR PARAM > 7 THEN  << NOT IN RANGE >>           03220000
             BEGIN                                                      03222000
               TOS := INVALIDOP;                                        03224000
               GOTO IODONE;                                             03226000
             END;                                                       03228000
         END;                                                           03230000
                                                                        03232000
       SIOP(DSBANK).(8:8) := BANK;                                      03234000
       SIOP(DSTATADR) := BUFFADDR;                                      03236000
                                                                        03238000
       CPVAP := 0;                                                      03240000
       SIOP(STATUS) := 0;                                               03242000
       SIOP(BRANCHPT) := DSTATSIOP;   << DIAGNOSTIC ENTRY >>            03244000
       START'HPIB(DITP,SIOP,TRUE);                                      03246000
       GOTO PRINTCONT;                                                  03248000
                                                                        03250000
     END   << OF SELF TEST LOGIC >>                                     03252000
                                                                        03254000
$PAGE                                                                   03256000
<<---------------------------------------------------->>                03258000
<<                                                    >>                03260000
<<   LOOPBACK TEST:                                   >>                03262000
<<   WRITE DATA - PING [FCODE = %113]                 >>                03264000
<<   READ DATA  - PONG [FCODE = %114]                 >>                03266000
<<                                                    >>                03268000
<<---------------------------------------------------->>                03270000
                                                                        03272000
   ELSE IF (FCODE = %113 OR FCODE = %114) AND IOQPL.DIAG THEN           03274000
                                                                        03276000
     BEGIN                                                              03278000
       IF FCODE=%113 THEN                                               03280000
         BEGIN                                                          03282000
         SIOP(RWCTL).DCODE := %10;  << WRITE CTRL CODE >>               03284000
         SIOP(DIAGJMP) := -24;  << WAIT, DSJ W/INTRP HLT >>             03286000
         END                                                            03288000
       ELSE                                                             03290000
         BEGIN                                                          03292000
         SIOP(RWCTL).DCODE := 7;   << READ CTRL CODE >>                 03294000
         SIOP(DIAGJMP) := -16;  << COMPLETE W/INTRP HLT >>              03296000
         END;                                                           03298000
                                                                        03300000
       TOS := IOQP(QWBCT);                                              03302000
       IF < THEN   << BYTE COUNT >>                                     03304000
         COUNT := -TOS   << MAKE POSITIVE >>                            03306000
       ELSE   << WORD COUNT >>                                          03308000
         COUNT := TOS&ASL(1);   << CHANGE TO BYTE COUNT >>              03310000
                                                                        03312000
       IF COUNT<1 OR COUNT>256 THEN   << INVALID REQ >>                 03314000
         BEGIN                                                          03316000
         TOS := INVALIDOP;                                              03318000
         GOTO IODONE;                                                   03320000
         END;                                                           03322000
                                                                        03324000
       SIOP(RWCTL).CMD := %16;   << PING/PONG SECONDARY >>              03326000
       SIOP(DSCOUNT) := COUNT;   << LOOPBACK DATA COUNT >>              03328000
       SIOP(DSBANK).(0:8) := 0;   << NO SPECIAL OPTIONS >>              03330000
       SIOP(DSBANK).(8:8) := BANK;                                      03332000
       SIOP(DSTATADR) := BUFFADDR;                                      03334000
                                                                        03336000
       CPVAP := 0;                                                      03338000
       SIOP(STATUS) := 0;                                               03340000
       SIOP(BRANCHPT) := DSTATSIOP;   << DIAGNOSTIC ENTRY >>            03342000
       START'HPIB(DITP,SIOP,TRUE);                                      03344000
       GOTO PRINTCONT;                                                  03346000
                                                                        03348000
     END   << OF LOOPBACK TEST LOGIC >>                                 03350000
                                                                        03352000
                                                                        03354000
   ELSE   << FALL THROUGH >>                                            03356000
                                                                        03358000
                                                                        03360000
$PAGE                                                                   03362000
                                                                        03364000
  PRINTDONE:                                                            03366000
     TOS := GOODIO;                                                     03368000
                                                                        03370000
  IODONE:                                                               03372000
     IOQP(QSTAT).IOSTAT := TOS;   << STORE RETURN STATUS >>             03374000
                                                               <<02697>>03376000
  EXIT:                                                        <<02697>>03378000
     LPDRVR := REQUESTDONE;                                             03380000
     RETURN;                                                            03382000
                                                                        03384000
  CHANERROR:                                                            03386000
     TOS := CHANFAIL;                                                   03388000
     DITP(DSERR) := [8/1,8/DLOGERROR];                                  03390000
     DITP(DLOGERROR) := CPVAP;   << LOG ERROR STATUS >>                 03392000
                                                                        03394000
  BADIO:                                                                03396000
     DITP(DSAVE).(13:3) := 0;   << CLEAR DRIVER FLAGS >>                03398000
     IOQP(QSTAT).IOSTAT := TOS;                                         03400000
     GOTO INITDEV;                                                      03402000
                                                                        03404000
  PARITYERROR:                                                          03406000
     TOS := PARITY;                                                     03408000
     DITP(DSERR) := [8/1,8/DLOGERROR];                                  03410000
     DITP(DLOGERROR) := PARITYERR;                                      03412000
     GOTO BADIO;                                                        03414000
                                                                        03416000
  TIMEOUT:                                                              03418000
     TOS := TIMOUTERR;                                                  03420000
     IF IOQPL.DIAG THEN GOTO BADIO;                                     03422000
     DITP(DSERR) := [8/1,8/DLOGERROR];                                  03424000
     DITP(DLOGERROR) := CPVAP;                                          03426000
     GOTO BADIO;                                                        03428000
                                                                        03430000
  UNITERROR:                                                            03432000
     TOS := UNITERR;                                                    03434000
     DITP(DSERR) := [8/1,8/DLOGERROR];                                  03436000
     DITP(DLOGERROR) := SIOP(STATUS);                                   03438000
     GOTO BADIO;                                                        03440000
                                                                        03442000
$PAGE                                                                   03444000
<<****************************************************>>                03446000
<<                                                    >>                03448000
<<   LINE PRINTER CONTINUATOR SECTION                 >>                03450000
<<                                                    >>                03452000
<<****************************************************>>                03454000
                                                                        03456000
  LPCONT:                                                               03458000
     IF CPVAP.ERRORCODE = 6 THEN   << DMA ABORT >>                      03460000
       GOTO CHANERROR;                                                  03462000
                                                                        03464000
     IF CPVAP.ERRORCODE = 7 THEN   << CHANNEL ABORT >>                  03466000
       BEGIN                                                            03468000
         IF CPVAP.TIMEDOUT = 1 THEN   << GIC TIMEOUT >>                 03470000
           BEGIN                                                        03472000
             IOQP(QMISC).TOUT := 0;                                     03474000
             IF <> THEN   << 2ND TIMEOUT - REPORT >>                    03476000
               GOTO TIMEOUT;                                            03478000
             IOQP(QMISC).TOUT := 1;   << 1ST TIMEOUT >>                 03480000
             CPVAP := 0;                                                03482000
             SIOP(STATUS) := 0;                                         03484000
             SIOP(BRANCHPT) := STATSIOP;   << READ STATUS >>            03486000
             START'HPIB(DITP,SIOP,TRUE);   << MAYBE PARITY >>           03488000
             GOTO PRINTCONT;                                            03490000
           END ELSE GOTO CHANERROR;                                     03492000
       END;                                                             03494000
                                                                        03496000
     IF IOQPL.SFAIL THEN   << FAILURE ON DELAYED START I/O >>           03498000
       BEGIN                                                            03500000
         TOS := SIOFAIL;                                                03502000
         GOTO BADIO;                                                    03504000
       END;                                                             03506000
                                                                        03508000
<<---------------------------------------------------->>                03510000
<<                                                    >>                03512000
<<   LP NOT READY COMPLETION                          >>                03514000
<<                                                    >>                03516000
<<---------------------------------------------------->>                03518000
                                                                        03520000
     DITP(DTIME).(0:1) := 0;                                            03522000
     IF <> THEN   << TIMER POPPED >>                                    03524000
       BEGIN                                                            03526000
                                                                        03528000
   LPNOTREADY:                                                          03530000
         IF IOQPL.DIAG THEN   << DIAGNOSTIC COMPLETION >>               03532000
           GOTO TIMEOUT                                                 03534000
         ELSE                                                           03536000
                                                                        03538000
         IF IOMESSAGE(1,NOTRDYMSG,%10000,DITP(DLDEV).DLDEVN,            03540000
                      ,,,,OPCONSOLE) THEN                               03542000
   IDLECP:                                                              03544000
           BEGIN                                                        03546000
             CPVAP := 0;                                                03548000
             SIOP(STATUS) := 0;                                         03550000
             SIOP(BRANCHPT) := IDLESIOP;   << IDLE CP ENTRY >>          03552000
             START'HPIB(DITP,SIOP,FALSE);                               03554000
             IF < THEN                                                  03556000
               BEGIN                                                    03558000
                 TOS := SIOFAIL;                                        03560000
                 GOTO BADIO;                                            03562000
               END;                                                     03564000
             IOQP(QMISC).WAITCODE := NOTRDYWAIT;  << SET REQ STATE >>   03566000
             LPDRVR := NOTREADY;                                        03568000
             RETURN;                                                    03570000
           END;                                                         03572000
                                                                        03574000
         TOS := SYSERROR;   << INDICATE FAILURE BECAUSE THERE >>        03576000
         GOTO BADIO;        << ARE NO MESSAGE LINK BUFFERS >>           03578000
       END;                                                             03580000
                                                                        03582000
<<---------------------------------------------------->>                03584000
<<                                                    >>                03586000
<<   I/O STATUS INTERROGATION COMPLETION              >>                03588000
<<                                                    >>                03590000
<<---------------------------------------------------->>                03592000
                                                                        03594000
     IF CPVAP(1).(14:2) = 2 THEN   << STATUS DIAGNOSIS IS REQUIRED >>   03596000
                                                                        03598000
       BEGIN                                                            03600000
         IF SIOP(STATUS).PON = 1 THEN   << PON OCCURRED >>              03602000
           BEGIN                                                        03604000
             IOQP(QMISC).PONBIT := 1;   << SET PON FLAG >>              03606000
             DITP(DSAVE).BETJOB := 1;   << BETWEEN JOB >>               03608000
           END;                                                         03610000
                                                                        03612000
         IF SIOP(STATUS).ONLINE <> 1 THEN   << UNIT NOTREADY >>         03614000
           GOTO LPNOTREADY;                                             03616000
                                                                        03618000
         IF SIOP(STATUS).PAPERBIT = 1 THEN   << PAPER ERROR >>          03620000
           GOTO LPNOTREADY;                                             03622000
                                                                        03624000
         IF SIOP(STATUS).PARITYBIT = 1 THEN                             03626000
           GOTO PARITYERROR;   << PARITY ERROR >>                       03628000
                                                                        03630000
         IF SIOP(STATUS).PROTOBIT = 1 THEN                              03632000
           GOTO UNITERROR;   << PROTOCOL ERROR >>                       03634000
                                                                        03636000
                                                                        03638000
     <<                                            >>                   03640000
     <<  AT THIS POINT, AN EXTRA PASS OF THE IDLE  >>                   03642000
     <<  CP MUST BE MADE TO ASSURE THAT A BUFFER   >>                   03644000
     <<  IS READY FOR THE NEXT SECONDARY COMMAND,  >>                   03646000
     <<  SO THE DRIVER WILL NOT GET OUT OF SYNCH   >>                   03648000
     <<  WITH THE FIRMWARE.  THIS WILL BE DONE     >>                   03650000
     <<  UNDER THE FOLLOWING CONDITIONS:           >>                   03652000
     <<                                            >>                   03654000
     <<    - PON CONDITION (FLAGGED BY DSJ 2)      >>                   03656000
     <<    - ALARM CONDITION WHICH CLEARED UP      >>                   03658000
     <<      SHOWING A CLEAN STATUS BUT RETAINED   >>                   03660000
     <<      THE DSJ 2 CONDITION.                  >>                   03662000
     <<    - BUFFER READY BIT NOT SET IN THE       >>                   03664000
     <<      STATUS WORD POSSIBLY DUE TO NOISE     >>                   03666000
     <<      ON THE BUS.                           >>                   03668000
     <<                                            >>                   03670000
                                                                        03672000
                                                                        03674000
         GOTO IDLECP;                                                   03676000
                                                                        03678000
   RESTART:                                                             03680000
         IF FCODE = 1 THEN   << RESTART INCOMPLETE WRT OPERATION >>     03682000
           BEGIN                                                        03684000
                                                                        03686000
             IF IOQP(QMISC).BUF'FILL <> 0 THEN                          03688000
               BEGIN   << FILL BUFFER RESTART >>                        03690000
                 IF SIOP(BCOUNT) = 0 THEN   << OPER DONE >>             03692000
                   GOTO PRINTDONE;                                      03694000
                 SIOP(BRANCHPT) := FILLSIOP;                            03696000
                 GOTO CONTD;                                            03698000
               END;                                                     03700000
                                                                        03702000
             IF DITP(DSAVE).PRESPACE = 1 THEN                           03704000
               BEGIN   << RESTART PRESPACE OPERATION >>                 03706000
                 IF SIOP(BCOUNT) <> 0 THEN                              03708000
                   SIOP(BRANCHPT) := FILLSIOP                           03710000
                 ELSE GOTO PRINTDONE;                                   03712000
                 IF SIOP(PRE'DCNT) <> 0 THEN                            03714000
                   SIOP(BRANCHPT) := PRE'DSBSIOP;                       03716000
                 IF SIOP(PRE'CNT) <> 0 THEN                             03718000
                   SIOP(BRANCHPT) := 0;                                 03720000
               END;                                                     03722000
                                                                        03724000
             IF DITP(DSAVE).PRESPACE = 0 THEN                           03726000
               BEGIN   << RESTART POSTSPACE OPERATION >>                03728000
                 IF SIOP(POST'DCNT) <> 0 THEN                           03730000
                   SIOP(BRANCHPT) := POST'DSBSIOP                       03732000
                 ELSE GOTO PRINTDONE;                                   03734000
                 IF SIOP(POST'CNT) <> 0 THEN                            03736000
                   SIOP(BRANCHPT) := POST'ENBSIOP;                      03738000
                 IF SIOP(BCOUNT) <> 0 THEN                              03740000
                   SIOP(BRANCHPT) := FILLSIOP;                          03742000
                 IF SIOP(PRE'DCNT) <> 0 THEN                            03744000
                   SIOP(BRANCHPT) := PRE'DSBSIOP;                       03746000
               END;                                                     03748000
                                                                        03750000
   CONTD:                                                               03752000
             IF SIOP(BCOUNT) <> 0 THEN                                  03754000
               BEGIN   << RECALCULATE BUFFER WRITE >>                   03756000
                 TOS := IOQP(QWBCT);   << GET TOTAL COUNT >>            03758000
                 IF < THEN                                              03760000
                   COUNT := -TOS                                        03762000
                 ELSE                                                   03764000
                   COUNT := TOS & ASL(1);   << CHANGE TO BYTE >>        03766000
                 SIOP(MEMX).(8:8) := BANK;   << RESET BANK >>           03768000
                 SIOP(BADDR) := BUFFADDR +                              03770000
                 (COUNT - SIOP(BCOUNT))/2;   << RESET ADR W/OFFSET >>   03772000
               END;                                                     03774000
                                                                        03776000
             START'HPIB(DITP,SIOP,TRUE);                                03778000
             GOTO PRINTCONT;                                            03780000
           END;                                                         03782000
                                                                        03784000
       END;                                                             03786000
                                                                        03788000
<<---------------------------------------------------->>                03790000
<<                                                    >>                03792000
<<   FUNCTION DEPENDENCIES COMPLETION                 >>                03794000
<<                                                    >>                03796000
<<---------------------------------------------------->>                03798000
                                                                        03800000
     IF FCODE = %17 THEN   << READ STATUS COMPLETION >>                 03802000
       GOTO PRINTDONE;                                                  03804000
                                                                        03806000
     IF FCODE = %110 THEN   << IDENTIFY COMPLETION >>                   03808000
       BEGIN                                                            03810000
       TOS := BUFFADDRD;                                                03812000
       TOS := SIOP(DSTATADR);   << DEVICE ID >>                         03814000
       STOREMEMORY;                                                     03816000
       GOTO PRINTDONE;                                                  03818000
       END;                                                             03820000
                                                                        03822000
                                                                        03824000
     IOQP(QMISC).PRE'TO'POST := 0;                                      03826000
     IF <> THEN GOTO LPINIT;   << DO POST FOR PRE-TO-POST >>            03828000
     DITP(DSAVE).TOP := IOQP(QMISC).PEJECT;   << TOF FLG FOR PE >>      03830000
     GOTO PRINTDONE;     << GOT HERE - REQUEST COMPLETED >>             03832000
                                                                        03834000
                                                                        03836000
   END;                                                                 03838000
$PAGE                                                                   03840000
   ASSEMBLE(                                                            03842000
     PCAL SIODM;     << MONITOR >>                                      03844000
     PCAL LPDRVR;    << INITIATOR >>                                    03846000
     PCAL LPDRVR;    << COMPLETOR >>                                    03848000
     CON  0;         << NO IO PROCESS >>                                03850000
     PCAL LPINIT;    << INITIALIZATION >>                               03852000
     CON  1;         << ONE INTERRUPT HANDLER >>                        03854000
     PCAL GIP'HPIB); << INTERRUPT HANDLER >>                            03856000
   END.                                                                 03858000
