	.TITLE	ERMSG
	.IDENT	/BL3.2/
;
;	Routine rewritten by J. CLEMENT April 1982
;
;	Error message routine
;
; LOCAL DATA
;
; ERROR MESSAGES
;
	.const
ERRTAB:	.WORDA	ERR0
	.WORDA	ERR1
	.WORDA	ERR2
	.WORDA	ERR3
	.WORDA	ERR4
	.WORDA	ERR5
	.WORDA	ERR6
	.WORDA	ERR7
	.WORDA	ERR8
	.WORDA	ERR9
	.WORDA	ERR10
	.WORDA	ERR11
	.WORDA	ERR12
	.WORDA	ERR13
	.WORDA	ERR14
	.WORDA	ERR15
	.WORDA	ERR16
	.WORDA	ERR17
	.WORDA	ERR18
	.WORDA	ERR19
	.WORDA	ERR20
	.WORDA	ERR21
	.WORDA	ERR22
	.WORDA	ERR23
	.WORDA	ERR24
	.WORDA	ERR25
	.WORDA	ERR26
	.WORDA	ERR27
	.WORDA	ERR28
	.WORDA	ERR29
	.WORDA	ERR30
	.WORDA	ERR31
	.WORDA	ERR32
	.WORDA	ERR33
	.WORDA	ERR34
	.WORDA	ERR35
	.WORDA	ERR36
	.WORDA	ERR37
	.WORDA	ERR38
	.WORDA	ERR39
	.WORDA	ERR40
	.WORDA	ERR41
	.WORDA	ERR42
	.WORDA	ERR43
	.WORDA	ERR44
	.WORDA	ERR45
	.WORDA	ERR46
	.WORDA	ERR47
	.WORDA	ERR48
	.WORDA	ERR49
	.WORDA	ERR50
	.WORDA	ERR51
	.WORDA	ERR52
	.WORDA	ERR53
	.WORDA	ERR54
ERREND:
FLGTAB:	.WORDA	MODEM
	.WORDA	TEXF
	.WORDA	TEXM
	.WORDA	NOTF
	.WORDA	NOTM
	.WORDA	FOTF
	.WORDA	FOTM
	.WORDA	LCKF
	.WORDA	LCKM
	.WORDA	FILLF
	.WORDA	FILLM
	.WORDA	JUSTF
	.WORDA	JUSTM
	.WORDA	0
	.WORDA	FLAGM
	.WORDA	MARGM
	.WORDA	NLPG
	.WORDA	RMARG
	.WORDA	LMARG
	.WORDA	TMARG
	.WORDA	NSPNG
	.WORDA	0	; List of variables
	.text
ERR0:	.ASCIZ	/RNO -- Unknown error message/
ERR1:	.ASCII	/RNO -- Bad parameters/<15><12>
	.ASCIZ	/ -- Parameter too large/
ERR2:	.ASCII	/RNO -- Bad parameters/<15><12>
	.ASCIZ	/ -- Parameter too small/
ERR3:	.ASCIZ	/RNO -- Symbol already defined/
ERR4:	.ASCIZ	/RNO -- Bad parameters/
ERR5:	.ASCIZ	/RNO -- Unrecognized command/
ERR6:	.ASCIZ	/RNO -- Error in formatting equation/
ERR7:	.ASCIZ	/RNO -- Missing parameter from command/
ERR8:	.ASCII	/RNO -- Bad parameters/<15><12>
	.ASCIZ	/ -- Param too big or negative/
ERR9:	.ASCII	/RNO -- Internal error/<15><12>
	.ASCIZ	/ -- Contact your system manager/
ERR10:	.ASCIZ	/RNO -- Output file error/
ERR11:	.ASCIZ	/RNO -- Input file error/
ERR12:	.ASCII	/RNO -- Insufficient dynamic memory/<15><12>
	.ASCII	/ -- Reduce either footnote length,/<15><12>
	.ASCII	/ -- Number of .DEFINE statements,/<15><12>
	.ASCIZ	/ -- or .TEXT section length/
