PCjs Machines

Home of the original IBM PC emulator for browsers.

Logo

DEC PDP-10 KA10 Basic Instruction Diagnostic #11

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

This diagnostic “TESTS THE MULTIPLY INSTRUCTION AND THE MULTIPLY ALGORITHM.”

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 DAKAK.MAC

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

To assemble the diagnostic using the original DEC source files:

a 'DAKAKT.MAC;../PARAM.KLM;../FIXED.KLM;DAKAKM.MAC;../UUOERR.KLM;../STOR.KLM'

The quotes (either single or double) are required to prevent the PDPjs Debugger from interpreting the filenames as separate commands, because a semicolon is the Debugger’s normal command separator.

If you want a machine to automatically assemble and load those files on startup, you can add the following machine configuration setting in the page’s Front Matter:

commands: a 'DAKAKT.MAC;../PARAM.KLM;../FIXED.KLM;DAKAKM.MAC;../UUOERR.KLM;../STOR.KLM'

However, in this case, you must use ' as the quoting sequence, because of the way these settings are encoded into JavaScript parameters; e.g.:

embedPDP10(...,'{commands:"a 'DAKAKT.MAC;../PARAM.KLM;../FIXED.KLM;DAKAKM.MAC;../UUOERR.KLM;../STOR.KLM'"}');

Issues

As noted in cpuops.js, in the doMUL() function:

The DAKAK diagnostic contains the following code:

036174: 200240 043643  MOVE    5,43643      ; [43643] = 400000000000
036175: 200300 043603  MOVE    6,43603      ; [43603] = 777777777777
036176: 200140 043604  MOVE    3,43604      ; [43604] = 000000000001
036177: 224240 000003  MUL     5,3          ; Multiply 400000000000 by 000000000001
036200: 312240 043604  CAME    5,43604      ; high order result in AC should be: 000000000001
036201: 003240 033721  UUO     5,33721      ;
036202: 312300 043602  CAME    6,43602      ; low order result in AC+1 should be: 000000000000

The “natural” result is:

05=777777777777 06=400000000000

And SIMH seems to agree. So why does the DEC diagnostic expect:

05=000000000001 06=000000000000

The answer can be found in the DECSYSTEM-10 and DECSYSTEM-20 Processor Reference Manual (June 1982), in the description of the MUL instruction:

CAUTION: In the KA10, an AC operand of 2^35 is treated as though it were +2^35, producing the
incorrect sign in the product.

This behavior is now simulated below for MODEL_KA10, at least to the extent that the diagnostic is happy.


DAKAK.TXT

MAINDEC-10-DAKAK.TXT






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


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

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

	FUNCTION:       MULTIPLY TEST

	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-DAKAK.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-DAKAK.TXT
							PAGE 3

1.0	ABSTRACT

	THIS PDP-10 KA10 BASIC INSTRUCTION DIAGNOSTIC IS THE
	ELEVENTH IN A SERIES OF PDP-10 KA10 PROCESSOR DIAGNOSTICS.
	THE DIAGNOSTIC TESTS THE MULTIPLY INSTRUCTION AND THE
	MULTIPLY ALGORITHM.

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-DAKAK.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-DAKAK.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-DAKAK.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-DAKAK.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-DAKAK.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 'DAKAK.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-DAKAK.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

DAKAK.HST

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

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

PRODUCT CODE:       MAINDEC-10-DAKAK

PRODUCT NAME:       BASIC INSTRUCTION DIAGNOSTIC #11

DATE RELEASED:      JANUARY 1977

VERSION:            0.2

UPDATE AUTHOR:      JOHN R. KIRCHOFF

CHANGES MADE:

    1. UPGRADE TO ALLOW COMPATABILITY WITH THE SUBROUTINE PACKAGE.

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

ORIGINAL VERSION:   0.1

ORIGINAL AUTHOR:    RICHARD MALISKA

ORIGINAL RELEASE:   16-MAR-72

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

DAKAK.MAC

[Download]

;DAKAK

	MCNVER==0
	DECVER==2


	XLIST
DEFINE	NAME	(MCNVER,DECVER)<

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

	NAME	\MCNVER,\DECVER

;(MULTIPY, INTERGER MULTIPLY, DIVIDE, INTERGER DIVIDE)

