Google
 

Trailing-Edge - PDP-10 Archives - klad_sources - klad.sources/dfkebm.mac
There are no other files named dfkebm.mac in the archive.
SUBTTL	MONITOR UUO TRAP TESTING

PGMNAM:	ASCIZ/
DECSYSTEM KL10 MONITOR UUO AND MODE DIAGNOSTIC (DFKEB)
/
START:	PGMINT


;*TEST MUUO TRAPPING TO 424(KERNAL NO TRAP)

SALL
T=SIXBTZ MONITOR UUO TEST - TRAPPING IN KERNAL MODE
LALL
A=MUUO			;DATA STORED
C=AXMUUO		;CORRECT DATA

STARTA=.
	SETZM	SCOPE#		;CLEAR SCOPE
	CONO	PAG,LTRPEN
	DATAO	PAG,[LLDUSB,,400000]	;CLEAR BASE REGISTER
AXMBEG:	MOVEI	40		;SET UP TEST
	MOVEM	COUNT#		;COUNTER
	TNSET
	MOVSI	1B21		;SET UP FIRST UUO
	MOVEM	AXMUUO		;FOR EXECUTION
AXMST:	MOVEI	AXMUPC		;SET UP UUO TRAP PC
	MOVEM	KNTRP		;INTO KERNAL NO TRAP
	SETZM	MUUO		;CLEAR UUO TRAP
	SETZM	MUUO+1		;LOCATIONS
AXMUUO:	0			;THIS IS THE UUO
	ERROR1	13,C,A,MUUO DID NOT TRAP IN KERNAL MODE,C(CORRECT)=MONITOR UUO
	ERLP2	AXMST
AXMUPC:	SKIPN	COUNT		;DONE 40 UUOS
	JRST	AYMBEG		;YES DO NEXT SET
	MOVSI	1B26		;SET UP FOR NEXT UUO
	ADDM	AXMUUO		;ADD IN FOR NEXT UUO
	SOS	COUNT		;FIX UP COUNTER
	JRST	AXMST		;LOOP
C=MUUOXA			;CORRECT DATA
MUU100:	MOVEI	10		;TEST COUNT
	MOVEM	COUNT
	TNSET
	MOVSI	1B20		;FIRST MUUO (100)
	MOVEM	MUUOXA		;STORE UUO TO EXECUTE
MUUSTA:	MOVEI	MUXPCA		;SET UP UUO TRAP PC
	MOVEM	KNTRP		;INTO KERNAL NO TRAP
	SETZM	MUUO		;CLEAR UUO
	SETZM	MUUO+1		;AND NEXT
MUUOXA:	0			;THIS LOC HAS MUUO
	ERROR1	13,C,A,MUUO DID NOT TRAP IN KERNAL MODE,C(CORRECT)=MUUO 
	ERLP2	MUUSTA
MUXPCA:	SKIPN	COUNT		;FINISHED
	JRST	MUU114		;DO NEXT TEST SET
	MOVSI	1B26		;SET UP FOR NEXT UUO
	ADDM	MUUOXA		;AND ADD IN TO OLD UUO
	SOS	COUNT		;FIX UP COUNT
	JRST	MUUSTA		;AND LOOP TEST
C=MUUOXB			;CORRECT DATA
MUU114:	MOVEI	4		;TEST COUNT
	MOVEM	COUNT
	TNSET
	MOVSI	114000		;FIRST MUUO (114)
	MOVEM	MUUOXB		;STORE UUO TO EXECUTE
MUUSTB:	MOVEI	MUXPCB		;SET UP UUO TRAP PC
	MOVEM	KNTRP		;INTO KERNAL NO TRAP
	SETZM	MUUO		;CLEAR UUO
	SETZM	MUUO+1		;AND NEXT
MUUOXB:	0			;THIS LOC HAS MUUO
	ERROR1	13,C,A,MUUO DID NOT TRAP IN KERNAL MODE,C(CORRECT)=MUUO 
	ERLP2	MUUSTB
MUXPCB:	SKIPN	COUNT		;FINISHED
	JRST	MUU114		;DO NEXT TEST SET
	MOVSI	1B26		;SET UP FOR NEXT UUO
	ADDM	MUUOXA		;AND ADD IN TO OLD UUO
	SOS	COUNT		;FIX UP COUNT
	JRST	MUUSTB		;AND LOOP TEST
;*MONITOR UUO TEST - UUO STORE INTO 424

SALL
T=SIXBTZ MONITOR UUO TEST - UUO STORE INTO 424
LALL
A=MUUO			;ACTUAL DATA STORED
C=AYMUUO		;CORRECT DATA LOCATION

AYMBEG:	MOVEI	40		;SET UP TEST COUNTER
	MOVEM	COUNT
	TNSET
	MOVSI	1B21		;SET UP FIRST UUO
	MOVEM	AYMUUO		;FOR EXECUTION
AYMST:	MOVEI	AYMUPC		;SET UP UUO TRAP
	MOVEM	KNTRP		;INTO KERNAL NO TRAP
	SETZM	MUUO		;CLEAR MUUO TRAP
	SETZM	MUUO+1		;LOCATIONS
AYMUUO:	0			;EXECUTE THIS UUO
	HALT	.		;UUO DID NOT TRAP
AYMUPC:	MOVE	MUUO		;GET WRITTEN UUO
	CAME	AYMUUO		;STORED CORRECTLY?
	ERROR1	13,C,A,CONTENTS OF 424 IS NOT EQUAL TO EXECUTED UUO,
	ERLP2	AYMST
	SKIPN	COUNT		;DONE 40 UUO'S
	JRST	AZMBEG		;DO NEXT SET
	MOVSI	1B26		;SET UP FOR NEXT UUO
	ADDM	AYMUUO		;ADD IN FOR NEXT UUO
	SOS	COUNT		;FIX UUO COUNTER
	JRST	AYMST		;LOOP
;*MONITOR UUO - STORE CORRECT PC

SALL
T=SIXBTZ MONITOR UUO - STORE CORRECT PC
LALL
C=[AZMUUO+1]		;CORRECT DATA
A=1			;ACTUAL DATA

AZMBEG:	SETZM	MUUO		;CLEAR MONITOR UUO
	SETZM	MUUO+1		;TRAP LOCATIONS
	TNSET
	MOVSI	1B21		;SET UP FIRST UUO
	MOVEM	AZMUUO		;TO BE EXECUTED
AZMST:	MOVEI	AZMUPC		;SET UP TRAP INSTRUCTION
	MOVEM	KNTRP		;INTO KERNAL NO TRAP
AZMUUO:	0			;EXECUTABLE UUO
	HALT	.		;SHOULDN'T  UUO DID NOT TRAP
