Google
 

Trailing-Edge - PDP-10 Archives - AP-4178E-RM - swskit-sources/futili.mac
There are 49 other files named futili.mac in the archive. Click here to see a list.
;<3-MONITOR>FUTILI.MAC.91,  7-Nov-77 13:02:12, EDIT BY KIRSCHEN
;MORE COPYRIGHT UPDATING...
;<3-MONITOR>FUTILI.MAC.90, 12-Oct-77 13:47:48, EDIT BY KIRSCHEN
;UPDATE COPYRIGHT FOR RELEASE 3
;<3-MONITOR>FUTILI.MAC.89, 20-Sep-77 15:17:41, EDIT BY HURLEY
;PERFORMANCE IMPROVEMENT - GET STR NUMBER FROM UNIQUE CODE IN CNVSTR
;<3-MONITOR>FUTILI.MAC.88,  3-Aug-77 14:31:16, EDIT BY HALL
;MAKE CPYTU1 WORK FROM ANY SECTION
;<3-MONITOR>FUTILI.MAC.87, 14-Jun-77 20:16:45, EDIT BY OSMAN
;ADD CPYTU1 ROUTINE.
;<3-MONITOR>FUTILI.MAC.86,  2-May-77 20:32:43, EDIT BY BOSACK
;<3-MONITOR>FUTILI.MAC.85, 28-Feb-77 04:36:55, EDIT BY CROSSLAND
;TCO 1744 ADD CPYFU2 ROUTINE FOR CRJOB JSYS
;<3-MONITOR>FUTILI.MAC.84, 23-Jan-77 15:10:21, Edit by MCLEAN
;<3-MONITOR>FUTILI.MAC.83, 27-Dec-76 17:32:38, EDIT BY HURLEY
;<3-MONITOR>FUTILI.MAC.82, 27-Nov-76 22:01:56, Edit by MCLEAN
;<3-MONITOR>FUTILI.MAC.81, 25-Nov-76 02:09:58, Edit by MCLEAN
;TCO 1669 EXTENDED ADDRESSING
;<2-MONITOR>FUTILI.MAC.80,  2-Nov-76 14:58:42, EDIT BY MILLER
;<2-MONITOR>FUTILI.MAC.79,  2-Nov-76 14:38:42, EDIT BY MILLER
;TCO 1642. CHECK BYTE POINTER BEFORE GOING NOINT IN CPYFUS
;<2-MONITOR>FUTILI.MAC.78,  1-Nov-76 14:33:14, EDIT BY KIRSCHEN
;MAKE GTSTOF, FRJSSO TURN -1 INTO UNIQUE CODE FOR CONNECTED STR
;<2-MONITOR>FUTILI.MAC.77, 21-Oct-76 12:20:45, Edit by MCLEAN
;TCO 1612 FIX ERROR RETURN FOR CNVSTD
;<2-MONITOR>FUTILI.MAC.76, 11-Oct-76 09:09:00, EDIT BY HURLEY
;<2-MONITOR>FUTILI.MAC.75,  5-Oct-76 17:07:42, EDIT BY HALL
;ADDITION TO PREVIOUS EDIT
;<2-MONITOR>FUTILI.MAC.74,  4-Oct-76 16:48:49, EDIT BY HALL
;ADDED CKJBNO AND CKJBLI TO VERIFY A JOB NUMBER
;<2-MONITOR>FUTILI.MAC.73,  1-Oct-76 16:39:52, EDIT BY HURLEY
;ADD CNVSTU ROUTINE TO CONVERT A USER NAME STRING TO USER NUMBER
;<2-MONITOR>FUTILI.MAC.72, 30-Sep-76 15:33:09, EDIT BY HALL
;FIXED BUG IN GTSTOF (RELGRP WAS CLOBBERING T2)
;<2-MONITOR>FUTILI.MAC.71, 30-Sep-76 12:59:40, EDIT BY HALL
;MADE GTSTOF ZERO JSSDM WHEN CREATING A NEW SLOT
;<2-MONITOR>FUTILI.MAC.70, 30-Sep-76 12:53:59, EDIT BY HALL
;FIXED FNDSTO 
;<2-MONITOR>FUTILI.MAC.69, 29-Sep-76 17:16:34, EDIT BY HALL
;MADE GTSTOF RELEASE GROUP SPACE IF NECESSARY; MADE FNDSTO LOOK FOR
; JSSDM; ADDED FRJSSO ENTRY POINT TO FRJSST
;<2-MONITOR>FUTILI.MAC.68, 28-Sep-76 17:05:17, EDIT BY HALL
;FIXED BUG IN FNDSTO
;<2-MONITOR>FUTILI.MAC.67, 28-Sep-76 14:47:59, EDIT BY HALL
;CHANGED GTSTOF, FNDSTO, AND FNDSTM TO TAKE UNIQUE CODE.  DELETED
;GTCSNO AND GTOJNO
;<2-MONITOR>FUTILI.MAC.66, 27-Sep-76 18:08:53, EDIT BY HALL
;MADE GTSTOF CALL FNDSTO; ADDED FRJSST; FIXED ERROR HANDLING IN CNVSTD
;<2-MONITOR>FUTILI.MAC.65, 23-Sep-76 16:02:08, Edit by HESS
;CHANGE STR # TO UNIQUE CODE FOR STDEV/DEVST
;<2-MONITOR>FUTILI.MAC.64, 23-Sep-76 15:33:01, EDIT BY KIRSCHEN
;ADD ROUTINES TO FIND STRUCTURE BLOCK IN JSB AND FAIL IF NOT THERE
;<2-MONITOR>FUTILI.MAC.63, 20-Sep-76 10:36:36, EDIT BY HALL
;ADDED COMMENTS TO EXPLAIN REQUIREMENTS FOR STRUCTURE CONVERSION ROUTINES
;<2-MONITOR>FUTILI.MAC.62, 31-Aug-76 17:11:58, EDIT BY HALL
;MADE CPYUSR, CPYFU0, ETC. USE STKVAR'S 
;<2-MONITOR>FUTILI.MAC.61, 27-Aug-76 16:02:58, EDIT BY HALL
;FIX TO CPYUSR EDIT
;<2-MONITOR>FUTILI.MAC.60, 27-Aug-76 16:00:59, EDIT BY HALL
;ADJUST PREVIOUS EDIT TO BACK UP THE BYTE POINTER BY ONE CHARACTER
;<2-MONITOR>FUTILI.MAC.59, 26-Aug-76 15:15:53, EDIT BY HALL
;MADE CPYUSR, CPYFUS, ETC. RETURN USER'S UPDATED BYTE POINTER IN AC 3
;<2-MONITOR>FUTILI.MAC.58, 25-Aug-76 12:32:08, EDIT BY OSMAN
;<2-MONITOR>FUTILI.MAC.57, 25-Aug-76 11:29:13, EDIT BY HALL
;MADE STRCNV ACCEPT -1 AND CONVERT IT TO THE USER'S CONNECTED STRUCTURE
;<2-MONITOR>FUTILI.MAC.56, 23-Aug-76 09:08:02, EDIT BY KIRSCHEN
;FIX CPYUSR BUG - ADJUST CHAR COUNT BASED ON LENGTH OF BLOCK USED
;<2-MONITOR>FUTILI.MAC.55, 12-Aug-76 18:08:58, EDIT BY HALL
;ADDED CNVSTD ROUTINE - CONVERTS STR:<DIR> TO STRUCTURE UNIQUE CODE,,
;DIRECTORY NUMBER
;<2-MONITOR>FUTILI.MAC.54, 11-Aug-76 12:06:12, EDIT BY HURLEY
;ADD CNVDIR ROUTINE AND DISALLOW USER NUMBERS IN CNVSTR
;<2-MONITOR>FUTILI.MAC.53,  5-Aug-76 15:26:35, EDIT BY KIRSCHEN
;ADD CPYUSR ROUTINE- IT'S CPYFUS WITH DESIRED BLOCK SIZE IN B
;<2-MONITOR>FUTILI.MAC.52,  4-Aug-76 19:27:08, EDIT BY HURLEY
;<2-MONITOR>FUTILI.MAC.51,  4-Aug-76 19:15:59, EDIT BY HURLEY
;<2-MONITOR>FUTILI.MAC.50,  4-Aug-76 14:02:47, EDIT BY HURLEY
;<2-MONITOR>FUTILI.MAC.49,  4-Aug-76 11:44:53, EDIT BY MILLER
;FIX CNVSTR
;<2-MONITOR>FUTILI.MAC.48,  4-Aug-76 10:39:14, EDIT BY KIRSCHEN
;ADD STRCNV ROUTINE
;<2-MONITOR>FUTILI.MAC.47,  3-Aug-76 20:12:40, EDIT BY HURLEY
;<2-MONITOR>FUTILI.MAC.46,  3-Aug-76 19:17:08, EDIT BY HURLEY
;EXPAND DIRECTORY NUMBERS TO 36 BITS
;<2-MONITOR>FUTILI.MAC.45,  2-Aug-76 13:26:23, EDIT BY HALL
;MADE CNVSTR AND GTSTOF RETURN ERROR CODES
;<2-MONITOR>FUTILI.MAC.44,  2-Aug-76 13:00:36, EDIT BY HALL
;CHANGED PREVIOUS EDIT (TYPO)
;<2-MONITOR>FUTILI.MAC.43,  2-Aug-76 12:32:34, EDIT BY HALL
;IN GTSTOF CHANGED TEST FOR FREE SLOT IN JSSTRT
;<2-MONITOR>FUTILI.MAC.42,  1-Aug-76 18:20:45, EDIT BY HALL
;FIXED TYPOS IN GTSTOF AND CNVSTR
;<2-MONITOR>FUTILI.MAC.41,  1-Aug-76 16:00:15, EDIT BY HALL
;FIXED USE OF BAD DEFSTRS
;<2-MONITOR>FUTILI.MAC.40, 29-Jul-76 16:18:37, EDIT BY HALL
;FIXED TYPO IN GTSTOF
;<2-MONITOR>FUTILI.MAC.39, 29-Jul-76 16:10:50, EDIT BY HALL
;ADDED GTSTOF ROUTINE
;<2-MONITOR>FUTILI.MAC.38, 25-Jul-76 13:24:43, EDIT BY HALL
;FURTHER FIXES TO GTOJCD,ETC.
;<2-MONITOR>FUTILI.MAC.37, 25-Jul-76 13:00:30, EDIT BY HALL
;CHANGES TO CNVSTR,GTOJCD,GTOJNO,GTCSCD,GTCSNO
;<2-MONITOR>FUTILI.MAC.36, 24-Jul-76 13:57:21, EDIT BY HALL
;MADE FIX TO PREVIOUS EDIT - MISSING LABEL
;<2-MONITOR>FUTILI.MAC.35, 24-Jul-76 13:35:39, EDIT BY HALL
;ADDED LOCKING OF STRUCTURE TO CNVSTR
;<2-MONITOR>FUTILI.MAC.34, 24-Jul-76 13:28:53, EDIT BY HALL
;ADDED ENTRY POINTS GTOJCD AND GTOJNO FOR GETTING CONNECTED STRUCTURE
;AND DIRECTORY FOR JOB OTHER THAN SELF
;<2-MONITOR>FUTILI.MAC.33, 24-Jul-76 10:38:37, EDIT BY HALL
;ADDED ROUTINES GTCSCD,GTCDNO,CNVSTR
;<2-MONITOR>FUTILI.MAC.2, 10-MAY-76 14:06:53, EDIT BY KIRSCHEN
;USE .DVDSK WHEN FORMING DEVICE DESIGNATOR FOR STRUCTURE IN STRST ROUTINE
;<2-MONITOR>FUTILI.MAC.1, 10-MAY-76 10:18:04, EDIT BY KIRSCHEN
;ADD STRST ROUTINE
;<2MONITOR>FUTILI.MAC.31, 16-JAN-76 17:48:17, EDIT BY MURPHY
;<2MONITOR>FUTILI.MAC.30, 23-DEC-75 12:49:21, EDIT BY LEWINE


