Google
 

Trailing-Edge - PDP-10 Archives - BB-KL11K-BM_1990 - t20src/helper.mac
There are 58 other files named helper.mac in the archive. Click here to see a list.
TITLE .HELPR	SUBROUTINE TO OUTPUT SYS:??????.HLP  %7F(57)
SUBTTL	A.W.LYONS/AWL/PFC/BPK/LCR/PY/JJF	10-DEC-89

;COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1971,1981,1984,1986,1988.
;ALL RIGHTS RESERVED.

;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
;ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND WITH THE
;INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY  OTHER
;COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
;OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
;TRANSFERRED.
;
;THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
;AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
;CORPORATION.
;
;DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
;SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.

VERSION==7			; MAJOR VERSION NO
VMINOR==7			; MINOR VERSION NO
EDITNO==57			; EDIT NUMBER
VWHO==0				; WHO LAST EDITED

%HELPR==:BYTE(3)VWHO(9)VERSION(6)VMINOR(18)EDITNO	; SET HELPER VERSION #
	PAGE

	COMMENT	~

REVISION HISTORY


%4(35) JAN 1972

36	(10-9713) Handle sequenced files and I/O errors
37	(10-11567) Handle HLP:
40	Add alternate entry 'HELPER' for FORTRAN/COBOL
41	Expand sorry message

%5(41) Dec, 73
42			BPK
	JSYSize HELPER and other assorted sundries.

43			BPK
	Create label HLPVER to store helper version instead
	of using .JBVER
44			BPK
	Search universal HLP20 for definition of TOPS20

45			BPK
	Implement new JSYS convention (ie. jsys%)

46			BPK
	Replace HLPVER with %HELPR and make it accessible
	to LINK.

47			PY	18-Aug-81
	Change the version number to match SCAN and WILD. Remove
	the reference to HLPR20, use an IFNDEF to default TOPS-10
	version. Change to more informative edit history style.

50			LCR
	If HLP: does not exist, try SYS: before giving error
	message. Note: This edit was originally installed as
	edit 42 in 1974.

51			LCR
	Use monitor supplied /MESSAGE setting. Note: This edit
	was installed as edit 43 in 1974.

52			PY	6-Oct-81
	Re-install the previous two edits, which were lost about
	eight years ago. Also change edit history format retroactive
	to start of this version, and indicate edit level and date
	last version was shipped.

%7D(52) JAN, 1982

53	SPR 10-34975	DRB	29-Jan-85
	Use non-privileged FILOP.s to lookup the help file (unless [1,2])
	so that we don't accidentally read something we shouldn't should
	we be running with JACCT.

54	None	BAH	9-Aug-85
	Do copyrights.

55	SPR 10-35295	DRB	26-Sep-85
	.RBCNT is being setup one too large.

%7E(54) AUG, 1985

56	None.	BAH	27-Oct-87
	The ECOPY and BCOPY macros are for TOPS10 only.  Put the IFE TOPS20
	assembly parameter around them.

%7F(57) DEC, 1989

57	None. 	JJF	 8-Dec-89
	Add code to TOPS-10 version to clear the screen before displaying
	the HELP and after each screenful of text.  Adds FTPAUS feature
	test (normally off) to control HELPER's behaviour.

*** END REVISION HISTORY
	~
	PAGE

	COMMENT	~

HELPER is a subroutine used to output help texts(HLP:/SYS:??????.HLP)
onto device TTY.  It was designed as a tool for the various
modules of the MULTI-PROGRAMMING-BATCH project.

Entered with the sixbit module name in AC1 via:

	PUSHJ	P,.HELPR
	return to here at end of HELPER

or	MOVEI	16,[,,['module']]
	PUSHJ	17,HELPER

HELPER requires eighteen locations (ten in -20 native mode) on
the push-down list on which to store and from which to
restore user AC'S and use as FILOP. argument blocks.  In -20
mode these locations are also used for the text buffer during I/O.
	~

PAGE
SUBTTL	ASSIGNMENTS
;ACCUMULATORS

T1=1	;AC1
T2=2	;AC2
T3=3	;AC3
T4=4	;AC4
T5=5	;AC5
AP=16	;ARG LIST POINTER
P=17	;STACK POINTER

;DEVICE CHANNELS

DSK=0

ENTRY	.HELPR,HELPER

SALL

IFNDEF	TOPS20,<TOPS20==0>	;[47] DEFAULT TO TOPS-10 STYLE