AZMUPC:	HRRZ	1,MUUO+1	;GET THE PC OF THE UUO
	CAIE	1,AZMUUO+1	;PC+1 OF THE UUO SHOULD BE STORED
	ERROR1	13,C,A,MUUO DID NOT STORE THE CORRECT PC,C(425) HAS PC STORED
	ERLP2	AZMST
;*TEST STORING ALL POSSIBLE VALUES OF THE E FIELD WHEN EXECUTING
;*A MONITOR UUO

SALL
T=SIXBTZ MONITOR UUO - STORE E CORRECTLY
LALL
A=1			;ACTUAL DATA
C=7			;CORRECT DATA

AWMBEG:	MOVEI	7,1000		;FIRST E FIELD TO TEST
AWMST:	MOVEI	AWMUPC		;SET UP MUUO TRAP INSTUCTION
	MOVEM	KNTRP		;INTO KERNAL NO TRAP
	TNSET
	SETZM	MUUO		;CLEAR MUUO TRAP LOCATIONS
	SETZM	MUUO+1
	MOVSI	1B21		;SET UP UUO TO EXECUTE
	MOVEM	AWMUUO		;AND STORE IT
	HRRM	7,AWMUUO	;AN A NEW PC
AWMUUO:	0			;THIS IS THE UUO
	HALT	.		;SHOULD NOT HALT
AWMUPC:	HRRZ	MUUO
	CAME	7		;CORRECT E STORED
	ERROR1	13,C,A,MUUO DID NOT STORE E CORRECTLY,C(424) HAS E VALUE STORED
	ERLP2	AWMST
	ADDI	7,1000		;NEXT E FIELD
	TLNE	7,1		;DONE 2^18TH TESTS?
	JRST	BXMBEG		;NEXT SET OF TESTS
	JRST	AWMST		;LOOP TEST
SUBTTL	TEST MUUO'S IN CONCEALED MODE

;*MONITOR UUO TEST - TRAPPING IN CONCEALED MODE

SALL
T=SIXBTZ MONITOR UUO TEST - TRAPPING IN CONCEALED MODE
LALL
A=UPMP+MUUO		;DATA STORED
C=BXMUUO		;CORRECT DATA

BXMBEG:	TNSET
	PAGECN
	MOVEI	40		;SET UP TEST
	MOVEM	COUNT#		;COUNTER
	MOVSI	1B21		;SET UP FIRST UUO
	MOVEM	BXMUUO		;FOR EXECUTION
BXMST:	GO	PAGE1
	MOVEI	BXMUPC		;SET UP UUO TRAP PC
	MOVEM	UPMP+CNTRP	;INTO CONCEALED NO TRAP
	MOVEI	BXERR		;SET WRONG TRAP ERROR
	MOVEM	UPMP+KNTRP
	MOVEM	UPMP+PNTRP
	MOVEM	UPMP+SNTRP
	SETZM	UPMP+MUUO	;CLEAR UUO TRAP
	SETZM	UPMP+MUUO+1	;LOCATIONS
BXMUUO:	0			;THIS IS THE UUO
	ERROR1	13,C,A,MUUO DID NOT TRAP IN CONCEALED MODE,C(CORRECT)=MONITOR UUO
	ERLP2	BXMST
BXMUPC:	SKIPN	COUNT		;DONE 40 UUOS
	JRST	BYMBEG		;YES DO NEXT SET
	MOVSI	1B26		;SET UP FOR NEXT UUO
	ADDM	BXMUUO		;ADD IN FOR NEXT UUO
	SOS	COUNT		;FIX UP COUNTER
	JRST	BXMST		;LOOP
BXERR:	ERROR1	13,C,A,MUUO TRAPPED TO INCORRECT TRAP LOCATION,
	ERLP2	BXMST
;*MONITOR UUO TEST - UUO STORE INTO 424

SALL
T=SIXBTZ MONITOR UUO TEST - UUO STORE INTO 424
LALL
A=UPMP+MUUO		;ACTUAL DATA STORED
C=BYMUUO		;CORRECT DATA LOCATION

BYMBEG:	PAGECN
	MOVEI	40		;SET UP TEST COUNTER
	MOVEM	COUNT
	TNSET
	MOVSI	1B21		;SET UP FIRST UUO
	MOVEM	BYMUUO		;FOR EXECUTION
BYMST:	GO	PAGE1
	MOVEI	BYMUPC		;SET UP UUO TRAP
	MOVEM	UPMP+CNTRP	;INTO CONCEALED NO TRAP
	MOVEI	BYERR		;IN CASE WE GO TO THE WRONG TRAP
	MOVEM	UPMP+KNTRP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+PNTRP	;SET UP THE OTHER TRAP LOCATIONS
	SETZM	UPMP+MUUO	;CLEAR MUUO TRAP
	SETZM	UPMP+MUUO+1	;LOCATIONS
BYMUUO:	0			;EXECUTE THIS UUO
	ERROR1	13,C,A,MUUO DID NOT TRAP,
	ERLP2	BYMST
BYMUPC:	MOVE	UPMP+MUUO	;GET WRITTEN UUO
	CAME	BYMUUO		;STORED CORRECTLY?
	ERROR1	13,C,A,CONTENTS OF 424 IS NOT EQUAL TO EXECUTED UUO,
	ERLP2	BYMST
	SKIPN	COUNT		;DONE 40 UUO'S
	JRST	BZMBEG		;DO NEXT SET
	MOVSI	1B26		;SET UP FOR NEXT UUO
	ADDM	BYMUUO		;ADD IN FOR NEXT UUO
	SOS	COUNT		;FIX UUO COUNTER
	JRST	BYMST		;LOOP
BYERR:	ERROR1	13,C,A,MUUO TRAPED TO INCORRECT TRAP LOCATION,
	ERLP2	BYMST
;*MONITOR UUO - STORING THE CORRECT PC

SALL
T=SIXBTZ MONITOR UUO - STORING THE CORRECT PC
LALL
C=[BZMUUO+1]		;CORRECT DATA
A=1			;ACTUAL DATA

BZMBEG:	TNSET
	PAGECN
	SETZM	UPMP+MUUO	;CLEAR MONITOR UUO
	SETZM	UPMP+MUUO+1	;TRAP LOCATIONS
	MOVSI	1B21		;SET UP FIRST UUO
	MOVEM	BZMUUO		;TO BE EXECUTED
BZMST:	GO	PAGE1
	MOVEI	BZMUPC		;SET UP TRAP INSTRUCTION
	MOVEM	UPMP+CNTRP	;INTO CONCEALED NO TRAP
	MOVEI	BZERR		;SET UP TRAP FOR INCORRECT TRAP
	MOVEM	UPMP+KNTRP	;INTO KERNAL NO TRAP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+PNTRP
BZMUUO:	0			;EXECUTABLE UUO
	HALT	.		;SHOULDN'T  UUO DID NOT TRAP