;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
KI10=1
KA10=1
KLOLD==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/DAKAK/
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>
DEFINE	MOP1	(T,A1,A2,EE,R1,R2)<
;THIS MACRO INITIALIZES AC,AC+1 AND E WITH [A1],[A2] AND
;[EE] RESPECTIVELY, PERFORMS 'MUL AC,E' AND COMPARES AC,AC+1
;AND E AGAINST [R1], [R2] AND [EE] RESPECTIVELY.
;IF ANY OF THE ABOVE COMPARISONS FAIL, AN ERROR IS REPORTED

F'T'0:	AA1=A1				;INITIAL C(AC)
	MOVE	AC,[A1]			;PRELOAD AC (MULTIPLIER)
	AA2=A2				;INITIAL C(AC+1)
	MOVE	AC+1,[A2]		;PRELOAD AC+1
	AEE=EE				;INITIAL C(E)
	MOVE	E,[EE]			;PRELOAD E (MULTIPLICAND)
	MUL	AC,E			;*MULTIPLY C(E) BY C(AC)
	AR1=R1				;EXPECTED RESULT IN AC
	CAME	AC,[R1]			;IS HIGH PRODUCT CORRECT?
	ER3	AC,T'1		;HIGH PRODUCT FAILED
	AR2=R2				;EXPECTED RESULT IN AC+1
	CAME	AC+1,[R2]		;IS LOW PRODUCT CORRECT?
	ER4	AC+1,T'2		;LOW PRODUCT FAILED
	AEE=EE				;INITIAL C(E)
	CAME	E,[EE]			;WAS C(E) CLOBBERED?
	ER5	E,T'3			;C(E) WAS CLOBBERED
	JUMPL	AC+2,F'T'0		;LOOP ON ERROR SWITCH>

SUBTTL	DIAGNOSTIC SECTION

EXIT:	;DROPDV			;CLOSE LOGICAL OUTPUT FILE
	;EXIT

PGMNAM:	ASCIZ/
PDP-10  KA10 BASIC INSTRUCTION DIAGNOSTIC (11) [DAKAK]
/

;INITIALIZE

TESTPC:	0		;SUBTEST PC

	LOC	30621

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

STARTA:	JRST	F00		;GO PERFORM DIAGNOSTIC
SUBTTL	DIAGNOSTIC SECTION - MPY TEST - ZERO PRODUCT

	ADR=3000
	AC=14
	E=<AC-2>&17

F00:	SAVEAC	(1,1)

;MULTIPLY 0 BY 0 TO GET PRODUCT OF 0
	MOP1	(\ADR,0,-1,0,0,0)

	AC=13
	E=<AC-2>&17
	SAVEAC	(1,1)
	XX=0

	REPEAT	^D36,	<
	ADR=ADR+1
	XX=XX+XX
	IFE	XX,<XX=1>

;MULTIPLY RIPPLED 1 BY 0 TO GET PRODUCT OF 0
	MOP1	(\ADR,0,-1,XX,0,0)>
	AC=12
	E=<AC-2>&17
	SAVEAC	(1,1)
	XX=0

	REPEAT	^D36,	<
	ADR=ADR+1
	XX=XX+XX+1
	IFE	<XX-1>,<XX=-2>

;MULTIPLY RIPPLED 0 BY 0 TO GET PRODUCT OF 0
	MOP1	(\ADR,0,-1,XX,0,0)>
	ADR=ADR+1
	AC=14
	E=<AC-2>&17
	SAVEAC	(1,1)

;MULTIPLY -1 BY 0 TO GET PRODUCT OF 0
	MOP1	(\ADR,0,-1,-1,0,0)
SUBTTL	DIAGNOSTIC SECTION - MULTIPLICATION ALGORITHM

	AC=13
	E=<AC-2>&17
	SAVEAC	(1,1)

	XX=-1

			;MULTIPLICAND=1
	REPEAT	^D16,<