;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1976, 1977, 1978 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

	SEARCH PROLOG
	TTITLE FUTILITY
	SWAPCD

;NO SPECIAL AC DEFINITIONS USED HEREIN

; Save ac's before monitor call

SAVAC::	ADD P,BHC+NSAC-1	; Make room for nsac ac's
	JUMPGE P,MSTKOV
	PUSH P,-<NSAC-1>(P)	; Move return to end
	MOVEM NSAC-1,-1(P)	; Save last ac
	MOVEI NSAC-1,-NSAC(P)	; Make blt pointer
	BLT NSAC-1,-2(P)	; Blt onto stack
	RET

RESAC::	MOVSI NSAC-1,-NSAC(P)	; Blt from stack to 0
	BLT NSAC-1,NSAC-1
	POP P,-NSAC(P)		; Move return to new top
	SUB P,BHC+NSAC-1	; Flush the room on the stack
	RET
;ROUTINE TO ACCEPT YES/NO ANSWER FROM USER.  REQUIRES USER TO
;TYPE Y OR N.  RETURNS "TRUE" ON Y, "FALSE" ON N IN A.

YESNO::	STKVAR <<YESNOL,2>,YESAB,YESAC>
	SE1CAL
	MOVEM B,YESAB		;PRESERVE ALL ACS
	MOVEM C,YESAC
