Google
 

Trailing-Edge - PDP-10 Archives - klad_sources - klad.sources/spccpu.klm
There are no other files named spccpu.klm in the archive.
SUBTTL	*SPCCPU* SPECIAL BASIC CPU PROCESSOR CONTROL, 26-FEB-76

;NEW DEFINITIONS USED BY THE KL10 SUBROUTINE PACKAGE

AC0=	0
DIAGNOS=30000		;PDP-10 DIAGNOSTIC START ADDRESS
DDT=	10000		;PDP-10 DDT START ADDRESS
DIAMON=	20000		;PDP-10 DIAMON LOADER START ADDRESS
DONG11=	1B22		;11 DOORBELL (FROM THE 10)

;DTE20 DEVICE CODES

DTE==	200		;DTE0
DTE0==	204
DTE1==	204
DTE2==	210
DTE3==	214

;KL10 EPT COMMUNICATION AREA

$STD=	440		;PDP-10 DIAGNOSTIC START ADDRESS
$DDT=	441		;PDP-10 DDT START ADDRESS
$STL=	442		;PDP-10 LOADER START ADDRESS
$STM=	443		;PDP-10 MONITOR START ADDRESS

$DTFLG=	444		;DTE20 OPERATION COMPLETE FLAG
$DTCLK=	445		;DTE20 CLOCK INTERRUPT FLAG
$DTCI=	446		;DTE20 CLOCK INTERRUPT INSTRUCTION
$DTT11=	447		;DTE20 10 TO 11 ARGUMENT
$DTF11=	450		;DTE20 11 TO 10 ARGUMENT
$DTCMD=	451		;DTE20 TO 11 COMMAND WORD
$DTSEQ=	452		;DTE20 OPERATION SEQUENCE NUMBER
$DTOPR=	453		;DTE20 OPERATIONAL DTE #
$DTCHR=	454		;DTE20 LAST TYPED CHARACTER
$DTMTD=	455		;DTE20 MONITOR TTY OUTPUT COMPLETE FLAG
$DTMTI=	456		;DTE20 MONITOR TTY INPUT FLAG

$DTSWR=	457		;DTE20 CONSOLE SWITCH REGISTER
;SPECIAL "FIXED" REASSIGNMENTS

	$$LOC=.			;SAVE CURRENT LOCATION

	LOC	30000
$$BEGIN:JRST	$$START		;SETUP SPECIAL START
	JRST	$$START		;"DIAMON" CHAIN START ADDRESS

	LOC	440
$STD:	JRST	BEGIN		;SETUP FOR "STD"
	LOC	443
$STM:	JRST	$SPEC		;SIMPLE RUN CONTROL

	LOC	30057
$BEGEND:JRST	$SPBEND		;SETUP SPECIAL "BEGEND"

;SPECIAL MUUO, TRAP & PAGE FAIL SETUP

	LOC	420
$$420:	HALT	.		;KI10 PAGE FAIL
$$421:	JFCL			;OVERFLOW
$$422:	HALT	.		;PUSHDOWN OVERFLOW
$$423:	HALT	.		;TRAP 3
$$424:	0			;MMUO
$$425:	0			;MMUO PC
$$426:	0			;KI10-PAGE FAIL, KL10-PROCESS CONTEXT
$$427:	HALT	.
$$430:	427			;MMUO NEW PC'S
$$431:	427
$$432:	427
$$433:	427
$$434:	427
$$435:	427
$$436:	427
$$437:	427

	LOC	500
$$500:	0			;KL10 PAGE FAIL WORD
$$501:	0			;KL10 PAGE FAIL PC
$$502:	503			;KL10 PAGE FAIL NEW PC
$$503:	HALT	.
	LOC	$$LOC		;RESET CURRENT LOCATION

;SPECIAL STARTUP SEQUENCE

