Google
 

Trailing-Edge - PDP-10 Archives - klad_sources - klad.sources/subkl.txt
There are no other files named subkl.txt in the archive.
;DFQDA






				IDENTIFICATION
				--------------

	PRODUCT CODE:		AH-F079A-DD

	DIAGNOSTIC CODE:	DFQDA (SUBKL)

	PRODUCT NAME:	 	DFQDAA0 DECSYSTEM DIAGNOSTICS KL10 SUBROUTINE PROGRAM
	VERSION:		0.1

	DATE RELEASED:		SEPTEMBER 1978

	MAINTAINED BY:		DIAGNOSTIC ENGINEERING

	AUTHOR:			JOHN R. KIRCHOFF

		        COPYRIGHT (C) 1978

	        DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

	THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR  USE  ONLY  ON  A
	SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY 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 EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO
	AGREES  TO  THESE  LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE
	SOFTWARE  SHALL  AT   ALL  TIMES  REMAIN  IN  DIGITAL  EQUIPMENT
	CORPORATION.

	THE INFORMATION IN THIS DOCUMENT IS SUBJECT  TO  CHANGE  WITHOUT
	NOTICE  AND  SHOULD  NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
	EQUIPMENT CORPORATION.

	DIGITAL EQUIPMENT CORPORATION ASSUMES NO  RESPONSIBILITY FOR THE
	USE  OR  RELIABILITY  OF  ITS SOFTWARE IN EQUIPMENT WHICH IS NOT
	SUPPLIED BY DIGITAL EQUIPMENT CORPORATION.
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 1
			TABLE OF CONTENTS
			-----------------

1.0	ABSTRACT

2.0	REQUIREMENTS

2.1	EQUIPMENT

2.2	STORAGE

3.0	PROGRAM PROCEDURES

3.1	PROGRAM ASSEMBLY PROCEDURE

3.2	SUBROUTINE OPERATING PROCEDURE

4.0	DATA SWITCH FUNCTIONS

5.0	SUBROUTINE DESCRIPTIONS

5.1	PROGRAM SUBROUTINE INITIALIZATION

5.2	CONTROL SWITCH INITIALIZATION

5.3	MEMORY MAPPING SUBROUTINE

5.4	INTERRUPT SUBROUTINE

5.5	UUO SUBROUTINE

5.6	CONSOLE DATA SWITCH INPUT

5.7	TELETYPE INPUT

5.8	PRINT

5.9	SIXBIT TYPE-IN / PRINT

5.10	KI10 - MARGIN PRINT

5.11	DEVICE CODE CHANGE SUBROUTINE

5.12	KL10 CLOCK SUBROUTINE

5.13	KL10 METER SUBROUTINE