YESN2:	HRROI A,YESNOL		;POINT TO STACK BUFFER
	MOVE B,[RD%BEL+^D10]
	MOVEI C,0		;NO ^R BUFFER
	RDTTY			;READ A LINE
	 JRST YESN1		;SHOULDN'T HAPPEN
	TXNN B,RD%BTM		;LINE TERMINATED WITH BREAK CHAR?
	JRST YESN1		;NO, OBJECT
	MOVE B,YESAB		;RESTORE AC'S
	MOVE C,YESAC
	LDB A,[POINT 7,YESNOL,6] ;GET FIRST CHAR OF LINE
	CAIL A,"A"+40		;LOWER CASE?
	CAILE A,"Z"+40
	SKIPA			;NO
	SUBI A,40		;YES, CONVERT
	CAIN A,"Y"		;GOT A "Y"?
	JRST RTRUE		;YES, RETURN TRUE
	CAIN A,"N"		;GOT A "N"?
	JRST RFALSE		;YES, RETURN FALSE
YESN1:	HRROI A,[ASCIZ / (Y OR N) /]
	PSOUT			;PROMPT USER
	JRST YESN2		;TRY AGAIN
;COPY STRING FROM USER TO JSB.  ASSIGN SPACE AND TRIM BLOCK AFTER COPY.
;ACCEPTS:
;	A/ STRING PTR TO USER'S ADDRESS SPACE
;	CALL CPYFU0
; RETURN +1: NO ROOM
; RETURN +2: SUCCESS, NOINT
;		A/ LOOKUP PTR TO JSB FREE SPACE
;		B/ UPDATED STRING PTR IN JSB FREE SPACE
;		C/ UPDATED STRING POINTER IN USER ADDRESS SPACE