BZMUPC:	HRRZ	1,UPMP+MUUO+1	;GET THE PC OF THE UUO
	CAIE	1,BZMUUO+1	;PC+1 OF THE UUO SHOULD BE STORED
	ERROR1	13,C,A,MUUO DID NOT STORE THE CORRECT PC,
	ERLP2	BZMST
	JRST	BWMBEG		;GO TO NEXT SET
BZERR:	ERROR1	13,C,A,MUUO DID NOT TRAP TO CORRECT TRAP,
	ERLP2	BZMST
;*MUUO STORING THE CORRECT E FIELD

SALL
T=SIXBTZ MUUO STORING THE CORRECT E FIELD
LALL
A=1			;ACTUAL DATA
C=7			;CORRECT DATA

BWMBEG:	PAGECN
	TNSET
	MOVEI	7,1000		;FIRST E FEILD TO TEST
BWMST:	GO	PAGE1
	MOVEI	BWMUPC		;SET UP MUUO TRAP INSTUCTION
	MOVEM	UPMP+CNTRP	;INTO CONCEALED NO TRAP
	MOVEI	BWERR		;SET UP FOR INCORRECT TRAP
	MOVEM	UPMP+PNTRP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+KNTRP
	SETZM	UPMP+MUUO	;CLEAR MUUO TRAP LOCATIONS
	SETZM	UPMP+MUUO+1
	MOVSI	1B21		;SET UP UUO TO EXECUTE
	MOVEM	BWMUUO		;AND STORE IT
	HRRM	7,BWMUUO	;AN A NEW PC
BWMUUO:	0			;THIS IS THE UUO
	ERROR1	13,C,A,MUUO DID NOT TRAP IN CONCEALED,
	ERLP2	BWMST
BWMUPC:	HRRZ	UPMP+MUUO
	CAME	7		;CORRECT E STORED
	ERROR1	13,C,A,MUUO DID NOT STORE E CORRECTLY,
	ERLP2	BWMST
	ADDI	7,1000		;NEXT E FIELD
	TLNE	7,1		;DONE 2^18TH TESTS?
	JRST	CXMBEG		;NEXT SET
	JRST	BWMST		;LOOP TEST
	JRST	CXMBEG		;GO TO NEXT SET
BWERR:	ERROR1	13,C,A,MUUO DID NOT TRAP TO CORRECT TRAP,
	ERLP2	BWMST
SUBTTL	PUBLIC TESTING

;*MONITOR UUO TEST - TRAPPING IN PUBLIC MODE

SALL
T=SIXBTZ MONITOR UUO TEST - TRAPPING IN PUBLIC MODE
LALL
A=UPMP+MUUO		;DATA STORED
C=CXMUUO		;CORRECT DATA

CXMBEG:	PAGEPN
	MOVEI	40		;SET UP TEST
	MOVEM	COUNT#		;COUNTER
	TNSET
	MOVSI	1B21		;SET UP FIRST UUO
	MOVEM	CXMUUO		;FOR EXECUTION
CXMST:	GO	PAGE1
	MOVEI	CXMUPC		;SET UP UUO TRAP PC
	MOVEM	UPMP+PNTRP	;INTO PUBLIC NO TRAP
	MOVEI	CXERR		;SET UP FOR INCORRECT TRAP
	MOVEM	UPMP+KNTRP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+CNTRP
	SETZM	UPMP+MUUO	;CLEAR UUO TRAP
	SETZM	UPMP+MUUO+1	;LOCATIONS
CXMUUO:	0			;THIS IS THE UUO
	ERROR1	13,C,A,MUUO DID NOT TRAP IN PUBLIC,C(CORRECT)=MONITOR UUO
	ERLP2	CXMST
CXMUPC:	SKIPN	COUNT		;DONE 40 UUOS
	JRST	CYMBEG		;YES DO NEXT SET
	MOVSI	1B26		;SET UP FOR NEXT UUO
	ADDM	CXMUUO		;ADD IN FOR NEXT UUO
	SOS	COUNT		;FIX UP COUNTER
	JRST	CXMST		;LOOP
CXERR:	ERROR1	13,C,A,MUUO DID NOT TRAP TO PUBLIC NO TRAP,
	ERLP2	CXMST
;*MONITOR UUO TEST - UUO STORE INTO 424

SALL
T=SIXBTZ MONITOR UUO TEST - UUO STORE INTO 424
LALL
A=UPMP+MUUO		;ACTUAL DATA STORED
C=CYMUUO		;CORRECT DATA LOCATION

CYMBEG:	PAGEPN
	MOVEI	40		;SET UP TEST COUNTER
	MOVEM	COUNT
	TNSET
	MOVSI	1B21		;SET UP FIRST UUO
	MOVEM	CYMUUO		;FOR EXECUTION
CYMST:	GO	PAGE1
	MOVEI	CYMUPC		;SET UP UUO TRAP
	MOVEM	UPMP+PNTRP	;INTO PUBLIC NO TRAP
	MOVEI	CYERR		;SET UP FOR INCORECT TRAP
	MOVEM	UPMP+KNTRP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+CNTRP
	SETZM	UPMP+MUUO	;CLEAR MUUO TRAP
	SETZM	UPMP+MUUO+1	;LOCATIONS
CYMUUO:	0			;EXECUTE THIS UUO
	ERROR1	13,C,A,MUUO DID NOT TRAP IN PUBLIC MODE,
	ERLP2	CYMST
CYMUPC:	MOVE	UPMP+MUUO	;GET WRITTEN UUO
	CAME	CYMUUO		;STORED CORRECTLY?
	ERROR1	13,C,A,CONTENTS OF 424 IS NOT EQUAL TO EXECUTED UUO,
	ERLP2	CYMST
	SKIPN	COUNT		;DONE 40 UUO'S
	JRST	CZMBEG		;DO NEXT SET
	MOVSI	1B26		;SET UP FOR NEXT UUO
	ADDM	CYMUUO		;ADD IN FOR NEXT UUO
	SOS	COUNT		;FIX UUO COUNTER
	JRST	CYMST		;LOOP
CYERR:	ERROR1	13,C,A,MUUO DID NOT TRAP TO PUBLIC TRAP,
	ERLP2	CYMBEG
;*MONITOR UUO TEST - STORING E CORRECTLY

SALL
T=SIXBTZ MONITOR UUO - STORING E CORRECTLY
LALL
C=[CZMUUO+1]		;CORRECT DATA
A=0			;ACTUAL DATA

CZMBEG:	PAGEPN
	SETZM	UPMP+MUUO	;CLEAR MONITOR UUO
	SETZM	UPMP+MUUO+1	;TRAP LOCATIONS
	TNSET
	MOVSI	1B21		;SET UP FIRST UUO
	MOVEM	CZMUUO		;TO BE EXECUTED