5.14	"DIAMON" FILE SELECTION AND READ SUBROUTINES
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 2

			TABLE OF CONTENTS (CON'T)
			-------------------------

6.0	SUBROUTINE CALLS, REGISTERS, ETC.

6.1	SUBROUTINE CALLS

6.2	SUBROUTINE CONTROL WORDS, REGISTERS

6.3	SUBROUTINE MISC.

6.4	SUBROUTINE FATAL HALTS

7.0	DIAGNOSTIC ERROR HANDLER

7.1	GENERAL ERROR CALL FORMAT

7.2	ERROR CALL FORMAT

7.3	CALLING THE ERROR MACRO

7.4	ERROR HANDLER SWITCH CONTROL

7.5	ERROR HANDLER BLOCK FLOW

7.6	ERROR HANDLER DIAGNOSTICS

8.0	SUBROUTINE PACKAGE INSTRUCTIONS

8.1	SUBROUTINE SYMBOLIC TAGS

8.2	SUBROUTINE PACKAGE DISTRIBUTION

9.0	MISCELLANEOUS

10.0	SOURCE FILE LISTINGS
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 3
1.0  ABSTRACT
     --------

     THE PDP-10 SUBROUTINES (PARAM.KLM,FIXED.KLM,STOR.KLM & SUBKL.SAV)
     PROVIDE THE BASIC SUBROUTINES AND SOURCE FILES NEEDED TO
     FACILITATE DEVELOPMENT OF DIAGNOSTIC AND UTILITY PROGRAMS FOR
     THE PDP-10 KL10 COMPUTER.  ALSO PROVIDED IS A DIAGNOSTIC ERROR
     HANDLER CAPABLE OF REPORTING A STANDARD BUT FLEXIBLE FORMAT OF TEST
     DATA AND DIAGNOSTIC INFORMATION.  THE ERROR HANDLER ALSO INTERPETS
     AND CONTROLS TEST SWITCHES SUCH AS TYPEOUT SUPPRESSION, CONTINUE
     CONTINUE/HALT OR LOOP ON ERROR, AND BELL ON ERROR.

     THIS SUBROUTINE PACKAGE CONSISTS OF FOUR FILES WHICH ARE:

	PARAM - THIS FILE CONTAINS ALL PERTINENT SUBROUTINE PARAMETERS:
	   A - OPERATOR DEFINITIONS
	   B - MAIN CONTROL REGISTERS/WORDS
	   C - SUBROUTINE ASSIGNMENTS

	FIXED - THIS FILE CONTAINS STANDARDIZED PROGRAM STARTING ADDRESSES
		AND CONTROL PARAMETER LOCATIONS.

	STOR - THIS FILE CONTAINS THE REQUIRED STORAGE SETUP INSTRUCTIONS
	       AND THE END COMMAND.

	THE PARAM.KLM, FIXED.KLM & STOR.KLM ARE SOURCE MACRO FILES
	WHICH ARE ASSEMBLED WITH THE APPROPRIATE DIAGNOSTIC MACRO
	SOURCE FILES TO CREATE A DIAGNOSTIC SEGMENT LOAD MODULE.
	THESE FILES PROVIDE THE COMMON DEFINITIONS AND ADDRESS
	ASSIGNMENTS REQUIRED FOR RUN TIME DIAGNOSTIC AND
	SUBROUTINE COMMUNICATIONS.

	SUBUSR - USER MODE SUBROUTINE PACKAGE
	SUBKL - EXEC MODE SUBROUTINE PACKAGE

	THESE FILES ARE A SEPARATE LOAD MODULE AND
	CONTAINS THE FOLLOWING SUBROUTINES:

	   A - PROGRAM SUBROUTINE INITIALIZATION
	   B - CONTROL SWITCH INITIALIZATION
	   C - INTERRUPT HANDLER
	   D - UUO HANDLER
	   E - CONSOLE DATA SWITCH INPUT
	   F - TELETYPE INPUT
	   G - PRINT
	   H - SIXBIT TYPE-IN / PRINT
	   I - DF10 CONTROL WORD PRINT
	   J - MEMORY MAPPING
	   K - KI10 MARGIN PRINTOUT ROUTINE
	   L - DEVICE CODE CHANGE SUBROUTINE
	   M - DIAGNOSTIC ERROR HANDLER
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 4

2.0  REQUIREMENTS
     ------------

2.1  EQUIPMENT
     ---------

     THE PDP-10 KL10 SUBROUTINES ARE CONFIGURED TO BE ABLE TO OPERATE
     ONLY IN EXEC MODE.  A NORMAL SYSTEM CONFIGURATION 
     DEPENDING ON THE MAIN PROGRAM IS REQUIRED.

2.2  STORAGE
     -------

     FIXED - THIS FILE CONTAINS THE FOLLOWING:
		A - PROGRAM STARTING ADDRESSES, 30000 TO 30017
		B - PROGRAM FIXED PARAMETER AREA, 30020 TO 30036
		C - PROGRAM VARIABLE PARAMETER AREA, 30037 TO 30056
		D - SPECIAL PROGRAM DISPATCH ADDRESSES, 30057 TO 30105
		E - PROCESSOR CONTROL STORAGE, 30106 TO 30123
		F - UUO DISPATCH TABLE, 30124 TO 30141
		G - MEMORY MANAGEMENT STORAGE, 30124 TO 30216
		H - PRINT CONTROL STORAGE, 30217 TO 30241
		I - PRINT CHARACTERS, 30242 TO 30264
		J - USER MODE OUTPUT FILE INFO, 30265 TO 30273
		K - DISK UPDATE FILE INFO, 30274 TO 30302
		L - PUSHDOWN LIST, 30303 TO 30504
		M - EXPANSION AREA, 30505 TO 30577

     PARAM - THIS FILE CONSISTS OF DEFINITIONS AND REQUIRES NO CORE
 	     LOCATIONS.

     STOR - REQUIRED LOCATIONS VARIES DEPENDING UPON NUMBER OF VARIABLES
	    AND LITERALS USED IN THE MAIN PROGRAM.
	    A DEBUG AREA IS PROVIDED (IF DEBUG IS DEFINED) OF DEBUG(8) LOCATIONS.
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 5

2.3	MEMORY UTILITIZATION MAP
	------------------------


	0	-----------------------------------------
		I
		I   EXEC PAGE TABLE
		I
	1000	-----------------------------------------
		I
		I   SUBKL
		I
	10000	-----------------------------------------
		I
		I   KLDDT
		I
	20000	-----------------------------------------
		I
		I   DIAMON
		I
	30000	----------------------------------------
		I
		I   FIXED
		I
	30600	----------------------------------------
		I
		I   DIAGNOSTIC SEGMENT
		I
		/
		\
		I
	MEMLOW	----------------------------------------
		I
		I   MEMORY AVAILABLE FOR TESTING
		I
		/
		\
		I
	MAX MEM	----------------------------------------
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 6
3.0  PROGRAM PROCEDURES
     ------------------

3.1  PROGRAM ASSEMBLY PROCEDURE
     --------------------------

     THE PARAM, FIXED & STOR FILE ARE ASSEMBLED WITH THE MAIN PROGRAM
     TO PRODUCE A COMPLETE PROGRAM. THE FILES ARE ASSEMBLED IN THE FOL-
     LOWING ORDER:

	A.  PROGRAM TITLE FILE; CONTAINS PROGRAM IDENTIFICATION DATA
	    AND OPERATION PARAMETERS

	B.  SUBROUTINE PARAMETER FILE, PARAM; CONTAINS SUBROUTINE 
	    PARAMETERS, OPERATOR DEFINITIONS, AND SUBROUTINE ASSIGN-
	    MENTS

	C.  PROGRAM STARTING FILE, FIXED; CONTAINS PROGRAM STARTING
	    ADDRESSES AND PROGRAM CONTROL PARAMETER LOCATIONS.

	D.  MAIN PROGRAM FILE; CONTAINS THE CODING FOR THE MAIN PROGRAM

	F.  STORAGE FILE, STOR; CONTAINS THE RESERVED STORAGE SETUP
		1.  LIT, PROGRAM CONSTANTS
		2.  SPECIFIED PROGRAM VARIABLES
		3.  VAR, PROGRAM VARIABLE WORDS
		4.  PROGRAM END STATEMENT (IF PGMEND DEFINED)

	THE DIAGNOSTIC SEGMENT IS ASSEMBLED FOR EXEC AND/OR USER MODE
	BY DEFINING THE FOLLOWING PARAMETERS:

	A.  EXCASB = 1	;ASSEMBLE FOR EXEC MODE
	B.  USRASB = 1	;ASSEMBLE FOR USER MODE

					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 7
3.1	CON'T
	-----

	THE PDP-10 CENTRAL PROCESSOR THAT THE DIAGNOSTIC SEGMENT
	IS ASSEMBLED FOR IS CONTROLLED BY THE FOLLOWING
	CONDITIONAL ASSEMBLY PARAMETERS:

	A.  KA10 = 1	;ASSEMBLE FOR KA10 CP.
	B.  KI10 = 1	;ASSEMBLE FOR KI10 CP.
	C.  KL10 = 1	;ASSEMBLE FOR KL10 CP.
	D.  KL10P0 = 1	;ASSEMBLE PRODUCTION KL10 DEFINITIONS IF KL10

	THE MEMORY MAPPING SUBROUTINES ARE CONDITIONALLY
	ALLOWED DEPENDING UPON THE REQUIREMENTS OF THE MAIN PROGRAM.
	THIS IS CONTROLLED BY DEFINING THE FOLLOWING SYMBOL IN THE
	DIAGNOSTIC SEGMENT TITLE FILE:

	1.  MEMMAP=1	;ALLOW MEMORY MAPPING SUBROUTINE

	THE PROGRAM END STATEMENT IS ASSEMBLED INTO THE "STOR" FILE
	IF THE FOLOWING SYMBOL IS DEFINED.  IF IT IS NOT DEFINED
	THERE THEN MUST BE A DIAGNOSTIC SEGMENT STORAGE FILE, ALLOWING
	ADDITIONAL BUFFER AREAS, CONTAINING THE END STATEMENT.

	1.  PGMEND=1	;ASSEMBLE PROGRAM END STATEMENT

	THE FOLLOWING START ADDRESSES MUST BE USED IN THE
	DIAGNOSTIC SEGMENT FOR INITIAL STARTING AND END OF
	PASS RESTART ADDRESSES.

	1.  START	;INITIAL DIAGNOSTIC START
	2.  STARTA	;END OF PASS RESTART
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 8
3.1	CON'T
	-----

	THE FOLLOWING SYMBOLS ARE USED TO CONTROL THE ASSEMBLY
	OF THE PROPER "FIXED" FILE:

	SADR1		;SPECIAL FEATURE START ADDRESS
	SADR2		;POWER FAIL RESTART ADDRESS (RESRT1)
	SADR3		;REENTER START ADDRESS
	SADR5		;CONTROL C TRANSFER ADDRESS
	SADR6		;ALTMODE TRANSFER ADDRESS
	SADR7		; START1 - STARTING INSTRUCTION
	SADR8		; START2 - "
	SADR9		; START3 - "
	SADR10		; START4 - "
	SADR11		; START5 - "

	PAREA1		;RANDOM BASE NUMBER
	PAREA2		;SYS EXER SWITCHES
	PAREA3		;SIXBIT PROGRAM NAME
	PAREA4		;SIXBIT PROGRAM NAME EXTENSION
	PAREA5		;OPTIONAL PARAMETER
	PAREA6		;OPTIONAL PARAMETER

	ITERAT		;EXEC & USER MODE PROGRAM ITERATIONS

	THE ABOVE SYMBOLS MUST BE DEFINED, AS 0 IF NOT USED OR AS
	THE PROGRAM REQUIRED DATA.

	TO PROVIDE A DEBUG PATCH AREA, DEFINE THE FOLLOWING
	WORD IN THE PROGRAM TITLE FILE:

		1.	DEBUG= #	;# ='S SIZE OF PATCH AREA
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 9

3.3	PROGRAM STANDARIZED STARTING ADDRESSES
	----------------------------------------

PROGRAM STARTING ADDRESSES

30000	BEGIN:	JRST	@MODLNK		;STAND-ALONE START

30001	$START:	JRST	START		;MODE CHECK STARTING ADDRESS

30002	DIAGMN:	JRST	@LDLNK		;DIAGNOSTIC MONITOR START

30003	SYSEXR:	JRST	@LDLNK		;SYSTEM EXERCISER START

30004	SFSTRT:	JRST	SADR1		;SPECIAL FEATURE START

30005	PFSTRT:	JRST	SADR2		;POWER FAIL RESTART

30006	REENTR:	JRST	SADR3		;REENTER START

30007	DDTSRT:	JRST	@DDTLNK		;DDT START

30010	BEGIN1:	JRST	STARTA		;START NEXT PROGRAM PASS

30011	SBINIT:	JRST	@SUBLNK		;PGMINT LINKAGE

30012	RETURN:	0			;RETURN ADDRESS STORAGE

30013	START1:	SADR7			;OPTIONAL STARTING ADR/INSTRUCTIONS

30014	START2:	SADR8			; "

30015	START3:	SADR9			; "

30016	START4:	SADR10			; "

30017	START5:	SADR11			; "
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 10
3.3  SUBROUTINE OPERATING PROCEDURE
     ------------------------------

     THE ONLY SPECIAL OPERATING PROCEDURES REQUIRED ARE FOR THE SWITCH
     INITIALIZATION AND PRINT SUBROUTINES:

	A.  SWITCH INITIALIZATION - THE OPERATIONAL SWITCHES FOR THE 
	    PROGRAM ARE INITIALIZED AS FOLLOWS:

		    EXEC MODE - KL10 - SWITCHES READ FROM DTE20 COMM
				AREA.  THESE ARE DEPOSITED INTO THE DTE20
				COMM AREA BY THE CONSOLE PROCESSOR.

	B.  PRINT INITIALIZATION - THE PRINT SUBROUTINE PROVIDES OUTPUT
	    TO THE TTY AND/OR LPT IN EXEC MODE.
	    USE OF THE TTY OR LPT DEVICE IS SPECIFIED BY THE SWITCHES.
					MAINDEC-10-DFQDA.TXT (SUBKL)
4.0  DATA SWITCH FUNCTIONS  (STANDARD SET)	PAGE 11
     ---------------------
     SWITCH NO.		SYMBOL	STATE	FUNCTION DESCRIPTION
     ----------		------	-----	--------------------

     0 (400000)		ABORT	   0	NORMAL OPERATION
				   1	ABORT AT END OF PASS

     1 (200000)		RSTART	   0	NO FUNCTION
				   1	LIST TOTALS AND RESTART

     2 (100000)		TOTALS	   0	NO FUNCTION
				   1	LIST TOTALS AND CONTINUE

     3 (040000)		NOPNT	   0	NORMAL TYPEOUT
				   1	INHIBIT ALL PRINTING EXCEPT FORCED

     4 (020000)		PNTLPT	   0	NORMAL OUTPUT TO TTY
				   1	PRINT ON LPT (USER, LOGICAL DEV)

     5 (010000)		DING	   0	NO FUNCTION
				   1	RING TTY BELL ON ERROR (FORCED OUTPUT).

     6 (004000)		LOOPER	   0	PROCEED TO NEXT TEST
				   1	ENTER SCOPE LOOP ON TEST ERROR

     7 (002000)		ERSTOP	   0	NO FUNCTION
				   1	HALT ON TEST ERROR (EXIT, USER MODE).

    8 (001000)		PALERS	  0	PRINT ONLY FIRST ERROR IN LOOP
				  1	PRINT ALL ERRORS

    9 (000400)		RELIAB 	  0	QUICK VERIFY MODE
				  1	RELIABILITY MODE

    10 (000200)		TXTINH	  0	PRINT FULL ERROR MESSAGES.
				  1	INHIBIT COMMENT PORTION OF ERROR MESSAGES.

    11	(000100)	INHPAG	  0	KI10 & KL10 - ALLOW FULL 256K/4096K ADDRESSING
				  1	KI10 & KL10 - INHIBIT PAGING; I.E. TREAT MEMORY AS 112K-1 MAXIMUM

    12	(000040)	MODDVC	  0	NO DEVICE CODE CHANGE
				  1	MODIFY DEVICE CODES

    13	(000020)	INHCSH	  0	KL10 - ALLOW CACHE USE
				  1	KL10 - INHIBIT CACHE

    14	(000010)	OPRSEL	  0	RUN DEFAULT OPERATIONS
				  1	OPERATOR TEST SELECTIONS

    15	(000004)	CHAIN	  0	THIS SWITCH USED BY "DIAMON", ETC.
					TO CONTROL CHAIN OPERATIONS

    16	(000002)			RESERVED

    17	(000001)			RESERVED
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 12
5.0  SUBROUTINE DESCRIPTIONS
     -----------------------

     SEE SECTION 6.1 OR LISTING OF FILE 'PARAM' FOR CALLING PROCEDURES
     FOR THE FOLLOWING SUBROUTINES.

5.1  PROGRAM SUBROUTINE INITIALIZATION
     ---------------------------------

     THIS SUBROUTINE INITIALIZES THE FOLLOWING:
	A - PUSH LIST
	B - JOB DATA AREA
	C - INTERRUPTS AND TRAPS
	D - PRINT
	E - TELETYPE INPUT
	F - SWITCHES
	G - MEMORY SIZE POINTERS (IN 'MEMSIZ' TABLE)

     IN ADDITION THIS ROUTINE PRINTS THE PROGRAM NAME. 'PGMNAM' IS 
     THE TAG FOR THE ASCIZ MESSAGE. 'PGMNAM' MUST BE INCLUDED IN
     THE MAIN PROGRAM FILE.

5.2  CONTROL SWITCH INITIALIZATION
     -----------------------------

     THIS SUBROUTINE INITIALIZES THE SWITCH SUBROUTINE TO USE EITHER
     THE ACTUAL CONSOLE SWITCHES OR THE TYPED IN SWITCHES. THIS IS
     DESCRIBED IN 3.3 A.

5.3	MEMORY MAPPING SUBROUTINES
	--------------------------

	A.  MAPMEM  (PART OF PGMINT)

	PERFORMS MEMORY MAPPING AND PRINTS A MEMORY MAP.
	MEMORY MAPPING OF EITHER 4096K KL10/KI10 MEMORY OR 256K DIRECT
	ADDRESSED MEMORY IS CONTROLLED BY THE MAPNEW FLAG.

	MAPNEW = 0, DIRECT MEMORY ADDRESSING, 256K MAXIMUM
	        -1, 4096K KL10/KI10 PAGED MEMORY OPERATIONS

	4096K PAGED MEMORY OPERATIONS WILL ONLY TAKE PLACE IF:
	1. KL10 OR KI10
	2. MAPNEW FLAG = -1 BEFORE "PGMINT"

	DIRECT MEMORY OPERATIONS WILL TAKE PLACE IF ANY OF:
	1. USER MODE OR SPECIAL USER MODE
	2. KA10
	3. KL10 OR KI10 & PAGING INHIBITED
	4. KL10 OR KI10 & MAPNEW WASN'T -1 BEFORE "PGMINT"
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 13
5.3	MEMORY MAPPING SUBROUTINES (CON'T)
	--------------------------

	B.  MEMSEG

	DOES MEMORY SEGMENT SETUP FOR A REQUESTED SEGMENT OF MEMORY

	** MAPNEW = -1

	SETS UP TO 128K SEGMENT IN PAGE MAP
	ARGUMENTS:	0-37 - MAP CORRESPONDING 128K SEGMENT
		       GT 37 - MAP USING PHYSICAL ADDRESS
	RETURNED IN AC0
		0 - NO MEMORY AVAILABLE
		HIGHEST VIRTUAL ADDRESS
		BIT 0 SET IF NON-CONSECUTIVE CORE (IN A 128K SEGMENT) WAS
		COMBINED.  NON-CONSECUTIVE CORE WILL NOT BE COMBINED WHEN
		DOING A PHYSICAL ADDRESS MEMSEG.
		PAGE MAP SETUP SO VIRTUAL ADDRESS 400000 AND UP POINTS
		TO MEMORY REQUESTED.
	RETURNS +2

	** MAPNEW = 0

	ARGUMENTS:	0-10 - SETUP CORRESPONDING CHUNK FROM MEMSIZ TABLE
		 	11-37 - RETURNS 0, MAXIMUM OF 8 CHUNKS IN 256K
			USER MODE, 1-37 ALWAYS RETURNS 0
			GT 37 - RETURNS MEMORY AT PHYSICAL ADDRESS
	RETURNED IN AC0:
		0 - NO MEMORY AVAILABLE
		START ADDRESS,, END ADDRESS
	RETURNS +1

	C.  MAPADR

	PERFORMS VIRTUAL TO PHYSICAL ADDRESS TRANSLATION
	ARGUMENT IN AC0: VIRTUAL ADDRESS
	RETURNED IN AC0: PHYSICAL ADDRESS
	SKIP RETURN IS NORMAL, NON-SKIP IS KI10 PAGE INACCESSIBLE

	NOTE: ON A KL10 IN USER MODE THE VIRTUAL ADDRESS IS RETURNED
		SINCE A MAP INSTRUCTION IS ILLEGAL IN USER MODE AND
		THE MONITOR DOES NOT PROVIDE A SUBSTITUTE.
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 14
5.3	MEMORY MAPPING SUBROUTINES (CON'T)
	--------------------------

	D.  MEMZRO

	ZERO'S MEMORY FROM MEMLOW UP TO MAXIMUM

	MAPNEW = 0, DIRECT MEMORY ZERO
		-1, 4096K PAGED MEMORY ZERO

	E.  MAPSET

	SETS UP KL10 OR KI10 PAGE MAP FOR VIRTUAL TO PHYSICAL
	ADDRESS TRANSLATION.

	ARGUMENTS IN AC0:
		NEG - CLEAR PAGE MAP
		0-37 - MAP CORRESPONDING 128K SEGMENT

	F.  MAPCNK

	DOES ACTUAL MEMORY MAPPING.

	ARGUMENTS:
		AC0: START ADDRESS,,END ADDRESS
		AC1: TEMPORARY CHUNK ADDRESS STORAGE POINTER

	DOES FOUR WAY INTERLEAVE MAPPING BUT IF ANY OF THE
	4-WAY ADDRESSES ARE NON-X THAT CHUNK IS MARKED NON-X.
	MAPS BY 16K CHUNKS.

	G.  MAPPNT

	DOES MEMORY MAP PRINTOUT USING PARAMETERS CONTAINED IN "MEMSIZ"
	TABLE.  NORMALLY DONE AS PART OF "MAPMEM" WHICH IS DONE BY
	"PGMINT".
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 15
5.4	INTERRUPT SUBROUTINE
	--------------------

	THIS SUBROUTINE HANDLES PROCESSOR INTERRUPTS ON CHANNEL 1
	IN EXEC MODE AND APR TRAPPING IN USER MODE.  THE FOLLOWING 
	INTERRUPTS / TRAPS ARE PROCESSED:

	    A - PUSHDOWN OVERFLOW
	    B - MEMORY PROTECTION VIOLATION
	    C - NON-EXISTANT MEMORY
	    D - PARITY ERROR
	    E - TO PROCESS OTHER INTERRUPTS, CHANGE CONO'S / APRENB
	        ACCORDINGLY AND SETUP JRST'S IN THE INTERRUPT
	        DETERMINATION SEQUENCE TO GO TO THE PROPER HANDLING
	        ROUTINE, SUPPLIED BY USER.

	THE FOLLOWING ADDITIONAL CONDITIONS ARE PROCESSED IN EXEC MODE:

	    A - POWER FAILURE ; WHEN A POWER FAILURE IS DETECTED THE
		AC'S ARE SAVED AND THE PROGRAM HALTS.  RESTART AT
		'PFSTRT' TO RESTORE AC'S AND CONTINUE PROGRAM.

	    B -	KI10 - THE POWER FAIL AUTO RESTART IS ENABLED AND
		RESTARTS BY 'JRST PFSTRT' PERFORMED BY POWER FAIL
		TRAP INSTRUCTION FROM LOC 70.

5.5	UUO SUBROUTINE
	--------------

	THIS SUBROUTINE HANDLES UUO'S IN THE RANGE 001-037 BY CHECKING
	FOR VALIDITY AND DISPATCHING VIA JRST TO THE APPROPRIATE USER SUPPLIED
	UUO HANDLING ROUTINE.  IN ORDER TO USE UUO'S THE USER MUST SUPPLY
	THE ROUTINE AND INSERT A POINTER TO THE ROUTINE IN THE 
	APPROPRIATE POSITION OF THE UUO DISPATCH TABLE.  A UUO
	ROUTINE IS EXITED BY USING A (JRST UUOEXT) OR (JRST UUOSKP) TO RETURN TO THE
	UUO HANDLER.  ILLEGAL UUO'S ARE HANDLED BY PRINTING OUT THE
	PERTINENT INFORMATION AND HALTING.

	UUOEXT PROVIDES FOR NORMAL RETURN FROM UUO (RETURNS UUO +1)
	UUOSKP PROVIDES FOR A SKIP RETURN FROM UUO (RETURNS UUO +2)

	THE UUO HANDLER IS ENTERED AND EXITED WITHOUT AFFECTING THE CONTENTS
	OF THE AC'S UNLESS THE AC'S ARE CHANGED BY THE USER UUO ROUTINE.
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 16
5.6  CONSOLE DATA SWITCH INPUT
     -------------------------

     THIS SUBROUTINE INPUTS THE CONSOLE DATA SWITCHES IN EXEC
     MODE. THE TYPED IN SWITCH SETTINGS ARE NOT AFFECTED IF IN USER
     MODE.

	IF THE PROGRAM IS UNDER CONTROL OF THE DIAGNOSTIC MONITOR
	(MONCTL = -PASS COUNT,X) THE RIGHT HALF OF MONCTL IS USED AS
	THE RIGHT HALF OF THE CONSOLE SWITCHES.  THE LEFT
	HALF CONSOLE SWITCHES ARE USED DIRECTLY.

	IF THE PROGRAM IS RUNNING UNDER THE SYSTEM EXERCISER,
	THE CONTENTS OF (SWTEXR) IS USED AS THE CONSOLE
	SWITCH SETTINGS.

5.7  TELETYPE INPUT
     --------------

     THIS SUBROUTINE INPUTS FROM THE TELETYPE. ACCEPTS ANY CHARACTER,
     Y OR N, UP TO 12 OCTAL DIGITS, UP TO 11 DECIMAL DIGITS (CONVERTED
     INTO AN OCTAL WORD), OR UP TO 9 CONVERTABLE DIGITS (DECIMAL
     IF A PERIOD <.> FOLLOWS, OCTAL OTHERWISE).

	ON NUMBER INPUTS, IF THE FIRST INPUT IS A MINUS THE
	NUMBER IS RETURNED NEGATED.  ALSO IF ONLY THE TERMINATION CHARACTER
	(CR OR COMMA) IS TYPED, THEN 0 IS RETURNED IN AC0 WITH THE
	"TTNBRF" FLAG STILL ZERO.

     ASKS THE QUESTION 'Y OR N <CR> -' IF A YES/NO RESPONSE IS REQUESTED.
     CARRIAGE RETURN OR COMMA (,) TERMINATES OCTAL, DECIMAL, OR CONVERT TYPE-IN.
     IN EXEC MODE THE SUBROUTINE WILL WAIT FOR THE AMOUNT OF TIME
     INITIALIZED IN (OPTIME) AND IF NO REPONSE WITHIN THAT TIME WILL
     TAKE THE NO/ERROR RESPONSE RETURN.

	IF A CONTROL C <^C> IS TYPED DURING TYPEIN (EXEC) A "JRST @CNTLC" IS
	PERFORMED TO RESTART OR TERMINATE PROGRAM. 'CNTLC' IS PART OF THE
	PROGRAM CONTROL PARAMETER AREA AND MAY BE SET TO THE USERS OPTION.
	INTERRUPTED ADDRESS IS STORED IN "JOBOPC" LOCATION 130.

	IF A CONTROL D <^D> IS TYPED DURING TYPEIN A JRST TO "DDT" IS
	PERFORMED, IF "DDT" IS NOT LOADED A "HALT BEGIN" IS DONE.
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 17
5.8  PRINT
     -----

     THIS SUBROUTINE PRINTS ASCII MESSAGES, DECIMAL NUMBERS, OR A 
     DESIGNATED AMOUNT OF OCTAL DIGITS. DECIMAL NUMBERS CAN EITHER BE 
     PRINTED WITH THE LEADING ZEROS SUPPRESSED OR WITH SPACES SUB-
     STITUTED FOR THE LEADING ZEROS. A FULL OCTAL WORD CAN EITHER BE
     PRINTED AS TWELVE CONSECUTIVE DIGITS OR IN HALF WORD FORMAT,
     6 SP 6.

     PRINTOUTS MAY BE EITHER IN NORMAL MODE, CAPABLE OF BEING SUPPRESSED
     BY THE NOPNT SWITCH, OR IN THE FORCED OUTPUT MODE WHERE THE PRINT-
     OUT GOES TO THE TTY EVEN IF THE LPT/LOGICAL DEVICE IS SELECTED OR
     IF PRINTOUTS ARE SUPPRESSED BY THE NOPNT SWITCH.

     THE PRINTED OUTPUT GOES TO THE TTY AND/OR LPT IN EXEC MODE AND TO
     THE TTY AND/OR USER ASSIGNED LOGICAL DEVICE IN USER MODE. THE LOGICAL
     OUTPUT FILE IN USER MODE IS '"PNTNAM"."PNTEXT"' AND THE LOGICAL DEVICE IS 'DEV'.

     IN EXEC MODE TYPEOUT MAY BE SUPPRESSED, ON THE TTY, TILL THE NEXT
     FORCED OUTPUT, TTY INPUT REQUEST OR TILL THE NEXT (^O) IS TYPED.
     THE "PFORCE" COMMAND MAY BE DONE TO OVERRIDE CONTROL O WITHOUT
     CAUSING ANY PRINTOUT.

	IF A CONTROL C <^C> IS TYPED DURING PRINTOUT A "JRST @CNTLC"
	IS PERFORMED AS DESCRIBED ABOVE (IN 5.7). (EXEC ONLY).

	IF AN ALT-MODE IS TYPED DURING PRINTOUT (EXEC ONLY)
	A "JRST @ALTMGO" IS PERFORMED TO TRANSFER TO USER'S ROUTINE, I.E. DDT.
	INTERRUPTED ADDRESS STORED IN 'JOBOPC' FOR CONTINUATION USE.

	IF A CONTROL D <^D> IS TYPED DURING PRINTOUT (EXEC ONLY)
	A JRST TO "DDT" IS PERFORMED, IF "DDT" IS NOT LOADED
	A "HALT BEGIN" IS DONE.
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 18

5.9  SIXBIT TYPE-IN / PRINT
     ----------------------

     A.	TTSIXB - SIXBIT TYPE-IN

	THIS ROUTINE INPUTS FROM THE TELETYPE AND CONVERTS ASCII 
   	INPUT INTO A SIXBIT WORD.  ACCEPTS UP TO SIX CHARACTERS,
	TERMINATES WITH A CR OR A COMMA.

     B.	PNTSIX & PNTSXF - SIXBIT PRINT

	THIS ROUTINE PRINTS OUT THE CONTENTS OF AC0 AS A SIXBIT WORD.
	PRINTOUT MAY BE IN NORMAL OR FORCED PRINTOUT MODE.

    C.  SIXBTZ

	THIS MACRO GENERATES SIXBIT DATA FOR PRINTING.  PROVIDES A
	CONSIDERABLE SAVING IN CORE STORAGE OVER ASCIZ.  ALL SIXBIT
	CHARACTERS MAY BE USED WITH THE FOLLOWING EXECPTIONS:

	1. BACKARROW (_) IS INSERTED AS THE LAST CHARACTER IN THE
	   MESSAGE STRING TO SIGNIFY END OF TEXT.

	2. UPARROW (^) SIGNIFIES CR/LF.

	3. RIGHT SQUARE BRACKET (]) SIGNIFIES TAB.

	THIS TEXT GENERATION METHOD IS USED BY THE DIAGNOSTIC ERROR
	MACRO.

5.10	KI10 - MARGIN PRINT
	-------------------

	THIS ROUTINE PRINTS THE KI10 MARGIN VALUE FROM THE WORD IN 'MARGIN'.
	FORMAT:

	MARGIN WORD = 123456 123456 , BAY 1 ROW A = 5052 MVOLTS, SPEED MARGINS
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 19

5.11	DEVICE CODE CHANGE SUBROUTINE
	-----------------------------

	THIS SUBROUTINE ALLOWS RUN TIME CHANGE OF DEVICE CODES.
	ROUTINE IS CALLED BY SETTING SWITCH "MODDVC".
	TO USE THE ROUTINE PLACE A "MODPCU" CALL IN THE APPROPRIATE
	PLACE IN THE PROGRAM AND HAVE THE FOLLOWING LIMIT PARAMETERS
	DEFINED:
		MODDVL = LOWER LIMIT OF DEVICE CODE SEARCH
		MODDVU = UPPER LIMIT OF DEVICE CODE SEARCH

	THE PROGRAM WILL ASK THE FOLLOWING QUESTIONS WHEN INVOKED:

		CHANGE DEVICE CODES, Y OR N <CR> -
		OLD DEVICE CODE -
		NEW DEVICE CODE -

	ANSWER QUESTIONS APPROPRIATELY.  THE CHANGE DEVICE CODES QUESTION
	WILL BE REASKED TILL YOU SAY NO, CHANGING AS MANY DEVICE CODES
	AS WANTED.

	TO CHANGE DEVICE CODES UNDER PROGRAM CONTROL, CALL
	"MODPCP" WITH C(AC0) = [OLD,,NEW] DEVICE CODES.

5.12	KL10 CLOCK SUBROUTINE
	---------------------

	THIS SUBROUTINE PROVIDES POWER-LINE CLOCK USAGE AND CONTROL
	OF THE POWER-LINE CLOCK IN THE CONSOLE PROCESSOR.  THE 
	FEATURES AND CONTROL ARE PROVIDED AS FOLLOWS:

	A.  AC0 = 0	;DISABLE

	B.  AC0 = -1	;ENABLE, THE "CLOCKF" FLAG IS SET TO -1 ON
			EVERY CLOCK TICK

	C.  AC0 = INST	;ENABLE AND EXECUTE INSTRUCTION, SETS "CLOCKF"
			;FLAG TO -1 ON EVERY CLOCK TICK AND EXECUTES
			;THE SUPPLIED INSTRUCTION.  THE INSTRUCTION
			;MAY SIMPLY BE AN "AOS" OF A COUNT OR MAY BE
			;A SUBROUTINE CALL TO PERFORM A ROUTINE AND
			;RETURN.

	D.  AC0 = 0,,X	;WAIT "X" CLOCK TICKS AND THEN PERFORM
			;AS "C" ABOVE.  THE INSTUCTION IN THIS CASE IS
			;SUPPLIED IN AC1.

	E.  AC0 = 0,,1	;READ CONSOLE PROCESSOR CLOCK COUNT SINCE ENABLED
			;BY "B,C OR D" ABOVE.  THE CLOCK COUNT (36 BITS)
			;IS RETURNED IN AC0.
					MAINDEC-10-DFQDA.TXT (SUBKL)
							PAGE 20

5.13	KL10 METER SUBROUTINE
	---------------------

	THIS SUBROUTINE PROVIDES DK20 METER USAGE AND CONTROL
	THE FEATURES AND CONTROL ARE PROVIDED AS FOLLOWS:

	A.  AC0 = 0	;DISABLE

	B.  AC0 = -1	;ENABLE, THE "CLOCKF" FLAG IS SET TO -1 ON
			;EVERY CLOCK TICK

	C.  AC0 = INST	;ENABLE AND EXECUTE INSTRUCTION, SETS "CLOCKF"
			;FLAG TO -1 ON EVERY CLOCK TICK AND EXECUTES
			;THE SUPPLIED INSTRUCTION.  THE INSTRUCTION
			;MAY SIMPLY BE AN "AOS" OF A COUNT OR MAY BE
			;A SUBROUTINE CALL TO PERFORM A ROUTINE AND
			;RETURN.

	D.  AC0 = 0,,X	;WAIT "X" CLOCK TICKS AND THEN PERFORM AS
			; "C" ABOVE.  THE INSTRUCTION IN THIS CASE IS
			;SUPPLIED IN AC1.

	E.  AC0 = 0,,1	;READ METER CLOCK COUNT SINCE ENABLED BY
			;"B,C OR D" ABOVE.  THE CLOCK COUNT IS RETURNED
			;IN AC0.

	THE DK20 METER IS SETUP FOR A PERIOD OF 3203 WHICH IS 60 HZ.
	IF THE PROCESSOR IS 50 HZ THEN THE INTERVAL IS 3720.
	THE METER IS ASSIGNED TO PI CHANNEL ONE AND DOES A VECTOR
	INTERRUPT TO EPT LOCATION 514.  THE I/O BUS RESET DOES NOT
	AFFECT THE DK20 METER.
					MAINDEC-10-DFQDA.TXT (SUBKL)
							PAGE 21

5.14	"DIAMON" FILE SELECTION AND READ SUBROUTINES
	--------------------------------------------

	THIS SUBROUTINE PROVIDES THE CAPABILITY OF SELECTING AND
	READING DATA FILES.  THE FILES MAY BE READ FROM ANY
	OF THE DEVICES SUPPORTED BY "DIAMON".  THE "DIAMON" PROGRAM
	MUST BE RESIDENT IN THE PDP-10 AND MUST PREVIOUSLY HAVE
	BEEN USED TO SELECT THE LOAD DEVICE TO BE USED.

	A.  FSELECT

	THIS SUBROUTINE CALL IS USED TO SELECT THE DESIRED FILE.  UPON
	CALL AC0 CONTAINS AN ADDRESS POINTER TO A TWO WORD SIXBIT FILE
	NAME AND EXTENSION BLOCK.  A SKIP RETURN IS NORMAL AND INDICATES
	THAT THE DESIRED FILE HAS BEEN FOUND AND SETUP FOR SUBSEQUENT
	READ OPERATIONS.

		MOVEI	AC0,FILSPC		FILSPC:	SIXBIT/FILE/
		FSELECT					SIXBIT/EXT/
		JRST	ERROR
		'OK'

	WHEN THE FILE IS FOUND A SKIP RETURN IS TAKEN WITH THE
	CONTENTS OF AC0 INDICATING THE DEVICE TYPE.

		DEVICE TYPE		ASCII	36BIT	8BIT

		0 = UNSPECIFIED		Y	Y	Y	
		1 = PDP-10 DTA		Y	Y	Y
		2 = PDP-10 DISK		Y	Y	Y
		3 = 11 FORMAT DTA	Y	N	Y
		4 = PAPER TAPE		Y	N	Y
		5 = USER (DSK)		Y	Y	Y
		6 = MAG TAPE		Y	Y	Y

	ON THE KL10 WHEN "KLDCP" IS SELECTED AS THE LOAD DEVICE
	THE CONTENTS OF AC0 INDICATE THE CONSOLE LOAD DEVICE.

		DEVICE TYPE		ASCII	36BIT	8BIT

		100 = UNSPECIFIED	Y	N	N
		101 = DTA		Y	N	Y
		102 = DISK		Y	N	Y
		103 = FLOPPY		Y	N	Y
		104 = APT10		Y	N	N

	IF AN ERROR OCCURS OR THE FILE IS NOT FOUND A NON-SKIP RETURN
	IS TAKEN WITH AC0 CONTAINING THE DEVICE TYPE OR THE FOLLOWING.


		0 = NO "DIAMON" CAPABILITY
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 22

5.14	"DIAMON" FILE SELECTION AND READ SUBROUTINES
	--------------------------------------------

	B.  FREAD

	THIS SUBROUTINE CALL IS USED TO READ ASCII DATA FROM THE 
	SELECTED FILE.  A SKIP RETURN IS NORMAL WITH AC0 CONTAINING
	A 7 BIT ASCII DATA CHARACTER.  A NON-SKIP RETURN INDICATES
	AN ERROR OR END-OF-FILE WITH AC0 CONTAINING AN ERROR CODE.
	NULLS IN THE DATA FILE ARE IGNORED.

		FREAD		;CALL
		JRST	EOF	;AC0 HAS ERROR CODE
		'OK'		;AC0 HAS 7 BIT ASCII CHARACTER

	IF ERROR, AC0 CODE:

		0 = END-OF-FILE

	C.  FRD36

	THIS SUBROUTINE CALL IS USED TO READ 36 BIT DATA FROM THE
	SELECTED FILE.  DATA RETURNED IN AC0 IS 36 BITS, REST AS
	"FREAD" ABOVE.

	D.  FRD8

	THIS SUBROUTINE CALL IS USED TO READ 8 BIT DATA FROM THE
	SELECTED FILE.  DATA RETURNED IN AC0 IS 8 BITS, REST AS
	"FREAD" ABOVE.

	IF AN UNSUPPORTED FILE READ IS MADE TO A DEVICE AN END
	OF FILE RETURN WILL OCCUR ON THE FIRST READ.
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 23
6.0	SUBROUTINE CALLS, REGISTERS, ETC.
	---------------------------------

6.1	SUBROUTINE CALLS
	----------------

	THE FOLLOWING COMMANDS ARE USED TO CALL THE VARIOUS SUBROUTINES.

	PGMINT	;PROGRAM SUBROUTINE INITIALIZATION
	FATAL	;FATAL PROGRAMMING HALT
	ERRHLT	;PROGRAM ERROR HALT

	GO	;SUBROUTINE CALL
	RTN	;SUBROUTINE RETURN
	PUT	;PUT DATA ON PUSH LIST
	GET	;GET DATA FROM PUSH LIST

	SWITCH	;READ CONSOLE/TTY SWITCHES

	TTICHR	;TTY, INPUT ANY CHAR			*** CALL SEQUENCE ***
	TTIYES	;TTY, ASK YES-NO, SKIP RETURN Y		TT----
	TTINO	;TTY, ASK NO-YES, SKIP RETURN N		NO/ERR RESPONSE RETURN
	TTIOCT	;TTY, INPUT OCTAL WORD			NORMAL RESPONSE RETURN
	TTIDEC	;TTY, INPUT DECIMAL WORD
	TTICNV	;TTY, INPUT CONVERTABLE WORD
	TTLOOK	;TTY, KEYBOARD CHECK, SKIP RETURN IF TYPE-IN
	TTALTM	;TTY, ALT-MODE CHECK, SKIP RETURN IF ALT-MODE
	TTSIXB	;TTY, INPUT SIXBIT, UP TO SIX
	TTYINP	;TTY, IMAGE MODE INPUT
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 24
6.0	SUBROUTINE CALLS, REGISTERS, ETC. (CON'T)
	---------------------------------
6.1	SUBROUTINE CALLS (CON'T)
	----------------

	PNTA	;PRINT ASCII WORD
	PNTAF	;FORCED
	PNTAL	;PRINT ASCIZ LINE
	PNTALF
	PSIXL	;PRINT SIXBIT'Z LINE
	PSIXLF
	PNTMSG	;PRINT MESSAGE IMMEDIATE
	PNTMSF
	PSIXM	;PRINT SIXBIT'Z MESSAGE IMMEDIATE
	PSIXMF
	PNTCI	;PRINT CHARACTER IMMEDIATE
	PNTCIF
	PNTCHR	;PRINT LOWER 7 BITS OF AC0 AS ASCII CHAR
	PNTCHF
	PNT1	;PRINT ONE OCTAL DIGIT
	PNT1F
	PNT2	;PRINT TWO OCTAL DIGITS
	PNT2F
	PNT3	;PRINT THREE OCTAL DIGITS
	PNT3F
	PNT4	;PRINT FOUR OCTAL DIGITS
	PNT4F
	PNT5	;PRINT FIVE OCTAL DIGITS
	PNT5F
	PNT6	;PRINT SIX OCTAL DIGITS
	PNT6F
	PNT7	;PRINT SEVEN OCTAL DIGITS
	PNT7F
	PNT11	;PRINT 11(8) OCTAL DIGITS
	PNT11F
	PNTADR	;PRINT 22 BITS AS ADDRESS
	PNTADF
	PNTOCT	;PRINT FULL WORD OCTAL
	PNTOTF
	PNTHW	;PRINT OCTAL HALF WORDS, 6 SP 6
	PNTHWF
	PNTOCS	;PRINT OCTAL, SUPPRESS LEADING 0'S
	PNTOCF
	PNTDEC	;PRINT DECIMAL, SUPRESS LEADING 0'S
	PNTDCF
	PNTDS	;PRINT DECIMAL, SPACES FOR LEADING 0'S
	PNTDSF
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 25

6.0	SUBROUTINE CALLS, REGISTERS, ETC. (CON'T)
	---------------------------------
6.1	SUBROUTINE CALLS (CON'T)
	----------------

	PNTSIX	;PRINT SIXBIT WORD
	PNTSXF
	PNTCW	;PRINT DF10 CONTROL WORD
	PNTCWF
	PCRL	;PRINT CR/LF
	PCRLF
	PCRL2	;PRINT CR/LF TWICE
	PCRL2F
	PSP	;PRINT SPACE
	PSPF
	PBELL	;PRINT BELL
	PFORCE	;PRINT FORCE, CONTROL O OVERRIDE

	PNTNM	;PRINT PROGRAM NAME IF NOT STAND-ALONE

	DROPDV	;CLOSE LOGICAL FILE, USER MODE

	PNTMGN	;KI10 - PRINT MARGIN VALUE

	MAPMEM	;MAP MEMORY
	MEMZRO	;ZERO MEMORY
	MAPADR	;VIRTUAL TO PHYSICAL ADDRESS TRANSLATION
	MEMSEG	;SETUP MEMORY SEGMENT
	MAPCNK	;MAP MEMORY CHUNK
	MAPSET	;SETUP PAGE MAP (KL/KI)
	MAPPNT	;PRINT MEMORY MAP

	MODPCU	;CHANGE DEVICE CODES, OPERATOR
	MODPCP	;CHANGE DEVICE CODES, PROGRAM

	CLOKOP	;KL10 POWER LINE CLOCK CONTROL
	MTROP	;KL10 DK20 METER CLOCK CONTROL

	CINVAL	;KL10 CACHE INVALIDATE
	CFLUSH	;KL10 CACHE FLUSH
	CWRTBI	;KL10 WRITE-BACK & CACHE INVALIDATE

	FSELECT	;"DIAMON" FILE SELECTION
	FREAD	;"DIAMON" FILE READ - ASCII DATA
	FRD36	;"DIAMON" FILE READ - 36 BIT DATA
	FRD8	;"DIAMON" FILE READ - 8 BIT DATA

	ENDUUO	;END OF PROGRAM PASS

	EOPUUO	;END OF PROGRAM
					MAINDEC-10-DFQDA.TXT (SUBKL)
6.2	CONTROL REGISTERS, WORDS		PAGE 26
	------------------------

	USER =		USER/EXEC MODE FLAG, 0 = EXEC MODE
					    -1 = USER MODE

	KLFLG  =	PROCESSOR TYPE FLAG, 0 = KA10 OR KI10
					    -1 = KL10

	KAIFLG =	PROCESSOR TYPE FLAG, 0 = KA10
					    -1 = KI10

	CONSW =		CONSOLE SWITCH SETTINGS; CONSOLE SWITCHES IN 
			EXEC/NON-TTY USER MODE, TYPED IN SWITCHES IN
			TTY SWITCH INPUT USER MODE.

	PDISF =		PRINT DISABLED FLAG, INITIALLY SET TO 0,
			1 = EXCEEDED ALLOWED PRINTOUTS

	PNTENB =	PRINT ENABLE, INITIALLY SET TO -5000, INCREMENTED
			BY EACH CR PRINTED, WHEN 0 DISABLES NORMAL PRINTOUTS.

	PNTSPC =	PRINT SPACE CONTROL, 0 = DON'T PRINT A SPACE
			FOLLOWING OCTAL PRINTOUT, 1 = PRINT A SPACE
			FOLLOWING AN OCTAL PRINTOUT.

	PNTFLG =	PRINT FLAG, SET TO -1 WHILE IN PRINT ROUTINE.
			ZERO (0) OTHERWISE.

	PNTINH =	EXEC TTY ALLOW ^O FEATURE, 0 = ALLOW
						  -1 = INHIBIT PRINT INPUT TTY CHECKS

	TTYFIL =	EXEC TTY FILLERS FLAG, INITIALLY SET TO 0 TO ALLOW
			FILLERS.  IF -1 INHIBITS FILLERS FOR CR & LF.

	TTYSPD =	EXEC TTY BAUD RATE	EXEC FILLERS
			  0 = 110 BAUD		  NONE
			  1 = 150 BAUD		  NONE
			  2 = 300 BAUD		  CR = 9   LF = 0
			  3 = 600 BAUD		  CR = 1   LF = 1
			  4 = 1200 BAUD		  CR = 2   LF = 2
			  5 = 2400 BAUD		  CR = 4   LF = 4

	USRLFF =	USER MODE FILLERS FOR LF'S
	USRCRF =	USER MODE FILLERS FOR CR'S
			  NORMAL DEFAULT IS 0, NO FILLERS
			FOR FILLERS, SET TO NUMBER OF FILLERS DESIRED.
						LF'S	CR'S
				110 BAUD	0	0
				150 BAUD	0	0
				300 BAUD	0	9
				600 BAUD	1	1
				1200 BAUD	2	2
				2400 BAUD	4	4
					MAINDEC-10-DFQDA.TXT (SUBKL)
6.2	CONTROL REGISTERS, WORDS (CON'T)	PAGE 27
	------------------------

	TTNBRF =	TELETYPE NUMBER INPUT DIGIT TYPED FLAG.
			0 = TERMINATOR TYPED ONLY
			-1 = VALID DIGIT TYPED

	OPTIME =	TELETYPE TYPE-IN WAIT TIME, EXEC MODE, INITIALIZED
			AS NUMBER OF SECONDS OF WAIT TIME, 180 SEC.

	CNTLC =		ADDRESS USED BY "CONTROL C" TYPEIN DURING
			TTY INPUT OR PRINT OUTPUT (EXEC MODE).

	ALTMGO =	ADDRESS USED BY "ALT-MODE" TYPEIN DURING
			PRINT OUTPUT (EXEC MODE) (ALTGO DEFINED).

	$CRLF =		EXEC TTY FREE CRLF FLAG, 0 = FREE CRLF AFTER 72 CHARS
						-1 = INHIBIT FREE CRLF

	$TABF =		EXEC TTY TAB CONVERSION FLAG, 0 = CONVERT TO SPACES
						     -1 = INHIBIT

	$FFF =		EXEC TTY FORM FEED CONVERSION FLAG, 0 = CONVERT TO 8 LF'S
							   -1 = INHIBIT

	$VTF =		EXEC TTY VERTICAL TAB CONV FLAG, 0 = CONVERT TO 4 LF'S
							-1 = INHIBIT

	MAPNEW =	MEMORY MAPPING CONTROL FLAG
				0 = DIRECT ADDRESSING ONLY
			       -1 = 4096K KL10/KI10 PAGED OPERATIONS
			FLAG MUST BE SET TO -1 BEFORE "PGMINT" TO GET
			4096K KI10 MAPPING.  FLAG WILL BE ZERO'D IF DIRECT
			ADDRESSING ONLY CAN TAKE PLACE.

	MEMLOW =	LOWEST USABLE ADDRESS, EVEN BREAK ABOVE JOBFF

	MEMTOT =	TOTAL SIZE OF MEMORY IN K (1024.)

	MEMSIZ	=	TABLE OF MEMORY SEGMENT POINTERS

	DF22F =		DF10 CONTROL FLAG, SET/CLEARED BY USER
			 0 = 18 BIT DF10
			-1 = 22 BIT DF10

	A PUSH DOWN LIST IS PROVIDED OF 200(8) WORDS.
	PLIST =		PUSH DOWN LIST POINTER WORD;  PUSH AC (P) SET TO
			PLIST-PLISTE,PLIST.
	PLISTS =	PUSH DOWN LIST STORAGE
	PLISTE =	SIGNIFIES END OF PUSH DOWN LIST.
					MAINDEC-10-DFQDA.TXT (SUBKL)
6.3	SUBROUTINE MISC.			PAGE 28
	----------------

	ALL BASIC SUBROUTINES (SWITCH, TTI, PNT, ETC) EITHER ARE
	ENTERED WITH THE REQUIRED ARGUMENTS IN AC0 OR EXITED WITH THE
	REQUIRED RESULTS IN AC0.  ALL OTHER AC'S ARE MAINTAINED
	AS THEY WERE BEFORE THE SUBROUTINE.
	THE FOLLOWING MISCELLANEOUS PRINT CHARACTERS ARE INCLUDED
	TO FACILITATE PRINTING AND ARE CALLED AS FOLLOWS:

		MOVEI	NAME
		PNTA			;OR PNTAF

	CRLF, CRLF2, COMMA, PERIOD, SPACE, TAB, HYPEN(-), MINUS(-),
	AST(*), ATSIN(@), LFP(LEFT PARAN), RTP(RIGHT PARAN),
	PLUS(+), BELL, QUEST(?), SLASH(/), DOLLAR($).

6.4	SUBROUTINE FATAL HALTS
	----------------------

	THE FOLLOWING FATAL HALT ADDRESSES ARE USED TO REPORT TOTAL
	INOPERATION OF THE PDP-10 PROCESSOR.  IF ANY OF THESE HALTS
	HAPPEN YOU SHOULD THEN RUN MORE BASIC DIAGNOSTICS THAT DO NOT
	REQUIRE THE SUBROUTINE PROGRAM.

	ADDRESS	TAG	REASON
	------- ---     ------
	1010	NOEXEC	;PROGRAM NOT CODED FOR EXEC MODE OPERATION
	1011	PLERR	;FATAL PUSH LIST POINTER ERROR
	1012	PLERR1	;INITIAL PUSH LIST POINTER INCORRECT
	1013	MUOERR	;MUUO WITH LUUO HANDLER WIPED OUT
	1014	DTEBER	;DTE20 INTERRUPT WITHOUT DOORBELL
	1015	DTECER	;DTE20 CLOCK INTERRUPT WITHOUT FLAG SET
	1016	CPIERR	;CPU INITIALIZATION ERROR
	1017	EOPERR	;END OF PROGRAM ERROR
	1020	LUOERR	;INTERRUPT WITH LUUO HANDLER WIPED OUT

7.0	DIAGNOSTIC ERROR HANDLER

	THE PDP-10 DIAGNOSTIC ERROR UUO HANDLER IS DESIGNED AS A
	DIAGNOSTIC PROGRAM SUBROUTINE CAPABLE OF REPORTING A
	STANDARD BUT FLEXIBLE FORMAT OF TEST DATA AND DIAGNOSTIC
	INFORMATION.  THE ERROR HANDLER ALSO INTERPRETS AND
	CONTROLS TEST SWITCHES SUCH AS TYPEOUT SUPPRESSION,
	CONTINUE/HALT OR LOOP ON ERROR, AND BELL ON ERROR.

	TO PROVIDE PROGRAM COMPATABILITY, THE GIVEN FORMATS OF
	ERROR, ERLOOP AND REPTUO SHOULD BE USED.
	THIS WILL REDUCE THE AMOUNT OF SOURCE CODING REQUIRED AND
	PROVIDE A STANDARDIZED FORMAT.
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 29

7.1	GENERAL ERROR CALL FORMAT

	THE GENERAL ERROR CALL FORMAT SPECIFIES UP TO SEVEN ITEMS
	CONCERNING A TEST FAILURE.

	THEY ARE:

	1)  NAME OF THE MAJOR TEST SEQUENCE BEING EXECUTED

	2)  NAME OF THE FUNCTION BEING TESTED

	3)  ADDRESS OF THE CORRECT TEST DATA RESULTS.

	4)  ADDRESS OF THE ACTUAL TEST DATA RESULTS

	5)  DIAGNOSTIC COMMENT CONCERNING THE TEST FAILURE.

	6)  ADDITIONAL ERROR PRINT ROUTINE

	7)  ADDRESS TO TRANSFER TO ON ERROR LOOP

	THE INSTRUCTION AND CODE SEQUENCE SPECIFYING THESE SEVEN
	ITEMS IS EXPLAINED BELOW:

	ERUUO	X,LITADR	;LINE 1, ERROR CALL

	LITADR:	XWD	T,F	;LINE 2, TITLE AND FUNCTION
		XWD	C,A	;LINE 3, ADDR'S OF CORRECT AND ACTUAL TEST DATA
		XWD	D,PNT	;LINE 4, DIAGNOSTIC COMMENT & ADDITIONAL PRINT ROUTINE

	ERLOOP	ADR		;LINE 5, ERROR LOOP CONTROL

	LINE 1:	TRANSFERS TO THE ERROR HANDLER WITH X
		SPECIFYING THE FORMAT OF THE OCTAL TEST DATA:
		X=1  TYPE 1 DIGIT (RIGHTMOST OCTAL DIGIT)
		X=2  TYPE 2 DIGITS
		THRU
		X=12 TYPE 10 DIGITS
		X=13 TYPE 12 DIGITS AS 6 SPACE 6
		X=14 TYPE 12 DIGITS (NO SPACE)
		X=0  SAME AS X=14

	LINE 2:	LEFT HALF OF XWD WILL BE THE ADDRESS OF A
		SIXBTZ LITERAL SPECIFYING THE NAME OF THE MAJOR
		TEST SEQUENCE BEING EXECUTED.

		RIGHT HALF OF XWD WILL BE THE ADDRESS OF A SIXBTZ
		LITERAL SPECIFYING THE NAME OF THE FUNCTION BEING
		TESTED.
					MAINDEC-10-DFQDA.TXT (SUBKL)