ERR13:	.ASCIZ	/RNO -- Can't indent list element/
ERR14:	.ASCIZ	/RNO -- Can't reduce margins/
ERR15:	.ASCIZ	/RNO -- Command string syntax error/
ERR16:	.ASCIZ	/RNO -- Output file specification error/
ERR17:	.ASCIZ	/RNO -- Output file open error/
ERR18:	.ASCIZ	/RNO -- Input file specification error/
ERR19:	.ASCII	/RNO -- Input file open error/<15><12>
	.ASCII	/ -- Input DEVICE:FILE probably doesn't exist, or/<15><12>
	.ASCIZ	/ -- You lack privelege to use the file/
ERR20:	.ASCII	/RNO -- Too many nested .REQ/<15><12>
	.if df	RT11
	.ASCIZ	/ -- Maximum nesting is 7 levels/
	.endc
	.if ndf	RT11
	.ASCIZ	/ -- Maximum nesting is 5 levels/
	.endc
ERR21:	.ASCIZ	/RNO -- Illegal command inside footnote/
ERR22:	.ASCIZ	/RNO -- Illegal command inside note/
ERR23:	.ASCIZ	/RNO -- Illegal command after .LOCK command/
ERR24:	.ASCIZ	/RNO -- Illegal command during .TEXT section/
ERR25:	.ASCIZ	/RNO -- Character is already defined as a flag/
ERR26:	.ASCII	/RNO -- Illegal character specified as flag/<15><12>
	.ASCIZ	/ -- Only special characters may be flags/
ERR27:	.ASCIZ	/RNO -- Extraneous characters after legal command/
ERR28:	.ASCII	/RNO -- Illegal command/<15><12>
	.ASCIZ	/ -- Missing .FOOTNOTE before .END FOOTNOTE/
ERR29:	.ASCII	/RNO -- Illegal command/<15><12>
	.ASCIZ	/ -- Missing .NOTE before .END NOTE/
ERR30:	.ASCII	/RNO -- Illegal command/<15><12>
	.ASCIZ	/ -- Missing .LIST before .END LIST/
ERR31:	.ASCII	/RNO -- Illegal command/<15><12>
	.ASCIZ	/ -- Missing .LITERAL before .END LITERAL/
ERR32:	.ASCIZ	/RNO -- Too many tabs specified -- Max is 32/
ERR33:	.ASCII	/RNO -- Permanent footnote error/<15><12>
	.ASCIZ	/ -- Footnote already specified for this page/
ERR34:	.ASCIZ	/RNO -- Char specified is not special flag/
ERR35:	.ASCII	/RNO -- Maximum list level exceeded/<15><12>
	.ASCIZ	/ -- Max level is 6 indented lists/
ERR36:	.ASCII	/RNO -- Maximum subindex levels exceeded/<15><12>
	.ASCIZ	/ -- No more than 6 subindices are allowed/
ERR37:	.ASCIZ	/RNO -- Illegal command on subpage/
ERR38:	.ASCII	\RNO -- Switch/UL:n is bad\<15><12>
	.ASCII	\ -- n must be either L(line),B(backspace),\<15><12>
	.ASCIZ	\S(simulate) or N(No)\
ERR39:	.ASCII	\RNO -- Switch/PS:h:w has bad w\<15><12>
	.ASCIZ	\ -- paper width must be between 15 and 256\
ERR40:	.ASCII	\RNO -- Switch/PS:h:w has bad v\<15><12>
	.ASCIZ	\ -- paper height must be between 15 and 128\
ERR41:	.ASCII	\RNO -- Switch/-FF:n has n too big or negative.\<15><12>
	.ASCIZ	\ -- The page length may not exceed 127.\
ERR42:	.ASCIZ	\RNO -- User requested traceback\
ERR43:	.ASCIZ	\RNO -- Conflicting command\
ERR44:	.ASCIZ	\RNO (WARNING) -- Substitution is not unique\
ERR45:	.ASCII	\RNO -- IF - too many nestings\<15><12>
	.ASCIZ	\ -- The maximum nesting is 32\
