	.TITLE *** CP....
/ 
/ 
/                   FIRST PRINTING, FEBRUARY 1974
/ 
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
/ DOCUMENT.
/ 
/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
/ VIDED IN WRITING BY DIGITAL.
/ 
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
/ MENT THAT IS NOT SUPPLIED BY DIGITAL.
/ 
/ COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
/ 
/ 
        .EJECT

/
/	EDIT #1		12 JUN 72	D. WARD - CSS

/

/

/COPYRIGHT 1972, DIGITAL EQUIPMENT CORP., MAYNARD MASS.

/

/THIS HANDLER DRIVES THE SP120 CARD PUNCH.  IT IS CAPATIBLE

/WITH NORMAL OUTPUT FROM MACRO AND FORTRAN

/WRITTEN PROGRAMS.

/

/TO SATISFY A PUNCH REQUEST, THE LINE IS MOVED TO A BUFFER IN

/THE HANDLER TASK WHERE IT IS UNPACKED FROM AN IOPS PACKED ASCII

/FORMAT (5/7 BIT CHARS IN 2 18 BITS WORDS) INTO SINGLE CHARACTER

/PER WORD HOLLERITH FORMAT.  THE NORMAL MODE REQUESTOR MUST NOT BE

/ABLE TO MODIFY THE LINE AFTER THE HARDWARE HAS BEGUN TO READ IT.

/

/THE FOLLOWING CAL PARAMETER BLOCKS ARE USED TO QUEUE

/REQUESTS FOR PUNCH SERVICE

/
/	CPB	3600		HANDLER INFORMATION (NONF)
/		EVA		  EVENT VARIABLE ADDRESS
/		LUN		  LOGICAL UNIT NUMBER

/

/	CPB	2400		ATTACH PUNCH
/		EVA		  EVENT VARIABLE ADDRESS
/		LUN		  LOGICAL UNIT NUMBER

/

/	CPB	2700		PUNCH LINE
/		EVA		  EVENT VARIABLE ADDRESS
/		LUN		  LOGICAL UNIT NUMBER
/		MODE		  DATA MODE (IOPS ASCII = 2)
/		LINE		  LINE BUFFER ADDRESS
/
/	CPB	3400		CLOSE PUNCH FILE
/		EVA		  EVENT VARIABLE ADDRESS
/		LUN		  LOGICAL UNIT NUMBER
/
/	CPB	2500		DETACH PUNCH
/		EVA		  EVENT VARIABLE ADDRESS
/		LUN		  LOGICAL UNIT NUMBER

/

/	CPB	1700		ABORT TASK I/O
/		EVA		  EVENT VARIABLE ADDRESS
/		LUN		  LOGICAL UNIT NUMBER

/

/

/THE REQUESTOR'S EVENT VARIABLE IS CLEARED (ZEROED) WHEN THE

/REQUEST IS QUEUED BY THE "QUEUE I/O" DIRECTIVE.  IF THE REQUEST

/CANNOT BE PERFORMED, THE EVENT VARIABLE IS SET TO ONE OF THE

/FOLLOWING NEGATIVE VALUES:

/

/	-6	ILLEGAL REQUEST FUNCTION

/	-7	ILLEGAL DATA MODE

/	-16	ILLEGAL OUTPUT HEADER WORD-PAIR-COUNT (<1)

/	-24	LUN HAS BEEN REASSIGNED WHILE REQUEST WAS IN QUEUE

/	-30	OUT-OF-PARTITION TRANSFER (NORMAL MODE)

/	-203	ILLEGAL TO ATTACH OR DETACH FROM OTHER THAN TASK LEVEL

/

/IF THE REQUEST IS PERFORMED SUCCESSFULLY, THE EVENT VARIABLE IS SET
/TO ONE (+1) UPON COMPLETION.  IF THE PUNCH OPERATION FAILED
/TO PUNCH OR SHOWED AN ERROR, THE EVENT VARIABLE IS SET TO
/MINUS (400000) TO ALLOW THE USER TO REQUEUE CARD I/O
/

/
/	CONDITIONAL ASSEMBLY PARAMETERS
/
CP029=1				/CP029 = 1 FOR 029 PUNCH CODE
				/CP029 = 0 FOR 026 PUNCH CODE
INTLN=22			/API INTERRUPT LINE NUMBER (MODULO 40)
/
/
/
/
/
/	CONSTANTS AND EQUATES
/

