	.TITLE	MOUNT A DISK MCR FUNCTION
/
/ COPYRIGHT (C) 1975
/ DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
/
/ THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY
/ ON A SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH
/ THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS
/ SOFTWARE, OR ANY OTHER COPIES THEREOF, MAY NOT BE PRO-
/ VIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON
/ EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO
/ THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE
/ SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.
/
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE
/ WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COM-
/ MITMENT BY DIGITAL EQUIPMENT CORPORATION.
/
/ DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
/ OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY
/ DEC.
/
	.EJECT
/
/
/	EDIT 010	JUN 25 75	M. HEBENSTREIT
/
/
/	THIS PROGRAM IS AN MCR FUNCTION TO ENABLE FILE ORIENTED
/	INPUT-OUTPUT.	THE FORMAT OF THE INPUT STRING IS
/	MCR>MNT NM <UIC>T   OR   NM# <UIC>T   OR   NM## <UIC>T
/	WHERE NM INDICATES A TWO CHARACTER NAME AND # IS A DIGIT
/	T IS EITHER AN ALTMODE OR A CARRIAGE RETURN.
/
/ DEFINING TDV PRODUCES A BINARY FOR A TDV FUNCTION
/
/
/
PDVL=252
.ENB=705521
.INH=705522
PENP=115
MCRRI=171
        .IFUND TDV
FAC=174
        .ENDC
LUTP1=142
LUTP2=143
LUFD1=304
X10=10
X11=11
X12=12
SYSDSK=301
DUFD1=306
ECLA=641000
IDX=ISZ
	.IFUND TDV
MSGLUN=3
	.ENDC
	.IFDEF TDV
MSGLUN=15
	.ENDC