;TEST MULTIPLICATION ALGORITHM
;VERIFY THAT (-MPY SHIFT) WORKS AS SPECIFIED IN THE
;KI10 MULTIPLICATION ALGORITHM. I.E., THE TWO LEAST
;SIGNIFICANT BITS OF THE MULTIPLIER (C(AC)) ARE
;EXAMINED AND THEN THE MULTIPLICAND (C(E)) IS MULTIPLIED BY THEM.
;THIS PROCESS IS REPEATED 18 TIMES IN ORDER
;TO MULTIPLY ALL 36 BITS OF THE AC.  THIS TEST IS
;EXECUTED 16 TIMES WITH C(AC)=0,1,3,4,..., 17 AND
;C(E)=1.  IT IS EXECUTED ANOTHER 16 TIMES AS ABOVE
;EXCEPT C(E)=-1 TO VERIFY THAT THE ALGORITHM IS INDEPENDENT
;OF C(E).

	ADR=ADR+1
	XX=XX+1

	MOP1	(\ADR,XX,-1,1,0,XX)>
	AC=12
	E=<AC-2>&17
	SAVEAC	(1,1)

	XX=-1

			;MULTIPLICAND=-1
	REPEAT	^D16,<
;TEST MULTIPLICATION ALGORITHM
;VERIFY THAT (-MPY SHIFT) WORKS AS SPECIFIED IN THE
;KI10 MULTIPLICATION ALGORITHM, I.E., THE TWO LEAST
;SIGNIFICANT BITS OF THE MULTIPLIER (C(AC)) ARE
;EXAMINED AND THEN THE MULTIPLICAND (C(E)) IS MULTIPLIED BY THEM.
;THIS PROCESS IS REPEATED 18 TIMES IN ORDER
;TO MULTIPLY ALL 36 BITS OF THE AC.  THIS TEST IS
;EXECUTED 16 TIMES WITH C(AC)=0, 1,2,3,4, . . ., 17 AND
;C(E)=1.  IT IS EXECUTED ANOTHER 16 TIMES AS ABOVE
;EXCEPT C(E)=-1 TO VERIFY THAT THE ALGORITHM IS INDEPENDENT
;OF C(E).

	ADR=ADR+1
	XX=XX+1
	MX=-XX
	IFE	XX,<
	V1=-1
	V2=0>
	IFN	XX,<
	V1=0
	V2=-1>
	MOP1	(\ADR,XX,V1,-1,V2,MX)>
SUBTTL	DIAGNOSTIC SECTION - MPY TEST - ZERO PRODUCT

	AC=11
	E=<AC-2>&17
	SAVEAC	(1,1)
	XX=0

	REPEAT	^D36,	<
	ADR=ADR+1
	XX=XX+XX
	IFE	XX,<XX=1>

;MULTIPLY 0 BY RIPPLED 1 TO GET PRODUCT OF ZERO
	MOP1	(\ADR,XX,-1,0,0,0)>
	AC=10
	E=<AC-2>&17
	SAVEAC	(1,1)
	XX=0

	REPEAT	^D36,<
	ADR=ADR+1
	XX=XX+XX+1
	IFE	<XX-1>,<XX=-2>

;MULTIPLY 0 BY RIPPLED 0 TO GET PRODUCT OF 0
	MOP1	(\ADR,XX,-1,0,0,0)>
	AC=7
	E=<AC-2>&17
	SAVEAC	(1,1)
	ADR=ADR+1

;MULTIPLY 0 BY -1 TO GET PRODUCT OF 0
	MOP1	(\ADR,-1,-1,0,0,0)
SUBTTL	DIAGNOSTIC SECTION - MPY TEST - NON-ZERO PRODUCT

	AC=6
	E=<AC-2>&17
	SAVEAC	(1,1)

	XX=0

	REPEAT	^D36, <
	ADR=ADR+1
	XX=XX+XX
	IFE	XX,<XX=1>

;MULTIPLY A RIPPLED 1 BY 1 TO GET A PRODUCT OF RIPPLED 1
	IFG	XX,<V1=0>
	IFL	XX,<V1=-1>
	MOP1	(\ADR,1,-1,XX,V1,XX)>
	AC=5
	E=<AC-2>&17
	SAVEAC	(1,1)
	XX=0

	REPEAT	^D35,<	;LAST CASE IS DIFFERENT
	ADR=ADR+1
	XX=XX+XX
	IFE	XX,<XX=1>

;MULTIPLY A 1 BY A RIPPLED 1 TO GET PRODUCT OF RIPPLED 1
	IFG	XX,<V1=0>
	IFL	XX,<V1=-1>
	MOP1	(\ADR,XX,-1,1,V1,XX)>