/

/

X12=12			/AUTO-INCREMENT REG 12

X13=13				/AUTO-INCREMENT REG 13

R1=101				/RE-ENTRANT REG ONE

R2=102				/RE-ENTRANT REG TWO

R3=103				/RE-ENTRANT REG THREE

R4=104				/RE-ENTRANT REG FOUR

NADD=107			/NODE ADDITION ROUTINE ENTRY POINT

SNAM=123			/NAME SCAN ROUTINE ENTRY POINT

POOL=240			/LISTHEAD FOR POOL OF EMPTY NODES

PDVL=252			/LISTHEAD FOR PHYSICAL DEVICE LIST

ALAD=325			/ATTACH LUN AND DEVICE ENTRY POINT

DLAD=332			/DETACH LUN AND DEVICE ENTRY POINT

DQRQ=337			/DE-QUEUE REQUEST ENTRY POINT

VAJX=342			/VERIFY I/O REQUEST ENTRY POINT

IOCD=345			/DECLARE I/O REQUEST COMPLETE ENTRY POINT

DMTQ=361			/DETACH & EMPTY QUEUE ENTRY POINT

D.TG=10				/POSITION OF TRIGGER EVENT VARIABLE IN PDVL NODE
LUN=3				/LUN FOR NOT-READY MESSAGE
				/LUN 3 COULD BE MCR OUTPUT

WCA=34				/WORD COUNT ADDRESS (NOT USED BY CP CONTROLLER)

CAA=35				/CURRENT ADDRESS REGISTER ADDRESS

/
PSKD=705001			/SKIP ON DATA REQUEST FLAG
PSTA=705012			/READ PUNCH STATUS

PCMD=705004			/LOAD COMMAND REGISTER
SKDN=705041			/SKIP ON CARD DONE

SKER=705061			/SKIP ON ERROR FLAG

PCLR=705042			/CLEAR PUNCH FLAGS

PLDD=705044			/LOAD PUNCH DATA

/

.INH=705521			/INHIBIT INTERRUPTS

.ENB=705521			/ENABLE INTERRUPTS

/

/

	.DEC

LBZ=80				/DEFINE PUNCH BUFFER SIZE

	.OCT

/

/

LBF=.				/DEFINE START OF PUNCH BUFFER

/

/



/

/HANDLER INITIALIZATION

/

/
START	LAC	(PDVL)		/SCAN PHYSICAL DEVICE LIST

	DAC*	(R1)		/FOR THIS DEVICE

	LAC	(HNAM)

	DAC*	(R2)

	JMS*	(SNAM)		/R1, R2, R6, XR, AND AC ARE ALTERED

				/NODE FOUND?

	CAL	(10)		/NO, EXIT

	DAC	PDVNA		/SAVE PDVL NODE ADDRESS

	AAC	+D.TG		/GET TRIGGER EVENT VAR ADDR

	DAC	PDVTA		/SAVE IT

/

	CAL	CCPB		/CONNECT INTERRUPT LINE

	LAC	EV		/IS CONNECT OK?

	SPA			/SKIP IF AC POSITIVE (OK)
	CAL	(10)		/NOT OK, EXIT
/
	DZM	EV		/RESET EV FOR LATER

	LAC	(TG)		/SET TRIGGER EVENT VARIABLE ADDR
	DAC*	PDVTA		/IN PHYSICAL DEVICE NODE

	AND	(070000)	/DETERMINE "XR-ADJ"

	TCA			/COMPLEMENT RESULT

	DAC	XADJ		/SAVE PAGE BIT ADJUST PARAMETER

/

	PCLR			/CLEAR CP CONTROLLER

	JMP	WFTGR		/WAIT FOR TRIGER

/
HNAM	.SIXBT	"CP@@@@"	/HANDLER TASK NAME

/
				/END OF INITALIZATION CODE
/
	.BLOCK	LBZ+LBF-.

/

/