CZMST:	GO	PAGE1
	MOVEI	CZMUPC		;SET UP TRAP INSTRUCTION
	MOVEM	UPMP+PNTRP
	MOVEI	CZERR		;SET UP FOR INCORRECT TRAP
	MOVEM	UPMP+CNTRP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+KNTRP
	PAGEPN
CZMUUO:	0			;EXECUTABLE UUO
	ERROR1	13,C,A,MUUO DID NOT TRAP IN PUBLIC,
	ERLP2	CZMST
CZMUPC:	HRRZ	0,UPMP+MUUO+1	;GET THE PC OF THE UUO
	CAIE	CZMUUO+1	;PC+1 OF THE UUO SHOULD BE STORED
	ERROR1	13,C,A,MUUO DID NOT STORE THE CORRECT PC,
	ERLP2	CZMST
	JRST	CWMBEG		;GO TO NEXT SET
CZERR:	ERROR1	13,C,A,MUUO DID NOT TRAP TO PUBLIC,
	ERLP2	CZMBEG
;*MONITOR UUO - STORING E CORRECTLY

SALL
T=SIXBTZ MUUO STORING THE CORRECT E FIELD
LALL
A=1			;ACTUAL DATA
C=7			;CORRECT DATA

CWMBEG:	PAGEPN
	TNSET
	MOVEI	7,1000		;FIRST E FEILD TO TEST
CWMST:	GO	PAGE1
	MOVEI	CWMUPC		;SET UP MUUO TRAP INSTUCTION
	MOVEM	UPMP+PNTRP	;INTO PUBLIC NO TRAP
	MOVEI	CWERR		;SET UP FOR INCORRECT TRAP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+CNTRP
	MOVEM	UPMP+KNTRP
	SETZM	UPMP+MUUO	;CLEAR MUUO TRAP LOCATIONS
	SETZM	UPMP+MUUO+1
	MOVSI	1B21		;SET UP UUO TO EXECUTE
	MOVEM	CWMUUO		;AND STORE IT
	HRRM	7,CWMUUO	;AN A NEW PC
	PAGEPN
CWMUUO:	0			;THIS IS THE UUO
	ERROR1	13,C,A,MUUO DID NOT TRAP IN PUBLIC,
	ERLP2	CWMST
CWMUPC:	HRRZ	UPMP+MUUO
	CAME	7		;CORRECT E STORED
	ERROR1	13,C,A,MUUO DID NOT STORE E CORRECTLY,
	ERLP2	CWMST
	ADDI	7,1000		;NEXT E FIELD
	TLNE	7,1		;DONE 2^18TH TESTS?
	JRST	DXMBEG		;DO NEXT TEST
	JRST	CWMST		;LOOP TEST
	JRST	DXMBEG		;GO TO NEXT TEST
CWERR:	ERROR1	13,C,A,MUUO DID NOT TRAP TO PUBLIC,
	ERLP2	CWMST
;*MONITOR UUO TEST - TRAPPING

SALL
T=SIXBTZ MONITOR UUO TEST - TRAPPING
LALL
A=UPMP+MUUO		;DATA STORED
C=DXMUUO		;CORRECT DATA

DXMBEG:	PAGEPN
	MOVEI	40		;SET UP TEST
	MOVEM	COUNT#		;COUNTER
	TNSET
	MOVSI	1B21		;SET UP FIRST UUO
	MOVEM	DXMUUO		;FOR EXECUTION
DXMST:	GO	PAGE1
	MOVEI	DXMUPC		;SET UP UUO TRAP PC
	MOVEM	UPMP+PNTRP	;INTO PUBLIC NO TRAP
	SETZM	UPMP+MUUO	;CLEAR UUO TRAP
	SETZM	UPMP+MUUO+1	;LOCATIONS
	MOVEI	DXMUER		;ERROR TRAP ADRESS
	MOVEM	UPMP+CNTRP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+KNTRP
DXMUUO:	0			;THIS IS THE UUO
	ERROR1	13,C,A,MUUO DID NOT TRAP,C(CORRECT)=MONITOR UUO
	ERLP2	DXMST
	DXMUER:	ERROR1	13,C,A,MUUO DID NOT TRAP TO CORRECT TRAP IN PUBLIC,
	ERLP2	DXMST
	JRST	DYMBEG		;GO TO NEXT TEST
DXMUPC:	SKIPN	COUNT		;DONE 40 UUOS
	JRST	DYMBEG		;YES DO NEXT SET
	MOVSI	1B26		;SET UP FOR NEXT UUO
	ADDM	DXMUUO		;ADD IN FOR NEXT UUO
	SOS	COUNT		;FIX UP COUNTER
	JRST	DXMST		;LOOP
;*MONITOR UUO TEST - UUO STORE INTO 424

SALL
T=SIXBTZ MONITOR UUO TEST - UUO STORE INTO 424
LALL
A=UPMP+MUUO		;ACTUAL DATA STORED
C=DYMUUO		;CORRECT DATA LOCATION
DYMBEG:	PAGEPN
	MOVEI	40		;SET UP TEST COUNTER
	MOVEM	COUNT
	TNSET
	MOVSI	1B21		;SET UP FIRST UUO
	MOVEM	DYMUUO		;FOR EXECUTION
DYMST:	GO	PAGE1
	MOVEI	DYMUPC		;SET UP UUO TRAP
	MOVEM	UPMP+PNTRP	;INTO PUBLIC NO TRAP
	SETZM	UPMP+MUUO	;CLEAR MUUO TRAP
	SETZM	UPMP+MUUO+1	;LOCATIONS
	MOVEI	DYMUER		;ERROR TRAP ADRESS
	MOVEM	UPMP+KNTRP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+CNTRP
DYMUUO:	0			;EXECUTE THIS UUO
	ERROR1	13,C,A,MUUO DID NOT TRAP IN PUBLIC,
	ERLP2	DYMST
DYMUPC:	MOVE	UPMP+MUUO	;GET WRITTEN UUO
	CAME	DYMUUO		;STORED CORRECTLY?
	ERROR1	13,C,A,CONTENTS OF 424 IS NOT EQUAL TO EXECUTED UUO,
	ERLP2	DYMST
	SKIPN	COUNT		;DONE 40 UUO'S
	JRST	DZMBEG		;DO NEXT SET
	MOVSI	1B26		;SET UP FOR NEXT UUO
	ADDM	DYMUUO		;ADD IN FOR NEXT UUO
	SOS	COUNT		;FIX UUO COUNTER
	JRST	DYMST		;LOOP
DYMUER:	ERROR1	13,C,A,MUUO TRAPPED TO WRONG TRAP IN PUBLIC,
	ERLP2	DYMST
C=DZMUUO

DZMBEG:	PAGEPN
	SETZM	UPMP+MUUO	;CLEAR MONITOR UUO
	SETZM	UPMP+MUUO+1	;TRAP LOCATIONS
	TNSET
	MOVSI	1B21		;SET UP FIRST UUO
	MOVEM	DZMUUO		;TO BE EXECUTED