IFNDEF	FTPAUS,<FTPAUS==0>	;[57] PAUSE AT END OF SCREEN UNDER TOPS10
				;[57] NORMALLY OFF

IFE TOPS20,<SEARCH MACTEN,UUOSYM> ; GET -10 MONITOR SYMBOLS
IFN TOPS20,<SEARCH MACSYM,MONSYM> ; GET -20 MONITOR SYMBOLS


IFE TOPS20,<

.BCOPY
COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1971,1988. ALL RIGHTS RESERVED.
\; END COPYRIGHT MACRO
.ECOPY

IFN FTPAUS,<IF1, <PRINTX [Assembling HELPER with screen pausing code]>> 

>; END IFE TOPS20


IFE TOPS20,<
	TWOSEG
	RELOC	400000>

	PAGE
SUBTTL	TOPS-10 HELPER CODE
IFE TOPS20,<			;START -10 NATIVE HELPER
STKALC==1+<<.BFCTR+1>+<.FOLEB+1>+<.RBEXT+1>> ;[53] NUMBER OF STACK WORDS TO ZERO

HELPER:	MOVE	T1,@(AP)	;FETCH FIRST ARG

.HELPR:	PUSH	P,T2		;SAVE ACS THAT ARE USED
	PUSH	P,T3
	PUSH	P,T4
	PUSH	P,.JBFF		;SAVE .JBFF
	MOVE	T2,.JBREL	;GET ACTUAL CORE SIZE
	HRLM	T2,(P)		;SAVE FOR RESTORATION
	SETZ	T2,		;TO LOAD BUFFER HEADER INTO PDL
	MOVEI	T3,STKALC	;[53] GET THE NUMBER OF STACK LOCS WE WANT
	PUSH	P,T2		;[53] GET A ZEROED LOCATION
	SOJG	T3,.-1		;[53] LOOP FOR ALL WE NEED
	MOVEI	T4,-<STKALC-1>(P) ;[53] POINT AT OUR FILOP. BLOCK
	MOVX	T3,%LDFFA	;[53] THEN, ASK THE MONITOR
	GETTAB	T3,		;[53]   WHO FULL FILE ACCESS IS
	  MOVE	T3,[1,,2]	;[53] THIS SHOULDN'T HAPPEN
	GETPPN	T2,		;[53] GET OUR PPN
	  JFCL			;[53] THIS REALLY COULD HAPPEN
	CAME	T2,T3		;[53] ARE WE ALLOWED LOTS OF ACCESS?
	  SKIPA	T2,[DSK,,.FORED] ;[53] NO, DON'T TRY FOR PRIVED READ
	MOVE	T2,[FO.PRV!<DSK,,.FORED>] ;[53] YES, TURN ALL OUR PRIVS ON
	MOVEM	T2,.FOFNC(T4)	;[53] STORE THE FUNCTION WORD
	MOVX	T2,.IOASC	;[53] GET THE I/O MODE
	MOVEM	T2,.FOIOS(T4)	;[53] STORE IN THE FILOP. BLOCK
	HRRZI	T2,-2(P)	;[53] POINT AT THE INPUT BUFFER HEADER
	MOVEM	T2,.FOBRH(T4)	;[53] STORE IT
	HRRZI	T2,1		;[53] GET ONE BUFFER FOR INPUT
	MOVEM	T2,.FONBF(T4)	;[53] STORE IN THE FILOP. BLOCK
	MOVEI	T3,.FOLEB+1(T4)	;[53] POINT AT THE LOOKUP BLOCK
	MOVEM	T3,.FOLEB(T4)	;[53] STORE IN THE FILOP. BLOCK
	MOVX	T2,.RBEXT	;[53,55] GET THE LENGTH OF THE LOOKUP BLOCK
	MOVEM	T2,.RBCNT(T3)	;[53] STORE THE LENGTH
	SETZM	.RBPPN(T3)	;[53] DEFAULT THE PPN
	MOVEM	T1,.RBNAM(T3)	;[53] STORE THE FILENAME
	HRLZI	T2,'HLP'	;[53] GET THE EXTENSION
	MOVEM	T2,.RBEXT(T3)	;[53] STORE IT

GETHLP:	SKIPA	T3,['HLP   ']	;GET HLP:
GETSYS:	MOVSI	T3,'SYS'	;OR GET SYS:
	MOVEM	T3,.FODEV(T4)	;[53] STORE THE DEVICE NAME
	MOVE	T2,T4		;[53] COPY THE FILOP. BLOCK POINTER
	HRLI	T2,.FOLEB+1	;[53] GET THE LENGTH OF THE FILOP. BLOCK
	FILOP.	T2,		;[53] TRY FOR THE FILE
	  SKIPA			;[53] CAN'T GET IT - SEE WHY NOT
