IDENT XHC,XHC
PERIPH
BASE MIXED
SST
TITLE XHC - HOSTCOPY DRIVER FOR 5870/5970 NIP.
*COMMENT XHC - HOSTCOPY DRIVER FOR 5870/5970 NIP.
COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
XHC SPACE 4,10
*** XHC TRANSFERS DATA TO THE HOSTCOPY UTILITY
* RESIDING ON A NIP PRINTER. 128 8-BIT BYTES OR 80
* 8-BIT BYTES ARE TRANSFERED AT A TIME.
*
* L. M. BURGHER 84/09/22.
* S. V. PRESTON 84/09/22.
SPACE 4,10
*** CALL.
*
*T 18/ *XHC*, 24/, 18/ CNTB
*
* CNTB ADDRESS OF CONTROL BLOCK *CNTB*.
SPACE 4,10
** CNTB - CONTROL BLOCK.
*
* COMMUNICATION BETWEEN XHC AND THE CALLING CP PROGRAM
* OCCURS IN *CNTB*.
*
*T CNTC 3/ ,9/ EQ ,11/ ,1/ T,11/ ,1/ I,11/ ,1/C
*T DRPC 42/ , 18/ DRP
*
* EQ = EQUIPMENT NUMBER.
* T = (1), TERMINATE XHC.
* I = (1), CARD IMAGE.
* C = (1), REQUEST COMPLETE.
* DRP = DATA RECORD ADDRESS.
SPACE 4,10
*** DAYFILE AND ERRLOG MESSAGES.
*
* *EQXXX CHYY ADDDD INCOMPLETE TRANSFER.* =
* AN INCOMPLETE DATA TRANSFER WAS DETECTED.
*
* *EQXXX CHYY GSSSS COUPLER STATUS.* =
* CCC COUPLER STATUS.
*
* *EQXXX CHYY CONTROLWARE NOT LOADED.*=
* CCC CONTROLWARE NOT SUCCESSFULLY LOADED.
*
* *EQXXX CHYY RESERVED.* = EQUIPMENT FOUND RESERVED.
*
* *EQXXX INCORRECT EQUIPMENT TYPE.* =
* EQUIPMENT REQUESTED WAS NOT OF TYPE *LX* OR *LY*.
*
* *EQXXX INCORRECT EQUIPMENT NUMBER.* =
* EQUIPMENT NUMBER NOT IN EST.
*
* *EQXXX NOT AVAILABLE.* = EQUIPMENT REQUESTED IS DOWN AND OFF.
*
* *TABLE NOT IN FL.* = HSTCOPY TABLE POINTER IS OUTSIDE FL.
*
* *INCORRECT JOB ORIGIN.* = CALLING PROGRAM IS NOT SYSTEM ORIGIN
*
* WHERE -
* EQ = EQUIPMENT TYPE (LX, LY).
* XXX = EST ORDINAL.
* YY = CHANNEL.
* DDDD = NUMBER OF BYTES REMAINING.
* SSSS = COUPLER STATUS.
SPACE 4,10
** COMMON DECKS.
*CALL COMPCHI
*CALL COMPMAC
TITLE ASSEMBLY CONSTANTS.
SPACE 4,10
**** DIRECT CELL ASSIGNMENTS.
BC EQU 25 BYTE COUNT
EQ EQU 27 EQUIPMENT NUMBER
ES EQU 30 - 34 EST ENTRY
FC EQU 35 FUNCTION CODE
T8 EQU 36 TEMPORARY
TM EQU 45 TERMINATE REQUEST FLAG
SPACE 4,10
** CONTROL BLOCK DEFINITIONS.
CNTC EQU 0 CONTROL BLOCK WORD
DRPC EQU 1 DATA RECORD POINTER
CNTBL EQU 2 CONTROL BLOCK LENGTH
SPACE 4,10
** DAYFILE MESSAGE CODES.
LOC 0
EITM BSS 1 *EQXXX CHYY ADDDD INCOMPLETE TRANSFER.*
EGSM BSS 1 *EQXXX CHYY GSSSS COUPLER STATUS.*
ENLM BSS 1 *EQXXX CHYY CCC CONTROLWARE NOT LOADED.*
ERSM BSS 1 *EQXXX CHYY RESERVED.*
ETYM BSS 1 *EQXXX INCORRECT EQUIPMENT TYPE.*
ENMM BSS 1 *EQXXX INCORRECT EQUIPMENT NUMBER.*
ENAM BSS 1 *EQXXX NOT AVAILABLE.*
EFLM BSS 1 *TABLE NOT IN FL.*
EJOM BSS 1 *INCORRECT JOB ORIGIN.*
LOC *O
SPACE 4,10
** CCC FUNCTION DEFINITIONS.
FSUF EQU 0 SELECT UNIT
FGSF EQU 12 GENERAL STATUS
FTDF EQU 20 TRANSPARENT DATA TRANSFER
SPACE 4,10
** MISCELLANEOUS CONSTANTS.
BFCL EQU 128D*8D/60D+1 BUFF LENGTH IN CM WORDS
BINL EQU 128D*8D/12D+1 BINARY BUFFER LENGTH
CRDL EQU 80D*8D/12D+1 CARD IMAGE BUFFER LENGTH
CH EQU 12 CHANNEL NUMBER
NILP EQU 377777 NIL POINTER
****
TITLE MAIN PROGRAM.
** XHC - MAIN PROGRAM.
ORG PPFW
XHC RJM PRS PRESET *XHC*
XHC1 RJM RCB READ CONTROL BLOCK
ZJN XHC2 IF NO DATA TO TRANSFER
CRM BUFF,T2 READ DATA RECORD
RJM XDR TRANSFER DATA RECORD
UJN XHC3 CHECK FOR MOVE REQUEST
XHC2 LDD TM
NJN TRM IF REQUEST TO TERMINATE
XHC3 PAUSE PAUSE FOR STORAGE MOVE
LDD CM+1
ZJN XHC1 IF NO CONTROL POINT ERROR
UJN TRM1 ERROR EXIT
TITLE TERMINATION PROCESSORS.
TRM SPACE 4,10
** TRM - TERMINATION PROCESSOR.
*
* EXIT TO *PPR*.
*
* CALLS CRQ, DEQ.
*
* MACROS MONITOR.
TRM RJM CRQ COMPLETE REQUEST
* TRM1 IS A SECONDARY ENTRY POINT FOR TRM.
TRM1 RJM DEQ DROP EQUIPMENT
MONITOR DPPM DROP PP
LJM PPR EXIT TO PP RESIDENT
ABT SPACE 4,10
** ABT - ABORT JOB.
*
* EXIT TO *PPR*.
*
* CALLS DEQ.
*
* MACROS MONITOR.
ABT RJM DEQ DROP EQUIPMENT
MONITOR ABTM ABORT JOB
LJM PPR EXIT TO PP RESIDENT
TITLE ERR - ERROR PROCESSOR.
ERR SPACE 4,10
** ERR - ERROR PROCESSOR.
*
* ENTRY (A) = MESSAGE CODE.
* (FC) = STATUS/BYTES REMAINING.
* (ES - ES+4) = EST ENTRY.
*
* USES T1, T2, T5.
*
* CALLS C2D, DFM.
ERR SUBR ENTRY/EXIT
SHN 1 GET TABLE ADDRESS
STD T1
LDM TDFP+1,T1 SET MESSAGE ADDRESS
STD T5
LDM TDFP,T1 SET PROCESSING ADDRESS
STD T2
LJM 0,T2 FORMAT ERROR MESSAGE
ERR3 LDD FC CONVERT STATUS / BYTE COUNT REMAINING
SHN -6
RJM C2D
STM 6,T5
LDD FC
RJM C2D
STM 7,T5
ERR4 LDD ES+1 CONVERT CHANNEL NUMBER TO DISPLAY CODE
RJM C2D
STM 4,T5
LDD ES+3 SET EQUIPMENT TYPE
STI T5
ERR5 LDM CNTB+CNTC*5+0 CONVERT EQUIPMENT NUMBER
SHN -3
RJM C2D
STM 1,T5
LDM CNTB+CNTC*5+0
RJM C2D
SHN 6
LMN 1R
STM 2,T5
ERR6 LDD T5 SEND MESSAGE TO DAYFILE
RJM DFM
LDC ERLN SEND MESSAGE TO ERROR LOG
LMD T5
RJM DFM
LJM ERRX RETURN
SPACE 4,10
** TDFP - TABLE OF PROCESSORS AND MESSAGES.
*
* *TDFP* IS INDEXED WITH DAYFILE MESSAGE CODES.
*
* ENTRY - 2 WORDS.
*
* INDEXED BY (MESSAGE CODE * 2).
TDFP EQU *
LOC 0
CON ERR3,=C*EQXXX CHYY ADDDD INCOMPLETE TRANSFER.*
CON ERR3,=C*EQXXX CHYY GSSSS ADAPTER STATUS.*
CON ERR4,=C*EQXXX CHYY CCC CONTROLWARE NOT LOADED.*
CON ERR4,=C*EQXXX CHYY RESERVED.*
CON ERR5,=C*EQXXX INCORRECT EQUIPMENT TYPE.*
CON ERR5,=C*EQXXX INCORRECT EQUIPMENT NUMBER.*
CON ERR5,=C*EQXXX NOT AVAILABLE.*
CON ERR6,=C*TABLE NOT IN FL.*
CON ERR6,=C*INCORRECT JOB ORIGIN.*
LOC *O
TDFPL EQU *-TDFP
USE LITERALS
TITLE XDR - TRANSFER DATA RECORD.
XDR SPACE 4,10
** XDR - TRANSFER DATA RECORD.
*
* ENTRY (BC) = BYTE COUNT.
* (BUFF) = DATA BUFFER.
*
* ERROR TO *TRM1*, IF CONTROL POINT ERROR.
*
* TO *ABT*, IF INCOMPLETE DATA TRANSFER OR
* BAD ADAPTER STATUS.
*
* USES FC.
*
* CALLS CRQ, ERR, FCN.
XDR3 RJM CRQ COMPLETE REQUEST
XDR SUBR ENTRY/EXIT
LDN FTDF ISSUE TRANSPARENT DATA TRANSFER FUNCTION
RJM FCN
LDD BC BYTE COUNT
OAM BUFF,CH OUTPUT BUFFER
ZJN XDR1 IF TRANSFER COMPLETE
STD FC REMAINING BYTE COUNT
LDN EITM *EQXXX CHYY INCOMPLETE TRANSFER.*
UJN XDR2 REPORT ERROR
XDR1 FJM *,CH IF XFER INCOMPLETE
DCN CH+40
LDN FGSF ISSUE GENERAL STATUS FUNCTION
RJM FCN
IAN CH
ZJN XDR3 IF STATUS OK
STD FC SAVE STATUS
LDN EGSM *EQXXX CHYY GSSSS ADAPTER STATUS.*
XDR2 RJM ERR PROCESS ERROR
LJM ABT ABORT JOB
TITLE SUBROUTINES.
CAD SPACE 4,15
** CAD - COMPUTE ABSOLUTE ADDRESS.
*
* ENTRY (A) = WORD COUNT.
* (T1) = INDIRECT ADDRESS OF ADDRESS.
* ((T1)) - ((T1)+1) = ADDRESS.
*
* EXIT (A) = ABSOLUTE ADDRESS.
* (T2) = WORD COUNT.
*
* ERROR TO *ERR*, IF TABLE NOT IN FL.
*
* USES T2.
*
* CALLS ERR.
CAD2 LDI T1 LOAD ABSOLUTE ADDRESS
LPN 77
SHN 6
ADD RA
SHN 6
ADM 1,T1
CAD SUBR ENTRY/EXIT
STD T2 SAVE WORD COUNT
LDI T1
LPN 77
SHN 14
MJN CAD1 IF OUT OF RANGE
LMM 1,T1
ADD T2
SHN -6
SBD FL
MJN CAD2 IF < FL - WORD COUNT
CAD1 LDN EFLM *TABLE NOT IN FL.*
RJM ERR PROCESS ERROR
LJM ABT ERROR EXIT
CRQ SPACE 4,15
** CRQ - COMPLETE REQUEST.
*
* ENTRY (IR+3) - (IR+4) = CNTB ADDRESS.
*
* EXIT CNTB UPDATED IN CM.
*
* USES T1, CM - CM+4.
*
* CALLS CAD.
*
* MACROS MONITOR.
CRQ SUBR ENTRY/EXIT
AOM CNTB+CNTC*5+4 SET REQUEST BIT
LDN IR+3 CONTROL BLOCK ADDRESS
STD T1
LDN CNTBL CONTROL BLOCK LENGTH
RJM CAD COMPUTE ABSOLUTE ADDRESS
CWM CNTB,ON UPDATE CONTROL WORD
LDD CP
ADN STSW FETCH CONTROL POINT STATUS WORD
CRD CM
LDD CM CHECK CPU STATE
SHN -11
LMN 6
NJN CRQX IF NOT IN *I* STATUS
MONITOR RCPM
UJN CRQX RETURN
DEQ SPACE 4,10
** DEQ - DROP EQUIPMENT.
*
* ENTRY (EQ) = 0, IF NO EQUIPMENT ASSIGNED.
* (EQ) = EQUIPMENT NUMBER.
* (ES - ES+4) = EST ENTRY.
*
* EXIT (EQ) = 0.
*
* USES CM - CM+4.
*
* MACROS DCHAN, MONITOR.
DEQ SUBR ENTRY/EXIT
LDD EQ
ZJN DEQX IF NO EQUIPMENT ASSIGNED.
LDD ES+1 DROP CHANNEL
DCHAN
LDD EQ DROP EQUIPMENT
STD CM+1
MONITOR DEQM
* LDN 0 INDICATE EQUIPMENT RELEASED
STD EQ
UJN DEQX RETURN
FCN SPACE 4,15
** FCN - ISSUE FUNCTION TO EQUIPMENT.
*
* ENTRY (A) = FUNCTION CODE.
*
* EXIT CHANNEL ACTIVE.
*
* ERROR TO *TRM1*, IF CONTROL POINT ERROR.
*
* USES FC.
*
* MACROS PAUSE.
FCN2 ACN CH ACTIVATE CHANNEL
FCN SUBR ENTRY/EXIT
STD FC SAVE FUNCTION CODE
FAN CH ISSUE FUNCTION
FCN1 IJM FCN2,CH IF FUNCTION ACCEPTED
SBN 1
NJN FCN1 IF NOT TIMED OUT
PAUSE PAUSE FOR STORAGE MOVE
LDD CM+1
ZJN FCN1 IF NO CONTROL POINT ERROR
DCN CH+40
LJM TRM1 ERROR EXIT
RCB SPACE 4,15
** RCB - READ CONTROL BLOCK.
*
* ENTRY (IR+3) - (IR+4) = CNTB ADDRESS.
*
* EXIT (A) = 0, IF NO DATA TO TRANSFER.
* (A) = DATA RECORD ADDRESS.
* (T2) = *BFCL*, IF (A) = DATA RECORD ADDRESS.
* (CNTB) UPDATED, IF (A) = DATA RECORD ADDRESS.
* (TM) <> 0, IF REQUEST TO TERMINATE.
*
* USES T1.
*
* CALLS CAD.
RCB1 AOD TM SET *TERMINATE REQUEST*
RCB2 LDN 0 INDICATE NO REQUEST
RCB SUBR ENTRY/EXIT
LDN IR+3 CNTB ADDRESS
STD T1
LDN CNTBL CNTB LENGTH
RJM CAD COMPUTE ABSOLUTE ADDRESS
CRM CNTB,T2 READ CNTB
LDM CNTB+CNTC*5+4 CHECK REQUEST BIT
SHN 21-0
MJN RCB2 IF NO REQUEST
LDM CNTB+CNTC*5+1 CHECK TERMINATE REQUEST
SHN 21-0
MJN RCB1 IF NOT REQUEST TO TERMINATE
LDM CNTB+DRPC*5+3 GET DATA RECORD POINTER
SHN 14
ADM CNTB+DRPC*5+4
LMC NILP
ZJN RCBX IF NIL
LDC CNTB+DRPC*5+3 DATA RECORD ADDRESS
STD T1
LDN BFCL DATA RECORD LENGTH
RJM CAD COMPUTE ABSOLUTE ADDRESS
UJP RCBX RETURN
SPACE 4,10
** COMMON DECKS.
*CALL COMPC2D
SPACE 4,10
USE BUFFER
BUFF EQU * DATA RECORD BUFFER
BUFE EQU BUFF+BFCL*5 END OF DATA BUFFER
CNTB EQU BFMS-CNTBL*5 CONTROL BLOCK
ERRNG CNTB-BUFE
ERRNG CNTB-PRSE
TITLE XHC PRESET.
PRS SPACE 4,15
** PRS - XHC PRESET.
*
* ENTRY (IR+3 - IR+4) = CONTROL BLOCK ADDRESS.
*
* EXIT (BC) = CRDL, IF CARD IMAGE FILE.
* (BC) = BINL, IF BINARY FILE.
* (EQ) = EQUIPMENT NUMBER.
* (ES - ES+4) = EST ENTRY.
* CHANNEL INSTRUCTIONS MODIFIED.
* EQUIPMENT AND CHANNEL RESERVED.
* NIP UNIT SELECTED.
*
* ERROR TO *ABT*, IF INCORRECT JOB ORIGIN OR
* EQUIPMENT PROBLEM.
*
* TO *TRM1*, IF CONTROL POINT ERROR.
*
* USES BC, CM - CM+4, EQ, ES - ES+4, FR, TM, T8.
*
* CALLS CRQ, ERR, FCN, GST, MCI, RCB.
*
* MACROS MONITOR, PAUSE, RCHAN.
PRS SUBR ENTRY/EXIT
LDN 0
STD EQ EQUIPMENT NOT ASSIGNED
STD TM TERMINATE NOT REQUESTED
LDD CP CHECK FOR SYOT ORIGIN
ADN JOTW
CRD CM
LDD CM+3
* LMN SYOT
ZJN PRS1 IF SYSTEM ORIGIN
LDN EJOM *INCORRECT JOB ORIGIN.*
UJN PRS4 PROCESS ERROR
PRS1 RJM RCB READ CONTROL BLOCK
LDM CNTB+CNTC*5+3
SHN 21-0
MJN PRS2 IF CARD IMAGE FILE
LDC BINL
UJN PRS3
PRS2 LDN CRDL
PRS3 STD BC
LDN ESTP GET EST TABLE ADDRESS
CRD CM
LDM CNTB+CNTC*5+0 GET EQUIPMENT NUMBER
LPC 777
STD T8
STD CM+1
SBD CM+2
MJN PRS5 IF ENTRY IN EST
LDN ENMM *EQXXX CHYY INCORRECT EQUIPMENT NUMBER.*
PRS4 RJM ERR PROCESS ERROR
LJM ABT ABORT JOB
PRS5 SFA EST,CM+1
ADK EQDE
CRD ES READ EST ENTRY
LDD ES+3 CHECK FOR NIP
LMC 2RLX
ZJN PRS6 IF 5870
LMN 2RLY&2RLX
ZJN PRS6 IF 5970
LDN ETYM *EQXXX INCORRECT EQUIPMENT TYPE.*
UJN PRS4 ERROR EXIT
PRS6 STD CM+2
LDD ES CHECK STATUS OF EQUIPMENT
SHN 21-5
PJN PRS8 IF NOT DOWN AND OFF
LDN ENAM *EQXXX NOT AVAILABLE.*
PRS7 UJN PRS4 ERROR EXIT
PRS8 SHN 1
PJN PRS9 IF CONTROLWARE LOADED
LDN ENLM *EQXXX CHYY CONTROLWARE NOT LOADED.*
UJN PRS7 PROCESS ERROR
PRS9 MONITOR REQM REQUEST EQUIPMENT
LDD CM+1
NJN PRS10 IF EQUIPMENT ASSIGNED
LDN ERSM *EQXXX CHYY RESERVED.*
UJN PRS7 PROCESS ERROR
PRS10 LDD T8 SET EQUIPMENT RESERVED
STD EQ
LDD ES+1 CLEAR UPPER BITS OF CHANNEL
LPN 37
STD ES+1
RJM MCI MODIFY CHANNEL INSTRUCTIONS
LDD ES+1
RCHAN RESERVE CHANNEL
* CONNECT EQUIPMENT.
LDN FSUF SELECT UNIT
RJM FCN
LDD ES+4 OUTPUT UNIT NUMBER
SHN 0-11
OAN CH+40
PRS11 EJM PRS12,CH IF CONNECT RESPONSE RECEIVED
SBN 1
NJN PRS11 IF NOT TIMED OUT
PAUSE PAUSE FOR STORAGE MOVE
LDD CM+1
ZJN PRS11 IF NO CONTROL POINT ERROR
DCN CH+40
LJM TRM1 ERROR EXIT
PRS12 DCN CH+40
LDN FGSF GET GENERAL STATUS
RJM FCN
IAN CH
ZJN PRS13 IF GOOD STATUS
STD FC
LDN EGSM *EQXXX CHYY GSSSS ADAPTER STATUS.*
RJM ERR PROCESS ERROR
LJM ABT ABORT JOB
PRS13 RJM CRQ COMPLETE REQUEST
LJM PRSX RETURN
MCI SPACE 4,10
** MCI - MODIFY CHANNEL INSTRUCTIONS.
*
* (ES+1) = CHANNEL NUMBER.
*
* USES T1, T2.
MCI SUBR ENTRY/EXIT
LDC TCHS LOAD FWA OF CHANNEL TABLE ADDRESSES
STD T1
MCI1 LDI T1
ZJN MCIX IF NO MORE INSTRUCTIONS TO MODIFY
STD T2
LDI T2
SCN 37
LMD ES+1
STI T2
AOD T1
UJN MCI1 MODIFY NEXT INSTRUCTION
SPACE 4,10
** TCHS - CHANNEL TABLE.
TCHS CHTB
SPACE 4,10
PRSE EQU *
OVERFLOW
END