DZMST:	GO	PAGE1
	MOVEI	DZMUPC		;SET UP TRAP INSTRUCTION
	MOVEM	UPMP+PNTRP	;INTO PUBLIC NO TRAP
	MOVEI	DZMUER		;ERROR TRAP ADRESS
	MOVEM	UPMP+KNTRP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+CNTRP
DZMUUO:	0			;EXECUTABLE UUO
	ERROR1	13,C,A,MUUO DID NOT TRAP IN PUBLIC,
	ERLP2	DZMST
DZMUPC:	HRRZ	0,UPMP+MUUO+1	;GET THE PC OF THE UUO
	CAIE	DZMUUO+1	;PC+1 OF THE UUO SHOULD BE STORED
	ERROR1	13,C,A,MUUO DID NOT STORE THE CORRECT PC,
	ERLP2	DZMST
	JRST	DWMBEG		;GO TO NEXT TEST
DZMUER:	ERROR1	13,C,A,MUUO DID NOT TRAP TO CORRECT TRAP IN PUBLIC,
	ERLP2	DZMST
A=UPMP+MUUO
C=DWMUUO

DWMBEG:	PAGEPN
	TNSET
	MOVEI	7,1000		;FIRST E FEILD TO TEST
DWMST:	GO	PAGE1
	MOVEI	DWMUPC		;SET UP MUUO TRAP INSTUCTION
	MOVEM	UPMP+PNTRP	;INTO PUBLIC NO TRAP
	SETZM	UPMP+MUUO	;CLEAR MUUO TRAP LOCATIONS
	SETZM	UPMP+MUUO+1
	MOVEI	DWMUER		;UUO ERROR TRAP
	MOVEM	UPMP+KNTRP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+CNTRP
	MOVSI	1B21		;SET UP UUO TO EXECUTE
	MOVEM	DWMUUO		;AND STORE IT
	HRRM	7,.+1
DWMUUO:	0			;THIS IS THE UUO
	ERROR1	13,C,A,MUUO DID NOT TRAP IN PUBLIC MODE,
	ERLP2	DWMST
DWMUPC:	HRRZ	UPMP+MUUO
	CAME	7		;CORRECT E STORED
	ERROR1	13,C,A,MUUO DID NOT STORE E CORRECTLY,
	ERLP2	DWMST
	ADDI	7,1000		;NEXT E FIELD
	TLNE	7,1		;DONE 2^18TH TESTS?
	JRST	SUPERX		;CHECK SUPERVISOR MODE!
	JRST	DWMST		;LOOP TEST
DWMUER:	ERROR1	13,C,A,MUUO DID NOT TRAP TO CORRECT TRAP IN PUBLIC,
	ERLP2	DWMST
SUBTTL	SUPERVISOR TESTING

;*SET UP PHYSICAL ADRESSES TO LOOK LIKE ITS RUNNING IN 400000 AND BEYOND
;*EXECUTE A MUUO IN SUPERVISOR AND EXPECT TO TRAP.
;*IF WE DON'T TRAP THEN WE EXIT SUPERVISOR WITH A 'JRST 1," TO THE
;*ERROR ROUTINE

A=0
C=0
SALL
T=SIXBTZ SUPERVISOR MODE TEST
LALL

SUPERX:	MOVEI 	16,2
SUP00:	TNSET
	MOVEI	SUPRTN		;CORRECT RETURN
	MOVEM	SNTRP		;INTO SUPERVISOR NO-TRAP
	MOVEI	SUPER1		;SUPERVISOR TRAP ERROR
	MOVEM	KNTRP
	MOVEM	KTRP
	MOVEM	PNTRP
	MOVEM	PTRP
	MOVEM	CNTRP
	MOVEM	CTRP
	SUPEX
	MOVE	[AOBJN 0,400001]
	MOVEM	400000
	SETZB	0,400001	;AND MUUO 0 INTO NEXT LOCATION
	MOVE	[JRST 1,SUPER2]	;SET UP TRAP INSTRUCTION
	MOVEM	400002		;IN CASE MUUO DOES NOT TRAP.
	JRST	1,400000	;ENTER SUPERVISOR
SUPER2:	JFCL
	ERROR1	13,C,A,MUUO DID NOT CAUSE TRAP TO KERNAL FROM SUPERVISOR,
	ERLP2	SUP00
	JRST	SPNXT

SUPER1:	ERROR1	13,C,A,MUUO DID NOT TRAP TO SUPERVISOR TRAP,
	ERLP2	SUP00

SUPRTN:	SOJGE	16,SUP00
SPNXT:	TNSET
SUBTTL TRAP TESTING

;*CAUSE TRAPS VIA JRSTF INSTRUCTION
;*TRAP WILL CAUSE A MOVEI TO BE EXECUTED PUTING THE TRAP ADDRESS INTO
;*AC0 WHICH IS THEN CHECKED FOR BEING THE CORRECT TRAP
;*TRAP RETURN WILL CHECK FOR CORRECT PC STORED IN IN 0

SALL
T=SIXBTZ AROV TRAP TEST
LALL
C=[AROVTP]		;CORRECT DATA
A=0			;ACTUAL DATA
TRAP0:	SETZ			;CLEAR AC0
	TNSET
	RESET
	TRPSET
TRAP0A:	CONO	PAG,LTRPEN
	DATAO	PAG,[LLDUSB,,400000]	 ;SET UP FOR ALLOWING TRAPS
	MOVE	[XWD TN1,.+2]	;TRAP PC WORD FOR JRSTF
	JRSTF	@		;CAUSE TRAP VIA JRSTF
	CAIE	0,AROVTP	;TRAP DID NOT OCCUR
	ERROR1	13,C,A,AROV DID NOT TRAP TO 421,
	ERLP2	TRAP0A

;*TEST PUSHDOWN LIST OVERFLOW TRAP TO 422
SALL
T=SIXBTZ PDLOV TRAP TEST
LALL
C=[PDOVTP]		;CORRECT DATA
A=0			;ACTUAL DATA

TRAP1:	SETZ			;CLEAR AC0
	TNSET
	RESET
	TRPSET
TRAP1A:	CONO	PAG,LTRPEN
	DATAO	PAG,[LLDUSB,,400000]	 ;SET UP FOR ALLOWING TRAPS
	MOVE	[XWD TN0,.+2]	;TRAP PC WORD FOR JRSTF
	JRSTF	@		;CAUSE TRAP VIA JRSTF
	CAIE	0,PDOVTP	;TRAP DID NOT OCCUR
	ERROR1	13,C,A,PDOVTP DID NOT TRAP TO 422,
	ERLP2	TRAP1A
;*TRAP3 TRAP TEST TRAPPING TO 423

