Google
 

Trailing-Edge - PDP-10 Archives - ap-c796e-sb - gripe.mac
There are 10 other files named gripe.mac in the archive. Click here to see a list.
	TITLE	GRIPE - PROGRAM FOR REGISTERING COMPLAINTS  %4(43)
	SUBTTL	D BLACK/CMF/PFC		17-APR-74
VGRIPE==4
VEDIT==43
VMINOR==0
VWHO==0

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

	SEARCH	C		;USE C AS UNIVERSAL
	SALL			;CLEAN LISTINGS

.JBVER==137
	LOC	.JBVER
	BYTE	(3)VWHO(9)VGRIPE(6)VMINOR(18)VEDIT
	RELOC


;PARAMETERS

ND	CMPRIV,157B8	;DEFAULT PROTECTION OF COMPLAINT FILE


;FLAG BITS
ALL6==1		;PRINT 6 SIXBIT BYTES

;AC'S

F=0
T=1
T1=T+1
T2=T1+1
T3=T2+1
P1=5
P2=6
C=7
P=17

;IO CHANNELS

TTY==1
DSK==2

;SPECIAL CHARS

CNTRLC==3		;CONTROL C
TERMCH==33		;TERMINATING CHARACTER
;REVISION HISTORY

;%3(34) APR 72

;35	ADD MONITOR NAME AND CPU SERIAL NUMBER TO HEADING
;36	CHANGE SIGN-ON MESSAGE TO DEPRESS KEY RATHER THAN TYPE
;37	CHANGE TO USE C AS UNIVERSAL
;40	PROTECT AGAINST CCL ENTRY
;41	HANDLE ^Z; REMOVE 175,176
;42	HANDLE - NUMBERS TO BE SAFE
;43	FIX BUG IN TIME OUTPUT ROUTINE
GRIPE:	JFCL			;IGNORE CCL START
	SKIPL	HELPFG		;SEE IF IN HERE YET
	JRST	GRIPE1		;YES--PROCEED
	SKIPN	.SGNAM		;NO--GET ARGUMENTS USER CALLED
	MOVE	.SGNAM,['GRIPE ']  ;  US WITH
	MOVEM	.SGNAM,LBLOCK+.RBNAM
	MOVEM	.SGPPN,LBLOCK+.RBPPN  ;SO WE CAN FIND WHAT STRUCTURE
	SKIPN	.SGLOW		;  GRIPE.SAV IS ON
	MOVSI	.SGLOW,'SAV'
	MOVEM	.SGLOW,LBLOCK+.RBEXT	;  WE NEED A GOOD F/S TO USE
	MOVEI	0,.RBDEV	;TO WRITE THE COMPLAINTS ON
	MOVEM	0,LBLOCK+.RBCNT
	SETZB	.SGDEV-1,.SGDEV+1
	SKIPN	.SGDEV
	MOVSI	.SGDEV,'SYS'
	OPEN	DSK,.SGDEV-1	;TRY TO OPEN
	  JRST	GRIPE1		;IF FAIL, USE DSK
	LOOKUP	DSK,LBLOCK	;TRY TO LOOKUP
	  JRST	GRIPE1		;IF FAIL, USE DSK
	SKIPE	T,LBLOCK+.RBDEV	;GET STR IF PRESENT
	MOVEM	T,DSKDEV	;AND STORE FOR LATER

GRIPE1:	RESET
	MOVE	P,PDL
	INIT	TTY,
	SIXBIT	.TTY.
	IBUF
	  EXIT
	INIT	DSK,
DSKDEV:	SIXBIT	.DSK.
	XWD	OBUF,
	  JRST	NODSK

	MOVX	T,%LDQUE	;GET COMPLAINT NUMBER
	GETTAB	T,		;FROM MONITOR
	  MOVE	T,[3,,3]	;GET DEFAULT IF NOT AVAILABLE
	MOVEM	T,CMPPPN	;GOT IT--STORE
	MOVEI	P1,5
RETRY:	MSTIME	T,		;TIME OF DAY IN MILLISECS
	MOVEM	T,TIME
	IDIVI	T,^D20		;REDUCE UNITS
	IDIVI	T,^D1000	;RANDOM NUMBER LE 999
	MOVE	T,T1
	PUSHJ	P,FILDPT	;CREATE FILE NAME
	MOVSI	T1,(SIXBIT .CMP.)
	SETZ	T2,
	MOVE	T3,CMPPPN	;PPN FOR COMPLAINT BASKET
	LOOKUP	DSK,T		;SEE IF THIS NAME EXISTS
	  TRNE	T1,-1		;SKIP IF NO SUCH FILE
	JRST	CANT
	MOVSI	T2,(CMPRIV)	;SET IN DEFAULT PRIVILEGE
	MOVE	T3,CMPPPN
	ENTER	DSK,T		;SEE IF CAN ENTER SUCH A FILE
	  JRST	CANT		;NO, SEE WHATS WRONG
	DATE	T,		;TODAYS DATE
	MOVEM	T,DATE
	PUSHJ	P,DATIM