IFN FTPAUS,<			;[57]
	JRST	INITTY		;[57] GOOD--GO INIT TTY AND READ FILE
>				;[57]
IFE FTPAUS,<			;[57]
	JRST	MORE		;GOOD--GO AND READ FILE
>				;[57]
	CAIE	T2,ERSNF%	;SFD NOT FOUND?
	CAIN	T2,ERSLE%	;SEARCH LIST EMPTY?
	JRST	AGAIN		;ONE OF THE ABOVE
	CAIN	T2,ERNSD%	;[53] NO SUCH DEVICE?
	JRST	AGAIN		;[53] YES, TRY ANOTHER
	CAILE	T2,ERIPP%	;INCORRECT PPN OR FILE NOT FOUND?
	JRST	SORRY		;HORRIBLE DISK ERROR
AGAIN:	MOVX	T2,.IOASC	;[53] CLEAR PHYSICAL BIT
	AOS	T3,-3(P)	;TRY NEXT CASE
	TRNE	T3,1		;SEE IF ODD
	TXO	T2,UU.PHS	;YES--TRY PHYSICAL ONLY
	MOVEM	T2,.FOIOS(T4)	;[53] STORE THE NEW I/O MODE WORD
	JRST	@[GETHLP	;TRY HLP: AGAIN
		  GETSYS	;THEN LOGICAL SYS:
		  GETSYS	;THEN PHYSICAL SYS:
		  SORRY]-1(T3)	;THEN GIVE UP

IFN FTPAUS,<

;[57] ADD INITTY ROUTINE TO GET TERMINAL TYPE & PAGE LENGTH, 
;[57] AND STORE FOR LATER USE.  ONLY PRESENT IF FTPAUS IS ON

INITTY:	PUSH	P,T3		;[57] GET
	PUSH	P,T2		;[57]   OURSELVES
	PUSH	P,T1		;[57]     SOME ACS
	SETZM	LINENO		;[57] CLEAR
	SETZM	LINCTR		;[57]   OUT
	SETZM	DECCRT		;[57]     ALL
	SETZM	NUMLIN		;[57]       HOLDERS
        MOVNI   T3,1		;[57] SET UP FOR TRMNO.
	TRMNO.  T3,		;[57] GET TTYS UDX
         CAIA                   ;[57] ???
        MOVEM   T3,LINENO       ;[57] SAVE LINE NUMBER
        MOVE    T1,[2,,T2]      ;[57] POINTER FOR TRMOP.
        MOVEI   T2,.TOLNB       ;[57] TO READ TERMINAL LENGTH
        TRMOP.  T1,             ;[57] READ TTY LENGTH
         MOVEI  T1,^D24         ;[57] DEFAULT TO 24 LINES
        JUMPLE  T1,INIDON       ;[57] IF ZERO, DON'T DO ANTHING ELSE
        SUBI    T1,2            ;[57] SUBTRACT TWO FROM LENGTH
        MOVNM   T1,NUMLIN      ;[57] STORE IT
        MOVNM   T1,LINCTR       ;[57] AND SET UP INITIAL COUNTER
        MOVE    T3,LINENO       ;[57] GET UDX
        MOVE    T1,[2,,T2]      ;[57] GET LENGTH
        MOVEI   T2,.TOAT2       ;[57] GET FUNCTION - 2ND TTY ATTRIBUTES WORD
        TRMOP.  T1,             ;[57] DO IT
         SETZ   T1              ;[57] CAN'T
        AND     T1,[T2.DCL]     ;[57] MASK OFF ALL BUT DEC-CHARACTERISTICS BITS
        MOVEM   T1,DECCRT       ;[57] SAVE IT
        JUMPE   T1,INIDON	;[57] DON'T DO INITIAL SCREEN-CLEAR IF NON CRT
         OUTSTR  CLSSTR		;[57] PUT OUT STRING

INIDON:	POP	P,T1		;[57] RESTORE
	POP	P,T2		;[57]   ACS
	POP	P,T3		;[57]     AND RETURN
>;[57] IFN FTPAUS

