RT-11 idle light pattern

Paul Koning paulkoning at comcast.net
Sun Dec 31 09:27:33 CST 2017



> On Dec 31, 2017, at 10:21 AM, Paul Koning via cctalk <cctalk at classiccmp.org> wrote:
> 
> ...
>> 
>> Ah; it must busy loop at loops spread across the address space? Clever!
>> (Perhaps using the mapping hardware so that it doesn't use too much _actual_
>> memory.) Is the source available?
> 
> Correct, it uses the MMU so it only needs 64 bytes of table space to get the low order bits right.  See attached.

Ok, so the list stripped the attachment.  Try it this way.

	paul

	.INCLUDE /CMN:COMMON/
TITLE	LIGHTS,<FANCY NULL JOB>,0A,10-MAY-91,MHB/ABC/WBN

;
;		COPYRIGHT (c) 1974, 1991 BY
;	DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
;
; THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
; ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH  LICENSE AND 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.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
; TRANSFERRED.
;
; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT  NOTICE
; AND  SHOULD  NOT  BE  CONSTRUED  AS  A COMMITMENT BY DIGITAL EQUIPMENT
; CORPORATION.
;
; DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE  OR  RELIABILITY  OF ITS
; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
;
.SBTTL	EDIT HISTORY FOR LIGHTS
;+
;
;  000	RRF  06-MAR-81	CREATION - COPIED FROM V7.0-07
;
;-
	DEFORG	LIGHTS

.SBTTL	A FANCY NULL JOB

; NEEDED DEFINITIONS

SISDR0	=	172200		;SUPERVISOR INSTRUCTION DESC REG 0
SISAR0	=	172240		;SUPERVISOR INSTRUCTION ADDR REG 0

PS	=	177776		;PROCESSOR STATUS

	ORG	NULJOB

; INITIAL ENTRY POINT

NULJOB:	BIT	#004000,@#PS	;DO WE HAVE SUPERVISOR MODE (2 REG SETS)?
	BNE	30$		;YES, DO IT FANCY...

; THE SIMPLE NULL JOB

10$:	MOV	R2,R1		;RELOAD THE WAIT COUNTER
20$:	WAIT			;DISPLAY THE LIGHTS (R0) A WHILE
	SOB	R1,20$		;KEEP WAITING
	ROL	R0		;ELSE SHIFT PATTERN 1 PLACE LEFT
	BR	10$		; AND AROUND AGAIN...

; FANCY NULL JOB SETUP

30$:	MOV	#176000,R3	;PRE-SET THE MEM ADR LIGHT PATTERN
	MOV	(PC)+,R4	;GET DESC REG VALUE FOR
	 .BYTE	4!2,128.-1	;	R/W AND 4K
	MOV	#SISDR0,R5	;POINT TO SUPERVISOR DESC REGS
	MOV	R4,(R5)+	;LOAD SISDR0 WITH 4K AND R/W
	MOV	R4,(R5)+	;LOAD SISDR1 WITH 4K AND R/W
	MOV	R4,(R5)+	;LOAD SISDR2 WITH 4K AND R/W
	MOV	R4,(R5)+	;LOAD SISDR3 WITH 4K AND R/W
	MOV	#177600,SISAR0-SISDR0(R5) ;LOAD PAR4 FOR THE I/O PAGE
	MOV	R4,(R5)+	;LOAD SISDR4 WITH 4K AND R/W
	MOV	#40$,R1		;FORM A MMU ADDRESS
	ASH	#-6,R1		; THAT WILL MAP OUR CODE
	BIC	#^C<001777>,R1	;  IN SUPERVISOR MODE
	MOV	R1,SISAR0-SISDR0(R5) ;LOAD MMU ADDRESS FOR PAR5 (CODE)
	MOV	(PC)+,(R5)+	;LOAD SISDR5 WITH
	 .BYTE	2,128.-1	;	R-O AND 4K
	CLR	(R5)+		;LOAD SISDR6 WITH "ABORT"
	MOV	R4,(R5)+	;LOAD SISDR7 WITH 4K AND R/W
	MOV	#000340,@#PS	;;;WE CAN'T AFFORD AN INTERRUPT HERE
	MOV	#054040,-(SP)	;;;NEW PS OF SUPERVISOR MODE @ PR1
	MOV	#40$,-(SP)	;;;NEW PC OF OUR ROUTINE
	BIC	#^C<77>,(SP)	;;; CORRECTED FOR RUNNING
	BIS	#120000,(SP)	;;;  OUT OF PAR5
	RTI			;;;DROP INTO SUPERVISOR MODE!!!
; THE FANCY NULL JOB

40$:	MOV	R3,R1		;COPY PATTERN FOR MEM ADR LIGHTS
	BIC	#^C<077776>,R1	; AND ENSURE AN HONEST ADDRESS
	CLR	R4		;CLEAR A HIGH ORDER
	MOV	R1,R5		; AND SET LOW ORDER AS ADDRESS
	ASHC	#3,R4		;EXTRACT THE APR #
	ASL	R4		; AND FORM APR # TIMES 2
	ADD	#SISAR0-160000+100000,R4 ;FIND PAR TO USE (I/O PAGE = PAR4)
	ASH	#-3,R5		;CORRECT THE VIRTUAL ADDRESS
	BIC	#^C<017700>,R5	; AND ISOLATE OFFSET WITHIN PAR
	NEG	R5		;SUBTRACT OFFSET WITHIN PAR
	ADD	#70$,R5		; FROM OUR WORK TABLE
	ASH	#-6,R5		;FIND THAT AS A MMU ADDRESS
	BIC	#^C<001777>,R5	; WITH NO SIGN EXTENSION
	MOV	R5,(R4)		;LOAD CORRECT PAR WITH CORRECT ADDRESS
	BIT	R4,#16		;ARE WE USING PAR0?
	BNE	50$		;NO
	ADD	#20,R4		;YES, CORRECT FOR PAR7 NEXT
50$:	SUB	#200,R5		;GO BACKWARDS 4K
	MOV	R5,-(R4)	; AND LOAD NEXT LOWER PAR WITH THAT
	MOV	(PC)+,(R1)	;LOAD THE RETURN INSTRUCTION
		JMP	(R4)	; WHICH IS JUMP THROUGH R4
	MOV	(PC)+,-(R1)	;LOAD THE WAITING INSTRUCTION
		WAIT		; WHICH IS WAIT
	MOV	R2,R5		;REFRESH WAIT COUNTER
	MOV	PC,R4		;SET THE RETURN ADDRESS
	CMP	(R4)+,(R4)+	; FOR WAITING DONE (PIC)
60$:	JMP	(R1)		;GO OFF AND DISPLAY LIGHTS...
	SOB	R5,60$		;DO UNTIL TIME'S UP
	ASL	R0		;SHIFT LIGHTS 1 PLACE LEFT
	ROR	R3		; AND BACK THROUGH MEMORY LIGHTS
	ADC	R0		;  WITH A CARRY
	BR	40$		;FROM THE TOP...

	.BLKB	100		;RESERVE WORK SPACE
70$:	.BLKB	100		;RESERVE WORK SPACE

.END



More information about the cctalk mailing list