SALL
T=SIXBTZ TRAP3 TRAP TEST
LALL
C=[TRP3TP]		;CORRECT DATA
A=0			;ACTUAL DATA
TRP02:	SETZ			;CLEAR AC0
	TNSET
	RESET
	TRPSET
	CONO	PAG,LTRPEN
	DATAO	PAG,[LLDUSB,,400000]	 ;SET UP FOR ALLOWING TRAPS
TRAP2A:	MOVE	[XWD TN0!TN1,.+2]	;PC FOR JRSTF
	JRSTF	@		;CAUSE TRAP VIA JRSTF
	CAIE	0,TRP3TP	;TRAP DID NOT OCCUR
	ERROR1	13,C,A,TRAP3 TRAP DID NOT TRAP TO 423,
	ERLP2	TRAP2A
SUBTTL FLAG SETTING
	MODE=1

	FLGTST	USERF,<MUUO DID NOT RE-ENTER USER-MODE>
;*THIS ROUTINE TO BRING US BACK TO KERNAL MODE FROM USER
;*MODE RESTORE VIA MUUO

USRRTN:	MOVE	[UEXT]		;PC FOR RETURN
	MOVEM	UPMP+KNTRP
	MOVEM	UPMP+PNTRP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+CNTRP
	MOVEM	UPMP+STRP
	MOVEM	UPMP+KTRP
	MOVEM	UPMP+CTRP
	MOVEM	UPMP+PTRP
	MOVSI	1B21
	MOVEM	.+1		;UUO TO GET US OUT