CPYFU0::SETZB D,B		;DO TRMBLK AFTER COPY, USE DEFAULT BLOCK SIZE
	SE1CAL
	JRST CPYUS4

;COPY STRING FROM USER TO JSB.  ASSIGN SPACE BUT DONOT TRIM BLOCK.
; A/ STRING PTR TO USER'S ADDRESS SPACE
; B/ LENGTH OF BLOCK IN WORDS IF CALLING CPYUSR
;	CALL CPYFUS (OR CPYUSR IF SUPPLYING LENGTH)
; RETURN +1: NO ROOM
; RETURN +2: SUCCESS, NOINT
;		A/ LOOKUP PTR TO JSB FREE SPACE
;		B/ UPDATED STRING PTR IN JSB FREE SPACE
;		C/ UPDATED STRING POINTER IN USER SPACE

CPYFUS::SETZM B			;USE DEFAULT BLOCK SIZE
CPYUSR::SETO D,			;SAY NO TRMBLK

	SE1CAL
CPYUS4:	STKVAR<CPYFLG,CPYPTR>
	MOVEM D,CPYFLG		;SAVE FLAG FOR TRIMMING BLOCK
	HLRZ C,A		;GET LH OF BYTE POINTER
	CAIN C,-1		;IS BP -1,,ADDR?
	HRLI A,(<POINT 7,0>)	;YES. GET REASONABLE LH
	XCTBU [	LDB C,A]	;TEST THE BYTE POINTER FOR AN INDIRECT LOOP
	MOVEM A,CPYPTR		;SAVE USER'S STRING POINTER
	SKIPN B			;BLOCK SIZE SUPPLIED ?
	MOVEI B,MAXLW		;NO, USE DEFUALT SIZE
	ADDI B,1		;ALLOW FOR BLOCK HEADER
	NOINT
	CALL ASGJFR		;ASSIGN JSB SPACE. RETURNS ADDRESS OF
				; BLOCK IN AC 1
	 JRST [	MOVE A,CPYPTR	;FAILED. RESTORE USER'S POINTER
		RET]		;TAKE ERROR RETURN
	MOVE B,CPYPTR		;B/POINTER TO USER SPACE
	HRRZ C,A
	HRRZ C,(C)		;GET SIZE OF THIS BLOCK FROM HEADER
	IMULI C,5		;GET # OF CHARACTERS IN BLOCK
	SUBI C,6		;ALLOW FOR NULL; SUBTRACT # OF CHARS IN HEADER
				; 5*(SIZE-1) - 1
	MOVE D,CPYFLG		;RESTORE FLAG FOR TRIMMING BLOCK
	JRST CPYFU6		;GO DO THE COPY