ERR46:	.ASCIZ	/RNO -- Improperly nested IF,ENDIF, or ELSE/
ERR47:	.ASCIZ	/RNO -- Permanent footnote too long/
ERR48:	.ASCIZ	/RNO -- Undefined escape sequence/
ERR49:	.ASCIZ	/RNO -- Undefined substitution/
ERR50:	.ASCIZ	/RNO -- Definition too long/
ERR51:	.ASCIZ	/RNO -- Literal or label too long/
ERR52:	.ASCIZ	/RNO -- Unrecognized command/
ERR53:	.ASCIZ	/RNO -- Command illegal inside user defined command/
ERR54:	.ASCIZ	/RNO -- Unrecognized parameter/
;
;	Traceback messages
;
FOTM:	.ASCIZ	/Footnote,/
TEXM:	.ASCIZ	/Text section,/
FILLM:	.ASCIZ	/Fill,/
JUSTM:	.ASCIZ	/Justify,/
NOTM:	.ASCIZ	/Note,/
LCKM:	.ASCIZ	/Lock,/
MARGM:	.ASCIZ	/-- page size,right,left,top margins,spacing, --/
FLAGM:	.ASCIZ	/-- Flags:/
MODEM:	.ASCIZ	/-- Modes:/
TABM:	.ASCIZ	/<tab>/
	.even
	.code
;
;	This entry point also loads error messages from overlay
;
ERMSG:: CLC
	ASL	R0			; Now is table pointer
	CMP	R0,#ERREND-ERRTAB	; Check it
	BLO	10$			; Not too big ?
	CLR	R0			; Output null message
10$:	MOV	ERRTAB(R0),R0		; Get address of error message
	JMP	EROUT			; TRANSFER TO REAL OUTPUT ROUTINE
;
;	TRACE command
;
TRACE::	MOV	#TTBF,R3		; Temporary buffer
	MOV	#ERR42,R0
	CALL	EROUT			; User requested traceback
	MOV	#FLGTAB,R4		; Table of flags
	CALL	198$			; SET UP TABLE
10$:	MOV	(R4)+,R1		; Get flag bits
	BEQ	20$			; Done ?
	MOV	(r4)+,R2		; Message
	BITEQ	R1,F.1,10$		; No feature ?
	CALL	200$			; Output message
	BR	10$			; Continue till done
20$:	CALL	205$			; OUTPUT A LIN
	CALL	198$			; SETUP a line
	MOV	#$AFLSW,R2		; Get flags
	MOV	#NFLAGS+1,R5		; Counter
25$:	TSTNEB	1(R2),30$		; No flag ?
	MOVB	(r2),R1
	BEQ	30$			; No flag ?
	CMPNE	R1,#TAB,26$		; Not tab ?
	MOV	R2,-(SP)		; Save
	MOV	#TABM,R2		; Output tab indicator
	CALL	200$
	MOV	(SP)+,R2		; Restore
	BR	27$
26$:	CALL	PBYT
27$:	MOV	#SPC,R1			; Get space
	CALL	PBYT			; Into buffer
30$:	TST	(R2)+
	SOB	R5,25$			; Continue
	CALL	205$
	MOV	(r4)+,R0		; Print margins
	CALL	EROUT
	CALL	CLRBF			; Start at beginning
50$:	MOV	(R4)+,R0		; Address of param
	BEQ	100$			; Done ?
	MOV	(R0),R0			; Number to convert
	CALL	DECTY			; Convert number
	MOV	#CMA,R1			; Character to insert
	CALL	PBYT
	BR	50$
100$:	CALL	205$			; Output the line
	JMP	ONLIN			; Type traceback message
198$:	CALL	CLRBF
199$:	MOV	(R4)+,R2		; input
200$:	MOVB	(r2)+,R1		; Get char
	BEQ	210$			; Done ?
	CALL	PBYT
	BR	200$
205$:	CLR	R1
	CALL	PBYT			; Zero 1 byte
	MOV	#TTBUF,R0		; Buffer containing message
	CALL	EROUT
210$:	RETURN
	.END