/*****THE ABOVE CODE BECOMES THE PUNCH*****

/*****XMIT BUFFER AFTER THE FIRST PASS*****

/

/

/WAIT FOR TASK TO BE TRIGGERED

/TO SIGNAL THAT A REQUEST HAS BEEN QUEUED

/

/

WFTGR	CAL	WFTCPB		/WAIT FOR TRIGGER EVENT VARIABLE TO BE SET

/

/THE TASK HAS BEEN TRIGGERED

/PICK REQUEST FROM QUEUE

/

/

	DZM	TG		/CLEAR TRIGGER FOR THIS PASS.

/
PQ	LAC	PDVNA		/DEQUEUE A REQUEST

	DAC*	(R1)

	JMS*	(DQRQ)		/R1, R2, R4, R5, R6, XR AND AC ALTERED

	JMP	WFTGR		/NO, WAIT FOR TRIGGER

/

	DAC	RN

	TAD	XADJ		/SETUP XFER TO ACCESS NODE

	PAX			/SAVE ADDR IN INDEX REG.

/

	LAC	5,X		/FETCH CAL FUNCTION CODE

	AND	(777)		/MASK FOR LOWER BITS

/

	SAD	(017)		/ABORT REQUEST?

	JMP	ABORT		/YES, DO IT

/

	SAD	(024)		/ATTACH REQUEST?

	JMP	ATTACH		/YES, DO IT

/

	SAD	(025)		/DETACH REQUEST?

	JMP	DETACH		/YES, DO IT

/

	SAD	(027)		/PUNCH REQUEST?

	JMP	PUNCH		/YES, DO IT
/
	SAD	(034)		/CLOSE REQUEST?
	JMP	CLOSE		/YES, DO IT
/

	SAD	(036)		/HANDLER INFO REQUEST?

	JMP	HINF		/YES, DO IT

/

	SAD	(777)		/EXIT (DEASSIGNED) REQUEST?

	JMP	DAEX		/YES, DO IT

/
ILFUNC	LAW	-6		/UNIMPLEMENTED FUNCTION

	JMP	SEV		/SET EVEN VARIABLE TO -6

/

/

/

/COMMON CODE FOR THE FOLLOWING FUNCTIONS

/

/

/

SETADR	0

	LAC	PDVNA

	DAC*	(R1)

	LAC	RN

	DAC*	(R2)

	JMP*	SETADR

/

/

/

RPOOL	0

	LAC	(POOL)

	DAC*	(R1)

	LAC	RN

	DAC*	(R2)

	JMS*	(NADD)

	JMP*	RPOOL



/
/ABORT ALL I/O INITIATED BY THE INDICATED TASK
/
ABORT	XOR	5,X		/ABORT IS AN ILLEGAL FUNCTION FOR ALL TASKS

	SZA			/EXCEPT 'IORD', WHO SETS THE LUN=0

	JMP	ILFUNC

/

	JMS	SETADR		/SET UP REQUESTOR NODE ADDRESSES

	JMS*	(DMTQ)		/DETACH LUN & DEVICE, IF NECESSARY, AND THEN

				/EMPTY THE QUEUE OF ALL I/O REQUESTS MADE

				/BY THE TASK BEING ABORTED.  R1, R2, R3,

				/R5, R6, X10, X11, X12, X4 & AC ARE ALTERED.

	JMP	SEV1		/DONE
/
/
/
/
/
/ATTACH TO A TASK

/
ATTACH	JMS	SETADR

	JMS*	(ALAD)		/ATTACH LUN AND DEVICE

				/R3, R4, R5, R6, X10, X11, XR & AC ALTERED

				/WAS LUN ATTACHED?

	JMP	SEV		/NO, SET REV TO -24 OR -203

	JMP	SEV1		/YES, SET REV TO +1
/
/
/
/
/
/CLOSE THE PUNCH FILE WITH AN EOF MARK
/
CLOSE	LAC	(LBF-1)		/SET UP FOR PUNCH BUFFER STORE
	DAC*	(X13)
	LAC	(7777)		/GET EOF MARK
	DAC*	X13		/PUT IT INTO PUNCH BUFFER
	JMP	PUN04		/PUNCH IT OUT
/
/
/
/
/
/DETACH FROM A TASK
/
DETACH	JMS	SETADR

	JMS*	(DLAD)		/DETACH LUN AND DEVICE

				/R3, R4, R5, R6, X10, X11, XR & AC ALTERED

				/WAS LUN DETACHED

	JMP	SEV		/NO, SET REV TO -24 OR -203

	JMP	SEV1
/
/
/
/
/
/RETURN HANDLER INFO IN EVENT VARIABLE
/
HINF	LAC	(100000!INTLN)	/SET INFO FOR DEVICE INTLN

	JMP	SEV
/
/
/
/
/
/EXIT REQUEST (FROM TASK"...REA")
/
DAEX	JMS	RPOOL		/RETURN REQUEST NODE TO POOL

/
	LAC	(20)		/DISABLE CP INTERRUPTS
	PCMD
/

	CAL	DCPB		/DISCONNECT INTERRUPT LINE

/

	ISZ	PDVTA		/CLEAR ASSIGN INHIBIT FLAG IN PDVL NODE

	.INH

	DZM*	PDVTA

	.ENB

/

	CAL	(10)		/EXIT



/

/WFAB

/SUBROUTINE TO WAIT FOR EVENT VARIABLE TO BE SET AND THEN TO

/CHECK THE TRIGGER EVENT VARIABLE TO SEE IF AN ABORT REQUEST

/SHOULD BE PROCESSED.

/

/
WFAB	0

	CAL	WFECPB		/WAIT FOR EV TO BE SET
/
	LAC	EV		/SAVE EV VALUE
	DAC	EVSTAT	
	DZM	EV		/RESET EV FOR THIS PASS

	LAC	TG		/TEST TRIGGER BIT 2 FOR ABORT
	RTL

	SMA

	JMP*	WFAB		/NOT SET, RETURN

/

/REQUEUE THE ABORT REQUEST

/

	DZM	TG

	JMS	SETADR

	JMS*	(DQRQ)		/REQUEUE THE REQUEST

				/R1, R2, R4, R5, XR & AC ALTERED

				/REQUEST FOUND?

	JMP*	WFAB		/NO, EXIT

/

	DAC	RN		/SAVE NODE ADDR

	JMS	SETADR

	JMS*	(DMTQ)		/DEQUEUE REQUEST

	JMS	SEVRN		/CLEAN UP

	JMP*	WFAB		/EXIT

/

/

/COMMON TERMINATION OF NON PRINTING REQUESTS

/

/

SEV1	CLA!IAC			/SET REV TO +1

SEV	JMS	SEVRN

	JMP	PQ

/

/
SEVRN	0

	PAL			/SAVE EV VALUE
	LAC	RN		/REQUEST NODE ADDR

	TAD	XADJ

	PAX

/

	LAC	6,X		/GET REQUESTS EV ADDR

	SNA

	JMP	NOSET		/NO REQ EV SPECIFIED

/

	TAD	XADJ		/SET PARAM TO POINT AT REQ EV

	PAX

	PLA			/RETRIEVE EV VALUE

	DAC	0,X		/INSERT IT

/

NOSET	JMS	SETADR

	JMS*	(IOCD)		/DECLARE I/0 REQUEST COMPLETED

				/DECREMENT TRANSFERS ENDING COUNT

				/R4, XR, & AC ALTERED

/

	LAC	SIGEVT		/DECLARE A SIGNIFICANT EVENT

	ISA

/

	JMS	RPOOL		/RETURN REQUEST NODE TO OPOOL

	JMP*	SEVRN		/EXIT ROUTINE



/

/

/INTERRUPT SERVICE ROUTINE

/

/

CPINT	0			/INTERRUPT ENTRY POINT

	DBA			/ENTER INDEX MODE

	DAC	TEMP1		/SAVE AC

/

	SKER			/SKIP ON PUNCH ERROR

	JMP	CPDONE		/JUMP TO CONTINUE

/
CPERR	LAC	(400000)	/SET AC TO 400000 FOR ERROR
CPOUT	DAC	EV		/PUT IT IN EVENT VARIABLE

	PCLR			/CLEAR ALL PUNCH FLAGS

/

	LAC	SIGEVT		/DECLARE A SIGNIFICANT EVENT

	ISA
/

CPEXIT	LAC	TEMP1		/RESTORE AC

	DBR			/RETURN TO INTERRUPTED PROGRAM

	JMP*	CPINT

/
CPDONE	SKDN			/SKIP ON CARD DONE
	JMP	CPDATA		/JUMP IF NOT CARD DONE
/
	LAC	PUNERR		/TEST FOR FIRST CARD ERROR EJECT
	SZA			/NO
	JMP	CPSTRT		/YES, GO TO START UP PUNCH
/

	CLA!IAC			/SET AC TO +1 FOR OK EXIT

	JMP	CPOUT		/GO AND SET CARD DONE

/
CPDATA	PSKD			/SKIP ON DATA REQUEST FLAG

	JMP	CPERR		/JUMP TO SOME ERROR
/
	LAC	PUNERR		/TEST PUNCH ERROR FLAG FOR EJECT
	SZA			/NO, PUNCH OUT CARD DATA
	JMP	CPEJOF		/YES, EJECT
/

	ISZ	DATACT		/TRY FOR NEXT CHARACTER

	JMP	CPCHAR		/GO TO OUTPUT NEXT CHAR
CPDAT1	LAC	PEJECT		/SET PUNCH EJECT

	PCMD

	JMP	CPEXIT		/GO TO EXIT

/
CPCHAR	LAC*	DATAP1		/GET NEXT CHAR

	PLDD			/AND PUNCH IT

	ISZ	DATAP1		/STEP TO NEXT CHAR POSITION
	JMP	CPEXIT		/GO TO EXIT
/
CPSTRT	PCLR			/CLEAR PUNCH FLAGS
	LAC	PSTART		/START PUNCH AND SET INTERRUPTS
	PCMD
	DZM	PUNERR		/RESET PUNCH ERROR FLAG
	JMP	CPEXIT		/GO TO EXIT
/
CPEJOF	LAC	PEJOFF		/EGECT FIRST CARD WITH OFFSET
	JMP	CPDAT1

/

/

/

/PUNCH A CARD

/

/
PUNCH	LAC	7,X		/GET REQUESTOR DATA MODE INDICATOR

	DAC	MI
	AND	(3)		/MASK FOR MOVE INDICATOR
	SAD	(2)		/TEST FOR IOPS ASCII

	JMP	PUN01		/YES, CONTINUE

/

	LAW	-7		/NO, SET REQUESTOR EV TO -7

	JMP	SEV

/
PUN01	LAC	RN		/GET REQ NODE ADDR

	DAC*	(R2)		/PUT IN R2

	LAC	10,X		/GET LINE BUFFER ADDRESS

	DAC*	(R3)		/PUT IN R3

	DAC	TEMP1		/AND SAVE IT

	CLA!IAC			/SET AC TO 1

	DAC*	(R4)		/PUT IN R4
	JMS*	(VAJX)		/GO TO VERIFY & ADJUST HEADER ADDR

				/IS BEGINNING ADDR OK

	JMP	ERR30		/NO, SET REQ EV TO -30

/

	LAW	-1		/POINT X12 TO LINE ADDR -1
	TAD*	(R3)		/GET ADJUSTED LINE BUFFER ADDR
	DAC*	(X12)		/SET X12 TO DAT

/

	LAC*	X12		/MOVE FIRST HEADER LINE TO AC

	LRS	10		/SHIFT TO GET ACTUAL WORD COUNT

	AND	(776)		/MASK TO GET COUNT

	DAC*	(R4)		/PUT IN R4

/

	AAC	-2		/TEST FOR LESS THAN 2 WORDS

	SMA			/IS IT LESS THAN 2

	JMP	PUN02		/NO, CONTINUE

/

	LAW	-16		/SET REQUESTORS EV TO -16

	JMP	SEV

/
PUN02	LAC	TEMP1		/VERIFY LINE SIZE

	DAC*	(R3)

	JMS*	(VAJX)		/R3, R5, XR & AC ALTERED

				/IS LINE SIZE OK?

	JMP	ERR30		/NO, GO TO SET REV TO -30

/

	LAC*	(R4)		/GET WORD COUNT
	RCR			/MODIFY TO WORD-PAIR COUNT
	TCA			/GET COMPLEMENT
	AAC	1		/MODIFY COUNT TO JUST DATA
	DAC	DATACT		/SAVE IT AS -WC

/

	AAC	16		/ADD MAX COUNT AS TEST

	SMA			/SKIP IF BUFFER IS TO BIG

	JMP	PUN03
	LAW	-20		/TRIM BUFFER OUTPUT TO 80 COLUMNS

	DAC	DATACT

/


PUN03	LAC	(LBF-1)		/SETUP X13 AS DESTINATION INDEX FOR MOVE
	DAC*	(X13)

	LAC*	X12		/STEP X12 TO FIRST DATA WORD

/

	JMS	MOVASC		/MOVE ASCII CHARACTERS TO HOL BUFFER

/
PUN04	LAC	(LBF)		/GET BUFFER START LOCATION
	DAC	DATAP1		/SAVE IT FOR INTERRUPT ROUTINE
	LAC*	(X13)		/GET LAST WORD ADDR
	AAC	2		/ADJUST IT FOR INTERRUPT ROUTINE

	TCA			/INVERT IT

	TAD	DATAP1		/SUBTRACT START ADDR

	DAC	DATACT		/SAVE IT FOR INTERRUPT ROUTINE

/
/
PUN05	PCLR			/CLEAR PUNCH FLAGS
/
	LAC	PSTART		/START PUNCH OPERATION AND TURN
				/ON INTERRUPT
	PCMD

/
	JMS	WFAB		/WAIT FOR COMPLETION

/
	LAC	EVSTAT		/CARD DONE, LOOK AT STATUS
	SMA			/SKIP IF PUNCH IN ERROR
/

	JMP	SEV		/PUT STATUS IN REQUESTORS EV

				/RETURN NODE TO POOL
				/AND TRY FOR ANOTHER QUEUED REQ.
/
/
RETRY	LAC	PUNERR		/CHECK FOR PREVIOUS ERROR
	RCL			/MASK OFF 1ST PASS FLAG
	SZA			/SKIP IF ERROR MSG TO BE PRINTED
	JMP	PUN06		/OLD ERROR, DELAY AND RETRY
/
	CAL	TEMCPB		/TYPE ERROR MESSAGE
	JMS	WFAB		/WAIT FOR COMPLETE
	ISZ	PUNERR		/SET NEW ERROR FLAG
/
PUN06	CAL	MTCPB		/DELAY
	JMS	WFAB		/WAIT FOR COMPLETE
	JMP	PUN05		/TRY FOR PUNCH OK AGAIN
/
/
/
/
/
/

ERR30	LAW	-30		/SET EV TO -30 AND EXIT

	JMP	SEV



/

/

MOVASC	0			/ENTERED WITH DATACT = NEG WORD PAIR COUNT

				/OF DATA, X12 = LINE BUFFER POINTER,

				/AND X13 = HANDLER HOLLERITH BUFFER

				/FOR XMIT -1

/
MOV01	JMS	UNPACK		/UNPACK NEXT WORD PAIR

/

	ISZ	DATACT		/REDUCE PAIR COUNT TO CONVERT

	JMP	MOV01		/GO DO IT AGAIN

/

	JMP*	MOVASC		/EXIT SUBROUTINE
/
/
/
/

/

/
CONVRT	0			/CONVERTS ASCII CHARACTER TO HOLLERITH

				/AND PLACES IT IN OUTPUT BUFFER IN

				/CARD PUNCH HANDLER

	AND	(177)		/MASK FOR CHARACTER
	PAX			/PUT IN INDEX REG.
	LAC	ATH,X		/GET HOLLERITH CHARACTER
CONV03	DAC*	X13		/PUT IT IN OUTPUT BUFFER
	JMP*	CONVRT		/EXIT FROM SUBROUTINE
/
/
/



/

/

/
UNPACK	0
	LAC*	X12		/GET 1ST WORD OF PAIR
	DAC	DATAP1		/SAVE IT
	LAC*	X12		/GET 2ND WORD OF PAIR

	DAC	DATAP2		/SAVE IT

/
	LAC	DATAP1		/GET FIRST CHARACTER
	LRS	13

	JMS	CONVRT		/CONVERT AND STORE IT

/

	LAC	DATAP1		/GET 2ND CHARACTER

	LRS	4

	JMS	CONVRT

/

	LAC	DATAP2		/GET 2ND WORD OF PAIR

	LMQ			/PUT IT IN MQ REG

	LAC	DATAP1		/GET 1ST WORD AGAIN

	LLS	3			/GET 3RD CHAR

	JMS	CONVRT

/
	LAC	DATAP2		/GET 4TH CHARACTER

	LRS	10

	JMS	CONVRT

/
	LAC	DATAP2		/GET 5TH CHARACTER

	LRS	1

	JMS	CONVRT

/

	JMP*	UNPACK		/EXIT SUBROUTINE

/

/

/

/

/CONSTANTS

/

/

CCPB	11			/CONNECT CPB

	EV			/EVENT VARIABLE ADDR

	INTLN			/INTERRUPT LINE NUMBER

	CPINT			/INTERRUPT ROUTINE ADR

/

DCPB	12			/DISCONNECT CPB

	EV			/

	INTLN			/

	CPINT			/

/

MTCPB	13			/MARK TIME CPB

	EV			/

	12			/DELTA TIME (12 TICKS)

	1			/DELTA UNITS (1-TICKS)

/

WFTCPB	20			/WAIT FOR TRIGGER CPB

	TG

/

WFECPB	20			/WAIT FOR EVENT VARIABLE CPB

	EV

/

TEMCPB	2700			/TYPE ERR MESSAGE

	EV

	LUN

	2

	ERRMES

/
ERRMES	005002; 000000;	.ASCII "*** CP NOT READY"<15>

/

/

/

PDVNA	0			/PDVL NODE ADDRESS

PDVTA	0			/PDVL TRIGGER EVENT VARIABLE ADDRESS
EV	0			/EVENT VARIABLE
EVSTAT	0			/EV VALUE SAVE LOCATION

TG	0			/TRIGGER EVENT VARIABLE

XADJ	0			/PAGE BIT ADJUST PARAMETER

RN	0			/REQUEST NODE ADDRESS

SIGEVT	401000			/SIGNIFICANT EVENT VALUE

TEMP1	0			/TEMPORY CELL

DATAP1	0			/BUFFER WORD POINTER

DATAP2	0			/BUFFER WORD POINTER
DATACT	0			/DATA BUFFER WORD PAIR COUNT

MI	0			/DATA MODE INDICATOR
PUNERR	400000			/NEW ERROR FLAG
PSTART	50			/START PUNCH AND ENABLE INTERRUPTS
PEJECT	110			/EJECT CARD AND ENABLE INTERRUPTS
PEJOFF	310			/EJECT CARD WITH OFFSET AND INTERRUPTS
/
/
	.EJECT
/ASCII TO HOLLERITH CONVERSION TABLE (029 CODE)
/
	.IFNZR	CP029
/
ATH	0		/NULL			SHOULD BE 5403
	4401		/SOH	(CTRL A)
	4201		/STX	(CTRL B)
	4101		/ETX	(CTRL C)
	5		/EOT	(CTRL D)
	1023		/ENQ	(CTRL E)
	1013		/ACK	(CTRL F)
	1007		/BEL	(CTRL G)
/010
	2011		/BS	(CTRL H)
	4021		/HT	(CTRL I)
	1021		/LF	(CTRL J)
	4103		/VT	(CTRL K)
	4043		/FF	(CTRL L)
	0		/CR	(CTRL H)	SHOULD BE 4023
	4013		/SO	(CTRL N)
	4007		/SI	(CTRL O)
/020
	6403		/DLE	(CTRL P)
	2401		/DC1	(CTRL Q)
	2201		/DC2	(CTRL R)
	2101		/DC3	(CTRL S)
	43		/DC4	(CTRL T)
	23		/NAK	(CTRL U)
	201		/SYN	(CTRL V)
	1011		/ETB (EOB)	(CTRL W)
/030
	2003		/CAN	(CTRL X)
	2403		/EM	(CTRL Y)
	3		/SUB	(CTRL Z)
	1005		/ESC (PRE)
	1201		/FS	(CRTL  )
	2023		/GS
	21		/RS
	2007		/US
/040
	0		/BLANK
	2202		/!
	6		/"
	102		/#
	2102		/$
	1042		/%
	4000		/&
	22		/'
/050
	4022		/(
	2022		/)
	2042		/*
	4012		/+
	1102		/,
	2000		/-
	4102		/.
	1400		//
/060
	1000		/0
	400		/1
	200		/2
	100		/3
	40		/4
	20		/5
	10		/6
	4		/7
/070
	2		/8
	1		/9
	202		/:
	2012		/;
	4042		/<
	12		/=
	1012		/>
	1006		/?
/100
	42		/@
	4400		/A
	4200		/B
	4100		/C
	4040		/D
	4020		/E
	4010		/F
	4004		/G
/110
	4002		/H
	4001		/I
	2400		/J
	2200		/K
	2100		/L
	2040		/M
	2020		/N
	2010		/O
/120
	2004		/P
	2002		/Q
	2001		/R
	1200		/S
	1100		/T
	1040		/U
	1020		/V
	1010		/W
/130
	1004		/X
	1002		/Y
	1001		/Z
	4202		/ 	(DEC CENT SIGN)
	2006		/ 	(DEC LOGICAL NOT)
	1202		/ 
	4006		/^
	1022		/_
/140
	5402		/ 
	5400		/SMALL A
	5200		/SMALL B
	5100		/SMALL C
	5040		/SMALL D
	5020		/SMALL E
	5010		/SMALL F
	5004		/SMALL G
/150
	5002		/SMALL H
	5001		/SMALL I
	6400		/SMALL J
	6200		/SMALL K
	6100		/SMALL L
	6040		/SMALL M
	6020		/SMALL N
	6010		/SMALL O
/160
	6004		/SMALL P
	6002		/SMALL Q
	6001		/SMALL R
	3200		/SMALL S
	3100		/SMALL T
	3040		/SMALL U
	3020		/SMALL V
	3010		/SMALL W
/170
	3004		/SMALL X
	3002		/SMALL Y
	3001		/SMALL Z
	5202		/ 
	5102		/ 
	4402		/ALTMODE
	5042		/
	4005		/DEL
/
	.ENDC
/
	.EJECT
/ASCII TO HOLLERITH CONVERSION TABLE (026 CODE)
/
	.IFZER	CP029
/
ATH	0		/NULL			SHOULD BE 5403
	4401		/SOH	(CTRL A)
	4201		/STX	(CTRL B)
	4101		/ETX	(CTRL C)
	5		/EOT	(CTRL D)
	1023		/ENQ	(CTRL E)
	1013		/ACK	(CTRL F)
	1007		/BEL	(CTRL G)
/010
	2011		/BS	(CTRL H)
	4021		/HT	(CTRL I)
	1021		/LF	(CTRL J)
	4103		/VT	(CTRL K)
	4043		/FF	(CTRL L)
	0		/CR	(CTRL M)	SHOULD BE 4023
	4013		/SO	(CTRL N)
	4007		/SI	(CTRL O)
/020
	6403		/DLE	(CTRL P)
	2401		/DC1	(CTRL Q)
	2201		/DC2	(CTRL R)
	2101		/DC3	(CTRL S)
	43		/DC4	(CTRL T)
	23		/NAK	(CTRL U)
	201		/SYN	(CTRL V)
	1011		/ETB (EOB)	(CTRL W)
/030
	2003		/CAN	(CTRL X)
	2403		/EM	(CTRL Y)
	3		/SUB	(CTRL Z)
	1005		/ESC (PRE)
	1201		/FS	(CTRL  )
	2023		/GS
	21		/RS
	2007		/US
/040
	0		/BLANK
	4006		/!
	1022		/"
	112		/#
	1006		/$
	1042		/%
	2006		/&
	12		/'
/050
	1042		/(
	4042		/)
	2042		/*
	4000		/+
	1102		/,
	2000		/-
	4102		/.
	1400		//
/060
	1000		/0
	400		/1
	200		/2
	100		/3
	40		/4
	20		/5
	10		/6
	4		/7
/070
	2		/8
	1		/9
	2202		/:
	1202		/;
	4012		/<
	102		/=
	2012		/>
	4202		/?
/100
	42		/@
	4400		/A
	4200		/B
	4100		/C
	4040		/D
	4020		/E
	4010		/F
	4004		/G
/110
	4002		/H
	4001		/I
	2400		/J
	2200		/K
	2100		/L
	2040		/M
	2020		/N
	2010		/O
/120
	2004		/P
	2002		/Q
	2001		/R
	1200		/S
	1100		/T
	1040		/U
	1020		/V
	1010		/W
/130
	1004		/X
	1002		/Y
	1001		/Z
	2022		/ 		(DEC CENT SIGN)
	6		/ 		(DEC LOGICAL NOT)
	4022		/ 
	22		/^
	202		/_
/140
	5402		/ 
	5400		/SMALL A
	5200		/SMALL B
	5100		/SMALL C
	5040		/SMALL D
	5020		/SMALL E
	5010		/SMALL F
	5004		/SMALL G
/150
	5002		/SMALL H
	5001		/SMALL I
	6400		/SMALL J
	6200		/SMALL K
	6100		/SMALL L
	6040		/SMALL M
	6020		/SMALL N
	6010		/SMALL O
/160
	6004		/SMALL P
	6002		/SMALL Q
	6001		/SMALL R
	3200		/SMALL S
	3100		/SMALL T
	3040		/SMALL U
	3020		/SMALL V
	3010		/SMALL W
/170
	3004		/SMALL X
	3002		/SMALL Y
	3001		/SMALL Z
	5202		/ 
	5102		/ 
	4402		/ALTMODE
	5042		/
	4005		/DEL
/
	.ENDC
/
/

/

/

	.END	START