;COPY STRING FROM USER TO SPACE ALREADY ASSIGNED
; A/ LOC OF BLOCK IN JSB FREE SPACE
; B/ STRING PTR IN USER'S ADDRESS SPACE
;	CALL CPYFU1
; RETURN +2: ALWAYS, STRING COPIED AND BLOCK NOT TRIMMED
;		A/ -(NWORDS-1) ,, ORG (LOOKUP POINTER)
;		B/ BYTE POINTER TO END OF STRING (BEFORE NULL)
;		C/ UPDATED STRING POINTER IN USER'S ADDRESS SPACE

;THE BLOCK THAT IS PROVIDED MUST HAVE ROOM FOR MAXLC CHARACTERS PLUS A
;WORD (NORMALLY THE HEADER)

CPYFU1::SETO D,			;SAY NO TRMBLK
	SE1CAL
	MOVEI C,MAXLC		;USE DEFAULT NUMBER OF CHARACTERS
	JRST CPYFU6		;GO DO THE COPY


;COPY STRING FROM USERS TO SPACE ALREADY ASSIGNED.  LIKE CPYFU1 BUT
;THE LENGTH IS PROVIDED BY THE CALLER
; A/ LOC OF BLOCK IN JSB FREE SPACE
; B/ STRING PTR IN USER'S ADDRESS SPACE
; C/ LENGTH OF STRING
;	CALL CPYFU2
; RETURN +2: ALWAYS, STRING COPIED AND BLOCK NOT TRIMMED
;		A/ -(NWORDS-1) ,, ORG (LOOKUP POINTER)
;		B/ BYTE POINTER TO END OF STRING (BEFORE NULL)
;		C/ UPDATED STRING POINTER IN USER'S ADDRESS SPACE

;THE BLOCK THAT IS PROVIDED MUST HAVE ROOM FOR THE CHARACTERS PLUS A
;WORD (NORMALLY THE HEADER)

CPYFU2::SETO D,			;SAY NO TRMBLK
	SE1CAL
	JRST CPYFU6		;GO DO THE COPY
;CPYFU6 - COMMON CODE FOR CPYUSR, CPYFUS, CPYFU1, CPYFU0