(7.1 CONT'D)					PAGE 30

	LINE 3:	LEFT HALF OF XWD SPECIFIES THE ADDRESS OF THE
		CORRECT TEST DATA.

		RIGHT HALF OF XWD SPECIFIES THE ADDRESS OF THE ACTUAL
		TEST DATA.

	LINE 4:	LEFT HALF OF XWD WILL BE THE ADDRESS OF A SIXBTZ LITERAL
		CONTAINING THE DESIRED DIAGNOSTIC COMMENT.

		RIGHT HALF OF XWD WILL BE THE ADDRESS OF AN ADDITIONAL
		ERROR PRINT ROUTINE.

	LINE 5: TRANSFERS TO ERROR LOOP ROUTINE. TRANSFERS TO ADR FOR
	        SCOPE LOOP, CONTINUES IN-LINE IF LOOPING NOT DESIRED.

	THE TYPEOUT RESULTING FROM THE GENERAL ERROR CALL FORMAT
	(ASSUMING X=13) IS:

	TEST PASS COUNT = #
	PC=XXXXXX
	ERROR IN TITLE-FUNCTION
	CORRECT:   XXXXXX XXXXXX
	ACTUAL:    YYYYYY YYYYYY
	DISCREP:   ZZZZZZ ZZZZZZ
	DIAGNOSTIC COMMENT
	ADDITIONAL COMMENT

	PC IS THE ABSOLUTE ADDRESS OF THE ERROR CALL INSTRUCTION.

	DISCREP IS THE OCTAL DISCREPANCY BETWEEN THE CORRECT AND ACTUAL
	TEST DATA. (DISCREP IS THE XOR OF C AND A).

	A ZERO ENTRY FOR ANY ITEM IN THE GENERAL ERROR CALL FORMAT WILL
	SUPPRESS THE CORRESPONDING ITEM FROM TYPEOUT.  THIS REQUIRES
	THAT TEST DATA CAN NOT BE REPORTED FROM AC0.  THE DATA DISCREP-
	ANCY WILL BE TYPED ONLY IF BOTH CORRECT AND ACTUAL TEST DATA IS
	SPECIFIED.

	THE TITLE, FUNCTION, AND DIAGNOSTIC COMMENT PORTION OF THE
	ERROR TYPEOUT MAY BE INHIBITED BY SETTING THE 'TXTINH'
	SWITCH.  THIS ALLOWS FOR SHORTER PRINTOUTS ON REPETITIVE
	FAILURES.

	THE TEST PASS COUNT IS ONLY PRINTED ON ERRORS WHICH
	OCCUR WHEN THE PASS COUNTER IS NON-ZERO.
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 31

7.2	ERROR CALL FORMAT

	TO REDUCE THE AMOUNT OF SOURCE CODE REQUIRED TO GENERATE THE GENERAL
	ERROR CALL FORMAT, A MACRO CALL IS DEFINED WHICH ENABLES THE ITEMS
	TO BE SPECIFIED IN A CONDENSED FORMAT.  THIS SECTION EXPLAINS THE
	USE OF THE MACRO CALL THRU AN EXAMPLE FOLLOWED BY EXPLANATION.

	;EXAMPLE OF ERROR CALL MACRO FORMAT

	T= SIXBTZ <CHAN TERM TEST>
	C=10
	A=CHNWRD+1

	CHNTST:	MOVE	[XWD -1,BUFF-1]
		MOVEM	CHNWRD		;SET UP CW TO TRANSFER ONE WORD.
		SETZM	CHNWRD+1	;TERMINATE CHANNEL COMMAND LIST.
		MOVE	C,[XWD 0,BUFF+1]
		DATAO	X,Y		;INTIATE TRANSFER
		CONSO	X,DONE		;SKIP IF TRANSFER COMPLETE
		JUMPA	.-1
		CAME	C,CHNWRD+1	;SKIP IF O.K.

	MACROA:	ERROR	(CHNTST,13,C,A,CHAN STOP,CHAN TERM WORD INCORRECT)

		REPTUO	CHNTST		;REPEAT TEST SECTION

	CODE				;CONTINUATION OF PROGRAM
	  *
	  *

	;END OF EXAMPLE

	THE MACRO CALL:

	ERROR	(CHNTST,13,C,A,CHAN STOP,CHAN TERM WORD INCORRECT)

	WILL RESULT IN THE FOLLOWING ERROR REPORT:

	::::::::::::::::::::::::::::::::::::::::

	TEST PASS COUNT = #
	PC=XXXXXX
	ERROR IN CHAN TERM TEST-CHAN STOP
	CORRECT:  XXXXXX  XXXXXX
	ACTUAL:   YYYYYY  YYYYYY
	DISCREP:  ZZZZZZ  ZZZZZZ
	CHAN TERM WORD INCORRECT

	::::::::::::::::::::::::::::::::::::::::
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 32
(7.2 CONT'D)

	THE SYMBOL T MAY BE REDEFINED AS MANY TIMES AS A NEW TEST
	TITLE IS DESIRED.

	THE FOLLOWING MAY BE USED TO CONTROL TEST ITERATION AND
	LOOP ON ERROR.

	ERLOOP	S

	REPTUO	R

	S IS THE TAG TO BE JUMPED TO WHEN AN ERROR OCCURS AND THE
	SCOPE LOOP SWITCH (LOOPER) IS SET.

	R IS THE TAG TO BE JUMPED TO FOR TEST SECTION ITERATION.  USEFUL
	TO CHECK CRITICAL TIMING, ETC. C(REPTU) = NUMBER OF ITERATIONS.

	THE ERROR CALL ARGUMENTS ARE AS FOLLOWS:

	ERROR	ADR,X,C,A,F,D,ERR


	ADR IS THE ADDRESS TO TRANSFER TO FOR ERROR LOOPING

	C IS THE ADDRESS CONTAINING THE CORRECT DATA.

	A IS THE ADDRESS CONTAINING THE ACTUAL TEST DATA.

	TEST DATA MAY RESIDE IN AN AC (OTHER THAN ZERO), OR IN CORE MEMORY.

	ENTERING EITHER C OR A AS ZERO DELETES THE CORRESPONDING TYPEOUT.

	T MUST BE DEFINED BY THE STATEMENT:

	T= SIXBTZ <TEST NAME> WHERE TEST NAME IDENTIFIES THE MAJOR
	TEST SEQUENCE BEING EXECUTED.

	ERR IS THE ADDRESS OF AN ADDITIONAL ERROR PRINT ROUTINE.
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 33

7.3	CALLING THE ERROR MACRO

	THE FOLLOWING EXAMPLE ILLUSTRATES THE MACRO CALL FORMATS TO
	BE USED TO ACHIEVE VARIOUS COMBINATIONS OF TEST FAILURE DATA.

	A.	FULL ERROR FORMAT  (ASSUME T ALREADY DEFINED)

		ERROR	(ADR,14,C,A,FUNCTION,DIAG. COMMENT)

		RESULTING TYPEOUT

		TEST PASS COUNT =
		PC=
		ERROR IN TEST NAME-FUNCTION
		CORRECT:
		ACTUAL:
		DISCREP:
		DIAG. COMMENT

	B.	NO DIAGNOSTIC COMMENT

		ERROR	(ADR,14,C,A,FUNCTION,)

		RESULTING TYPEOUT

		TEST PASS COUNT =
		PC=
		ERROR IN TEST NAME-FUNCTION
		CORRECT:
		ACTUAL:
		DISCREP:

	C.	NO FUNCTION

		ERROR	(ADR,13,C,A,,DIAG. COMMENT)

		RESULTING TYPEOUT

		TEST PASS COUNT =
		PC=
		ERROR IN TEST NAME-
		CORRECT:
		ACTUAL:
		DISCREP:
		DIAG. COMMENT
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 34

	D.	NO FUNCTION, NO DIAGNOSTIC COMMENT

		ERROR	(ADR,13,C,A,,)

		RESULTING TYPEOUT

		TEST PASS COUNT =
		PC=
		ERROR IN TEST NAME-
		CORRECT:
		ACTUAL:
		DISCREP:

	E.	MULTILINED DIAGNOSTIC COMMENT AND/OR COMMENTS
		CONTAINING DELIMITING CODES.

		ERROR	(ADR,6,C,A,FUNCTION,<DIAG. COMMENT^CONTAINING MULTIPLE LINES,^OR DELIMITING CODES (, OR ; . >)

		RESULTING TYPEOUT

		TEST PASS COUNT =
		PC=
		ERROR IN TEST NAME-FUNCTION
		CORRECT:
		ACTUAL:
		DISCREP:
		DIAGNOSTIC COMMENT
		CONTAINING MULTIPLE LINES,
		OR DELIMITING CODES (, OR ; .
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 35
7.4	ERROR HANDLER SWITCH CONTROL

	THE ERROR HANDLER INTERPRETS SWITCHES 3, 5, 6, 7, 8 AND 10 IN THE
	FOLLOWING MANNER.

	SWITCH 3:  0 NO FUNCTION
		   1 BYPASS ERROR REPORT SEQUENCE. TEST
		     SWITCHES 5,6 & 7.

	SWITCH 5:  0 NO FUNCTION
		   1 RING TTY BELL ON ERROR

	SWITCH 6:  0 PROCEED TO NEXT TEST WHEN ERROR IS DETECTED (SET SCOPE TO ZERO).
		   1 ENTER SCOPE LOOP ON FAILING TEST (SET SCOPE TO -1).

	SWITCH 7:  0 NO FUNCTION
		   1 HALT ON ERROR AFTER REPORTING ERROR (EXEC MODE),
		     RESUME NORMAL SEQUENCE BY PRESSING 'CONTINUE'.
		     IN USER MODE, THIS SWITCH CAUSES A CALL AC,EXIT
		     TO BE EXECUTED. NORMAL TEST SEQUENCE MAY BE RESUMED
		     BY TYPING .CONT.

	SWITCH 8:  0 PRINT ONLY FIRST ERROR WHEN ERRORS OCCUR AT
		     SAME PC. (PER PASS)
		   1 PRINT ALL ERRORS, EVEN IF LOOPING AND SAME
		     ERROR OCCURS.

	SWITCH 10: 0 PRINT FULL ERROR MESSAGES.
		   1 INHIBIT COMMENT PORTION OF ERROR MESSAGES.
					MAINDEC-10-DFQDA.TXT (SUBKL)
						PAGE 36

7.5	ERROR HANDLER BLOCK FLOW

	ERUUO X,LITADR***>%ERUUO: (TYPE ERROR REPORT?)
			*
			*
			*
		GET <ADDRESS> OF ERROR CALL
		GO TO %ERSW1 IF<ADDRESS>=(ERRPC)
		IF NOT, TEST SWITCH 3. IF SWITCH 3
		IS SET GO TO %ERSW1.
		IF NOT, STORE <ADDRESS> IN ERRPC AND
		REPORT TEST ERROR DATA.
			*
			*
			*
		%ERSW1: (HALT ON ERROR?)
			*
			*
		GO TO %ERSW2 IF DATA SWITCH 7=0
		IF EXEC MODE AND SWITCH 7=1, RESTORE 
		ORIGINAL AC CONTENTS AND EXECUTE
		HALT, (PRESS 'CONT' TO CONTINUE FROM ERROR).
		IF USER MODE AND SWITCH 7=1, EXECUTE
		CALL 1, (EXIT), (TYPE CONT TO CONTINUE
		FROM ERROR).
			*
			*
			*
		%ERSW2: (SCOPE LOOP ON ERROR?)
		IF SWITCH 6=0, SET SCOPE TO ZERO.  GO TO
		%ERSW3
		IF SWITCH 6=1, SET SCOPE TO -1, ADD
		ONE TO %ERCNT.  IF EXEC MODE, DISPLAY
		ERROR PC, ERROR COUNT IN MI LIGHTS.  GO TO %ERSW3.
			*
			*
			*
		%ERSW3: (RING BELL ON ERROR?)
		IF SWITCH 5=0, GO TO %EXCAL
		IF SWITCH 5=1, OUTPUT BELL CHAR.  GO TO %EXCAL
			*
			*
			*
		%EXCAL: (EXIT FROM ERROR CALL)
		RESTORE SAVED AC'S
		RETURN TO <ADDRESS+1> OF ERROR CALL.
					MAINDEC-10-DFQDA.TXT (SUBKL)
	     					PAGE 37

7.6	ERROR HANDLER DIAGNOSTICS

	IF THE X ARGUMENT IN THE (ERUUO X,LITADR) IS NOT 0 THRU 14, THE
	FOLLOWING MESSAGE IS TYPED AND A HALT (EXIT) IS EXECUTED.

	FATAL PROGRAM ERROR AT ######

	(###### POINTS TO ERROR HANDLER)

	PROGRAM EXECUTION SHOULD NOT BE CONTINUED UNTIL PROBLEM
	HAS BEEN CORRECTED.

8.0  SUBROUTINE PACKAGE INSTRUCTIONS
     -------------------------------

8.1  SUBROUTINE PACKAGE DISTRIBUTION
     -------------------------------

     THE PARAM, FIXED & STOR FILES ARE SUPPLIED AS ASCII SOURCE FILES
     WHICH SHOULD BE ASSEMBLED WITH THE MAIN PROGRAM SOURCE FILE.

	THE DECSYSTEM10 SUBROUTINE PROGRAM LOAD MODULE IS SUPPLIED
    TO BE USED WITH THE DIAGNOSTIC SEGMENT LOAD MODULES
    TO PROVIDE RUN TIME SUBROUTINE SUPPORT.

	THE SUBROUTINE PACKAGE SHOULD BE USED AS A STANDARD
    SUBROUTINE SET AND ANY CORRECTIONS OR IMPROVEMENTS TO IT
    SHOULD BE CLEARED WITH THE  DIGITAL EQUIPMENT CORP. DIAGNOSTIC
    ENGINEERING GROUP.

9.0  MISCELLANEOUS
     -------------

10.0  SOURCE FILE LISTINGS
     --------------------