$CONTROL USLINIT,MAP,CODE                                               00010000
<<  HIOPPRT0, MODULE 23 - HP2680A PAGE PRINTER DRIVER SERIES 33   >>    00015000
<<  COPYRIGHT     (C) COPYRIGHT HEWLETT-PACKARD CO. 1976.,         >>   00020000
<<    THIS PROGRAM MAY BE USED WITH ONE COMPUTER SYSTEM AT A,      >>   00025000
<<    TIME AND SHALL NOT OTHERWISE BE RECORDED, TRANSMITTED OR,    >>   00030000
<<    STORED IN A RETRIEVAL SYSTEM.  COPYING OR OTHER REPRODUCTION,>>   00035000
<<    OF THIS PROGRAM EXCEPT FOR ARCHIVAL PURPOSES IS PROHIBITED,  >>   00040000
<<    WITHOUT THE PRIOR WRITTEN CONSENT OF HEWLETT-PACKARD COMPANY.>>   00045000
<<****NOTE - DOLLAR COPYRIGHT CANNOT BE USED WITH THIS MODULE ***  >>   00050000
$CONTROL PRIVILEGED,UNCALLABLE,MAIN=HIOPPRT0                            00055000
$TP                                                                     00060000
BEGIN                                                                   00065000
$PAGE                                                                   00070000
COMMENT                                                        <<02579>>00075000
            HP 3000 Page Printer Driver - HIOPPRT0                      00080000
            ---------------------------------------------               00085000
                                                                        00090000
                                                                        00095000
Operation of HIOPPRT0:                                                  00100000
                                                                        00105000
HIOPPRT0, together with the I/O  Device  Monitor  (SIODM)  constitute  a00110000
standard MPE Type 1 I/O Driver/Monitor.  This means that it does not run00115000
in its own process, but executes on any stack (including  the  Interrupt00120000
Control  Stack)  and therefore must run to completion.  During initiali-00125000
zation it executes on PROGEN's stack, during request initiation it  exe-00130000
cutes  on  ATTACHIO's (user's) stack, and during interrupt processing it00135000
executes on the Interrupt Control Stack (ICS).                          00140000
                                                                        00145000