;A/LOCATION OF FREE SPACE
;B/USER'S STRING POINTER
;C/NUMBER CHARACTERS THAT FREE SPACE CAN HOLD
;D/0 IF WANT TO TRIM BLOCK AFTER COPY, -1 IF NOT

CPYFU6:	STKVAR<CPYFLG,CPYBLK,CPYUPT,CPYLPT>
	MOVEM D,CPYFLG		;SAVE TRMBLK FLAG
	MOVEM A,CPYBLK		;SAVE LOCATION OF FREE SPACE BLOCK
	EXCH A,B		;A/USER'S STRING POINTER, B/ADDRESS OF JSB FREE SPACE
	HRLI B,(<POINT 7,0,35>)	;POINT TO FIRST WORD AFTER HEADER
	JUMPGE A,CPYUS1		;IF USER SPECIFIED (-1,,ADDRESS)
	CAML A,[777777000000]	; CONVERT IT TO BYTE POINTER FOR ILDB
	HRLI A,(<POINT 7,0>)

CPYUS1:	XCTBU [ILDB D,A]	;GET THE NEXT CHARACTER FROM USER SPACE
	CAIN D,"V"-100		;QUOTE CHARACTER?
	XCTBU [ILDB D,A]	;YES, GET NEXT CHAR
	SOSGE C			;OUT OF SPACE IN JSB BLOCK?
	MOVEI D,0		;YES. OVERWRITE LAST CHARACTER WITH NULL
	JUMPE D,CPYUS2		;FOUND A NULL OR OUT OF SPACE?
	CAIL D,"A"+40		;NO. LOWER CASE?
	CAILE D,"Z"+40
	SKIPA			;NO
	TRZ D,40		;YES, RAISE
	IDPB D,B		;STORE IN FREE SPACE BLOCK
	JRST CPYUS1		;GO GET NEXT CHARACTER

;AT END OF STRING.  APPEND A NULL AND BACKUP THE LOCAL COPY OF THE USER'S BYTE
;POINTER TO POINT TO THE LAST CHARACTER

CPYUS2:	MOVNI C,1		;AMOUNT TO ADJUST BYTE POINTER
	ADJBP C,A		;BACKUP THE USER'S BYTE POINTER TO POINT TO
				; LAST CHARACTER
	MOVEM C,CPYUPT		;SAVE THE ADJUSTED POINTER
	MOVE A,CPYBLK		;RECOVER ORG OF BLOCK
	MOVEM B,CPYLPT		;SAVE END STRING PTR
	IDPB D,B		;APPEND NULL TO STRING
	SKIPE CPYFLG		;WANT TO TRIM BLOCK?
	JRST [	SUBM A,B	;NO. COMPUTE -NWORDS
		HRLI A,1(B)	;MAKE LOOKUP PTR: -(NWORDS-1),,ORG
		JRST CPYUS3]
	CALL TRMBLK		;YES. A/ADDRESS OF BLOCK, B/LAST WORD USED
				;TRIM BLOCK, RETURN EXCESS TO FREE LIST
	HRRZ A,CPYBLK		;RECOVER ORG
	MOVN B,0(A)		;GET NEG LENGTH OF BLOCK
	HRLI A,2(B)		;NWORDS-1 = BLOCKLENGTH-2
CPYUS3:	MOVE C,CPYUPT		;RECOVER USER'S UPDATED BYTE POINTER
	MOVE B,CPYLPT		;RECOVER PTR TO END OF STRING IN JSB
	RETSKP
; Copy string to user
; Call:	A	; User pointer
;	B	; LocatiOn of string block
;	CALL CPYTUS
;	UPDATED POINTER ALWAYS WRITTEN TO USER'S AC2.  USE CPYTU1 FOR
;	WRITING UPDATED POINTER TO SOMEWHERE ELSE

CPYTUS::MOVEI C,2	;RETURN UPDATED POINTER IN USER'S AC2
	CALLRET CPYTU1	;DO THE WORK AND RETURN

