Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99e-bb - dndte.c10
There is 1 other file named dndte.c10 in the archive. Click here to see a list.
 REP 1/1	;10C1
	.SBTTL	DNDTE - KL10/PDP-11 INTERFACE  25 NOV 80
 WIT
	.SBTTL	DNDTE - KL10/PDP-11 INTERFACE  20 NOV 84
 REP 8/1	;10C2
	VRDTE=032			;FILE EDIT NUMBER
 WIT
	VRDTE=034			;FILE EDIT NUMBER
 REP 18/15	;10C3
		JSR	PC,GETCNK	;GET A CHUNK FROM FREELIST
 WIT
		JSR	PC,ERSGET	;GET A CHUNK FROM FREELIST, GOING FOR BROKE
 REP 22/15	;10C4
	10$:	SEC			;NO ROOM, SET CARRY TO SAY ERROR
		RTS	PC

	;ROUTINE TO "ALLOCATE OR WAIT" FOR MEMORY. SINCE WE HAVE NO GOOD
	;WAY TO SLEEP AT SUBROUTINE CALL LEVEL, CRASH FOR NOW

	..ALOW:	JSR	PC,..ALCB	;GET A CHUNK
		ASSERT	CC		;CRASH IF WE CAN'T GET IT
		RTS	PC		;ALL OK, JUST RETURN
 WIT
	10$:	TRAP			;NO ROOM, DIE

 REP 26/27	;10C5
		BNE	40$		;DONE
		DEC	DEXST		;TIMEOUT?
		BNE	10$		;NO -- CONTINUE WAITING
	20$:	SEC
		RTS	PC

	40$:	BIT	#BPARER,STATD(R0) ;CHECK FOR E BUS PARITY ERROR
		BEQ	60$		;LOOKS GOOD
		BIS	#ERR11C,STATD(R0) ;CLEAR THE ERROR STATUS
		BR	20$		;AND CLAIM FAILURE

	60$:	CLC			;CLEAR CC-C
		RTS	PC		;RETURN TO CALLER
 WIT
		BEQ	30$		;WAIT IF NOT YET DONE
		BIT	#BPARER,STATD(R0) ;DONE, CHECK FOR E BUS PARITY ERROR
		BNE	40$		;LOOKS BAD
	.IF NE FTKLKR			;IF PARANOID ABOUT THE KL KROAKING OFF,
		BIT	#DS04!DS06,DAG1(R0)  ;KL IN HALT-LOOP OR CLOCK-ERROR-STOP?
		BNE	39$		;YES, THEN THE KL IS NOT RUNNING
		BIT	#DS05,DAG1(R0)	;IS THE KL RUN FLOP STILL SET?
		BEQ	39$		;NO, THEN THE KL IS NOT RUNNING
	.ENDC;.IF NE FTKLKR
		CLC			;CLEAR CC-C FOR SUCCESSFUL OPERATION
		RTS	PC		;RETURN TO CALLER

	30$:	DEC	DEXST		;TIMEOUT?
		BNE	10$		;NO -- CONTINUE WAITING
	39$:	TWIDDLE			;COUNT THE NUMBER OF TIMES THIS HAPPENS
		TWIDDLE	STATD(R0)	;REMEMBER STATUS REGISTER
		TWIDDLE	DAG1(R0)	;REMEMBER SOME OTHER STATUS
		SEC			;SET CC-C TO INDICATE FAILURE
		RTS	PC		;AND RETURN WITH BAD NEWS

	40$:	BIS	#ERR11C,STATD(R0) ;CLEAR THE ERROR STATUS
		BR	39$		;AND CLAIM FAILURE
 REP 33/46	;10C6
	10$:	JSR	PC,..ALOW	;ALLOCATE BUFFER
 WIT
	10$:	JSR	PC,..ALCB	;ALLOCATE BUFFER
 SUM 82928