/   
START	LAC	(START	/CALC THE XR ADJUSTMENT
	AND	(70000
	DAC	MXRADJ
	TCA
	DAC	XRADJ
        .IFDEF TDV
        CAL     RFTDV	/READ TDV BUFFER
        CAL     WAIT
        LAC     EV
        DAC     XFEREV
        SPA
        JMP     ERR08
        JMS     FAC	/LOOK FOR 1ST SPACE
        SAD     (15
        JMP     ERR01
        SAD     (175
        JMP     ERR01
        SAD     (40
        SKP
        JMP     .-7
        .ENDC
	JMS	GETDEV	/GET DEVICE NAME AND UNIT NO.
	JMP	ERR01        /RETURN HERE IS A FORMAT ERROR IS FOUND
	SAD	(76	/NO ERRORS -- IS NEXT CHAR A >?
	SKP
	JMP	ERR01 /ANY OTHER CHARACTERS ARE ERRORS
        .IFUND TDV
SPACE	JMS*	(FAC   /LOOK FOR THE TERMINATOR
        .ENDC
        .IFDEF TDV
SPACE   JMS     FAC
        .ENDC
	SAD	(40
	JMP	.-2
	SAD	(15
	JMP	H1
	SAD	(175
	JMP	H1
	JMP	ERR01        /OTHER CHARACTERS ARE ERRORS
H1	DAC	TERM       /SAVE THE TERMINATOR
	LAC	GN2	/SAVE THE UNIT NUMBER
	DAC	UNIT
	LAC	GN1	/SAVE THE NAME
	DAC	NAME1
        LAC     GN3	/SAVE THE UIC NAME
        DAC     NAME2
	JMS	DEQUE        /TRY TO FIND DEVICE IN PDVL LIST
	JMP	ERR02        /IF DEVICE ISN'T IN LIST THAT'S AN ERROR
        LAC     NAME1	/GET NAME OF DEVICE INTO AC
        SAD     (220600	/RF?
        JMP     RF0	/YES
        SAD     (222000	/NO -- RP?
        JMP     RP0	/YES
        SAD     (221300	/NO -- RK?
        SKP		/YES
        JMP     ERR03	/NO -- ERROR NOT A DISK
RK0     LAC     (24	/GET THE DEVICE CODE FOR RK
        SKP
RP0     LAC     (3	/GET THE DEVICE CODE FOR RP
        SKP
RF0     LAC     (2	/GET THE DEVICE CODE FOR RF
        DAC     DEVICE	/SAVE THE DEVICE CODE
        LAC     UNIT
        SZA
        JMP     NOTSYS	/DEV. CAN'T BE SYS. DEV. IF UNIT<>0
        LAC*    (SYSDSK	/IS THIS THE SYSTEM DEVICE?
        SAD     DEVICE
        JMP     ERR04	/ERROR -- NAMED DEVICE IS SYSTEM DEVICE
NOTSYS  LAC     DEVICE	/GET THE ADDR. OF THE UFD NAME.
        SAD     (2
        JMP     RF1
        SAD     (3
        JMP     RP1
RK1     LAC*    (DUFD1
        AAC     10
        TAD     UNIT
        JMP     GETUFD
RP1     LAC*    (DUFD1
        TAD     UNIT
        JMP     GETUFD
RF1     LAC*    (DUFD1
        AAC     20
GETUFD  DAC     TEMP
	LAC*	TEMP	/GET THE UFD NAME
	SZA		/IS DISK MOUNTED?
	JMP	ERR05	/YES -- ERROR
	LAC	NAME2	/FIND SPECIFIED UFD NAME IN MFD
	JMS	MFD
	LAC	NAME2	/ENTER UFD NAME IN DSK-UFD TABLE
	DAC*	TEMP
	LAC*	(LUTP1	/USE X11 AS A POINTER TO LUT
	AAC	-1
	DAC*	(X11
	LAC*	(LUFD1	/USE X10 AS A POINTER TO LUN-UFD TABLE
	AAC	-1
	DAC*	(X10
	LAC*	(LUTP1	/DETERMINE NO. OF LUNS
	TCA
	TAD*	(LUTP2
	IAC
	TCA		/NEGATE TO SET UP COUNTER
	DAC	TEMP
UFD1	LAC*	X11	/IS THIS LUN ASSIGNED TO THE DISK?
	SAD	NODEAD
	JMP	UFD2	/YES
	LAC*	X10	/NO -- INCREMENT X10
	JMP	UFD3
UFD2	LAC*	X10	/GET THE LUN-UFD TABLE ENTRY
	SZA		/HAS REASSIGN ALREADY INITIALIZED IT?
	JMP	UFD3	/YES -- THEN DON'T ENTER THE NEW UFD NAME
	LAC*	(X10	/NO -- BACK UP X10
	AAC	-1
	DAC*	(X10
	LAC	NAME2	/ENTER THE DEFAULT UFD NAME INTO TABLE
	DAC*	X10
UFD3	ISZ	TEMP	/DONE WITH ALL LUNS?
	JMP	UFD1	/NO
        .IFUND TDV
EXIT	LAC TERM    /EXIT ACCORDING TO THE LINE TERMINATOR
	SAD	(15
        JMP     EXIT1
	DZM*	(MCRRI
        SKP
EXIT1   CAL     REQMCR
        CAL     (10
        .ENDC
        .IFDEF TDV
EXIT    LAC     XFEREV
        SAD     (1
        SKP
EXIT1   CAL     REQMCR
        CAL     (10
        .ENDC
REQMCR	1
	0
        .IFDEF TDV
        .SIXBT "TDV"
        .SIXBT "..."
        .ENDC
        .IFUND TDV
	.SIXBT "..."
	.SIXBT "MCR"
        .ENDC
	0
/
/       S.R. TO LOOK UP A NODE IN PDVL
/       ONE ENTRY THE 1ST HALF OF THE NAME MUST BE IN NAME1 AND
/       THE UNIT NUMBER MUST BE IN UNIT.        ON RETURN, NODEAD HAS THE
/       ADDRESS OF THE INDICATED NODE (ASSUMING NO ERROR WERE DETECTED)
/       AND THE RETURN IS TO JMS+2. IF, HOWEVER, ERRORS WERE DETECTED
/       RETURN IS AT JMS+1.
/
DEQUE	0
	LAC	(PDVL	/SET XR TO ACCESS HEADER OF PDVL
	JMS	SETXR
	LAC	0,X	/GET ADDR. OF 1ST NODE
D1	JMS	SETXR      /COMPARE THE NAME AND UNIT NUMBER, JMP TO D2 IF NO MATCH
	LAC	2,X
	SAD	NAME1	/1ST HALF OF NAME MATCHES?
	SKP
	JMP	D2	/NO
        LAC     3,X		/YES -- 2ND HALF OF NAME?
	SZA
	JMP	D2	/NO
	LAC	5,X	/DOES THE UNIT NO. MATCH
	SAD	UNIT
	SKP
	JMP	D2	/NO
	PXA		/YES -- SAVE THE NODE ADDR
	TAD	MXRADJ
	DAC	NODEAD
	ISZ	DEQUE	/RETURN AT JMS+2 -- NODE FOUND
	JMP*	DEQUE
D2	LAC	0,X        /NO MATCH SO TEST FOR END OF DEQUE
	SAD	(PDVL
	JMP*	DEQUE
	JMP	D1	/NOT THE END OF THE DEQUE -- CHECK NEXT NODE
/
/       S.R. TO ADJUST THE XR
/
SETXR   0
	TAD	XRADJ
	PAX
	JMP*	SETXR
/ 
/ SUBROUTINE MFD -- MAKE SURE AN MFD ENTRY EXISTS FOR A UFD AND THAT
/                   THE UFD IS PROPERLY INITIALIZED.
/
/ ENTER WITH AC CONTAINING SIXBT NAME OF UFD AND 
/ UNIT CONTAINING THE UNIT NUMBER AND
/ DEVICE CONTAINING THE DEVICE CODE.
/
/ RETURN AT JMS+1 UNLESS AN ERROR IS DETECTED
/
/ ALL REGISTERS ARE MODIFIED
/
MFD	0
	DAC	MFDNAM		/SAVE THE NAME OF THE UFD
	JMS	MFDSCN		/SCAN THE MFD FOR THE UFD
	JMP	MFDFND		/RETURN HERE IF FOUND
MFD1	CLA			/RETURN HERE IF NOT -- LOOK FOR FREE ENTRY
	JMS	MFDSCN		/WAS A FREE MFD ENTRY FOUND?
	SKP
	JMP	MFD2		/NO -- GO CREATE ONE
	DAC	MFDT0		/YES -- SAVE MFD BLK WITH FREE ENTRY
	LAW	-1		/SET STATING UFD BLK TO -1 FOR FREE ENT
	DAC	1,X
	LAC	MFDT0		/GET THE MFD BLK NO.
	JMP	MFDFND		/GO ENTER NEW UFD
MFD2	JMS	MFDNEW		/ALLOCATE A BLK AND INIT BUFFER
	DAC	MFDT1		/SAVE NO. OF NEW BLOCK
	LAC	MFDT0		/GET NO. OF LAST MFD BLK
	DAC	BUFF+376	/ENTER NO. AS BACK PTR FOR NEW MFD BLK
	LAC	MFDT1		/WRITE OUT NEW MFD BLK
	JMS	MFDPUT
	LAC	MFDT0		/GET NO. OF OLD MFD BLK
	JMS	MFDGET		/READ IT INTO BUFFER
	LAC	MFDT1		/SET UP FWD PTR
	DAC	BUFF+377
	JMS	MFDPUT		/WRITE OUT OLD, MODIFIED MFD BLK
	LAC	(BUFF		/SET XR TO POINT AT BUFFER
	JMS	SETXR
	LAW	-1		/SET -1 INTO UFD ST. BLK
	DAC	1,X
	LAC	MFDT1		/GET BLK OF MFD WITH FREE ENTRY
MFDFND	DAC	MFDT0		/SAVE BLK NO. OF MFD BLK
	LAC	1,X		/IS UFD ST. BLK DEFINED?
	SAD	(-1
	SKP
	JMP*	MFD		/YES -- RETURN
	PXA			/NO -- SAVE XR
	DAC	MFDT1
	JMS	MFDNEW		/ALLO A BLK AND INIT BUFFER
	DAC	MFDT2		/SAVE NEW UFD BLK NO.
	JMS	MFDPUT		/WRITE OUT NEW UFD BLK
	LAC	MFDT0		/GET MFD BLK
	JMS	MFDGET
	LAC	MFDT1		/RESTORE XR
	PAX
	LAC	MFDNAM		/ENTER NAME OF UFD INTO MFD
	DAC	0,X
	LAC	MFDT2		/ENTER START OF UFD INTO MFD
	DAC	1,X
	LAC	(400010		/ENTER PC AND NO. WDS / UFD ENTRY
	DAC	2,X
	LAC	MFDT0		/WRITE OUT MODIFIED MFD BLK
	JMS	MFDPUT
	JMP*	MFD		/RETURN
/
MFDT0	0
MFDT1	0
MFDT2	0
MFDNAM	0
/
/ SUBROUTINE MFDSCN -- SCAN MFD FOR A UFD NAME
/
/ ENTER WITH AC CONTAINING UFD NAME AND
/ UNIT CONTAINING UNIT NUMBER AND
/ DEVICE CONTAINING DEVICE CODE
/
/ RETURN AT JMS+1 IF FOUND WITH AC=MFD BLK NO. AND XR POINTING
/ AT ENTRY (XR IS CORRECTED)
/ RETURN AT JMS+2 IF NOT FOUND WITH AC=LAST MFD BLK
/
/ ALL REGISTERS ARE MODIFIED
/
MFDSCN	0
	DAC	MFDST1		/SAVE UFD NAME
	LAC	DEVICE		/IS DEVICE THE RP?
	SAD	(3
	JMP	MFDS1		/YES
	LAC	(1777		/NO -- RK OR RF , GET MFD ST. BLK
	SKP
MFDS1	LAC	(47040
MFDS4	DAC	MFDST2		/SAVE MFD BLK NO.
	JMS	MFDGET		/READ IN MFD BLK
	LAC	(BUFF		/INIT PTR TO BUFFER
	DAC	MFDST0
MFDS2	LAC*	MFDST0		/GET THIS UFD NAME
	SAD	MFDST1		/DOES IT MATCH THE ONE WANTED?
	JMP	MFDS5		/YES
	LAC	MFDST0		/NO -- END OF MFD BLK?
	SAD	(BUFF+370
	JMP	MFDS3		/YES
	AAC	4		/NO -- PREPARE TO EXAMINE NEXT ENTRY
	DAC	MFDST0
	JMP	MFDS2		/GO LOOK AT NEXT MFD ENTRY
MFDS3	LAC	BUFF+377	/GET NO. OF NEXT MFD BLK
	SAD	(-1		/END OF MFD?
	SKP
	JMP	MFDS4		/NO -- PREPARE TO READIN NEXT BLK
	IDX	MFDSCN		/YES -- PREPARE TO RET. AT JMS+2
MFDS6	LAC	MFDST2		/GET MFD BLK INTO AC
	JMP*	MFDSCN		/RETURN
MFDS5	LAC	MFDST0		/GET THE POINTER TO MFD ENTRY
	JMS	SETXR		/ADJUST XR
	JMP	MFDS6		/PREPARE TO RETURN AT JMS+1
/
MFDST0	0
MFDST1	0
MFDST2	0
/
/ SUBROUTINE MFDNEW -- ALLOCATE A BLK AND INIT BUFFER
/
/ ENTER WITH DEVICE AND UNIT SET UP
/
/ RETURN AT JMS+1 WITH AC CONTAING BLK NO.
/
/ ALL REGISTERS ARE MODIFIED
/
MFDNEW	0
	LAC	DEVICE		/SET UP DEVICE AND UNIT NO.
	DAC	ALLO+4
	LAC	UNIT
	CLL
	ALS	17
	DAC	ACTA+1
	CAL	ALLO		/ALLOCATE A DISK BLOCK
	CAL	WAIT
	LAC	EV		/WHERE THERE ANY ERROR?
	SPA
	JMP	ERR09		/YES
	LAC	ACTA+2		/NO -- DETERMINE BLK NO.
	LMQ
	LAC	ACTA+1
	AND	(7777
	LRSS	10
	LAC	(BUFF-1		/INIT BUFFER
	DAC*	(X10
	LAW	-376		/INIT COUNTER
	DAC	MFDTMP
	DZM*	X10		/ZERO WDS 0-376
	ISZ	MFDTMP
	JMP	.-2
	LAW	-1		/SET -1 INTO BLK PTRS
	DAC	BUFF+376
	DAC	BUFF+377
	LACQ			/GET BLK NO. INTO AC
	JMP*	MFDNEW		/RETURN
/
MFDTMP	0
/
/ SUBROUTINE CONVRT -- CONVERT BLK NO. INTO PLATTER AND ADDR
/
/ ENTER WITH BLK NO. IN AC
/
/ RETURN AT JMS+1 UNCOND.
/
/ AC IS MODIFIED
/
CONVRT	0
	LMQ			/PUT BLK INTO MQ
	CLL
	LLSS!ECLA  10
	DAC	GPCTA+0		/ENTER PLATTER INTO CTA
	LACQ
	DAC	GPCTA+1		/ENTER ADDR INTO CTA
	LAC	UNIT		/ENTER UNIT NO.
	CLL
	ALS	17
	TAD	GPCTA+0
	DAC	GPCTA+0
	JMP*	CONVRT		/RETURN
/
/ SUBROUTINE MFDGET -- GET A DISK BLOCK
/
/ ENTER WITH BLK NO IN AC
/
/ RETURN AT JMS+1 WITH AC UNCHANGED
/
/ ALL OHTER REG. ARE MOD
/
MFDGET	0
	DAC	MFDTMP		/SAVE AC
	JMS	CONVRT		/CONVERT BLK NO INTO PLATTER + ADDR
	LAC	DEVICE		/ENTER DEVICE INOT CPB
	DAC	GET+4
	CAL	GET		/GET THE DISK BLK
	CAL	WAIT
	LAC	EV		/ANY ERROR?
	SPA
	JMP	ERR06		/YES
	LAC	MFDTMP		/NO -- RESTORE AC
	JMP*	MFDGET
/
/ SUBROUTINE MFDPUT -- WRITE OUT A DISK BLK
/
/ ENTER WITH BLK NO. IN AC
/
/ RETURN AT JMS+1 WITH AC UNCHANGED
/
/ ALL OTHER REG ARE MOD.
/
MFDPUT	0
	DAC	MFDTMP		/SAVE AC
	JMS	CONVRT		/ENTER PLATTER AND ADDR INTO CTA
	LAC	DEVICE		/SET UP DEVICE CODE
	DAC	PUT+4
	CAL	PUT		/WRITE OUT BLK
	CAL	WAIT
	LAC	EV		/ANY ERROR?
	SPA
	JMP	ERR10		/YES
	LAC	MFDTMP		/NO -- RESTORE AC
	JMP*	MFDPUT		/RETURN
TERM	0
XRADJ	0
MXRADJ	0
UNIT	0
NODEAD	0
EV	0
GN1	0
GN2	0
GN3     0
GNNFLG	0
GNTEMP	0
NNODE	0
FP	0
NAME1	0
NAME2   0
OLDUFD  0
TEMP    0
TEMP1   0
TEMP2   0
        .IFDEF TDV
XFEREV  0
        .ENDC
BUFF    .BLOCK 400
/
/       S.R. TO GET A DEVICE NAME AND UNIT NUMBER
/       ON RETURN GN1 HAS 1ST HALF OF NAME AND GN2 HAS UNIT NUMBER
/	GN3 HAS THE NAME OF THE UIC
/       IF ANY ERRORS ARE DETECTED RETURN AT JMS+1
/       IF NO ERRORS ARE DETECTED RETURN AT JMS+2 WITH AC=NEXT CHAR.
/
GETDEV	0
	DZM	GN1	/INIT. NAME AND UNIT NO.
	DZM	GN2
        DZM     GN3
	CLC		/INIT. FLAG -- SPACES NOW LEGAL
	DAC	GNNFLG
	JMS	GDSR /GET 1ST LETTER
	ALS	14
	DZM	GNNFLG	/CLEAR FLAG -- SPACES NOW ILLEGAL
	DAC	GN1	/SAVE CHAR.
	JMS	GDSR /GET 2ND CHAR
	ALS	6
	TAD	GN1
	DAC	GN1	/SAVE NAME OF DEVICE
	JMS	NEXT /GET NEXT CHAR
	JMS	NUMCK	/MAKE SURE IT'S A NO.
	DAC	GN2	/SAVE UNIT NO.
	JMS	NEXT /GET NEXT CHAR
	JMS	NUMCK	/MAKE SURE IT'S A NO.
	DAC	GNTEMP	/CONVERT 2 DIGIT DECI NO. INTO OCATL
	CLL
	LAC	GN2
	MUL
	12
	LACQ
	TAD	GNTEMP
	DAC	GN2	/SAVE UNIT NO.
	.IFUND	TDV
NEXT1	JMS*	(FAC		/GET THE NEXT CHAR
	.ENDC
	.IFDEF	TDV
NEXT1	JMS	FAC
	.ENDC
	SAD	(40		/IS CHAR A SPACE?
	JMP	.-2		/YES -- IGNORE IT
	SAD	(74		/NO -- <?
	SKP
	JMP*	GETDEV		/NO -- ERROR
	DZM	GNNFLG		/YES -- SET FLAG TO SHOW SPACES ARE BREAKS
	CLA
        JMS     GDSR
        ALS     14
        DAC     GN3
	CLA
        JMS     GDSR
        ALS     6
        TAD     GN3
        DAC     GN3
	CLA
        JMS     GDSR
        TAD     GN3
        DAC     GN3
        .IFUND TDV
	JMS*	(FAC	/GET NEXT CHAR INTO AS
        .ENDC
        .IFDEF TDV
        JMS     FAC
        .ENDC
	JMP	GDOK /PREPARE TO RETURN
/
/       S.R. TO GET NEXT NUMERICAL CHAR.
/
NEXT	0
        .IFUND TDV
	JMS*	(FAC
        .ENDC
        .IFDEF TDV
        JMS     FAC
        .ENDC
	SAD	(40	/SPACE?
	JMP	NEXT1 /YES
	SAD	(175 /NO -- ALTMODE?
	JMP	GDERR /YES
	SAD	(15	/NO -- CR?
	JMP	GDERR /YES
	DAC	GNTEMP	/NO -- SAVE CHAR
	JMP*	NEXT
/
/       S.R. TO CHECK TO SEE NUMBER IS REALLY A NUMBER
/       ON ENTRY AC HAS ASCII OF DIGIT
/       ON EXIT AC HAS OCTAL VALUE OF DIGIT
/       ERRORS FORCE A JMP TO GDERR
/
NUMCK	0
	TAD	(-60
	SPA
	JMP	GDERR	/ERROR IF ASCII<60
	LAC	GNTEMP
	TCA
	TAD	(71
	SPA
	JMP	GDERR	/ERROR IF ASCII>71
	LAC	GNTEMP
	AND	(17	/OK -- AC CONTAINS OCTAL NO.
	JMP*	NUMCK
/
/       S.R. TO CHECK THAT CHARACTER IS A LETTER
/       ON EXIT AC HAS SIXBT OF CHAR
/       ERRORS RESULT IN A JMP TO GDERR
/        IF THE AC IS 0 ON ENTRY ONLY CHECK FOR TERMINS.
/
GDSR	0
	DAC	GDTMP	/SAVE THE FLAG
        .IFUND TDV
	JMS*	(FAC	/READ NEXT CHAR.
        .ENDC
        .IFDEF TDV
        JMS     FAC
        .ENDC
	DAC	GNTEMP
	SAD	(40	/SPACE?
	JMP	GDSPAC	/YES
	SAD	(15	/NO -- CR?
	JMP*	GETDEV	/YES -- RETURN AT JMS+1
	SAD	(175 /NO -- ALTMODE?
	JMP*	GETDEV	/YES -- RETURN
	LAC	GDTMP	/NO -- SHOULD WE CHECK FOR LERRERS
	SNA
	JMP	GDSKP	/NO
	LAC	(-101	/YES
	TAD	GNTEMP
	SPA
	JMP	GDERR	/ERROR IF ASCII<101
GDSKP	LAC	GNTEMP
	TCA
	TAD	(132
	SPA
	JMP	GDERR	/ERROR IF ASCII>132
	LAC	GNTEMP
	AND	(77
	CLL
	JMP*	GDSR
GDSPAC	LAC	GNNFLG /IS THE SPACE LEGAL?
	SZA
	JMP	GDSR+1	/YES
GDERR	LAC	GNTEMP	/ERROR
	JMP*	GETDEV
GDOK	ISZ	GETDEV	/OK -- RETURN AT JMS+2
	JMP*	GETDEV
GDTMP	0
WRITE	2700
	EV
	MSGLUN
	2
	0
WAIT	20
	EV
PUT     13100
        EV
        1
        GPCTA
        XX
ALLO    11500
        EV
        1
        ACTA
        XX
ACTA    400
        XX
        XX
GET     13000
        EV
        1
        GPCTA
DEVICE  0
GPCTA     0
        0
        BUFF
        400
/  
        .IFDEF TDV
RFTDV   37
        EV
        FACLB
        22
/  
/  
/ SUBROUTINE FAC -- STANDARD TDV LINE BUFFER UNPACKER
/  
/  
FAC     0
        LAC*    FACCBX
        SMA
        JMP     FAC2
        LAC     (FACCB-1
        DAC     FACCBX
        LAC*    FACLBX
        ISZ     FACLBX
        LMQ
        CLA!CLL
        JMS     FACUPS
        JMS     FACUPS
        JMS     FACUPS
        LAC*    FACLBX
        ISZ     FACLBX
        LRS     17
        XOR*    FACCBX
        DAC*    FACCBX
        CLA
        JMS     FACUPS
        JMS     FACUPS
        LAC     (FACCB
        DAC     FACCBX
        LAC*    FACCBX
FAC2    SAD     (15
        JMP*    FAC
        SAD     (175
        JMP*    FAC
        ISZ     FACCBX
        JMP*    FAC
/  
FACUPS  0
        LLS     7
        ISZ     FACCBX
        DAC*    FACCBX
        CLA
        JMP*    FACUPS
FACLBX  FACLB+2
FACCBX  FACCB+5
FACCB   .BLOCK 5
        -1
/  
FACLB   .BLOCK 22
        .ASCII <15>
/  
        .ENDC
ERR01	LAC	(MSG1
	DAC	WRITE+4
	CAL	WRITE
	CAL	WAIT
	CLA
	JMP	EXIT1
ERR03	LAC	(MSG3
	JMP	ERR01+1
ERR02	LAC        (MSG2
	JMP	ERR01+1
ERR04	LAC	(MSG4
	JMP	ERR01+1
ERR05   LAC     (MSG5
        JMP     ERR01+1
ERR06	LAC        (MSG6
	JMP	ERR01+1
ERR09   LAC     (MSG9
        JMP     ERR01+1
ERR10   LAC     (MSG10
        JMP     ERR01+1
        .IFDEF TDV
ERR08   LAC     (MSG8
        JMP     ERR01+1
        .ENDC
MSG9    MSG10-MSG9/2*1000
        0
        .ASCII "ALLOCATION ERROR"<15>
MSG10   MSG1-MSG10/2*1000
        0
        .ASCII "DISK PUT ERROR"<15>
MSG1	MSG2-MSG1/2*1000
	0
	.ASCII "FORMAT ERROR"<15>
MSG2	MSG3-MSG2/2*1000
	0
	.ASCII "DISK HAS NO PDVL NODE"<15>
MSG3	MSG4-MSG3/2*1000
	0
        .ASCII "DEVICE IS NOT A DISK"<15>
MSG4	MSG5-MSG4/2*1000
	0
        .ASCII "ILLEGAL TO MOUNT THE SYSTEM DISK"<15>
MSG5    MSG6-MSG5/2*1000
        0
        .ASCII "DISK NOT DISMOUNTED"<15>
MSG6	MSG8-MSG6/2*1000
	0
        .ASCII "DISK GET ERROR"<15>
        .IFUND TDV
MSG8    0
        .ENDC
        .IFDEF TDV
MSG8    MSGEND-MSG8/2*1000
        0
        .ASCII "TDV READ ERROR"<15>
MSGEND    0
        .ENDC
	.END
