PCjs Machines

Home of the original IBM PC emulator for browsers.

Logo

DEC PDP-10 KA10 Basic Instruction Diagnostic #13

The PDP-10 KA10 Basic Instruction Diagnostic #13 (MAINDEC-10-DAKAM) test code has been extracted from DAKAMM.MAC [original] and DAKAMT.MAC [original] for use with the PDP-10 Test Machine with Debugger below.

This diagnostic “TESTS THE BYTE, BLOCK TRANSFER AND JFFO INSTRUCTIONS.”

Information regarding this diagnostic includes:

[PCjs Machine "testka10"]

Waiting for machine "testka10" to load....

The Debugger’s assemble (“a”) command can be used to test the new built-in MACRO-10 Mini-Assembler, which supports a subset of the MACRO-10 assembly language.

This command:

a DAKAM.MAC

will automatically read the DAKAM.MAC source file (a slightly modified copy of DAKAMM.MAC), assemble it, and then load the binary image at the location specified in the file.


DAKAM.TXT

MAINDEC-10-DAKAM.TXT






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

	PRODUCT CODE:   MAINDEC-10-DAKAM-B-D

	PRODUCT NAME:   DECSYSTEM10 PDP-10 KA10 BASIC
	                INSTRUCTION DIAGNOSTIC (13)

	FUNCTION:       BYTE, BLT, JFFO

	VERSION:        0.2

	DATE RELEASED:  JANUARY 1977

	MAINTAINED BY:  DIAGNOSTIC ENGINEERING GROUP

	AUTHOR:         JOHN R. KIRCHOFF

COPYRIGHT(C) 1976,1977
DIGITAL EQUIPMENT CORPORATION
MARLBORO, MASS. 01752

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 EXECPT 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 DEC.

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

DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

							MAINDEC-10-DAKAM.TXT
							PAGE 2

			TABLE OF CONTENTS
			-----------------

1.0	ABSTRACT

2.0	REQUIREMENTS

2.1	EQUIPMENT

2.2	STORAGE

2.3	PRELIMINARY PROGRAMS

3.0	PROGRAM PROCEDURES

3.1	LOADING PROCEDURE

3.2	STARTING PROCEDURE

3.3	OPERATING PROCEDURE

4.0	DATA SWITCH FUNCTIONS

5.0	ERRORS

6.0	ITERATION COUNTER

7.0	CYCLE TIME

8.0	OPERATIONAL VARIATIONS

9.0	MISCELLANEOUS

10.0	LISTING

							MAINDEC-10-DAKAM.TXT
							PAGE 3

1.0	ABSTRACT

	THIS PDP-10 KA10 BASIC INSTRUCTION DIAGNOSTIC IS THE
	THIRTEENTH IN A SERIES OF PDP-10 KA10 PROCESSOR DIAGNOSTICS.
	THE DIAGNOSTIC TESTS THE BYTE, BLOCK TRANSFER AND
	JFFO INSTRUCTIONS.

2.0	REQUIREMENTS

2.1	EQUIPMENT

	A PDP-10 KA10 EQUIPPED WITH A MINIMUM OF 32K OF MEMORY

	PAPER TAPE READER 
	CONSOLE TELETYPE
	DECTAPE
	LINE PRINTER (OPTIONAL)

2.2	STORAGE

	THE PROGRAM RUNS WITHIN 32K OF MEMORY.

2.3	PRELIMINARY PROGRAMS

	PREVIOUS PROCESSOR DIAGNOSTICS

3.0	PROGRAM PROCEDURES

3.1	LOADING PROCEDURE

	THIS DIAGNOSTIC REQUIRES THAT THE DECSYSTEM10 SUBROUTINE
	PROGRAM BE RESIDENT IN THE PDP-10.

	PAPER TAPE - HARDWARE READ-IN (READER DEVICE CODE 104)
	DECTAPE - LOAD WITH DIAMON (DECTAPE DEVICE CODE 320)
	TIME SHARING - RUN UNDER DIAMON.
	
							MAINDEC-10-DAKAM.TXT
							PAGE 4

3.2	STARTING PROCEDURE

	A.  SELECT OPERATIONAL CONSOLE DATA SWITCH SETTINGS (REFER TO
	    4.0 DATA SWITCH FUNCTIONS).

	B.  EXEC MODE

	    STAND-ALONE STARTING ADDRESS IS 30000.

	C.  USER MODE

	    RUN UNDER "DIAMON".
	    IN USER MODE THE FOLLOWING QUESTIONS WILL BE ASKED TO 
	    SELECT THE OPERATIONAL SWITCHES:

		    TELETYPE SWITCH CONTROL ? 0,S,Y OR N (CR) -

		    IF THE OPERATOR TYPES "N", THE ACTUAL CONSOLE
		    SWITCHES ARE USED.

		    IF THE OPERATOR TYPES "Y", THE FOLLOWING QUESTIONS
		    ARE ASKED AND THE OPERATOR RESPONDS BY TYPING
		    THE ANSWER AS SIX OCTAL DIGITS REPRESENTING
		    THE DESIRED SWITCH SETTINGS.

		    SPECIFY LH SWITCHES IN OCTAL-

		    SPECIFY RH SWITCHES IN OCTAL-

		    IF THE OPERATOR TYPES "0", ZERO'S ARE USED FOR
		    THE SWITCH SETTINGS.

		    IF THE OPERATOR TYPES "S", PREVIOUSLY SET SWITCHES
		    ARE USED.  THIS IS ONLY VALID UPON RESTARTING
		    OF AN INTERRUPTED PROGRAM.
		    
							MAINDEC-10-DAKAM.TXT
							PAGE 5

3.3	OPERATING PROCEDURE

	A.  TO THROUGHLY TEST ALL HARDWARE, ALL TEST CONTROL DATA 
	    SWITCHES SHOULD BE SET TO 0.

	B.  WHEN DEBUGGING HARDWARE, SET SWITCHES TO 0.  ALLOW THE 
	    TELETYPE TO PRINT THE ERROR MESSAGES.  THIS ALLOWS THE 
	    PROGRAM TO RUN A COMPLETE PASS AND THEN THE ERROR MESSAGES
	    MAY BE CORRELATED TO QUICKLY DIAGNOSE THE FAILURE.  IF A
	    HARDWARE PROBLEM IS SUCH THAT THE ERROR MESSAGES, AFTER THE
	    FIRST ONE, HAVE NO MEANING (FIRST ERROR CAUSES ALL FOLLOWING
	    TESTS TO FAIL) SET THE LOOP ON ERROR SWITCH AND RESTART THE
	    TEST FROM THE BEGINNING.  THE FIRST FAILURE WILL THEN CAUSE
	    THE PROGRAM TO ENTER A LOOP SUITABLE FOR SCOPING.

	    THE ERROR MESSAGE USED IN CONJUNCTION WITH THE LISTING AND
	    SCOPING IF NECESSARY SHOULD ALLOW THE FAILING CONPONENT 
	    TO BE ISOLATED AND REPLACED AND/OR REPAIRED.

	C.  WHEN TAKING MARGINS, SET DATA SWITCHES 'NOPNT' AND 'DING'.
	    THIS WILL INHIBIT PRINTOUT BUT WILL ALLOW THE TELETYPE
	    BELL TO BE RUNG WHEN A ERROR OCCURS.  IF THE MARGIN OBTAINED
	    IS UNACCEPTABLE, THE OPERATOR MAY REVERT TO STANDARD SWITCH
	    SETTINGS FOR DEBUGGING PURPOSES.

	D.  ERROR INFORMATION MAY BE OBTAINED QUICKLY BY PRINTING 
	    ERRORS ON THE LINE PRINTER.

	E.  IN THE EVENT OF A PRINT ROUTINE FAILURE THE 'NOPNT' SWITCH
	    AND THE 'ERSTOP' SWITCH MAY BE SET TO INHIBIT PRINTOUT 
	    BUT HALT THE PROGRAM POINTING TO THE ERROR.

							MAINDEC-10-DAKAM.TXT
							PAGE 6

4.0	DATA SWITCH FUNCTIONS

	SWITCH		STATE	FUNCTION
	------		-----	--------

	0    ABORT	0	NORMAL OPERATION
			1	ABORT AT END OF PASS

	1    RSTART		NOT USED

	2    TOTALS		NOT USED

	3    NOPNT	0	NORMAL TYPEOUT
			1	INHIBIT ALL PRINT/TYPEOUT
				(EXCEPT FORCED)

	4    PNTLPT	0	NORMAL OUTPUT TO TTY
			1	PRINT ALL DATA ON LPT
				(LOGICAL DEVICE, USER MODE)

	5    DING	0	NO FUNCTION
			1	RING TTY BELL ON ERROR

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

	7    ERSTOP	0	NO FUNCTION
			1	HALT ON TEST ERROR

	8    PALERS	0	PRINT ONLY FIRST ERROR WHEN LOOPING
			1	PRINT ALL ERRORS, EVEN IF SAME ERROR

	9    RELIAB		NOT USED

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

	11   INHPAG	0	ALLOW PAGING AND TRAP ENABLE
			1	INHIBIT PAGING AND TRAPPING

	12   MODDVC		NOT USED

	13   INHCSH		NOT USED
	
							MAINDEC-10-DAKAM.TXT
							PAGE 7

5.0	ERRORS

	ERRORS ARE PRINTED ON THE TTY OR LINE PRINTER.  THE ERROR 
	PRINTOUT CONTAINS THE TEST TITLE, THE PC OF THE FAILURE, ERROR
	NUMBER AND THE CONTENTS OF AN APPLICABLE AC.

	THE PC VALUE IS USEFUL IN RELATING THE FAILURE TO THE LISTING.
	THE ERROR NUMBER IS PROVIDED SUCH THAT AN ERROR DICTIONARY MAY
	BE MADE AT SOME FUTURE DATE.

	WHEN THE SCOPE LOOP MODE IS USED THE MI REGISTER WILL COUNT 
	FOR EACH OCCURANCE OF AN ERROR.  IF AN AUDIO INDICATION OF
	A CONTINUING ERROR IS DESIRED THE 'DING' SWITCH MAY BE SET.

6.0	ITERATION COUNTER

	THE ITERATION COUNT OF THE PROGRAM IS DISPLAYED IN THE MEMORY
	INDICATORS (MI).  THIS COUNT IS A DECREMENTING COUNT AND 
	INITIALLY STARTS AT -1 IN STAND-ALONE OPERATION.

7.0	CYCLE TIME

	THE CYCLE TIME OF THE PROGRAM IS IN THE MILLISECOND RANGE AND
	IS THEREFORE SUITABLE FOR TAKING MARGINS, VIBRATION TESTS,
	ETC.
	
							MAINDEC-10-DAKAM.TXT
							PAGE 8

8.0	OPERATIONAL VARIATIONS

	A.  DIAGNOSTIC MONITOR

	    THE PROGRAM IS USABLE WITH THE DIAGNOSTIC MONITOR TO PROVIDE
	    RELIABILITY TESTS, ACCEPTANCE TESTS, AND/OR TO PROVIDE A
	    QUICK METHOD OF ISOLATION OF A FAULT TO A PARTICULAR AREA
	    OF THE PROCESSOR.  CERTAIN PROCEDURES ARE USED WHEN THE
	    PROGRAM IS USED IN THIS MANNER.  THEY ARE:

	    1.	THE DIAGNOSTIC MONITOR TRANSFERS CONTROL TO THE PROGRAM
		AND STARTS IT AT LOCATION 30002.

	    2.	MONCTL - LOCATION 30043 IS USED AS THE DIAGNOSTIC MONITOR
		CONTROL WORD.
			LH = 0, STAND-ALONE OPERATION
			    -1, RUNNING UNDER DIAGNOSTIC MONITOR

			RH = RIGHT HALF OF CONSOLE SWITCHES IF UNDER
			     DIAGNOSTIC MONITOR CONTROL.

	B.  USER MODE

	    TO OUTPUT THE PRINTED ERROR MESSAGES TO A USER SPECIFIED
	    DEVICE IN USER MODE, ASSIGN THE DESIRED OUTPUT DEVICE TO
	    DEVICE NAME 'DEV' AND SET SWITCH 'PNTLPT'.  THE PHYSICAL
	    DEVICE USED CAN BE ANY DEVICE THAT CAN ACCEPT ASCII OUTPUT
	    FORMAT SUCH AS LPT, DSK, DTA, ETC.  THE CORRESPONDING 
	    OUTPUT FILE IS 'DAKAM.TMP'

	    EXAMPLE DEVICE ASSIGNMENT:

	    .ASSIGN DSK DEV

	    IN USER MODE THE PROGRAM WILL MAKE 1000(8) PASSES AND THEN
	    RETURN TO DIAMON COMMAND MODE.
	    
							MAINDEC-10-DAKAM.TXT
							PAGE 9