MORE:	IN	DSK,		;GET A BUFFER
	  JRST	GETCHR		;OUTPUT THE STUFF
	STATZ	DSK,IO.ERR	;SEE IF ERRORS
	  JRST	IOERR		;YES--ISSUE MESSAGE
	STATZ	DSK,IO.EOF	; YET?
	  JRST	DONE		;YES, ALL DONE!

GETCHR:	SOSGE	T2,(P)		;
	JRST	MORE
	IBP	-1(P)		;INCR CHAR POINTER
	MOVE	T1,@-1(P)	;GET THIS WORD
	TRNE	T1,1		;SEE IF SEQUENCE NUMBER
	JRST	[AOS   -1(P)	;YES--SKIP 5 MORE CHARS
		 MOVNI T1,5	; ..
		 ADDM  T1,(P)	; ..
		 JRST  GETCHR]
	LDB	T1,-1(P)
IFN FTPAUS,<
	CAIN	T1,.CHFFD	;[57] IS THIS A FORM-FEED?
	 PUSHJ	P,PAUNOW	;[57] PAUSE RIGHT NOW INSTEAD OF TYPING IT
>
	OUTCHR	T1
IFN FTPAUS,<
	CAIN	T1,.CHLFD	;[57] DID WE PUT OUT A LINE-FEED?
	 PUSHJ	P,CHKPAU	;[57] SEE IF WE NEED TO PAUSE
>
	JRST	GETCHR

IFN FTPAUS,<
;[57] HERE TO SEE IF WE NEED TO PAUSE THE OUTPUT STREAM

CHKPAU:	SKIPN	NUMLIN		;[57] IS LINE-PER-SCREEN VALUE NONZERO?
	POPJ	P,		;[57] NO - RETURN
	AOSE	LINCTR		;[57] DECREMENT LINES-TILL-PAUSE COUNTER
	 POPJ	P,		;[57] AND RETURN IF NOTHING TO DO
	JRST	CHKPA1		;[57] SKIP ALTERNATE ENTRY POINT	

PAUNOW:	SKIPN	NUMLIN		;[57] IS LINES-PER-SCREEN NONZERO?
	 POPJ	P,		;[57] NO - DON'T BOTHER 

CHKPA1:	OUTSTR	MORSTR		;[57] OUTPUT THE RETURN-FOR-MORE STRING

CHKPA2:	INCHWL	T1		;[57] GET ANY CHARACTER
	CAIN	T1,^D26		;[57] WAS A CONTROL-Z TYPED?
	 JRST	CHKPA5		;[57] YES - GO CLEAN STACK AND RETURN
				;[57] NO - FALL THROUGH
	CLRBFI			;[57] CLEAR OUT THE REST OF THE INPUT BUFFER
	SKIPE	DECCRT		;[57] IS THIS A VT100 OR BETTER CRT?
	 OUTSTR	CLSSTR		;[57] YES, OUTPUT STRING

	PUSH	P,T2		;[57] SAVE
	PUSH	P,T3		;[57]   SOME
	PUSH	P,T4		;[57]     ACS
	MOVE	T1,[XWD 2,T2]	;[57] SET UP PTR TO ARG BLOCK
	MOVEI	T2,.TOFLM	;[57] FORCE LEFT MARGIN
	MOVE	T3,LINENO	;[57] GET LINE NUMBER
	TRMOP.	T1,		;[57] DO IT
	 JFCL			;[57] NO BIG SHAKES IF IT FAILS
	MOVE	T1,[XWD 3,T2]	;[57] SET UP NEW PTR TO ARG BLOCK
	MOVEI	T2,.TOPCT+.TOSET ;[57] RESET PAGE COUNTER AS WELL
	SETZ	T4,		;[57] VALUE TO SET
	TRMOP.	T1,		;[57] DO IT
	 JFCL			;[57] COULDN'T
	POP	P,T4		;[57] RESTORE
	POP	P,T3		;[57]   SOME
	POP	P,T2		;[57]     ACS

CHKPA4:	MOVE	T1,NUMLIN	;[57] GET FRESH COPY OF LINE LIMIT
	MOVEM	T1,LINCTR	;[57] PLACE IN LINES-TILL-PAUSE COUNTER
	SETZ	T1,		;[57] CLEAR T1
	POPJ	P,		;[57] AND RETURN

CHKPA5:	POP	P,T1		;[57] OBLITERATE OUR RETURN ADDRESS
	JRST	DONE		;[57] AND LEAVE HELPER NOW
	
MORSTR:	ASCIZ	|Press RETURN to continue ...|
CLSSTR:	BYTE(7)	033,"[","H",033,"[","J",015