; Copy string to user
; Call:	A	; User pointer
;	B	; LocatiOn of string block
;	C	;USER ADDRESS INTO WHICH TO WRITE UPDATED POINTER
;	CALL CPYTU1

CPYTU1::SE1CAL
	ACVAR <W1>		;RESERVE A WORK REGISTER
	JUMPGE A,STDIR0
	CAML A,[777777000000]
	HRLI A,(<POINT 7,0>)
STDIR0:	MOVE W1,[POINT 7,0(B),35] ;GET A BYTE POINTER TO SOURCE
STDIR2:	ILDB D,W1
	JUMPE D,STDIR3
	XCTBU [IDPB D,A]
	JRST STDIR2

STDIR3:	UMOVEM A,@C
	XCTBU [IDPB D,A]
	RET
; ROUTINE TO FORM A FILESPEC OF THE FORM STR:FILE-SPEC
;
; CALL: ACCEPTS IN T1/ DESTINATION POINTER
;		   T2/ STRUCTURE NUMBER
;		   T3/ POINTER TO FILENAME
;		CALL STRST
; RETURNS: +1	 ERROR
;	   +2	SUCCESS

STRST::	SE1CAL
	ASUBR <DSTPNT,STRNM,FPNTR>
	MOVE T1,STRNM		;COPY STRUCTURE #
	CALL STRCNV		;CONVERT TO UNIQUE CODE
	 RET			;ERROR
	MOVE T2,T1		;RETURNS IN T1
	HRLI T2,.DVDES+.DVDSK	;FORM DEVICE DESIGNATOR
	MOVE T1,DSTPNT		;GET POINTER
	DEVST			;TRANSLATE STR NUMBER TO STRING
	 RET			;RETURN, ERROR
	MOVEI T4,":"		;GET DEVICE PUNCTUATION
	IDPB T4,T1		;TERMINATE STRUCTURE NAME
	MOVE T2,FPNTR		;GET POINTER TO FILESPEC
	SETZM T3		;TERMINATE ON NULL
	SOUT			;COPY REMAINDER OF FILENAME
	 ERJMP R		;IF ERROR, JUST RETURN
	RETSKP			;RETURN
;GTCSCD, GTOJCD, - ROUTINES TO GET CONNECTED STRUCTURE AND DIRECTORY

;ACCEPTS: IF CALLING GTCSCD, NONE
;	 IF CALLING GTOJCD,
;		T1/OFFSET TO USE IN ADDRESSING OTHER JOB'S JSB

;RETURNS +1: ALWAYS
;		T1/STRUCTURE UNIQUE CODE,,DIRECTORY NUMBER

;GTCSCD HANDLES THE CASE WHERE THE JOB IS ASKING ABOUT ITSELF.
;IT ASSUMES THE JSB IS MAPPED AT THE USUAL PLACE
;GTOJCD HANDLES THE CASE WHERE THE JOB IS ASKING ABOUT ANOTHER
;JOB.  THE JSB MUST BE MAPPED, AND T1 MUST CONTAIN THE DIFFERENCE BETWEEN
;WHERE THE JSB IS USUALLY MAPPED AND WHERE THE OTHER JOB'S JSB IS MAPPED.
;THIS VALUE IS RETURNED BY SETJSB

GTCSCD::SETZ T1,		;THIS JOB. JSB IS MAPPED IN USUAL PLACE
GTOJCD::LOAD T2,JSUC,(T1) 	;GET UNIQUE CODE FOR CONNECTED STRUCTURE
	LOAD T1,JSDIR,(T1)	;GET CONNECTED DIRECTORY NUMBER
	HRL T1,T2		;GET STRUCTURE CODE
	RET
;CNVSTR - CONVERT STRUCTURE UNIQUE CODE TO STRUCTURE NUMBER (OFFSET
;IN STRTAB)

;ACCEPTS:
;	T1/STRUCTURE UNIQUE CODE IN RH

;RETURNS +1: STRUCTURE DOES NOT EXIST IN SDB
;	 +2: STRUCTURE EXISTS, NOINT
;