8.0	OPERATIONAL VARIATIONS (CON'T)

	THE OUTPUT FILE (IF USED) MAY THEN BE LISTED BY USING THE
	NORMAL MONITOR COMMANDS (PRINT, LIST, TYPE, PIP, ETC.).

	IF THE PROGRAM IS ABORTED BEFORE COMPLETION (BY ^C, ETC.) THE
	OUTPUT FILE MAY BE CLOSED BY USING THE MONITOR 'REENTER' 
	COMMAND.

	C.  SYSTEM EXERCISER

	    START ADDRESS IS 30003.  DATA SWITCHES ARE PRESTORED IN
	    'SWTEXR' LOC 30023.

9.0	MISCELLANEOUS

	THE NON-EX-MEMORY AND PARITY STOP SWITCHES SHOULD BE RESET 
	(0).  THESE ERRORS, ILLEGAL UUO'S AND OTHER ERRORS OF THIS
	TYPE ARE HANDLED BY PRINTOUT ON THE TELETYPE.

10.0	LISTING

DAKAM.HST

THIS IS A HISTORY OF THE DEVELOPMENT OF MAINDEC-10-DAKAM

************************************************************************

PRODUCT CODE:       MAINDEC-10-DAKAM

PRODUCT NAME:       BASIC INSTRUCTION DIAGNOSTIC #13

DATE RELEASED:      JANUARY 1977

VERSION:            0.2

UPDATE AUTHOR:      JOHN R. KIRCHOFF

CHANGES MADE:

    1. UPGRADE TO ALLOW COMPATABILITY WITH THE SUBROUTINE PACKAGE.

    2. ADD TEST FOR BLT WITH EFFECTIVE ADDRESS LESS THAN CONTENTS OF
        AC RIGHT.

************************************************************************

ORIGINAL VERSION:   0.1

ORIGINAL AUTHOR:    RICHARD MALISKA

ORIGINAL RELEASE:   16-MAR-72

************************************************************************

DAKAM.MAC

[Download]

;DAKAM


	MCNVER==0
	DECVER==2


	XLIST
DEFINE	NAME	(MCNVER,DECVER)<

TITLE	DAKAM PDP-10 KA10 BASIC INSTRUCTION DIAGNOSTIC (13) MCNVER,DECVER
>
	LIST
	LALL

	NAME	\MCNVER,\DECVER

;(BYTE, BLOCK TRANSFER, JFFO AND OTHER BASIC MISCELLANEOUS INSTRUCTIONS)

;COPYRIGHT 1975,1977
;DIGITAL EQUIPMENT CORPORATION
;MARLBORO, MASS. 01752

;JOHN R. KIRCHOFF

	LOC	137
	MCNVER,,DECVER

	NOSYM
SUBTTL	DIAGNOSTIC PARAMETERS

;OPERATOR DEFINITIONS

OPDEF	ER1	[1B8]
OPDEF	ER2	[2B8]
OPDEF	ER3	[3B8]
OPDEF	ER4	[4B8]
OPDEF	ER5	[5B8]
OPDEF	ER6	[6B8]
OPDEF	ER7	[7B8]
OPDEF	ER10	[10B8]
OPDEF	ER11	[11B8]
OPDEF	ER12	[12B8]
OPDEF	ER13	[13B8]

LUUO1=ERRMES
LUUO2=ERRMES
LUUO3=ERRMES
LUUO4=ERRMES
LUUO5=ERRMES
LUUO6=ERRMES
LUUO7=ERRMES
LUUO10=ERRMES
LUUO11=ERRMES
LUUO12=ERRMES
LUUO13=ERRMES
;SUBROUTINE ASSEMBLY DEFINITIONS

DEBUG=40
EXCASB=1
USRASB=1
KA10=1
PGMEND=1
ERDIAG=1

;SPECIAL FEATURE DEFINITIONS

SADR1=BEGIN
SADR2=BEGIN
SADR3=BEGIN
SADR4=BEGIN
SADR5=JRST BEGIN
SADR6=JRST BEGIN
SADR7=JRST BEGIN
SADR8=JRST BEGIN
SADR9=JRST BEGIN
SADR10=JRST BEGIN
SADR11=JRST BEGIN

;SPECIAL FEATURE PARAMETERS

PAREA0=0
PAREA1=0
PAREA2=0
PAREA3=SIXBIT/DAKAM/
PAREA4=SIXBIT/TMP/
PAREA5=0
PAREA6=0
ITERAT==1000

;MACROS

DEFINE	SAVEAC	(A,B)<
	MOVEI	AC+2,.		;SAVE TEST PC
	MOVEM	AC+2,TESTPC
	MOVEI	AC+2,<AC+2>&17	;INFORM ERROR ROUTINE WHICH
	MOVEM	AC+2,ERRLOP#	;AC IS USED FOR ITERATION>
;SPECIAL INSTRUCTIONS TO ASSEMBLER

IF1,<BYTBLK=14773>	;BYTBLK BEYOND AC RANGE FOR PASS 1
IF1,<BLTBLK=15000>	;BLTBLK BEYOND AC RANGE FOR PASS 1

;MACROS

DEFINE	GMOV	(X1,DATA),<
	IFLE	<X1-20>,<
	MOVE	X1,[DATA]	;PRELOAD X1 WITH DATA>
	IFG	<X1-20>,<
	MOVE	AC+1,[DATA]
	MOVEM	AC+1,X1		;PRELOAD X1 WITH DATA>>

DEFINE	GCAM	(X1,DATA),<
SN=SN+1
	IFG	<X1-20>,<
	MOVE	AC-1,X1
	CAME	AC-1,[DATA]	;IS C(X1) = DATA
	IFIDN	<DEST>,<X1>,<
	ER2	AC-1,SN		;DEST NOT LOADED CORRECTLY>
	IFDIF	<DEST>,<X1>,<
	ER2	AC-1,SN		;C(X1) WAS CLOBBERED>>
	IFLE	<X1-20>,<
	CAME	X1,[DATA]	;IS C(X1) = DATA
	IFIDN	<DEST>,<X1>,<
	ER2	X1,SN		;DEST NOT LOADED CORRECTLY>
	IFDIF	<DEST>,<X1>,<
	ER2	X1,SN		;C(X1) WAS CLOBBERED>>>
DEFINE	BLTM1	(A1,C1,S1,D1,SC)<
;VERIFY THAT BLT WILL TRANSFER A 1 WORD BLOCK OF DATA
;WHERE SOURCE AND DESTINATION ARE DIFFERENT
;SOURCE DATA = SC

	AC=C1
	SAVEAC	(1,1)
SN=A1
	SRCE=S1			;1ST LOC OF SOURCE = S1
	DEST=D1			;1ST LOC OF DESTINATION = D1
	SIZ=1			;BLOCK SIZE = 1 WORD

G'A1:	MOVE	AC,[SRCE,,DEST]	;LOAD BLT AC
	GMOV	(SRCE-1,<252525252525>)
	GMOV	(SRCE,<SC>)
	GMOV	(SRCE+1,<770077007700>)
	GMOV	(DEST-1,<070707070707>)
	GMOV	(DEST,<123456765432>)
	GMOV	(DEST+1,<552255225522>)
	BLT	AC,DEST+SIZ-1	;*BLOCK TRANSFER
	GCAM	(SRCE-1,<252525252525>)
	GCAM	(SRCE,<SC>)
	GCAM	(SRCE+1,<770077007700>)
	GCAM	(DEST-1,<070707070707>)
	GCAM	(DEST,<SC>)
	GCAM	(DEST+1,<552255225522>)
	JUMPL	AC+2,G'A1		;LOOP ON ERROR>

SUBTTL	*PARAM*	CONSOLE DATA SWITCH ASSIGNMENTS, SEPT 18,1979

DEFINE	S,<; *********************************************************************>

; **********************************************************************
;*DATA SWITCHES (READ FROM CONSOLE IN EXEC MODE OR TYPED IN IN USER MODE)
;*LEFT HALF SWITCHES ARE PRE-ASSIGNED FOR SUBROUTINE PACKAGE USE
;*AND CONTROL LOOPING, PRINTING (TTY OR OTHER DEVICE) AND MISC. FUNCTIONS
; **********************************************************************

ABORT==	400000			;ABORT PROGRAM ON PASS COMPLETION
RSTART==200000			;RESTART TEST, PRINT TOTALS
TOTALS==100000			;PRINT TOTALS, CONTINUE

NOPNT==	040000			;INHIBIT ALL PRINT/TYPE OUT (EXCEPT FORCED)
PNTLPT==020000			;PRINT ALL DATA ON LPT (LOGICAL DEVICE, USER MODE)
DING==	010000			;RING BELL ON ERROR

LOOPER==004000			;ENTER EXERCISE/CHECK LOOP ON ERROR
ERSTOP==002000			;HALT ON TEST ERROR
PALERS==001000			;PRINT ALL ERRORS

RELIAB==000400			;RELIABILITY MODE
TXTINH==000200			;INHIBIT ERROR TEXT
INHPAG==000100			;INHIBIT PAGING

MODDVC==000040			;MODIFY DEVICE CODE
INHCSH==000020			;INHIBIT CACHE
OPRSEL==000010			;OPERATOR SELECTION

CHAIN==	000004			;CHAIN CONTROL SWITCH

KAHZ50==000002			;KA10 50 HERTZ POWER

				;SWITCH 17 RESERVED !!!
SUBTTL	*PARAM* PROGRAM/SUBROUTINE PARAMETERS, SEPT 18,1979

; **********************************************************************
;*SPECIAL SUBPROGRAM LINKAGES
; **********************************************************************

FSELNK=	27772	;FILE SELECT LINK
FRDLNK=	27773	;FILE READ LINK
LDLNK=	27774	;LOAD LINKAGE ADDRESS
DDTLNK=	27775	;DDT LINKAGE ADDRESS
MODLNK=	27776	;OPERATIONAL MODE CHECK LINKAGE ADDRESS
SUBLNK=	27777	;SUBROUTINE LINKAGE ADDRESS

; **********************************************************************
;*SPECIAL SUBROUTINE FATAL HALTS
;*USED TO REPORT ERRORS THAT CAUSE THE SUBROUTINES TO BE UNUSABLE
; **********************************************************************

;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 ERROR
; 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

; **********************************************************************
; **********************************************************************
;OPERATOR DEFINITIONS (NON-UUO'S)
; **********************************************************************

OPDEF	GO	[PUSHJ	P,]	;SUBROUTINE CALL
OPDEF	RTN	[POPJ	P,]	;SUBROUTINE RETURN
OPDEF	PUT	[PUSH	P,]	;PUT DATA ON PUSH LIST
OPDEF	GET	[POP	P,]	;GET DATA FROM PUSH LIST
OPDEF	PJRST	[JRST	]	;JRST TO ROUTINE THAT RTN'S
OPDEF	HALT	[JRST	4,]	;DEFINITION FOR DDT
OPDEF	JRSTF	[JRST	2,]	;DEFINITION FOR DDT
OPDEF	JEN	[JRST	12,]	;DEFINITION FOR DDT

; **********************************************************************
;SUBROUTINE INITIALIZATION CALL
; **********************************************************************

OPDEF	PGMINT	[JSP	0,SBINIT]	;SUBROUTINE INITIALIZATION

; **********************************************************************
;HALTING UUO'S (A MORE GRACEFUL HALT THAN SIMPLY USING THE HALT INSTRUCTION).
; **********************************************************************

OPDEF	FATAL	[37B8!15B12!4]	;FATAL PROGRAMMING HALT
OPDEF	ERRHLT	[37B8!14B12!4]	;PROGRAM ERROR HALT

; **********************************************************************
;TERMINAL INPUT UUO'S
;ALWAYS COME FROM THE CONSOLE TERMINAL IN EXEC MODE OR THE
;CONTROLLING TERMINAL (REAL TERMINAL OR PTY) IN USER MODE.
; **********************************************************************

OPDEF	TTICHR 	[37B8!0B12!3]	;TTY, INPUT ANY CHARACTER
OPDEF	TTIYES	[37B8!1B12!3]	;TTY, NORMAL RETURN Y
OPDEF	TTINO	[37B8!2B12!3]	;TTY, NORMAL RETURN N
OPDEF	TTIOCT	[37B8!3B12!3]	;TTY, INPUT OCTAL WORD
OPDEF	TTIDEC	[37B8!4B12!3]	;TTY, INPUT DECIMAL WORD
OPDEF	TTICNV	[37B8!5B12!3]	;TTY, INPUT CONVERTABLE WORD
OPDEF	TTLOOK	[37B8!6B12!3]	;TTY, KEYBOARD CHECK
OPDEF	TTALTM	[37B8!7B12!3]	;TTY, ALT-MODE CHECK
OPDEF	TTSIXB	[37B8!10B12!3]	;TTY, INPUT SIXBIT WORD
OPDEF	TTYINP	[37B8!11B12!3]	;TTY, IMAGE MODE INPUT
OPDEF	TTICLR	[37B8!12B12!3]	;TTY, CLEAR INPUT
;TERMINAL OUTPUT UUO'S.

OPDEF	PNTA	[37B8!0B12!0]	;PRINT ASCII WORD
OPDEF	PNTAF	[37B8!0B12!1]	;PRINT ASCII WORD FORCED
OPDEF	PNTAL	[37B8!17B12!0]	;PRINT ASCIZ LINE
OPDEF	PNTALF	[37B8!17B12!1]	;PRINT ASCIZ LINE FORCED
OPDEF	PSIXL	[37B8!14B12!3]	;PRINT SIXBIT'Z LINE
OPDEF	PSIXLF	[37B8!15B12!3]	;PRINT SIXBIT'Z LINE FORCED
OPDEF	PNTMSG	[37B8!0B12!0]	;PRINT MESSAGE IMMEDIATE
OPDEF	PNTMSF	[37B8!1B12!0]	;PRINT MESSAGE IMMEDIATE FORCED
OPDEF	PSIXM	[37B8!2B12!0]	;PRINT SIXBIT'Z MSG IMMEDIATE
OPDEF	PSIXMF	[37B8!4B12!0]	;PRINT SIXBIT'Z MSG IMM FORCED
OPDEF	PNTCI	[37B8!0B12!0]	;PRINT CHARACTER IMMEDIATE
OPDEF	PNTCIF	[37B8!1B12!0]	;PRINT CHARACTER IMMEDIATE FORCED
OPDEF	PNTCHR	[37B8!12B12!0]	;PRINT CHARACTER
OPDEF	PNTCHF	[37B8!12B12!1]	;PRINT CHARACTER FORCED
OPDEF	PNT1	[37B8!1B12!0]	;PRINT ONE OCTAL DIGIT
OPDEF	PNT1F	[37B8!1B12!1]	;PRINT 1 OCTAL DIGIT FORCED
OPDEF	PNT2	[37B8!2B12!0]	;PRINT TWO OCTAL DIGITS
OPDEF	PNT2F	[37B8!2B12!1]	;PRINT 2 OCTAL DIGITS FORCED
OPDEF	PNT3	[37B8!3B12!0]	;PRINT THREE OCTAL DIGITS
OPDEF	PNT3F	[37B8!3B12!1]	;PRINT THREE OCTAL DIGITS FORCED
OPDEF	PNT4	[37B8!4B12!0]	;PRINT FOUR OCTAL DIGITS
OPDEF	PNT4F	[37B8!4B12!1]	;PRINT FOUR OCTAL DIGITS FORCED
OPDEF	PNT5	[37B8!5B12!0]	;PRINT FIVE OCTAL DIGITS
OPDEF	PNT5F	[37B8!5B12!1]	;PRINT FIVE OCTAL DIGITS FORCED
OPDEF	PNT6	[37B8!6B12!0]	;PRINT SIX OCTAL DIGITS
OPDEF	PNT6F	[37B8!6B12!1]	;PRINT SIX OCTAL DIGITS FORCED
OPDEF	PNT7	[37B8!7B12!0]	;PRINT 7 OCTAL DIGITS
OPDEF	PNT7F	[37B8!7B12!1]	;PRINT 7 OCTAL DIGITS FORCED
OPDEF	PNT11	[37B8!11B12!0]	;PRINT 11 OCTAL DIGITS
OPDEF	PNT11F	[37B8!11B12!1]	;PRINT 11 OCTAL DIGITS FORCED.
OPDEF	PNTADR	[37B8!10B12!0]	;PRINT PHYSICAL ADDRESS
OPDEF	PNTADF	[37B8!10B12!1]	;PRINT PHYSICAL ADDRESS FORCED
OPDEF	PNTOCT  [37B8!14B12!0]	;PRINT FULL WORD OCTAL
OPDEF	PNTOTF	[37B8!14B12!1]	;PRINT FULL WORD OCTAL FORCED
OPDEF	PNTHW	[37B8!13B12!0]	;PRINT OCTAL HALF WORDS, 6 SP 6
OPDEF	PNTHWF	[37B8!13B12!1]	;PRINT OCTAL HALF WORDS, 6 SP 6 FORCED
OPDEF	PNTOCS	[37B8!16B12!3]	;PRINT OCTAL, SUPPRESS LEADING 0'S
OPDEF	PNTOCF	[37B8!17B12!3]	;PRINT OCTAL, SUPPRESS LEADING 0'S FORCED
OPDEF	PNTDEC	[37B8!15B12!0]	;PRINT DECIMAL, SUPRESS LEADING 0'S
OPDEF	PNTDCF	[37B8!15B12!1]	;PRINT DECIMAL, SUPRESS LEADING 0'S FORCED
OPDEF	PNTDS	[37B8!16B12!0]	;PRINT DECIMAL, SPACES FOR LD 0'S
OPDEF	PNTDSF	[37B8!16B12!1]	;PRINT DECIMAL, SPACES FOR LD 0'S FORCED
OPDEF	PNTNM	[37B8!4B12!2]	;PRINT PROGRAM NAME
OPDEF	PNTSIX	[37B8!0B12!2]	;PRINT SIXBIT WORD
OPDEF	PNTSXF	[37B8!1B12!2]	;PRINT SIXBIT WORD FORCED
OPDEF	DROPDV	[37B8!5B12!2]	;CLOSE LOGICAL FILE, USER MODE
OPDEF	PNTCW	[37B8!2B12!2]	;PRINT DF10 CONTROL WORD
OPDEF	PNTCWF	[37B8!3B12!2]	;PRINT DF10 CONTROL WORD FORCED
OPDEF	PCRL	[37B8!0B12!CRLF] ;PRINT CARRIAGE RETURN/LINE FEED
OPDEF	PCRLF	[37B8!1B12!CRLF] ;PRINT CARRIAGE RETURN/LINE FEED FORCED
OPDEF	PSP	[37B8!0B12!40]	;PRINT SPACE
OPDEF	PSPF	[37B8!1B12!40]	;PRINT SPACE FORCED
OPDEF	PCRL2	[37B8!0B12!CRLF2] ;PRINT CARRIAGE RETURN/LINE FEED (TWICE)
OPDEF	PCRL2F	[37B8!1B12!CRLF2] ;PRINT CARRIAGE RETURN/LINE FEED (TWICE) FORCED
OPDEF	PBELL	[37B8!1B12!7]	;PRINT TTY BELL

OPDEF	PFORCE	[37B8!1B12!26]	;PRINT FORCE, CONTROL O OVERRIDE

DEFINE	PMSG	(ARG),<
	PSIXM	[SIXBIT\ARG'_\]>

DEFINE	PMSGF	(ARG),<
	PSIXMF	[SIXBIT\ARG'_\]>

;SIXBTZ -- MACRO TO GENERATE SIXBIT DATA FOR PRINTING
;	CONSERVES CORE OVER ASCIZ

DEFINE	SIXBTZ	(ARG),<	[SIXBIT\ARG'_\]>

;CONSOLE SWITCH INPUT UUO.
;READS CONSOLE SWITCHES IF IN EXEC MODE OR ASKS FOR THEM IF
; USER MODE.

OPDEF	SWITCH	[37B8!10B12!2]	;INPUT CONSOLE SWITCHES

;CLOCK INITIALIZATION UUO - TO SET DESIRED CLOCK OPERATION
;EITHER IGNORE CLOCK, ONLY LET IT TICK OR CAUSE INTERRUPT TO OCCUR.

OPDEF	CLOKOP	[37B8!13B12!4]	;CLOCK OPERATION UUO - PDP-11 CLOCK
OPDEF	MTROP	[37B8!4B12!4]	;CLOCK OPERATION UUO - DK20 METER

;KL10 ONLY CACHE OPERATION UUO'S

OPDEF	CINVAL	[37B8!1B12!4]	;CACHE INVALIDATE
OPDEF	CFLUSH	[37B8!2B12!4]	;CACHE FLUSH
OPDEF	CWRTBI	[37B8!3B12!4]	;CACHE WRITE-BACK & INVALIDATE
;END OF PASS/PROGRAM UUOS

;PERFORMS THE END OF PASS FUNCTIONS. INCREMENT PASS COUNT,
;DECREMENT ITERATION COUNT, CHECK IF FINISHED WITH THIS PROGRAM ETC.

OPDEF	ENDUUO	[37B8!12B12!4]	;UUO TO DISPLAY LIGHTS
OPDEF	EOPUUO	[37B8!16B12!4]	;END OF PROGRAM UUO

;MEMORY MANAGEMENT UUO'S
;UUO'S TO PERFORM VARIOUS MEMORY FUNCTIONS. MAPPING, ZEROING, PAGING,
;ADDRESS CONVERSION, ETC...

OPDEF	MAPMEM	[37B8!0B12!4]	;MAP MEMORY
OPDEF	MEMZRO	[37B8!12B12!2]	;ZERO MEMORY
OPDEF	MEMSEG	[37B8!11B12!2]	;SETUP MEMORY SEGMENT
OPDEF	MAPADR	[37B8!13B12!2]	;VIRTUAL TO PHYSICAL ADR CONVERT
OPDEF	MAPCNK	[37B8!15B12!2]	;MAP MEMORY CHUNK
OPDEF	MAPSET	[37B8!14B12!2]	;SET KI10 EXEC PAGE MAP
OPDEF	MAPPNT	[37B8!17B12!2]	;PRINT MEMORY MAP

;DEVICE CODE MODIFICATION UUO
;ALLOWS THE MODIFICATION OF IOT'S TO ONE DEVICE TO BE CHANGED TO
;IOT'S TO A DIFFERENT DEVICE CODE.

OPDEF	MODPCU	[37B8!7B12!2]	;MODIFY PERHIPERAL CODE, USER
OPDEF	MODPCP	[37B8!6B12!2]	;MODIFY PERHIPERAL CODE, PROGRAM

	IFNDEF	MODDVL,<MODDVL==BEGIN>
	IFNDEF	MODDVU,<MODDVU==BEGIN>

;"DIAMON" FILE SELECTION AND READ UUOS

OPDEF	FSELECT	[37B8!5B12!4]	;FILE SELECTION
OPDEF	FREAD	[37B8!6B12!4]	;FILE READ - ASCII DATA
OPDEF	FRD36	[37B8!7B12!4]	;FILE READ - 36 BIT DATA
OPDEF	FRD8	[37B8!10B12!4]	;FILE READ - 8 BIT DATA

;KI10 ONLY UUO FOR PRINTING MARGIN VALUES

OPDEF	PNTMGN	[37B8!16B12!2]	;PRINT MARGIN VALUE

	XLIST
IFNDEF	KLOLD,<LIST
SUBTTL	ERROR HANDLING UUO DEFINITIONS, SEPT 18,1979

; **********************************************************************
;ERROR HANDLER PARAMETERS
; **********************************************************************

OPDEF	ERUUO	[36B8]		;ERROR CALL UUO
OPDEF	ERLOOP	[35B8]		;ERROR LOOP, CHECKS PC,REPT,REPT1,ERROR
OPDEF	ERLP1	[35B8!1B12]	;ERROR LOOP IF PC'S MATCH
OPDEF	ERLP2	[35B8!2B12]	;ERROR LOOP IF ANY ERROR
OPDEF	REPTUO	[34B8]		;REPEAT LOOP UUO

;THE ERROR HANDLER MACROS

;A MACRO TO REPORT AN ERROR AND LOOP

	DEFINE	ERROR	(ADR,FORMAT,CORECT,ACTUAL,F,D,ERR)<
							SALL
	ERUUO	FORMAT,[T,,[SIXBIT\F'_\]
		   CORECT,,ACTUAL
		   [SIXBIT\D'_\],,ERR]
							XALL
	ERLOOP	ADR		;IF ERROR, LOOP TO ADR
>

;A MACRO TO REPORT AN ERROR AND NOT LOOP

	DEFINE	ERROR1	(FORMAT,CORECT,ACTUAL,F,D,ERR)<
							SALL
	ERUUO	FORMAT,[T,,[SIXBIT\F'_\]
		   CORECT,,ACTUAL
		   [SIXBIT\D'_\],,ERR]
							XALL>

>;END OF KLOLD CONDITIONAL

	XLIST
IFDEF	$PAPER,<LIST>
SUBTTL	STANDARD PROGRAM ASSIGNMENTS

; **********************************************************************
;ACCUMULATORS
; **********************************************************************

P=	17			;PUSHDOWN POINTER AC (IF PUSH LIST USED)
REPT==	15			;ERROR HANDLER REPEAT AC
REPT1==	16			; "

; **********************************************************************
;PDP-10 STANDARD PC CONTROL FLAGS (SAVED ON PUSHJ, JSR, ETC..)
; **********************************************************************

AROV==	400000			;ARITHMETIC OVERFLOW
CRY0==	200000			;CARRY 0
CRY1==	100000			;CARRY 1
FOV==	40000			;FLOATING POINT OVERFLOW
BIS==	20000			;BYTE INTERRUPT
USERF==	10000			;USER MODE
EXIOT==	4000			;USER PRIV I/O
FXU==	100			;FLOATING POINT UNDERFLOW
DCK==	40			;DIVIDE CHECK

; **********************************************************************
;PDP-10 STANDARD ADDRESS ASSIGNMENTS
; **********************************************************************

LUUO==	40			;UUO STORAGE, UUO 1-37
LUUOI==	41			;UUO SERVICE INSTRUCTION

; **********************************************************************
;JOB DATA AREA EXTERNALS (OLD DEFINITIONS)
; **********************************************************************

JOBUUO==40
JOB41==	41
JOBREL==44
JOBDDT==74
JOBSYM==116
JOBUSY==117
JOBSA==	120
JOBFF==	121
JOBREN==124
JOBAPR==125
JOBCNI==126
JOBTPC==127
JOBOPC==130
JOBVER==137
; **********************************************************************
;JOB DATA AREA EXTERNALS (NEW DEFINITIONS)
; **********************************************************************

.JBUUO==40
.JB41==	41
.JBREL==44
.JBDDT==74
.JBSYM==116
.JBUSY==117
.JBSA==	120
.JBFF==	121
.JBREN==124
.JBAPR==125
.JBCNI==126
.JBTPC==127
.JBOPC==130
.JBVER==137

; **********************************************************************
;USER MODE APR ASSIGNMENTS (FOR "APRENB" CALL)
; **********************************************************************

PDLOVU==200000			;PUSHDOWN LIST OVERFLOW
MPVU==	20000			;MEMORY PROTECTION VIOLATION
NXMU==	10000			;NON-X-MEMORY
PARU==	4000			;PARITY ERROR
CLKU==	1000			;CLOCK
FOVU==	100			;FLOATING OVERFLOW
AROVU==	10			;ARITHMETIC OVERFLOW

; **********************************************************************
;USER MODE PRINT OUTPUT CHANNEL ASSIGNMENTS (FOR SUBROUTINE PACKAGE)
;THE USER SHOULD BE CAUTIONED NOT TO USE THESE CHANNELS WHEN
;USING THE SUBROUTINE PACKAGE AND CODING USER MODE PROGRAMS.
; **********************************************************************

$DEVCH==17			;LOGICAL DEVICE CHANNEL
$DVCH1==16			;LOGICAL DEV UPDATE INPUT CHANNEL

; **********************************************************************
;PDP-10 SPECIAL COMPATABILITY ASSIGNMENTS
; **********************************************************************

PAG==	010		;PAGING I/O DEVICE CODE, KI/KL

CCA==	014		;CACHE I/O DEVICE CODE, KL10
; **********************************************************************
;PDP-10 STANDARD APR CONO ASSIGNMENTS
; **********************************************************************

IOCLR==	200000			;CLEAR ALL I/O DEVICES
CLKDIS==4000			;DISABLE CLOCK INTERRUPTS
CLKENB==2000			;ENABLE CLOCK INTERRUPTS
CLKCLR==1000			;CLEAR CLOCK FLAG

; **********************************************************************
;PDP-10 STANDARD APR CONI ASSIGNMENTS, RIGHT HALF
; **********************************************************************

CLKENB==2000			;CLOCK INTERRUPT ENABLED
CLK==	1000			;CLOCK FLAG
ANXM==	10000			;KA10, NON-X-MEMORY
INXM==	100			;KI10

; **********************************************************************
;PDP-10 STANDARD PI CONO ASSIGNMENTS
; **********************************************************************

PWFCLR==400000			;CLEAR POWER FAIL FLAG
PARCLR==200000			;CLEAR PARITY ERROR FLAG
PARDIS==100000			;DISABLE PARITY INTERRUPTS
PARENB==40000			;ENABLE PARITY INTERRUPTS
PICLR==	10000			;CLEAR PI SYSTEM
REQSET==4000			;SET PROGRAM PI REQUEST
CHNON==	2000			;TURN ON CHANNEL
CHNOFF==1000			;TURN OFF CHANNEL
PIOFF==	400			;TURN OFF PI SYSTEM
PION==	200			;TURN ON PI SYSTEM

; **********************************************************************
;PDP-10 STANDARD PI CONI ASSIGNMENTS
; **********************************************************************

PION==	200			;PI SYSTEM ON

; **********************************************************************
;PDP-10 STANDARD PI CHANNEL ASSIGNMENTS
; **********************************************************************

PICHN1==100			;PI CHANNEL 1
PICHN2==40			;PI CHANNEL 2
PICHN3==20			;PI CHANNEL 3
PICHN4==10			;PI CHANNEL 4
PICHN5==4			;PI CHANNEL 5
PICHN6==2			;PI CHANNEL 6
PICHN7==1			;PI CHANNEL 7
PICHNA==177			;ALL PI CHANNELS, 1 THRU 7
	XLIST
	IFDEF	KA10,<
IFDEF	$PAPER,<LIST>
; **********************************************************************
;KA10 APR CHANNEL ASSIGNMENTS
; **********************************************************************

AAPRC1==1			;APR INTERRUPT CHANNEL

; **********************************************************************
;KA10 APR CONO ASSIGNMENTS
; **********************************************************************

APDCLR==400000			;CLEAR PUSHDOWN OVERFLOW
AABCLR==40000			;CLEAR ADDRESS BREAK
AMPCLR==20000			;CLEAR MEMORY PROTECTION
ANXCLR==10000			;CLEAR NON-X-MEMORY
AFODIS==400			;DISABLE FLOATING POINT OVERFLOW
AFOENB==200			;ENABLE FLOATING POINT OVERFLOW
AFOCLR==100			;CLEAR FLOATING POINT OVERFLOW
AOVDIS==40			;DISABLE OVERFLOW
AOVENB==20			;ENABLE OVERFLOW
AOVCLR==10			;CLEAR OVERFLOW

; **********************************************************************
;KA10 APR CONI ASSIGNMENTS
; **********************************************************************

APDLOV==200000			;PUSHDOWN OVERFLOW
AUSRIO==100000			;USER I/O
AADRBK==40000			;ADDRESS BREAK
AMPV==	20000			;MEMORY PROTECTION VIOLATION
ANXM==	10000			;NON-EXISTENT MEMORY
AFOENB==200			;FLT PT INTERRUPT ENABLED
AFOV==	100			;FLOATING POINT OVERFLOW
ATRPOS==40			;TRAPS OFFSET
AOVENB==20			;OVERFLOW INTERRUPT ENABLED
AOVFLO==10			;ARITHMETIC OVERFLOW

; **********************************************************************
;KA10 PI CONI ASSIGNMENTS
; **********************************************************************

APWRFL==400000			;POWER FAILURE
APARER==200000			;PARITY ERROR
APAREN==100000			;PARITY INTERRUPT ENABLED

>				;END CONDITIONAL ON KA10
	XLIST
	IFDEF	KI10,<
IFDEF	$PAPER,<LIST>
; **********************************************************************
;KI10 PC CONTROL FLAGS
; **********************************************************************

LIP==	2000			;LAST INSTRUCTION PUBLIC
TN0==	400			;TN=00, NO TRAP ;TN=01, ARITH TRAP
TN1==	200			;TN=10, PDL OV  ;TN=11, TRAP 3

; **********************************************************************
;KI10 SPECIAL EXEC MODE FLAGS
; **********************************************************************

UOLIP==	400000			;UUO OLD L.I.P.
UOUSR==	4000			;UUO OLD USER

; **********************************************************************
;KI10 APR CHANNEL ASSIGNMENTS
; **********************************************************************

IAPRC1==1			;APR CLOCK CHANNEL
IAPRE1==10			;APR ERROR CHANNEL

; **********************************************************************
;KI10 APR CONO ASSIGNMENTS
; **********************************************************************

ITMSET==400000			;SET TIME OUT TIMER
ITMDIS==100000			;DISABLE TIME OUT
ITMENB==40000			;ENABLE TIME OUT
IASRTC==20000			;CLEAR AUTO RESTART
IASRTS==10000			;SET AUTO RESTART
IIOPFC==200			;CLEAR I/O PAGE FAIL
INXCLR==100			;CLEAR NON-X-MEM

; **********************************************************************
;KI10 APR CONI ASSIGNMENTS, RIGHT HALF
; **********************************************************************

ITMOUT==400000			;TIMER TIMED OUT
IPARER==200000			;PARITY ERROR
IPAREN==100000			;PARITY ENABLED
ITMOEN==40000			;TIME OUT ENABLED
IPWRFL==20000			;POWER FAIL
IASRTE==10000			;AUTO RESTART ENABLED
IIOPFL==200			;I/O PAGE FAIL
INXM==	100			;NON-X-MEMORY
; **********************************************************************
;KI10 APR CONI ASSIGMENTS, LEFT HALF
; **********************************************************************

IMLAPD==200000			;MEMORY OVERLAP DISABLED
IFMMAN==100000			;FAST MEMORY MANUAL
IMIPGD==40000			;MI PROGRAM DISABLE
ICNSLR==20000			;CONSOLE READ ONLY
ICNSLL==10000			;CONSOLE LOCKED
IP50HZ==4000			;50 HZ POWER
IMGINM==2000			;MANUAL MARGINS
IMAINT==1000			;MAINTENANCE MODE
IPWRLO==400			;POWER LOW
IMGNLO==200			;MARGIN COMPARATOR LOW
SENSE1==40			;SENSE SWITCHES		1
SENSE2==20			;			2
SENSE3==10			;			3
SENSE4==4			;			4
SENSE5==2			;			5
SENSE6==1			;			6

; **********************************************************************
;KI10 APR DATAO ASSIGNMENTS
; **********************************************************************

IEVNPR==20000			;WRITE EVEN PARITY
ISPDOF==10000			;SPEED MARGINS OFF
ISPDON==4000			;SPEED MARGINS ON
IMGNOF==2000			;MARGINS OFF - LH
IMGNON==1000			;MARGINS ON - LH

; **********************************************************************
;KI10 PI CONO ASSIGNMENTS
; **********************************************************************

IRQCLR==20000			;CLEAR PROGRAM PI REQUEST
; **********************************************************************
;KI10 PI CONI ASSIGNMENTS
; **********************************************************************

IINSTF==400000			;ADDRESS CONDITIONS, INST FETCH
IDATAF==200000			;	    	     DATA FETCH
IWRITE==100000			;		     WRITE
IADSTP==40000			;ADDRESS STOP
IADBRK==20000			;ADDRESS BREAK
IADEXC==10000			;ADDRESS SWITCHES EXEC
IADUSR==4000			;  "	  "       USER
IPRSTP==2000			;PARITY STOP
INXSTP==1000			;NON-X-MEM STOP

; **********************************************************************
;KI10 PAG CONI ASSIGNMENTS
; **********************************************************************

EXCMEM==400			;EXEC MEMORY SPACE
AMCLRB==40			;ASSOCIATIVE MEMORY CLEAR BIT

; **********************************************************************
;KI10 PAG DATAO ASSIGNMENTS, LEFT HALF
; **********************************************************************

LDUSRB==400000			;LOAD USER BASE REGISTER
SMLUSR==40000			;SMALL USER, 32K OR UNDER
USRCMP==20000			;USER ADR COMPARE ENABLE

; **********************************************************************
;KI10 PAG DATAO ASSIGNMENTS, RIGHT HALF
; **********************************************************************

LDEXCB==400000			;LOAD EXEC BASE REGISTER
TRPENB==20000			;ENABLE TRAPS

; **********************************************************************
;KI10 PAG DATAI ASSIGNMENTS
; **********************************************************************

SMLUSR==40000			;SMALL USER
USRCMP==20000			;USER ADR COMPARE ENABLED
TRPENB==20000			;RH, TRAPS ENABLED

; **********************************************************************
;KI10 PTR DATAO ASSIGNMENTS
; **********************************************************************

				;ADDRESS CONDITIONS, ADDRESS BREAK ;AS ABOVE, PI CONI
				;ADDRESS SWITCHES, 14-35
; **********************************************************************
;KI10 EXEC PAGE MAP PAGE ASSIGNMENTS
; **********************************************************************

PGFTRP==420			;PAGE FAULT TRAP
AROVTP==421			;ARITHMETIC TRAP
PDOVTP==422			;PUSHDOWN OVERFLOW TRAP
TRP3TP==423			;TRAP 3 TRAP

; **********************************************************************
;KI10 USER PAGE MAP PAGE ASSIGNMENTS
; **********************************************************************

PGFTRP==420			;PAGE FAULT TRAP
AROVTP==421			;ARITHMETIC TRAP
PDOVTP==422			;PUSHDOWN OVERFLOW TRAP
TRP3TP==423			;TRAP 3 TRAP

MUUO==	424			;MUUO STORAGE
MUUOPC==425			;C(PC) OF MUUO STORAGE

EXCPFW==426			;EXEC PAGE FAIL WORD
USRPFW==427			;USER PAGE FAIL WORD

KNTRP==	430			;KERNAL	 	NO TRAP - NEW PC'S-
KTRP==	431			;"	 	TRAP
SNTRP==	432			;SUPERVISOR	NO TRAP
STRP==	433			;"		TRAP
CNTRP==	434			;CONCEAL 	NO TRAP
CTRP==	435			;"		TRAP
PNTRP==	436			;PUBLIC		NO TRAP
PTRP==	437			;"		TRAP

>			;END CONDITIONAL ON KI10
	XLIST
	IFDEF	KL10,<
	IFNDEF	KL10P0,<
IFDEF	$PAPER,<LIST>
;KL10 CONO APR 000 ASSIGMENTS
; **********************************************************************

LIOCLR==200000			;CLEAR ALL I/O DEVICES
LFLGEN==100000			;ENABLE SELECTED FLAG
LFLGDS==40000			;DISABLE SELECTED FLAG
LFLGCL==20000			;CLEAR SELECTED FLAG
LFLGST==10000			;SET SELECTED FLAG
LSBUSE==4000			;SBUS ERROR FLAG
LNXMER==2000			;NON-EXISTENT MEMORY FLAG
LPARER==1000			;PARITY ERROR FLAG
LIOPFE==400			;I/O PAGE FAIL FLAG
LPWRFL==100			;POWER FAIL FLAG
LCASWD==20			;CACHE SWEEP DONE FLAG
LAPRP7==7			;APR PI CHANNEL 7
LAPRP6==6			;APR PI CHANNEL 6
LAPRP5==5			;APR PI CHANNEL 5
LAPRP4==4			;APR PI CHANNEL 4
LAPRP3==3			;APR PI CHANNEL 3
LAPRP2==2			;APR PI CHANNEL 2
LAPRP1==1			;APR PI CHANNEL 1
LESBER==104000			;ENABLE SBUS ERRORS
LDSBER==044000			;DISABLE SBUS ERRORS
LCSBER==024000			;CLR SBUS ERRORS
LSSBER==014000			;SET SBUS ERROR
LENXER==102000			;ENABLE NON-EXISTENT MEMORY
LDNXER==042000			;DISABLE NON-EXISTENT MEORY
LCNXER==022000			;CLR NON-EXISTENT MEMORY
LSNXER==012000			;SET NON-EXISTENT MEMORY
LEPAER==101000			;ENABLE PARITY ERRORS
LDPAER==041000			;DISABLE PARITY ERRORS
LCPAER==021000			;CLR PARITY ERROR
LSPAER==011000			;SET PARITY ERROR
LEIOPF==100400			;ENABLE I/O PAGE FAILS
LDIOPF==040400			;DISABLE I/O PAGE FAILS
LCIOPF==020400			;CLR I/O PAGE FAIL
LSIOPF==010400			;SET I/O PAGE FAIL
LEPWRF==100100			;ENABLE POWER FAIL
LDPWRF==040100			;DISABLE POWER FAIL
LCPWRF==020100			;CLR POWER FAIL
LSPWRF==010100			;SET POWER FAIL
LECASD==100020			;ENABLE CACHE SWEEP DONE
LDCASD==040020			;DISABLE CACHE SWEEP DONE
LCCASD==020020			;CLR CACHE SWEEP DONE
LSCASD==010020			;SET CACHE SWEEP DONE
LAPRAL==127520			;CLR ALL ERROR FLAGS & ENABLE
; **********************************************************************
;KL10 CONI APR 000 ASSIGMENTS (LEFT HALF)
; **********************************************************************

LSBSEN==4000			;SBUS ERRORS ENABLED
LNXMEN==2000			;NON-EXISTENT MEMORY ERRORS ENABLED
LPAREN==1000			;PARITY ERRORS ENABLED
LIOPFE=400			;I/O PAFE FAILURES ENABLED
LPWRFE==100			;POWER FAILURES ENABLED
LCASDE==20			;CACHE SWEEP DONE ENABLED

; **********************************************************************
;KL10 CONI APR 000 ASSIGMENTS (RIGHT HALF)
; **********************************************************************

LCASWB==200000			;CACHE SWEEP BUSY
LSBUSE==4000			;SBUS ERROR FLAG
LNXMER==2000			;NON-EXISTENT MEMORY FLAG
LPARER==1000			;PARITY ERROR FLAG
LIOPFE==400			;I/O PAGE FAIL FLAG
LPWRFL==100			;POWER FAIL FLAG
LCASWD==20			;CACHE SWEEP DONE FLAG
LAPRP7==7			;APR PI CHANNEL 7
LAPRP6==6			;APR PI CHANNEL 6
LAPRP5==5			;APR PI CHANNEL 5
LAPRP4==4			;APR PI CHANNEL 4
LAPRP3==3			;APR PI CHANNEL 3
LAPRP2==2			;APR PI CHANNEL 2
LAPRP1==1			;APR PI CHANNEL 1
LINT==10			;APR INTERRUPT

; **********************************************************************
;KL10 DATAO APR 000 ASSIGMENTS (LEFT HALF)
; **********************************************************************

LINSTF==400			;ADDRESS BREAK REQUEST FOR INST. FETCH
LDATAF==200			;ADDRESS BREAK REQUEST FOR DATA FETCH
LWRITE==100			;ADDRESS BREAK REQUEST FOR DATA WRITE
LUSCMP==40			;USER ADDRESS COMPARE
LEXCMP==0			;EXEC ADDRESS COMPARE

; **********************************************************************
;KL10 DATAO APR 000 ASSIGMENTS (RIGHT HALF)
; **********************************************************************

;DATAO APR,ADDRESS SWITCHES=13-35
>
	XLIST
	IFDEF	KL10P0,<
IFDEF	$PAPER,<LIST>
;KL10 CONO APR 000 ASSIGMENTS
; **********************************************************************
LIOCLR==200000			;CLEAR ALL I/O DEVICES
LFLGEN==100000			;ENABLE SELECTED FLAG
LFLGDS==40000			;DISABLE SELECTED FLAG
LFLGCL==20000			;CLEAR SELECTED FLAG
LFLGST==10000			;SET SELECTED FLAG
LSBUSE==4000			;SBUS ERROR FLAG
LNXMER==2000			;NON-EXISTENT MEMORY FLAG
LIOPFE==1000			;I/O PAGE FAIL FLAG
LPARER==400			;MB PARITY ERROR FLAG
LCADRP==200			;CACHE ADDRESS PARITY ERROR FLAG
LSADRP==100			;S-BUS ADDRESS PARITY ERROR FLAG
LPWRFL==40			;POWER FAIL FLAG
LCASWD==20			;CACHE SWEEP DONE FLAG
LAPRP7==7			;APR PI CHANNEL 7
LAPRP6==6			;APR PI CHANNEL 6
LAPRP5==5			;APR PI CHANNEL 5
LAPRP4==4			;APR PI CHANNEL 4
LAPRP3==3			;APR PI CHANNEL 3
LAPRP2==2			;APR PI CHANNEL 2
LAPRP1==1			;APR PI CHANNEL 1
LESBER==104000			;ENABLE SBUS ERRORS
LDSBER==044000			;DISABLE SBUS ERRORS
LCSBER==024000			;CLR SBUS ERRORS
LSSBER==014000			;SET SBUS ERROR
LENXER==102000			;ENABLE NON-EXISTENT MEMORY
LDNXER==042000			;DISABLE NON-EXISTENT MEORY
LCNXER==022000			;CLR NON-EXISTENT MEMORY
LSNXER==012000			;SET NON-EXISTENT MEMORY
LEIOPF==101000			;ENABLE I/O PAGE FAILS
LDIOPF==041000			;DISABLE I/O PAGE FAILS
LCIOPF==021000			;CLR I/O PAGE FAIL
LSIOPF==011000			;SET I/O PAGE FAIL
LEPAER==100400			;ENABLE PARITY ERRORS
LDPAER==040400			;DISABLE PARITY ERRORS
LCPAER==020400			;CLR PARITY ERROR
LSPAER==010400			;SET PARITY ERROR
LECAER==100200			;ENABLE CACHE ADR PARITY ERRORS
LDCAER==040200			; " DISABLE
LCCAER==020200			; " CLR
LSCAER==010200			; " SET
LESAER==100100			;ENABLE S-BUS ADR PARITY ERRORS
LDSAER==040100			; " DISABLE
LCSAER==020100			; " CLR
LSSAER==010100			; " SET
LEPWRF==100040			;ENABLE POWER FAIL
LDPWRF==040400			;DISABLE POWER FAIL
LCPWRF==020040			;CLR POWER FAIL
LSPWRF==010040			;SET POWER FAIL
LECASD==100020			;ENABLE CACHE SWEEP DONE
LDCASD==040020			;DISABLE CACHE SWEEP DONE
LCCASD==020020			;CLR CACHE SWEEP DONE
LSCASD==010020			;SET CACHE SWEEP DONE
LAPRAL==127760			;CLR ALL ERROR FLAGS & ENABLE
; **********************************************************************
;KL10 CONI APR 000 ASSIGMENTS (LEFT HALF)
; **********************************************************************

LSBSEN==4000			;SBUS ERRORS ENABLED
LNXMEN==2000			;NON-EXISTENT MEMORY ERRORS ENABLED
LIOPFE==1000			;I/O PAGE FAILURES ENABLED
LPAREN==400			;PARITY ERRORS ENABLED
LCADEN==200			;CACHE ADR PARITY ERRORS ENABLED
LSADEN==100			;S-BUS ADR PARITY ERRORS ENABLED
LPWRFE==40			;POWER FAILURES ENABLED
LCASDE==20			;CACHE SWEEP DONE ENABLED

; **********************************************************************
;KL10 CONI APR 000 ASSIGMENTS (RIGHT HALF)
; **********************************************************************

LCASWB==200000			;CACHE SWEEP BUSY
LSBUSE==4000			;SBUS ERROR FLAG
LNXMER==2000			;NON-EXISTENT MEMORY FLAG
LIOPFE==1000			;I/O PAGE FAIL FLAG
LPARER==400			;PARITY ERROR FLAG
LCADRP==200			;CACHE ADR PARITY ERROR FLAG
LSADRP==100			;S-BUS ADR PARITY ERROR FLAG
LPWRFL==40			;POWER FAIL FLAG
LCASWD==20			;CACHE SWEEP DONE FLAG
LAPRP7==7			;APR PI CHANNEL 7
LAPRP6==6			;APR PI CHANNEL 6
LAPRP5==5			;APR PI CHANNEL 5
LAPRP4==4			;APR PI CHANNEL 4
LAPRP3==3			;APR PI CHANNEL 3
LAPRP2==2			;APR PI CHANNEL 2
LAPRP1==1			;APR PI CHANNEL 1
LINT==10			;APR INTERRUPT

; **********************************************************************
;KL10 DATAO APR 000 ASSIGMENTS (LEFT HALF)
; **********************************************************************

LINSTF==400			;ADDRESS BREAK REQUEST FOR INST. FETCH
LDATAF==200			;ADDRESS BREAK REQUEST FOR DATA FETCH
LWRITE==100			;ADDRESS BREAK REQUEST FOR DATA WRITE
LUSCMP==40			;USER ADDRESS COMPARE
LEXCMP==0			;EXEC ADDRESS COMPARE

; **********************************************************************
;KL10 DATAO APR 000 ASSIGMENTS (RIGHT HALF)
; **********************************************************************

;DATAO APR,ADDRESS SWITCHES=13-35
>
	XLIST
IFDEF	$PAPER,<LIST>
; **********************************************************************
;KL10 DATAI APR 000 ASSIGMENTS (LEFT HALF)
; **********************************************************************

LINSTF==400			;ADDRESS BREAK REQUEST FOR INST. FETCH
LDATAF==200			;ADDRESS BREAK REQUEST FOR DATA FETCH
LWRITE==100			;ADDRESS BREAK REQUEST FOR DATA WRITE
LUSCMP==40			;USER ADDRESS COMPARE
LEXCMP==0			;EXEC ADDRESS COMPARE

; **********************************************************************
;KL10 DATAI APR 000 ASSIGMENTS (RIGHT HALF)
; **********************************************************************

;DATAI APR,ADDRESS SWITCHES=13-35

; **********************************************************************
;KL10 BLKO APR 000 ASSIGMENTS (IMMEDIATE MODE)
; **********************************************************************

;REFILL ALGORITHM BITS 18-20
;REFILL ALGORITHM ADDRESS 27-33

; **********************************************************************
;KL10 BLKI APR 000 ASSIGMENTS
; **********************************************************************

;MICRO-CODE OPTIONS = 0-8
;MICRO-CODE VERSION NUMBER = 9-17
;HARDWARE OPTIONS =18-23
;PROCESSOR SERIAL NUMBER = 24-35
; **********************************************************************
;KL10 CONO PI 004 ASSIGMENTS
; **********************************************************************

LEVNPA==400000			;WRITE EVEN PARITY ADDRESS
LEVNPD==200000			;WRITE EVEN PARITY DATA
LEVNCD==100000			;WRITE EVEN CACHE DIRECTORY PARITY *P0
LRQCLR==20000			;DROP INTERRUPT ON SELECTED CHANNEL
LPICLR==10000			;CLEAR PI SYSTEM
LREQSE==4000			;REQUEST INTERRUPT ON SELECTED CHANNEL
LCHNON=2000			;TURN ON SELECTED CHANNEL
LCHNOF==1000			;TURN OFF SELECTED CHANNEL
LPIOFF==400			;TURN PI SYSTEM OFF
LPION==200			;TURN PI SYSTEM ON
LPICH1==100			;PI CHANNEL 1
LPICH2==40			;PI CHANNEL 2
LPICH3==20			;PI CHANNEL 3
LPICH4==10			;PI CHANNEL 4
LPICH5==4			;PI CHANNEL 5
LPICH6==2			;PI CHANNEL 6
LPICH7==1			;PI CHANNEL 7
LPICHA==177			;ALL PI CHANNELS

; **********************************************************************
;KL10 CONI PI 004 ASSIGMENTS (LEFT HALF)
; **********************************************************************

LPRCH1==100			;PROGRAM REQUEST ON CHANNEL 1
LPRCH2==40			;PROGRAM REQUEST ON CHANNEL 2
LPRCH3==20			;PROGRAM REQUEST ON CHANNEL 3
LPRCH4==10			;PROGRAM REQUEST ON CHANNEL 4
LPRCH5==4			;PROGRAM REQUEST ON CHANNEL 5
LPRCH6==2			;PROGRAM REQUEST ON CHANNEL 6
LPRCH7==1			;PROGRAM REQUEST ON CHANNEL 7
; **********************************************************************
;KL10 CONI PI 004 ASSIGMENTS (RIGHT HALF)
; **********************************************************************

LEVNPA==400000			;WRITE EVEN PARITY ADDRESS
LEVNPD==200000			;WRITE EVEN PARITY DATA
LEVNCD==100000			;WRITE EVEN CACHE DIRECTORY PARITY *P0
LPIIP1==40000			;PI IN PROGRESS ON CHANNEL 1
LPIIP2==20000			;PI IN PROGRESS ON CHANNEL 2
LPIIP3==10000			;PI IN PROGRESS ON CHANNEL 3
LPIIP4==4000			;PI IN PROGRESS ON CHANNEL 4
LPIIP5==2000			;PI IN PROGRESS ON CHANNEL 5
LPIIP6==1000			;PI IN PROGRESS ON CHANNEL 6
LPIIP7==400			;PI IN PROGRESS ON CHANNEL 7
LPION==200			;PI SYSTEM ON
LPICH1==100			;PI CHANNEL 1 ON
LPICH2==40			;PI CHANNEL 2 ON
LPICH3==20			;PI CHANNEL 3 ON
LPICH4==10			;PI CHANNEL 4 ON
LPICH5==4			;PI CHANNEL 5 ON
LPICH6==2			;PI CHANNEL 6 ON
LPICH7==1			;PI CHANNEL 7 ON
; **********************************************************************
;KL10 DATAO PAG 010 ASSIGMENTS (LEFT HALF)
; **********************************************************************

LLACBL==400000			;LOAD AC BLOCKS
LLPRCN==200000			;LOAD PREVIOUS CONTEXT SECTION
LLDUSB==100000			;LOAD USER BASE REGISTER
LCWSX==40			;

;CURRENT AC BLOCKS BITS 6 - 8
;PREVIOUS AC BLOCKS BITS 9 - 11
;PREVIOUS CONTEXT SECTION BITS 13 - 17

; **********************************************************************
;KL10 DATAO PAG 010 ASSIGMENTS (RIGHT HALF)
; **********************************************************************

;USER BASE REGISTER BITS 23 - 35

; **********************************************************************
;KL10 DATAI PAG 010 ASSIGMENTS (LEFT HALF)
; **********************************************************************

LLACBL==400000			;LOAD AC BLOCKS
LLPRCN==200000			;LOAD PREVIOUS CONTEXT SECTION
LLDUSB==100000			;LOAD USER BASE REGISTER
LCWSX==40			;

;CURRENT AC BLOCKS BITS 6 - 8
;PREVIOUS AC BLOCKS BITS 9 - 11
;PREVIOUS CONTEXT SECTION BITS 13 - 17

; **********************************************************************
;KL10 DATAI PAG 010 ASSIGMENTS (RIGHT HALF)
; **********************************************************************

;USER BASE REGISTER BITS 23 - 35
; **********************************************************************
;KL10 CONO PAG 010 ASSIGMENTS
; **********************************************************************

LCASLO==400000			;CACHE STRATEGY LOOK
LCASLD==200000			;CACHE STRATEGY LOAD
LSMODE==40000			;SECTION MODE
LTRPEN==20000			;TRAP AND PAGE ENABLE

;EXEC BASE REGISTER = 23-35

; **********************************************************************
;KL10 CONI PAG 010 ASSIGMENTS
; **********************************************************************


LCSLOO==400000			;CACHE STRATEGY LOOK
LCSLOA==200000			;CACHE STRATEGY LOAD
LSECMO==40000			;SECTION MODE
LTRPAE==20000			;TRAP AND PAGE ENABLE

;EXEC BASE REGISTER = 23-35

; **********************************************************************
;KL10 BLKO PAG 010 ASSIGMENTS (IMMEDIATE MODE)
; **********************************************************************

	XLIST
	IFNDEF	KL10P0,<
IFDEF	$PAPER,<LIST>
; **********************************************************************
;KL10 EXEC PAGE MAP PAGE ASSIGNMENTS
; **********************************************************************

LAROVT==421			;ARITHMETIC TRAP
LPDOVT==422			;PUSHDOWN OVERFLOW TRAP
LTRP3T==423			;TRAP 3 TRAP

; **********************************************************************
;KL10 USER PAGE MAP PAGE ASSIGNMENTS
; **********************************************************************

LEUPFW==420			;EXEC & USER PAGE FAIL WORD
LAROVT==421			;ARITHMETIC TRAP
LPDOVT==422			;PUSHDOWN OVERFLOW TRAP
LTRP3T==423			;TRAP 3 TRAP

LMUUO==	424			;MUUO STORAGE
LMUUOP==425			;C(PC) OF MUUO STORAGE

LPFWPC==426			;C(PC) OF PAGE FAIL WORD
LPGFTR==427			;PAGE FAIL NEW PC TRAP

LKNTRP==430			;KERNAL	 	NO TRAP - NEW PC'S-
LKTRP==	431			;"	 	TRAP
LSNTRP==432			;SUPERVISOR	NO TRAP
LSTRP==	433			;"		TRAP
LCNTRP==434			;CONCEAL 	NO TRAP
LCTRP==	435			;"		TRAP
LPNTRP==436			;PUBLIC		NO TRAP
LPTRP==	437			;"		TRAP

>
	XLIST
	IFDEF	KL10P0,<
IFDEF	$PAPER,<LIST>
; **********************************************************************
;KL10 EXEC PAGE MAP PAGE ASSIGNMENTS
; **********************************************************************

LAROVT==421			;ARITHMETIC TRAP
LPDOVT==422			;PUSHDOWN OVERFLOW TRAP
LTRP3T==423			;TRAP 3 TRAP

LTBASH==510			;TIME-BASE, HI
LTBASL==511			;TIME-BASE, LO
LPRFMH==512			;PERFORMANCE ANAYLYSIS, HI
LPRFML==513			;PERFORMANCE ANAYLYSIS, LO

; **********************************************************************
;KL10 USER PAGE MAP PAGE ASSIGNMENTS
; **********************************************************************

LAROVT==421			;ARITHMETIC TRAP
LPDOVT==422			;PUSHDOWN OVERFLOW TRAP
LTRP3T==423			;TRAP 3 TRAP

LMUUO==	424			;MUUO STORAGE
LMUUOP==425			;C(PC) OF MUUO STORAGE
LCNTXT==426			;PROCESS CONTEXT WORD

LKNTRP==430			;KERNAL	 	NO TRAP - NEW PC'S-
LKTRP==	431			;"	 	TRAP
LSNTRP==432			;SUPERVISOR	NO TRAP
LSTRP==	433			;"		TRAP
LCNTRP==434			;CONCEAL 	NO TRAP
LCTRP==	435			;"		TRAP
LPNTRP==436			;PUBLIC		NO TRAP
LPTRP==	437			;"		TRAP

LEUPFW==500			;EXEC & USER PAGE FAIL WORD
LPFWPC==501			;C(PC) OF PAGE FAIL WORD
LPGFTR==502			;PAGE FAIL NEW PC

LEBXMH==504			;E-BOX CLOCK TICK METER, HI
LEBXML==505			;E-BOX CLOCK TICK METER, LO
LMBXMH==506			;M-BOX CYCLE METER, HI
LMBXML==507			;M-BOX CYCLE METER, LO

>>				;END CONDITIONAL ON KL10
	LIST

SUBTTL	*FIXED* FIXED CONTROL AND DISPATCH STORAGE, SEPT 18,1979

	LOC	30000

; **********************************************************************
;PROGRAM STARTING ADDRESSES
;THESE ADDRESSES CALL VARIOUS SPECIAL START ROUTINES AND OR OPTIONS
;NORMAL START ADDRESS IS 30000 ALL OTHERS ARE SPECIAL. INVOKED BECAUSE
;OF END OF PASS, POWER FAILURE, DDT START, RE-ENTERING(TYPICALLY USER
;MODE), OR ANY NUMBER OF SPECIAL FEATURE TESTS.
; **********************************************************************

BEGIN:	JRST	@MODLNK		;STAND-ALONE START
$START:	JRST	START		;MODE CHECK STARTING ADDRESS

DIAGMN:	JRST	@LDLNK		;DIAGNOSTIC MONITOR START

SYSEXR:	JRST	@LDLNK		;SYSTEM EXERCISER START

SFSTRT:	JRST	SADR1		;SPECIAL FEATURE START

PFSTRT:	JRST	SADR2		;POWER FAIL RESTART

REENTR:	JRST	SADR3		;REENTER START(USUALLY USER MODE ONLY)

SRTDDT:				;COMMONLY MISTAKEN NAME FOR "DDTSRT"
DDTSRT:	JRST	@DDTLNK		;DDT START

BEGIN1:	JRST	STARTA		;LOOP START(END OF PASS COMES HERE)
SBINIT:	JRST	@SUBLNK		;PMGINT LINKAGE
RETURN:	0			;RETURN ADDRESS STORAGE

START1:	SADR7			;OPTIONAL STARTING ADR/INSTRUCTIONS
START2:	SADR8			; "
START3:	SADR9			; "
START4:	SADR10			; "
START5:	SADR11			; "
; **********************************************************************
;PROGRAM FIXED PARAMETER AREA
; **********************************************************************

PNTNAM:	PAREA3		;SIXBIT PROGRAM NAME
PNTEXT:	PAREA4		;SIXBIT PROGRAM EXTENSION
RANDBS:	PAREA1		;RANDOM BASE NUMBER
SWTEXR:	PAREA2		;SYSTEM EXERCISER SWITCHES
ITRCNT:	ITERAT		;PROGRAM ITERATIONS
$PNAME:	PGMNAM		;POINTER TO PROGRAMS NAME
$PVER:	MCNVER,,DECVER	;MCN & DEC VERSION LEVEL
$MODVL:	MODDVL		;DEVICE CODE CHANGE LOWER LIMIT
$MODVU:	MODDVU		;DEVICE CODE CHANGE UPPER LIMIT
$EMODE:	IFNDEF EXCASB,<0> IFDEF EXCASB,<-1>	;EXEC ALLOWED
$UMODE:	IFNDEF USRASB,<0> IFDEF USRASB,<-1>	;USER ALLOWED
$DSKUP:	IFNDEF DSKUPD,<0> IFDEF DSKUPD,<-1>	;DISK UPDATE MODE
$MMAP:	IFNDEF MEMMAP,<0> IFDEF MEMMAP,<-1>	;ALLOW MEMORY RTNS
PAREA7:	PAREA5		;OPTIONAL PARAMETER
PAREA8:	PAREA6		;OPTIONAL PARAMETER

; **********************************************************************
;PROGRAM VARIABLE PARAMETER AREA
; **********************************************************************

USER:	0		; 0 = EXEC, -1 = USER MODE FLAG
KAIFLG:	0		;PROCESSOR TYPE, 0 = KA10, -1 = KI10
KLFLG:	0		;PROCESSOR TYPE, 0 = KA/KI, -1 = KL10
MONFLG:	-1		;DIAG MONITOR SPECIAL USER FLAG
MONCTL:	0		;DIAG MON/SYS EXR FLAG
MONTEN:	0		;-1= LOADED BY 10
CLOCKF:	0		;CLOCK TICKED FLAG
CONSW:	0		;CONSOLE SWITCH SETTINGS
PASCNT:	0		;PROGRAM PASS COUNT
RUNFLG:	0		;PROGRAM RUN FLAG
TESTPC:	0		;SUBTEST PC
ERRPC:	0		;ERROR PC
ERRTLS:	0		;ERROR TOTALS
TICKS:	0		;PROGRAM RUNNING TIME
MARGIN:	0		;KI10 MARGIN WORD VALUE
$ONETM:	0		;SUBROUTINE INITIALIZATION FLAG
; **********************************************************************
;SPECIAL PROGRAM DISPATCH ADDRESSES
; **********************************************************************

BEGEND:	ENDUUO		;END OF PASS
$BEND1:	JRST	BEGIN1	;KEEP RUNNING PROGRAM
$BEND2:	EOPUUO		;END OF PROGRAM - NO RETURN
CNTLC:	SADR5		;CONTROL C XFER ADDRESS
ALTMGO:	SADR6		;ALTMODE XFER ADDRESS
CPOPJ1:			;SKIP RETURN
UUOSKP:	AOS	(P)	;SKIP RETURN FROM UUO
CPOPJ:			;NON-SKIP REGULAR RETURN
UUOEXT:	RTN		;UUO RETURN
UUORTN:	JFCL		;ADDITIONAL USERS UUO ROUTINE
$UORTX:	JFCL		;ADDITIONAL UUO LINKAGE
$UUOER:	JFCL		;INITED AS (JRST $UOERX)
$ITRHL:	JFCL		;ADDITIONAL INTERRUPT LINKAGE
$ITRX1:	JFCL		; "
$USRHL:	JFCL		; "
$RSRTX:	JFCL		;ADDITIONAL POWER FAIL LINKAGE
$RSRTY:	JFCL		; "
RESRT1:	JFCL		; INITED AS (JRST RESRTX)
RESRT2:	JFCL		; "
$PARER:	JFCL		;ADDITIONAL PARITY ERROR LINKAGE
ERMORE:	JFCL		;ADDITIONAL ERROR HANDLER LINKAGE
	HALT	.	;IMPROPER TRANSFER HALT

$PSHER:	0		;INITED AS (JRST PSHERR)
ITRCH1:	0		;PC & FLAGS OF CURRENT INTERRUPT
	0		;INITED AS (JRST $ITRC1)

; **********************************************************************
;PROCESSOR CONTROL STORAGE
; **********************************************************************

$ACC0:	0		;INTERRUPT SAVED AC0
$SVPI:	0		;INTERRUPT SAVED PI
$SVAPR:	0		;INTERRUPT SAVED APR
$SVPAG:	0		;INTERRUPT SAVED PAG (DATAI)
$SPAG1:	0		;INTERRUPT SAVED PAG (CONI)

$SVUUO:	0		;CURRENT USERS UUO
$SVUPC:	0		;PC OF CURRENT USERS UUO

REPTU:	0		;REPEAT UUO ITERATIONS
SCOPE:	0		;ERROR HANDLER SCOPE LOOP FLAG
%CORFLG:0		; " CORRECT FLAG
%COREC:	0		; " CORRECT DATA
%ACTFL:	0		; " ACTUAL FLAG
%ACTUL:	0		; " ACTUAL DATA
%DISCR:	0		; " DISCREPENCY DATA
; **********************************************************************
;UUO DISPATCH TABLE
; **********************************************************************
	XLIST
IFNDEF	LUUO1,<LUUO1=$UUOER>
IFNDEF	LUUO2,<LUUO2=$UUOER>
IFNDEF	LUUO3,<LUUO3=$UUOER>
IFNDEF	LUUO4,<LUUO4=$UUOER>
IFNDEF	LUUO5,<LUUO5=$UUOER>
IFNDEF	LUUO6,<LUUO6=$UUOER>
IFNDEF	LUUO7,<LUUO7=$UUOER>
IFNDEF	LUUO10,<LUUO10=$UUOER>
IFNDEF	LUUO11,<LUUO11=$UUOER>
IFNDEF	LUUO12,<LUUO12=$UUOER>
IFNDEF	LUUO13,<LUUO13=$UUOER>
IFNDEF	LUUO14,<LUUO14=$UUOER>
IFNDEF	LUUO15,<LUUO15=$UUOER>
IFNDEF	LUUO16,<LUUO16=$UUOER>
IFNDEF	LUUO17,<LUUO17=$UUOER>
IFNDEF	LUUO20,<LUUO20=$UUOER>
IFNDEF	LUUO21,<LUUO21=$UUOER>
IFNDEF	LUUO22,<LUUO22=$UUOER>
IFNDEF	LUUO23,<LUUO23=$UUOER>
IFNDEF	LUUO24,<LUUO24=$UUOER>
IFNDEF	LUUO25,<LUUO25=$UUOER>
IFNDEF	LUUO26,<LUUO26=$UUOER>
IFNDEF	LUUO27,<LUUO27=$UUOER>
IFNDEF	LUUO30,<LUUO30=$UUOER>
IFNDEF	LUUO31,<LUUO31=$UUOER>
IFNDEF	LUUO32,<LUUO32=$UUOER>
IFNDEF	LUUO33,<LUUO33=$UUOER>
	LIST
UUODIS:	LUUO1,,$UUOER
	LUUO3,,LUUO2
	LUUO5,,LUUO4
	LUUO7,,LUUO6
	LUUO11,,LUUO10
	LUUO13,,LUUO12
	LUUO15,,LUUO14
	LUUO17,,LUUO16
	LUUO21,,LUUO20
	LUUO23,,LUUO22
	LUUO25,,LUUO24
	LUUO27,,LUUO26
	LUUO31,,LUUO30
	LUUO33,,LUUO32

; **********************************************************************
;MEMORY MANAGMENT STORAGE
; **********************************************************************

DF22F:	0		;DF10 CONTROL FLAG, 0 = 18, -1 = 22 BIT
MAPNEW:	0		;MEMORY MAPPING CONTROL FLAG, -1 = 4096K MAPPING
MEMTOT:	0		;TOTAL MEMORY SIZE IN K (1024.)
MEMLOW:	0		;LOWEST USABLE MEMORY
MEMSIZ:	BLOCK ^D41	;MEMORY SEGMENT POINTER TABLE

; **********************************************************************
;PRINT CONTROL STORAGE
; **********************************************************************

PNTFLG:	0		;PRINT FLAG, -1 WHILE IN PRINT ROUTINE
PNTENB:	0		;PRINT ENABLE
PDISF:	0		;PRINT DISABLED FLAG
PNTINH:	0		;INHIBIT PRINT INPUT CHECKS
PNTSPC:	0		;PRINT SPACE CONTROL
OPTIME:	0		;TYPE-IN WAIT TIME
$TWCNT:	0		;TIME WAITED
$DVOFF:	0		;LOGICAL DEVICE INITED FLAG
TTYFIL:	0		;TTY EXEC FILLERS FLAG
TTYSPD:	0		;TTY EXEC BAUD RATE
$TTCHR:	0		;ACTUAL TYPED IN CHAR
$CHRIN:	0		;UPPER CASED & PARITY STRIPPED CHAR
$TYPNB:	0		;TYPED IN NUMBER
$CRLF:	0		;FREE CR/LF FLAG
$TABF:	0		;TAB CONVERSION FLAG
$FFF:	0		;FORM FEED CONVERSION FLAG
$VTF:	0		;VERTICAL TAB CONVERSION FLAG
USRLFF:	0		;USER LF FILLERS
USRCRF:	0		;USER CR FILLERS
; **********************************************************************
;THE FOLLOWING MISCELLANEOUS PRINT CHARACTERS ARE INCLUDED
;TO FACILITATE PRINTING AND ARE CALLED AS FOLLOWS:
;	MOVEI	NAME
;	PNTA		;OR PNTAF
; **********************************************************************

CRLF:	ASCII/
/
CRLF2:	ASCII/

/
COMMA:	ASCII/,/
PERIOD:	ASCII/./
SPACE:	ASCII/ /
TAB:	ASCII/	/
MINUS:
HYPEN:	ASCII/-/
PLUS:	ASCII/+/
AST:	ASCII/*/
ATSIN:	ASCII/@/
LFP:	ASCII/(/
RTP:	ASCII/)/
BELL:	BYTE (7) 007
QUEST:	ASCII/?/
SLASH:	ASCII!/!
DOLLAR:	ASCII/$/
RADIX:	^D10			;DECIMAL PRINT RADIX
RADLSP:	40			;DECIMAL PRINT LEADING CHAR
RADLSC:	^D10			;DECIMAL PRINT LEADING CHAR COUNT

; **********************************************************************
;USER MODE OUTPUT FILE INFORMATION
; **********************************************************************

$OBUF:	BLOCK	3		;LOGICAL FILE OUTPUT BUFFER HEADER
$OUTNM:	SIXBIT	/PRINT/		;FILE NAME
$OUTEX:	SIXBIT	/PNT/		;FILE NAME EXTENSION
	BLOCK	2

; **********************************************************************
;DISK UPDATE MODE FILE INFORMATION
; **********************************************************************

$IBUF:	BLOCK	3
$INNM:	SIXBIT	/PRINT/
$INEXT:	SIXBIT	/PNT/
	BLOCK	2
; **********************************************************************
;PUSHDOWN LIST CONTROL INFORMATION
; **********************************************************************

PLIST:	PLIST-PLISTE,,PLIST
PLISTS:	BLOCK	200
PLISTE:	0		;END OF PUSHDOWN LIST

; **********************************************************************
;POWER LINE CLOCK FREQUENCY FLAG
; **********************************************************************

CYCL60:	0	;0 = 60, -1 = 50 CYCLE

; **********************************************************************
;KL10 CACHE CONTROL FLAGS
; **********************************************************************

CSHFLG:	0	;ALLOW CACHE IF 0
CSHMEM:	0	;CACHE MEMORY SEGMENTS IF 0

; **********************************************************************
;NUMBER INPUT DIGIT FLAG
; **********************************************************************

TTNBRF:	0	;-1 IF ANY DIGIT TYPED

; **********************************************************************
;KL10 & KI10 "INHPAG" SWITCH PAGING PREVENTION
; **********************************************************************

PVPAGI:	0	;IF NON-ZERO, OVERRIDE "INHPAG" SWITCH ACTION

; **********************************************************************
;ERROR REPORTING ROUTINE ADDITIONAL USERS CONTROL INSTRUCTIONS
; **********************************************************************

%ERHI1:	0	;IF NON-ZERO, XCT'D AT START OF %ERUUO
%ERHI2:	0	;IF NON-ZERO, XCT'D AT END OF %ERUUO
%ERHI3:	0	;IF NON-ZERO, XCT'D AFTER "PC" OF %ERUUO

; **********************************************************************
;SPECIAL USERS UUO INTERCEPT INSTRUCTION
; **********************************************************************

$$UUO:	0	;IF NON-ZERO, XCT'D AT START OF $UORTN
; **********************************************************************
;USER MODE MONITOR TYPE FLAG
; **********************************************************************

MONTYP:	0	;0 = TOPS10, -1 = TOPS20

;*********************************************************************^
;*KL10 PROCESSOR TYPE FLAG, 0=P0, 1=BBD NEW, 2=BBD OLD
;*********************************************************************^

KLTYP:	0

; **********************************************************************
;SPECIAL USERS MUUO INTERCEPT INSTRUCTION
; **********************************************************************

$$MUUO:	0	;IF NON-ZERO, XCT'D AT START OF MUUOER

; **********************************************************************
;SPECIAL USERS USER MODE OUTPUT ERROR INTERCEPT INSTUCTION
; **********************************************************************

$$OUTER:0	;IF NON-ZERO, XCT'D AT END OF USER MODE ERROR

; **********************************************************************
;"SWITCH" CALL USAGE CONTROL
; **********************************************************************

$$TOGGLE:0	;IF NON-ZERO, USE C(CONSW) FOR SWITCHES

; **********************************************************************
;SPECIAL USERS ALTMODE SWITCH CALL INTERCEPT INSTRUCTIONS
; **********************************************************************

$$TAX1:	0	;IF NON-ZERO, XCT'D AT START OF ALTMODE SWITCH CALL
$$TAX2:	0	;IF NON-ZERO, XCT'D AT END OF ALTMODE SWITCH CALL

; **********************************************************************
;SM10 (KS-10) PROCESSOR TYPE FLAG
; **********************************************************************

SM10:	0	;IF -1 THIS IS A KS-10

; **********************************************************************
;RIGHT HALF SWITCHES PROMPT TABLE ADDRESS
; **********************************************************************

SWPTAB:	0	;0 = NO PROMPT, ADR = ADR OF SIXBIT PROMPT TABLE

; **********************************************************************
;SPECIAL FUTURE EXPANSION ROOM
; **********************************************************************

; **********************************************************************
;END OF FIXED STORAGE
; **********************************************************************

	LOC	30577
ENDFIX:	0		;END OF FIXED STORAGE

SUBTTL	DIAGNOSTIC SECTION

EXIT:	;DROPDV		;CLOSE LOGICAL OUTPUT FILE
	;EXIT

PGMNAM:	ASCIZ/
PDP-10  KA10 BASIC INSTRUCTION DIAGNOSTIC (13) [DAKAM]
/

;INITIALIZE SUBROUTINES

	LOC	30621

START:	;PGMINT
	;MOVE	[ASCIZ/AM/]
	;MOVEM	TLET		;INITIALIZE TEST LETTER

STARTA:	JRST	G00		;GO PERFORM DIAGNOSTIC

;	GENERAL DESCRIPTION
;PART   IA   -BTYE LOGIC TESTS
;PART   IB   -GENERAL BYTE TEST
;PART	II   -GENERAL BLOCK TRANSFER TEST
;PART	III   -GENERAL JFFO TEST
SUBTTL	PART IA - BYTE MANIPULATION


;PART IA - BYTE LOGIC TESTS
;INST-IBP
;TEST ABILITY TO FCE PSE AND DECODE
;PFIELD=14
;SFIELD=6
;BYTEWORD=0,-1
;DESTAC=0
;AN ERROR WILL OCCUR IF AC DIFFERS FROM 0
;FOLLOWING IBP

G00:	AC=5
	SAVEAC	(1,1)

G100:	MOVSI	AC+1,140600	;SETUP PNTR WORD
	MOVEI	,-1		;SETUP BYTE WORD
	SETZ	AC,		;SETUP DEST AC
	IBP	,<AC+1>&17	;INC PNTR WORD
	SKIPE	AC&17		;TEST AC DIFFERS FROM 0
	ER3	AC,101		;FCE PSE FAILED
	JUMPL	AC+2,G100	;LOOP ON ERROR SWITCH

;INST-IBP
;TEST ABILITY TO INCREMENT BYTE PNTR
;WITHOUT AFFECTING BYTE WORD
;PFIELD=14
;SFIELD=6
;BYTE ADDRESS=AC0
;AN ERROR WILL OCCUR IF C(AC0) DIFFERS
;FROM ORIGINAL FOLLOWING IBP

	AC=14
	SAVEAC	(1,1)

G200:	SETO	AC-2,		;SETUP FOR COMPARISON
	MOVSI	AC+1,140600	;SETUP PNTR WORD
	SETO			;SETUP BYTE WORD (AC0)
	IBP	,<AC+1>&17	;INC BYTE PNTR
	CAME	,<AC-2>&17	;TEST BYTE WORD
	ER12	,201		;BYTE WORD FAILED
	JUMPL	AC+2,G200	;LOOP ON ERROR SWITCH
;INST-IBP
;PFIELD=22
;SFIELD=6
;AN ERROR WILL OCCUR IF POINTER IS NOT INCREMENTED

	AC=13
	SAVEAC	(1,1)

G300:	MOVSI	AC-2,060600	;SETUP FOR COMPARISON
	MOVSI	AC+1,140600	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT PNTR
	CAME	AC+1,<AC-2>&17	;TEST PNTR INC
	ER5	AC+1,301	;POINTER FAILED
	JUMPL	AC+2,G300	;LOOP ON ERROR SWITCH

;INST - IBP
;PFIELD=16
;SFIELD=6

	AC=12
	SAVEAC	(1,1)

G400:	MOVSI	AC-2,100600	;SETUP FOR COMPARISON
	MOVSI	AC+1,160600	;SETUP PNTR
	IBP	,<AC+1>&17	;INCREMENT PNTR
	CAME	AC+1,<AC-2>&17	;TEST PFIELD
	ER5	AC+1,401	;POINTER FAILED
	JUMPL	AC+2,G400	;LOOP ON ERROR SWITCH
;INST-IBP
;TEST ABILITY TO TRANSFER INCREMENTED
;PFIELD
;TEST JAM-ZERO'S
;PFIELD=77
;SFIELD=1,2,4,10,20,40
;TEST JAM-ONE'S
;PFIELD=6,14,30,60,40
;SFIELD=3,6,14,30,20

	AC=10
	SAVEAC	(1,1)

SN=600
	ZZ=40
	YY=4000

G600:	REPEAT	^D6,<
SN=SN+1
	ZZ=ZZ+ZZ
	YY=YY+YY
	MOVSI	AC-2,770000+ZZ-YY	;SETUP FOR COMPARISON
	MOVSI	AC+1,770000+ZZ	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT BYTE PNTR
	CAME	AC+1,<AC-2>&17	;TEST PFIELD
	ER5	AC+1,SN		;BIT UNDER TEST FAILED
	JUMPL	AC+2,.-5	;LOOP ON ERROR SWITCH
>
	AC=11
	SAVEAC	(1,1)

				;TEST AR1(1)
G700:	MOVSI	AC-2,202000	;SETUP FOR COMPARISON
	MOVSI	AC+1,402000	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT PNTR
	CAME	AC+1,<AC-2>&17	;TEST PFIELD
	ER5	AC+1,701	;POINTER FAILED TO INCREMENT CORRECTLY
	JUMPL	AC+2,G700	;LOOP ON ERROR SWITCH

				;TEST AR2(1)
G1000:	MOVSI	AC-2,303000	;SETUP FOR COMPARISON
	MOVSI	AC+1,603000	;SETUP PNTR
	IBP	,<AC+1>&17	;INCREMENT PNTR
	CAME	AC+1,<AC-2>&17	;TEST PFIELD
	ER5	AC+1,1001	;POINTER FAILED TO INCREMENT CORRECTLY
	JUMPL	AC+2,G1000	;LOOP ON ERROR SWITCH

G1100:	MOVSI	AC-2,141400	;SETUP FOR COMPARISON
	MOVSI	AC+1,301400	;SETUP PNTR
	IBP	,<AC+1>&17	;INCREMENT PNTR
	CAME	AC+1,<AC-2>&17	;TEST PFIELD
	ER5	AC+1,1101	;POINTER FAILED TO INCREMENT CORRECTLY
	JUMPL	AC+2,G1100	;LOOP ON ERROR SWITCH

				;TEST AR4(1)
G1200:	MOVSI	AC-2,060600	;SETUP FOR COMPARISON
	MOVSI	AC+1,140600	;SETUP PNTR
	IBP	,<AC+1>&17	;INCREMENT PNTR
	CAME	AC+1,<AC-2>&17	;TEST PFIELD
	ER5	AC+1,1201	;POINTER FAILED TO INCREMENT CORRECTLY
	JUMPL	AC+2,G1200	;LOOP ON ERROR SWITCH

				;TEST AR5(1)
G1300:	MOVSI	AC-2,030300	;SETUP FOR COMPARISON
	MOVSI	AC+1,060300	;SETUP PNTR
	IBP	,<AC+1>&17	;INCREMENT PNTR
	CAME	AC+1,<AC-2>&17	;TEST P FIELD
	ER5	AC+1,1301	;POINTER FAILED TO INCREMENT CORRECTLY
	JUMPL	AC+2,G1300	;LOOP ON ERROR SWITCH
;INST-IBP
;PFIELD=5
;SFIELD=10

	AC=5
	SAVEAC	(1,1)

G1400:	MOVSI	AC-2,341000	;SETUP FOR COMPARISON
	MOVSI	AC+1,051000	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT PNPR
	TRZ	AC+1,1		;CREAR ADDRESS FIELD OF POINTER
	CAME	AC+1,<AC-2>&17	;TEST P FIELD
	ER5	AC+1,1401	;POINTER FAILED
	JUMPL	AC+2,G1400	;LOOP ON ERROR SWITCH
PAGE
;INST - IBP
;TEST ABILITY TO TRANSFER PFIELD
;PRELIMINARY - TEST FOR PRESENCE
; OF PULSE
;PFIELD=16
;SFIELD=6

	AC=5
	SAVEAC	(1,1)

G1500:	MOVSI	AC-2,100600	;SETUP FOR COMPARISON
	MOVSI	AC+1,160600	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT BYTE PNTR
	TRZ	AC+1,1		;CLEAR BIT 35
	CAME	AC+1,<AC-2>&17	;TEST PFIELD
	ER5	AC+1,1501	;POINTER FAILED
	JUMPL	AC+2,G1500	;LOOP ON ERROR SWITCH
;INST-IBP
;TEST ABILITY TO TRANSFER PFIELD
;TEST ABILITY TO SET INDIVIDUAL
;SC BITS 3-8
;PFIELD=1,2,4,10,20,40
;SFIELD=1,2,4,10,20,40

	AC=14
	SAVEAC	(1,1)
				;TEST SC BIT 8 SET
G1600:	MOVSI	AC-2,000100	;SETUP FOR COMPARISON
	MOVSI	AC+1,010100	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT BYTE PNTR
	TRZ	AC+1,1		;CLEAR BIT 35
	CAME	AC+1,<AC-2>&17	;TEST BIT 8
	ER5	AC+1,1601	;POINTER FAILED
	JUMPL	AC+2,G1600	;LOOP ON ERROR SWITCH

				;TEST SC BIT 7 SET
G1700:	MOVSI	AC-2,000200	;SETUP FOR COMPARISON
	MOVSI	AC+1,020200	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT BYTE PNTR
	TRZ	AC+1,1		;CLEAR BIT 35
	CAME	AC+1,<AC-2>&17	;TEST BIT 7
	ER5	AC+1,1701	;POINTER FAILED
	JUMPL	AC+2,G1700	;LOOP ON ERROR SWITCH

				;TEST SC BIT 6 SET
G2000:	MOVSI	AC-2,000400	;SETUP FOR COMPARISON
	MOVSI	AC+1,040400	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT BYTE PNTR
	TRZ	AC+1,1		;CLEAR BIT 35
	CAME	AC+1,<AC-2>&17	;TEST BIT 6
	ER5	AC+1,2001	;POINTER FAILED
	JUMPL	AC+2,G2000	;LOOP ON ERROR SWITCH

				;TEST SC BIT 5 SET
G2100:	MOVSI	AC-2,001000	;SETUP FOR COMPARISON
	MOVSI	AC+1,101000	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT BYTE PNTR
	TRZ	AC+1,1		;CLEAR BIT 35
	CAME	AC+1,<AC-2>&17	;TEST BIT 5
	ER5	AC+1,2101	;POINTER FAILED
	JUMPL	AC+2,G2100	;LOOP ON ERROR SWITCH

				;TEST SC BIT 4 SET
G2200:	MOVSI	AC-2,002000	;SETUP FOR COMPARISON
	MOVSI	AC+1,202000	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT BYTE PNTR
	TRZ	AC+1,1		;CLEAR BIT 35
	CAME	AC+1,<AC-2>&17	;TEST BIT 4
	ER5	AC+1,2201	;POINTER FAILED
	JUMPL	AC+2,G2200	;LOOP ON ERROR SWITCH
				;TEST SC BIT 3 SET
G2300:	MOVSI	AC-2,004000	;SETUP FOR COMPARISON
	MOVSI	AC+1,404000	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT BYTE PNTR
	TRZ	AC+1,1		;CLEAR BIT 35
	CAME	AC+1,<AC-2>&17	;TEST BIT 3
	ER5	AC+1,2301	;POINTER FAILED
	JUMPL	AC+2,G2300	;LOOP ON ERROR SWITCH
;INST-IBP
;TEST ABILITY TO SET SC BITS 3,6
;PFIELD=6
;SFIELD=10
;FAILURE OF BIT 3 TO SET RESULTS IN A
;PFIELD=74
;FAILURE OF BIT 6 TO SET RESULTS IN
;A PFEILD=30
;SC BIT2 IS NOT TESTED-FAILURE TO SET
;BIT 2 RESULTS IN LOOPING

	AC=13
	SAVEAC	(1,1)

G2400:	MOVSI	AC-2,341000	;SETUP FOR COMPARISON
	MOVSI	AC+1,061000	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT PNTR
	TRZ	AC+1,1		;CLEAR BIT 35
	CAME	AC+1,<AC-2>&17	;TEST SC3 (1)
	ER5	AC+1,2401	;POINTER FAILED
	JUMPL	AC+2,G2400	;LOOP ON ERROR SWITCH
;INST-IBP
;TEST ABILITY TO CLEAR INDIVIDUAL
;SC BITS
;PFIELD=20,10,2,1
;SFIELD=21,11,3,2
;FAILURE TO CLEAR SC BITS 4,5,7
;OR 8 RESULTS IN A PFIELD=43
;FAILURE TO CLEAR SC BITS 3 OR 6
;WILL NOT BE APPARENT

	AC=11
	SAVEAC	(1,1)

				;TEST SC4 CLEARING
G2600:	MOVSI	AC-2,232100	;SETUP FOR COMPARISON
	MOVSI	AC+1,202100	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT PNTR
	TRZ	AC+1,1		;CLEAR BIT 35
	CAME	AC+1,<AC-2>&17	;TEST PFIELD=43
	ER5	AC+1,2601	;POINTER FAILED
	JUMPL	AC+2,G2600	;LOOP ON ERROR SWITCH

				;TEST SC5 CLEARING
G2700:	MOVSI	AC-2,331100	;SETUP FOR COMPARISON
	MOVSI	AC+1,101100	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT PNTR
	TRZ	AC+1,1		;CLEAR BIT 35
	CAME	AC+1,<AC-2>&17	;TEST PFIELD=45
	ER5	AC+1,2701	;POINTER FAILED
	JUMPL	AC+2,G2700	;LOOP ON ERROR SWITCH

				;TEST SC 7 CLEARING
G3000:	MOVSI	AC-2,410300	;SETUP FOR COMPARISON
	MOVSI	AC+1,020300	;SETUP PNTR
	IBP	,<AC+1>&17	;INCREMENT PNTR
	TRZ	AC+1,1		;CLEAR BIT 35
	CAME	AC+1,<AC-2>&17	;TEST PFIELD=43
	ER5	AC+1,3001	;POINTER FAILED
	JUMPL	AC+2,G3000	;LOOP ON ERROR SWITCH

				;TEST SC8 CLEARING
G3100:	MOVSI	AC-2,420200	;SETUP FOR COMPARISON
	MOVSI	AC+1,010200	;SETUP PNTR
	IBP	,<AC+1>&17	;INCREMENT PNTR
	TRZ	AC+1,1		;CLEAR BIT 35
	CAME	AC+1,<AC-2>&17	;TEST PFIELD=43
	ER5	AC+1,3101	;POINTER FAILED
	JUMPL	AC+2,G3100	;LOOP ON ERROR SWITCH
;INST-IBP
;TEST ABILITY TO INCREMENT ADDRESS
;FIELD OF PNTR WORD
;PFIELD=6
;SFIELD=10
;LOSS OF THE SFIELD AND AN ADDRESS=1

	AC=12
	SAVEAC	(1,1)

G3200:	MOVSI	AC-2,341000	;SETUP AC-2
	AOJ	AC-2,.+1	;FOR COMPARISON
	MOVSI	AC+1,061000	;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INC PNTR WORD
	CAME	AC+1,<AC-2>&17	;TEST FOR ERROR PNTR
	ER5	AC+1,3201	;POINTER FAILED
	JUMPL	AC+2,G3200	;LOOP ON ERROR SWITCH

;INST-IBP
;TEST ABILITY TO INCREMENT
;ADDRESS FIELD OF PNTR WORD
;PFIELD=6
;SFIELD=10

	AC=11
	SAVEAC	(1,1)

G3300:	HRLI	AC-2,341000	;SETUP AC-2 FOR
	HRRI	AC-2,<AC+1>&17	;COMPARISON
	HRLI	AC+1,061000	;SETUP BYTE
	HRRI	AC+1,AC&17		;PNTR WORD
	IBP	,<AC+1>&17	;INCREMENT PNTR
	CAME	AC+1,<AC-2>&17	;TEST ADDRESS
	ER5	AC+1,3301	;POINTER FAILED
	JUMPL	AC+2,G3300	;LOOP ON ERROR SWITCH
;INST-LDB
;TEST ABILITY TO FCE (2ND PART)
;FAILURE TO FCE RESULTS IN LOSS
;OF DATA WORD
;PFIELD=0
;SFIELD=6
;BYTE WORD=0,777777
;DEST AC=0

	AC=14
	SAVEAC	(1,1)

G3400:	HRLI	AC+1,000600	;SETUP BYTE
	HRRI	AC+1,5		;PNTR WORD
	MOVEI	5,-1		;SETUP BYTE WORD
	SETZ	AC,		;CLEAR DEST AC
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAIE	AC,77		;TEST DEST AC=0,,77
	ER3	AC,3401		;AC FAILED
	JUMPL	AC+2,G3400	;LOOP ON ERROR SWITCH

;INST-LDB
;P FIELD =14
;S FIELD =6
;BYTE WORD =-1

	AC=11
	SAVEAC	(1,1)

G3500:	HRRZI	AC-2,77		;SETUP FOR COMPARISON
	MOVSI	AC+1,140600	;SETUP PNTR
	SETO			;SETUP BYTE WORD
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAME	AC,<AC-2>&17	;TEST BYTE=0,,77
	ER3	AC,3501		;AC FAILED
	JUMPL	AC+2,G3500	;LOOP ON ERROR SWITCH
;INST-LDB
;PFIELD=14
;SFIELD=6
;BYTE WORD = 777777

	AC=6
	SAVEAC	(1,1)

G3600:	MOVSI	AC+1,140600	;SETUP PNTR WORD
	MOVEI	,-1		;SETUP BYTE WORD (AC0)
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAIE	AC,77		;TEST DEST AC
	ER3	AC,3601		;AC FAILED
	JUMPL	AC+2,G3600	;LOOP ON ERROR SWITCH
;INST-LDB
;TEST ABILITY TO TRANSFER 2'S COMP
;SFIELD
;TEST ABILITY TO SET INDIVIDUAL
;BITS OF SC
;PFIELD=0
;SFIELD=40,20,10,4,2,1
;BYTE WORD=-1

	AC=5
	SAVEAC	(1,1)
				;TEST SC 1,2,3 SET
G3700:	HRLOI	AC-2,37777	;SETUP FOR COMPARISON
	MOVSI	AC+1,4000	;SETUP PNTR WORD
	SETO			;SETUP BYTE WORD (AC0)
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAME	AC,<AC-2>&17	;TEST BYTE=37777,,777777
	ER3	AC,3701		;AC FAILED
	JUMPL	AC+2,G3700	;LOOP ON ERROR SWITCH

				;TEST SC4 SET
G4000:	HRRZI	AC-2,177777	;SETUP FOR COMPARISON
	MOVSI	AC+1,2000	;SETUP PNTR WORD
	SETO			;SETUP BYTE WORD (AC0)
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAME	AC,<AC-2>&17	;TEST BYTE=0,,177777
	ER3	AC,4001		;AC FAILED
	JUMPL	AC+2,G4000	;LOOP ON ERROR SWITCH

				;TEST SC5 SET
G4100:	MOVEI	AC-2,377	;SETUP FOR COMPARISON
	MOVSI	AC+1,1000	;SETUP PNTR WORD
	SETO			;SETUP BYTE WORD (AC0)
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAME	AC,<AC-2>&17	;TEST BYTE = 0,,377
	ER3	AC,4101		;AC FAILED
	JUMPL	AC+2,G4100	;LOOP ON ERROR SWITCH

				;TEST SC6 SET
G4200:	MOVEI	AC-2,17	;SETUP FOR COMPARISON
	MOVSI	AC+1,400	;SETUP PNTR WORD
	SETO			;SETUP BYTE WORD (AC0)
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAME	AC,<AC-2>&17	;TEST BYTE=0,,17
	ER3	AC,4201		;AC FAILED
	JUMPL	AC+2,G4200	;LOOP ON ERROR SWITCH
				;TEST SC 7 SET
G4300:	MOVEI	AC-2,3		;SETUP FOR COMPARISON
	MOVSI	AC+1,200	;SETUP PNTR WORD
	SETO			;SETUP BYTE WORD (AC0)
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAME	AC,<AC-2>&17	;TEST BYTE=0,,3
	ER3	AC,4301		;AC FAILED
	JUMPL	AC+2,G4300	;LOOP ON ERROR SWITCH

				;TEST SC 8 SET
G4400:	MOVEI	AC-2,1		;SETUP FOR COMPARISON
	MOVSI	AC+1,100	;SETUP PNTR WORD
	SETO			;SETUP BYTE WORD (AC0)
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAME	AC,<AC-2>&17	;TEST BYTE=0,,1
	ER3	AC,4401		;AC FAILED
	JUMPL	AC+2,G4400	;LOOP ON ERROR SWITCH
;INST-LDB
;PFIELD=6
;SFIELD=14
;BYTE WORD=000000007700

	AC=14
	SAVEAC	(1,1)

G4600:	MOVEI	AC-2,77		;SETUP FOR COMPARISON
	MOVSI	AC+1,061400	;SETUP PNTR WORD
	MOVEI	,7700		;SETUP BYTE WORD
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAME	AC,<AC-2>&17	;TEST BYTE =77
	ER3	AC,4601		;AC FAILED
	JUMPL	AC+2,G4600	;LOOP ON ERROR SWITCH
;INST-LDB
;PFIELD=6
;SFIELD=6
;BYTEWORD=-1

	AC=13
	SAVEAC	(1,1)

G4700:	MOVEI	AC-2,77		;SETUP FOR COMPARISON
	MOVSI	AC+1,060600	;SETUP PNTR
	SETO			;SETUP BYTE WORD
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAME	AC,<AC-2>&17	;TEST BYTE=0,,77
	ER3	AC,4701		;AC FAILED
	JUMPL	AC+2,G4700	;LOOP ON ERROR SWITCH

;INST-LDB
;TEST IR 134-7
;PFIELD=14
;SFIELD=6
;BYTE WORD=-1
;AN ERROR WILL OCCUR IF PC IS INCREMENTED
;TWICE DURING EXECUTION OF LDB

	AC=10
	SAVEAC	(1,1)

G5000:	MOVSI	AC+1,140600	;SETUP PNTR WORD
	SETO			;SETUP BYTE WORD (AC0)
	LDB	AC,<AC+1>&17	;LOAD BYTE
	JRST	,.+2		;PC+1 INH ASSERTED
	ER3	AC,5001		;AC FAILED
	JUMPL	AC+2,G5000	;LOOP ON ERROR SWITCH
;INST-LDB
;TEST ABILITY TO CLEAR BYF6
;PFIELD=14
;SFIELD=6
;BYTE WORD=-1
;AN ERROR WILL OCCUR IF BYF6(1) WHEN STORED
;BY JSP

	AC=7
	SAVEAC	(1,1)

G5100:	MOVSI	AC+1,140600	;SETUP PNTR WORD
	SETO			;SETUP BYTE WORD
	LDB	AC,<AC+1>&17	;LOAD BYTE
	JSP	AC,.+1		;STORE FLAGS
	TLNE	AC,020000	;TEST BIT 4
	ER3	AC,5101		;AC FAILED
	JUMPL	AC+2,G5100	;LOOP ON ERROR SWITCH

;INST-LDB
;TEST ABILITY TO DEFER (INDIRECT) BYTE
;PNTR ADDRESS
;FAILURE TO INDIRECTLY ADDRESS BYTE
;PNTR RESULTS IN AN ERROR BYTE
;PFIELD=0
;SFIELD=6
;ERROR BYTE=14
;CORRECT BYTE=44
;AN ERROR WILL OCCUR IF DEST AC=14
;FOLLOWING LOAD BYTE INDIRECTLY ADDRESSED

	AC=6
	SAVEAC	(1,1)

G5200:	MOVSI	AC+1,600	;SETUP PNTR WORD
	HRLI	,600		;SETUP INDIRECT ADDRESS
	HRRI	,14		;PNTR WORD (AC0)
	MOVEI	AC+6,44		;SETUP CORR BYTE WORD
	LDB	AC,@<AC+1>&17	;LOAD BYTE INDIRECTLY
	CAIE	AC,44		;TEST FOR CORR BYTE
	ER3	AC,5201		;INDIRECT ADDRESSING FAILED
	JUMPL	AC+2,G5200	;LOOP ON ERROR SWITCH
;INST-LDB
;TEST IR RT CLR AT6
;FURTHER TEST OF IR 134-7
;TEST ABILITY TO CLEAR IR BITS 13-17 FOLLOWING
;DEFERRING OR INDEXING OF BYTE PNTR ADDR
;PFIELD=6
;SFIELD=14
;CORR BYTE WORD=222222
;DEST AC=4
;AN ERROR WILL OCCUR IF DEST AC
;EQUALS 5555 FOLLOWING LOAD BYTE

	AC=7
	SAVEAC	(1,1)

G5300:	MOVSI	AC+5,061400	;SETUP INDEXED PNTR WORD
	MOVEI	AC,4		;SETUP INDEX AC
	MOVEI	,222222		;SETUP CORR BYTE WORD
	MOVEI	AC-3,555555	;SETUP CORR BYTE WORD
	LDB	AC,<AC+1>&17(AC)	;LOAD BYTE INDEXED
	CAIE	AC,2222		;TEST FOR CORR BYTE
	ER3	AC,5301		;AC FAILED
	JUMPL	AC+2,G5300	;LOOP ON ERROR SWITCH

;INST-LDB
;FURTHER TEST OF IR 134-7
;TEST ABILITY TO INDEX BYTE WORD ADDRESS
;P FIELD=0
;S FIELD=6
;FAILURE RESULTS IN IR14-17=0,
;NO INDEX, ERROR BYTE=55

	AC=10
	SAVEAC	(1,1)

G5400:	HRLI	AC+1,000607	;SETUP BYTE
	HRRI	AC+1,5		;PNTR WORD
	MOVEI	7,10		;SETUP INDEX AC
	MOVEI	5,55		;SETUP NON INDEX BYTE WORD
	MOVEI	15,77		;SETUP INDEXED BYTE WORD
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAIE	AC,77		;TEST BYTE=0,,77
	ER3	AC,5401		;AC FAILED
	JUMPL	AC+2,G5400	;LOOP ON ERROR SWITCH
;INST-LDB
;TEST ABILITY TO INDEX BYTE WORD ADDRESS
;P FIELD=0
;S FIELD=6
;FAILURE RESULTS IN A BYTE WORD
;ADDRESS EQUAL TO CONTENTS OF
;INDEX AC(=AC)

	AC=10
	SAVEAC	(1,1)

G5500:	HRLI	AC+1,000607	;SETUP BYTE
	HRRI	AC+1,5		;PNTR WORD
	SETZB	AC,5		;CLEAR DEST AC'S
	MOVEI	7,10		;SETUP INDEX AC
	MOVEI	15,77		;SETUP BYTE WORD
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAIE	AC,77		;TEST FOR BYTE
	ER3	AC,5501		;AC FAILED
	JUMPL	AC+2,G5500	;LOOP ON ERROR SWITCH

;INST-LDB
;TEST ABILITY TO INDEX BYTE WORD ADDRESS
;P FIELD=0
;S FIELD=6
;FAILURE RESULTS IN AN INDEX AC EQUAL
;TO INDEX AC+AC(AC7+AC10=AC17)

	AC=10
	SAVEAC	(1,1)

G5600:	HRLI	AC+1,000607	;SETUP BYTE
	HRRI	AC+1,5		;PNTR WORD
	MOVEI	6,10		;SETUP INDEX AC
	MOVEI	15,15		;SETUP BYTE WORD
	MOVEI	16,5		;SETUP ERROR INDEX AC
	MOVEI	14,14		;SETUP ERROR BYTE WORD
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAIE	AC,15		;TEST BYTE=15
	ER3	AC,5601		;AC FAILED
	JUMPL	AC+2,G5600	;LOOP ON ERROR SWITCH
;INST-LDB
;TEST ABILITY TO INDEX BYTE WORD ADDRESS
;P FIELD=0
;S FIELD=6
;FAILURE RESULTS IN INDEXING BY C(AC0)

	AC=10
	SAVEAC	(1,1)

G5700:	HRLI	AC+1,000607	;SETUP BYTE
	HRRI	AC+1,5		;PNTR WORD
	MOVEI	7,10		;SETUP INDEX AC
	MOVEI	15,15		;SETUP BYTE WORD
	MOVEI	,7		;SETUP ERROR INDEX AC
	MOVEI	14,33		;SETUP ERROR BYTE WORD
	LDB	AC,AC+1		;LOAD BYTE
	CAIE	AC,15		;TEST BYTE=0,,15
	ER3	AC,5701		;AC FAILED
	JUMPL	AC+2,G5700	;LOOP ON ERROR SWITCH

;INST-ILDB
;TEST ABILITY TO ASSERT BYTE PTRINC
;P FIELD=16
;S FIELD=6
;FAILURE TO ASSERT MAY RESULT IN A HALT
;AT ET0
;AN ERROR WILL OCCUR IF PNTR WORD
;EQUALS ORIGINAL FOLLOWING ILDB

	AC=5
	SAVEAC	(1,1)

G6000:	MOVSI	AC-2,100600	;SETUP FOR COMPARISON
	MOVSI	AC+1,160600	;SETUP PNTR WORD
	ILDB	AC,<AC+1>&17	;INC AND LOAD BYTE
	CAME	AC+1,<AC-2>&17	;TEST PNTR=ORIGINAL
	ER4	AC+1,6001	;PNTR FAILED TO INCREMENT
	JUMPL	AC+2,G6000	;LOOP ON ERROR SWITCH

;INST-ILDB
;TEST LB BYTE LOAD
;TEST BYF5 SET
;P FIELD=22
;S FIELD=22
;BYTE WORD=000000777777
;FAILURE RESULTS IN A BYTE EQUAL
;TO BYTE WORD.

	AC=14
	SAVEAC	(1,1)

G6100:	MOVSI	AC-2,002200	;SETUP FOR COMPARISON
	MOVSI	AC+1,222200	;SETUP PNTR WORD
	MOVEI	,-1		;SETUP BYTE WORD
	ILDB	AC,<AC+1>&17	;INC AND LOAD BYTE
	CAME	,AC		;TEST BYTE=000000777777
	ER12	,6101		;BYTE WORD FAILED
	CAME	AC+1,<AC-2>&17	;TEST PNTR WORD
	ER5	AC+1,6101	;POINTER FAILED
	JUMPL	AC+2,G6100	;LOOP ON ERROR SWITCH

;INST-ILDB
;P FIELD=22
;S FIELD=6
;BYTE WORD=0000007700000
;FAILURE RESULTS IN A BYTE
;=0

	AC=13
	SAVEAC	(1,1)

G6200:	MOVSI	AC-2,140600	;SETUP FOR COMPARISON
	MOVSI	AC+1,220600	;SETUP PNTR WORD
	MOVEI	,770000		;SETUP BYTE WORD (AC0)
	ILDB	AC,<AC+1>&17	;INC AND LOAD BYTE
	CAIE	AC,77		;TEST BYTE
	ER3	AC,6201		;AC FAILED
	CAME	AC+1,<AC-2>&17	;TEST PNTR WORD
	ER5	AC+1,6201	;POINTER FAILED
	JUMPL	AC+2,G6200	;LOOP ON ERROR SWITCH

;INST-DPB
;TEST ABILITY TO ASSERT BYF5 SET
;P FIELD
;P=14
;S=6
;BYTE WORD=000000000077
;DEST WORD=000000000000

	AC=12
	SAVEAC	(1,1)

G6300:	MOVEI	AC-2,770000	;SETUP FOR COMPARISON
	MOVSI	AC+1,140600	;SETUP PNTR WORD
	MOVEI	AC,77		;SETUP BYTE
	SETZ			;SETUP DEST WORD
	DPB	AC,<AC+1>&17	;DEPOSIT BYTE (AC0)
	CAME	,<AC-2>&17	;TEST DEST=0,,770000
	ER12	,6301		;BYTE W0RD FAILED
	JUMPL	AC+2,G6300	;LOOP ON ERROR SWITCH

;INST-DPB
;TEST ABILITY TO ASSERT DPBYTE DEP
;P FIELD=14
;S FIELD=6
;BYTE WORD=55
;DEST WORD=-1
;FAILURE OF MQ TO SHIFT RESULTS IN A
;DEPOSIT BYTE=777777777700

	AC=7
	SAVEAC	(1,1)

G6400:	HRROI	AC-2,557777	;SETUP AC-2 FOR COMPARISON
	MOVSI	AC+1,140600	;SETUP PNTR WORD
	MOVEI	AC,55		;SETUP BYTE WORD
	SETO			;SETUP DEST WORD
	DPB	AC,<AC+1>&17	;DEPOSIT BYTE (AC0)
	CAME	,<AC-2>&17	;TEST DEST=-1,,557777
	ER12	,6401		;BYTE WORD FAILED
	JUMPL	AC+2,G6400	;LOOP ON ERROR SWITCH
;INST-DPB
;TEST ABILITY TO AND MASK, BYTE
;P FIELD=14
;S FIELD=6
;BYTE WORD=5555
;DEST WORD=0
;FAILURE RESULTS IN A DEPOSIT
;BYTE=000055550000

	AC=5
	SAVEAC	(1,1)

G7000:	HRRZI	AC-2,550000	;SETUP AC-2 FOR COMPARISON
	HRRI	AC-2,550000	;FOR COMPARISON
	MOVSI	AC+1,140600	;SETUP PNTR WORD
	MOVEI	AC,5555		;SETUP BYTE WORD
	SETZ			;SETUP DEST WORD
	DPB	AC,<AC+1>&17	;DEPOSIT BYTE (AC0)
	CAME	,<AC-2>&17	;TEST DEST WORD=0,,550000
	ER12	,7001		;BYTE WORD FAILED
	JUMPL	AC+2,G7000	;LOOP ON ERROR SWITCH

;INST-DPB
;P FIELD = 6
;S FIELD = 14
;BYTE WORD=55
;DEST WORD = -1
;FAILURE OF ANY ONE RESULTS IN A
;BYTE = 777777 000077

	AC=14
	SAVEAC	(1,1)

G7100:	HRROI	AC-2,5577		;SETUP FOR COMPARISON
	MOVSI	AC+1,061400	;SETUP PNTR WORD
	MOVEI	AC,55		;SETUP BYTE WORD
	SETO			;SETUP DEST WORD
	DPB	AC,<AC+1>&17	;DEPOSIT BYTE (AC0)
	CAME	,<AC-2>&17	;TEST BYTE=777777 005577
	ER12	,7101		;BYTE WORD FAILED
	JUMPL	AC+2,G7100	;LOOP ON ERROR SWITCH

;INST-DPB
;P FIELD=14
;S FIELD=6
;BYTE WORD=55
;DEST WORD=0
;FAILURE RESULTS IN A DEPOSIT
;BYTE=777777557777

	AC=13
	SAVEAC	(1,1)

G7200:	HRRZI	AC-2,550000	;SETUP FOR COMPARISON
	MOVSI	AC+1,140600	;SETUP PNTR WORD
	MOVEI	AC,55		;SETUP BYTE WORD
	SETZ			;SETUP DEST WORD
	DPB	AC,<AC+1>&17	;DEPOSIT BYTE (AC0)
	CAME	,<AC-2>&17	;TEST DEST WORD=0,,550000
	ER12	,7201		;BYTE WORD FAILED
	JUMPL	AC+2,G7200	;LOOP ON ERROR SWITCH
;INST-DBP
;P FIELD=22
;S FIELD=6
;BYTE WORD=5555
;DEST WORD=-1
;FAILURE RESULTS IN A DEPOSIT
;BYTE=005455777777

	AC=11
	SAVEAC	(1,1)

G7400:	HRLOI	AC-2,777755	;SETUP FOR COMPARISON
	MOVSI	AC+1,220600	;SETUP PNTR WORD
	MOVEI	AC,5555		;SETUP BYTE WORD
	SETO			;SETUP DEST WORD
	DPB	AC,<AC+1>&17	;DEPOSIT BYTE (AC0)
	CAME	,<AC-2>&17	;TEST DEST WORD=777755,,-1
	ER12	,7401		;BYTE WORD FAILED
	JUMPL	AC+2,G7400	;LOOP ON ERROR SWITCH
;INST-DPB
;TEST ABILITY TO CLEAR BYF6
;P FIELD=14
;S FIELD=6
;BYTE WORD=55
;DEST WORD=0
;AN ERROR WILL OCCUR IF BYF6(1) WHEN
;STORED BY JSP

	AC=7
	SAVEAC	(1,1)

G7600:	MOVSI	AC+1,140600	;SETUP PNTR WORD
	MOVEI	AC,55		;SETUP BYTE WORD
	SETZ			;SETUP DEST WORD
	DPB	AC,<AC+1>&17	;DEPOSIT BYTE
	JSP	AC,.+1		;STORE FLAGS
	TLNE	AC,020000	;TEST BIT 4
	ER13	AC,7601		;BYF6 FAILED TO CLEAR
	JUMPL	AC+2,G7600	;LOOP ON ERROR SWITCH

;INST-IDPB
;TEST ABILITY TO ASSERT BYTE PTRINC
;TEST ABILITY TO ASSERT DB BYTE DEP
;FAILURE TO ASSERT BYTE PTR INC
;MAY CAUSE A HALT AT ET0
;FAILURE TO ASSERT DB BYTE DEP PREVENTS
;ARMQSHLT SCT3 (2ND PART)
;P FIELD=22
;S FIELD=6
;DEST WORD=0
;BYTE WORD=77
;AN ERROR WILL OCCUR IF BYTE PNTR
;WORD EQUALS ORIGINAL
;AN ERROR WILL OCCUR IF DEST WORD
;EQUALS BYTE WORD

	AC=5
	SAVEAC	(1,1)

G7700:	MOVSI	AC-2,140600	;SETUP FOR COMPARISON
	MOVSI	AC+1,220600	;SETUP PNTR WORD
	MOVEI	AC,77		;SETUP BYTE WORD
	SETZ			;SETUP DEST WORD (AC0)
	IDPB	AC,<AC+1>&17	;INC AND DEPOSIT BYTE
	CAME	AC+1,<AC-2>&17	;TEST FOR INCREMENTED PNTR
	ER5	AC+1,7701	;BYTE PTR INC FAILED
	CAIE	,770000		;TEST DEST WORD
	ER12	,7701		;DB BYTE DEP FAILED
	JUMPL	AC+2,G7700	;LOOP ON ERROR SWITCH
SUBTTL	PART IB-GENERAL BYTE TEST

;PART IA- GENERAL BYTE TEST

;INST-IBP
;DECREASING P FIELD
;P FIELD=22,20,16,14,12
;S FIELD=6
;RESULTANT P FIELDS=14,12,10,6,4
;AN ERROR WILL OCCUR ON AN
;INCORRECT INCREMENTED PNTR WORD

	AC=5
	SAVEAC	(1,1)

SN=10000
	XX=160600
	ZZ=240600

		;TEST IBP
G10000:	REPEAT	^D5,<
SN=SN+1
	XX=XX-020000
	ZZ=ZZ-020000
	MOVSI	AC-2,XX		;SETUP FOR COMPARISON
	MOVSI	AC+1,ZZ		;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INC BYTE PNTR
	CAME	AC+1,<AC-2>&17	;TEST INC PNTR
	ER5	AC+1,SN		;IBP FAILED
	JUMPL	AC+2,.-5	;LOOP ON ERROR SWITCH
>
PAGE
;INST-IBP
;DECREASING S FIELD
;P FIELD=22
;S FIELD=14,12,10,6,4
;RESULTANT P FIELDS=6,10,12,14,16
;AN ERROR WILL OCCUR ON AN
;INCORRECT INCREMENTED PNTR WORD

	AC=14
	SAVEAC	(1,1)

SN=10100
	XX=040000
	WW=001600
	ZZ=221600

		;TEST IBP
G10100:	REPEAT	^D5,<
SN=SN+1
	XX=XX+020000
	WW=WW-000200
	ZZ=ZZ-000200
	MOVSI	AC-2,XX+WW	;SETUP FOR COMPARISON
	MOVSI	AC+1,ZZ		;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INC BYTE PNTR
	CAME	AC+1,<AC-2>&17	;TEST INC PNTR
	ER5	AC+1,SN		;IBP FAILED
	JUMPL	AC+2,.-5	;LOOP ON ERROR SWITCH
>

;INST-IBP
;OVERFLOW AND INC ADDRESS
;P FIELD=0
;S FIELD=14,12,10,6,4
;RESULTANT P FIELDS=30,32,34,36,40
;ADDRESS FIELD INCREMENTED BY ONE
;AN ERROR WILL OCCUR ON AN INCORRECT
;INCREMENTED PNTR WORD

	AC=13
	SAVEAC	(1,1)

SN=10200
	XX=260000
	ZZ=001600

		;TEST IBP
G10200:	REPEAT	^D5,<
SN=SN+1
	XX=XX+020000
	ZZ=ZZ-000200
	MOVSI	AC-2,XX+ZZ	;SETUP AC-2
	AOJ	AC-2,		;FOR COMPARISON
	MOVSI	AC+1,ZZ		;SETUP PNTR WORD
	IBP	,<AC+1>&17	;INC BYTE PNTR
	CAME	AC+1,<AC-2>&17	;TEST INC PNTR
	ER5	AC+1,SN		;IBP FAILED
	JUMPL	AC+2,.-6	;LOOP ON ERROR SWITCH
>
PAGE
;INST-LDB
;INCREASING S FIELD
;P FIELD=22
;S FIELD=1,2,3,4,5
;BYTE WORD=777777000000
;AN ERROR WILL OCCUR IF AN
;IN CORRECT BYTE IS LOADED
;INTO AC

	AC=12
	SAVEAC	(1,1)

SN=10300
	XX=220000
	ZZ=0

		;TEST LDB
G10300:	REPEAT	^D5,<
SN=SN+1
	XX=XX+000100
	ZZ=ZZ*2+1
	MOVSI	AC+1,XX		;SETUP PNTR WORD
	HRLZI	,-1		;SETUP BYTE WORD (AC0)
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAIE	AC,ZZ		;TEST DEST AC
	ER3	AC,SN		;LDB FAILED
	JUMPL	AC+2,.-5	;LOOP ON ERROR SWITCH
>

;INST-LDB
;INCREASING BYTE WORD
;INCREASING P FIELD
;P FIELD=14,17,22,25,33
;S FIELD=3
;BYTE WORD=000000070000 SHIFTING
;LEFT BY 3
;AN ERROR WILL OCCUR IF DEST AC
;DIFFERS FROM 7

	AC=11
	SAVEAC	(1,1)

SN=10400
	XX=0
	ZZ=110300

		;TEST LDB
G10400:	REPEAT	^D5,<
SN=SN+1
	XX=XX+3
	ZZ=ZZ+030000
	MOVSI	AC+1,ZZ		;SETUP PNTR WORD
	MOVEI	,7000		;SETUP BYTE WORD
	ROT	,XX		;ROTATE LEFT BY 3
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAIE	AC,7		;TEST DEST AC=7
	ER3	AC,SN		;LDB FAILED
	JUMPL	AC+2,.-6	;LOOP ON ERROR SWITCH
>

;INST-LDB
;VARY BYTE ADDRESS
;P FIELD=22
;S FIELD=3
;BYTE WORD=AC NUMBER
;BYTE PNTR ADDR=AC 6,5,4,3,2
;AN ERROR WILL OCCUR IF C(DEST AC)
;DIFFERS FROM AC UNDER TEST

	AC=7
	SAVEAC	(1,1)

SN=10500
	ZZ=7

		;TEST LOAD BYTE
G10500:	REPEAT	^D5,<
SN=SN+1
	ZZ=ZZ-1
	HRLI	AC+1,220300	;SETUP BYTE
	HRRI	AC+1,ZZ		;PNTR WORD
	MOVSI	ZZ,ZZ		;SETUP BYTE WORD
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAIE	AC,ZZ		;TEST DEST AC=AC NUMBER
	ER3	AC,SN		;LDB FAILED
	JUMPL	AC+2,.-6	;LOOP ON ERROR SWITCH
>
PAGE
;INST-LDB
;BYTE PNTR INDEXED
;P FIELD=0
;S FIELD=3
;BYTE WORD=PNTR WORD
;AN ERROR WILL OCCUR IF LOADED
;BYTE DIFFERS FROM CURRENT
;AC NUMBER

	AC=10
	SAVEAC	(1,1)

SN=10600
	ZZ=0

		;TEST LDB INDEXED
G10600:	REPEAT	^D5,<
SN=SN+1
	ZZ=ZZ+1
	MOVSI	,000300		;SETUP NON IND PNTR WORD
	HRLI	ZZ,000300	;SETUP INDEXED
	HRRI	ZZ,ZZ		;PNTR WORD
	LDB	AC,(ZZ)		;LOAD BYTE INDEXED
	CAIE	AC,ZZ		;TEST FOR AC NUMBER
	ER3	AC,SN		;LDB FAILED
	JUMPL	AC+2,.-6	;LOOP ON ERROR SWITCH
>

;INST-LDB
;BYTE PNTR INDIRECTLY ADDRESSED
;P FIELD=0
;S FIELD=3
;BYTE WORD=PNTR WORD
;AN ERROR WILL OCCUR IF LOADED
;BYTE DIFFERS FROM CURRENT
;AC NUMBER

	AC=7
	SAVEAC	(1,1)

SN=10700
	ZZ=0

		;TEST LDB INDIRECTLY ADDRESSED
G10700:	REPEAT	^D5,<
SN=SN+1
	ZZ=ZZ+1
	MOVSI	AC+1,440300	;SETUP DIRECTLY ADDRESSED PNTR WORD
	HRRI	AC+1,ZZ		;SETUP INDIRECT ADDRESS
	HRLI	ZZ,000300	;SETUP INDIRECTLY ADDRESSED
	HRRI	ZZ,ZZ		;PNTR WORD
	SETZ			;SETUP DIRECTLY ADDRESSED BYTE WORD
	LDB	AC,@<AC+1>&17	;LOAD BYTE INDIRECTLY ADDRESSED
	CAIE	AC,ZZ		;TEST FOR AC NUMBER
	ER3	AC,SN		;LDB INDIRECTLY ADDRESSED FAILED
	JUMPL	AC+2,.-10	;LOOP ON ERROR SWITCH
>
;INST-LDB
;PNTR INDEXED AND INDIRECTLY ADDRESSED
;P FIELD=0
;S FIELD=6
;PNTR WORD IS IN AC 12,13,14
;BYTE WORD=PNTR WORD
;LOADED BYTE SHOULD EQUAL
;12,13,14

	AC=10
	SAVEAC	(1,1)

SN=11000
	VV=3
	WW=6
	XX=11
	ZZ=3

		;TEST LDB INDEXED, INDIRECTLY ADDRESSED
G11000:	REPEAT	^D3,<
SN=SN+1
	VV=VV+1
	WW=WW+1
	XX=XX+1
	ZZ=ZZ+1
	MOVEI	VV,WW		;SETUP INDEX AC
	MOVEI	WW,XX		;SETUP INDIRECT AC
	HRLI	XX,000600	;SETUP INDEXED AND
	HRRI	XX,XX		;INDIRECT PNTR WORD
	LDB	AC,@(ZZ)	;LOAD BYTE INDEXED, INDIRECTLY ADDRESSED
	CAIE	AC,XX		;TEST LOAD BYTE=12,13,14
	ER3	AC,SN		;LDB INDEXED, INDIRECTLY ADDRESSEDD FAILED
	JUMPL	AC+2,^D8	;LOOP ON ERROR SWITCH
>

;INST-LDB
;INDEX BYTE ADDRESS
;P FIELD=0
;S FIELD=6
;INDEX AC=AC7
;BYTE WORD ADDRESS=AC 7,10,11,12,13
;AN ERROR WILL OCCUR IF LOADED BYTE
;DIFFERS CURRENT AC

	AC=4
	SAVEAC	(1,1)

SN=11100
	ZZ=6

		;TEST LDB BYTE ADDR INDEXED
G11100:	REPEAT	^D5,<
SN=SN+1
	ZZ=ZZ+1
	MOVSI	AC+1,000607	;SETUP PNTR WORD
	MOVEI	AC+3,ZZ		;SETUP INDEX AC
	MOVEI	ZZ,ZZ		;SETUP BYTE WORD
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAIE	AC,ZZ		;TEST BYTE=7,10,11,12,13
	ER3	AC,SN		;LDB FAILED
	JUMPL	AC+2,.-6	;LOOP ON ERROR SWITCH
>
PAGE
;INST-LDB
;BYTE INDIRECTLY ADDRESSED
;P FIELD=0
;S FIELD=6
;BYTE WORD ADDRESS=AC7,10,11,12,13
;AN ERROR WILL OCCUR IF LOADED
;BYTE DIFFERS FROM CURRENT AC

	AC=4
	SAVEAC	(1,1)

SN=11200
	ZZ=6

		;TEST LDB, BYTE INDIRECTLY ADDRESSED
G11200:	REPEAT	^D5,<
SN=SN+1
	ZZ=ZZ+1
	MOVSI	AC+1,000620	;SETUP PNTR WORD
	MOVEI	,ZZ		;SETUP DEFER ADDRESS
	MOVEI	ZZ,ZZ		;SETUP BYTE WORD
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAIE	AC,ZZ		;TEST BYTE=7,10,11,12,13
	ER3	AC,SN		;LDB FAILED
	JUMPL	AC+2,.-6	;LOOP ON ERROR SWITCH
>

;INST-LDB
;BYTE ADDRESS INDEXED AND INDIRECT
;P FIELD=0
;S FIELD=6
;BYTE ADDRESS=AC13,14,15
;BYTE WORD=13,14,15
;AN ERROR WILL OCCUR IF LOADED
;BYTE DIFFERS FROM CURRENT AC

	AC=4
	SAVEAC	(1,1)

SN=11300
	XX=12
	ZZ=7

		;TEST LDB, BYTE ADDR INDEXED AND INDIRECT
G11300:	REPEAT	^D3,<
SN=SN+1
	XX=XX+1
	ZZ=ZZ+1
	MOVSI	AC+1,000627	;SETUP PNTR WORD
	MOVEI	AC+3,ZZ		;SETUP INDEX AC
	MOVEI	ZZ,XX		;SETUP INDIRECT ADDR
	MOVEI	XX,XX		;SETUP BYTE WORD
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAIE	AC,XX		;TEST BYTE=13,14,15
	ER3	AC,SN		;LDB FAILED
	JUMPL	AC+2,.-7	;LOOP ON ERROR SWITCH
>

;INST-ILDB
;DECREASING P FIELD
;P FIELD=44,36,30,22,14
;S FIELD=6
;BYTE ADDRESS=AC0
;AN ERROR WILL OCCUR IF AC DIFFERS
;FROM 77

	AC=5
	SAVEAC	(1,1)

SN=11400
	XX=520600
	ZZ=0

		;TEST ILDB
G11400:	REPEAT	^D5,<
SN=SN+1
	XX=XX-060000
	ZZ=ZZ-6
	MOVSI	AC+1,XX		;SETUP PNTR WORD
	MOVEI	,77		;SETUP BYTE WORD
	ROT	,ZZ		;ROTATE RIGHT
	ILDB	AC,<AC+1>&17	;INC AND LOAD BYTE
	CAIE	AC,77		;TEST AC=77
	ER3	AC,SN		;ILDB FAILED
	JUMPL	AC+2,.-6	;LOOP ON ERROR SWITCH
>
PAGE
;INST-ILDB
;INCREASING S FIELD
;CALCULATE NEW P FIELD, INCREMENT
;BYTE WORD ADDRESS
;P FIELD=0
;S FIELD=6,14,22,30,36
;AN ERROR WILL OCCUR IF AC
;DIFFERS FROM 77

	AC=14
	SAVEAC	(1,1)

SN=11500
	XX=0
	ZZ=0

		;TEST ILDB
G11500:	REPEAT	^D5,<
SN=SN+1
	XX=XX+600
	ZZ=ZZ-6
	MOVSI	AC+1,XX		;SETUP PNTR WORD
	MOVEI	1,77		;SETUP BYTE WORD
	ROT	1,ZZ		;ROTATE RIGHT BYTE WORD
	ILDB	AC,<AC+1>&17	;INC AND LOAD BYTE
	CAIE	AC,77		;TEST AC=77
	ER3	AC,SN		;ILDB FAILED
	JUMPL	AC+2,.-6	;LOOP ON ERROR SWITCH
>

;INST-ILDB
;TESTING SPECIAL POINTER
;WHICH SETS AC TO ZERO
;PFIELD=20 ORIG,64 AFTER
;SFIELD=60 ORIG,60 AFTER
;AN ERROR WILL OCCUR IF AC IS NOT ZEROED

	XX=206000

G11600:	MOVSI	AC+1,XX		;SETUP PNTR WORD
	SETOB	0,1		;SETUP BYTE WORD
	SETOM	AC		;SETUP AC FOR TEST
	ILDB	AC,<AC+1>&17	;THIS SHOULD ZERO AC
	SKIPE	AC		;TEST AC=0
	ER3	AC,11601	;ILDB FAILED
	JUMPL	AC+2,G11600	;LOOP ON ERROR SWITCH
PAGE
;INST-DPB
;INCREASING P FIELD
;P FIELD=6,14,22,30,36
;S FIELD=6
;BYTE WORD=55
;AN ERROR WILL OCCUR IF DPB
;FAILS TO DEPOSIT CORRECTLY

	AC=13
	SAVEAC	(1,1)

SN=11700
	XX=0
	ZZ=000600

		;TEST DPB
G11700:	REPEAT	^D5,<
SN=SN+1
	XX=XX+6
	ZZ=ZZ+60000
	MOVEI	AC-2,55		;SETUP AC-2
	ROT	AC-2,XX		;FOR COMPARISON
	MOVSI	AC+1,ZZ		;SETUP PNTR WORD
	SETZ			;SETUP DEST WORD
	MOVEI	AC,55		;SETUP BYTE WORD
	DPB	AC,<AC+1>&17	;DEPOSIT BYTE (AC0)
	CAME	,<AC-2>&17	;TEST DEST WORD
	ER12	,SN		;DPB FAILED
	JUMPL	AC+2,.-^D8	;LOOP ON ERROR SWITCH
>

;INST-DPB
;INCREASING P FIELD
;P FIELD = 0,6,14,22,30
;S FIELD = 6
;BYTE WORD=55 (SHIFTING LEFT 6 PLACES)
;AN ERROR WILL OCCUR IF DPB FAILS
;TO DEPOSIT CORRECTLY

	AC=12
	SAVEAC	(1,1)

SN=12000
	XX=0
	ZZ=-60000

		;TEST DPB
G12000:	REPEAT	^D5,<
SN=SN+1
	XX=XX+6
	ZZ=ZZ+060000
	IFE	ZZ,<ZZ=000600>
	MOVSI	AC-2,550000	;SETUP AC=2
	ROT	AC-2,XX		;FRO COMPARISON
	MOVSI	AC+1,ZZ		;SETUP PNTR WORD
	MOVEI	AC,55		;SETUP BYTE WORD
	SETZ			;SETUP DEST WORD
	DPB	AC,<AC+1>&17	;DEPOSIT BYTE (AC0)
	CAME	,<AC-2>&17	;TEST DEST WORD
	ER12	,SN		;DPB FAILED
	JUMPL	AC+2,.-^D8	;LOOP ON ERROR SWITCH
>
;INST-IDPB
;INCREASING S FIELD
;CALCULATE NEW P FIELD, INCREMENT
;BYTE WORD ADDRESS
;P FIELD=0
;S FIELD=6,14,22,30,36
;BYTE WORD=77
;AN ERROR WILL OCCUR IF IDPB FAILS
;TO DEPOSIT CORRECTLY

	AC=11
	SAVEAC	(1,1)

SN=12100
	XX=0
	ZZ=000000

		;TEST IDPB
G12100:	REPEAT	^D5,<
SN=SN+1
	XX=XX-6
	ZZ=ZZ+600
	MOVEI	AC-2,77		;SETUP AC-2
	ROT	AC-2,XX		;FOR COMPARISON
	MOVSI	AC+1,ZZ		;SETUP PNTR WORD
	MOVEI	AC,77		;SETUP BYTE WORD
	SETZ	1,		;SETUP DEST WORD
	IDPB	AC,<AC+1>&17	;INC AND DEPOSIT BYTE
	CAME	1,<AC-2>&17	;TEST DEST WORD
	ER12	1,SN		;IDPB FAILED
	JUMPL	AC+2,.-^D8	;LOOP ON ERROR SWITCH
>
;INST-IDPB
;P FIELD=44
;S FIELD=6
;BYTE WORD=55
;DEST WORD=-1
;AN ERROR WILL OCCUR IF IDPB
;FAILS TO DEPOSIT CORRECTLY

	AC=10
	SAVEAC	(1,1)

SN=12200
	ZZ=0

G12200:	MOVSI	AC+1,440600	;SETUP PNPR WORD
		;TEST IDPB
	REPEAT	^D5,<
SN=SN+1
	ZZ=ZZ-6
	HRLI	AC-2,-1		;SETUP AC-2
	HRRI	AC-2,-23	;FOR COMPARISON
	ROT	AC-2,ZZ		;ROTATE RIGHT BY 6
	MOVEI	AC,55		;SETUP BYTE WORD
	SETO			;SETUP DEST WORD (AC0)
	IDPB	AC,<AC+1>&17	;INC AND DEPOSIT BYTE
	CAME	,<AC-2>&17	;TEST DEST WORD
	ER12	,SN		;IDPB FAILED
	JUMPL	AC+2,.-^D8	;LOOP ON ERROR SWITCH
>
;INST-LDB-SPECIAL CASE-S GREATER THAN 44
;P FIELD=7
;S FIELD=60,40
;VERIFY THAT THE BYTE PROCESSED IS, AT MOST, 44 BITS IF S GREATER THAN 44

	AC=13
	SAVEAC	(1,1)

SN=12210
	XX=100000

		;TEST LDB
G12210:	REPEAT	2,<
SN=SN+1
	XX=XX-2000
	SETOB	0,2
	MOVE	1,[525252,,525377]	;SETUP BYTE WORD
	SETZM	AC		;CLEAR DEST WORD
	MOVE	AC+1,[XX,,1]	;SETUP POINTER
	LDB	AC,<AC+1>&17	;LOAD BYTE
	CAME	AC,[002525,,252525]	;TEST DEST WORD
	ER3	AC,SN		;LDB FAILED
	CAME	AC+1,[XX,,1]	;CHECK POINTER
	ER4	AC+1,SN		;POINTER WAS MODIFIED
	JUMPL	AC+2,.-^D9	;LOOP ON ERROR SWITCH
>
PAGE
;INST-DPB-SPECIAL CASE-S GREATER THAN 44
;P FIELD=7
;S FIELD=60,40
;VERIFY THAT THE BYTE PROCESSED IS, AT MOST, 44 BITS IF S GREATER THAN 44

SN=12220
	XX=100000

		;TEST DPB
G12220:	REPEAT	2,<
SN=SN+1
	XX=XX-2000
	SETOB	0,2
	MOVE	1,[707070,,707070]	;SETUP DEST WORD
	MOVE	AC,[323232,,232323]	;SETUP BYTE WORD
	MOVE	AC+1,[XX,,1]	;SETUP POINTER
	DPB	AC,<AC+1>&17	;DEPOSIT BYTE
	MOVEI	AC-2,[ASCIZ/C(C(E)-1) FAILED/]
	MOVE	AC-2,SPDES	;FAILURE DESCRIPTOR
	CAME	0,[-1,,-1]	;CHECK DEST WORD -1
	ER2	0,SN		;DPB FAILED
	CAME	1,[646446,,464670]	;CHECK DEST WORD
	ER12	1,SN		;DPB FAILED
	MOVEI	AC-2,[ASCIZ/C(C(E)+1) FAILED/]
	MOVEM	AC-2,SPDES	;FAILURE DSCRIPTOR
	CAME	2,[-1,,-1]	;CHECK DEST WORD +1
	ER2	2,SN		;DPB FAILED
	JUMPL	AC+2,.-^D15	;LOOP ON ERROR SWITCH
>
;VERIFY THAT THE POINTER IS NOT INCREMENTED BY "ILDB" OR "IDPB" IF 'BIS'
;IS SET; AND THAT THE SECOND PART OF THE BYTE INSTRUCTION CLEARS 'BIS'

	AC=13
	SAVEAC	(1,1)

G12300:	MOVE	AC+1,[220600,,AC-1]	;SETUP BYTE POINTER
	MOVE	AC,[707070,,707070]	;SETUP AC
	MOVE	AC-1,[112233,,445566]	;SETUP BYTE WORD
	JRSTF	@[BIS,,.+1]		;SET 'BIS' FLAG
	ILDB	AC,AC+1
	JSP	AC-2,.+1		;SAVE FLAGS
	CAIE	AC,33			;TEST DEST WORD
	ER3	AC,12301		;INCORRECT BYTE WAS LOADED
	CAME	AC+1,[220600,,AC-1]	;TEST POINTER
	ER4	AC+1,12301		;POINTER WAS INCREMENTED
	TLNE	AC-2,BIS		;EXAMINE 'BIS'
	ER13	AC-2,12301		;'BIS' WAS NOT CLEARED
	JUMPE	AC+2,G12300		;LOOP ON ERROR SWITCH

G12400:	MOVE	AC+1,[220600,,AC-1]	;SET-UP BYTE POINTER
	MOVE	AC,[707070,,707070]	;SET-UP AC
	MOVE	AC-1,[112233,,445566]	;SETUP BYTE WORD
	JRSTF	@[BIS,,.+1]		;SET 'BIS' FLAG
	IDPB	AC,AC+1
	JSP	AC-2,.+1		;SAVE FLAGS
	CAME	AC+1,[220600,,AC-1]	;TEST POINTER
	ER4	AC+1,12401		;POINTER WAS INCREMENTED
	CAME	AC-1,[112270,,445566]	;TEST BYTE WORD
	ER12	AC-1,12401		;INCORRECT BYTE WAS DEPOSITED
	TLNE	AC-2,BIS		;EXAMINE 'BIS'
	ER13	AC-2,12401		;'BIS' WAS NOT CLEARED
	JUMPL	AC+2,G12400		;LOOP ON ERROR SWITCH
;MSCL BYTE TESTS - IBP
;VERIFY THAT IBP WORKS WHEN THE POINTER IS IN AN AC

	AC=7
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G12500:	MOVSI	AC-2,170600	;SETUP POINTER
	MOVSI	AC-1,110600	;RESULT FOR COMPARISON
	IBP	<AC-2>&17		;*IBP SHOULD PLACE 110600,,0 INTO PTR
	CAME	AC-2,<AC-1>&17	;IS PTR = 110600,,0 ?
	ER5	AC-2,12501	;POINTER FAILURE
	JUMPL	AC+2,G12500	;LOOP ON ERROR SWITCH

;MSCL BYTE TESTS - IBP
;VERIFY THAT IBP WORKS WHEN THE POINTER IS IN CORE MEMORY

	AC=6
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G12510:	MOVSI	AC-2,170600
	MOVEM	AC-2,BYTBLK	;SETUP POINTER
	MOVSI	AC-2,110600	;RESULT FOR COMPARISON
	SETZ	AC-1,		;INITIALIZE FOR RESULT
	IBP	BYTBLK		;*IBP SHOULD PLACE 110600,,0 INTO PTR
	MOVE	AC-1,BYTBLK
	CAME	AC-1,<AC-2>&17	;IS PTR = 110600,,0 ?
	ER5	AC-1,12511	;POINTER FAILURE
	JUMPL	AC+2,G12510	;LOOP ON ERROR SWITCH
;MSCL BYTE TESTS - DPB
;VERIFY THAT DPB WORKS WHEN BOTH POINTER AND BYTE
;ARE IN AC'S

	AC=5
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G12600:	MOVSI	AC-2,170600	;SETUP POINTER
	HRRI	AC-2,<AC-4>&17
	MOVE	AC-3,<AC-2>&17	;POINTER FOR COMPARISON
	MOVE	AC-4,[230703,,603700]	;SETUP BYTE WORD
	MOVEI	AC,654321	;SETUP AC
	MOVE	AC-1,[230702,,103700]	;BYTE WORD FOR COMPARISON
	DPB	AC,<AC-2>&17	;DPB SHOULD PLACE 230702.103700 INTO BYTE WORD
	CAME	AC-2,<AC-3>&17	;WAS POINTER MODIFIED ?
	ER5	AC-2,12601	;FAILURE - POINTER WAS MODIFIED
	CAIE	AC,654321	;WAS AC MODIFIED?
	ER3	AC,12602	;FAILURE - AC WAS MODIFIED
	CAME	AC-4,<AC-1>&17	;WAS BYTE DEPOSITED CORRECTLY?
	ER12	AC-4,12603	;FAILURE - BYTE NOT DEPOSITED CORRECTLY
	JUMPL	AC+2,G12600	;LOOP ON ERROR SWITCH
;MSCL BYTE TESTS - DPB
;VERIFY THAT DPB WORKS WHEN POINTER IS IN AN AC AND
;BYTE IS IN CORE MEMORY

	AC=14
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G12610:	MOVSI	AC-2,170600	;SETUP POINTER
	HRRI	AC-2,BYTBLK
	MOVE	AC-3,<AC-2>&17	;POINTER FOR COMPARISON
	MOVE	AC,[230703,,603700]	;SETUP BYTE WORD
	MOVEM	AC,BYTBLK
	MOVE	AC-1,[230702,,103700]	;BYTE WORD FOR COMPARISON
	MOVEI	AC,654321	;SETUP AC
	DPB	AC,<AC-2>&17	;DPB SHOULD PLACE 230702,,103700 INTO BYTE WORD
	CAME	AC-2,<AC-3>&17	;WAS POINTER MODIFIED?
	ER5	AC-2,12611	;FAILURE - POINTER WAS MODIFIED
	CAIE	AC,654321	;WAS AC MODIFIED?
	ER3	AC,12612	;FAILURE - AC WAS MODIFIED
	MOVE	AC-5,BYTBLK
	CAME	AC-1,BYTBLK	;WAS BYTE DEPOSITED CORRECTLY?
	ER12	AC-5,12613	;FAILURE - BYTE NOT DEPOSITED CORRECTLY
	JUMPL	AC+2,G12610	;LOOP ON ERROR SWITCH
;MSCL BYTE TESTS - DPB
;VERIFY THAT DPB WORKS WHEN BYTE IS IN AN AC AND
;POINTER IS IN CORE MEMORY

	AC=13
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G12620:	MOVSI	AC-2,170600
	HRRI	AC-2,<AC-4>&17	;POINTER FOR COMPARISON
	MOVEM	AC-2,BYTBLK	;SETUP POINTER
	MOVE	AC-4,[230703,,603700]	;SETUP BYTE WORD
	MOVE	AC-1,[230702,,103700]	;BYTE WORD FOR COMPARISON
	MOVEI	AC,654321	;SETUP AC
	DPB	AC,BYTBLK	;DPB SHOULD PLACE 230702,,103700 INTO BYTE WORD
	MOVE	AC-3,BYTBLK
	CAME	AC-2,BYTBLK	;WAS POINTER MODIFIED?
	ER5	AC-3,12621	;FAILURE - POINTER WAS  MODIFIED
	CAIE	AC,654321	;WAS AC MODIFIED?
	ER3	AC,12622	;FAILURE - AC WAS MODIFIED
	CAME	AC-4,<AC-1>&17	;WAS BYTE DEPOSITED CORRECTLY?
	ER12	AC-4,12523	;FAILURE - BYTE NOT DEPOSITED CORRECTLY
	JUMPL	AC+12,G12620	;LOOP ON ERROR SWITCH

;MSCL BYTE TESTS - DPB
;VERIFY THAT DPB WORKS WHEN BOTH POINTER AND BYTE WORD ARE IN CORE MEMORY

	AC=12
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G12630:	MOVSI	AC-2,170600
	HRRI	AC-2,BYTBLK+3	;POINTER FOR COMPARISON
	MOVEM	AC-2,BYTBLK	;SETUP POINTER
	MOVE	AC-4,[230703,,603700]
	MOVEM	AC-4,BYTBLK+3	;SETUP BYTE WORD
	MOVE	AC-1,[230702,,103700]	;BYTE WORD FOR COMPARISON
	MOVEI	AC,654321	;SETUP AC
	DPB	AC,BYTBLK	;DPB SHOULD PLACE 230702,,103700 INTO BYTE WORD
	MOVE	AC-4,BYTBLK
	CAME	AC-2,BYTBLK	;WAS POINTER MODIFIED?
	ER5	AC-4,12631	;FAILURE - POINTER WAS MODIFIED
	MOVE	AC-3,BYTBLK+3
	CAME	AC-1,BYTBLK+3	;WAS BYTE DEPOSITED CORRECTLY?
	ER12	AC-3,12632	;FAILURE - BYTE NOT DEPOSITED CORRECTLY
	CAIE	AC,654321	;WAS AC MODIFIED?
	ER3	AC,12633	;FAILURE - AC WAS MODIFIED
	JUMPL	AC+2,G12630	;LOOP ON ERROR SWITCH
;MSCL BYTE TESTS - IDPB
;VERIFY THAT IDPB WORKS WHEN BOTH POINTER AND BYTE
;ARE IN AC'S

	AC=11
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G12700:	MOVSI	AC-2,250600	;SETUP POINTER
	HRRI	AC-2,<AC-4>&17
	MOVE	AC-3,<AC-2>&17
	HRLI	AC-3,170600	;POINTER FOR COMPARISON
	MOVE	AC-4,[230703,,603700]	;SETUP BYTE WORD
	MOVEI	AC,654321	;SETUP AC
	MOVE	AC-1,[230702,,103700]	;BYTE WORD FOR COMPARISON
	IDPB	AC,<AC-2>&17	;IDPB SHOULD PLACE 230702,,103700 INTO BYTE WORD
	CAME	AC-2,<AC-3>&17	;WAS POINTER INCREMENTED CORRECTLY
	ER5	AC-2,12701	;FAILURE - POINTER NOT INCREMENTED CORRECTLY
	CAIE	AC,654321	;WAS AC MODIFIED
	ER3	AC,12700	;FAILURE - AC WAS MODIFIED
	CAME	AC-4,<AC-1>&17	;WAS BYTE DEPOSITED CORRECTLY?
	ER12	AC-4,12703	;FAILURE - BYTE NOT DEPOSITED CORRECTLY
	JUMPL	AC+2,G12700	;LOOP ON ERROR SWITCH

;MSCL BYTE TESTS - IDPB
;VERIFY THAT DPB WORKS WHEN POINTER IS IN AN AC AND
;BYTE IS IN CORE MEMORY

	AC=10
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G12710:	MOVSI	AC-2,250600	;SETUP POINTER
	HRRI	AC-2,BYTBLK
	MOVE	AC-3,<AC-2>&17
	HRLI	AC-3,170600	;POINTER FOR COMPARISON
	MOVE	AC,[230703,,603700]	;SETUP BYTE WORD
	MOVEM	AC,BYTBLK
	MOVE	AC-1,[230702,,103700]	;BYTE WORD FOR COMPARISON
	MOVEI	AC,654321	;SETUP AC
	IDPB	AC,<AC-2>&17	;IDPB SHOULD PLACE 230702,,103700 INTO
				;BYTE WORD AND INCREMENT POINTER
	CAME	AC-2,<AC-3>&17	;WAS POINTER INCREMENTED CORRECTED
	ER12	AC-2,12713	;FAILURE - BYTE NOT DEPOSITED CORRECTLY
	JUMPL	AC+2,G12710	;LOOP ON ERROR SWITCH
;MSCL BYTE TESTS - IDPB
;VERIFY THAT IDPB WORKS WHEN BYTE IS IN AN AC AND
;POINTER IS IN CORE MEMORY

	AC=7
	SAVEAC	(1,1)

	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G12720:	MOVSI	AC-2,250600
	HRRI	AC-2,<AC-4>&17
	MOVEM	AC-2,BYTBLK	;SETUP POINTER
	HRLI	AC-2,170600	;POINTER FOR COMPARISON
	MOVE	AC-4,[230703,,603700]	;SETUP BYTE WORD
	MOVE	AC-1,[230702,,103700]	;BYTE WORD FOR COMPARISON
	MOVEI	AC,654321	;;SETUP AC
	IDPB	AC,BYTBLK	;IDPB SHOULD PLACE 230702,,103700 INTO
				;BYTE WORD AND INCREMENT POINTER
	MOVE	AC-3,BYTBLK
	CAME	AC-2,BYTBLK	;WAS POINTER INCREMENTED CORRECTLY
	ER5	AC-3,12721	;FAILURE - POINTER WAS NOT INCREMENTED CORRECTLY
	CAIE	AC,654321	;WAS AC MODIFIED?
	ER3	AC,12722	;FAILURE - AC WAS MODIFIED
	CAME	AC-4,<AC-1>&17	;WAS BYTE DEPOSITED CORRECTLY
	ER12	AC-4,12723	;FAILURE - BYTE NOT DEPOSITED CORRECTLY
	JUMPL	AC+2,G12720	;LOOP ON ERROR SWITCH

;MSCL BYTE TESTS - IDPB
;VERIFY THAT IDPB WORKS WHEN BOTH POINTER AND BYTE WORD ARE IN CORE MEMORY

	AC=6
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G12730:	MOVSI	AC-2,250600
	HRRI	AC-2,BYTBLK+3
	MOVEM	AC-2,BYTBLK	;SETUP POINTER
	HRLI	AC-2,170600	;POINTER FOR COMPARISON
	MOVE	AC-4,[230703,,603700]
	MOVEM	AC-4,BYTBLK+3	;SETUP BYTE WORD
	MOVE	AC-1,[230702,,103700]	;BYTE WORD FOR COMPARISON
	MOVEI	AC,654321	;SETUP AC
	IDPB	AC,BYTBLK	;IDPB SHOULD PLACE 230702,,103700 INTO
				;BYTE WORD AND INCREMENT POINTER
	MOVE	AC-4,BYTBLK
	CAME	AC-2,BYTBLK	;WAS POINTER MODIFIED?
	ER5	AC-4,12731	;FAILURE - POINTER WAS MODIFIED
	MOVE	AC-3,BYTBLK+3
	CAME	AC-1,BYTBLK+3	;WAS BYTE DEPOSITED CORRECTLY
	ER12	AC-3,12732	;FAILURE - BYTE NOT DEPOSITED CORRECTLY
	CAIE	AC,654321	;WAS AC MODIFIED
	ER3	AC,12733	;FAILURE - AC WAS MODIFIED
	JUMPL	AC+2,G12730	;LOOP ON ERROR SWITCH
;MSCL BYTE TESTS - LDB
;VERIFY THAT LDB WORKS WHEN BOTH POINTER AND BYTE
;ARE IN AC'S

	AC=5
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13000:	MOVSI	AC-2,170600	;SETUP POINTER
	HRRI	AC-2,<AC-4>&17
	MOVE	AC-3,<AC-2>&17	;POINTER FOR COMPARISON
	MOVE	AC-4,[230703,,603700] ;SETUP BYTE WORD
	SETZ	AC,		;SETUP AC
	MOVE	AC-1,<AC-4>&17	;BYTE WORD FOR COMPARISON
	LDB	AC,<AC-2>&17	;LDB SHOULD PLACE 0,,36 INTO THE AC
	CAME	AC-2,<AC-3>&17	;WAS POINTER MODIFIED?
	ER5	AC-2,13001	;FAILURE - POINTER WAS MODIFIED
	CAIE	AC,36		;WAS BYTE LOADED CORRECTLY?
	ER3	AC,13002	;FAILURE - BYTE NOT LOADED CORRECTLY.
	CAME	AC-4,<AC-1>&17	;WAS BYTE WORD MODIFIED
	ER12	AC-4,13003	;FAILURE - BYTE WORD WAS MODIFIED
	JUMPL	AC+2,G13000	;LOOP ON ERROR SWITCH

;MSCL BYTE TESTS - LDB
;VERIFY THAT LDB WORKS WHEN POINTER IS IN AN AC AND
;BYTE IS IN CORE MEMORY

	AC=14
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13010:	MOVSI	AC-2,170600	;SETUP POINTER
	HRRI	AC-2,BYTBLK
	MOVE	AC-3,<AC-2>&17	;POINTER FOR COMPARISON
	MOVE	AC-1,[230703,,603700] ;BYTE WORD FOR COMPARISON
	MOVEM	AC-1,BYTBLK	;SETUP BYTE WORD
	SETZ	AC,		;SETUP AC
	LDB	AC,<AC-2>&17	;LDB SHOULD PLACE 0,,36 INTO THE AC
	CAME	AC-2,<AC-3>&17	;WAS POINTER MODIFIED?
	ER5	AC-2,13011	;FAILURE - POINTER WAS MODIFIED
	CAIE	AC,36		;WAS BYTE LOADED CORRECTLY?
	ER3	AC,13012	;FAILURE - BYTE NOT LOADED CORRECTLY
	MOVE	AC-5,BYTBLK
	CAME	AC-1,BYTBLK	;WAS BYTE WORD MODIFIED?
	ER12	AC-5,13013	;FAILURE - BYTE WORD WAS MODIFIED
	JUMPL	AC+2,G13010	;LOOP ON ERROR SWITCH
;MSCL BYTE TESTS - LDB
;VERIFY THAT LDB WORKS WHEN BYTE IS IN AN AC AND
;POINTER IS IN CORE MEMORY.

	AC=13
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13020:	MOVSI	AC-2,170600
	HRRI	AC-2,<AC-4>&17	;POINTER FOR COMPARISON
	MOVEM	AC-2,BYTBLK	;SETUP POINTER
	MOVE	AC-4,[230703,,603700] ;SETUP BYTE WORD
	MOVE	AC-1,[230703,,603700] ;BYTE WORD FOR COMPARISON
	SETZ	AC,		;SETUP AC
	LDB	AC,BYTBLK	;LDB SHOULD PLACE 20,,36 INTO THE AC
	MOVE	AC-3,BYTBLK
	CAME	AC-2,BYTBLK	;WAS POINTER MODIFIED?
	ER5	AC-3,13021	;FAILURE - POINTER WAS MODIFIED
	CAIE	AC,36		;WAS BYTE LOADED CORRECTLY?
	ER3	AC,13022	;FAILURE - BYTE NOT LOADED CORRECTLY
	CAME	AC-4,<AC-1>&17	;WAS BYTE WORD MODIFIED?
	ER12	AC-4,13023	;FAILURE - BYTE WORD WAS MODIFIED
	JUMPL	AC+2,G13020	;LOOP ON ERROR SWITCH

;MSCL BYTE TESTS - LDB
;VERIFY THAT LDB WORKS WHEN BOTH POINTER AND BYTE WORD ARE IN CORE MEMORY.

	AC=12
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13030:	MOVSI	AC-2,170600
	HRRI	AC-2,BYTBLK+3	;POINTER FOR COMPARISON
	MOVEM	AC-2,BYTBLK	;SETUP POINTER
	MOVE	AC-4,[230703,,603700]
	MOVEM	AC-4,BYTBLK+3	;SETUP BYTE WORD
	MOVE	AC-1,[230703,,603700] ;BYTE WORD FOR COMPARISON
	SETZ	AC,		;SETUP AC
	LDB	AC,BYTBLK	;LDB SHOULD PLACE 20,,36 INTO THE AC
	MOVE	AC-4,BYTBLK
	CAME	AC-2,BYTBLK	;WAS POINTER MODIFIED?
	ER5	AC-4,13031	;FAILURE - POINTER WAS MODIFIED
	MOVE	AC-3,BYTBLK+3
	CAME	AC-1,BYTBLK+3	;WAS BYTE WORD MODIFIED?
	ER12	AC-3,13032	;FAILURE - BYTE WORD WAS MODIFIED
	CAIE	AC,36		;WAS BYTE LOADED CORRECTLY?
	ER3	AC,13033	;FAILURE - BYTE NOT LOADED CORRECTLY
	JUMPL	AC+2,G13030	;LOOP ON ERROR SWITCH
;MSCL BYTE TESTS - ILDB
;VERIFY THAT ILDB WORKS WHEN BOTH POINTER AND BYTE
;ARE IN AC'S.

	AC=11
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13100:	MOVSI	AC-2,170600	;SETUP POINTER
	HRRI	AC-2,<AC-4>&17
	MOVE	AC-3,<AC-2>&17
	HRLI	AC-3,110600	;POINTER FOR COMPARISON
	MOVE	AC-4,[230703,,603700] ;SETUP BYTE WORD
	SETZ	AC,		;SETUP AC
	MOVE	AC-1,<AC-4>&17	;BYTE WORD FOR COMPARISON
	ILDB	AC,<AC-2>&17	;ILDB SHOULD PLACE 0,,3 INTO THE AC
				;AND INCREMENT POINTER
	CAME	AC-2,<AC-3>&17	;WAS POINTER INCREMENTED CORRECTLY?
	ER5	AC-2,3101	;FAILURE - POINTER NOT INCREMENTED CORRECTLY
	CAIE	AC,3		;WAS BYTE LOADED CORRECTLY?
	ER3	AC,13102	;FAILURE - BYTE NOT LOADED CORRECTLY
	CAME	AC-4,<AC-1>&17	;WAS BYTE WORD MODIFIED?
	ER12	AC-4,13103	;FAILURE - BYTE WORD WAS MODIFIED
	JUMPL	AC+2,G13100	;LOOP ON ERROR SWITCH

;MSCL BYTE TESTS - ILDB
;VERIFY THAT ILDB WORKS WHEN POINTER IS IN AN AC AND
;BYTE IS IN CORE MEMORY

	AC=10
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13110:	MOVSI	AC-2,170600	;SETUP POINTER
	HRRI	AC-2,BYTBLK
	MOVE	AC-3,<AC-2>&17
	HRLI	AC-3,110600	;POINTER FOR COMPARISON
	MOVE	AC-1,[230703,,603700] ;BYTEWORD FOR COMPARISON
	MOVEM	AC,BYTBLK	;SETUP BYTE WORD
	SETZ	AC,		;SETUP AC
	ILDB	AC,<AC-2>&17	;ILDB SHOULD PLACE 0,,3 INTO THE AC
				;AND INCREMENT POINTER
	CAME	AC-2,<AC-3>&17	;WAS POINTER INCREMENTED CORRECTLY?
	ER5	AC-2,13111	;FAILURE - POINTER NOT INCREMENTED CORRECTLY
	CAIE	AC,3		;WAS BYTE LOADED CORRECTLY?
	ER3	AC,13012	;FAILURE - BYTE NOT LOADED CORRECTLY
	MOVE	AC-5,BYTBLK
	CAME	AC-1,BYTBLK	;WAS BYTE WORD MODIFIED?
	ER12	AC-5,13113	;FAILURE - BYTE WORD WAS MODIFIED
	JUMPL	AC+2,G13110	;LOOP ON ERROR SWITCH
;MSCL BYTE TESTS - ILDB
;VERIFY THAT ILDB WORKS WHEN BYTE IS IN AN AC AND
;POINTER IS IN CORE MEMORY

	AC=7
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13120:	MOVSI	AC-2,170600
	HRRI	AC-2,<AC-4>&17
	MOVEM	AC-2,BYTBLK	;SETUP POINTER
	HRLI	AC-2,110600	;POINTER FOR COMPARISON
	MOVE	AC-4,[230703,,603700] ;SETUP BYTE WORD
	MOVE	AC-1,[230703,,603700] ;BYTE WORD FOR COMPARISON
	SETZ	AC		;SETUP AC
	ILDB	AC,BYTBLK	;ILDB SHOULD PLACE 0,,3 INTO THE AC
				;AND INCREMENT POINTER
	MOVE	AC-3,BYTBLK
	CAME	AC-2,BYTBLK	;WAS POINTER INCREMENTED CORRECTLY?
	ER5	AC-3,13121	;FAILURE - POINTER NOT INCREMENTED CORRECTLY
	CAIE	AC,3		;WAS BYTE LOADED CORRECTLY?
	ER3	AC,13122	;FAILURE - BYTE NOT LOADED CORRECTLY
	CAME	AC-4,<AC-1>&17	;WAS BYTE WORD MODIFIED?
	ER12	AC-4,13123	;FAILURE - BYTE WORD WAS MODIFIED
	JUMPL	AC+2,G13120	;LOOP ON ERROR SWITCH

;MSCL BYTE TESTS - ILDB
;VERIFY THAT ILDB WORKS WHEN BOTH POINTER AND BYTE WORD ARE IN CORE MEMORY

	AC=6
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13130:	MOVSI	AC-2,170600
	HRRI	AC-2,BYTBLK+3
	MOVEM	AC-2,BYTBLK	;SETUP POINTER
	HRLI	AC-2,110600	;POINTER FOR COMPARISON
	MOVE	AC-4,[230703,,603700]
	MOVEM	AC-4,BYTBLK+3	;SETUP BYTE WORD
	MOVE	AC-1,[230703,,603700] ;BYTE WORD FOR COMPARISON
	SETZ	AC,		;SETUP AC
	ILDB	AC,BYTBLK	;ILDB SHOULD PLACE 0,,3 INTO THE AC
				;AND INCREMENT THE POINTER
	MOVE	AC-4,BYTBLK
	CAME	AC-2,BYTBLK	;WAS POINTER INCREMENTED CORRECTLY?
	ER5	AC-4,13131	;FAILURE - POINTER NOT INCREMENTED CORRECTLY
	MOVE	AC-3,BYTBLK+3
	CAME	AC-1,BYTBLK+3	;WAS BYTE WORD MODIFIED?
	ER12	AC-3,13132	;FAILURE - BYTE WORD WAS MODIFIED
	CAIE	AC,3		;WAS BYTE LOADED CORRECTLY?
	ER3	AC,13133	;FAILURE - BYTE NOT LOADED CORRECTLY
	JUMPL	AC+2,G13130	;LOOP ON ERROR SWITCH
;TEST LDB WHEN SIZE OF BYTE IS ZERO BITS
;THE AC SHOULD BE CLEARED

	AC=5
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13200:	MOVEI	AC-2,<AC-4>&17	;SETUP POINTER
	SETO	AC,		;SETUP AC
	HRRZI	AC-4,10		;SETUP BYTE WORD
	LDB	AC,<AC-4>&17	;LDB SHOULD CLEAR THE AC
	CAIE	AC,0		;WAS AC CLEARED?
	ER3	AC,13201	;FAILURE - AC WAS NOT CLEARED
	CAIE	AC-2,<AC-4>&17	;WAS POINTER MODIFIED?
	ER5	AC-2,13202	;FAILURE - POINTER WAS MODIFIED
	CAIE	AC-4,10		;WAS BYTE WORD MODIFIED
	ER12	AC-4,13203	;FAILURE - BYTE WORD WAS MODIFIED
	JUMPL	AC+2,G13200	;LOOP ON ERROR SWITCH

;TEST ILDB WHEN SIZE OF BYTE IS ZERO BITS
;THE AC SHOULD BE CLEARED

	AC=14
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13210:	MOVEI	AC-2,<AC-4>&17	;SETUP POINTER
	SETO	AC,		;SETUP AC
	HRRZI	AC-4,10		;SETUP BYTE WORD
	ILDB	AC,<AC-4>&17	;ILDB SHOULD CLEAR THE AC
	CAIE	AC,0		;WAS AC CLEARED
	ER3	AC,13211	;FAILURE - AC WAS NOT CLEARED
	CAIE	AC-2,<AC-4>&17	;WAS POINTER MODIFIED
	ER5	AC-2,13212	;FAILURE - POINTER WAS MODIFIED
	CAIE	AC-4,10		;WAS BYTE WORD MODIFIED?
	ER12	AC-4,13213	;FAILURE - BYTE WORD WAS MODIFIED
	JUMPL	AC+2,G13210	;LOOP ON ERROR SWITCH
;TEST DPB WHEN SIZE OF BYTE IS ZERO BITS
;THE AC SHOULD NOT BE AFFECTED

	AC=13
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13220:	MOVEI	AC-2,<AC-4>&17	;SETUP POINTER
	SETO	AC,		;SETUP AC
	HRRZI	AC-4,10		;SETUP BYTE WORD
	DPB	AC,<AC-4>&17	;DPB SHOULD NOT MODIFY ANYTHING
	CAME	AC,[-1]		;WAS AC MODIFIED?
	ER3	AC,13221	;FAILURE - AC WAS MODIFIED
	CAIE	AC-2,<AC-4>&17	;WAS POINTER MODIFIED?
	ER5	AC-2,13222	;FAILURE - POINTER WAS MODIFIED
	CAIE	AC-4,10		;WAS BYTE WORD MODIFIED?
	ER12	AC-4,13223	;FAILURE - BYTE WORD WAS MODIFIED
	JUMPL	AC+2,G13220	;LOOP ON ERROR SWITCH

;TEST IDPB WHEN SIZE OF BYTE IS ZERO BITS
;TITE AC SHOULD NOT BE AFFECTED

	AC=12
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13230:	MOVEI	AC-2,<AC-4>&17	;SETUP POINTER
	SETO	AC,		;SETUP AC
	HRRZI	AC-4,10		;SETUP BYTE WORD
	IDPB	AC,<AC-4>&17	;IDPB SHOULD NOT MODIFY ANYTHING
	CAME	AC,[-1]	;WAS AC MODIFIED?
	ER3	AC,13231	;FAILURE - AC WAS MODIFIED
	CAIE	AC-2,<AC-4>&17	;WAS POINTER MODIFIED
	ER5	AC-2,13232	;FAILURE - POINTER WAS MODIFIED
	CAIE	AC-4,10		;WAS BYTE WORD MODIFIED
	ER12	AC-4,13233	;FAILURE - BYTE WORD WAS MODIFIED
	JUMPL	AC+2,G13230	;LOOP ON ERROR SWITCH
;TEST IBP WHEN SIZE OF BYTE IS ZERO BITS
;THE AC SHOULD NOT BE AFFECTED

	AC=11
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13240:	MOVEI	AC-2,<AC-4>&17	;SETUP POINTER
	SETO	AC,		;SETUP AC
	HRRZI	AC-4,10		;SETUP BYTE WORD
	SKIPN	KLFLG
	IBP	AC,<AC-4>&17	;IBP SHOULD NOT MODIFY ANYTHING
	SKIPE	KLFLG
	IBP	0,<AC-4>&17	;KL10, DON'T DO ADJBP !
	CAME	AC,[-1]		;WAS AC MODIFIED?
	ER3	AC,13241	;FAILURE - AC WAS MODIFIED
	CAIE	AC-2,<AC-4>&17	;WASPOINTER MODIFIED?
	ER5	AC-2,13242	;FAILURE - POINTER WAS MODIFIED
	CAIE	AC-4,10		;WAS BYTE WORD MODIFIED
	ER12	AC-4,13243	;FAILURE - BYTE WORD WAS MODIFIED
	JUMPL	AC+2,G13240	;LOOP ON ERROR SWITCH
;TEST LDB WHEN SIZE OF BYTE IS ONE BIT

	AC=10
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13300:	MOVSI	AC-2,430100
	HRRI	AC-2,<AC-4>&17	;SETUP POINTER
	MOVE	AC-1,<AC-2>&17	;POINTER FOR COMPARISON
	HRROI	AC,0		;SETUP AC
	HRLZI	AC-4,-1		;SETUP BYTE WORD
	MOVE	AC-3,<AC-4>&17	;BYTE OWRD FOR COMPARISON
	LDB	AC,<AC-2>&17	;LDB SHOULD PLACE 0,,1 INTO THE AC
	CAIE	AC,1		;LOOP ON ERROR SWITCH
	ER3	AC,13301	;FAILURE - BYTE NOT LOADED CORRECTLY
	CAME	AC-2,<AC-1>&17	;WAS POINTER MODIFIED?
	ER5	AC-2,13302	;FAILURE POINTER WAS MODIFIED
	CAME	AC-4,<AC-3>&17	;WAS BYTE WORD MODIFIED?
	ER12	AC-4,13303	;FAILURE - BYTE OWRD WAS MODIFIED
	JUMPL	AC+2,G13300	;LOOP ON ERROR SWITCH

;TEST LDB WHEN SIZE OF BYTE IS ONE BIT

	AC=7
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13310:	MOVSI	AC-2,100
	HRRI	AC-2,<AC-4>&17	;SETUP POINTER
	MOVE	AC-1,<AC-2>&17	;POINTER FOR COMPARISON
	HRROI	AC,0		;SETUP AC
	HRLOI	AC-4,0		;SETUP BYTE WORD
	MOVE	AC-3,<AC-4>&17	;BYTE WORD FOR COMPARISON
	LDB	AC,<AC-2>&17	;LDB SHOULD PLACE 0,,1 INTO THE AC
	CAIE	AC,1		;LOOP ON ERROR SWITCH
	ER3	AC,13311	;FAILURE - BYTE NOT LOADED CORRECTLY
	CAME	AC-2,<AC-1>&17	;WAS POINTER MODIFIED
	ER5	AC-2,13312	;FAILURE - POINTER WAS MODIFIED
	CAME	AC-4,<AC-3>&17	;WAS BYTE WORD MODIFIED
	ER12	AC-4,13313	;FAILURE - BYTE WORD WAS MODIFIED
	JUMPL	AC+2,G13310	;LOOP ON ERROR SWITCH
;TEST DPB WHEN SIZE OF BYTE IS ONE BIT

	AC=6
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13320:	MOVSI	AC-2,430100
	HRRI	AC-2,<AC-4>&17	;SETUP POINTER
	MOVE	AC-1,<AC-2>&17	;POINTER FOR COMPARISON
	HRROI	AC,76		;SETUP AC
	MOVEM	AC,<AC-5>&17	;AC FOR COMPARISON
	SETO	AC-4,		;SETUP BYTE WORD
	MOVE	AC-3,[377777,,-1]	;BYTE WORD FOR COMPARISON
	DPB	AC,<AC-2>&17	;DPB SHOULD PLACE 377777,,-1 INTO BYTE WORD
	CAME	AC,<AC-5>&17	;WAS AC MODIFIED?
	ER3	AC,13321	;FAILURE - AC WAS MODIFIED
	CAME	AC-2,<AC-1>&17	;WAS POINTER MODIFIED
	ER5	AC-2,13322	;FAILURE - POINTER WAS MODIFIED
	CAME	AC-4,<AC-3>&17	;WAS BYTE DEPOSITED CORRECTLY
	ER12	AC-4,13323	;FAILURE - BYTE NOT DEPOSITED CORRECTLY
	JUMPL	AC+2,G13320	;LOOP ON ERROR SWITCH

;TEST DPB WHEN SIZE OF BYTE IS ONE BIT

	AC=5
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13330:	MOVSI	AC-2,100
	HRRI	AC-2,<AC-4>&17	;SETUP POINTER
	MOVE	AC-1,<AC-2>&17	;POINTER FOR COMPARISON
	HRROI	AC,76		;SETUP AC
	MOVEM	AC,<AC-5>&17	;AC FOR COMPARISON
	SETO	AC-4,		;SETUP BYTE WORD
	MOVE	AC-3,[-2]	;BYTE WORD FOR COMPARISON
	DPB	AC,<AC-2>&17	;DPB SHOULD PLACE -1,,-2 INTO BYTE WORD
	CAME	AC,<AC-5>&17	;WAS AC MODIFIED
	ER3	AC,13331	;FAILURE - AC WAS MODIFIED
	CAME	AC-2,<AC-1>&17	;WAS POINTER MODIFIED
	ER5	AC-2,13332	;FAILURE - POINTER WAS MODIFIED
	CAME	AC-4,<AC-3>&17	;WAS BYTE DEPOSITED CORRECTLY
	ER12	AC-4,13333	;FAILURE - BYTE NOT DEPOSITED CORRECTLY
	JUMPL	AC+2,G13330	;LOOP ON ERROR SWITCH
;TEST IBP WHEN S IS GREATER THAN P AND THE ADDRESS FIELD OF THE POINTER IS 777777
;IBP SHOULD CAUSE THE ADDRESS FIELD TO CLEAR AND P SHOULD BECOME 44-S

	AC=4
	SAVEAC	(1,1)
	JRSTF	@[.+1]		;CLEAR ALL FLAGS

G13400:	HRLOI	AC-2,000100	;SETUP POINTER
	HRLZI	AC-3,430101	;RESULT FOR COMPARISON (KA)
	IBP	<AC-2>&17	;IBP SHOULD PLACE 430100,,0 INTO PTR
	CAME	AC-2,<AC-3>&17	;PASS IF POINTER UPATED CORRECTLY
	ER5	AC-2,13400	;POINTER NOT UPDATED CORRECTLY
	JUMPL	AC+2,G13400	;LOOP ON ERROR SWITCH
SUBTTL	PART II - GENERAL  BLOCK TRANSFER TEST

	MOVEI	[ASCIZ/BLT FAILED/]
	MOVEM	SPDES		;INITIALIZE SPECIAL FAILURE DESCRIPTOR

;VERFIY THAT BLT WILL TRANSFER A 1 - WORD BLOCK OF ZEROS
;WHERE BOTH SOURCE AND DESTINATION BLOCKS ARE THE SAME
;AND WITHIN THE AC ADDRESS RANGE.
	AC=7
	SAVEAC	(1,1)
SN=22100
	SRCE=<AC-6>&17		;SOURCE BLOCK=AC-6
	DEST=<AC-6>&17		;DESTINATION BLOCK=AC-6
	SIZ=1			;BLOCK SIZE = 1 OWRD

G22100:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH ADR OF SRCE AND DEST
	SETOB	SRCE-1,SRCE+1	;PRELOAD SRCE-1 AND SRCE+1 WITH ONES
	SETZM	SRCE		;LOAD SRCE WITH ZEROS
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD CLEAR DEST BLOCK
SN=SN+1
	CAME	DEST-1,[-1]	;WAS DEST-1 CLOBBERRED?
	ER2	DEST-1,SN	;DEST -1 WAS CLOBBERRED
SN=SN+1
	SKIPE	DEST		;DID BLT LOAD DEST FROM SRCE?
	ER2	DEST,SN		;FAIL IF C(DEST) NON-ZERO
SN=SN+1
	CAME	DEST+1,[-1]	;WAS DEST+1 CLOBBERRED?
	ER2	DEST+1,SN	;DEST +1 WAS CLOBBERRED
	JUMPL	AC+2,G22100	;LOOP ON ERROR SWITCH
PAGE
;VERIFY THAT BLT WILL TRANSFER A 1 - WORD BLOCK OF ONES
;WHERE BOTH SOURCE AND DESTINATION BLOCKS ARE THE SAME
;AND WITHIN THE AC ADDRESS RANGE.
	AC=14
	SAVEAC	(1,1)
SN=22200
	SRCE=<AC-6>&17		;SOURCE BLOCK = AC-6
	DEST=<AC-6>&17		;DESTINATION BLOCK = AC-6
	SIZ=1			;BLOCK = 1 WORD

G22200:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH ADR OF SRCE AND DEST
	SETZB	SRCE-1,SRCE+1	;PRELOAD SRCE-1 AND SRCE+1 WITH ZEROS
	SETOM	SRCE		;LOAD SRCE WITH ONES
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DEST WITH ONES
SN=SN+1
	SKIPE	DEST-1		;WAS DEST-1 CLOBBERRED?
	ER2	DEST-1,SN	;DEST-1 WAS CLOBBERRED
SN=SN+1
	CAME	DEST,[-1]	;DID BLT LOAD DEST FROM SRCE?
	ER2	DEST,SN		;FAIL IF C(DEST) NOT ALL ONES
SN=SN+1
	SKIPE	DEST+1		;WAS DEST+1 CLOBBERRED?
	ER2	DEST+1,SN	;DEST+1 WAS CLOBBERRED
	JUMPL	AC+2,G22200	;LOOP ON ERROR SWITCH
;VERIFY THAT BLT WILL TRANSFER A 1 - WORD BLOCK OF DATA
;WHERE BOTH SOURCE AND DESTINATION BLOCKS ARE THE SAME
;AND WITHIN THE AC ADDRESS RANGE.

	AC=14
	SAVEAC	(1,1)
SN=22300
	SRCE=<AC-6>&17		;SOURCE BLOCK = AC-6
	DEST=<AC-6>&17		;DESTINATION BLOCK = AC-6
	SIZ=1			;BLOCK SIZE = 1 WORD

G22300:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH ADR OF ARCE AND DEST
	SETZB	SRCE-1,SRCE+1	;CLEAR SRCE-1 AND SRCE+1
	MOVE	SRCE,[230703,,603700]	;PRELOAD SOURCE BLOCK
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD PLACE C(SRCE) INTO DEST
SN=SN+1
	SKIPE	DEST-1		;WAS DEST-1 CLOBBERRED?
	ER2	DEST-1,SN	;DEST-1 WAS CLOBBERRED
SN=SN+1
	CAME	DEST,[230703,,603700]	;DID BLT LOAD DEST FROM SRCE
	ER2	DEST,SN		;FAIL IF C(DEST) NOT 230703,,603700
SN=SN+1
	SKIPE	DEST+1		;WAS DEST+1 CLOBBERRED?
	ER2	DEST+1,SN	;DEST+1 WAS CLOBBERRED
	JUMPL	AC+2,G22300	;LOOP ON ERROR SWITCH
PAGE
;VERIFY THAT BLT WILL TRANSFER A 1 - WORD BLOCK OF ZEROS
;WHERE BOTH SOURCE AND DESTINATION BLOCKS ARE THE SAME
;AND BEYOND THE AC ADDRESS RANGE.
	AC=14
	SAVEAC	(1,1)
SN=22400
	SRCE=BLTBLK+1		;SOURCE BLOCK = BLTBLK+1
	DEST=BLTBLK+1		;DEST BLOCK = BLTBLK+1
	SIZ=1			;BLOCK SIZE = 1 WORD

G22400:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH ADR OF SRCE AND DEST
	SETOM	SRCE-1		;PRELOAD SRCE-1 WITH ONES
	SETZM	SRCE		;LOAD SRCE WITH ZEROS
	SETOM	SRCE+1		;PRELOAD SRCE+1 WITH ONES
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD CLEAR DEST BLOCK
SN=SN+1
	MOVE	AC-1,DEST-1
	CAME	AC-1,[-1]	;WAS DEST-1 CLOBBERRED?
	ER2	AC-1,SN		;DEST-1 WAS CLOBBERRED
SN=SN+1
	MOVE	AC-1,DEST
	SKIPE	AC-1		;DID BLT LOAD DEST FROM SRCE?
	ER2	AC-1,SN		;FAIL IF C(DEST) NOT ZERO
SN=SN+1
	MOVE	AC-1,DEST+1
	CAME	AC-1,[-1]	;WAS DEST+1 CLOBBERRED?
	ER2	AC-1,SN		;DEST+1 WAS CLOBBERRED
	JUMPL	AC+1,G22400	;LOOP ON ERROR SWITCH
;VERIFY THAT BLT WILL TRANSFER A 1 - WORD BLOCK OF ONES
;WHERE BOTH SOURCE AND DESTINATION BLOCKS ARE THE SAME
;AND BEYOND THE AC ADDRESS RANGE.

	AC=13
	SAVEAC	(1,1)
SN=22500
	SRCE=BLTBLK+1		;SOURCE BLOCK = BLTBLK+1
	DEST=BLTBLK+1		;DEST BLOCK = BLTBLK+1
	SIZ=1			;BLOCK SIZE = 1 WORD

G22500:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH ADR OF SRCE AND DEST
	SETZM	SRCE-1		;PRELOAD SRCE-1 WITH ZEROS
	SETOM	SRCE		;LOAD SRCE WITH ONES
	SETZM	SRCE+1		;PRELOAD SRCE+1 WITH ZEROS
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DEST BLOCK WITH ONES
SN=SN+1
	MOVE	AC-1,DEST-1
	SKIPE	AC-1		;WAS DEST-1 CLOBBERRED?
	ER2	AC-1,SN		;DEST-1 WAS CLOBBERRED
SN=SN+1
	MOVE	AC-1,DEST
	CAME	AC-1,[-1]	;DID BLT LOAD DEST FROM SRCE?
	ER2	AC-1,SN		;FAIL IF C(DEST) NOT ALL ONES
SN=SN+1
	MOVE	AC-1,DEST+1
	SKIPE	AC-1		;WAS DEST+1 CLOBBERRED?
	ER2	AC-1,SN		;DEST+1 WAS CLOBBERRED
	JUMPL	AC+2,G22500	;LOOP ON ERROR SWITCH
PAGE
;VERIFY THAT BLT WILL TRANSFER A 1 - WORD BLOCK OF DATA
;WHERE BOTH SOURCE AND DESTINATION BLOCKS ARE THE SAME
;AND BEYOND THE AC ADDRESS RANGE.

	AC=12
	SAVEAC	(1,1)
SN=22600
	SRCE=BLTBLK+1		;SOURCE BLOCK = BLTBLK+1
	DEST=BLTBLK+1		;DEST BLOCK = BLTBLK+1
	SIZ=1			;BLOCK SIZE = 1 WORD

G22600:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH ADR OF SRCE AND DEST
	SETZM	SRCE-1		;PRELOAD SRCE-1 WITH ZEROS
	MOVE	AC+1,[230703,,603700]	;LOAD SRCE BLOCK
	MOVEM	AC+1,SRCE
	SETZM	SRCE+1		;PRELOAD SRCE+1 WITH ZEROS
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD PLACE C(SRCE) INTO DEST
SN=SN+1
	MOVE	AC-1,DEST-1
	SKIPE	AC-1		;WAS DEST-1 CLOBBERRED?
	ER2	AC-1,SN		;DEST-1 WAS CLOBBERRED
SN=SN+1
	MOVE	AC-1,DEST
	CAME	AC-1,[230703,,603700]	;DID BLT LOAD DEST FROM SRCE?
	ER2	AC-1,SN		;FAIL IF C(DEST) NOT 230703,,603700
SN=SN+1
	MOVE	AC-1,DEST+1
	SKIPE	AC-1		;WAS DEST+1 CLOBBERRED?
	ER2	AC-1,SN		;DEST+1 WAS CLOBBERRED
	JUMPL	AC+1,G22600	;LOOP ON ERROR SWITCH
;BOTH SOURCE AND DESTINATION BLOCKS HAVE AC ADDRESSES.

	BLTM1	(22700,14,<<AC-6>&17>,<<AC-3>&17>,0)
PAGE
;BOTH SOURCE AND DESTINATION BLOCKS HAVE AC ADDRESSES.

	BLTM1	(23000,13,<<AC-6>&17>,<<AC-3>&17>,-1)
PAGE
;BOTH SOURCE AND DESTINATION BLOCKS HAVE AC ADDRESSES.

	BLTM1	(23100,12,<<AC-6>&17>,<<AC-3>&17>,<230703,,603700>)
PAGE
;SOURCE BLOCK HAS AC ADDRESS, DESTINATION BLOCK HAS NON-AC ADDRESS

	BLTM1	(23200,14,<<AC-6>&17>,<BLTBLK+4>,0)
PAGE
;SOURCE BLOCK HAS AC ADDRESS, DESTINATION BLOCK HAS NON-AC ADDRESS

	BLTM1	(23300,13,<<AC-6>&17>,<BLTBLK+4>,-1)
PAGE
;SOURCE BLOCK HAS AC ADDRESS, DESTINATION BLOCK HAS NON-AC ADDRESS

	BLTM1	(23400,12,<<AC-6>&17>,<BLTBLK+4>,<230703,,603700>)
PAGE
;BOTH SOURCE AND DESTINATION BLOCKS HAVE NON-AC ADDRESSES

	BLTM1	(23500,11,<BLTBLK+1>,<BLTBLK+4>,0)
PAGE
;BOTH SOURCE AND DESTINATION BLOCKS HAVE NON-AC ADDRESSES

	BLTM1	(23600,10,<BLTBLK+1>,<BLTBLK+4>,-1)
PAGE
;BOTH SOURCE AND DESTINATION BLOCKS HAVE NON-AC ADDRESSES

	BLTM1	(23700,7,<BLTBLK+1>,<BLTBLK+4>,<230703,,603700>)
PAGE
;SOURCE BLOCK HAS NON-AC ADDRESS, DESTINATION BLOCK HAS AC ADDRESS

	BLTM1	(24000,14,<BLTBLK+1>,<<AC-6>&17>,0)
PAGE
;SOURCE BLOCK HAS NON-AC ADDRESS, DESTINATION BLOCK HAS AC ADDRESS

	BLTM1	(24100,13,<BLTBLK+1>,<<AC-6>&17>,-1)
PAGE
;SOURCE BLOCK HAS NON-AC ADDRESS, DESTINATION BLOCK HAS AC ADDRESS

	BLTM1	(24200,12,<BLTBLK+1>,<<AC-6>&17>,<230703,,603700>)
;DO A BLT WHERE SOURCE AND DESTINATION BLOCKS HAVE SAME STARTING ADDRESS
;- AC RANGE - ZEROS

	AC=14
	SAVEAC	(1,1)

SN=20100
	SRCE=<AC-10>&17		;SOURCE BLOCK STARTING ADDRESS=<AC-10>&17
	DEST=<AC-10>&17		;DESTINATION BLOCK STARTING ADDRESS=<AC-10>&17
	SIZ=5			;BLOCK SIZE=5 WORDS

G20100:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH STARTING ADDRESSES OF SOURCE
				;AND DESTINATION BLOCKS
	SETOB	SRCE-1,SRCE+SIZ	;PRELOAD SOURCE BLOCK -1 AND LAST WORD OF
				;SOURCE BLOCK +1 WITH ONES
	SETZB	SRCE,SRCE+1	;PRELOAD ALL WORDS OF SOURCE BLOCK WITH ZEROS
	SETZB	SRCE+2,SRCE+3
	SETZM	SRCE+4
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
SN=SN+1
	CAME	DEST-1,[-1,,-1]	;WAS WORD PRECEEDING FIRST WORD OF DESTINATION BLOCK
				;CLOBBERED?
	ER2	DEST-1,SN	;FAIL IF WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED?
SN=SN+1
	SKIPE	DEST		;WAS FIRST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	DEST,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	SKIPE	DEST+1		;WAS SECOND WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	DEST+1,SN	;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	SKIPE	DEST+2		;WAS THIRD WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	DEST+2,SN	;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	SKIPE	DEST+3		;WAS FOURTH WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	DEST+3,SN	;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	SKIPE	DEST+4		;WAS FIFTH WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	DEST+4,SN	;FAIL IF FIFTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+SIZ,[-1,,-1] ;WAS WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;CLOBBERED?
	ER2	DEST+SIZ,SN	;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED
	JUMPL	AC+2,G20100	;LOOP ON ERROR SWITCH
;DO A BLT WHERE SOURCE AND DESTINATION BLOCKS HAVE SAME STARTING ADDRESS
;- AC RANGE - ONES

	AC=14
	SAVEAC	(1,1)

SN=20200
	SRCE=<AC-10>&17		;SOURCE BLOCK STARTING ADDRESS=<AC-10>&17
	DEST=<AC-10>&17		;DESTINATION BLOCK STARTING ADDRESS=<AC-10>&17
	SIZ=5			;BLOCK SIZE=5 WORDS

G20200:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH STARTING ADDRESSES OF SOURCE
				;AND DESTINATION BLOCKS
	SETZB	SRCE-1,SRCE+SIZ	;PRELOAD SOURCE BLOCK -1 AND LAST WORD OF SOURCE
				;BLOCK +1 WITH ZEROS
	SETOB	SRCE,SRCE+1	;PRELOAD ALL WORDS OF SOURCE BLOCK WITH ONES
	SETOB	SRCE+2,SRCE+3
	SETOM	SRCE+4
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
SN=SN+1
	SKIPE	DEST-1		;WAS WORD PRECEEDING FIRST WORD OF DESTINATION BLOCK
				;CLOBBERED?
	ER2	DEST-1,SN	;FAIL IF WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED?
SN=SN+1
	CAME	DEST,[-1,,-1]	;WAS FIRST WORD OF DESTINATION BLOCK LOAED CORRECTLY
				;FROM SOURCE?
	ER2	DEST,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+1,[-1,,-1]	;WAS SECOND WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	DEST+1,SN	;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+2,[-1,,-1]	;WAS THIRD WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	DEST+2,SN	;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+3,[-1,,-1]	;WAS FOURTH WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	DEST+3,SN	;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+4,[-1,,-1]	;WAS FIFTH WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	DEST+4,SN	;FAIL IF FIFTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	SKIPE	DEST+SIZ	;WAS WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;CLOBBERED?
	ER2	DEST+SIZ,SN	;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED
	JUMPL	AC+2,G20200	;LOOP ON ERROR SWITCH
;DO A BLT WHERE SOURCE AND DESTINATION BLOCKS HAVE SAME STARTING ADDRESS
;- AC RANGE - SINGLE PATTERN

	AC=14
	SAVEAC	(1,1)

SN=20300
	SRCE=<AC-10>&17		;SOURCE BLOCK STARTING ADDRESS=<AC-10>&17
	DEST=<AC-10>&17		;DESTINATION BLOCK STARTING ADDRESS=<AC-10>&17
	SIZ=5			;BLOCK SIZE=5 WORDS

G20300:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH STARTING ADDRESSES OF
				;SOURCE AND DESTINATION BLOCKS
	SETOB	SRCE-1,SRCE+SIZ	;PRELOAD SOURCE BLOCK -1 AND LAST WORD OF SOURCE
				;BLOCK +1 WITH ONES
	MOVE	SRCE,[230703,,603700] ;PRELOAD ALL WORDS OF SOURCE BLOCK WITH
				;230703,,603700
	MOVE	SRCE+1,[230703,,603700]
	MOVE	SRCE+2,[230703,,603700]
	MOVE	SRCE+3,[230703,,603700]
	MOVE	SRCE+4,[230703,,603700]
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
SN=SN+1
	CAME	DEST-1,[-1,,-1]	;WAS WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	DEST-1,SN	;FAIL IF WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED?
SN=SN+1
	CAME	DEST,[230703,,603700] ;WAS FIRST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	DEST,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+1,[230703,,603700] ;WAS SECOND WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+1,SN	;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+2,[230703,,603700] ;WAS THIRD WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+2,SN	;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+3,[230703,,603700] ;WAS FOURTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+3,SN	;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+4,[230703,,603700] ;WAS FIFTH WORD OF DESTINATION BLOCK
				;NOT LOADED CORRECTLY FROM SOURCE
	ER2	DEST+4,SN	;FAIL IF FIFTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+SIZ,[-1,,-1] ;WAS WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	DEST+SIZ,SN	;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED
	JUMPL	AC+2,G20300	;LOOP ON ERROR SWITCH
;DO A BLT WHERE SOURCE AND DESTINATION BLOCKS HAVE SAME STARTING ADDRESS
;- AC RANGE - MULTIPLE PATTERN

	AC=14
	SAVEAC	(1,1)

SN=20400
	SRCE=<AC-10>&17		;SOURCE BLOCK STARTING ADDRESS=<AC-10>&17
	DEST=<AC-10>&17		;DESTINATION BLOCK STARTING ADDRESS=<AC-10>&17
	SIZ=5			;BLOCK SIZE=5 WORDS

G20400:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH STARTING ADDRESSES OF
				;SOURCE AND DESTINATION BLOCKS
	MOVE	SRCE-1,[230703,,603700] ;PRELOAD WORD PRECEEDING FIRST WORD
				;OF SOURCE BLOCK WITH 230703,,603700
	MOVE	SRCE,[252525,,252525] ;PRELOAD FIRST WORD OF SOURCE BLOCK WITH
				;252525,,252525
	MOVE	SRCE+1,[146314,,631463] ;PRELOAD SECOND WORD OF SOURCE BLOCK
				;WITH 146314,,631463
	MOVE	SRCE+2,[070707,,070707] ;PRELOAD THIRD WORD OF SOURCE BLOCK
				;WITH 070707,,070707
	MOVE	SRCE+3,[036074,,170360] ;PRELOAD FOURTH WORD OF SOURCE BLOCK
				;WITH 036074,,170360
	MOVE	SRCE+4,[017407,,603701] ;PRELOAD FIFTH WORD OF SOURCE BLOCK
				;WITH 017407,,603701
	MOVE	SRCE+SIZ,[007603,,607062] ;PRELOAD WORD FOLLOWING LAST WORD
				;OF SOURCE BLOCK WITH 007603,,607062
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
SN=SN+1
	CAME	DEST-1,[230703,,603700] ;WAS WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	DEST-1,SN	;FAIL IF WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED?
SN=SN+1
	CAME	DEST,[252525,,252525] ;WAS FIRST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	DEST,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+1,[146314,,631463] ;WAS SECOND WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+1,SN	;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+2,[070707,,070707] ;WAS THIRD WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+2,SN	;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+3,[036074,,170360] ;WAS FOURTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+3,SN	;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+4,[017407,,603701] ;WAS FIFTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+4,SN	;FAIL IF FIFTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+SIZ,[007603,,607062] ;WAS WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	DEST+SIZ,SN	;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED
	JUMPL	AC+2,G20400	;LOOP ON ERROR SWITCH
;DO A BLT WHERE SOURCE AND DESTINATION BLOCKS HAVE SAME STARTING ADDRESS
				;- NON-AC RANGE - ZEROS

	AC=13
	SAVEAC	(1,1)

SN=20500
	SRCE=BLTBLK+1		;SOURCE BLOCK STARTING ADDRESS=BLTBLK+1
	DEST=BLTBLK+1		;DESTINATION BLOCK STARTING ADDRESS=BLTBLK+1
	SIZ=5			;BLOCK SIZE=5 WORDS

G20500:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH STARTING ADDRESSES OF
				;SOURCE AND DESTINATION BLOCKS
	SETOM	SRCE-1		;PRELOAD WORD PRECEEDING FIRST WORD OF SOURCE BLOCK
				;WITH ONES
	SETZM	SRCE		;PRELOAD WORD FOLLOWING LAST WORD OF SOURCE BLOCK WITH
				;ZEROS
	SETZM	SRCE+1
	SETZM	SRCE+2
	SETZM	SRCE+3
	SETZM	SRCE+4
	SETOM	SRCE+SIZ	;PRELOAD WORD FOLLOWING LAST WORD OF SOURCE BLOCK
				;WITH ONES
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
SN=SN+1
	MOVE	AC-2,DEST-1
	CAME	AC-2,[-1,,-1]	;WAS WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	AC-2,SN		;FAIL IF WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED?
SN=SN+1
	MOVE	AC-2,DEST
	SKIPE	<AC-2>&17	;WAS FIRST WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+1
	SKIPE	<AC-2>&17	;WAS SECOND WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+2
	SKIPE	<AC-2>&17	;WAS THIRD WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+3
	SKIPE	<AC-2>&17	;WAS FOURTH WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+4
	SKIPE	<AC-2>&17	;WAS FIFTH WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FIFTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+SIZ
	CAME	AC-2,[-1,,-1]	;WAS WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;CLOBBERED?
	ER2	AC-2,SN		;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;WAS CLOBBERED
	JUMPL	AC+2,G20500	;LOOP ON ERROR SWITCH
;DO A BLT WHERE SOURCE AND DESTINATION BLOCKS HAVE SAME STARTING ADDRESS
;- NON-AC RANGE - ONES

	AC=12
	SAVEAC	(1,1)

SN=20600
	SRCE=BLTBLK+1		;SOURCE BLOCK STARTING ADDRESS=BLTBLK+1
	DEST=BLTBLK+1		;DESTINATION BLOCK STARTING ADDRESS=BLTBLK+1
	SIZ=5			;BLOCK SIZE=5 WORDS

G20600:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH STARTING ADDRESSES OF
				;SOURCE AND DESTINATION BLOCKS
	SETZM	SRCE-1		;PRELOAD WORD PRECEEDING FIRST WORD OF SOURCE BLOCK
				;WITH ZEROS
	SETOM	SRCE		;PRELOAD WORD FOLLOWING LAST WORD OF SOURCE BLOCK WITH
				;ONES
	SETOM	SRCE+1
	SETOM	SRCE+2
	SETOM	SRCE+3
	SETOM	SRCE+4
	SETZM	SRCE+SIZ	;PRELOAD WORD FOLLOWING LAST WORD OF SOURCE BLOCK
				;WITH ZEROS
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
SN=SN+1
	MOVE	AC-2,DEST-1
	SKIPE	<AC-2>&17	;WAS WORD PRECEEDING FIRST WORD OF DESTINATION BLOCK
				;CLOBBERED?
	ER2	AC-2,SN		;FAIL IF WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED?
SN=SN+1
	MOVE	AC-2,DEST
	CAME	AC-2,[-1,,-1]	;WAS FIRST WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+1
	CAME	AC-2,[-1,,-1]	;WAS SECOND WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+2
	CAME	AC-2,[-1,,-1]	;WAS THIRD WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+3
	CAME	AC-2,[-1,,-1]	;WAS FOURTH WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+4
	CAME	AC-2,[-1,,-1]	;WAS FIFTH WORD OF DESTINATION BLOCK LOADED CORRECTLY
				;FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FIFTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+SIZ
	SKIPE	<AC-2>&17	;WAS WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;CLOBBERED?
	ER2	AC-2,SN		;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;WAS CLOBBERED
	JUMPL	AC+2,G20600	;LOOP ON ERROR SWITCH
;DO A BLT WHERE SOURCE AND DESTINATION BLOCKS HAVE SAME STARTING ADDRESS
;- NON-AC RANGE - SINGLE PATTERN

	AC=11
	SAVEAC	(1,1)

SN=20700
	SRCE=BLTBLK+1		;SOURCE BLOCK STARTING ADDRESS=BLTBLK+1
	DEST=BLTBLK+1		;DESTINATION BLOCK STARTING ADDRESS=BLTBLK+1
	SIZ=5			;BLOCK SIZE=5 WORDS

G20700:	MOVE	AC,[SRCE,,DEST] ;PRELOAD AC WITH STARTING ADDRESSES OF
				;SOURCE AND DESTINATION BLOCKS
	SETOM	SRCE-1		;PRELOAD WORD PRECEEDING FIRST WORD OF SOURCE BLOCK
				;WITH ONES
	MOVE	[230703,,603700]
	MOVEM	SRCE		;PRELOAD ALL WORDS OF SOURCE BLOCK WITH 230703,,603700
	MOVEM	SRCE+1
	MOVEM	SRCE+2
	MOVEM	SRCE+3
	MOVEM	SRCE+4
	SETOM	SRCE+SIZ	;PRELOAD WORD FOLLOWING LAST WORD OF SOURCE BLOCK
				;WITH ONES
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
SN=SN+1
	MOVE	AC-2,DEST-1
	CAME	AC-2,[-1,,-1]	;WAS WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	AC-2,SN		;FAIL IF WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED?
SN=SN+1
	MOVE	AC-2,DEST
	CAME	AC-2,[230703,,603700] ;WAS FIRST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+1
	CAME	AC-2,[230703,,603700] ;WAS SECOND WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+2
	CAME	AC-2,[230703,,603700] ;WAS THIRD WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+3
	CAME	AC-2,[230703,,603700] ;WAS FOURTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FOURTH WORD OF DESTINATION BLOCK NOT LOADED CORRECTLY
				;FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+4
	CAME	AC-2,[230703,,603700] ;WAS FIFTH WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FIFTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+SIZ
	CAME	AC-2,[-1,,-1]	;WAS WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;CLOBBERED?
	ER2	AC+2,SN		;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;WAS CLOBBERED
	JUMPL	AC+2,G20700	;LOOP ON ERROR SWITCH
;DO A BLT WHERE SOURCE AND DESTINATION BLOCKS HAVE SAME STARTING ADDRESS
;- NON-AC RANGE - MULTIPLE PATTERN

	AC=10
	SAVEAC	(1,1)

SN=21000
	SRCE=BLTBLK+1		;SOURCE BLOCK STARTING ADDRESS=BLTBLK+1
	DEST=BLTBLK+1		;DESTINATION BLOCK STARTING ADDRESS=BLTBLK+1
	SIZ=5			;BLOCK SIZE=5 WORDS

G21000:	MOVE	AC,[SRCE,,DEST] ;PRELOAD AC WITH STARTING ADDRESSES OF
				;SOURCE AND DESTINATION BLOCKS
	MOVE	[230703,,603700]
	MOVEM	SRCE-1		;PRELOAD WORD PRECEEDING FIRST WORD OF SOURCE BLOCK
				;WITH 230703,,603700
	MOVE	[252525,,252525]
	MOVEM	SRCE		;PRELOAD FIRST WORD OF SOURCE BLOCK WITH 252525,,252525
	MOVE	[146314,,631463]
	MOVEM	SRCE+1		;PRELOAD SECOND WORD OF SOURCE BLOCK
				;WITH 146314,,631463
	MOVE	[070707,,070707]
	MOVEM	SRCE+2		;PRELOAD THIRD WORD OF SOURCE BLOCK WITH 070707,,070707
	MOVE	[036074,,170360]
	MOVEM	SRCE+3		;PRELOAD FOURTH WORD OF SOURCE BLOCK
				;WITH 036074,,170360
	MOVE	[017407,,603701]
	MOVEM	SRCE+4		;PRELOAD FIFTH WORD OF SOURCE BLOCK WITH 017407,,603701
	MOVE	[007603,,607062]
	MOVEM	SRCE+SIZ	;PRELOAD WORD FOLLOWING LAST WORD OF SOURCE BLOCK
				;WITH 007603,,607062
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
SN=SN+1
	MOVE	AC-2,DEST-1
	CAME	AC-2,[230703,,603700] ;WAS WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	AC-2,SN		;FAIL IF WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED?
SN=SN+1
	MOVE	AC-2,DEST
	CAME	AC-2,[252525,,252525] ;WAS FIRST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+1
	CAME	AC-2,[146314,,631463] ;WAS SECOND WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+2
	CAME	AC-2,[070707,,070707] ;WAS THIRD WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+3
	CAME	AC-2,[036074,,170360] ;WAS FOURTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+4
	CAME	AC-2,[017407,,603701] ;WAS FIFTH WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FIFTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+SIZ
	CAME	AC-2,[007603,,607062] ;WAS WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	AC-2,SN		;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;WAS CLOBBERED
	JUMPL	AC+2,G21000	;LOOP ON ERROR SWITCH
;DO A BLT WHERE DESTINATION STARTING ADDRESS EQUALS SOURCE STARTING
;ADDRESS MINUS ONE - AC RANGE - MULTIPLE PATTERN

	AC=14
	SAVEAC	(1,1)

SN=21100
	SRCE=<AC-12>&17		;SOURCE BLOCK STARTING ADDRESS= <AC-12>&17
	DEST=<AC-13>&17		;DESTINATION BLOCK STARTING ADDRESS= <AC-13>&17
	SIZ=5			;BLOCK SIZE=5 WORDS

G21100:	MOVE	AC,[SRCE,,DEST] ;PRELOAD AC WITH STARTING ADDRESSES OF
				;SOURCE AND DESTINATION BLOCKS
	SETOM	DEST-1		;PRELOAD WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WITH ONES
	MOVE	DEST,[230703,,603700] ;PRELOAD FIRST WORD OF DESTINATION BLOCK
				;WITH 230703,,603700
	MOVE	SRCE,[252525,,252525] ;PRELOAD FIRST WORD OF SOURCE BLOCK WITH
				;252525,,252525
	MOVE	SRCE+1,[146314,,631463] ;PRELOAD SECOND WORD OF SOURCE BLOCK
				;WITH 146314,,631463
	MOVE	SRCE+2,[070707,,070707] ;PRELOAD THIRD WORD OF SOURCE BLOCK
				;WITH 070707,,070707
	MOVE	SRCE+3,[036074,,170630] ;PRELOAD FOURTH WORD OF SOURCE BLOCK
				;WITH 036074,,170630
	MOVE	SRCE+4,[017407,,603701] ;PRELOAD FIFTH WORD OF SOURCE BLOCK
				;WITH 017407,,603701
	MOVE	SRCE+SIZ,[007603,,607062] ;PRELOAD WORD FOLLOWING LAST WORD
				;OF SOURCE BLOCK WITH 007603,,607062
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
SN=SN+1
	CAME	DEST-1,[-1,,-1] ;WAS WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	DEST-1,SN	;FAIL IF WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED?
SN=SN+1
	CAME	DEST,[252525,,252525] ;WAS FIRST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	DEST,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+1,[146314,,631463] ;WAS SECOND WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+1,SN	;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+2,[070707,,070707] ;WAS THIRD WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+2,SN	;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE

SN=SN+1
	CAME	DEST+3,[036074,,170630] ;WAS FOURTH WORD OF DESTINATION
				;BLOCK LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+3,SN	;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+4,[017407,,603701] ;WAS LAST WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+4,SN	;FAIL IF LAST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+SIZ,[017407,,603701] ;WAS WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	DEST+SIZ,SN	;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED
SN=SN+1
	CAME	SRCE+SIZ,[007603,,607062] ;WAS WORD FOLLOWING LAST WORD OF SOURCE
				;BLOCK CLOBBERED?
	ER2	SRCE+SIZ,SN	;FAIL IF WORD FOLLOWING LAST WORD OF SOURCE BLOCK
				;WAS CLOBBERED
	JUMPL	AC+2,G21100	;LOOP ON ERROR SWITCH
;DO A BLT WHERE DESTINATION STARTING ADDRESS EQUALS SOURCE STARTING
;ADDRESS MINUS ONE - NON-AC RANGE - MULTIPLE PATTERN

	AC=6
	SAVEAC	(1,1)

SN=21200
	SRCE=BLTBLK+2	;SOURCE BLOCK STARTING ADDRESS= BLTBLK+2
	DEST=BLTBLK+1	;DESTINATION BLOCK STARTING ADDRESS= BLTBLK+1
	SIZ=5		;BLOCK SIZE=5 WORDS

G21200:	MOVE	AC,[SRCE,,DEST] ;PRELOAD AC WITH STARTING ADDRESSES OF
				;SOURCE AND DESTINATION BLOCKS
	SETOM	DEST-1		;PRELOAD WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WITH ONES
	MOVE	[230703,,603700]
	MOVEM	DEST		;PRELOAD FIRST WORD OF DESTINATION BLOCK
				;WITH 230703,,603700
	MOVE	[252525,,252525]
	MOVEM	SRCE		;PRELOAD FIRST WORD OF SOURCE BLOCK WITH 252525,,252525
	MOVE	[146314,,631463]
	MOVEM	SRCE+1		;PRELOAD SECOND WORD OF SOURCE BLOCK
				;WITH 146314,,631463
	MOVE	[070707,,070707]
	MOVEM	SRCE+2		;PRELOAD THIRD WORD OF SOURCE BLOCK WITH 070707,,070707
	MOVE	[036074,,170630]
	MOVEM	SRCE+3		;PRELOAD FOURTH WORD OF SOURCE BLOCK
				;WITH 036074,,170630
	MOVE	[017407,,603701]
	MOVEM	SRCE+4		;PRELOAD FIFTH WORD OF SOURCE BLOCK WITH 017407,,603701
	MOVE	[007603,,607062]
	MOVEM	SRCE+SIZ	;PRELOAD WORD FOLLOWING LAST WORD OF SOURCE BLOCK
				;WITH 007603,,607062
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
;DO A BLT WHERE DESTINATION STARTING ADDRESS EQUALS SOURCE STARTING
;ADDRESS MINUS ONE - NON-AC RANGE - MULTIPLE PATTERN (CONTINUED)

SN=SN+1
	MOVE	AC-2,DEST-1
	CAME	AC-2,[-1,,-1]	;WAS WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	AC-2,SN		;FAIL IF WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED?
SN=SN+1
	MOVE	AC-2,DEST
	CAME	AC-2,[252525,,252525] ;WAS FIRST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+1
	CAME	AC-2,[146314,,631463] ;WAS SECOND WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+2
	CAME	AC-2,[070707,,070707] ;WAS THIRD WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+3
	CAME	AC-2,[036074,,170630] ;WAS FOURTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+4
	CAME	AC-2,[017407,,603701] ;WAS LAST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF LAST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+SIZ
	CAME	AC-2,[017407,,603701] ;WAS WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	AC-2,SN		;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;WAS CLOBBERED
SN=SN+1
	MOVE	AC-2,SRCE+SIZ
	CAME	AC-2,[007603,,607062] ;WAS WORD FOLLOWING LAST WORD OF SOURCE
				;BLOCK CLOBBERED?
	ER2	AC-2,SN		;FAIL IF WORD FOLLOWING LAST WORD OF SOURCE BLOCK WAS
				;CLOBBERED
	JUMPL	AC+2,G21200	;LOOP ON ERROR SWITCH
;DO A BLT WHERE DESTINATION STARTING ADDRESS EQUALS SOURCE STARTING
;ADDRESS PLUS ONE - AC RANGE - MULTIPLE PATTERN

	AC=14
	SAVEAC	(1,1)

SN=21300
	SRCE=<AC-13>&17		;SOURCE BLOCK STARTING ADDRESS= <AC-13>&17
	DEST=<AC-12>&17		;DESTINATION BLOCK STARTING ADDRESS= <AC-12>&17
	SIZ=5		;BLOCK SIZE=5 WORDS

G21300:	MOVE	AC,[SRCE,,DEST] ;PRELOAD AC WITH STARTING ADDRESSES OF
				;SOURCE AND DESTINATION BLOCKS
	MOVE	SRCE-1,[230703,,603700] ;PRELOAD WORD PRECEEDING FIRST WORD
				;OF SOURCE BLOCK WITH 230703,,603700
	MOVE	SRCE,[252525,,252525] ;PRELOAD FIRST WORD OF SOURCE BLOCK WITH
				;252525,,252525
	MOVE	SRCE+1,[146314,,631463] ;PRELOAD SECOND WORD OF SOURCE BLOCK
				;WITH 146314,,631463
	MOVE	SRCE+2,[070707,,070707] ;PRELOAD THIRD WORD OF SOURCE BLOCK
				;WITH 070707,,070707
	MOVE	SRCE+3,[036074,,170630] ;PRELOAD FOURTH WORD OF SOURCE BLOCK
				;WITH 036074,,170630
	MOVE	SRCE+4,[017407,,603701] ;PRELOAD FIFTH WORD OF SOURCE BLOCK
				;WITH 017407,,603701
	MOVE	SRCE+SIZ,[007603,,607062] ;PRELOAD WORD FOLLOWING LAST WORD
				;OF SOURCE BLOCK WITH 007603,,607062
	SETOM	DEST+SIZ	;PRELOAD WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;WITH ONES
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
SN=SN+1
	CAME	SRCE-1,[230703,,603700] ;WAS WORD PRECEEDING FIRST WORD OF SOURCE
				;BLOCK CLOBBERED?
	ER2	SRCE-1,SN	;FAIL IF WORD PRECEEDING FIRST WORD OF SOURCE BLOCK
				;WAS CLOBBERED
SN=SN+1
	CAME	SRCE,[252525,,252525] ;WAS FIRST WORD OF SOURCE BLOCK CLOBBERED
	ER2	SRCE,SN		;FAIL IF FIRST WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	CAME	DEST,[252525,,252525] ;WAS FIRST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	DEST,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+1,[252525,,252525] ;WAS SECOND WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+1,SN	;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+2,[252525,,252525] ;WAS THIRD WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+2,SN	;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+3,[252525,,252525] ;WAS FOURTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+3,SN	;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+4,[252525,,252525] ;WAS LAST WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+4,SN	;FAIL IF LAST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+SIZ,[-1,,-1] ;WAS WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	DEST+SIZ,SN	;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED
	JUMPL	AC+2,G21300	;LOOP ON ERROR SWITCH
;DO A BLT WHERE DESTINATION STARTING ADDRESS EQUALS SOURCE STARTING
;ADDRESS PLUS ONE - NON-AC RANGE - MULTIPLE PATTERN

	AC=4
	SAVEAC	(1,1)

SN=21400
	SRCE=BLTBLK+1	;SOURCE BLOCK STARTING ADDRESS= BLTBLK+1
	DEST=BLTBLK+2	;DESTINATION BLOCK STARTING ADDRESS= BLTBLK+2
	SIZ=5			;BLOCK SIZE=5 WORDS

G21400:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH STARTING ADDRESSES OF
				;SOURCE AND DESTINATION BLOCKS
	MOVE	[230703,,603700]
	MOVEM	SRCE-1		;PRELOAD WORD PRECEEDING FIRST WORD OF SOURCE BLOCK
				;WITH 23703,,603700
	MOVE	[252525,,252525]
	MOVEM	SRCE		;PRELOAD FIRST WORD OF SOURCE BLOCK WITH 252525,,252525
	MOVE	[146314,,146314]
	MOVEM	SRCE+1		;PRELOAD SECOND WORD OF SOURCE BLOCK
				;WITH 146314,,631463
	MOVE	[070707,,070707]
	MOVEM	SRCE+2		;PRELOAD THIRD WORD OF SOURCE BLOCK WITH 070707,,070707
	MOVE	[036074,,170630]
	MOVEM	SRCE+3		;PRELOAD FOURTH WORD OF SOURCE BLOCK
				;WITH 036074,,170630
	MOVE	[017407,,603701]
	MOVEM	SRCE+4		;PRELOAD FIFTH WORD OF SOURCE BLOCK WITH 017407,,603701
	MOVE	[007603,,607062]
	MOVEM	SRCE+SIZ	;PRELOAD WORD FOLLOWING LAST WORD OF SOURCE BLOCK
				;WITH 007603,,607062
	SETOM	DEST+SIZ	;PRELOAD WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;WITH ONES
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
;DO A BLT WHERE DESTINATION STARTING ADDRESS EQUALS SOURCE STARTING
;ADDRESS PLUS ONE - NON-AC RANGE - MULTIPLE PATTERN (CONTINUED)

SN=SN+1
	MOVE	AC-2,SRCE-1
	CAME	AC-2,[230703,,603700] ;WAS WORD PRECEEDING FIRST WORD OF SOURCE
				;BLOCK CLOBBERED?
	ER2	AC-2,SN		;FAIL IF WORD PRECEEDING FIRST WORD OF SOURCE BLOCK
				;WAS CLOBBERED
SN=SN+1
	MOVE	AC-2,SRCE
	CAME	AC-2,[252525,,252525] ;WAS FIRST WORD OF SOURCE BLOCK CLOBBERED
	ER2	AC-2,SN		;FAIL IF FIRST WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	MOVE	AC-2,DEST
	CAME	AC-2,[252525,,252525] ;WAS FIRST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+1
	CAME	AC-2,[252525,,252525] ;WAS SECOND WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+2
	CAME	AC-2,[252525,,252525] ;WAS THIRD WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+3
	CAME	AC-2,[252525,,252525] ;WAS FOURTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+4
	CAME	AC-2,[252525,,252525] ;WAS LAST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC-2,SN		;FAIL IF LAST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC-2,DEST+SIZ
	CAME	AC-2,[-1,,-1]	;WAS WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;CLOBBERED?
	ER2	AC-2,SN		;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;WAS CLOBBERED
	JUMPL	AC+2,G21400	;LOOP ON ERROR SWITCH
;DO A BLT WHERE SOURCE BLOCK HAS AC ADDRESS AND DESTINATION BLOCK
;HAS NON-AC ADDRESS- MULTIPLE PATTERN

	AC=14
	SAVEAC	(1,1)

SN=21500
	SRCE=<AC-13>&17		;SOURCE BLOCK STARTING ADDRESS=<AC-13>&17
	DEST=BLTBLK+1		;DESTINATION BLOCK STARTING ADDRESS=BLTBLK+1
	SIZ=^D10		;BLOCK SIZE=10 WORDS

G21500:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH STARTING ADDRESSES OF
				;SOURCE AND DESTINATION BLOCKS
	MOVE	SRCE-1,[230703,,603700] ;PRELOAD WORD PRECEEDING FIRST WORD
				;OF SOURCE BLOCK WITH 230703,,603700
	MOVE	SRCE,[252525,,252525] ;PRELOAD FIRST WORD OF SOURCE BLOCK WITH
				;252525,,252525
	MOVE	SRCE+1,[146314,,631463] ;PRELOAD SECOND WORD OF SOURCE BLOCK
				;WITH 146314,,631463
	MOVE	SRCE+2,[070707,,070707] ;PRELOAD THIRD WORD OF SOURCE BLOCK
				;WITH 070707,,070707
	MOVE	SRCE+3,[036074,,170630] ;PRELOAD FOURTH WORD OF SOURCE BLOCK
				;WITH 036074,,170630
	MOVE	SRCE+4,[017407,,603701] ;PRELOAD FIFTH WORD OF SOURCE BLOCK
				;WITH 017407,,603701
	MOVE	SRCE+5,[007700,,770077] ;PRELOAD SIXTH WORD OF SOURCE BLOCK
				;WITH 007700,,770077
	MOVE	SRCE+6,[003760,,077401] ;PRELOAD SEVENTH WORD OF SOURCE BLOCK
				;WITH 003760,,077401
	MOVE	SRCE+7,[001774,,007760] ;PRELOAD EIGHTH WORD OF SOURCE BLOCK
				;WITH 001774,,007760
	MOVE	SRCE+^D8,[000777,,000777] ;PRELOAD NINTH WORD OF SOURCE BLOCK
				;WITH 000777,,000777
	MOVE	SRCE+^D9,[000377,,600077] ;PRELOAD TENTH WORD OF SOURCE BLOCK
				;WITH 000377,,600077
	MOVE	SRCE+SIZ,[007603,,607062] ;PRELOAD WORD FOLLOWING LAST WORD
				;OF SOURCE BLOCK WITH 007603,,607062
	MOVEM	GSVAC0#
	HRROI	DEST-1
	MOVEM	DEST-1		;PRELOAD WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WITH DEST-1
	HRROI	DEST
	MOVEM	DEST		;PRELOAD FIRST WORD OF DESTINATION BLOCK WITH DEST
	HRROI	DEST+1
	MOVEM	DEST+1		;PRELOAD SECOND WORD OF DESTINATION BLOCK WITH DEST+1
	HRROI	DEST+2
	MOVEM	DEST+2		;PRELOAD THIRD WORD OF DESTINATION BLOCK WITH DEST+2
	HRROI	DEST+3
	MOVEM	DEST+3		;PRELOAD FOURTH WORD OF DESTINATION BLOCK WITH DEST+3
	HRROI	DEST+4
	MOVEM	DEST+4		;PRELOAD FIFTH WORD OF DESTINATION BLOCK WITH DEST+4
	HRROI	DEST+5
	MOVEM	DEST+5		;PRELOAD SIXTH WORD OF DESTINATION BLOCK WITH DEST+5
	HRROI	DEST+6
	MOVEM	DEST+6		;PRELOAD SEVENTH WORD OF DESTINATION BLOCK WITH DEST+6
	HRROI	DEST+7
	MOVEM	DEST+7		;PRELOAD EIGHTH WORD OF DESTINATION BLOCK WITH DEST+7
	HRROI	DEST+^D8
	MOVEM	DEST+^D8	;PRELOAD NINTH WORD OF DESTINATION BLOCK WITH DEST+8
	HRROI	DEST+^D9
	MOVEM	DEST+^D9	;PRELOAD TENTH WORD OF DESTINATION BLOCK WITH DEST+9
	HRROI	DEST+SIZ
	MOVEM	DEST+SIZ	;PRELOAD WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;WITH DEST+SIZ
	MOVE	GSVAC0

	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
;DO A BLT WHERE SOURCE BLOCK HAS AC ADDRESS AND DESTINATION BLOCK
;HAS NON-AC ADDRESS- MULTIPLE PATTERN (CONTINUED)

SN=SN+1
	CAME	SRCE-1,[230703,,603700] ;WAS WORD PRECEEDING FIRST WORD OF SOURCE
				;BLOCK CLOBBERED?
	ER2	SRCE-1,SN	;FAIL IF WORD PRECEEDING FIRST WORD OF SOURCE BLOCK
				;WAS CLOBBERED
SN=SN+1
	CAME	SRCE,[252525,,252525] ;WAS FIRST WORD OF SOURCE BLOCK CLOBBERED
	ER2	SRCE,SN		;FAIL IF FIRST WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	CAME	SRCE+1,[146314,,631463] ;WAS SECOND WORD OF SOURCE BLOCK CLOBBERED?
	ER2	SRCE+1,SN	;FAIL IF SECOND WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	CAME	SRCE+2,[070707,,070707] ;WAS THIRD WORD OF SOURCE BLOCK CLOBBERED?
	ER2	SRCE+2,SN	;FAIL IF THIRD WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	CAME	SRCE+3,[036074,,170630] ;WAS FOURTH WORD OF SOURCE BLOCK CLOBBERED?
	ER2	SRCE+3,SN	;FAIL IF FOURTH WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	CAME	SRCE+4,[017407,,603701] ;WAS FIFTH WORD OF SOURCE BLOCK CLOBBERED?
	ER2	SRCE+4,SN	;FAIL IF FIFTH WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	CAME	SRCE+5,[007700,,770077] ;WAS SIXTH WORD OF SOURCE BLOCK CLOBBERED?
	ER2	SRCE+5,SN	;FAIL IF SIXTH WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	CAME	SRCE+6,[003760,,077401] ;WAS SEVENTH WORD OF SOURCE BLOCK CLOBBERED?
	ER2	SRCE+6,SN	;FAIL IF SEVENTH WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	CAME	SRCE+7,[001774,,007760] ;WAS EIGHTH WORD OF SOURCE BLOCK CLOBBERED?
	ER2	SRCE+7,SN	;FAIL IF EIGHTH WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	CAME	SRCE+^D8,[000777,,000777] ;WAS NINTH WORD OF SOURCE BLOCK CLOBBERED?
	ER2	SRCE+^D8,SN	;FAIL IF NINTH WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	CAME	SRCE+^D9,[000377,,600077] ;WAS LAST WORD OF SOURCE BLOCK CLOBBERED?
	ER2	SRCE+^D9,SN	;FAIL IF LAST WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	CAME	SRCE+SIZ,[007603,,607062] ;WAS WORD FOLLOWING LAST WORD OF SOURCE
				;BLOCK CLOBBERED?
	ER2	SRCE+SIZ,SN	;FAIL IF WORD FOLLOWING LAST WORD OF SOURCE BLOCK
				;WAS CLOBBERED
;DO A BLT WHERE SOURCE BLOCK HAS AC ADDRESS AND DESTINATION BLOCK
;HAS NON-AC ADDRESS- MULTIPLE PATTERN (CONTINUED)

SN=SN+1
	MOVE	AC+1,DEST-1
	CAME	AC+1,[-1,,DEST-1] ;WAS WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED?
SN=SN+1
	MOVE	AC+1,DEST
	CAME	AC+1,[252525,,252525] ;WAS FIRST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC+1,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC+1,DEST+1
	CAME	AC+1,[146314,,631463] ;WAS SECOND WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC+1,SN		;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC+1,DEST+2
	CAME	AC+1,[070707,,070707] ;WAS THIRD WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC+1,SN		;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC+1,DEST+3
	CAME	AC+1,[036074,,170630] ;WAS FOURTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC+1,SN		;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC+1,DEST+4
	CAME	AC+1,[017407,,603701] ;WAS FIFTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC+1,SN		;FAIL IF FIFTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC+1,DEST+5
	CAME	AC+1,[007700,,770077] ;WAS SIXTH WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC+1,SN		;FAIL IF SIXTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC+1,DEST+6
	CAME	AC+1,[003760,,077401] ;WAS SEVENTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC+1,SN		;FAIL IF SEVENTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC+1,DEST+7
	CAME	AC+1,[001774,,007760] ;WAS EIGHTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	AC+1,SN		;FAIL IF EIGHTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC+1,DEST+^D8
	CAME	AC+1,[000777,,000777] ;WAS NINTH WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC+1,SN		;FAIL IF NINTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC+1,DEST+^D9
	CAME	AC+1,[000377,,600077] ;WAS LAST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	AC+1,SN		;FAIL IF LAST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	MOVE	AC+1,DEST+SIZ
	CAME	AC+1,[-1,,DEST+SIZ] ;WAS WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION BLOCK
				;WAS CLOBBERED
	JUMPL	AC+2,G21500	;LOOP ON ERROR SWITCH
;DO A BLT WHERE SOURCE BLOCK HAS NON-AC ADDRESS AND DESTINATION BLOCK
;HAS AC ADDRESS - MULTIPLE PATTERN

	AC=14
	SAVEAC	(1,1)

SN=21600
	SRCE=BLTBLK+1		;SOURCE BLOCK STARTING ADDRESS= BLTBLK+1
	DEST=<AC-13>&17		;DESTINATION BLOCK STARTING ADDRESS= <AC-13>&17
	SIZ=^D10		;BLOCK SIZE=10 WORDS

G21600:	MOVE	AC,[SRCE,,DEST]	;PRELOAD AC WITH STARTING ADDRESSES OF
				;SOURCE AND DESTINATION BLOCKS
	MOVE	[230703,,603700]
	MOVEM	SRCE-1		;PRELOAD WORD PRECEEDING FIRST WORD OF SOURCE BLOCK
				;WITH 230703,,603700
	MOVE	[252525,,252525]
	MOVEM	SRCE		;PRELOAD FIRST WORD OF SOURCE BLOCK WITH 252525,,252525
	MOVE	[146314,,631463]
	MOVEM	SRCE+1		;PRELOAD SECOND WORD OF SOURCE BLOCK
				;WITH 146314,,631463
	MOVE	[070707,,070707]
	MOVEM	SRCE+2		;PRELOAD THIRD WORD OF SOURCE BLOCK WITH 070707,,070707
	MOVE	[036074,,170630]
	MOVEM	SRCE+3		;PRELOAD FOURTH WORD OF SOURCE BLOCK
				;WITH 036074,,170630
	MOVE	[017407,,603701]
	MOVEM	SRCE+4		;PRELOAD
				;FIFTH WORD OF SOURCE BLOCK WITH 017407,,603701
	MOVE	[007700,,770077]
	MOVEM	SRCE+5		;PRELOAD SIXTH WORD OF SOURCE BLOCK WITH 007700,,770077
	MOVE	[003760,,077401]
	MOVEM	SRCE+6		;PRELOAD SEVENTH WORD OF SOURCE BLOCK
				;WITH 003760,,077401
	MOVE	[001774,,007760]
	MOVEM	SRCE+7		;PRELOAD EIGHTH WORD OF SOURCE BLOCK
				;WITH 001774,,007760
	MOVE	[000777,,000777]
	MOVEM	SRCE+^D8	;PRELOAD NINTH WORD OF SOURCE BLOCK WITH 000777,,000777
	MOVE	[000377,,600077]
	MOVEM	SRCE+^D9	;PRELOAD TENTH WORD OF SOURCE BLOCK WITH 000377,,600077
	MOVE	[007603,,607062]
	MOVEM	SRCE+SIZ	;PRELOAD WORD FOLLOWING LAST WORD OF SOURCE BLOCK
				;WITH 007603,,607062
	HRROI	DEST-1,DEST-1	;PRELOAD WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WITH DEST-1
	HRROI	DEST,DEST	;PRELOAD FIRST WORD OF DESTINATION BLOCK WITH DEST
	HRROI	DEST+1,DEST+1	;PRELOAD SECOND WORD OF DESTINATION BLOCK
				;WITH DEST+1,DEST+1
	HRROI	DEST+2,DEST+2	;PRELOAD THIRD WORD OF DESTINATION BLOCK WITH DEST+2
	HRROI	DEST+3,DEST+3	;PRELOAD FOURTH WORD OF DESTINATION BLOCK WITH DEST+3
	HRROI	DEST+4,DEST+4	;PRELOAD FIFTH WORD OF DESTINATION BLOCK WITH DEST+4
	HRROI	DEST+5,DEST+5	;PRELOAD SIXTH WORD OF DESTINATION BLOCK WITH DEST+5
	HRROI	DEST+6,DEST+6	;PRELOAD SEVENTH WORD OF DESTINATION BLOCK WITH DEST+6
	HRROI	DEST+7,DEST+7	;PRELOAD EIGHTH WORD OF DESTINATION BLOCK WITH DEST+7
	HRROI	DEST+^D8,DEST+^D8 ;PRELOAD NINTH WORD OF DESTINATION BLOCK WITH DEST+8
	HRROI	DEST+^D9,DEST+^D9 ;PRELOAD TENTH WORD OF DESTINATION BLOCK WITH DEST+9
	HRROI	DEST+SIZ,DEST+SIZ ;PRELOAD WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK WITH DEST+SIZ
	BLT	AC,DEST+SIZ-1	;*BLT SHOULD LOAD DESTINATION BLOCK FROM SOURCE BLOCK
;DO A BLT WHERE SOURCE BLOCK HAS NON-AC ADDRESS AND DESTINATION BLOCK
;HAS AC ADDRESS - MULTIPLE PATTERN (CONTINUED)

SN=SN+1
	MOVE	AC+1,SRCE-1
	CAME	AC+1,[230703,,603700] ;WAS WORD PRECEEDING FIRST WORD OF SOURCE
				;BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF WORD PRECEEDING FIRST WORD OF SOURCE BLOCK
				;WAS CLOBBERED
SN=SN+1
	MOVE	AC+1,SRCE
	CAME	AC+1,[252525,,252525] ;WAS FIRST WORD OF SOURCE BLOCK CLOBBERED
	ER2	AC+1,SN		;FAIL IF FIRST WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	MOVE	AC+1,SRCE+1
	CAME	AC+1,[146314,,631463] ;WAS SECOND WORD OF SOURCE BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF SECOND WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	MOVE	AC+1,SRCE+2
	CAME	AC+1,[070707,,070707] ;WAS THIRD WORD OF SOURCE BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF THIRD WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	MOVE	AC+1,SRCE+3
	CAME	AC+1,[036074,,170630] ;WAS FOURTH WORD OF SOURCE BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF FOURTH WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	MOVE	AC+1,SRCE+4
	CAME	AC+1,[017407,,603701] ;WAS FIFTH WORD OF SOURCE BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF FIFTH WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	MOVE	AC+1,SRCE+5
	CAME	AC+1,[007700,,770077] ;WAS SIXTH WORD OF SOURCE BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF SIXTH WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	MOVE	AC+1,SRCE+6
	CAME	AC+1,[003760,,077401] ;WAS SEVENTH WORD OF SOURCE BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF SEVENTH WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	MOVE	AC+1,SRCE+7
	CAME	AC+1,[001774,,007760] ;WAS EIGHTH WORD OF SOURCE BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF EIGTH WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	MOVE	AC+1,SRCE+^D8
	CAME	AC+1,[000777,,000777] ;WAS NINTH WORD OF SOURCE BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF NINTH WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	MOVE	AC+1,SRCE+^D9
	CAME	AC+1,[000377,,600077] ;WAS LAST WORD OF SOURCE BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF LAST WORD OF SOURCE BLOCK WAS CLOBBERED
SN=SN+1
	MOVE	AC+1,SRCE+SIZ
	CAME	AC+1,[007603,,607062] ;WAS WORD FOLLOWING LAST WORD OF SOURCE
				;BLOCK CLOBBERED?
	ER2	AC+1,SN		;FAIL IF WORD FOLLOWING LAST WORD OF SOURCE BLOCK WAS
				;CLOBBERED
;DO A BLT WHERE SOURCE BLOCK HAS NON-AC ADDRESS AND DESTINATION BLOCK
;HAS AC ADDRESS - MULTIPLE PATTERN (CONTINUED)

SN=SN+1
	CAME	DEST-1,[-1,,DEST-1] ;WAS WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	DEST-1,SN	;FAIL IF WORD PRECEEDING FIRST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED?
SN=SN+1
	CAME	DEST,[252525,,252525] ;WAS FIRST WORD OF DESTINATION BLOCK LOADED
				;CORRECTLY FROM SOURCE?
	ER2	DEST,SN		;FAIL IF FIRST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+1,[146314,,631463] ;WAS SECOND WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+1,SN	;FAIL IF SECOND WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+2,[070707,,070707] ;WAS THIRD WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+2,SN	;FAIL IF THIRD WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+3,[036074,,170630] ;WAS FOURTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+3,SN	;FAIL IF FOURTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+4,[017407,,603701] ;WAS FIFTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+4,SN	;FAIL IF FIFTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+5,[007700,,770077] ;WAS SIXTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+5,SN	;FAIL IF SIXTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+6,[003760,,077401] ;WAS SEVENTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+6,SN	;FAIL IF SEVENTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+7,[001774,,007760] ;WAS EIGHTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+7,SN	;FAIL IF EIGHTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+^D8,[000777,,000777] ;WAS NINTH WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+^D8,SN	;FAIL IF NINTH WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+^D9,[000377,,600077] ;WAS LAST WORD OF DESTINATION BLOCK
				;LOADED CORRECTLY FROM SOURCE?
	ER2	DEST+^D9,SN	;FAIL IF LAST WORD OF DESTINATION BLOCK NOT LOADED
				;CORRECTLY FROM SOURCE
SN=SN+1
	CAME	DEST+SIZ,[-1,,DEST+SIZ] ;WAS WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK CLOBBERED?
	ER2	DEST+SIZ,SN	;FAIL IF WORD FOLLOWING LAST WORD OF DESTINATION
				;BLOCK WAS CLOBBERED
	JUMPL	AC+2,G21600	;LOOP ON ERROR SWITCH
;TEST BLT WITH 'E' LESS THAN RH(AC)
;SUCH THAT THE BLT INSTR. TRANSFERS ONLY ONE WORD, THEN STOPS.

	AC=10
	SAVEAC	(1,1)
	SN=21700

	BLTSRC=END+2
	BLTDST=END+6

G21700:	MOVE	AC,[252525,,252525]	; PRELOAD FOR SRC-1
	MOVEM	AC,BLTSRC-1
	MOVE	AC,[707070,,707070]	; PRELOAD FOR SRC
	MOVEM	AC,BLTSRC
	MOVE	AC,[525252,,525252]	;PRELOAD FOR SRC+1
	MOVEM	AC,BLTSRC+1
	MOVE	AC,[123456,,654321]	;PRELOAD FOR DST-1
	MOVEM	AC,BLTDST-1
	MOVE	AC,[070707,,070707]	;PRELOAD FOR DST
	MOVEM	AC,BLTDST
	MOVE	AC,[112233,,445566]	;PRELOAD FOR DST+1
	MOVEM	AC,BLTDST+1

	MOVE	AC,[BLTSRC,,BLTDST]	;SETUP BLT PTR=FROM,,TO
	BLT	AC,BLTDST-1		;*BLT SHOULD XFER ONE WORD AND STOP

SN=SN+1
	CAME	AC,[BLTSRC,,BLTDST]	;SEE IF PTR CHANGED
	ER2	AC,SN			;YES, REPORT
SN=SN+1
	MOVE	AC,[252525,,252525]	;GET PRELOAD FOR SRC-1
	CAME	AC,BLTSRC-1		;SEE IF OK
	ER2	AC,SN			;REPORT ERROR
SN=SN+1
	MOVE	AC,[707070,,707070]	;GET PRELOAD FOR SRC
	CAME	AC,BLTSRC		;SEE IF SRC OK
	ER2	AC,SN			; REPORT ERR
SN=SN+1
	MOVE	AC,[525252,,525252]	;GET PRELOAD FOR SRC+1
	CAME	AC,BLTSRC+1		;SEE IF OK
	ER2	AC,SN			;REPORT ER
SN=SN+1
	MOVE	AC,[123456,,654321]	;GET PRELOAD FOR DST-1
	CAME	AC,BLTDST-1		;SEE IF OK
	ER2	AC,SN			;REPORT ERR
SN=SN+1
	MOVE	AC,[707070,,707070]	;GET PRELOAD FOR SRC***
	CAME	AC,BLTDST		;SEE IF IT XFERED A WORD
	ER2	AC,SN			;REPORT ER
SN=SN+1
	MOVE	AC,[112233,,445566]	;GET PRELOAD FOR DST+1
	CAME	AC,BLTDST+1		;SEE IF XFERED ONLY ONE WORD
	ER2	AC,SN			;REPORT ERR

	JUMPL	AC+2,G21700		;LOOP ON ERROR SWITCH
SUBTTL	PART III - GENERAL JFFO TEST

;VERIFY THAT JFFO WILL CLEAR AC+1 AND NOT JUMP WHEN C(AC)=0

G30000:	SN=30100
	AC=-1

	MOVEI	[ASCIZ/JFFO NO-JUMP FAILED/]
	MOVEM	SPDES		;INITIALIZE SPECIAL FAILURE DESCRIPTOR

G30100:	REPEAT	^D13,<
;VERIFY THAT JFFO WILL CLEAR AC+1 AND NOT JUMP WHEN C(AC)=0.
;THIS TEST IS REPEATED 13 TIMES, ONCE FOR EACH USABLE AC.

SN=SN+1
	AC=<AC+1>&17
	SAVEAC	(1,1)

	SETZM	AC		;CLEAR AC
	SETOM	<AC+1>&17	;INITIALIZE AC+1
	JFFO	AC,.+2		;*JFFO SHOULD CLEAR AC+1 AND NOT JUMP
	JRST	.+2		;PASS IF JFFO DOES NOT JUMP
	ER2	AC,SN		;ERROR IF JFFO JUMPED
	SKIPE	AC		;EXAMINE AC
	ER3	AC,SN		;C(AC) WAS CLOBBERED
	SKIPE	<AC+1>&17	;EXAMINE AC+1
	ER4	AC+1,SN		;AC+1 WAS NOT CLEARED
	JUMPL	AC+2,-^D9	;LOOP ON ERROR SWITCH
>
PAGE
;VERIFY THAT JFFO WILL JUMP AND SET AC+1 TO THE NO. OF LEADING
;ZEROS IN AC WHEN C(AC) IS NON-ZERO

	MOVEI	[ASCIZ/JFFO JUMP FAILED/]
	MOVEM	SPDES		;INITIALIZE SPECIAL FAILURE DESCRIPTER

G30200:	SETOB	AC,<AC+1>&17	;INITIALIZE AC AND AC+1
	JFFO	AC,.+2
	ER2	AC,30201	;ERROR IF JFFO DID NOT JUMP
	CAME	AC,[-1,,-1]	;EXAMINE AC
	ER3	AC,30201	;C(AC) WAS CLOBBERED
	SKIPE	<AC+1>&17	;EXAMINE AC+1
	ER4	AC+1,30201	;C(AC+1) NOT = TO NO OF LEADING ZEROS IN AC
	JUMPL	AC+2,G30200	;LOOP ON ERROR SWITCH
;VERIFY THAT JFFO WILL JUMP AND SET AC+1 TO THE NO. OF LEADING
;ZEROS IN AC WHEN C(AC) IS NON-ZERO
;RIPPLE A ONE THROUGH A FIELD OF ZEROS IN THE AC TO TEST JFFO

SN=30300
	XX=1000000
	ZZ=-1

G30300:	REPEAT	^D18,<
;VERIFY THAT JFFO WILL JUMP AND SET AC+1 TO THE NO. OF LEADING
;ZEROS IN AC WHEN C(AC) IS NON-ZERO
;RIPPLE A ONE THROUGH A FIELD OF ZEROS IN THE AC TO TEST JFFO

SN=SN+1
	XX=XX/2
	ZZ=ZZ+1
	MOVSI	AC,XX		;INITIALIZE AC
	MOVE	AC-2,AC		;INITIALIZE AC-2 FOR COMPARISON
	SETOM	<AC+1>&17	;INITIALIZE AC+1
	JFFO	AC,.+2		;*JFFO SHOULD PLACE ZZ INTO AC+1 AND JUMP
	ER2	AC,SN		;ERROR IF JFFO DID NOT JUMP
	CAME	AC,<AC-2>&17	;EXAMINE AC
	ER3	AC,SN		;C(AC) WAS CLOBBERED
	CAIE	AC+1,ZZ		;EXAMINE AC+1
	ER4	AC+1,SN		;C(AC+1) NOT = NO. OF LEADING ZEROS IN AC
	JUMPL	AC+2,.-^D9	;LOOP ON ERROR SWITCH
>
PAGE
SN=30400
	XX=1000000

G30400:	REPEAT	^D18,<
;VERIFY THAT JFFO WILL JUMP AND SET AC+1 TO THE NO. OF LEADING
;ZEROS IN AC WHEN C(AC) IS NON-ZERO
;RIPPLE A ONE THROUGH A FIELD OF ZEROS IN THE AC TO TEST JFFO

SN=SN+1
	XX=XX/2
	ZZ=ZZ+1
	MOVEI	AC,XX		;INITIALIZE AC
	MOVE	AC-2,AC		;INITIALIZE AC-2 FOR LATER COMPARISON
	SETOM	<AC+1>&17	;INITIALIZE AC+1
	JFFO	AC,.+2		;*JFFO SHOULD PLACE ZZ INTO AC+1 AND JUMP
	ER2	AC,SN		;ERROR IF JFFO DID NOT JUMP
	CAME	AC,<AC-2>&17	;EXAMINE AC
	ER3	AC,SN		;C(AC) WAS CLOBBERED
	CAIE	AC+1,ZZ		;EXAMINE AC+1
	ER4	AC+1,SN		;C(AC+1) NOT = NO. OF LEADING ERRORS IN AC
	JUMPL	AC+2,.-^D9	;LOOP ON ERROR SWITCH
>
;VERIFY THAT JFFO WILL JUMP AND SET AC+1 TO THE NO. OF LEADING
;ZEROS IN AC WHEN C(AC) IS NON-ZERO.
;THIS TEST IS REPEATED 13 TIMES, ONCE FOR EACH USABLE AC.

SN=30500
	AC=-1

G30500:	REPEAT	^D13,<
;VERIFY THAT JFFO WILL JUMP AND SET AC+1 TO THE NO. OF LEADING
;ZEROS IN AC WHEN C(AC) IS NON-ZERO.
;THIS TEST IS REPEATED 13 TIMES, ONCE FOR EACH USABLE AC.

SN=SN+1
	AC=<AC+1>&17
	SAVEAC	(1,1)

	MOVSI	AC,(1B<^O<AC>>)	;INITIALIZE AC
	MOVEM	AC,GSVAC#	;INITIALIZE FOR LATER COMPARISON
	SETOM	<AC+1>&17	;INITIALIZE AC+1
	JFFO	AC,.+2		;*JFFO SHOULD PLACE AC INTO AC+1 AC+1 AND JUMP
	ER2	AC,SN		;ERROR IF JFFO DID NOT JUMP
	CAME	AC,GSVAC	;EXAMINE AC
	ER3	AC,SN		;C(AC) WAS CLOBBERED
	CAIE	AC+1,AC		;EXAMINE AC+1
	ER4	AC+1,SN		;C(AC+1) NOT = NO. OF LEADING ZEROS IN AC
	JUMPL	AC+2,-^D9	;LOOP ON ERROR SWITCH
>

LAST1:	JRST	BEGEND		;REPEAT DIAGNOSTIC

	IF1,<PURGE BYTBLK>
BYTBLK:	BLOCK	^D50

	IF1,<PURGE BLTBLK>
BLTBLK:	BLOCK	^D200

SUBTTL	*UUOERR* OLD-UUO ERROR HANDLER SUBROUTINE, V75B, APR 22,1975

;THIS SUBROUTINE PROVIDES ERROR REPORTING THRU THE USE OF UUO'S.

ERRMES:	MOVEM	0,%ERAC0#	;SAVE AC0
	IFDEF	EXCASB,<IFDEF	KI10,<
	SKIPN	KAIFLG
	JRST	.+5
	SKIPE	USER		;USER MODE ?
	JRST	.+3
	SKIPE	MARGIN
	DATAO	APR,[IMGNOF,,ISPDOF] ;CLR MARGINS >>
	MOVEM	1,%ERAC1#	;SAVE AC1
	MOVEM	2,%ERAC2#	;SAVE AC2
	AOS	ERRTLS		;INCREMENT ERROR TOTALS
	HRRZ	0,$SVUPC	;GET PC OF UUO
	CAMN	0,ERRPC		;PC = PC OF LAST ERROR ?
	AOS	MICNT#		;YES, ADD 1 TO ERROR COUNT
	MOVE	0,MICNT
	HRL	0,$SVUPC
	SKIPN	KLFLG		;NOT KL10
	SKIPE	USER		;AND NOT USER?
	JRST	.+2
	DATAO	PI,0		;YES, DISPLAY ERROR PC,ERROR COUNT
	SETZM	PROCED#		;CLEAR PROCEED FLAG
	SWITCH
	TLNE	NOPNT		;PRINTOUT ?
	JRST	%ERRS1		;NO, RESTORE AC'S AND RETURN
	MOVE	1,$SVUUO
	LSH	1,-^D27
	MOVEM	1,%ACS1A#	;SAVE UUO NUMBER
	MOVE	0,%ERAC0
	MOVE	1,%ERAC1
	SKIPGE	@ERRLOP		;ERR LOOP AC > OR = 0 ?
	JRST	%ERRS4		;NO, SEE IF PRINT ALL
%ERMS1:	SETZM	MICNT		;CLEAR ERROR COUNT
	SKIPL	MONCTL		;DIAG MON OR SYS EXER ?
	JRST	.+4		;NO, DON'T NEED TITLE
	SKIPN	%ERFST#		;FIRST ERROR ?
	PNTNM			;YES, PRINT PROGRAM TITLE
	SETOM	%ERFST
	SKIPN	PASCNT		;FIRST PASS ?
	JRST	.+4		;YES
	PMSG	<^TEST PASS COUNT = >
	MOVE	PASCNT
	PNTDEC
	PMSG	<^PC =   >
	HRRZ	0,$SVUPC	;GET PC OF UUO
	MOVEM	0,ERRPC		;SAVE FOR COMPARE
	PNT6			;PRINT UUO ADDRESS
	XLIST
	IFDEF	ERDIAG,<LIST
;DIAGNOSTIC FORMAT ERROR PRINTER

;PRINT RESULT

%ERMS2:	PMSG	<^RESULT  = >
	MOVE	1,$SVUUO	;GET AC # OF UUO
	LSH	1,-27
	ANDI	1,17
	MOVE	0,(1)		;GET C(AC)
	CAIG	1,1		;IS AC # = TO SAVE AC ?
	MOVE	0,%ERAC0(1)	;YES, GET SAVED AC
	PNTHW			;PRINT C(AC)

	MOVE	CONSW
	TLNE	TXTINH		;PRINT FAILURE DES AND FLT NBR ?
	JRST	%ERMORE		;NO, RESTORE AC'S ETC.

;PRINT FAILURE DESCRIPTOR

	MOVE	1,%ACS1A	;GET UUO NUMBER
	CAIG	1,1		;PRINT DESCRIPTOR ?
	JRST	%ERMS3		;NO, JUST PRINT FAULT NUMBER
	PCRL
	MOVE	%FLTTB(1)
	PNTAL			;PRINT FAULT DESCRIPTOR

;PRINT FAULT NUMBER

%ERMS3:	PMSG	<^FAULT NUMBER = >
	MOVEI	TLET
	PNTA			;PRINT TEST LETTER

	HRRZ	$SVUUO
	TRNE	700000
	JRST	%ER6X
	TRNE	070000
	JRST	%ER5X
	TRNE	007000
	JRST	%ER4X
	PNT3			;PRINT FAULT NUMBER
%ER7X:	PCRL
	JRST	%ERMORE

%ER4X:	PNT4
	JRST	%ER7X
%ER5X:	PNT5
	JRST	%ER7X
%ER6X:	PNT6
	JRST	%ER7X

;FAILURE DESCRIPTORS

TLET:	0			;TEST LETTER
%FLTTB:	0			;DESCRIPTOR TABLE
%NODES:	[0]			;NO DESCRIPTOR
SPDES:	[0]			;SPECIAL USER FAILURE DESCRIPTOR
$ACF:	[ASCIZ/C(AC) FAILED/]
%AC1F:	[ASCIZ/C(AC+1) FAILED/]
%EF:	[ASCIZ/C(E) FAILED/]
%E1F:	[ASCIZ/C(E+1) FAILED/]
%ARF:	[ASCIZ/C(C(ACR)) FAILED/]
%AR1F:	[ASCIZ/C(C(ACR+1)) FAILED/]
%ALF:	[ASCIZ/C(C(ACL)) FAILED/]
%EEF:	[ASCIZ/C(C(E)) FAILED/]
%FF:	[ASCIZ/FLAG FAILED/]
>
	XLIST
	IFDEF	ERRELB,<
	LIST
;RELIABILITY FORMAT ERROR PRINTER

%ERMS2:	SETZM	%RAND#		;CLEAR PNT C(RAN) FLAG
	MOVE	1,%ACS1A
	CAIL	1,11		;UUO # 11-13
	SETOM	%RAND		;YES, SET PNT C(RAN) FLAG
	TRZ	1,10		;MAKE UUO # 1-7
	MOVEM	1,%ACS1A
	MOVE	2,ERRPC		;GET UUO ADDRESS
	MOVE	2,-1(2)		;GET INST IN UUO-1
	CAIL	1,4		;UUO # < THAN 4 ?
	MOVE	2,$SVUUO	;YES, GET UUO
	MOVEM	2,%CNTE#	;SAVE E ADDRESS
	MOVE	2,%ERAC2
	MOVE	1,%ERAC1
	MOVE	0,%ERAC0
	MOVEI	1,@%CNTE	;GET ADRS FIELD OF UUO OR UUO-1
	MOVEM	1,%EE1#
	MOVE	1,%ERAC1
	MOVE	1,@%EE1		;GET C(E)
	MOVEM	1,%EE1A#
	MOVE	1,%ERAC1
	MOVEI	1,@$SVUUO	;GET ADDRESS FIELD OF UUO
	MOVEM	1,%EE2#
	MOVE	1,%ACS1A
	CAIN	1,3		;UUO # 3 ?
	JRST	.+4		;YES
	MOVE	1,%ERAC1
	MOVE	1,@%EE2		;GET C(E) OF UUO
	MOVEM	1,%EE2A#
	MOVE	2,%ACS1A	;GET UUO #
	MOVE	1,%CNTE
	LSH	1,-27		;GET AC NUMBER
	ANDI	1,17
	CAIG	2,5		;UUO # 6,7 OR 2
	CAIN	2,2
	JRST	%ERR2		;YES, GO PNT E AND C(E)
;PRINT ERROR AC

	PMSG	<^AC =   >
	MOVE	0,1
	PNT2			;PRINT AC NUMBER
	PMSG	<^C(AC)= >
	MOVE	0,(1)		;GET C(AC)
	CAIG	1,2		;IS AC # = SAVED AC ?
	MOVE	0,%ERAC0(1)	;YES, GET SAVED AC
%ERRB:	PNTHW			;PRINT C(AC) OR UUO2 (E)

;PRINT ERROR INFO

	CAIN	2,5		;UUO # 5
	JRST	%ERR4		;YES, GO PNT 'TST','SKP', OR ETC.

	PMSG	<^COR =  >
	MOVE	0,(1)		;GET C(AC)
	CAIG	1,2		;IS AC # = SAVED AC ?
	MOVE	0,%ERAC0(1)	;YES, GET SAVED AC
	CAIE	2,2
	MOVE	0,%EE1A		;UUO # 2, GET C(E)
	PNTHW			;PRINT C(E) OR UUO2 C(AC)
	CAIL	2,4		;UUO # >3 ?
	JRST	%ERRC		;YES, RESTORE AC'S AND RETURN

	PMSG	<^    ORIGINAL>
%ERRB1:	MOVE	1,$SVUUO
	LSH	1,-27		;GET AC # OF UUO
	ANDI	1,17
	PMSG	<^C(AC)= >
	MOVE	0,(1)		;GET C(AC)
	CAIG	1,2		;IS AC # = SAVED AC ?
	MOVE	0,%ERAC0(1)	;YES, GET SAVED AC
	SKIPE	%RAND		;PRINT C(RAN) FLAG SET ?
	MOVE	0,RAN#		;YES
	PNTHW			;PRINT C(AC) OR C(RAN)
	CAIN	2,3		;UUO # 3 ?
	JRST	%ERR2		;YES, PRINT E, RESTORE AC'S AND RETURN
	CAIN	2,7		;UUO # 7 ?
	JRST	%ERRC		;YES, BYPASS PRINTING C(E)
	PMSG	<^C(E) = >
	MOVE	0,%EE2A
	PNTHW			;PRINT C(E)
	JRST	%ERRC

%ERR2:	PMSG	<^E =    >
	MOVE	0,%EE2
	CAIN	2,2		;UUO # 2 ?
	MOVE	0,%EE1
	PNT6			;PRINT E OF UUO OR UUO-1
	CAIL	2,6		;UUO 6 OR 7 ?
	JRST	%ERRB1		;YES, GO PNT C(AC), C(E) AND RETURN
	CAIN	2,3		;UUO # 3 ?
	JRST	%ERRC		;YES, RESTORE AC'S AND RETURN

	PMSG	<^C(E) = >
	MOVE	0,%EE1A		;GET C(E)
	JRST	%ERRB
;PRINT ASCII COMMENT

%ERR4:	HRRZI	0,@$SVUUO
	PNTA			;PRINT 'TST','SKP', OR ETC.
	JRST	%ERRC

;COMPLETE PRINTOUT

%ERRC:	PCRL

	XLIST
	IFDEF	UUOTXT,<
	LIST
	MOVE	0,CONSW
	TLNN	TXTINH		;PRINT DIAGNOSTIC COMMENT ?
	CAIE	2,7		;UUO # 7 ?
	JRST	%ERMORE		;NO, RESTORE AC'S AND RETURN
	MOVE	0,%EE2		;YES
	PNTAL			;PRINT DIAGNOSTIC COMMENT
	PCRL
>
	LIST
	JRST	%ERMORE

>
	LIST
;RESTORE AC'S AND RETURN OR HALT

%ERMORE:XCT	ERMORE
	PNTMGN			;PRINT MARGINS
	SWITCH

%ERRS1:	TTALTM			;ALTMODE CHECK
	JRST	.+4		;NONE
	MOVEI	.+3		;SAVE CONT ADDRESS
	MOVEM	JOBOPC
	JRST	@ALTMGO		;PERFORM TRANSFER
	MOVE	CONSW
	TLNE	0,ERSTOP	;HALT ON ERROR SWITCH SET ?
	ERRHLT			;YES
	TLNN	0,LOOPER	;LOOP ON ERROR SWITCH SET ?
	SETOM	PROCED		;NO, SET THE PROCEED FLAG
	TLNE	0,DING		;RING BELL SWITCH SET ?
	PBELL			;YES, GO RING BELL

%ERRS2:	MOVE	2,%ERAC2	;RESTORE AC'S
	MOVE	1,%ERAC1
	SETOM	@ERRLOP		;SET C(ERR LOOP AC) TO -1
	SKIPN	PROCED		;LOOP ON ERROR ?
	JRST	%ERRS5		;YES
	AOS	@ERRLOP		;NO, INC C(ERR LOOP AC)
	AOS	@ERRLOP		;SO IT ='S 1
	SKIPL	MONCTL		;UNDER DIAGNOSTIC MONITOR ?
	JRST	%ERRS5		;NO, CONTINUE PROGRAM
	MOVE	0,ERRTLS	;YES
	CAIL	0,5		;PRINTED ALLOWED ERRORS ?
	JRST	$BEND2

%ERRS5:	MOVE	0,%ERAC0	;NO, CONTINUE PROGRAM
	IFDEF	EXCASB,<IFDEF KI10,<
	SKIPN	KAIFLG
	JRST	.+5
	SKIPE	USER
	JRST	.+3
	SKIPE	MARGIN
	DATAO	APR,MARGIN	;RESET MARGIN SYSTEM >>
	JRST	UUOEXT

%ERRS4:	MOVE	0,CONSW
	TLNN	PALERS		;PRINT ALL ERRORS ?
	JRST	%ERRS1		;NO
	JRST	%ERMS1		;YES

SUBTTL	*STOR* RESERVED STORAGE, JULY 19,1977

;PROGRAM LITERALS

	XLIST
IFNDEF	$LPAPER,<LIST>
	LIT
	LIST
ENDSLD:	0

IFDEF	DEBUG,<
PATCH:	BLOCK DEBUG		;PATCHING AREA
>

;PROGRAM VARIABLES
	VAR

IFDEF	PGMEND,<
END:	0
	END	START	>