USREXT:	0			;DO THIS UUO TO EXIT TO KERNAL
	HALT	.		;FATAL ERROR (DID NOT ENTER KERNAL
UEXT:	JSP	.+1		;GET FLAGS
	TLNE	USERF		;STILL IN USER MODE
	HALT	.+1		;FATAL - TRAPPED FROM UUO BUT STILL
	JRST	.+1		;IN USER MODE
	MODE=1
	FLGTST	EXIOT,<MMUO DID NOT SET EXIOT FLAG>
PAGE
	MODE=0
	FLGTST	AROV,<MUUO DID NOT SET ARITHMETIC OVERFLOW FLAG>
PAGE
	FLGTST	CRY0,<MUUO DID NOT SET CRY0 FLAG>
PAGE
	FLGTST	CRY1,<MUUO DID NOT SET CRY1 FLAG>
PAGE
	FLGTST	FOV,<MUUO DID NOT SET FOV FLAG>
PAGE
	FLGTST	BIS,<MUUO DID NOT SET BIS FLAG>
PAGE
	FLGTST	FXU,<MUUO DID NOT SET FXU FLAG>
PAGE
	FLGTST	DCK,<MUUO DID NOT SET DCK FLAG>
PAGE
	FLGTST	CRY0+CRY1+AROV+FOV+FXU+DCK+BIS,<MUUO DID NOT SET CRY0+CRY1+AROV+FOV+FXU+DCK+BIS FLAGS>
SUBTTL	TEST IOT'S IN CONCEALED MODE

SALL
T=SIXBTZ	IOT MUUO^CONCEALED MODE
LALL
A=UPMP+MUUO
C=IOTCM1

IOTCM:	TNSET
	PAGECN

	SETZM	10		;INIT COUNTER

IOTCM0:	MOVE	IOTTAB(10)	;SETUP IOT FOR EXECUTION
	MOVEM	IOTCM1

	GO	PAGE1
	MOVEI	IOTCM3		;SETUP MUUO TRAP PC
	MOVEM	UPMP+CNTRP
	MOVEI	IOTCM2		;SETUP FOR INCORRECT TRAP
	MOVEM	UPMP+KNTRP
	MOVEM	UPMP+PNTRP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+KTRP
	MOVEM	UPMP+PTRP
	MOVEM	UPMP+CTRP
	MOVEM	UPMP+STRP

	SETZM	UPMP+MUUO	;CLEAR MUUO LOCATIONS
	SETZB	0,UPMP+MUUO+1

IOTCM1:	0			;DO "IOT"

	ERROR1	13,C,A,IOT DID NOT TRAP,C=IOT
	ERLP2	IOTCM0
	JRST	IOTCM3
IOTCM2:	ERROR1	13,C,A,IOT DID NOT TRAP TO PROPER TRAP
	ERLP2	IOTCM0

IOTCM3:	MOVE	UPMP+MUUO	;GET SAVED MUUO
	CAME	IOTCM1
	ERROR1	13,C,A,CONTENTS OF 424 NOT EXECUTED IOT
	ERLP2	IOTCM0

C=[IOTCM1+1]
A=1

	HRRZ	1,UPMP+MUUO+1	;GET SAVED PC
	CAIE	1,IOTCM1+1
	ERROR1	13,C,A,IOT MUUO DID NOT STORE CORRECT PC
	ERLP2	IOTCM0

	AOS	10
	CAIE	10,^D11		;DONE ALL ILLEGAL IOT'S ?
	JRST	IOTCM0		;NOT YET
	JRST	IOTPM		;YES, TO NEXT TEST
SUBTTL	TEST IOT'S IN PUBLIC MODE

SALL
T=SIXBTZ	IOT MUUO^PUBLIC MODE
LALL
A=UPMP+MUUO
C=IOTPM1

IOTPM:	TNSET
	PAGEPN

	SETZM	10		;INIT COUNTER

IOTPM0:	MOVE	IOTTAB(10)	;SETUP IOT FOR EXECUTION
	MOVEM	IOTPM1

	GO	PAGE1
	MOVEI	IOTPM3		;SETUP MUUO TRAP PC
	MOVEM	UPMP+PNTRP
	MOVEI	IOTPM2		;SETUP FOR INCORRECT TRAP
	MOVEM	UPMP+KNTRP
	MOVEM	UPMP+CNTRP
	MOVEM	UPMP+SNTRP
	MOVEM	UPMP+KTRP
	MOVEM	UPMP+STRP
	MOVEM	UPMP+CTRP
	MOVEM	UPMP+PTRP

	SETZM	UPMP+MUUO	;CLEAR MUUO LOCATIONS
	SETZB	0,UPMP+MUUO+1

IOTPM1:	0			;DO "IOT"

	ERROR1	13,C,A,IOT DID NOT TRAP,C=IOT
	ERLP2	IOTPM0
	JRST	IOTPM3
IOTPM2:	ERROR1	13,C,A,IOT DID NOT TRAP TO PROPER TRAP
	ERLP2	IOTPM0

IOTPM3:	MOVE	UPMP+MUUO	;GET SAVED MUUO
	CAME	IOTPM1
	ERROR1	13,C,A,CONTENTS OF 424 NOT EXECUTED IOT
	ERLP2	IOTPM0

C=[IOTPM1+1]
A=1

	HRRZ	1,UPMP+MUUO+1	;GET SAVED PC
	CAIE	1,IOTPM1+1
	ERROR1	13,C,A,IOT MUUO DID NOT STORE CORRECT PC
	ERLP2	IOTPM0

	AOS	10
	CAIE	10,^D11		;DONE ALL ILLEGAL IOT'S ?
	JRST	IOTPM0		;NOT YET
	JRST	IOTSM		;YES, TO NEXT TEST
SUBTTL	TEST IOT'S IN SUPERVISOR MODE

SALL
T=SIXBTZ	IOT MUUO^SUPERVISOR MODE
LALL
A=MUUO
C=400001

IOTSM:	TNSET
	MOVEI	IOTSM3		;SETUP SUPERVISOR TRAP
	MOVEM	SNTRP
	MOVEI	IOTSM2		;SETUP INCORRECT TRAPS
	MOVEM	STRP
	MOVEM	KNTRP
	MOVEM	KTRP
	MOVEM	PNTRP
	MOVEM	PTRP
	MOVEM	CNTRP
	MOVEM	CTRP

	SETZM	10		;INIT COUNTER

IOTSM0:	SUPEX

	MOVE	[JFCL 17,400001]
	MOVEM	400000		;SETUP CLEAR FLAGS

	MOVE	[JRST 1,IOTSM1]
	MOVEM	400002		;SETUP "DID NOT TRAP" CATCHER

	MOVE	IOTTAB(10)	;SETUP TEST IOT
	MOVEM	400001

	SETZM	0
	JRST	1,400000	;ENTER SUPERVISOR MODE
IOTSM1:	ERROR1	13,C,A,IOT DID NOT TRAP,C=IOT
	ERLP2	IOTSM0
	JRST	IOTSM3

IOTSM2:	ERROR1	13,C,A,IOT DID NOT TRAP TO SUPERVISOR TRAP
	ERLP2	IOTSM0

IOTSM3:	MOVE	MUUO
	CAME	400001		;IOT GET SAVED CORRECTLY ?
	ERROR1	13,C,A,CONTENTS OF 424 NOT EXECUTED IOT
	ERLP2	IOTSM0

C=[400002]
A=1

	HRRZ	1,MUUO+1	;CORRECT PC GET SAVED ?
	CAIE	1,400002
	ERROR1	13,C,A,IOT MUUO DID NOT STORE CORRECT PC
	ERLP2	IOTSM0

	AOS	10		;COMPLETED ALL IOT'S ?
	CAIE	10,^D11
	JRST	IOTSM0		;NOT YET

	JRST	PVTST
;*ILLEGAL USER MODE IOT TABLE

IOTTAB:	CONO
	CONI
	DATAO
	DATAI
	CONSZ
	CONSO
	BLKO
	BLKI
	HALT
	JEN
	JRST	10,
	HALT
SUBTTL	TEST PROPRIETARY VIOLATION

SALL
T=SIXBTZ	PROPRIETARY TRANSFER^SUPERVISOR MODE
LALL
C=0
A=0

PVTST:	TNSET
	MOVE	LPGFTRP
	MOVEM	PGFTSV#		;SAVE PAGE FAIL INST
	APRID			;GET APRID
	TRNE	1B19		;TEST FOR CACHE
	SETOM	CACHE#		;YES WE HAVE CACHE

PVTST0:	MOVEI	PVTST3
	MOVEM	LPGFTRP		;SETUP FOR PAGE FAIL

	SUPEX

	MOVE	[JFCL 17,400001]
	MOVEM	400000		;CLEAR ALL FLAGS
	MOVE	[JRST PVTST2]
	MOVEM	400001		;ILLEGAL TRANSFER TO KERNAL
	MOVE	[JRST 1,PVTST1]
	MOVEM	400002		;NO TRAP, NO JRST - WHO KNOWS

	JRST	1,400000	;ENTER SUPERVISOR MODE

PVTST1:	ERROR1	13,C,A,JRST TO KERNAL,NOTHING HAPPENED
	ERLP2	PVTST0
	JRST	PVTST4
PVTST2:	JFCL
	ERROR1	13,C,A,JRST WENT TO KERNAL,NO TRAP
	ERLP2	PVTST0
	JRST	PVTST4

C=13
A=14

PVTST3:	JRST	1,.+1		;CORRECT TRAP, CHECK RESULTS
	MOVE	C,[LIP,,PVTST2+1]
	MOVE	A,LPFWPC
	CAME	C,A
	ERROR1	13,C,A,PAGE FAIL SAVED PC WRONG
	ERLP2	PVTST0
SALL
T=SIXBTZ	PROPRIETARTY WRITE^SUPERVISOR MODE
LALL
C=0
A=0

PVTST4:	MOVEI	PVTST6
	MOVEM	LPGFTRP		;SETUP FOR PAGE FAIL

	SUPEX

	MOVE	[JFCL 17,400001]
	MOVEM	400000		;CLEAR ALL FLAGS
	MOVE	[SETOM PVTSTX#]
	MOVEM	400001		;ILLEGAL WRITE INTO KERNAL
	MOVE	[JRST 1,PVTST5]
	MOVEM	400002		;NO TRAP

	SETZM	PVTSTX		;CLEAR WRITE ATTEMPT LOCATION
	JRST	1,400000	;ENTER SUPERVISOR MODE

PVTST5:	ERROR1	13,C,A,JRST TO KERNAL,NO TRAP
	ERLP2	PVTST4
	JRST	PVTST7
C=13
A=14

PVTST6:	JRST	1,.+1		;CORRECT TRAP, CHECK RESULTS
	MOVE	C,[213000,,PVTSTX]
	SKIPN	CACHE		;SKIP IF CPU HAS CACHE
	MOVE	C,[211000,,PVTSTX]
	MOVE	A,LEUPFW
	CAME	C,A
	ERROR1	13,C,A,PAGE FAIL WORD WRONG
	ERLP2	PVTST4

	MOVE	C,[LIP,,400001]
	MOVE	A,LPFWPC
	CAME	C,A
	ERROR1	13,C,A,PAGE FAIL SAVED PC WRONG
	ERLP2	PVTST4

	SETZM	C
	MOVE	A,PVTSTX
	CAME	C,A
	ERROR1	13,C,A,WROTE INTO KERNAL LOC
	ERLP2	PVTST4

PVTST7:	MOVE	PGFTSV
	MOVEM	LPGFTRP		;RESTORE PAGE FAIL
SUBTTL	TEST USER MODE ADDRESSING

;*USER MODE PUBLIC - MAXIMUM BLOCK TRANSFER

SALL
T=SIXBTZ	USER MODE PUBLIC^MAXIMUM BLOCK TRANSFER
LALL

A=UPMP+MUUO
C=[HALT 13]

UBLT:	TNSET
UBLT0:	MOVEI	<<UPMP+1000>_-^D9>!740000
	HRL				;SETUP PAGE TABLE ENTRY
	MOVSI	1,-1000/2	;SO ALL PAGES POINT TO SAME 512 WORDS
	MOVEM	UPMP(1)
	AOBJN	1,.-1

	MOVE	10,[JRST 1,11]	;PORTAL
	MOVE	11,[SETZM 20]	;CLEAR FIRST LOC
	MOVE	12,[BLT 7,777777] ;MAX BLT
	MOVE	13,[HALT 13]	;MUUO TO GET BACK TO EXEC
	MOVE	7,[20,,21]	;BLT START ADDRESSES

	MOVEI	UBLT1		;SETUP FOR TERMINATION MUUO
	MOVEM	UPMP+PNTRP
	MOVEM	UPMP+CNTRP
	MOVEI	UBLT2		;SETUP FOR ERROR TERMINATION
	MOVEM	UPMP+PTRP
	MOVEM	UPMP+CTRP

	SETZM	UPMP+MUUO	;CLEAR MUUO LOCATIONS
	SETZM	UPMP+MUUO+1

	MOVE	[0,,UPMP+LPGFTRP]	;SETUP FOR PAGE FAIL
	MOVEM	UPMP+LPGFTRP		;HANDLE VIA MUUO

	CONO	PAG,LTRPEN
	DATAO	PAG,[LLDUSB,,400000!<UPMP_-^D9>]

	JRSTF	@.+1		;GO TO USER MODE
	USERF,,10		;IN THE AC'S
	HALT	.
UBLT1:	MOVE	UPMP+MUUO	;COMPLETED, CHECK RESULTS
	CAME	[HALT 13]
	ERROR1	13,C,A,INCORRECT TERMINATION MUUO
	ERLP2	UBLT0

A=UPMP+MUUO+1
C=[USERF,,14]

	MOVE	UPMP+MUUO+1
	CAME	[USERF,,14]
	ERROR1	13,C,A,INCORRECT TERMINATION PC
	ERLP2	UBLT0
	JRST	UBLT3

C=5
A=6

UBLT2:	MOVE	5,UPMP+LEUPFW
	MOVE	6,UPMP+MUUO+1
	ERROR1	13,C,A,PAGE FAILURE,<CORRECT=PF WORD, ACTUAL=PF PC>
	ERLP2	UBLT0
;*USER MODE CONCEALED - MAXIMUM BLOCK TRANSFER

SALL
T=SIXBTZ	USER MODE CONCEALED^MAXIMUM BLOCK TRANSFER
LALL

A=UPMP+MUUO
C=[HALT 13]

UBLT3:	TNSET
UBLT4:	MOVEI	<<UPMP+1000>_-^D9>!540000
	HRL				;SETUP PAGE TABLE ENTRY
	MOVSI	1,-1000/2	;SO ALL PAGES POINT TO SAME 512 WORDS
	MOVEM	UPMP(1)
	AOBJN	1,.-1

	MOVE	10,[JRST 1,11]	;PORTAL
	MOVE	11,[SETOM 20]	;SET FIRST LOC
	MOVE	12,[BLT 7,777777] ;MAX BLT
	MOVE	13,[HALT 13]	;MUUO TO GET BACK TO EXEC
	MOVE	7,[20,,21]	;BLT START ADDRESSES

	MOVEI	UBLT5		;SETUP FOR TERMINATION MUUO
	MOVEM	UPMP+CNTRP
	MOVEI	UBLT6		;SETUP FOR ERROR TERMINATION MUUO
	MOVEM	UPMP+CTRP
	MOVEM	UPMP+PNTRP
	MOVEM	UPMP+PTRP

	SETZM	UPMP+MUUO	;CLEAR MUUO LOCATIONS
	SETZM	UPMP+MUUO+1

	MOVE	[0,,UPMP+LPGFTRP]	;SETUP FOR PAGE FAIL
	MOVEM	UPMP+LPGFTRP		;HANDLE VIA MUUO

	CONO	PAG,LTRPEN
	DATAO	PAG,[LLDUSB,,400000!<UPMP_-^D9>]

	JRSTF	@.+1		;GO TO USER MODE
	USERF,,10		;IN THE AC'S
	HALT	.
UBLT5:	MOVE	UPMP+MUUO	;COMPLETED, CHECK RESULTS
	CAME	[HALT 13]
	ERROR1	13,C,A,INCORRECT TERMINATION MUUO
	ERLP2	UBLT4

A=UPMP+MUUO+1
C=[USERF,,14]

	MOVE	UPMP+MUUO+1
	CAME	[USERF,,14]
	ERROR1	13,C,A,INCORRECT TERMINATION PC
	ERLP2	UBLT4
	JRST	UBLT7

C=5
A=6

UBLT6:	MOVE	5,UPMP+LEUPFW
	MOVE	6,UPMP+MUUO+1
	ERROR1	13,C,A,PAGE FAILURE,<CORRECT=PF WORD, ACTUAL=PF PC>
	ERLP2	UBLT4

UBLT7:	JRST	LAST

LAST:	JRST	BEGEND
SUBTTL	SPECIAL PROGRAM SUBROUTINES

IFNDEF	PAGSIZ,<PAGSIZ=21>

TRAPST:	0			;FOR JSR
	MOVEM	XAC0#		;SAVE AC0
	MOVE	[TPLST,,421]	;BLT POINTER
	BLT	423		;FILL LOCATIONS
	MOVE	XAC0		;RESTORE AC0
	JRST	@TRAPST		;RETURN

TPLST:	MOVEI	421
	MOVEI	422
	MOVEI	423

;*PAGE TABLE SETUP

PAGSET:	MOVSI	1,-PAGSIZ	;SET UP PAGE COUNT
	MOVE	[737776,,737777]	;ADDRESS
	SKIPE	CNSFLG#		;IF CONCEALED DONT SET PUBLIC
	MOVE	[537776,,537777]
	ADD	[2,,2]		;NEW ADRESS
	MOVEM	UPMP(1)		;STORE PAGE MAP
	AOBJN	1,.-2		;LOOP TILL DONE
PAGE1:	JSP	1,.+1
	TLNE	1,USERF		;IF IN USER MODE FORGET PAGE RESET
	POPJ	P,		;EXIT DIRECTLY
	CONO	PAG,LTRPEN
	DATAO	PAG,[LLDUSB,,400000!<UPMP_-^D9>]
	JRSTF	@.+1		;ENTER USER MODE
	USERF,,.+1		;ENTRY FLAG
	JRST	1,.+1		;ENTRY
	JSP	.+1		;GET FLAGS
	TLNN	USERF		;DID WE GET INTO USER MODE?
	ERROR1	13,C,A,ENTRY TO USER MODE UNSUCESSFUL,JRSTF FAILED
	ERLP2	PAGSET
	POPJ	P,		;RETURN TO CALLING SEQUENCE