Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-05 - 43,50337/08/dm.mac
There are 2 other files named dm.mac in the archive. Click here to see a list.

;NAME:	DM
;====

;AUTHOR:	KIM WALDEN
;======

;PURPOSE:	TO UPDATE DIAGNOSTICS MESSAGES TABLE, ZDM
;=======

;FUNCTION:	DM CONSTRUCTS A NEW ENTRY IN ZDM. IT INSERTS
;========	THE ERROR NUMBER, FIRST AND LAST LINE NUMBER,
;		AND WHEN APPLICABLE, ASCII TEXT OR INDICES
;		TO SYMBOL TABLE/CONTROL WORD TABLES, WHEN
;		SUCH ENTITIES ARE TO BE EDITED INTO THE ERROR
;		MESSAGE. IT ALSO INSERTS THE SEMICOLON COUNT.

;ENVIRONMENT:	DM IS CALLED VIA UUO:S
;===========	ERR,ERRI1,ERRI2,ERRI3,ERRT IN THE FOLLOWING MANNER:
;		<UUO>	TYPE,ERRNO
;		WHERE TYPE IS 0 FOR TYPE E
;			      1 FOR TYPE T
;			      2 FOR TYPE W
;		WHEN UUO IS ERRT, THEN THE ASCII TEXT IS IN REG X1
;		WHEN UUO IS ERRI1,ERRI2,ERRI3 RESP. THEN THE INDICES ARE
;		IN REGS X1,X2,X3 RESP.
;		UUO ERRLI MEANS THAT LAST LINE NUMBER IS SUPPLIED IN
;		YELIN2, AND IS TO BE INSERTED IN PROPER FIELDS OF
;		ALL PREVIOUS ZDM ENTRYS THAT HAS NOT YET RECEIVED
;		SUCH A NUMBER. THESE RECORDS HAVE BEEN CHAINED, AND
;		THE INDEX TO THE LAST CHAIN MEMBER IS IN YECHDM.

;		IF THE CALL IS DIRECTLY FOLLOWED BY A WORD,
;		CONTAINING A NOP IN THE OP CODE FIELD, AND
;		AN ADDRESS TO AN ASCIZ STRING IN THE ADDRESS
;		FIELD, THEN DM WILL PRINT THIS STRING ON THE
;		TTY, IF IN DEBUG MODE

IF2,<PRINTX VERSION:  8 DATE: 10-MAR-75/RK>
	SALL
	SEARCH	SIMMAC,SIMMC3	;[104]
	CTITLE	DM
	MACINIT
	P3INIT	;[104]
	TWOSEG
	RELOC	400000

;FIELD DEFINITIONS:
;=================

	DF	ZUUOOP,40,9,8
	DF	ZUUOTP,40,4,12
	DF	ZUUONO,40,18,35

;ASSEMBLY TIME VARIABLES:
;=======================



	EXTERN	YSWITCH
	EXTERN	.JBOPC
	EXTERN	YDMEND,YELIN1,YELIN2,YESEM,YWARCT,YERRCT,YECHDM	;[104] ZDM removed
	ENTRY	DM
	;[31006] Remove XPAS from RENAME and SAVE
RNAME	<XENTRY,XPT,XW,XETYP>,<X4,X5,X6,X7>
	PROC
DM:	IFON	YSWTRM
	RETURN
	SAVE	<XENTRY,XPT,XW,XETYP>
;load UUO type: ERRT,,ERRI3,ERRI2,ERRI1,ERR,ERRLI
	LF	XENTRY,ZUUOOP
;if ERRLI then jump
	CAIN	XENTRY,QERRLI
	GOTO	ERRLI
;load pointer to first free entry in ZDM
	L	XPT,YDMEND
	LF	XETYP,ZUUOTP
	CAIN	XETYP,QW
	GOTO	WAR
	CAIN	XETYP,QT
	GOTO	TER
;type was ERROR
ERR:	AOS	YERRCT
	CAIGE	XPT,QLDM
	GOTO	ADV
;table full
	L	YERRCT
	CAILE	QLDM/3
	GOTO	OUT
;Warning message exists in ZDM. Replace it with current message
;[31006] Replace the last WARNING in ZDM instead of the first.
;Make XPT point to first WARNING record in ZDM (or last record)
;[301006] Do not replace the 10 first messages.

SCAN:
	LI	XPT,QLDM
	LOOP	SUBI	XPT,3
		LF	,ZDMEN(XPT,ZDM)	;[104]
		;[31006] Correct the check on type WARNING.
		IF
			CAIGE	X0,Q1.ERR
			GOTO	TRUE	;W1

			CAIGE	X0,Q2.WAR
			GOTO	FALSE
			CAIGE	X0,Q2.ERR
			GOTO	TRUE	;W2

			CAIGE	X0,Q3.WAR
			GOTO	FALSE
			CAIL	X0,Q3.ERR	;W3
		THEN
			GOTO	FILL	;REPLACE
		FI
	AS	CAIL	XPT,^D10*3	;DO NOT REPLACE THE 10 FIRST
		GOTO	TRUE
		LI	XPT,QLDM-3	;Let XPT point to the last rec.
	SA
;insert information of message in ZDM
;set fields of new entry
FILL:	LF	,ZUUONO
	SF	,ZDMEN(XPT,ZDM)	;[104]
	L	YELIN1
	SF	,ZDML1(XPT,ZDM)	;[104]
	L	YESEM
	SF	,ZDMSM(XPT,ZDM)	;[104]
	IF	SKIPN	YELIN2
		GOTO	FALSE
	THEN	;line 2 present
		L	YELIN2
		SF	,ZDML2(XPT,ZDM)	;[104]
	ELSE
		SETZM	YECHDM
		HLLOS	ZDM+1(XPT)	;line 2 field = -1
	FI
	GOTO	FIN-QUUO(XENTRY)
FIN:	SF	X1,ZDMTX(XPT,ZDM)	;store ASCII text	;[104]
	GOTO	OUT
	SF	X3,ZDME3(XPT,ZDM)	;store index 3	;[104]
	SF	X2,ZDME2(XPT,ZDM)	;store index 2	;[104]
	SF	X1,ZDME1(XPT,ZDM)	;store index 1	;[104]
OUT:	RETURN

;type was WARNING
WAR:	AOS	YWARCT
	IFOFF	YSWW
	GOTO	OUT
	CAIL	XPT,QLDM	;table full?
	GOTO	OUT
;table not full
ADV:	LI	3
	ADDM	YDMEND
	GOTO	FILL
;type was TERMINATION
TER:	SETON	YSWTRM
	CAIL	XPT,QLDM	;table full?
	GOTO	SCAN
	GOTO	ADV

ERRLI:
	;insert last line number
	SKIPGE	YECHDM
	GOTO	OUT
	SETZ	XPT,
	L	YELIN2
	WHILE	LFE	XW,ZDML2(XPT,ZDM)	;[104]
		SKIPGE	XW
		SF	,ZDML2(XPT,ZDM)	;[104]
	DO	ADDI	XPT,3
		CAIGE	XPT,QLDM
	OD
	GOTO	OUT

	EPROC
	LIT
	END