;PRINT MONITOR NAME AND CPU SERIAL NUMBER
	PUSHJ	P,SPACE
	MOVEI	C,5		;5 WORDS OF CONFIG DATA
	MOVE	P2,[XWD .GTCNF,0]	;SWAPPED GETTAB ARGUMENT
CNFLOP:	MOVS	T,P2
	GETTAB	T,
	  JRST	NONAME
	MOVEM	T,CONFIG(P2)	;STORE PART OF NAME
	AOS	P2
	SOJG	C,CNFLOP	;COUNT AND GET NEXT
	MOVEI	T,CONFIG
	PUSHJ	P,MSG		;PRINT MONITOR NAME

NONAME:	MOVEI	T,[ASCIZ / Cpu/]
	PUSHJ	P,MSG
	MOVE	T,[ %CNSER]	;GET SERIAL NUMBER
	GETTAB	T,
	  JRST	TYJOB
	PUSHJ	P,DECOUT	;PRINT SERIAL NUMBER
TYJOB:	MOVEI	T,[ASCIZ . Job.]
	PUSHJ	P,MSG
	PJOB	T,
	PUSHJ	P,DECOUT
	PUSHJ	P,SPACE
	GETLIN	T,
	JUMPE	T,NOTTY
	PUSHJ	P,SIXOUT
NOTTY:	PUSHJ	P,SPACE
	GETPPN	T,
	  JFCL
	MOVEM	T,PPN
	HLRZS	T
	PUSHJ	P,OCTOUT
	PUSHJ	P,COMMA
	HRRZ	T,PPN
	PUSHJ	P,OCTOUT
	PUSHJ	P,SPACE
	HRROI	T,.GTNM1
	GETTAB	T,
	 JRST	YES		;FORGET IT IF NOT IMPLEMENTED
	PUSHJ	P,FRCSIX
	HRROI	T,.GTNM2
	GETTAB	T,
	 JRST	YES
	SKIPE	T		;AVOID TRAILING SPACES
	PUSHJ	P,FRCSIX	;PRINT E.G. "NAME"
	PUSHJ	P,CRLF
YES:	OUTSTR	[ASCIZ .
Yes? .]
	AOSG	HELPFG
	OUTSTR	[ASCIZ . (Depress ESCape key when through)
.]
CHLOOP:	PUSHJ	P,TTI		;GET NEXT CHAR
	CAIE	T,.CHCNZ	;SEE IF EOF,
	CAIN	T,TERMCH	;SKIP IF NOT TERMINATING CHAR
	JRST	ENDIT
	CAIN	T,15		;SEE IF CARRIAGE RETURN
	JRST	CHLOOP		;YES--IGNORE
	CAIL	T,12		;SEE IF END OF LINE
	CAILE	T,14		; ..
	JRST	CHLP1		;NO--GO OUTPUT
	CAIE	T,12		;SEE IF LINE FEED
	PUSHJ	P,CRLF		;NO--ISSUE BLANK LINE
	PUSHJ	P,CRLF		;END THIS LINE
	JRST	CHLOOP		;GO FOR NEXT CHARACTER
CHLP1:	PUSHJ	P,CHOUT		;OUTPUT CHAR
	JRST	CHLOOP

ENDIT:	PUSHJ	P,CRLF
	PUSHJ	P,CRLF
	PUSHJ	P,CRLF
	PUSHJ	P,CRLF
	CLOSE	DSK,
	RELEAS	DSK,
	RELEAS	TTY,
	OUTSTR	[ASCIZ .
Thank you
.]
	MONRT.
	EXIT
CANT:	HRRZS	T1
	CAIN	T1,ERFBM%	;SKIP IF FILE BEING MODIFIED
	JRST	MODER
	CAIN	T1,ERNRM%	;SKIP UNLESS NO ROOM IN COMPLAINT AREA
	JRST	NOROOM
	CAIN	T1,ERIPP%
	JRST	NOUFD
	JRST	NOWRT

MODER:	SOJG	P1,NOROO1
NOWRT:	MOVEI	T,[ASCIZ .
? Sorry, can't write in complaint area.]
	JRST	ERREX

NOROOM:	SOJLE	P1,NRMEX
NOROO1:	MOVEI	T,1
	SLEEP	T,
	JRST	RETRY

NRMEX:	MOVEI	T,[ASCIZ .
? Sorry, complaint basket is full.]
	JRST	ERREX

NODSK:	MOVS	T,DSKDEV	;GET DEVICE USED
	CAIN	T,'DSK'		;SEE IF DSK
	JRST	NODSK1		;YES--THAT'S THE BEST WE CAN DO
	MOVSI	T,'DSK'		;NO--GO TRY DSK
	MOVEM	T,DSKDEV	; ..
	JRST	GRIPE1		; ..
NODSK1:	MOVEI	T,[ASCIZ .
? Sorry, can't open DSK.]
	JRST	ERREX

NOUFD:	MOVEI	T,[ASCIZ .
? Sorry, no UFD for complaint basket.]
ERREX:	OUTSTR	(T)
	OUTSTR	[ASCIZ \, please call the operator.
\]
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