Google
 

Trailing-Edge - PDP-10 Archives - ap-c796e-sb - 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  %5(41)
SUBTTL	A.W.LYONS/AWL/PFC	17-OCT-73

;***COPYRIGHT 1971,1972,1973 DIGITAL EQUIPMENT CORP., MAYNARD,MASS.***

CUSTVR==0		;CUSTOMER VERSION
DECVER==5		;DEC VERSION
DECMVR==0		;DEC MINOR VERSION
DECEVR==41		;DEC EDIT NUMBER


XP %HELPR,CUSTVR*1B2+DECVER*1B11+DECMVR*1B17+DECEVR
	PURGE	CUSTVR,DECVER,DECMVR,DECEVR

;ASSEMBLY INSTRUCTIONS:
IFNDEF	%%C,<PRINTX	?	.COMPILE C+HELPER
	PASS2
	END>
;THEN LOAD THE .REL FILE WITH ANY PROGRAM
;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
;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 EIGHT(8) LOCATIONS ON THE PUSH-DOWN LIST
; ON WHICH TO STORE AND FROM WHICH TO RESTORE USER AC'S.

;ACCUMULATORS

T1=1
T2=2
T3=3
T4=4
AP=16	;ARG LIST POINTER
P=17

;DEVICE CHANNELS

DSK=0

ENTRY	.HELPR,HELPER

	TWOSEG
	RELOC	400000
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
	PUSH	P,T2		; LOAD UP 4 ZEROED LOCATIONS
	PUSH	P,T2
	PUSH	P,T2
	PUSH	P,T2

GETHLP:	SKIPA	T3,['HLP   ']	;GET HLP:
GETSYS:	MOVSI	T3,'SYS'
	HRRZI	T4,-2(P)
	OPEN	DSK,T2
	  JRST	SORRY
	MOVSI	T2,'HLP'
	SETZB	T3,T4
	LOOKUP	DSK,T1
	  TLZA	T2,-1		;CLEAR JUNK
	JRST	MORE		;GOOD--GO READ FILE
	CAIE	T2,ERSNF%
	CAIN	T2,ERSLE%
	JRST	AGAIN
	CAILE	T2,ERIPP%
	JRST	SORRY		;HORRIBLE DISK ERROR
AGAIN:	SETZM	T2		;CLEAR PHYSICAL BIT
	AOS	T3,-3(P)	;TRY NEXT CASE
	TRNE	T3,1		;SEE IF ODD
	TXO	T2,UU.PHS	;YES--TRY PHYSICAL ONLY
	JRST	@[GETHLP	;TRY HLP: AGAIN
		  GETSYS	;THEN LOGICAL SYS:
		  GETSYS	;THEN PHYSICAL SYS:
		  SORRY]-1(T3)	;THEN GIVE UP
MORE:	IN	DSK,
	  JRST	GETCHR
	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)
	OUTCHR	T1
	JRST	GETCHR
IOERR:	OUTSTR	[ASCIZ	\%HLRIOE I/O error reading help file\]
	JRST	SORRYX		;FINISH WITH SORRY MESSAGE	[41]
SORRY:	OUTSTR	[ASCIZ /%HLRNHF No .HLP file on SYS:/]
SORRYX:	OUTSTR	[ASCIZ/; I'm sorry, I can't help you/]

DONE:	OUTSTR	[ASCIZ/
/]
	RELEAS	DSK,
	SUB	P,[4,,4]	;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

	XLIST		;LITERALS
	LIT
	LIST
	RELOC

	END