>;[57] END IFN FTPAUS



IOERR:	PJSP	T1,HLRERR	;[51] ISSUE ERROR
	ASCIZ	/IOE/		;[51]
	ASCIZ	\ I/O error reading help file\ ;[51]
 
SORRY:	PJSP	T1,HLRERR	;[51] ISSUE ERROR
	ASCIZ	/NHF/		;[51]
	ASCIZ / No .HLP file on SYS:/ ;[51]
 
HLRERR:	OUTSTR	[ASCIZ /%/]	;[51] ISSUE WARNING
	GTMSG.	T2		;[51] GET /MESSAGE LEVEL
	TXNE	T2,JW.WPR	;[51] SEE IF PREFIX
	OUTSTR	[ASCIZ /HLR/]	;[51] YES--INDICATE FROM HELPER
	TXNE	T2,JW.WPR	;[51] SEE IF PREFIX
	OUTSTR	(T1)		;[51] YES--GIVE ACTUAL MESSAGE PREFIX
	TXNN	T2,JW.WFL	;[51] SEE IF FIRST
	JRST	DONE		;[51] NO--SKIP TEXT
	OUTSTR	1(T1)		;[51] YES--ISSUE MESSAGE
	OUTSTR	[ASCIZ/; I'm sorry, I can't help you/]

DONE:	OUTSTR	[ASCIZ/
/]
	RELEAS	DSK,
	SUB	P,[STKALC,,STKALC] ;[53] RESTORE PDL
	POP	P,T1		;RETRIEVE .JBFF IN "T1"
	HRRZM	T1,.JBFF	;RESTORE .JBFF
	HLRZ	T1,T1		;RETRIEVE .JBCOR
	CORE	T1,
	  JFCL			;IGNORE ERROR
	POP	P,T4
	POP	P,T3
	POP	P,T2
	POPJ	P,		;RETURN TO CALLER
IFN FTPAUS,<
;[57] STORAGE FOR NEEDED INFORMATION
	RELOC			;[57] SWITCH TO LOW SEGMENT

LINENO:	BLOCK	1		;[57] HOLDER FOR TERMINAL UDX
NUMLIN:	BLOCK	1		;[57] NUMBER OF LINES IN SCREEN
LINCTR:	BLOCK	1		;[57] CURRENT LINE COUNTER
DECCRT:	BLOCK	1		;[57] IF TUBE SUPPORTS DEC CRT FUNCTIONS

	RELOC			;[57] SWITCH BACK
>;[57] END IFN FTPAUS

	XLIST		;LITERALS
	LIT
	LIST
	RELOC
	>			;END OF -10 NATIVE HELPER

	PAGE
SUBTTL	TOPS-20 HELPER CODE
IFN TOPS20,<			; START -20 NATIVE HELPER

HELPER:	MOVE	T1,@(AP)	; FETCH FIRST ARG

.HELPR:	PUSH	P,T2		; SAVE ACS
	PUSH	P,T3
	PUSH	P,T4
	PUSH	P,T5
	MOVEI	T5,6		; MAX NUMBER OF CHARS IN FILE NAME
	MOVE	T2,[POINT 6,T1]	; POINTER TO SIXBIT FILE NAME
	MOVE	T3,[POINT 7,FILENM]	; POINTER TO ASCII DESTINATION
GETASC:	ILDB	T4,T2		; GET A SIXBIT CHAR.
	ADDI	T4,40		; MAKE IT ASCII
	IDPB	T4,T3		; AND PUT IT IN THE ASCII BUFFER
	SOJG	T5,GETASC	; DO IT TILL ALL ARE DONE
	SETZ	T4,
	IDPB	T4,T3		; PUT IN A ZERO BYTE
	SETZB	T2,T3		; ZERO THESE ACS
	PUSH	P,T2		; WE WILL USE THESE 6 WORDS ON THE
	PUSH	P,T2		; STACK AS THE BUFFER TO CONSERVE
	PUSH	P,T2		; SPACE (THIS DOES NOT CHANGE SPECS.)
	PUSH	P,T2
	PUSH	P,T2
	PUSH	P,T2
	MOVX	T4,GJ%OLD	; JUST AN EXISTING FILE
	MOVEM	T4,GTJBLK	; PUT IT IN THE GTJFN BLOCK
	MOVEI	T3,4		; NUMBER OF ATTEMPTS AT FINDING FILE