HIOPPRT0 consists of a global area, one procedure, and an "outer  block"00150000
which is really a linkage area for INITIAL.  The global area contains an00155000
array called INITIAL which is comprised of three parts.  The first  part00160000
specifies  the  size of the other two, the unit extract instruction, and00165000
various parameters which are used by INITIAL.  This section  is  deleted00170000
after  INITIAL  is  through with it.  The other two parts are the Device00175000
Information Table (DIT) and the Channel Program area (CHANP),  which  is00180000
part  of  the  Interrupt  Linkage Table (ILT).  INITIAL will put each of00185000
these items in the area of memory where it belongs.   The  linkage  area00190000
specifies  the  procedure  labels  (P-labels)  of the associated monitor00195000
(SIODM),  the  request  initiator  (PPDRIVER),  the  request   completor00200000
(PPDRIVER), and the interrupt handler (GIP'HPIB).                       00205000
                                                                        00210000
The primary working code of HIOPPRT0 is a procedure PPDRIVER.   PPDRIVER00215000
is  called  with  six  parameters.    Two  of these parameters, BANK and00220000
BUFADR, are the absolute buffer address of the  data  to  be  processed.00225000
DRTN  is  the  hardware  address  and interrupt information area for the00230000
device.  The other three, DITP, IOQP, and CHANP are  pointers  to  three00235000
tables.    DITP  is  a  pointer  to  the  Device Information Table which00240000
contains information about its associated page printer unit.   There  is00245000
one  DIT  for  unit on the controller and they contain information which00250000
must be saved between I/O requests to the driver.  IOQP is a pointer  to00255000
the  Input/Output  Queue  element.    IOQ  elements  contain information00260000
relevent to the current request.   CHANP  is  a  pointer  to  the  first00265000
element  of  the Channel Program which is actually part of the Interrupt00270000
Linkage Table.                                                          00275000
                                                                        00280000
PPDRIVER is always called by the  I/O  device  monitor  (SIODM)  and  it00285000
determines  the  reason  for  the call by examining the IOQ and the DIT.00290000
There are three  basic  parts  of  the  driver,  the  Common  area,  the00295000
Initiator and the Completor.  The operation of each is discussed below. 00300000
                                                                        00305000
                                                                        00310000
HIOPPRT0 Commom area:                                                   00315000
                                                                        00320000
This code is at the beginning of the driver and is executed any time the00325000
driver is "called." It performs housekeeping functions (sets  up   local00330000
variables,  maps  external  function into internal functions, checks for00335000
abort or timeout conditions)  and ensures  that  certain  functions  are00340000
only accessible to the 2680 Online Diagnostic.                          00345000
                                                                        00350000
                                                                        00355000
HIOPPRT0 Initiator:                                                     00360000
                                                                        00365000
Execution begins here for either a new request or  a  retry/continuation00370000
of  the  last  request.    If the request is a new one counts and buffer00375000
offsets are initialized.  The main purpose of the Initiator is to set up00380000
the appropriate Channel program (if necessary) to perform the  requested00385000
function.                                                               00390000
                                                                        00395000
                                                                        00400000
HIOPPRT0 Completor:                                                     00405000
                                                                        00410000
The Completor section of the driver is entered either as a result of  an00415000
internal  interrupt  from  the  Channel  program or an unusual condition00420000
occurred in the Common  area  or  the  Initiator  section.   The  status00425000
condition  of  the  last Channel program execution is checked and appro-00430000
priate action is taken.  If an I/O status block was read from the  2680A00435000
then an analysis of this status is performed and appropriate actions are00440000
taken.  Finally either the request is completed and special notation  is00445000
sent  back  to the user or execution is resumed back at the Initiator to00450000
retry or complete the request.                                          00455000
                                                                        00460000
                                                               <<02656>>00465000
                                                               <<02656>>00470000
                                                               <<02656>>00475000
                                                               <<02656>>00480000
        Development and Fix History                            <<02656>>00485000
        ---------------------------                            <<02656>>00490000
                                                               <<02656>>00495000
Development Engineer: Dave Cassafer                            <<02656>>00500000
                      DAVID SM CHANG INITL MPEV PGM. 4-4-1983  <<07417>>00505000
                                                               <<06833>>00510000
8/23/83 Dave Cassafer - Removed useless fix.                   <<07417>>00515000
$PAGE                                                                   00520000
                                                                        00525000
THE FOLLOWING INFORMATION IS PERTINENT TO CONFIGURING THE               00530000
DEVICE INTO AN HP3000 COMPUTER SYSTEM.                                  00535000
                                                                        00540000
DEVICE TYPE    =32                                                      00545000
DEVICE SUBTYPE =8                                                       00550000
RECORD WIDTH   =66 WORDS                                                00555000
                                                                        00560000
                                                                        00565000
                                                                        00570000
                                                                        00575000
     SINCE THE 2680A (EPOC) IS A SPECIAL DEVICE IN MANY WAYS,           00580000
SOME OF THE FUNCTION CODES ARE ALSO SPECIAL.  THE MPE DEVELOPMENT       00585000
LAB WILL USE FUNCTION CODES 128 THROUGH 191 SOLELY FOR 2680A SPECIAL    00590000
FUNCTIONS.  THE SPOOLER PROCESS WILL START USING FUNCTION CODE 128      00595000
ON UP.  THIS DRIVER WILL USE FUNCTION CODES 191 ON DOWN.  HOPEFULLY,    00600000
63 FUNCTION CODES WILL BE SUFFICIENT FOR FUTURE GROWTH.  SEE HP         00605000
BOISE DIVISION DATA CONTROL SYSTEM (DCS) ERS DRAWING #A-2680-90002.     00610000
DRIVER REQUEST CODES ARE DEFINED AS FOLLOWS:                            00615000
                                                                        00620000
PAGE PRINTER REQUEST CODES.                                             00625000
                                                                        00630000
                                                                        00635000
                                                                        00640000
  1 - WRITE DATA                                                        00645000
      P1/P2 Parameters not used by this function.  This function        00650000
      merely writes the "count" data requested by the user to the       00655000
      HP2680A.                                                          00660000
                                                                        00665000
  2 - FILE OPEN                                                         00670000
      P1/P2 Parameters not used by this function.  This function is     00675000
      not used.  If the driver is called with this function code, it    00680000
      immediately returns a 'GOOD' completion without any communica-    00685000
      tion to the device.                                               00690000
                                                                        00695000
  3 - FILE CLOSE                                                        00700000
      P1/P2 Parameters not used by this function.  This function is     00705000
      not used.  If the driver is called with this function code, it    00710000
      immediately returns a 'GOOD' completion without any communica-    00715000
      tion to the device.                                               00720000
                                                                        00725000
  4 - DEVICE/JOB CLOSE                                                  00730000
      P1/P2 Parameters not used by this function.  The driver           00735000
      automatically will invoke a CLEAR command to the HP2680A.  This   00740000
      CLEAR will cause the HP2680A to do an JOB CLOSE CLEAR.            00745000
      The HP2680A will not respond to the driver until the currently    00750000
      printing job is completely printed.                               00755000
                                                                        00760000
 15 - (%17) READ I/O STATUS                                             00765000
      P1/P2 Parameters not used by this function.  This function reads  00770000
      16 words of I/O STATUS to the buffer provided by the caller.      00775000
                                                                        00780000
 71 - (%107) READ LAST I/O STATUS FROM THE DEVICE INFORMATION TABLE     00785000
      P1/P2 Parameters not used by this function.  This function reads  00790000
      the last I/O status that is kept in the Device Information        00795000
      Table.  This function should not be called unless there was       00800000
      an error or an unpredictable I/O status can occur.                00805000
                                                                        00810000
 72 - (%110) IDENTIFY                                                   00815000
      P1/P2 Parameters not used by this function.  This request is for  00820000
      use in identification of the device.  A two byte identification   00825000
      code will be returned to the caller.                              00830000
                                                                        00835000
 73 - (%111) INITIATE SELF TEST                                         00840000
      P1/P2 Parameters not used by this function.  This request is for  00845000
      use by ONLINE DIAGNOSTICS.  An INITIATE SELF TEST is performed.   00850000
      See Diagnostic Philosophy ERS.                                    00855000
                                                                        00860000
 74 - (%112) READ SELF TEST RESULTS                                     00865000
      P1/P2 Parameters not used by this function.  This request is for  00870000
      use by ONLINE DIAGNOSTICS.  The READ SELF TEST RESULTS is         00875000
      performed.  The read is for a 1 word result.  The word has bit    00880000
      settings which indicate the state of the HP2680A Processors       00885000
      in a go or no-go fashion.  See DIAGNOSTIC PHILOSOPHY ERS.         00890000
                                                                        00895000
 75 - (%113) WRITE LOOPBACK BUFFER                                      00900000
      P1/P2 Parameters not used by this function.  This request is for  00905000
      use by ONLINE DIAGNOSTICS.  The WRITE LOOPBACK BUFFER is          00910000
      performed.  The HP2680A accepts 16 words of loopback data.        00915000
      See DIAGNOSTIC PHILOSOPHY ERS.                                    00920000
                                                                        00925000
 76 - (%114) READ LOOPBACK BUFFER                                       00930000
      P1/P2 Parameters not used by this function.  This request is for  00935000
      use by ONLINE DIAGNOSTICS.  The READ LOOPBACK BUFFER is           00940000
      performed.  The HP2680A returns 16 words of data that was         00945000
      sent with the WRITE LOOPBACK BUFFER command.  See DIAGNOSTIC      00950000
      PHILOSOPHY ERS.                                                   00955000
                                                                        00960000
189 - (%275) DEVICE CLEAR COMMAND                                       00965000
      P1/P2 Parameters not used by this function.  The driver           00970000
      automatically will invoke a CLEAR command to the HP2680A.  This   00975000
      CLEAR will cause the HP2680A to do an JOB ABORT CLEAR.            00980000
      The HP2680A will terminate the current job without printing any   00985000
      pages that might be in the printers memory.                       00990000
                                                                        00995000
190 - (%276) WRITE RECOVERY BLOCK                                       01000000
      P1/P2 Parameters not used by this function.  The SPOOLER writes   01005000
      16 words of data to the HP2680A which is necessary for data       01010000
      recovery from an abnormal condition.                              01015000
                                                                        01020000
191 - (%277) READ ENVIRONMENTAL STATUS BLOCK                            01025000
      P1/P2 Parameters not used by this function.  The SPOOLER or       01030000
      ONLINE DIAGNOSTIC may read the 16 word status block which         01035000
      describes the current environment of the HP2680A as detailed in   01040000
      the Data Control System ERS.                                      01045000
                                                                        01050000
                                                                        01055000
$PAGE                                                                   01060000
STATUS  RETURNS -                                                       01065000
                                                                        01070000
PENDING (WAITING).                                                      01075000
 % 10  - WAITING FOR COMPLETION INTERRUPT.                              01080000
   20  - OFFLINE.                                                       01085000
   30  - LAST TRANSACTION TIMED OUT.                                    01090000
                                                                        01095000
SUCCESSFUL (COMPLETION).                                                01100000
   01  - NORMAL COMPLETION.                                             01105000
                                                                        01110000
UNUSUAL COMPLETION (DATA MAY NOT TRANSFERRED TO DEVICE).                01115000
 % 13  - I/O STATUS IS AVAILABLE FOR THE SPOOLING PROCESS.              01120000
   23  - I/O STATUS IS AVAILABLE FOR THE SPOOLING PROCESS AND           01125000
         A RETRANSMISSION OF THE LAST REQUEST IS NECESSARY.             01130000
   33  - REQUEST ABORTED EXTERNALLY.                                    01135000
   63  - SYSTEM POWER FAIL.(BUT NOT NECESSARILY 2680A PFAIL!)           01140000
  213  - 2680A POWER ON.                                                01145000
                                                                        01150000
IRRECOVERABLE (CATASTROPHIC TERMINATION).                               01155000
 % 04  - INVALID REQUEST, FUNCTION OR PARAMETER.                        01160000
   14  - TRANSFER ERROR.                                                01165000
   24  - I/O TIMED OUT BEFORE COMPLETION.                               01170000
   44  - SIO FAILURE.                                                   01175000
   54  - 2680A UNIT FAILURE.                                            01180000
  124  - NO MESSAGE LINK BUFFERS AVAILABLE.                             01185000
  144  - NO RESPONSE FROM CONTROLLER INTERFACE..WE ARE DEAD.            01190000
  214  - PARITY ERROR DETECTED ON PHI COMMAND.                          01195000
                                                                        01200000
$PAGE                                                                   01205000
                                                                        01210000
                     Device Reference Table (DRT)                       01215000
                     ----------------------------                       01220000
                                                                        01225000
                                                                        01230000
There is one DRT for each device controller configured on the system.   01235000
                                                                        01240000
     0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   MNEMONIC          01245000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    01250000
  0|      Channel Program Pointer  (SIOP)          |   DRT0             01255000
   +-----------------------------------------------+                    01260000
  1|  Channel Program Variable Area pointer (CPVA) |   DRT1             01265000
   +-----------------------------------------------+                    01270000
  2|      Interrupt Handler Program Label          |   DRT2             01275000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    01280000
  3|ST|SH|PF|      ( status )          |WS|GF|DT|WT|   DRT3             01285000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    01290000
                                                                        01295000
 Channel Program Status:                                                01300000
                                                                        01305000
   Bit 0  - ST, Channel Program Status. 0 - halted,1 - running <<02579>>01310000
       1  - SH, SIOP or HIOP instruction pending                        01315000
       2  - PF, Power Fail recovery in progress                         01320000
      12  - WS, Waiting for device status request                       01325000
      13  - GF, GIC FIFO buffer not empty                               01330000
      14  - DT, DMA transfer active                                     01335000
      15  - WT, Channel Program in Wait state                           01340000
                                                                        01345000
$PAGE                                                                   01350000
                                                                        01355000
                Interrupt Linkage Table (ILT)                           01360000
                -----------------------------                           01365000
                                                                        01370000
                                                                        01375000
There is one ILT for each device controller configured on the system.   01380000
                                                                        01385000
     0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15   MNEMONIC          01390000
   +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                    01395000
  0|         Channel                               |   ICPVA0           01400000
  1|              Program                          |   ICPVA1           01405000
  2|                  Variable                     |   ICPVA2           01410000
  3|                       Area (CPVA)             |   ICPVA3           01415000
   +-----------------------------------------------+                    01420000
  4|         DMA Abort                             |   ICPVA4           01425000
  5|              Address                          |   ICPVA5           01430000
   +-----------------------------------------------+                    01435000
  6|                      0                        |   ISRQL            01440000
   +--+-----------------+-----+-----------+--------+                    01445000
  7|LI|     CHANQUE     |     |   CHAN    |  DEV   |   ICNTRL           01450000
   +--+-----------------+-----+-----------+--------+                    01455000
%10| SYSDB relative pointer to Channel Program area|   ISIOP            01460000
   +-----------------------------------------------+                    01465000
%11| SYSDB relative pointer to Status Return area. |   ISTAP            01470000
   |  Always 0 for the HP2680A Page Printer.       |                    01475000
   |     Note: I/O Status is read into the DIT.    |                    01480000
   +-----------------------------------------------+                    01485000
%12| single instruction that is executed to extract|   IUNIT            01490000
   | the device unit number from the status pointed|                    01495000
   | to by ISTAP.  Always 0 for HP2680A.           |                    01500000
   +-----------------------------------------------+                    01505000
%13| SYSDB relative DIT pointer of the device      |   ICDP             01510000
   | currently using the channel to perform a      |                    01515000
   | data operation.                               |                    01520000
   +-----------------------+-----------------------+                    01525000
%14|       SIOPSIZE        |        CQUEN          |   IQUEUE           01530000
   +--+--+--+--------------+-----------+-----------+                    01535000
%15|RW|WP|IG|                          |  HCUNIT   |   IFLAG            01540000
   +--+--+--+--------------------------+-----------+                    01545000
%16| SYSDB relative DIT pointer                    |   IDITP0           01550000
   +-----------------------------------------------+                    01555000
%17|             Page Printer                      |                    01560000
   .               Channel                         .                    01565000
   |                 Program                       |                    01570000
   +-----------------------------------------------+                    01575000
                                                                        01580000
$PAGE                                                                   01585000
ICPVA0 - Channel Program Variable Area                                  01590000
                                                                        01595000
                                                                        01600000
  THE CHANNEL PROGRAM VARIABLE AREA (CPVA) IS MODIFIED BY               01605000
  THIS CHANNEL PROGRAM IN THE FOLLOWING WAYS:                           01610000
                                                                        01615000
  CPVA0 =    RESERVED FOR CHANNEL HARDWARE STATUS.  NOT USED            01620000
             BY THE CHANNEL PROGRAM (BELOW) FOR ANY REASON!             01625000
                                                                        01630000
  CPVA1 =  0 DEFAULT PRE-RUN STATE SET UP BY DRIVER.                    01635000
           1 TRANSMISSION COMPLETED SUCCESSFULLY.                       01640000
           2 I/O STATUS READ BEFORE MAIN TRANSFER DONE.                 01645000
           3 I/O STATUS READ AFTER MAIN TRANSFER DONE.                  01650000
                                                                        01655000
  CPVA2 =  0 DEFAULT PRE-RUN STATE SET UP BY DRIVER.                    01660000
             CURRENTLY NOT USED.                                        01665000
                                                                        01670000
  CPVA3 =  0 DEFAULT PRE-RUN STATE SET UP BY DRIVER.                    01675000
             CURRENTLY NOT USED.                                        01680000
                                                                        01685000
                                                                        01690000
  CPVA4/5  - DMA ABORT ADDRESS.                                         01695000
                                                                        01700000
             IF A DMA ABORT OCCURS, THE ABSOLUTE ADDRESS WHERE THE      01705000
             ABORT OCCURRED IS STORED IN THIS AREA.                     01710000
                                                                        01715000
                                                                        01720000
ICNTRL - CONTAINS CONTROLLER INFORMATION                                01725000
                                                                        01730000
  LI      - IF THIS BIT IS SET, THE CONTROLLER IS SHARING A SOFTWARE    01735000
            CHANNEL RESOURCE IN ORDER TO LIMIT BANDWIDTH.               01740000
  CHANQUE - THE SOFTWARE CHANNEL RESOURCE NUMBER.                       01745000
  CHAN    - CHANNEL NUMBER (FOUR MOST SIGNIFICANT BITS OF DRTN).        01750000
  DEV     - DEVICE NUMBER (THREE LEAST SIGNIFICANT BITS OF DRTN).       01755000
                                                                        01760000
                                                                        01765000
IQUEUE - RESOURCE QUEUING INFORMATION.                                  01770000
                                                                        01775000
  SIOPSIZE - (NUMBER OF WORDS + 1)/2 IN THE CHANNEL PROGRAM AREA.       01780000
  CQUEN    - FOR A MULTI-UNIT CONTROLLER THIS FIELD CONTAINS THE        01785000
             SOFTWARE CONTROLLER RESOURCE NUMBER.                       01790000
                                                                        01795000
                                                                        01800000
IFLAG - CONTROLLER AND CHANNEL PROGRAM STATE FLAGS                      01805000
                                                                        01810000
  RW (RUNWAIT)  - AN IDLE CHANNEL PROGRAM SHOULD BE STARTED WHEN THERE  01815000
                  ARE NO ACTIVE REQUESTS TO PROCESS.                    01820000
  WP (WAITPROG) - AN IDLE CHANNEL PROGRAM HAS BEEN STARTED FOR THIS     01825000
                  CONTROLLER.  THIS BIT IS RESET BY AN INTERRUPT.       01830000
  IG (IGNOREHI) - AN HIOP INSTRUCTION HAS BEEN ISSUED AGAINST THIS	     01835000
                  CONTROLLER BUT THE CHANNEL PROGRAM WAS NOT IN A WAIT  01840000
                  STATEMENT.  THEREFORE IGNORE THE INTERRUPT GENERATED  01845000
                  BY THE CHANNEL CODE WHEN THIS PROGRAM HALTS.          01850000
  HCUNIT        - HIGHEST CONFIGURED UNIT NUMBER FOR THIS CONTROLLER.   01855000
                                                                        01860000
$PAGE                                                                   01865000
                                                                        01870000
                                                                        01875000
    2680A DIT -                                                         01880000
                                                                        01885000
          0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15               01890000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              01895000
   DIT0  !0 !0 !AC!RQ!0 !0 !SP!CP!IA!NR!SW!  !   STATE   !  DFLAG       01900000
         -------------------------------------------------              01905000
      1  !           POINTER TO NEXT DIT                 !  DLINK       01910000
         -------------------------------------------------              01915000
      2  !        POINTER TO ACTIVE IOQ OR ZERO          !  DIOQP       01920000
         -------------------------------------------------              01925000
      3  |          LOGICAL DEVICE NUMBER                |DLDEV<<07417>>01930000
         -------------------------------------------------              01935000
      4  !      DRIVER LINKAGE TABLE POINTER             !  DDLTP       01940000
         -------------------------------------------------              01945000
      5  !      INTERRUPT LINKAGE TABLE POINTER          !  DILTP       01950000
         -------------------------------------------------              01955000
      6  !     SPECIAL ERROR CONDITIONS TO BE LOGGED     !  DSTAT       01960000
         -------------------------------------------------              01965000
      7  !          ERROR LOGGING INFORMATION            !  DSERR       01970000
         -------------------------------------------------              01975000
      8  !T !    TIMEOUT INDICATION IN BIT 0             !  DTIME       01980000
         -------------------------------------------------              01985000
      9  !       TIMER REQUEST INDEX (TRL) OR ZERO       !  DTRLX       01990000
         -------------------------------------------------              01995000
      10 |IOT|        UNIT NUMBER                        |DUNIT<<07417>>02000000
         -------------------------------------------------     <<07417>>02005000
      11 !          CURRENT DATA WRITE BYTE COUNT        !DCB- <<07417>>02010000
         +-----------------------------------------------+-CNT <<07417>>02015000
      12 !            CURRENT DATA WORD COUNT            !DCW- <<07417>>02020000
         +-----------------------------------------------+-CNT <<07417>>02025000
      13 !        # OF WORDS LEFT TO TRANSFER            !DRC- <<07417>>02030000
         +-----------------------------------------------+-NT  <<07417>>02035000
      14 !  BUFFER OFFSET FOR NEXT # OF WORDS TO XFER.   !DOF- <<07417>>02040000
         +-----------------------------------------------+-FSET<<07417>>02045000
      15 !                                             !D!DDE- <<07417>>02050000
         +-----------------------------------------------+-BUG <<07417>>02055000
      16 ! I/O STATUS BLOCK WORD 1 GETS LOGGED FROM HERE !DLOGB<<07417>>02060000
         +-----------------------------------------------+UFFER<<07417>>02065000
      17 ! I/O STATUS BLOCK WORD 3 GETS LOGGED FROM HERE !     <<07417>>02070000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02075000
      18 ! I/O STATUS AREA (16 WORDS, SEE DEFINITION)    !DIO- <<07417>>02080000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-STAT<<07417>>02085000
                                                                        02090000
   DFLAG - DEVICE RELATIVE FLAGS.                                       02095000
         AC         ACTIVE BIT. 1 IMPLIES A MONITOR CURRENTLY           02100000
                    SERVICING THIS DEVICE.                              02105000
         RQ         REQUEST BIT. 1 IMPLIES SERVICE REQUESTED            02110000
                    WHILE MONITOR IS ACTIVE.                            02115000
         SP         SIO PREEMPTION. IF SET THEN A PREEMPTIVE            02120000
                    REQUEST HAS BEEN QUEUED FOR THIS DEVICE.            02125000
                    PREEMPT CODE IS SET IN IOQ ELEMENT.                 02130000
         CP         CHANNEL PROGRAM IN PROGRESS. IF SET, THEN           02135000
                    A CHANNEL PROGRAM IS CURRENTLY EXECUTING.           02140000
         IA         IF SET, AN INTERRUPT OR RESPONSE HAS OCCURED.       02145000
         NR         IF SET, DEVICE IS IN A NOT READY OR OPERATOR WAIT.  02150000
         SW         IF SET, AN IDLE CHANNEL PROGRAM SHOULD BE STARTED   02155000
                    FOR THIS DEVICE.                                    02160000
$PAGE                                                                   02165000
         MSTATE     CURRENT DRIVER STATE AS DEFINED BY THE MONITOR.     02170000
                    ALLOWABLE STATES ARE:                               02175000
                    0  - START REQUEST                                  02180000
                    1  - NOT USED(BUT RESERVED)                         02185000
                    2  - CALL DRIVER INITIATOR                          02190000
                    3  - CALL DRIVER COMPLETOR                          02195000
                    4  - UNUSED(BUT RESERVED)                           02200000
                    5  - COMPLETE REQUEST..PERHAPS RETURN TO USER.      02205000
                    6  - UNEXPECTED INTERRUPT OCCURRED.                 02210000
                    7  - START OPERATOR INTERVENTION WAIT.              02215000
                  %10  - WAITING (ON OPERATOR). RESTART AT 0.           02220000
                   11  - WAITING (DATA MAKEPRESENT/FREEZING)            02225000
                   12  - WAITING (INITIATOR CODE MAKEPRESENT/FREEZE)    02230000
                   13  - WAITING (FOR COMPLETION INTERRUPT)             02235000
                   14  - WAITING (FOR DEVICE CONTROLLER AVAILABILITY)   02240000
                   15  - UNUSED(BUT RESERVED)                           02245000
                   16  - WAITING (INITIATOR CODE MAKEPRESENT)           02250000
                   17  - WAITING (COMPLETOR CODE MAKEPRESENT)           02255000
                                                                        02260000
   DLDEV - I/O SYSTEM TYPE, UNIT AND LOGICAL DEVICE NUMBER.             02265000
         IOT        I/O SYSTEM TYPE.                                    02270000
                    0 - HP3000 SERIES II/III (SIO/DIO)                  02275000
                    1 - HP-IB                                           02280000
                    2 - RESERVED                                        02285000
                    3 - RESERVED                                        02290000
                                                                        02295000
   DCBCNT - CURRENT BYTE COUNT TO BE TRANSFERRED.                       02300000
                                                                        02305000
   DCWCNT - CURRENT WORD COUNT TO BE TRANSFERRED.                       02310000
                                                                        02315000
   DRCNT  - REMAINING WORD COUNT TO TRANSFER.                           02320000
                                                                        02325000
   DOFFSET - OFFSET IN BUFFER OF NEXT # WORDS TO TRANSFER.              02330000
                                                                        02335000
   DDEBUG - IF BIT 15=1 THEN DEBUGGING INFO WILL BE SENT TO CONSOLE     02340000
                                                                        02345000
   DLOGBUFFER - STATUS WORDS 1 & 3 ARE MOVED HERE TO BE LOGGED          02350000
                IF THEY WERE LOGGED FROM THE I/O STATUS BLOCK           02355000
                THEIR CONTENTS MIGHT BE CHANGED BEFORE THEY             02360000
                WERE LOGGED.                                            02365000
                                                                        02370000
   DIOSTAT - I/O STATUS AREA 16 WORDS, SEE I/O STATUS BLOCK DEFINITION. 02375000
                                                                        02380000
$PAGE                                                                   02385000
                                                                        02390000
     THE DRIVER IS CONCERNED WITH THE I/O STATUS BLOCK.  THE            02395000
I/O STATUS BLOCK CONTAINS INFO ABOUT THE ACTUAL 2680 HARDWARE           02400000
AND ITS CURRENT STATE.  THE DRIVER READS I/O STATUS INTO THE            02405000
DIT STATUS AREA POINTED TO BY DIT(DIOSTAT) POINTER.  THE FORMAT         02410000
OF THE BLOCK IS SHOWN BELOW.  IT IS READ BY THE CHANNEL PROGRAM         02415000
WITH AN ADDRESS MODIFIER SET TO 1.  IF ANY BIT IN THE I/O               02420000
STATUS WORD CHANGES STATE, THE DEVICE WILL ASSERT PARALLEL POLL         02425000
AND RESPOND TO THE NEXT DSJ WITH A 1.  EACH WORD AND BIT IN             02430000
THE TABLE IS DEFINED AS FOLLOWS:                                        02435000
                                                                        02440000
                                                                        02445000
                                                                        02450000
                                                                        02455000
I/O STATUS BLOCK                                                        02460000
                                                                        02465000
          0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15               02470000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02475000
      0  !0 !--THE "OR" OF WORDS 1/15 IS LOCATED HERE----! DIT1<<07417>>02480000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02485000
      1  !OF!MS!PW!PE!TE!  !  !  !  !  !  !  !  !  !  !  !    1<<07417>>02490000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02495000
      2  !  !  !  !  !  !  (RESERVED)  !  !  !  !  !  !  !    2<<07417>>02500000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02505000
      3  !              MCS FAULT NUMBER                 !    2<<07417>>02510000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02515000
      4  !CL!FL!VL!CU!FU!VU!IL!IP!ST!SB!IR!MP!NJ!NM!NL!NC!    2<<07417>>02520000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02525000
      5  !LP!PF!NC!  !  !  !  !  !  !  !  !  !  !  !  !  !    2<<07417>>02530000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02535000
      6  !  !  !  !  !  !  (RESERVED)  !  !  !  !  !  !  !    2<<07417>>02540000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02545000
      7  !  !  !  !  !  !  (RESERVED)  !  !  !  !  !  !  !    2<<07417>>02550000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02555000
      8  !  !  !  !  !  !  (RESERVED)  !  !  !  !  !  !  !    2<<07417>>02560000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02565000
      9  !  !  !  !  !  !  (RESERVED)  !  !  !  !  !  !  !    2<<07417>>02570000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02575000
      10 !  !  !  !  !  !  (RESERVED)  !  !  !  !  !  !  !    2<<07417>>02580000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02585000
      11 !  !  !  !  !  !  (RESERVED)  !  !  !  !  !  !  !    2<<07417>>02590000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02595000
      12 !          RECORD NUMBER OF ERROR               !    3<<07417>>02600000
         +--             IF WORD 4 IS                  --+              02605000
      13 !                NON-ZERO                       !    3<<07417>>02610000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02615000
      14 !  SHEET NUMBER OF ERROR IF WORD 4 IS NON-ZERO  !    3<<07417>>02620000
         +--                   OR                      --+              02625000
      15 !  LAST SHEET TRANSFERRED IF "JOB" & POWER-ON   !    3<<07417>>02630000
         +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+              02635000
$PAGE                                                                   02640000
WORD 0 - EACH BIT IS THE 'OR' OF ONE WORD IN THE TABLE (EXCEPT          02645000
         BIT 0 WHICH IS NOT USED).  THEREFORE, BIT .(1:1) IS SET        02650000
         IF WORD 1 IN THE TABLE IS NON-ZERO.                            02655000
                                                                        02660000
WORD 1 - BIT= 0 - (OF)  ONLINE/OFFLINE BIT.                             02665000
              1 - (MS)  MESSAGE BEING DISPLAYED ON THE 2680A CONSOLE.   02670000
              2 - (PW)  POWER UP COMPLETED SINCE LAST I/O STATUS READ.  02675000
              3 - (PE)  PARITY ERROR DETECTED ON PHI COMMAND.           02680000
              4 - (TE)  TRANSMISSION ERROR DETECTED IN THE PRINTER.     02685000
           5/15 -       RESERVED.  UNUSED.                              02690000
                                                                        02695000
WORD 2 - NOT USED. RESERVED.                                            02700000
                                                                        02705000
WORD 3 - MCS FAULT NUMBER.  CONTAINS AN INTEGER DESCRIBING THE LAST     02710000
         FAULT TO OCCUR SINCE THE LAST TIME THE I/O STATUS WAS READ     02715000
         OR THE HP2680A WAS POWERED DOWN.  IF THE WORD IS ZERO THERE    02720000
         IS NO MCS FAULT. SEE DCS ERS FOR A DESCRIPTION OF THE MCS      02725000
         FAULT NUMBERS.                                                 02730000
                                                                        02735000
WORD 4 - BIT= 0 - (CL)  NO ROOM FOR ATTEMPTED CHARACTER SET LOAD.       02740000
              1 - (FL)  NO ROOM FOR ATTEMPTED FORM LOAD.                02745000
              2 - (VL)  NO ROOM FOR ATTEMPTED VFC LOAD.                 02750000
              3 - (CU)  ATTEMPT TO PRINT DATA AND THERE IS NO CURRENTLY 02755000
                  SELECTED CHARACTER SET.                               02760000
              4 - (FU)  ATTEMPT TO SELECT AN UNDEFINED FORM SET.        02765000
              5 - (VU)  ATTEMPT TO PRINT DATA AND THERE IS NO CURRENTLY 02770000
                  SELECTED VFC SET.                                     02775000
              6 - (IL)  ATTEMPT TO PRINT DATA AND THERE IS NO CURRENTLY 02780000
                  SELECTED LOGICAL PAGE TABLE (LPT) ENTRY.              02785000
              7 - (IP)  ATTEMPT TO MOVE PEN OFF THE LOGICAL PAGE.       02790000
              8 - (ST)  THE 2680A COULD NOT PROCESS ALL OF THE DATA     02795000
                  BEFORE IT WAS SUPPOSED TO BE TRANSFERRED TO THE       02800000
                  DRUM/PAPER.  DATA WAS LOST!                           02805000
              9 - (SB)  SPOOLER BLOCK CONTAINS FORMAT ERROR.            02810000
             10 - (IR)  INVALID RECOVERY BLOCK RECEIVED FROM SPOOLER.   02815000
             11 - (MP)  MAXIMUM NUMBER OF COPIES PER PHYSICAL PAGE      02820000
                  HAS BEEN EXCEEDED.  THIS IS A RESULT OF THE           02825000
                  SPOOLER PROCESS SETTING THE MAXIMUM COPIES PER        02830000
                  PAGE WITH FUNCTION CODE 132.                          02835000
             12 - (NJ)  A COMMAND OR FUNCTION CODE WAS RECEIVED WHEN NO 02840000
                  "JOB" WAS IN PROGRESS.  THE COMMAND OR FUNCTION WAS   02845000
                  IGNORED BY THE DCS.                                   02850000
             13 - (NM)  NO MEMORY.  2680A DYNAMIC MEMORY ALLOCATION HAS 02855000
                  DETECED THAT MAIN MEMORY IS COMPLETELY OCCUPIED WITH  02860000
                  CHARACTER SETS, VFC'S, FORMS AND DATA SUCH THAT THE   02865000
                  2680A CANNOT PROCESS THE CURRENT INPUT DATA.  DATA    02870000
                  WILL BE LOST!                                         02875000
             14 - (NL)  A VFC IS SELECTED BY A LPT ENTRY WHICH HAS WORD 02880000
                  10 (LINE SPACING ON PAGE) LESS THAN OR EQUAL TO ZERO. 02885000
                  ENTRIES SELECTED.                                     02890000
             15 - (NC)  A NON-EXISTENT VFC CHANNEL WAS SKIPPED TO.      02895000
$PAGE                                                                   02900000
WORD 5 - BIT= 0 - (LP)  LOGICAL PAGE TRUNCATED TO FIT PHYSICAL PAGE.    02905000
              1 - (PF)  PAGE SIZE REQUIRED BY PROGRAMMER DID NOT        02910000
                  MATCH PAGE SIZE SET BY OPERATOR.  OPERATOR PAGE       02915000
                  SIZE PREVAILS.                                        02920000
              2 - (NC)  NO CHARACTER SET SELECTED.                      02925000
                                                                        02930000
WORDS 6/11        NOT USED BUT RESERVED FOR FUTURE USE.                 02935000
                                                                        02940000
WORDS 12/13 - THE RECORD NUMBER WHICH CONTAINS THE OFFENDING ERROR      02945000
             AS DEFINED BY WORD FOUR.  IF A POWER FAIL OCCURS DURING    02950000
             A "JOB", THE POWER FAIL BIT IS SET AND A SHEET NUMBER IS   02955000
             MADE AVAILABLE IN WORDS FOURTEEN AND FIFTEEN.  HOWEVER,    02960000
             THE RECORD NUMBER IS LOST AND CANNOT BE REPORTED.  THESE   02965000
             WORDS OCCUR IN A "JOB" ONLY.                               02970000
                                                                        02975000
WORDS 14/15 - THE SHEET NUMBER ON WHICH THE ERROR OCCURED AS DEFINED    02980000
             BY WORD FOUR.  IF AN ERROR OCCURS IN THE ENVIRONMENT FILE  02985000
             AT THE START OF A "JOB", THEN THIS NUMBER WILL BE ZERO.    02990000
             IN ADDITION, WHEN A POWER FAIL OCCURS DURING A "JOB",      02995000
             THE POWER ON BIT IS SET IN WORD ONE AND THE SHEET          03000000
             NUMBER OF THE LAST SUCCESSFULLY TRANSFERRED PAGE IS        03005000
             PLACED HERE.  THIS INFORMATION IS FOR USE BY THE           03010000
             SPOOLER SHOULD A RECOVERY OF A "JOB" BE DETERMINED.        03015000
             THESE WORDS OCCUR IN "JOB" ONLY.                           03020000
                                                                        03025000
                                                                        03030000
                                                                        03035000
     ALL WORDS OF THE I/O STATUS ARE CLEARED WHENEVER THE STATUS BLOCK  03040000
IS RETURNED TO THE HOST.  IT IS UP TO THE HOST CPU TO RETAIN ANY ON-    03045000
GOING STATUS BITS REQUIRED.                                             03050000
                                                                        03055000
$PAGE                                                                   03060000
                                                                        03065000
    2680A IOQ -                                                         03070000
                                                                        03075000
                                                                        03080000
          0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15               03085000
         +--+--------+--------+--------+--------+--------+              03090000
   IOQ0  !AB!  !DI!SB!WA!BL!C !FR!  !PR!SF!PF!PRMPT!  !MD!  QFLAG       03095000
         -------------------------------------------------              03100000
   IOQ1  !       IOQ POINTER TO NEXT NEW REQUEST         !  QLINK       03105000
         -------------------------------------------------              03110000
   IOQ2  !                       ! LOGICAL DEVICE NUMBER !  QLDEV       03115000
         -------------------------------------------------              03120000
   IOQ3  !          MISCELLANEOUS PARAMETER              !  QMISC       03125000
         -------------------------------------------------              03130000
   IOQ4  !                  DST NUMBER                   !  QDSTN       03135000
         -------------------------------------------------              03140000
   IOQ5  !        TARGET DATA BUFFER ADDRESS             !  QADDR       03145000
         -------------------------------------------------              03150000
   IOQ6  !                       !     FUNCTION CODE     !  QFUNC       03155000
         -------------------------------------------------              03160000
   IOQ7  !      WORD (+) OR BYTE (-) COUNT               !  QWBCT       03165000
         -------------------------------------------------              03170000
   I0Q8  !              PARAMETER 1                      !  QPAR1       03175000
         -------------------------------------------------              03180000
   I0Q9  !              PARAMETER 2                      !  QPAR2       03185000
         -------------------------------------------------              03190000
   IOQ10 !     PCB NUMBER        !   QUALIFIER  !RSTATUS !  QSTAT       03195000
         -------------------------------------------------              03200000
                                                                        03205000
   QFLAG -                                                              03210000
          AB         REQUEST ABORTED EXTERNALLY.                        03215000
          DI         DIAGNOSTIC FUNCTION REQUESTED.                     03220000
          SB         REQUEST IS USING SYSTEM BUFFERS.                   03225000
          WA         WAKE CALLER ON COMPLETION OF REQUEST.              03230000
          BL         BLOCKED IO. CALLER IS WAITING COMPLETION.          03235000
          C          REQUEST HAS BEEN COMPLETED & USER AWAKENED.        03240000
          FR         DATA SEG. IS PRESENT IN CORE AND FROZEN.           03245000
          PR         THIS REQUEST STARTED-BUT PREEMPTED BY MAM.         03250000
                     (NOT A POSSIBLE SEQUENCE OF EVENTS IN EPOC).       03255000
          SF         START IO FAILURE IN GIP.                           03260000
          PF         THE IO IS BEING ABORTED DUE TO POWER FAIL.         03265000
          PRMPT      (NOT USED IN EPOC DRIVER AT PRESENT)               03270000
          MD         A MESSAGE REQUEST REPLY HAS COMPLETED.             03275000
                     (NOT USED IN EPOC DRIVER AT PRESENT)               03280000
                                                                        03285000
$PAGE                                                                   03290000
   QMISC -                                                              03295000
                                                                        03300000
          0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15               03305000
         +--+--+--+-----+--+--+--+--+--------+--------+--+              03310000
   IOQ3  !MB!RB!AB!IO!TO!           !  XFER  ! PARITY !  !  QMISC       03315000
         +--+--+--+-----+--+--+--+--+--------+--------+--+              03320000
                                                                        03325000
   WHERE:                                                               03330000
                                                                        03335000
     .(0:1) - MB         USER REQUESTED TRANSFER IN EXCESS OF 4096      03340000
                         WORDS.  THE DRIVER CAN WRITE UP TO 4096 WORDS  03345000
                         TO THE 2680A.  IN ORDER TO HANDLE UP TO 32K    03350000
                         WORDS, MULTIPLE WRITES ARE USED WITHOUT A      03355000
                         RETURN TO THE USER WHO CALLED THE DRIVER.      03360000
                         THIS BIT INDICATES THAT MULTIPLE WRITES ARE    03365000
                         BEING DONE TO THE 2680A.                       03370000
                                                                        03375000
     .(1:1) - RB         THE CURRENT WRITE BLOCK MUST BE RETRIED.       03380000
                                                                        03385000
     .(2:1) - AB         USER REQUESTED ABORT IN PROGRESS FLAG.         03390000
                                                                        03395000
     .(3:1) - IO         I/O STATUS HAS BEEN READ AND IS AVAILABLE.     03400000
                                                                        03405000
     .(4:1) - TO         GENERAL I/O CONTROLLER TIMED OUT.              03410000
                                                                        03415000
     .(5:4) - RESERVED   NOT CURRENTLY USED.                            03420000
                                                                        03425000
     .(9:3) - XFER       2680A TRANSFER ERROR COUNTER.                  03430000
                                                                        03435000
     .(12:3)- PARITY     CHANNEL PROGRAM COMMAND PARITY ERROR COUNTER.  03440000
                                                                        03445000
     .(15:1)- RESERVED   NOT CURRENTLY USED.                            03450000
                                                                        03455000
      **NOTE**  IN THE ABOVE, SINGLE BIT FIELDS ARE AS DEFINED          03460000
                WHEN THE BIT IS A LOGIC "1".                            03465000
$PAGE                                                                   03470000
                                                                        03475000
Special situations.                                                     03480000
                                                                        03485000
    A job can be disrupted by either a paper jam or power failure.      03490000
Generally a paper jam is detected immediately before any data is        03495000
lost.  The operator straightens the paper path and hits run.  The       03500000
printer will restart with the proper page.  To facilitate recovery      03505000
after a power failure the sheet number of each page is recorded in      03510000
non-volatile memory after it is transferred to paper.  The host can     03515000
interrogate this value by reading the Environmental status block at     03520000
any time.  The printer can be instructed to start printing any job      03525000
on a specified sheet, thus allowing a disrupted job to be resumed on    03530000
the proper page.  The following sections detail the recovery mechanisms.03535000
                                                                        03540000
$PAGE                                                                   03545000
Power Fail Recovery.                                                    03550000
                                                                        03555000
    If a power failure occurs the printer can restart the job on the    03560000
page of the failure.  This is accomplished by retransmitting the job    03565000
from the beginning and the printer will "silent run" until the proper   03570000
page is found and then resume printing.  The protocol is:               03575000
                                                                        03580000
                                                                        03585000
    1.  Power failure occurs on the 2680A.                              03590000
                                                                        03595000
    2.  Power resumes, the printer asserts parallel poll and the DSJ    03600000
        response indicates that an I/O status block is pending.         03605000
                                                                        03610000
    3.  The host reads the I/O status block and see's the power on      03615000
        completed bit.                                                  03620000
                                                                        03625000
    4.  If the host wishes to restart a job after power resumes it      03630000
        reads the Environmental status block to determine the page      03635000
        number of the last page completely transferred to paper before  03640000
        power failed.  The host then adds 1 to the sheet number and     03645000
        sends the correct Recovery block to the printer.                03650000
                                                                        03655000
    5.  The host the retransmits the job from the start, beginning      03660000
        with the Job Open.                                              03665000
                                                                        03670000
    6.  The printer will resume printing with the sheet number          03675000
        specified in the Recovery block which preceeded the Job         03680000
        Open.                                                           03685000
                                                                        03690000
$PAGE                                                                   03695000
Paper Jams.                                                             03700000
                                                                        03705000
    Generally a paper jam is detected before any pages of print are     03710000
damaged.  In these cases the operator straightens the paper and presses 03715000
run.  The printer will restart at the correct page.  No host computer   03720000
interaction is required.  If the paper jam occurred in the output area  03725000
of the printer and several pages of print are damaged the operator may  03730000
elect to reprint several pages.  This requires host system interaction. 03735000
The steps are:                                                          03740000
                                                                        03745000
                                                                        03750000
    1.  A paper jam occurs.  The printer goes into Stop mode.           03755000
                                                                        03760000
    2.  The operator clears the paper path and decides to back up       03765000
        several pages.                                                  03770000
                                                                        03775000
    3.  The operator aborts the current job from the system console     03780000
        and instructs the spooling system to back up "n" pages.         03785000
                                                                        03790000
    4.  The spooling system then reads the Environmental status block   03795000
        and computes which page to restart on.  It then sends a         03800000
        Recovery block and retransmits the job.                         03805000
                                                                        03810000
    5.  The printer will resume printing on the correct page.           03815000
                                                                        03820000
$PAGE                                                          <<02579>>03825000
                                                               <<02579>>03830000
*********** How to Interpret Error Logging ***********         <<02579>>03835000
                                                               <<02579>>03840000
There are four conditions which cause the Driver to invoke     <<02579>>03845000
error logging.  These are the causes and what will be logged   <<02579>>03850000
in each case:                                                  <<02579>>03855000
1.  Parity Error -    1 word will be logged and its value      <<02579>>03860000
                      will be %177777.                         <<02579>>03865000
2.  Channel Failure - 1 word will be logged and its value      <<02579>>03870000
                      will be the contents of CPVA0.           <<02579>>03875000
                      (The contents of CPVA0 cannot be         <<02579>>03880000
                       %177777.)                               <<02579>>03885000
3.  Transfer Error -  2 words will be logged.  They will be    <<02579>>03890000
                      words 1&3 of the I/O STATUS BLOCK.  Bit  <<02579>>03895000
                      4 of the first word will be set to 1.    <<02579>>03900000
4.  MCS Fault -       2 words will be logged.  They will be    <<02579>>03905000
                      words 1&3 of the I/O STATUS BLOCK.  The  <<02579>>03910000
                      second word will contain the MCS Fault   <<02579>>03915000
                      number.                                  <<02579>>03920000
Please Note:  If 2 words are logged and both bit 4 of the      <<02579>>03925000
              first word is set and the second word is         <<02579>>03930000
              nonzero then both a transfer error and an        <<02579>>03935000
              MCS Fault were reported by the device.           <<02579>>03940000
                                                               <<02579>>03945000
$PAGE                                                                   03950000
Job Protocol.                                                           03955000
                                                                        03960000
    It is expected that jobs will be sent to the printer following a    03965000
standard protocol outlined below.                                       03970000
                                                                        03975000
                                                                        03980000
    1.  The first record received is a Job Open.                        03985000
                                                                        03990000
    2.  The spooling system prints the header. ( optional ).            03995000
                                                                        04000000
    3.  The Environment file is sent.                                   04005000
                                                                        04010000
    4.  The data is sent.  Environment changes can be included in the   04015000
        data.                                                           04020000
                                                                        04025000
    5.  If a programming error occurs the printer returns an I/O status 04030000
        block to the host.                                              04035000
                                                                        04040000
    6.  The host commands the printer to load the default environment.  04045000
                                                                        04050000
    7.  The host prints the error trailer, detailing the record number  04055000
        of each programming error in the job.                           04060000
                                                                        04065000
    8.  The regular trailer is printed. ( optional ).                   04070000
                                                                        04075000
    9.  The host sends a Job Close command.                             04080000
                                                                        04085000
   10.  The host reads the Environmental status block to determine,     04090000
        for accounting purposes, how many pages were printed.           04095000
                                                                        04100000
                                                                        04105000
    Many variations can occur, but the above scenario represents        04110000
most jobs.                                                              04115000
$PAGE                                                                   04120000
                                                                        04125000
Comd.  Secondary  Meaning                           Data Bytes          04130000
-----  ---------  -------                           ----------          04135000
READ    011MMMMM  READ SOME STATUS BLOCK            32 BYTES READ       04140000
           00001  I/O STATUS BLOCK                                      04145000
           00010  ENVIRONMENTAL STATUS BLOCK                            04150000
           11110  READ LOOPBACK BUFFER              256 BYTES READ      04155000
           11111  READ SELF TEST RESULTS            2 BYTES READ        04160000
                                                                        04165000
                                                                        04170000
                                                                        04175000
WRITE   011MMMMM  WRITE SOME DATA TO 2680A                              04180000
           00000  HERE COMES SPOOLFILE DATA         *NOTE 1             04185000
           00001  BYTE COUNT                        2 BYTES OF N        04190000
           00011  PAGE STATUS RECOVERY BLOCK        32 BYTES            04195000
           11110  WRITE LOOPBACK BUFFER             256 BYTES           04200000
           11111  INITIATE SELF TEST                1 BYTE-IGNORED      04205000
                                                                        04210000
                                                                        04215000
                                                                        04220000
DSJ     01110000  REASON FOR PARALLEL POLL?         1 BYTE              04225000
         (talk)                                     *NOTE 2             04230000
                  PRINTER READY                     00000000            04235000
                  I/O STATUS READ REQUESTED         00000001            04240000
                                                                        04245000
                                                                        04250000
                                                                        04255000
CLEAR   01110000  PERFORM SOME CLEAR                *NOTE 3             04260000
        (listen)                                                        04265000
                  BYTE = 0, JOB CLOSE CLEAR                             04270000
                  BYTE = 1, JOB ABORT CLEAR                             04275000
                                                                        04280000
Summary of Secondary Address Commands                                   04285000
                                                                        04290000
                                                                        04295000
Secondary Address Command                                               04300000
******  NOTES  ******                                                   04305000
---------------------                                                   04310000
                                                                        04315000
NOTE 1.  Spoolfile data is sent from the host to the 2680A in blocks    04320000
of 512 words each.  The host may send multiple blocks in one trans-     04325000
mission up to the limit of the 3000 driver (32767 words).               04330000
                                                                        04335000
NOTE 2.  In addition to transferring data from the Host to the Device,  04340000
it is also necessary to transfer I/O Status to the CPU. The general     04345000
protocol is that EPOC will assert Parallel Poll whenever it has status  04350000
for the CPU.  The CPU driver sends a DSJ request to device and device   04355000
responds with one of the following bytes which is mapped to the CPVA    04360000
by the channel program.  The HP2680A responds with one of the follow-   04365000
ing two DSJ status bytes.                                               04370000
                                                 HANDLING               04375000
STATUS BYTE          MEANING                     PRIORITY               04380000
---------------      --------------------------  --------               04385000
                                                                        04390000
0                    Device Ready                   2                   04395000
1                    Request I/O Status Read        1                   04400000
                                                                        04405000
                                                                        04410000
     After the DSJ has been responded to by outputting one of           04415000
the above bytes (by device to CPU), the device will clear the Parallel  04420000
Poll.  If a non-zero DSJ response vector is received by the driver, it  04425000
will interrogate the device with a DSJ after taking the appropriate     04430000
action on the current DSJ byte.  Note that the Parallel Poll line is    04435000
used to indicate that status is available and the line is cleared once  04440000
the HP2680A indicates to the driver that status is pending!  The        04445000
actual status info has not yet been transferred.  At this point, it is  04450000
the responsibility of the driver to make the appropriate read to fetch  04455000
the status block.  There are 2 different status blocks: Environmental   04460000
status and I/O status.  The first are for use by the CPU                04465000
calling process to determine the current state of affairs in the        04470000
HP2680A.  Each status block is 16 words (32 bytes) long and is read by  04475000
setting the secondary address modifier bits appropriately.              04480000
                                                                        04485000
NOTE 3.  A Job Close Clear closes the current page, if opened, and      04490000
all pages in the printer memory will be printed.  A Job Abort Clear     04495000
will terminate the current job without printing any pages that might    04500000
be in the printers memory.                                              04505000
                                                                        04510000
;  <<end of comments>>                                         <<02579>>04515000
$PAGE "I/O TABLE AND GENERAL INFORMATION"                               04520000
$INCLUDE INCLIOQ                                               <<07417>>04525000
EQUATE                                                                  04530000
  ADVISORY'MSG      = 1001,   << ADVISORY MESSAGE NUMBER >>             04535000
  CALL'INITIATOR    = 2,      << MONITOR STATE = 2 >>                   04540000
  CPVA0             = 0,      << CHANNEL PROGRAM VARIABLE AREA >>       04545000
  CPVA1             = 1,                                                04550000
  CPVA2             = 2,                                                04555000
  CPVA3             = 3,                                                04560000
  CPVA4             = 4,                                                04565000
  CPVA5             = 5,                                                04570000
  DATAWRITE         = 1,      << FUNCTION = WRITE DATA >>               04575000
  DCBCNT            = 11,     << DIT - CURRENT BYTE COUNT >>   <<07417>>04580000
  DDEBUG            = 15,     << DIT- FOR DEBUGGING >>         <<07417>>04585000
  DCWCNT            = 12,     << DIT- CURRENT WORD COUNT >>    <<07417>>04590000
  DDLTP             = 4,      << DIT- DRIVER LINKAGE TABLE POINTER >>   04595000
  DEVICECLEAR       = 12,     << FUNCTION = JOB ABORT CLEAR >>          04600000
  DEVICECLOSE       = 4,      << FUNCTION = DEVICE CLOSE >>             04605000
  DFLAG             = 0,      << DIT- FLAGS WORD >>                     04610000
  DILTP             = 5,      << DIT- INTERRUPT LINKAGE TABLE POINTER >>04615000
  DIOQP             = 2,      << DIT- IOQ POINTER >>                    04620000
  DIOSTAT           = 18,     << DIT- I/O STATUS AREA >>       <<07417>>04625000
  DITSIZE           = 34,     <<WORD SIZE OF PAGE PRINTER DIT>><<07417>>04630000
  DLDEV             = 3,      << DIT- I/O SYSTEM TYPE, LDEV, UNIT >>    04635000
  DLINK             = 1,      << DIT- NEXT DIT REQUESTING SERVICE >>    04640000
  DLOGBUFFER        = 16,     << DIT- LOGGING AREA FOR IOSTATUS<<07417>>04645000
                              << WORDS 1 & 3 >>                <<07417>>04650000
  DOFFSET           = 14,     << DIT- RELATIVE BUFFER OFFSET>> <<07417>>04655000
  DRCNT             = 13,     << DIT- REMAINING WORD COUNT >>  <<07417>>04660000
  DSERR             = 7,      << DIT- ERROR LOGGING STATUS WORD >>      04665000
  DSTAT             = 6,      << DIT- CHANNEL STATUS >>                 04670000
  DTIME             = 8,      << DIT- TIMEOUT FLAGS WORD >>             04675000
  DTRLX             = 9,      << DIT- TIMER REQUEST INDEX >>            04680000
  DUNIT             = 10,     << DIT- UNIT NUMBER >>           <<07417>>04685000
  ICNTRL            = 7,      << ILT- CONTROLLER INFORMATION >>         04690000
  IFLAG             = 13,     << ILT- FLAGS WORD >>                     04695000
  IDENTIFYFUNC      = 7,      << IDENTIFY INTERNAL FUNCTION CODE >>     04700000
  ISIOP             = 8,      << ILT- CHANNEL PROGRAM POINTER >>        04705000
  ISTAP             = 9,      << ILT- I/O STATUS AREA POINTER >>        04710000
  LOG'DSTAT         = %000406,<< DSTAT LOGGING INFO >>                  04715000
  LOG'BUFFER        = %001017,<< DLOGBUFFER LOGGING INFO >>             04720000
  MAX'RECORD'SIZE   = 4096,   << SINGLE WRITE MAXIMUM SIZE >>           04725000
  MCS'WORD          = DIOSTAT+3,<< DIT RELATIVE ADR OF MCR'STATUS>>     04730000
  NRDYMSG           = 11,     << NOT READY MESSAGE NUMBER >>            04735000
  PPSET             = 22,     << CATALOG MESSAGE SET NUMBER >>          04740000
<< IOQ IS SPECIFIED BY INCL5 >>                                <<07417>>04745000
                                                               <<07417>>04750000
                                                               <<07417>>04755000
                                                               <<07417>>04760000
                                                               <<07417>>04765000
                                                               <<07417>>04770000
                                                               <<07417>>04775000
                                                               <<07417>>04780000
                                                               <<07417>>04785000
                                                               <<07417>>04790000
                                                               <<07417>>04795000
  SIOSIZE           = 40,     << CHANNEL PROGRAM SIZE >>                04800000
  SIOHALF           = SIOSIZE/2,                                        04805000
  INITSIZE          = DITSIZE + SIOSIZE + 4,                            04810000
  STATSIZE          = 1,      << I/O STATUS AREA IN ILT >>     <<07417>>04815000
  SYSDB             = %1000,                                            04820000
  SYSMSET           = 1;      << SYSTEM MESSAGE SET IN CATALOG >>       04825000
                                                                        04830000
$PAGE "CHANNEL PROGRAM INSTRUCTIONS"                                    04835000
                                                                        04840000
EQUATE                                                                  04845000
  JOB'ABORT'CLEAR   = %4401,                                            04850000
  DSJ               = %2401,                                            04855000
  JOB'CLOSE'CLEAR   = %4400,                                            04860000
  DSJ1'AFTER        = 3,                                                04865000
  DSJ1'BEFORE       = 2,                                                04870000
  IDENTIFY          = %3000,                                            04875000
  INITSELFTEST      = %4017,                                            04880000
  INTERRUPT'HALT1   = %601,                                             04885000
  INTERRUPT'HALT2   = %602,                                             04890000
  INTERRUPT'HALT3   = %603,                                             04895000
  JUMP              = 0,                                                04900000
  READENVSTATUS     = %1402,                                            04905000
  READIOSTATUS      = %1401,                                            04910000
  READLOOPBACK      = %3416,                                            04915000
  READSELFTEST      = %3417,                                            04920000
  WAIT              = %1000,                                            04925000
  WRITEBYTECOUNT    = %2001,                                            04930000
  WRITEDATA         = %2000,                                            04935000
  WRITELOOPBACK     = %4016,                                            04940000
  WRITEPGRECOVER    = %2003;                                            04945000
                                                                        04950000
$PAGE "CHANNEL PROGRAM JUMP VECTORS AND ADDRESSES"                      04955000
                                                                        04960000
EQUATE                                                                  04965000
  CPBASE            = 6,                 << CHANNEL PROGRAM BASE ADDR >>04970000
  JADR              = 5,                 << INITIAL JUMP ADDRESS >>     04975000
  WBC1              = 6,                 << WRITE BYTE COUNT >>         04980000
  WBC2              = 7,                 << CHANNEL INSTRUCTION >>      04985000
  WBC3              = 8,                 << RELATIVE ADDRESSES >>       04990000
  WBC4              = 9,                                                04995000
  WBC5              = 10,                                               05000000
  CMND1             = 17,                << FIVE WORD CHANNEL >>        05005000
  CMND2             = 18,                << RELATIVE ADDRESSES >>       05010000
  CMND3             = 19,                                               05015000
  CMND4             = 20,                                               05020000
  CMND5             = 21,                                               05025000
  DSJ3              = 24,                                               05030000
  IOST1             = 32,                << I/O STATUS READ CHANNEL >>  05035000
  IOST2             = 33,                << INSTRUCTION RELATIVE >>     05040000
  IOST3             = 34,                << ADRRESSES >>                05045000
  IOST4             = 35,                                               05050000
  IOST5             = 36,                                               05055000
  WAIT1             = 11,                                               05060000
  WAIT2             = 22,                                               05065000
  WAIT3             = 37,                                               05070000
  STHLT             = 38,              << HALT CODE AFTER I/O>>         05075000
  CLEARCP           = CMND4 - CPBASE,    << CLEAR JUMP ADDR.>>          05080000
  IDENTCP           = CMND2 - CPBASE,    << IDENTIFY >>                 05085000
  IDLECP            = WAIT2 - CPBASE,    << IDLE CHANNEL PROGRAM >>     05090000
  IOSTATCP          = IOST1 - CPBASE,    << INTERNAL I/O STATUS READ >> 05095000
  IO'STATUS'CP      = CMND1 - CPBASE,    << EXTERNAL I/O STATUS READ >> 05100000
  LOOPBACKCP        = CMND1 - CPBASE,    << PERFORM LOOPBACK TEST >>    05105000
  PAGERECVCP        = CMND1 - CPBASE,    << WRITE PAGE RECOVERY BLOCK >>05110000
  READENVSTATCP     = CMND1 - CPBASE,    << READ ENVIRONMENTAL STATUS >>05115000
  SELFTESTCP        = CMND1 - CPBASE,    << PERFORM SELF TEST >>        05120000
  WRITECP           = WBC1 - CPBASE;     << WRITE DATA >>               05125000
                                                                        05130000
$PAGE "DRIVER RETURN CODES & MONITOR STATES"                            05135000
                                                                        05140000
EQUATE                                                                  05145000
  PENDING           = %10,      << PENDING/WAITING FOR COMPLETION >>    05150000
  OFFLINESTAT       = %20,      << OFFLINE >>                           05155000
  TIMEOUTSTAT       = %30,      << TIMEOUT >>                           05160000
                                                                        05165000
  SUCCESSFUL        = 1,        << SUCCESSFUL COMPLETION >>             05170000
                                                                        05175000
  SPOOLERSTATUS     = %13,      << UNUSUAL COMPLETION >>                05180000
  RETRANSMIT'SPOOL  = %23,                                              05185000
  USERABORT         = %33,                                              05190000
  POWERFAIL         = %63,                                              05195000
  POWERUPSTAT       = %213,                                             05200000
                                                                        05205000
  INVALID           = 4,        << IRRECOVERABLE ERROR >>               05210000
  TRANSFER'ERROR    = %14,                                              05215000
  IO'TIMEDOUT       = %24,                                              05220000
  BADCHANP          = %44,                                              05225000
  UNIT'FAILURE      = %54,                                              05230000
  SYSTEMERROR       = %124,                                             05235000
  CNTRLNOGOOD       = %144,                                             05240000
  PARITY'ERROR      = %214,                                             05245000
                                                                        05250000
  COMPLETED         = 5,        << MONITOR RETURN STATES >>             05255000
  OPERATOR'WAIT     = 7,                                                05260000
  COMPLETION'WAIT   = %13;                                              05265000
                                                                        05270000
$PAGE "PROGRAM DEFINES & BIT DEFINITIONS"                               05275000
                                                                        05280000
DEFINE                                                                  05285000
  ABORT             = (0:1)#,                                           05290000
  ABS               = ABSOLUTE#,                                        05295000
  ASMB              = ASSEMBLE#,                                        05300000
  DIAG              = (2:1)#,                                           05305000
  DIAGNOSTIC        = IOQ'DIAG#,                               <<07417>>05310000
  ERRORCODE         = (0:3)#,                                           05315000
  FINISH            = (15:1)#,                                          05320000
  FUNC              = (8:8)#,                                           05325000
  IOPROG            = (7:1)#,                                           05330000
  IOSTAT            = (14:1)#,                                          05335000
  LDEV              = (8:8)#,                                           05340000
  PFAILABORT        = (11:1)#,                                          05345000
  SYSBUFR           = (3:1)#,                                           05350000
  STAT              = (8:8)#,                                           05355000
  TIMEDOUT          = (13:1)#,                                          05360000
  SETMBLOCKMODE     = MISC.(0:1) := 1#,                                 05365000
  MULTIBLOCKMODE    = MISC.(0:1)#,                                      05370000
  CLEARMBLOCKMODE   = MISC.(0:1) := 0#,                                 05375000
  SETBLOCKRETRY     = MISC.(1:1) := 1#,                                 05380000
  BLOCKRETRY        = MISC.(1:1)#,                                      05385000
  CLEARBLOCKRETRY   = MISC.(1:1) := 0#,                                 05390000
  SETABORTFLAG      = MISC.(2:1) := 1#,                                 05395000
  ABORTFLAG         = MISC.(2:1)#,                                      05400000
  CLEARABORTFLAG    = MISC.(2:1) := 0#,                                 05405000
  SETIOSTATUS       = MISC.(3:1) := 1#,                                 05410000
  IOSTATUS          = MISC.(3:1)#,                                      05415000
  CLEARIOSTATUS     = MISC.(3:1) := 0#,                                 05420000
  SETTIMEOUT        = MISC.(4:1) := 1#,                                 05425000
  TIMEOUT           = MISC.(4:1)#,                                      05430000
  CLEARTIMEOUT      = MISC.(4:1) := 0#,                                 05435000
  OFFLINE           = IOSTATUS1.(0:1)#,                                 05440000
  ADVISORY          = IOSTATUS1.(1:1)#,                                 05445000
  POWERUP           = IOSTATUS1.(2:1)#,                                 05450000
  PARITY            = IOSTATUS1.(3:1)#,                                 05455000
  XFERERROR         = IOSTATUS1.(4:1)#;                                 05460000
                                                                        05465000
$PAGE "I/O TABLE DEFINITION AREA"                                       05470000
<< DIT DEFINITION/DRIVER LINKAGE AREA/CHANNEL PROGRAM AREA >>           05475000
                                                                        05480000
ARRAY INITIAL(0:INITSIZE-1)= DB :=                                      05485000
    [8/DITSIZE,8/1],        << DIT SIZE, TYPE 1 MONITOR >>              05490000
    0,                      << NOT USED >>                              05495000
    0,                      << NO UNIT EXTRACT >>                       05500000
    [8/SIOHALF,8/STATSIZE], << CHANNEL PROGRAM SIZE/2, STATUS SIZE >>   05505000
                                                                        05510000
    << DIT AREA >>                                                      05515000
                                                                        05520000
                                                                        05525000
                                                                        05530000
    0,             << DFLAG   - 0 >>                                    05535000
    0,             << DLINK   - 1 >>                                    05540000
    0,             << DIOQP   - 2 >>                                    05545000
    0,             << DLDEV   - 3 >>                           <<07417>>05550000
    0,             << DDLTP   - 4 >>                                    05555000
    0,             << DILTP   - 5 >>                                    05560000
    0,             << DSTAT   - 6 >>                                    05565000
    0,             << DSERR   - 7 >>                                    05570000
    0,             << DTIME   - 8 >>                                    05575000
    0,             << DTRLX   - 9 >>                                    05580000
    %40000,        << DUNIT   -10 >>                           <<07417>>05585000
    0,             << DCBCNT  -11 >>                           <<07417>>05590000
    0,             << DCWCNT  -12 >>                           <<07417>>05595000
    0,             << DRCNT   -13 >>                           <<07417>>05600000
    0,             << DOFFSET -14 >>                           <<07417>>05605000
    0,             << DDEBUG  -15 >>                           <<07417>>05610000
    2(0),          << DLOGBUFFER - 16 >>                       <<07417>>05615000
    16(0),         << DIOSTST - 18/33 >>                       <<07417>>05620000
$PAGE "CHANNEL PROGRAM"                                                 05625000
                                                                        05630000
<<********************************************************************  05635000
                                                                        05640000
  THE CHANNEL PROGRAM VARIABLE AREA (CPVA) IS MODIFIED BY               05645000
  THIS CHANNEL PROGRAM IN THE FOLLOWING WAYS:                           05650000
                                                                        05655000
  CPVA0 =    RESERVED FOR CHANNEL HARDWARE STATUS.  NOT USED            05660000
             BY THE CHANNEL PROGRAM (BELOW) FOR ANY REASON!             05665000
                                                                        05670000
  CPVA1 =  0 DEFAULT PRE-RUN STATE SET UP BY DRIVER.                    05675000
           1 TRANSMISSION COMPLETED SUCCESSFULLY.                       05680000
           2 I/O STATUS READ BEFORE MAIN TRANSFER DONE.                 05685000
           3 I/O STATUS READ AFTER MAIN TRANSFER DONE.                  05690000
                                                                        05695000
  CPVA2 =  0 DEFAULT PRE-RUN STATE SET UP BY DRIVER.                    05700000
             CURRENTLY NOT USED.                                        05705000
                                                                        05710000
  CPVA3 =  0 DEFAULT PRE-RUN STATE SET UP BY DRIVER.                    05715000
             CURRENTLY NOT USED.                                        05720000
                                                                        05725000
********************************************************************    05730000
                                                                        05735000
              IDENTIFY TO MAKE SURE DEVICE IS CONNECTED TO CPU          05740000
                                                                        05745000
********************************************************************>>  05750000
<<THE PURPOSE OF THIS IDENTIFY IS SO THAT IF THE DEVICE IS NOT CONNECTED05755000
THE DENTIFY COMMAND WILL TIME OUT AND INTERRUPT THE DRIVER,             05760000
IF THE IDENTIFY WAS NOT HERE THE DRIVER COULD HANG INDEFINATELY         05765000
IN THE WAIT FOLLOWING THE WRITE. >>                                     05770000
                                                                        05775000
<<  0>> << IDENTIFY >>        %3000,                                    05780000
<<  1>>                           0,                                    05785000
                                                                        05790000
<<THE JUMP 0 IS SO THAT THE LENGTH OF THE CHANNEL PROGRAM               05795000
  WOULD NOT CHANGE WHEN THE IDENTIFY COMMMAND WAS SUBSTITUTED           05800000
  FOR A DSJ AT THE BEGINNING OF THE CHANNEL PROGRAM>>                   05805000
<<  2>> << JUMP 0 >>              0,                                    05810000
<<  3>>                           0,                                    05815000
                                                                        05820000
<<********************************************************************  05825000
                                                                        05830000
               JUMP TO APPROPRIATE CHANNEL PROGRAM AREA                 05835000
                                                                        05840000
********************************************************************>>  05845000
                                                                        05850000
<<  4>> << JUMP >>                0,                                    05855000
<<  5>>                           0,                                    05860000
                                                                        05865000
$PAGE                                                                   05870000
<<********************************************************************  05875000
                                                                        05880000
                           WRITE BYTE COUNT                             05885000
                                                                        05890000
********************************************************************>>  05895000
                                                                        05900000
<<  6>> << WRITE COMMAND >>   %2001,  << WRITE BYTE COUNT >>            05905000
<<  7>>                           0,  << BYTE COUNT >>                  05910000
<<  8>>                           0,  << BURST LENGTH >>                05915000
<<  9>>                           0,  << FLAGS AND BANK NUMBER >>       05920000
<< 10>>                           0,  << ADDRESS >>                     05925000
                                                                        05930000
<< 11>> << WAIT >>            %1000,  << WAIT FOR PARALLEL POLL >>      05935000
<< 12>>                           0,                                    05940000
                                                                        05945000
<< 13>> << DSJ >>             %2401,  << CHECK PRINTER'S CONDITION >>   05950000
<< 14>>                           0,  << DSJ # 2 RETURN BYTE >>         05955000
<< 15>>                           0,  << OK >>                          05960000
<< 16>>                          13,  << READ I/O STATUS >>             05965000
                                                                        05970000
<<********************************************************************  05975000
                                                                        05980000
                              WRITE DATA                                05985000
                   WRITE PAGE STATUS RECOVERY BLOCK                     05990000
                           READ I/O STATUS                              05995000
                   READ ENVIRONMENTAL STATUS BLOCK                      06000000
                          INITIATE SELF TEST                            06005000
                        READ SELF TEST RESULTS                          06010000
                        WRITE LOOPBACK BUFFER                           06015000
                         READ LOOPBACK BUFFER                           06020000
                                CLEAR                                   06025000
                               IDENTIFY                                 06030000
                                                                        06035000
********************************************************************>>  06040000
                                                                        06045000
<< 17>> << WRITE COMMAND >>   %2000,  << READ OR WRITE COMMAND >>       06050000
<< 18>> << IDENTIFY >>            0,  << BYTE COUNT >>                  06055000
<< 19>>                           0,  << BURST LENGTH >>                06060000
<< 20>> << CLEAR OR ID HALT >>    0,  << FLAGS AND BANK NUMBER >>       06065000
<< 21>>                           0,  << ADDRESS >>                     06070000
                                                                        06075000
<< 22>> << WAIT OR JUMP 0>>   %1000,<< WAIT FOR PARALLEL POLL>>         06080000
<< 23>>                           0,  << ALSO IDLE CHANNEL PROGRAM >>   06085000
<< READ I/O STATUS DOES NOT WANT A WAIT SO IT WILL BE CHANGED>>         06090000
<<TO A JUMP 0 TO GO ON TO THE DSJ>>                                     06095000
                                                                        06100000
<< 24>> << DSJ >>             %2401,  << CHECK PRINTER'S CONDITION >>   06105000
<< 25>>                           0,  << DSJ # 3 RETURN BYTE >>         06110000
<< 26>>                           0,  << OK >>                          06115000
<< 27>>                           4,  << READ I/O STATUS >>             06120000
$PAGE                                                                   06125000
<<********************************************************************  06130000
                                                                        06135000
                 TRANSMISSION COMPLETED SUCCESSFULLY                    06140000
                            SET CPVA1 = 1                               06145000
                                                                        06150000
********************************************************************>>  06155000
                                                                        06160000
<< 28>> << INTERRUPT HALT >>   %601,  << CPVA1 = 1 >>                   06165000
<< 29>>                           1,  << TRANSMISSION SUCCESSFUL >>     06170000
                                                                        06175000
<<********************************************************************  06180000
                                                                        06185000
  MODIFY THE HALT CODE AFTER THE I/O STATUS READ TO SIGIFY THAT THE     06190000
STATUS WAS READ BEFORE THE TRANSMISSION COMPLETED TO SET UP             06195000
FOR RETRY CONDITION.                                                    06200000
                            SET CPVA1 = 2                               06205000
                                                                        06210000
********************************************************************>>  06215000
                                                                        06220000
<< 30>> << WRITE REL. IMM. >> %7406,  << MODIFY THE HALT CODE>>         06225000
<< 31>>                           2,  << AFTER I/O STATUS READ >>       06230000
                                                                        06235000
<<********************************************************************  06240000
                                                                        06245000
                           READ I/O STATUS                              06250000
                 CPAV1 SHOWS WHEN I/O STATUS WAS READ                   06255000
    CPVA1 = 2 - I/O STATUS WAS READ BEFORE TRANSMISSION COMPLETED       06260000
    CPVA1 = 3 - I/O STATUS WAS READ AFTER  TRANSMISSION COMPLETED       06265000
                                                                        06270000
********************************************************************>>  06275000
                                                                        06280000
<< 32>> << READ COMMAND >>    %1401,  << READ I/O STATUS >>             06285000
<< 33>>                          32,  << BYTE COUNT >>                  06290000
<< 34>>                           0,  << BURST LENGTH >>                06295000
<< 35>>                       %2000,  << FLAGS AND BANK NUMBER >>       06300000
<< 36>>                           0,  << ADDRESS >>                     06305000
                                                                        06310000
<< 37>> << INTERRUPT >>        %601,  << I/O STATUS WAS READ >>         06315000
<< 38>>                           3;  <<BEFORE/AFTER TRANSFER>>         06320000
                                                                        06325000
<< END OF CHANNEL PROGRAM AREA >>                                       06330000
                                                                        06335000
$PAGE "EXTERNAL PROCEDURE DECLARATIONS"                                 06340000
                                                                        06345000
PROCEDURE ABORTTIMEREQ(TRLX);                                           06350000
VALUE   TRLX; INTEGER TRLX;                                             06355000
OPTION  EXTERNAL;                                                       06360000
                                                                        06365000
INTEGER PROCEDURE GETDRT(DRT,OFFSET);                          <<03009>>06370000
VALUE DRT,OFFSET;                                              <<03087>>06375000
INTEGER DRT,OFFSET;                                            <<03009>>06380000
OPTION EXTERNAL;                                               <<03009>>06385000
                                                               <<03009>>06390000
PROCEDURE GIP'HPIB;                                                     06395000
OPTION  EXTERNAL;                                                       06400000
                                                                        06405000
PROCEDURE HELP;                                                         06410000
OPTION  EXTERNAL;                                                       06415000
                                                                        06420000
LOGICAL PROCEDURE IOMESSAGE(SETNO,MSGNO,MASK,P1,P2,P3,P4,P5,            06425000
                            DEST,REPLY,OFFSET,DITP,IOTYPE);             06430000
VALUE   SETNO,MSGNO,MASK,P1,P2,P3,P4,P5,DEST,REPLY,OFFSET,IOTYPE;       06435000
INTEGER SETNO,MSGNO,MASK,P1,P2,P3,P4,P5,DEST,REPLY,OFFSET,IOTYPE;       06440000
INTEGER POINTER DITP;                                                   06445000
OPTION  EXTERNAL, VARIABLE;                                             06450000
                                                                        06455000
PROCEDURE MASTERCLEARHPIB(DITP);                                        06460000
INTEGER ARRAY DITP;                                                     06465000
OPTION  EXTERNAL;                                                       06470000
                                                                        06475000
PROCEDURE SIODM(DITP,FLAGS);                                            06480000
VALUE   DITP,FLAGS;                                                     06485000
LOGICAL FLAGS;                                                          06490000
POINTER DITP;                                                           06495000
OPTION  EXTERNAL;                                                       06500000
                                                                        06505000
PROCEDURE START'HPIB(DITP,SIOP,QFLAG);                                  06510000
VALUE   DITP,SIOP,QFLAG;                                                06515000
LOGICAL QFLAG;                                                          06520000
POINTER DITP,SIOP;                                                      06525000
OPTION  EXTERNAL;                                                       06530000
                                                                        06535000
INTEGER PROCEDURE TIMEREQ(CODE,REQ,TIME);                               06540000
VALUE   CODE,REQ,TIME;                                                  06545000
INTEGER CODE,REQ;                                                       06550000
DOUBLE  TIME;                                                           06555000
OPTION  EXTERNAL;                                                       06560000
                                                                        06565000
                                                                        06570000
$PAGE "PAGE PRINTER DRIVER"                                             06575000
INTEGER PROCEDURE PPDRIVER                                     <<07417>>06580000
        (IOQ'ENTRY'INDEX,DITP,BANK,BUFADR,CHANP,DRTN);         <<07417>>06585000
<<                                                                      06590000
  THIS PROCEDURE INITIATES AND COMPLETES I/O FOR THE HP2680A            06595000
  CONNECTED THROUGH THE HPIB INTERFACE.                                 06600000
                                                                        06605000
    MONITOR RETURNS IN PPDRIVER:                                        06610000
                                                                        06615000
        5  -  REQUEST COMPLETED.                                        06620000
        7  -  OPERATOR INTERVENTION (NOT READY) WAIT.                   06625000
      %13  -  INTERRUPT WAIT OR WAIT FOR COMPLETION.                    06630000
>>                                                                      06635000
                                                                        06640000
VALUE   DITP,   << POINTER TO DEVICE INFORMATION TABLE >>               06645000
        IOQ'ENTRY'INDEX,   << POINTER TO I/O REQUEST QUEUE >>  <<07417>>06650000
        BANK,   << BANK WHERE THE BUFFER RESIDES >>                     06655000
        BUFADR, << TARGET ADDRESS WITHIN BANK >>                        06660000
        CHANP,  << POINTER TO BEGINING OF THE CHANNEL PROGRAM >>        06665000
        DRTN;   << DEVICE REFERENCE TABLE NO. .. HARDWARE ADDRESS >>    06670000
                                                                        06675000
INTEGER BANK,                                                           06680000
        DRTN,                                                           06685000
        BUFADR;                                                         06690000
                                                                        06695000
INTEGER POINTER DITP,                                                   06700000
                CHANP;                                         <<07417>>06705000
INTEGER IOQ'ENTRY'INDEX;                                       <<07417>>06710000
                                                                        06715000
OPTION  PRIVILEGED, UNCALLABLE;                                         06720000
  BEGIN                                                                 06725000
                                                                        06730000
    INTEGER FUNCTION            ,     << FUNCTION CODE >>      <<07417>>06735000
            S0             = S-0,          << TOP OF STACK >>           06740000
            S1             = S-1,          << TOP OF STACK - 1 >>       06745000
            MSTATE         = PPDRIVER,     << MONITOR STATE RETURN >>   06750000
            INDEX               ,     << TEMPORARY INDEX >>    <<07417>>06755000
            X              = X;            << X REGISTER >>             06760000
                                                                        06765000
     LOGICAL CPPSTATUS           ,    << CHANNEL STATUS >>     <<07417>>06770000
            IOSTATUS1           ,     << I/O STATUS WORD 1 >>  <<07417>>06775000
            MISC                ,     << MISCELLANEOUS FLAGS >><<07417>>06780000
            LS0            = S-0;          << TOP OF STACK >>           06785000
                                                                        06790000
                                                               <<07417>>06795000
                                                               <<07417>>06800000
                                                                        06805000
    INTEGER POINTER                                                     06810000
            ILTP                ,  <<INTERRUPT LINKAGE TABLE>> <<07417>>06815000
            STATP               ;  << STATUS POINTER >>        <<07417>>06820000
                                                                        06825000
    DEFINE  BANKNO         = BANK.(8:8)#;  << BANK NUMBER >>            06830000
$PAGE "DRIVER INITIATOR & COMPLETOR COMMON AREA"                        06835000
                                                                        06840000
    SUBROUTINE BUMPPARITY;                                              06845000
                                                                        06850000
    <<                                                                  06855000
       CALLED IF A COMMAND SENT TO THE HP2680A HAD A PARITY ERROR.      06860000
                                                                        06865000
       UPDATES A RETRY COUNTER IN THE QMISC WORD AND RETURNS            06870000
       INDICATION WHETHER MORE THAN 3 RETRIES HAVE BEEN ATTEMPTED.      06875000
    >>                                                                  06880000
                                                                        06885000
      BEGIN                                                             06890000
                                                                        06895000
        TOS := MISC;                                                    06900000
        ASMB(LDI %2; LADD,DUP);                                         06905000
        MISC := TOS;                                                    06910000
        ASMB(TBC 12; DEL);                                              06915000
      END;                                                              06920000
                                                                        06925000
                                                                        06930000
                                                                        06935000
    SUBROUTINE BUMPXFER;                                                06940000
                                                                        06945000
    <<                                                                  06950000
       CALLED IF A TRANSFER ERROR OCCURRED IN THE 2680A.                06955000
                                                                        06960000
       UPDATES A RETRY COUNTER IN THE QMISC WORD AND RETURNS            06965000
       INDICATION WHETHER MORE THAN 3 RETRIES HAVE BEEN ATTEMPTED.      06970000
    >>                                                                  06975000
                                                                        06980000
      BEGIN                                                             06985000
                                                                        06990000
        TOS := MISC;                                                    06995000
        ASMB(LDI %20; LADD,DUP);                                        07000000
        MISC := TOS;                                                    07005000
        ASMB(TBC 9; DEL);                                               07010000
      END;                                                              07015000
                                                                        07020000
                                                                        07025000
$PAGE                                                                   07030000
    SUBROUTINE START'IDLEWAIT(RSTATUS);                                 07035000
    VALUE   RSTATUS;    << IOQ RETURN STATUS >>                         07040000
    INTEGER RSTATUS;                                                    07045000
                                                                        07050000
    <<                                                                  07055000
       SET UP AND START AN IDLE WAIT CHANNEL PROGRAM AND                07060000
       RETURN THE APPROPRIATE STATUS.                                   07065000
    >>                                                                  07070000
                                                                        07075000
      BEGIN                                                             07080000
                                                                        07085000
                                                                        07090000
        << NEED TO STOP THE TIMEOUT REQUEST IF AN >>                    07095000
        << IDLE CHANNEL PROGRAM IS BEING EXECUTED >>                    07100000
                                                                        07105000
        IF DITP(DTRLX) <> 0 THEN                                        07110000
          BEGIN << A TIMER REQUEST WAS MADE >>                          07115000
            ABORTTIMEREQ(DITP(DTRLX));                                  07120000
            DITP(DTRLX) := 0; << CLEAR TIMER REQUEST INDEX IN DIT >>    07125000
            DITP(DTIME).(0:1) := 0; << SET CC ON PREVIOUS BIT STATE >>  07130000
          END;                                                          07135000
    CHANP:=JUMP; <<IDLE CP MUST NOT START WITH IDENTIFY>>      <<02656>>07140000
    CHANP(1):=IDLECP+4;                                                 07145000
        CHANP(DSJ3+3):=0; <<DONT READ STATUS AFTER IDLE CP>>            07150000
        START'HPIB(DITP, CHANP, FALSE);                                 07155000
        IF < THEN GOTO CHANPFAIL;                                       07160000
        IOQ'QMISC := MISC;                                     <<07417>>07165000
        IOQ'STAT := RSTATUS;                                   <<07417>>07170000
        MSTATE := OPERATOR'WAIT;                                        07175000
      END;   << START'IDLEWAIT >>                                       07180000
                                                                        07185000
$PAGE                                                                   07190000
                                                                        07195000
    << IF NO IOQ, THEN ERRONEOUS INTERRUPT >>                           07200000
                                                                        07205000
IF MSTATE = CALL'INITIATOR THEN IF IOQ'ENTRY'INDEX = 0 THEN    <<07417>>07210000
      BEGIN << NO IOQ >>                                                07215000
        MSTATE := 5;  << SET GOOD END >>                                07220000
        RETURN;                                                         07225000
      END;                                                              07230000
                                                                        07235000
    << SET UP LOCAL VARIABLES >>                                        07240000
                                                                        07245000
    @ILTP := DITP(DILTP);       << ILT POINTER >>              <<07417>>07250000
    @STATP := @DITP + DIOSTAT;  << STATUS POINTER >>           <<07417>>07255000
    FUNCTION := IOQ'FUNC.FUNC;  << FUNCTION CODE >>            <<07417>>07260000
    CPPSTATUS := 0;             << CPPSTATUS >>                <<07417>>07265000
    IOSTATUS1 := 0;             << IOSTATUS1 >>                <<07417>>07270000
    MISC := IOQ'QMISC;          << MISCELLANEOUS FLAG >>       <<07417>>07275000
    INDEX := 0;                 << TEMPORARY INDEX >>          <<07417>>07280000
                                                                        07285000
    << MAP EXTERNAL FUNCTION CODES INTO INTERNAL FUNCTION CODES >>      07290000
    << FUNCTION CODE 15 MAPS TO INTERNAL CODE 5                 >>      07295000
    << FUNCTION CODES 71/76 MAP TO INTERNAL CODES 6/11          >>      07300000
    << FUNCTION CODES 189/191 MAP TO INTERNAL CODES 12/14       >>      07305000
                                                                        07310000
    IF (5 <= FUNCTION <= 14) THEN GOTO INVALIDFUNC;                     07315000
    IF FUNCTION = 15 THEN FUNCTION := 5 ELSE                            07320000
    IF (71 <= FUNCTION <= 76) THEN FUNCTION := FUNCTION - 65 ELSE       07325000
    IF (189 <= FUNCTION <= 191) THEN FUNCTION := FUNCTION - 177;        07330000
    IF NOT(1 <= FUNCTION <= 17) THEN GO TO INVALIDFUNC;                 07335000
                                                                        07340000
    << IF THE REQUEST IS FOR A DIAGNOSTIC OPERATION THEN THE >>         07345000
    << HP2680A MUST BE IN DIAGNOSTIC MODE, OTHERWISE THE     >>         07350000
    << CURRENT USER COULD LOSE DATA, ENVIRONMENT, ETC.       >>         07355000
                                                                        07360000
    IF (7 <= FUNCTION <= 11) THEN                                       07365000
      IF NOT DIAGNOSTIC THEN GOTO INVALIDFUNC;                          07370000
                                                                        07375000
    << CHECK FOR INTERNAL TIMEOUT INTERRUPTS. >>                        07380000
                                                                        07385000
    IF DITP(DTRLX) <> 0 THEN                                            07390000
      BEGIN << A TIMER REQUEST WAS MADE >>                              07395000
        ABORTTIMEREQ(DITP(DTRLX));                                      07400000
        DITP(DTRLX) := 0; << CLEAR TIMER REQUEST INDEX IN DIT >>        07405000
        DITP(DTIME).(0:1) := 0; << SET CC ON PREVIOUS BIT STATE >>      07410000
        IF <> THEN                                                      07415000
          BEGIN   << TIMER POPPED...LAST TRANSACTION TIMED OUT >>       07420000
            IOQ'STAT := TIMEOUTSTAT;                           <<07417>>07425000
            GOTO ERROREXIT;                                             07430000
          END;                                                          07435000
      END;                                                              07440000
$PAGE                                                                   07445000
    << CHECK FOR POWER FAIL OR ABORT REQUEST >>                         07450000
                                                                        07455000
    IF IOQ'ABORT THEN                                          <<07417>>07460000
      BEGIN  << A PENDING ABORT >>                                      07465000
        MASTERCLEARHPIB(DITP);                                          07470000
        IF NOT IOQ'PFAIL THEN                                  <<07417>>07475000
          BEGIN      << USER REQUEST >>                                 07480000
            IF ABORTFLAG THEN                                           07485000
              BEGIN     << ALREADY DID "CLEAR" EVENT >>                 07490000
                IOQ'STAT := USERABORT;                         <<07417>>07495000
                GOTO ERROREXIT;                                         07500000
              END;                                                      07505000
            SETABORTFLAG;                                               07510000
            GO TO CLEARFUNC;                                            07515000
          END                                                           07520000
        ELSE                                                            07525000
          BEGIN   << POWER FAIL ABORT >>                                07530000
            IOQ'STAT := POWERFAIL;                             <<07417>>07535000
            GOTO ERROREXIT;                                             07540000
          END;                                                          07545000
      END;                                                              07550000
$PAGE "DRIVER INITIATOR"                                                07555000
    IF MSTATE = CALL'INITIATOR THEN                                     07560000
      BEGIN  << DRIVER INITIATOR >>                                     07565000
                                                                        07570000
        CHANP(WAIT2):=WAIT; <<RESTORE WAIT>>                            07575000
        CHANP(DSJ3+3):=4; <<RESTORE DSJ VECTOR>>                        07580000
        CHANP:=IDENTIFY; <<RESTORE INTITIAL IDENTIFY IT MAY HAVE BEEN>> 07585000
        CHANP(1):=0; <<CHANGED TO A JUMP TO IDLE CP>>                   07590000
      COMMAND'RETRY:                                                    07595000
                                                                        07600000
        << IF THIS REQUEST IS FROM A NOT READY CONDITION,      >>       07605000
        << CHECK IF RECOVERY OR MULTIPLE BLOCKS ARE IN EFFECT. >>       07610000
                                                                        07615000
        IF BLOCKRETRY OR MULTIBLOCKMODE THEN GOTO WRITERETRYBLOCK;      07620000
                                                                        07625000
        << CALCULATE WORD & BYTE COUNT >>                               07630000
        << INITIALIZE BUFFER OFFSET    >>                               07635000
                                                                        07640000
        TOS := IOQ'COUNT;                                      <<07417>>07645000
        TOS := IF < THEN -TOS ELSE TOS*2;                               07650000
        DITP(DRCNT) := (DITP(DCBCNT) := TOS)&LSR(1);                    07655000
        DITP(DOFFSET) := 0;                                             07660000
                                                                        07665000
        << CHECK FOR VALID COUNT IF SYSTEM BUFFERS >>                   07670000
                                                                        07675000
        IF IOQ'SBUF THEN                                       <<07417>>07680000
          IF NOT (1 <= DITP(DCBCNT) <= 256) THEN GOTO INVALIDFUNC;      07685000
                                                                        07690000
        << THE BYTE COUNT MUST BE A MULTIPLE OF 1024 >>                 07695000
        << FOR A FUNCTION OF WRITE DATA.             >>                 07700000
                                                                        07705000
        IF FUNCTION = DATAWRITE THEN                                    07710000
          IF LOGICAL(DITP(DCBCNT)) MOD 1024 <> 0 OR DITP(DCBCNT) = 0    07715000
          THEN GOTO INVALIDFUNC;                                        07720000
                                                                        07725000
$PAGE "DRIVER FUNCTIONS"                                                07730000
                                                                        07735000
        CASE FUNCTION OF                                                07740000
          BEGIN  << DRIVER FUNCTION CASES >>                            07745000
                                                                        07750000
COMMENT                                                                 07755000
                                                                        07760000
************************************************************************07765000
                                                                        07770000
FUNCTION                     EXTERNAL CODE          INTERNAL CODE       07775000
                             ( ATTACHIO )            ( DRIVER )         07780000
                                                                        07785000
************************************************************************07790000
                                                                        07795000
WRITE SPOOLFILE DATA                   1                  1             07800000
FILE OPEN                              2                  2             07805000
FILE CLOSE                             3                  3             07810000
DEVICE CLOSE                           4                  4             07815000
READ CURRENT I/O STATUS               15                  5             07820000
READ LAST I/O STATUS FROM DIT         71                  6             07825000
DEVICE IDENTIFY                       72                  7             07830000
INITIATE SELF TEST                    73                  8             07835000
READ SELF TEST RESULTS                74                  9             07840000
WRITE LOOPBACK BUFFER                 75                 10             07845000
READ LOOPBACK BUFFER                  76                 11             07850000
DEVICE CLEAR                         189                 12             07855000
WRITE PAGE STATUS RECOVERY BLOCK     190                 13             07860000
READ ENVIRONMENTAL STATUS BLOCK      191                 14             07865000
                                                                        07870000
************************************************************************07875000
                                                                        07880000
; << END OF COMMENT >>                                                  07885000
                                                                        07890000
$PAGE                                                                   07895000
            BEGIN  << FUNCTION = 0; INVALID FUNCTION CODE >>            07900000
                                                                        07905000
              GOTO INVALIDFUNC;                                         07910000
                                                                        07915000
            END;   << FUNCTION = 0; INVALID FUNCTIONC CODE >>           07920000
$PAGE                                                                   07925000
            BEGIN  << FUNCTION = 1; WRITE SPOOLFILE DATA >>             07930000
                                                                        07935000
              << DO WE NEED TO RE-TRANSMIT A BLOCK? >>                  07940000
              << RESET REMAINING COUNT & BUFFER ADDRESS >>              07945000
                                                                        07950000
            WRITERETRYBLOCK:                                            07955000
                                                                        07960000
              IF BLOCKRETRY THEN                                        07965000
                BEGIN    << A BLOCK MUST BE RETRANSMITTED >>            07970000
                  CLEARBLOCKRETRY;                                      07975000
                  DITP(DRCNT) := DITP(DRCNT) + DITP(DCWCNT);            07980000
                  DITP(DOFFSET) := DITP(DOFFSET) - DITP(DCWCNT);        07985000
                END;                                                    07990000
                                                                        07995000
              << CHECK FOR MULTIPLE WRITES >>                           08000000
              << SET UP COUNTS & ADDRESS INTO THE DIT >>                08005000
                                                                        08010000
            WRITEMULTIBLOCK:                                            08015000
                                                                        08020000
              << CHECK IF MULTI-BLOCK (REQUEST GREATER THAN 4K WORDS) >>08025000
              << FIGURE CURRENT COUNT IN WORDS & BYTES, SAVE IN DIT   >>08030000
                                                                        08035000
              CLEARMBLOCKMODE;                                          08040000
              TOS := DITP(DRCNT);                                       08045000
              IF <= THEN                                                08050000
                BEGIN   << ALL FINISHED >>                              08055000
                  DEL;                                                  08060000
                  GOTO DONE;                                            08065000
                END;                                                    08070000
              IF S0 > MAX'RECORD'SIZE THEN                              08075000
                BEGIN   << MULTI-BLOCK TRANSFER >>                      08080000
                  DITP(DRCNT) := TOS - MAX'RECORD'SIZE;                 08085000
                  TOS := MAX'RECORD'SIZE;                               08090000
                  SETMBLOCKMODE;                                        08095000
                END                                                     08100000
              ELSE DITP(DRCNT) := 0;                                    08105000
              DITP(DCBCNT) := (DITP(DCWCNT) := TOS)&LSL(1);             08110000
                                                                        08115000
              << SET UP THE WRITE BYTE CNT & DATA CHANNEL PROGRAMS >>   08120000
                                                                        08125000
              CHANP(JADR) := WRITECP;     << JUMP TO WRITE BYTE COUNT >>08130000
                                                                        08135000
              << SET UP WRITE BYTE COUNT CHANNEL INSTRUCTION >>         08140000
                                                                        08145000
              CHANP(WBC1) := WRITEBYTECOUNT;                            08150000
              CHANP(WBC2) := 2;                                         08155000
              CHANP(WBC3) := 0;                                         08160000
              CHANP(WBC4) := 0;                                         08165000
              CHANP(WBC5) := @DITP+SYSDB+DCBCNT; << ADDR OF BYTE CNT >> 08170000
                                                                        08175000
              << SET UP WRITE DATA CHANNEL INSTRUCTION >>               08180000
                                                                        08185000
              CHANP(CMND1) := WRITEDATA;                                08190000
              CHANP(CMND2) := DITP(DCBCNT);                             08195000
              CHANP(CMND3) := 0;                                        08200000
              CHANP(CMND4) := BANKNO;                                   08205000
              CHANP(CMND5) := BUFADR + DITP(DOFFSET);                   08210000
                                                                        08215000
              << UPDATE BUFERR OFFSET >>                                08220000
                                                                        08225000
              DITP(DOFFSET) := DITP(DOFFSET) + DITP(DCWCNT);            08230000
                                                                        08235000
            END;   << FUNCTION = 1; WRITE SPOOLFILE DATA >>             08240000
$PAGE                                                                   08245000
            BEGIN  << FUNCTION = 2; FILE OPEN >>                        08250000
                                                                        08255000
              << JUST RETURN GOOD COMPLETION >>                         08260000
                                                                        08265000
              IOQ'STAT := SUCCESSFUL;                          <<07417>>08270000
              GOTO EXIT;                                                08275000
                                                                        08280000
            END;   << FUNCTION = 2; FILE OPEN >>                        08285000
$PAGE                                                                   08290000
            BEGIN  << FUNCTION = 3; FILE CLOSE >>                       08295000
                                                                        08300000
              << JUST RETURN GOOD COMPLETION >>                         08305000
                                                                        08310000
              IOQ'STAT := SUCCESSFUL;                          <<07417>>08315000
              GOTO EXIT;                                                08320000
                                                                        08325000
            END;   << FUNCTION = 3; FILE CLOSE >>                       08330000
$PAGE                                                                   08335000
            BEGIN  << FUNCTION = 4; DEVICE CLOSE >>                     08340000
                                                                        08345000
              << SET UP THE CLEAR CHANNEL PROGRAM >>                    08350000
                                                                        08355000
              CHANP(JADR) := CLEARCP;  << SET INITIAL JUMP TO CLEAR >>  08360000
                                                                        08365000
              << SET UP CLEAR CHANNEL INSTRUCTION >>                    08370000
                                                                        08375000
              CHANP(CMND4) := JOB'CLOSE'CLEAR;                          08380000
              CHANP(CMND5) := 0;                                        08385000
                                                                        08390000
            END;   << FUNCTION = 4; DEVICE CLOSE >>                     08395000
$PAGE                                                                   08400000
            BEGIN  << FUNCTION = 15; READ I/O STATUS BLOCK >>           08405000
                                                                        08410000
              << CHECK FOR VALID COUNT >>                               08415000
                                                                        08420000
              IF DITP(DCBCNT) <> 32 THEN GOTO INVALIDFUNC;              08425000
                                                                        08430000
              << SET UP READ I/O STATUS CHANNEL PROGRAM >>              08435000
                                                                        08440000
              CHANP(JADR) := IO'STATUS'CP; << JUMP TO READ I/O STATUS >>08445000
                                                                        08450000
              << SET UP READ I/O STATUS CHANNEL INSTRUCTION >>          08455000
                                                                        08460000
              CHANP(CMND1) := READIOSTATUS;                             08465000
              CHANP(CMND2) := DITP(DCBCNT);                             08470000
              CHANP(CMND3) := 0;                                        08475000
              CHANP(CMND4) := BANKNO;                                   08480000
              CHANP(CMND5) := BUFADR;                                   08485000
              CHANP(WAIT2):=JUMP; <<IN THE CASE OF READ I/O >>          08490000
                          <<STATUS WE REPLACE THE WAIT WITH A>>         08495000
                                <<JUMP 0 TO GET TO NEXT INSTR>>         08500000
                                                                        08505000
            END;   << FUNCTION = 15; READ I/O STATUS BLOCK >>           08510000
$PAGE                                                                   08515000
            BEGIN  << FUNCTION = 71; READ LAST I/O STATUS FROM DIT >>   08520000
                                                                        08525000
              << CHECK FOR VALID COUNT >>                               08530000
                                                                        08535000
              IF DITP(DCBCNT) <> 32 THEN GOTO INVALIDFUNC;              08540000
                                                                        08545000
              << MOVE THE LAST STATUS TO THE CALLER'S BUFFER >>         08550000
                                                                        08555000
              TOS := BANKNO;          << TARGET BANK >>                 08560000
              TOS := BUFADR;          << TARGET ABSOLUTE ADDRESS >>     08565000
              TOS := 0;               << SOURCE BANK >>                 08570000
              TOS := @STATP + SYSDB;  << SOURCE ABSOLUTE ADDRESS >>     08575000
              TOS := 16;              << 16 WORDS OF I/O STATUS >>      08580000
              ASMB(MABS);                                               08585000
              GOTO DONE;                                                08590000
                                                                        08595000
            END;   << FUNCTION = 71; READ LAST I/O STATUS FROM DIT >>   08600000
$PAGE                                                                   08605000
            BEGIN  << FUNCTION = 72; DEVICE IDENTIFY >>                 08610000
                                                                        08615000
              << CHECK FOR VALID COUNT >>                               08620000
                                                                        08625000
              IF DITP(DCBCNT) <> 2 THEN GOTO INVALIDFUNC;               08630000
                                                                        08635000
              << SET UP THE IDENTIFY CHANNEL PROGRAM >>                 08640000
                                                                        08645000
              CHANP(JADR) := IDENTCP;  << INITIAL JUMP TO IDENTIFY >>   08650000
                                                                        08655000
              << SET UP IDENTIFY CHANNEL INSTRUCTION >>                 08660000
                                                                        08665000
              CHANP(CMND2) := IDENTIFY;                                 08670000
              CHANP(CMND3) := 0;       << IDENTIFY CODE RETURN AREA >>  08675000
              CHANP(CMND4) := INTERRUPT'HALT1;                          08680000
              CHANP(CMND5) := 1;       << COMPLETE >>                   08685000
                                                                        08690000
            END;   << FUNCTION = 72; DEVICE IDENTIFY >>                 08695000
$PAGE                                                                   08700000
            BEGIN  << FUNCTION = 73; INITIATE SELF TEST >>              08705000
                                                                        08710000
              << CHECK FOR VALID COUNT >>                               08715000
                                                                        08720000
              IF DITP(DCBCNT) <> 1 THEN GOTO INVALIDFUNC;               08725000
                                                                        08730000
              << SET UP INITIATE SELF TEST CHANNEL PROGRAM >>           08735000
                                                                        08740000
              CHANP(JADR) := SELFTESTCP;  << JUMP TO INIT. SELF TEST >> 08745000
                                                                        08750000
              << SET UP INITIATE SELF TEST CHANNEL INSTRUCTION >>       08755000
                                                                        08760000
              CHANP(CMND1) := INITSELFTEST;                             08765000
              CHANP(CMND2) := 1;  << BYTE COUNT IGNORED >>              08770000
              CHANP(CMND3) := 0;                                        08775000
              CHANP(CMND4) := 0;                                        08780000
              CHANP(CMND5) := 0;  << ADDRESS IGNORED >>                 08785000
                                                                        08790000
            END;   << FUNCTION = 73; INITIATE SELF TEST >>              08795000
$PAGE                                                                   08800000
            BEGIN  << FUNCTION = 74; READ SELF TEST RESULTS >>          08805000
                                                                        08810000
              << CHECK FOR VALID COUNT >>                               08815000
                                                                        08820000
              IF DITP(DCBCNT) <> 2 THEN GOTO INVALIDFUNC;               08825000
                                                                        08830000
              << SET UP READ SELF TEST RESULTS CHANNEL PROGRAM >>       08835000
                                                                        08840000
              CHANP(JADR) := SELFTESTCP;  << JUMP TO READ SELF TEST >>  08845000
                                                                        08850000
              << SET UP READ SELF TEST RESULTS CHANNEL INSTRUCTION >>   08855000
                                                                        08860000
              CHANP(CMND1) := READSELFTEST;                             08865000
              CHANP(CMND2) := DITP(DCBCNT);                             08870000
              CHANP(CMND3) := 0;                                        08875000
              CHANP(CMND4) := BANKNO;                                   08880000
              CHANP(CMND5) := BUFADR;                                   08885000
                                                                        08890000
            END;   << FUNCTION = 74; READ SELF TEST RESULTS >>          08895000
$PAGE                                                                   08900000
            BEGIN  << FUNCTION = 75; WRITE LOOPBACK BUFFER >>           08905000
                                                                        08910000
              << CHECK FOR VALID COUNT >>                               08915000
                                                                        08920000
              IF DITP(DCBCNT) <> 256 THEN GOTO INVALIDFUNC;             08925000
                                                                        08930000
              << SET UP WRITE LOOPBACK BUFFER CHANNEL PROGRAM >>        08935000
                                                                        08940000
              CHANP(JADR) := LOOPBACKCP; << JUMP TO WRITE LOOPBACK >>   08945000
                                                                        08950000
              << SET UP WRITE LOOPBACK BUFFER CHANNEL INSTRUCTION >>    08955000
                                                                        08960000
              CHANP(CMND1) := WRITELOOPBACK;                            08965000
              CHANP(CMND2) := DITP(DCBCNT);                             08970000
              CHANP(CMND3) := 0;                                        08975000
              CHANP(CMND4) := BANKNO;                                   08980000
              CHANP(CMND5) := BUFADR;                                   08985000
                                                                        08990000
            END;   << FUNCTION = 75; WRITE LOOPBACK BUFFER >>           08995000
$PAGE                                                                   09000000
            BEGIN  << FUNCTION = 76; READ LOOPBACK BUFFER >>            09005000
                                                                        09010000
              << CHECK FOR VALID COUNT >>                               09015000
                                                                        09020000
              IF DITP(DCBCNT) <> 256 THEN GOTO INVALIDFUNC;             09025000
                                                                        09030000
              << SET UP READ LOOPBACK BUFFER CHANNEL PROGRAMS >>        09035000
                                                                        09040000
              CHANP(JADR) := LOOPBACKCP; << JUMP TO WRITE LOOPBACK >>   09045000
                                                                        09050000
              << SET UP READ LOOPBACK BUFFER CHANNEL INSTRUCTION >>     09055000
                                                                        09060000
              CHANP(CMND1) := READLOOPBACK;                             09065000
              CHANP(CMND2) := DITP(DCBCNT);                             09070000
              CHANP(CMND3) := 0;                                        09075000
              CHANP(CMND4) := BANKNO;                                   09080000
              CHANP(CMND5) := BUFADR;                                   09085000
                                                                        09090000
            END;   << FUNCTION = 76; READ LOOPBACK BUFFER >>            09095000
$PAGE                                                                   09100000
            BEGIN  << FUNCTION = 189; DEVICE CLEAR >>                   09105000
                                                                        09110000
            CLEARFUNC:                                                  09115000
                                                                        09120000
              << SET UP THE CLEAR CHANNEL PROGRAM >>                    09125000
                                                                        09130000
              CHANP(JADR) := CLEARCP;  << SET INITIAL JUMP TO CLEAR >>  09135000
                                                                        09140000
              << SET UP CLEAR CHANNEL INSTRUCTION >>                    09145000
                                                                        09150000
              CHANP(CMND4) := JOB'ABORT'CLEAR;                          09155000
              CHANP(CMND5) := 0;                                        09160000
                                                                        09165000
            END;   << FUNCTION = 189; DEVICE CLEAR >>                   09170000
$PAGE                                                                   09175000
            BEGIN  << FUNCTION = 190; WRITE RECOVERY BLOCK >>           09180000
                                                                        09185000
              << CHECK FOR VALID COUNT >>                               09190000
                                                                        09195000
              IF DITP(DCBCNT) <> 32 THEN GOTO INVALIDFUNC;              09200000
                                                                        09205000
              << SET UP WRITE RECOVERY BLOCK CHANNEL PROG. >>           09210000
                                                                        09215000
              CHANP(JADR) := PAGERECVCP;  << JUMP TO WRITE RECOVERY >>  09220000
                                                                        09225000
              << SET UP WRITE RECOVERY BLOCK INSTRUCTION >>             09230000
                                                                        09235000
              CHANP(CMND1) := WRITEPGRECOVER;                           09240000
              CHANP(CMND2) := DITP(DCBCNT);                             09245000
              CHANP(CMND3) := 0;                                        09250000
              CHANP(CMND4) := BANKNO;                                   09255000
              CHANP(CMND5) := BUFADR;                                   09260000
                                                                        09265000
            END;   << FUNCTION = 190; WRITE RECOVERY BLOCK >>           09270000
$PAGE                                                                   09275000
            BEGIN  << FUNCTION = 191; READ ENVIRONMENTAL STATUS BLOCK >>09280000
                                                                        09285000
              << CHECK FOR VALID COUNT >>                               09290000
                                                                        09295000
              IF DITP(DCBCNT) <> 32 THEN GOTO INVALIDFUNC;              09300000
                                                                        09305000
              << SET UP READ ENV STATUS BLOCK CHANNEL PROGRAM >>        09310000
                                                                        09315000
              CHANP(JADR) := READENVSTATCP; << JUMP TO READ ENV STATUS>>09320000
                                                                        09325000
              << SET UP READ ENV STATUS BLOCK CHANNEL INSTRUCTION >>    09330000
                                                                        09335000
              CHANP(CMND1) := READENVSTATUS;                            09340000
              CHANP(CMND2) := DITP(DCBCNT);                             09345000
              CHANP(CMND3) := 0;                                        09350000
              CHANP(CMND4) := BANKNO;                                   09355000
              CHANP(CMND5) := BUFADR;                                   09360000
                                                                        09365000
            END;   << FUNCTION = 191; READ ENVIRONMENTAL STATUS BLOCK >>09370000
          END;   << DRIVER FUNCTION CASES >>                            09375000
$PAGE "SET UP AND START THE CHANNEL PROGRAM"                            09380000
      START'CHANP:                                                      09385000
                                                                        09390000
        << SET UP INTERNAL READ I/O STATUS AND INTERRUPT HALT >>        09395000
                                                                        09400000
        CHANP(IOST2) := 32;  << I/O STATUS READ BYTE COUNT >>           09405000
        CHANP(IOST5) := @STATP + SYSDB; << I/O STATUS READ AREA >>      09410000
        CHANP(STHLT):=DSJ1'AFTER;<<I/O STATUS READ AFTER XFER>><<07417>>09415000
                                                                        09420000
        << CLEAR THE CHANNEL PROGRAM VARIABLE AREA >>                   09425000
                                                                        09430000
        INDEX := 0;                                                     09435000
        DO ILTP(INDEX) := 0 UNTIL (INDEX := INDEX+1) > 3;               09440000
                                                                        09445000
        << START THE CHANNEL PROGRAM...... >>                           09450000
                                                                        09455000
        START'HPIB(DITP, CHANP, TRUE);                                  09460000
        IF < THEN GOTO CHANPFAIL;                                       09465000
                                                                        09470000
        << SET UP TIMER REQUEST TO TIME THE COMMAND >>                  09475000
                                                                        09480000
        IF DIAGNOSTIC THEN                                              09485000
          DITP(DTRLX) := TIMEREQ(%20,@DITP,60000D);  << 60 SECONDS >>   09490000
                                                                        09495000
        IOQ'STAT := PENDING;                                   <<07417>>09500000
        IOQ'QMISC := MISC;                                     <<07417>>09505000
        MSTATE := COMPLETION'WAIT;                                      09510000
        RETURN;                                                         09515000
                                                                        09520000
        << THE FOLLOWING HELP CALL IS FOR LINKAGE TO HELP >>            09525000
        << IT IS NEVER DIRECTLY EXECUTED.                 >>            09530000
                                                                        09535000
        HELP;                                                           09540000
      END;   << DRIVER INITIATOR >>                                     09545000
                                                                        09550000
                                                                        09555000
$PAGE "HP2680A PAGE PRINTER DRIVER COMPLETOR"                           09560000
                                                                        09565000
    << CHECK CPVA0 FOR CHANNEL PROGRAM ERROR/STATUS CONDITIONS >>       09570000
                                                                        09575000
    CPPSTATUS := ILTP; << CPVA0 >>                                      09580000
    IF CPPSTATUS.ERRORCODE = 6 THEN GOTO CHANNEL'FAILURE;               09585000
    IF CPPSTATUS.ERRORCODE = 7 THEN                                     09590000
      BEGIN                                                             09595000
        IF NOT CPPSTATUS.TIMEDOUT THEN GO TO CHANNEL'FAILURE;           09600000
        IF TIMEOUT THEN BEGIN                                           09605000
          IF DIAGNOSTIC OR ((GETDRT(DRTN,0))<>(@CHANP+SYSDB))  <<03009>>09610000
            THEN GOTO UNIT'FAIL ELSE GOTO OFFLINECODE;                  09615000
            <<IF DRTPTR=@CHANP+SYSDB THEN GIC TIMEDOUT ON>>             09620000
            <<FIRST INSTRUCTION UNLESS WE ARE CALLED BY>>               09625000
            <<DIAGNOSTIC WE WILL TREAT THIS AS OFFLINE>>                09630000
        END                                                             09635000
        ELSE                                                            09640000
          BEGIN  << GIC TIMEOUT ; CHECK FOR A PARITY ERROR >>           09645000
            SETTIMEOUT;                                                 09650000
            CHANP(JADR) := IOSTATCP;                                    09655000
            GOTO START'CHANP;                                  <<07417>>09660000
          END;                                                          09665000
      END;                                                              09670000
                                                                        09675000
    << CHECK CPVA1 TO SEE HOW CHANNEL PROGRAM ENDED >>                  09680000
                                                                        09685000
    IF ILTP(CPVA1).IOSTAT = 1 THEN SETIOSTATUS;                         09690000
    IF ILTP(CPVA1).FINISH = 0 THEN SETBLOCKRETRY;                       09695000
                                                                        09700000
    << IF WE GOT THIS FAR AND THE FUNCTION IS AN IDENTIFY THEN >>       09705000
    << RETURN THE IDENTIFY CODE TO THE USERS BUFFER.           >>       09710000
                                                                        09715000
    IF FUNCTION = IDENTIFYFUNC THEN                                     09720000
      BEGIN << MOVE THE IDENTIFY CODE TO THE USERS BUFFER >>            09725000
        TOS := BANKNO;           << USER BUFFER BANK NUMBER >>          09730000
        TOS := BUFADR;           << USERS BUFFER ADDRESS >>             09735000
        TOS := CHANP(CMND3);     << IDENTIFY CODE >>                    09740000
        ASMB(SSEA);              << STORE INTO USERS BUFFER >>          09745000
        DDEL;                    << DELETE BANK & ADDRESS >>            09750000
      END;                                                              09755000
$PAGE "I/O STATUS EVALUATION"                                           09760000
                                                                        09765000
    << CHECK IF ANALYSIS OF I/O STATUS IS NECESSARY >>                  09770000
                                                                        09775000
    IF IOSTATUS THEN                                                    09780000
      BEGIN << I/O STATUS WAS READ >>                                   09785000
        CLEARIOSTATUS;                                                  09790000
                                                                        09795000
                                                                        09800000
        IOQ'STAT:=IF DIAGNOSTIC THEN SPOOLERSTATUS ELSE        <<07417>>09805000
                                                       SUCCESSFUL;      09810000
        <<STATUS MAY BE OVERWRITTEN AFTER FURTHER CHECKING>>            09815000
                                                                        09820000
        IF ( (FUNCTION=DATAWRITE) LAND BLOCKRETRY ) OR                  09825000
           (FUNCTION=DEVICECLOSE)                                       09830000
           THEN IOQ'STAT := RETRANSMIT'SPOOL;                  <<07417>>09835000
                                                                        09840000
        << CHECK I/O STATUS WORDS 4 & 5 FOR ERROR CONDITIONS >>         09845000
                                                                        09850000
        IF STATP(4) <> 0 OR STATP(5) <> 0 THEN                          09855000
          BEGIN                                                         09860000
           IF ( (FUNCTION=DATAWRITE) LAND BLOCKRETRY ) OR               09865000
              (FUNCTION=DEVICECLOSE)                                    09870000
              THEN IOQ'STAT := RETRANSMIT'SPOOL                <<07417>>09875000
              ELSE IOQ'STAT := SPOOLERSTATUS;                  <<07417>>09880000
          END; <<ANALYSIS OF I/O STATUS WORDS 4&5 >>                    09885000
                                                                        09890000
        << CHECK I/O STATUS WORD 3 FOR AN MCS FAULT NUMBER >>           09895000
                                                                        09900000
        IF STATP(3)<>0 THEN                                             09905000
          BEGIN  << CHECK OUT I/O STATUS WORD 3 >>                      09910000
            DITP(DLOGBUFFER):=DITP(DIOSTAT+1);                          09915000
            DITP(DLOGBUFFER+1):=DITP(MCS'WORD);                         09920000
            <<MOVE WORD 1 AND WORD 3 TO DLOGBUFFER SO IT CAN BE LOGGED>>09925000
            DITP(DSERR):=LOG'BUFFER; <<LOG WORD 1 AND MCS STATUS>>      09930000
          END;   << ANALYSIS OF I/O STATUS WORD 3 >>                    09935000
                                                                        09940000
        << CHECK I/O STATUS WORD 1 FOR ERROR CONDITIONS >>              09945000
                                                                        09950000
        IF STATP.(1:1) = 1 THEN                                         09955000
          BEGIN  << CHECK OUT I/O STATUS WORD 1 >>                      09960000
            IOSTATUS1 := STATP(1);                                      09965000
            IF <> THEN                                                  09970000
              BEGIN  << I/O STATUS WORD 1 CONTAINS VALID INFORMATION >> 09975000
                                                                        09980000
                IF POWERUP THEN                                         09985000
                  BEGIN                                                 09990000
                    IOQ'STAT := POWERUPSTAT;                   <<07417>>09995000
                    GOTO ERROREXIT;                                     10000000
                  END;                                                  10005000
                                                                        10010000
                IF ADVISORY THEN                                        10015000
                  BEGIN                                                 10020000
                    IF NOT IOMESSAGE(PPSET,ADVISORY'MSG,%10000,         10025000
                       DITP(DLDEV),,,,, ) THEN GOTO SYSERR;    <<07417>>10030000
                  END;                                                  10035000
                                                                        10040000
                                                                        10045000
                IF OFFLINE THEN                                         10050000
                  BEGIN  << START AN OPERATOR WAIT SEQUENCE >>          10055000
                    IF DIAGNOSTIC THEN                                  10060000
                      BEGIN  << FALL THRU, DON'T CAUSE A WAIT >>        10065000
                        IOQ'STAT := OFFLINESTAT;               <<07417>>10070000
                        GOTO EXIT;                                      10075000
                      END;                                              10080000
                    IF STATP.(4:2)=0 THEN BEGIN                         10085000
OFFLINECODE:                                                            10090000
                      IF NOT IOMESSAGE(SYSMSET,NRDYMSG,%10000,          10095000
                         DITP(DLDEV),,,,, ) THEN GOTO SYSERR;  <<07417>>10100000
                      START'IDLEWAIT(OFFLINESTAT);                      10105000
                      RETURN;                                           10110000
                    END; <<IF THERE IS STATUS IN 4 OR 5 WE MUST RETURN>>10115000
                         <<IT OR IT WILL BE LOST.  THE DRIVER WILL>>    10120000
                         <<SEE THAT THE DEVICE IS OFFLINE ON THE>>      10125000
                         <<NEXT REQUEST AND START THE IDLE CP>>         10130000
                  END;                                                  10135000
                                                                        10140000
                IF PARITY THEN                                          10145000
                  BEGIN                                                 10150000
                    IF STATP.(4:2)=0 THEN BEGIN                         10155000
                      IF FUNCTION = DATAWRITE THEN SETBLOCKRETRY;       10160000
                      BUMPPARITY;                                       10165000
                      IF = THEN GOTO COMMAND'RETRY;                     10170000
                      DITP(DSTAT) := -1;                                10175000
                      IOQ'STAT := PARITY'ERROR;                <<07417>>10180000
                      DITP(DSERR):=LOG'DSTAT;  <<LOG ERROR>>            10185000
                      GOTO ERROREXIT;                                   10190000
                    END ELSE IOQ'STAT := RETRANSMIT'SPOOL;     <<07417>>10195000
                  END;                                                  10200000
                                                                        10205000
                IF XFERERROR THEN                                       10210000
                  BEGIN                                                 10215000
                    IF STATP.(4:2)=0 THEN BEGIN                         10220000
                      IF FUNCTION = DATAWRITE THEN SETBLOCKRETRY;       10225000
                      BUMPXFER;                                         10230000
                      IF = THEN GOTO COMMAND'RETRY;                     10235000
                      IOQ'STAT := TRANSFER'ERROR;              <<07417>>10240000
                      DITP(DLOGBUFFER):=DITP(DIOSTAT+1);                10245000
                      DITP(DLOGBUFFER+1):=DITP(MCS'WORD);               10250000
                      DITP(DSERR):=LOG'BUFFER;                          10255000
                      <<MOVE STATUS WORDS 1&3 TO DLOGBUFFER             10260000
                        AND LOG THEM>>                                  10265000
                      GOTO ERROREXIT;                                   10270000
                    END ELSE IOQ'STAT := RETRANSMIT'SPOOL;     <<07417>>10275000
                  END;                                                  10280000
                                                                        10285000
              END;                                                      10290000
          END;   << ANALYSIS OF I/O STATUS WORD 1 >>                    10295000
                                                                        10300000
         GOTO EXIT;                                                     10305000
      END;  << I/O STATUS WAS READ >>                                   10310000
$PAGE "CLEANUP AND STATUS REPORTING"                                    10315000
  DONE:                                                                 10320000
                                                                        10325000
    IF BLOCKRETRY THEN GOTO WRITERETRYBLOCK;                            10330000
                                                                        10335000
    IF MULTIBLOCKMODE THEN GOTO WRITEMULTIBLOCK;                        10340000
                                                                        10345000
    IOQ'STAT := SUCCESSFUL;                                    <<07417>>10350000
    GOTO EXIT;                                                          10355000
                                                                        10360000
  INVALIDFUNC:                                                          10365000
                                                                        10370000
    IOQ'STAT := INVALID;                                       <<07417>>10375000
    GOTO ERROREXIT;                                                     10380000
                                                                        10385000
  CHANPFAIL:                                                            10390000
                                                                        10395000
    IOQ'STAT := BADCHANP;                                      <<07417>>10400000
    GOTO ERROREXIT;                                                     10405000
                                                                        10410000
  UNIT'FAIL:                                                            10415000
                                                                        10420000
    IOQ'STAT := UNIT'FAILURE;                                  <<07417>>10425000
    GOTO ERROREXIT;                                                     10430000
                                                                        10435000
  SYSERR:                                                               10440000
                                                                        10445000
    IOQ'STAT := SYSTEMERROR;                                   <<07417>>10450000
    GOTO ERROREXIT;                                                     10455000
                                                                        10460000
  CHANNEL'FAILURE:                                                      10465000
                                                                        10470000
    DITP(DSTAT) := ILTP;       << CPVA 0 >>                             10475000
    IOQ'STAT := CNTRLNOGOOD;                                   <<07417>>10480000
    DITP(DSERR):=LOG'DSTAT;  <<LOG ERROR>>                              10485000
                                                                        10490000
  ERROREXIT:                                                            10495000
                                                                        10500000
    IOQ'COUNT := 0;    << ZERO COUNT ON ERROR >>               <<07417>>10505000
                                                                        10510000
  EXIT:                                                                 10515000
<< DEBUGGING SOFTWARE >>                                       <<DEBUG>>10520000
                                                               <<DEBUG>>10525000
IF DITP(DDEBUG).(15:1)=1 THEN                                  <<DEBUG>>10530000
  BEGIN                                                        <<DEBUG>>10535000
    IOMESSAGE(PPSET,2000,%11100,IOQ'FUNC,                      <<07417>>10540000
      IOQ'COUNT,IOQ'STAT);                                     <<07417>>10545000
                                                               <<DEBUG>>10550000
    IF FUNCTION = 1 THEN                                       <<DEBUG>>10555000
      BEGIN                                                    <<DEBUG>>10560000
        TOS := BANK;                                           <<DEBUG>>10565000
        TOS := BUFADR+2;  << SPOOLER FUNCTION >>               <<DEBUG>>10570000
        ASMB(LSEA);                                            <<DEBUG>>10575000
        IOMESSAGE(PPSET,2001,%10000,S0);                       <<DEBUG>>10580000
        DDEL;                                                  <<DEBUG>>10585000
        TOS := BUFADR+510; << RECORD NUMBER >>                 <<DEBUG>>10590000
        ASMB(LDEA);                                            <<DEBUG>>10595000
        IOMESSAGE(PPSET,2002,%11000,S1,S0);                    <<DEBUG>>10600000
        DDEL; DDEL;                                            <<DEBUG>>10605000
      END;                                                     <<DEBUG>>10610000
                                                               <<DEBUG>>10615000
    IF IOQ'STAT = %13 OR IOQ'STAT = %23 THEN                   <<07417>>10620000
      BEGIN                                                    <<DEBUG>>10625000
        IOMESSAGE(PPSET,2003,%11100,DITP(21),DITP(22),         <<DEBUG>>10630000
          DITP(29),DITP(30));                                  <<DEBUG>>10635000
      END;                                                     <<DEBUG>>10640000
  END;                                                         <<DEBUG>>10645000
                                                               <<DEBUG>>10650000
                                                                        10655000
    MSTATE := COMPLETED;                                                10660000
    IOQ'QMISC := MISC;                                         <<07417>>10665000
  END;  << PAGE PRINTER DRIVER >>                                       10670000
                                                                        10675000
$PAGE "OUTER BLOCK"                                                     10680000
                                                                        10685000
ASMB( PCAL SIODM;       << DRIVER MONITOR >>                            10690000
      PCAL PPDRIVER;    << DRIVER INITIATOR >>                          10695000
      PCAL PPDRIVER;    << DRIVER COMPLETOR >>                          10700000
      CON  0;           << NO I/O PROCESS NECESSARY >>                  10705000
      CON  0;           << NO INITIALIZATION PROCEDURE >>               10710000
      CON  1;           << ONE INTERRUPT HANDLER >>                     10715000
      PCAL GIP'HPIB);   << GENERAL INTERRUPT HANDLER >>                 10720000
END.                                                                    10725000