$$START:SETZM	USER
	JSP	0,.+1		;IN USER MODE ?
	TLNE	0,USERF
	SETOM	USER		;YES, SET CONTROL WORD
	SKIPN	MONFLG		;SPECIAL USER MODE ?
	SETZM	USER		;YES, RUN AS EXEC
	SKIPE	USER
	JRST	START		;USER MODE, DON'T NEED CPU TYPE

$STKIL:	SKIPN	MONTEN		;LOADED BY "DIAMON" ?
	SETOM	ITRCNT		;NO, RUN FOREVER
	SETZM	KLTYP
	SETZM	KLFLG		;ASSUME KI10
	MOVE	1,[1,,1]
	BLT	1,1		;HOPE THIS WORKS
	CAMN	1,[1,,1]	;IF AC NE 1,,1 AFTER BLT, KL10
	JRST	START		;KI10, NO ADDITIONAL SETUP

$STKL:	CONO	APR,10040	;SET BBD NOT BIT
	CONI	APR,0
	CONO	APR,20040	;CLEAR BBD NOT BIT
	TRNN	0,40		;IF SET, KL10
	AOS	KLTYP		;IF NOT, BBD
	SETZM	$DTFLG
	SETZM	$DTCLK
	MOVE	$DTOPR		;GET DTE #
	ORM	$$DTE0		;INSERT IN DTE I/O INSTS
	ORM	$$DTE1
	ORM	$$DTE2
	ORM	$$DTE3
	SETOM	KLFLG		;SET KL10 CONTROL FLAG
	JRST	START

$SPEC:	MOVE	[JRST STARTA]	;SIMPLE RUN CONTROL
	MOVEM	$SPB1
	JRST	START
;SPECIAL "BEGEND" ROUTINE

$SPBEND:AOS	PASCNT		;INCREMENT PASS COUNT
	SOS	ITRCNT		;DECREMENT ITERATION COUNT
$SPB1:	SKIPN	USER
	JRST	$SPBEX		;EXEC MODE

$SPBUS:	SKIPE	ITRCNT		;USER MODE, COMPLETED ?
	JRST	STARTA		;NO, KEEP RUNNING
	SKIPN	MONTEN		;DONE, LOADED BY "DIAMON" ?
	EXIT			;NO, RETURN TO MONITOR
	JRST	@RETURN		;YES, RETURN TO "DIAMON"

$SPBEX:	SKIPE	KLFLG
	JRST	$SPBKL		;KL10 & EXEC
	DATAO	PI,ITRCNT	;KI10 & EXEC, DISPLAY ITER COUNT
	SKIPE	ITRCNT
	JRST	STARTA		;NOT COMPLETED YET
	JRST	@RETURN		;DONE

$SPBKL:	SKIPN	ITRCNT
	JRST	$SPKLD		;KL10, EXEC & COMPLETED

	SKIPGE	MONCTL
	JRST	STARTA		;"DIAMON" CONTROL
	MOVEI	0,404		;NOTIFY PDP-11 OF END OF PASS
	MOVEM	0,$DTCMD
	SETZM	$DTFLG
	SKIPN	KLTYP
$$DTE0:	CONO	DTE,DONG11
	SKIPE	KLTYP
$$DTE1:	CONO	DTE,10000
	SKIPN	$DTFLG		;WAIT TILL 11 RESPONDS
	JRST	.-1
	JRST	STARTA		;KEEP RUNNING

;SPECIAL KL10 COMPLETED ROUTINE

$SPKLD:	SKIPE	MONTEN
	JRST	@RETURN		;LOADED BY "DIAMON"

	MOVEI	0,403		;NOTIFY PDP-11 OF COMPLETION
	MOVEM	0,$DTCMD
	SETZM	$DTFLG
	SKIPN	KLTYP
$$DTE2:	CONO	DTE,DONG11
	SKIPE	KLTYP
$$DTE3:	CONO	DTE,10000
	SKIPN	$DTFLG		;SHOULD NEVER HAPPEN
	JRST	.-1		;11 NEVER RETURNS ON END OF PROGRAM
	HALT	BEGIN		;IF IT DOES, HALT.