;MULTIPLY A 1 BY 400000,,0
	XX=400000000000
	ADR=ADR+1

	MOP1	(\ADR,XX,-1,1,1,0)
	AC=4
	E=<AC-2>&17
	SAVEAC	(1,1)
	XX=0

	REPEAT	^D36,<
	ADR=ADR+1
	XX=XX+XX
	IFE	XX,<XX=1>

;MULTIPLY A RIPPLED ONE BY -1
	IFG	XX,<
	V1=-1
	V2=-XX>
	IFL	XX,<
	V1=1
	V2=0>
	MOP1	(\ADR,-1,0,XX,V1,V2)>
	AC=3
	E=<AC-2>&17
	SAVEAC	(1,1)
	XX=0

	REPEAT	^D35,<	;LAST CASE IS DIFFERENT
	ADR=ADR+1
	XX=XX+XX
	IFE	XX,<XX=1>

;MULTIPLY -1 BY A RIPPLED 1
	IFG	XX,<
	V1=-1
	V2=-XX>
	IFL	XX,<
	V1=1
	V2=0>
	MOP1	(\ADR,XX,0,-1,V1,V2)>
;MULTIPLY A -1 BY 400000,,0
	ADR=ADR+1
	XX=400000000000

	MOP1	(\ADR,XX,0,-1,-1,XX)
	AC=2
	E=<AC-2>&17
	SAVEAC	(1,1)
	XX=0

	REPEAT	^D36,<
	ADR=ADR+1
	XX=XX+XX+1
	IFE	<XX-1>,<XX=-2>

;MULTIPLY RIPPLED 0 BY 1 TO GET PRODUCT OF RIPPLED 0
	IFL	XX,<V1=-1>
	IFG	XX,<V1=0>
	MOP1	(\ADR,1,0,XX,V1,XX)>
	AC=10
	E=<AC-2>&17
	SAVEAC	(1,1)
	XX=0

	REPEAT	^D36,<
	ADR=ADR+1
	XX=XX+XX+1
	IFE	<XX-1>,<XX=-2>

;MULTIPLY 1 BY RIPPLED 0 TO GET PRODUCT OF RIPPLED 0
	IFL	XX,<V1=-1>
	IFG	XX,<V1=0>
	MOP1	(\ADR,XX,0,1,V1,XX)>
	AC=10
	E=<AC-2>&17
	SAVEAC	(1,1)
	XX=0

	REPEAT	^D36,	<
	ADR=ADR+1
	XX=XX+XX+1
	IFE	<XX-1>,<XX=-2>

;MULTIPLY A RIPPLED 0 BY -1
	MX=-XX
	IFL	XX,<V1=0>
	IFG	XX,<V1=-1>
	MOP1	(\ADR,-1,-1,XX,V1,MX)>
	AC=14
	E=<AC-2>&17
	SAVEAC	(1,1)
	XX=0

	REPEAT	^D36,	<
	ADR=ADR+1
	XX=XX+XX+1
	IFE	<XX-1>,<XX=-2>

;MULTIPLY -1 BY A RIPPLED 0
	MX=-XX
	IFL	XX,<V1=0>
	IFG	XX,<V1=-1>
	MOP1	(\ADR,XX,-1,-1,V1,MX)>
	N1=525252525252
	N2=252525252525
	AC=13
	E=<AC-2>&17
	SAVEAC	(1,1)
	WW=^D36
	XX=0
	ZZ=0

	REPEAT	^D35,	<	;LAST CASE DIFFERENT

	ADR=ADR+1
	WW=WW-1
	XX=XX+XX
	ZZ=ZZ+1
	IFE	XX,<ZZ=0>
	IFE	XX,<XX=1>

;MULTIPLY 1010...1010 BY A FLOATING 1
	V1=N1
	V2=<N1_ZZ>!1B0
	IFE	WW,<V2=0>
	IFL	XX,<V3=N2+1>
	IFG	XX,<V3=<<-1B<WW>>!<N1_<-WW>>>>
	MOP1	(\ADR,XX,0,V1,V3,V2)>

;MULTIPLY A 1010...1010 BY 400000,,0
	ADR=ADR+1
	XX=400000000000
	V1=525252525252
	V3=525252525252
	V2=400000000000

	MOP1	(\ADR,XX,0,V1,V3,V2)
LAST1:	;JRST	BEGEND

	END	START