GETHLP:	MOVE	T4,[POINT 7,[ASCIZ/HLP:/]] ; GET THE HLP: POINTER
	MOVEM	T4,GTJBLK+2	; PUT IT IN THE GTJFN BLOCK
	JRST	GETIT
GETSYS:	MOVE	T4,[POINT 7,[ASCIZ/SYS:/]] ; GET THE SYS: POINTER
	MOVEM	T4,GTJBLK+2	; PUT IT IN THE GTJFN BLOCK
GETIT:	HRROI	T2,FILENM	; GET POINTER TO MODULE NAME IN T2
	MOVEI	T1,GTJBLK	; LONG FORM GTJFN BLOCK
	GTJFN%			;[45] GET THE FILE
	JRST	AGAIN		; LOSE TEMPORARILY
	HRRM	T1,JFN		; SAVE THE JFN
	MOVE	T2,[FLD(7,OF%BSZ)!OF%RD] ; BYTE SIZE OF 7 AND READ ONLY
	OPENF%			;[45] OPEN THE FILE FOR READ ACCESS
	JRST	IOERR		; SOMETHING WEIRD HAPPENED

PRINT:	MOVE	T1,JFN		; GET JFN
	HRROI	T2,-5(P)	; POINTER FOR TEXT BUFFER
	MOVEI	T3,^D25		; HELP TEXT BUFFER SIZE * 5
	SIN%			;[45] GET 5 WORDS
	ERJMP	DONE		; DON'T CARE ABOUT THIS ERROR
	SETZ	T1,		; NEED A ZERO BYTE
	IDPB	T1,T2		; MAKE SURE ZERO THE LAST BYTE
	HRROI	T1,-5(P)
	PSOUT%			;[45] OUTPUT ASCIZ STRING
	JRST	PRINT		; IF THERE'S MORE, GO GET IT

AGAIN:	MOVE	T4,GTJBLK	; GET THE FLAGS
	TXOE	T4,GJ%PHY	; TURN ON PHYSICAL DEVICE BIT
	TXZ	T4,GJ%PHY	; CLEAR PHYSICAL BIT
	MOVEM	T4,GTJBLK	; PUT IT BACK IN GTJFN BLOCK
	SOJLE	T3,SORRY	; SEE IF ANY DEVICES LEFT
	CAIG	T3,2		; TIME TO TRY SYS:?
	JRST	GETSYS		; YES, USE SYS:
	JRST	GETHLP		; NO, USE HLP:

DONE:	SETZ	T1,		; NEED A ZERO BYTE
	IDPB	T1,T2		; MAKE SURE ZERO THE LAST BYTE
	HRROI	T1,-5(P)
	PSOUT%			;[45] OUTPUT ASCIZ STRING
	HRROI	T1,CRLF		; OUTPUT CRLF
	PSOUT%			;[45]
	MOVE	T1,JFN
	CLOSF%			;[45] GET RID OF THE JFN
	JFCL			; NOT LIKELY
LEAVE:	SUB	P,[6,,6]	; FIX UP STACK POINTER
	POP	P,T5		; RESTORE ACS
	POP	P,T4
	POP	P,T3
	POP	P,T2
	POPJ	P,		; AND RETURN TO CALLER

IOERR:	HRROI	T1,[ASCIZ/%HLREOH Error opening help file/]
	PSOUT%			;[45]
	MOVE	T1,JFN		; WE STILL HAVE TO RELEASE THE JFN
	CLOSF%			;[45]
	JFCL			; NOT LIKELY
	JRST	SORRYX		; FINISH WITH SORRY MESSAGE
SORRY:	HRROI	T1,[ASCIZ/%HLRNHF No .HLP file on SYS:/]
	PSOUT%			;[45]
SORRYX:	HRROI	T1,[ASCIZ/; I'm sorry I can't help you/]	
	PSOUT%			;[45]
	HRROI	T1,CRLF
	PSOUT%			;[45]
	JRST	LEAVE		; WE FAILED, BUT NOTHING ELSE TO DO

CRLF:	ASCIZ	/
/
FILENM:	BLOCK	2
JFN:	0
GTJBLK: 0			; FLAGS
	.NULIO,,.NULIO
	POINT	7,[ASCIZ/HLP:/]	; POINTER TO DEVICE
	0
	0
	POINT	7,[ASCIZ/HLP/]	; POINTER TO EXTENSION
	0
	0
	0

	XLIST		;LITERALS
	LIT
	LIST
	>			; END OF -20 NATIVE HELPER

	END