perm filename FD11.1[KL,SYS] blob sn#209154 filedate 1976-04-03 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00012 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	MODIFICATION HISTORY
C00003 00003
C00006 00004
C00008 00005
C00010 00006
C00012 00007
C00014 00008
C00015 00009
C00017 00010
C00018 00011
C00020 00012
C00023 ENDMK
CāŠ—;
;;;MODIFICATION HISTORY
;;;
;;; 15 NOV 75  OBTAINED FROM DEC (KLDCP REV 7)
;;; 15 NOV 75  CONVERTED TO PALX FORMAT
;;;

.SBTTL	CONTROL RAM CONSOLE FUNCTIONS, 9-SEPTEMBER-75

$EC:	DFLEGAL 		;FUNCTION LEGAL ?
	TTISDL
	BCS 8$			;NON-NUMBER

1$:	TTICRA 			;READ IN C-RAM ADDRESS
	BR 3$

8$:	BVC 82$
	MOV $ECADR,R0		;COLON, READ & LIST SAME CRAM ADDRESS
	INC $INPTC
	BR 33$

82$:	TTBTRM

$ALLEC=.
	DFRDT 			;EXAMINE PRESENT C-RAM OUTPUT
	RCRAM2
	JSR PC,$ECGET
	PUSH $ECADR
	DFRDT 			;READ HIGH ORDER BITS
	RCRAM1
	POP R0			;LOW ORDER TO R0
	JSR PC,$ECGET
	ASL R0			;POSITION TO 6-0
	ASL R0
	SWAB R0
	BISB R0,$ECADR		;STUFF LOW ORDER
	MOV #-1,R0		;-1 READS CURRENT C-RAM OUTPUT
	BR 33$

3$:	MOV R0,$ECADR		;SAVE C-RAM ADDRESS

33$:	RCRAM 			;READ THE RAM ADDRESS

	MOV R0,$ADR1		;SAVE STARTING ADDRESS OF DATA LIST
	TST ALLFLG
	BNE 91$
9$:	PCRLF 			;PRINT OCTAL VALUE OF C-RAM

	JSR PC,$$ECA		;PRINT C-RAM ADDRESS

	MOV $ADR1,R5		;GET C-RAM DATA LIST ADDRESS
	ADD #12,R5
	MOV (R5),R4		;SAVE SPEC
	MOV -(R5),R0		;PRINT 1ST C-RAM WORD, LAST IN LIST
	PNTOCT

	MOV -(R5),R0		;PRINT 2ND C-RAM WORD
	PNTOCT

	MOV -(R5),R0		;PRINT 3RD C-RAM WORD
	PNTOCT

	MOV -(R5),R0		;PRINT 4TH C-RAM WORD
	PNTOCT

	MOV -(R5),R0		;PRINT 5TH C-RAM WORD
	PNTOCT

	MOV R4,R0		;PRINT 6TH C-RAM WORD (SPEC)
	PNTODT
	2

91$:	MOV $ECADR,R0
	MOV $ADR1,R1
	PNTCRM 			;PRINT C-RAM BY LOGICAL FIELDS
	JMP ALLEXT

$ECGET:	MOV @.DAT2,$ECADR	;GET BITS 4,5
	MOVB @.DAT1,$ECADR	;GET BITS 0-3
	SWAB $ECADR
	BIC #170077,$ECADR
	RTS PC

;FIELD PRINT OUT, THIS IS THE C-RAM BIT FIDDLER

$PCRAM:	MOV R0,$ECADR
	MOV R1,$ADR1

91$: PMSG <\ LOC/  J  T AR  AD BR MQ FM SCAD SC FE SH  # VMA MEM COND SPEC M\>

	JSR PC,$$ECA		;PRINT C-RAM ADDRESS

$DCTPC:	MOV #$CRMD0,R5		;GET PRIMARY DECISION TABLE ADDRESS
$DCTP1:	CLR R0	
	MOV (R5)+,R4		;R4=SECONDARY DECISION TABLE ADDRESS
	BEQ $END		;WOW WE MADE IT TO THE END

2$:	MOVB (R4)+,R3		;GET A BYTE FROM SECONDARY TABLE
	BEQ $NEXT		;GET NEXT FIELD
	MOVB R3,R2		;CALCULATE BYTE LOCATION
	ASRB R3			;/2
	ASRB R3			;/4
	ASRB R3			;/8
	ADD $ADR1,R3
	MOVB (R3),R3		;FETCH THE DATA BYTE
	BICB #370,R2		;R2=BIT LOCATION
3$:	ASRB R3			;CALCULATE BIT LOCATION
	DEC R2			;FOUND BIT YET
	BGE 3$
	ROL R0			;PLACE BIT IN R0
	BR 2$

$NEXT:	MOVB (R5)+,R1		;R1=OCTAL CHARACTERS IN NUMBER
	PNTODC 			;PRINT THE NUMBER
	MOVB (R5)+,R1		;R1=POST SPACING PARAMETER
	JSR PC,$PNTSPC
	BR $DCTP1
$END:	MOV $ADR1,R5		;SPECIAL PRINT OF SPEC FIELD
	MOVB 12(R5),R0
	PNTODT
	2
	PSPACE
	MOVB 4(R5),R0
	SHIFTR
	4
	BIC #177776,R0
	PNTOCS
	TST ALLFLG
	BEQ 1$
	PCRLF
1$:	EXIT

;READ THE C-RAM AND PRINT ACTUAL BY E-BUS ARRANGMENT

$RC:	DFLEGAL 		;FUNCTION LEGAL ?
	TTISDL
	BCS 3$			;NON-NUMBER
	BR 2$			;NUMBER, MUST BE ADDRESS

1$:	MOV #RCRAM1,R0
	JSR R5,$RCP		;FIRST 36
	MOV #RCRAM2,R0
	JSR R5,$RCP		;2ND 36
	MOV #RCRAM3,R0
	JSR R5,$RCP		;3RD 36
	MOV #RCRAM4,R0
	JSR R5,$RCP		;4TH 36
	TST RPTFLG
	BNE 11$
	PCRLF
11$:	JMP $KONSL

2$:	TTICRA 			;GET C-RAM ADDRESS
	MOV R0,$ECADR
5$:	MOV $ECADR,R0

	WWADR 			;WRITE C-RAM ADDRESS

	DFSCLK
	DFSCLK

	JSR PC,$$ECA		;PRINT C-RAM ADDRESS
	PSPACE

	BR 1$

3$:	BVC 32$
	INC $INPTC		;COLON, READ SAME C-RAM ADDRESS
	BR 5$

32$:	TTBTRM 			;READ PRESENT C-RAM ADDRESS
	BR 1$

$RCP:	MOV #.DFRDA,R1
	DFRDMV 			;READ C-RAM

	MOV R1,R0
	PNT36 			;PRINT IT
	PSPACE
1$:	RTS R5

;PRINT C-RAM ADDRESS

$$ECA:	MOV $ECADR,R0
	PNTODT
	4
	PSLASH
	RTS PC

.SBTTL	DISPATCH RAM CONSOLE FUNCTIONS

;LOAD D-RAM SUBROUTINE

$DDNPR:	JMP $PARAM

$DD:	DFLEGAL 		;FUNCTION LEGAL ?
	TTISDO 			;GET THE ADDRESS
	BIT #1,R0
	BNE 98$			;MUST BE EVEN ADDRESS

	MOV R0,$ADR		;SAVE THE ADDRESS

	CMP R0,#776		;TEST ADDRESS SIZE
	BLE 2$
98$:	JMP ADRERR

2$:	TTIBRK 			;READ A CHARACTER
	BCS $DDNPR		;NO COLON

	CMPB R0,#':		;IS IT A COLON
	BEQ 21$
	CMPB R0,#'/
	BNE $DDNPR

21$:	JSR PC,$DDA		;READ A FIELD
	MOV R0,$DRAM		;STORE "A" FIELD

	JSR PC,$DDB
	BIS R0,$DRAM		;STORE "B" FIELD

	TTISDO 			;READ "P" FIELD
	BIC #177776,R0		;SAVE "P" FIELD

	SHIFTL
	  5
	BIS R0,$DRAM

	TTISDO 			;READ "J" FIELD

	CMP R0,#1777
	BLE 3$
$DDSIZ=.
	PMSG <\J SIZE ERR>
	JMP $CNTLC

3$:	MOV R0,$DRAM+6		;SAVE FOR COMMON
	BIC #177760,R0
	BIS R0,$DRAM		;SAVE "J" EVEN

;DONE WITH EVEN NOW PROMPT FOR ODD

$DRAMO:	PMSG < DD >			;PROMPT
	MOV $ADR,R0			;ODD ADDRESS
	INC R0

	PNTOCS

	PMSG <:ā†>			;PRINT COLON, OUTPUT

	TTILIN
	BCS $DDNPR

	JSR PC,$DDA			;READ ODD "A" FIELD
	MOV R0,$DRAM+2		;INSERT ODD "A" FIELD

	JSR PC,$DDB			;READ ODD "B" FIELD
	BIS R0,$DRAM+2

	TTISDO 			;READ ODD "P" FIELD

	BIC #177776,R0

	SHIFTL
	  5
	BIS R0,$DRAM+2

	TTISDO 			;READ ODD "J" FIELD

	CMP R0,#1777
	BGT $DDSIZ

1$:	MOV R0,$DRAM+10		;SAVE FOR COMMON
	BIC #177760,R0
	BIS R0,$DRAM+2		;SAVE "J" ODD
	BIC #17,$DRAM+6
	BIC #17,$DRAM+10
	CMP $DRAM+6,$DRAM+10  ;ARE BOTH COMMONS THE SAME ?
	BEQ 2$
	CMP #254,$ADR		;IS THIS JRST/JFCL ?
	BEQ 2$			;YES, COMMONS MAY BE DIFFERENT
	PMSG <\J CMN ERR>
	JMP $CNTLC

2$:	MOV $DRAM+10,R0		;USE ODD COMMON

	SR R0,6
	MOV R0,$DRAM+4		;INSERT "J" COMMON

	MOV $ADR,R0		
	MOV #$DRAM,R1

	MRESET

	WDRAM 			;WRITE THE D-RAM

	PCRLF
	JMP @#$KONSL

99$:	JMP $OCTN

$DDA:	TTISDO 			;READ "A" FIELD
	SHIFTL
	  11.
	BIC #143777,R0
	RTS PC

$DDB:	TTISDO 			;READ "B" FIELD
	SHIFTL
	  8.
	BIC #174377,R0
	RTS PC

;EXAMINE D-RAM SUBROUTINE

$EDNOA:	JMP $OCTN
$EDODD:	JMP ADRERR

$ED:	DFLEGAL 		;FUNCTION LEGAL ?
	TTISDL
	BCS 5$

	TTISDO 			;READ THE ADDRESS
	BIT #1,R0
	BNE $EDODD		;MUST BE EVEN ADDRESS
	MOV R0,$EDADR
4$:	CMP R0,#777		;TEST FOR HIGHEST ADDRESS
	BLE 2$
41$:	JMP ADRERR

5$:	BVC 52$
51$:	MOV $EDADR,R0		;COLON, EXAMINE SAME DRAM ADDRESS
	INC $INPTC
	BR 4$

52$:	TTBTRM
	MOV $EDADR,R0
	BR 4$

2$:	MOV R0,$EDADR

	MRESET

	RDRAM 			;READ D-RAM

	MOV R0,R1
	MOV $EDADR,R0

	PNTDRM 			;PRINT D-RAM

	JMP $KONSL

;PRINT D-RAM IN LOGICAL FIELD FORMAT

$PDRAM:	MOV R0,R5
	PMSG <\ADR: A B P J\>

	MOV 4(R1),R0		;POSITION COMMON J-FIELD
	SHIFTL
	6 			;FOR PRINTING
	MOV R0,R2

	CLR R4

1$:	MOV R5,R0		;PRINT D-RAM ADDRESS
	PNTODT
	3
	PSLASH
	PSPACE

	MOV (R1),R0		;PRINT A-FIELD
	SHIFTR
	11.
	PNTNBR
	PSPACE

	MOV (R1),R0		;PRINT B-FIELD
	SHIFTR
	8.
	PNTNBR
	PSPACE

	MOV (R1),R0		;PRINT PARITY
	SHIFTR
	5
	BIC #177776,R0
	PNTNBR
	PSPACE

	MOV (R1)+,R0		;PRINT J-FIELD
	BIC #177760,R0
	BIS R2,R0
	PNTODT
	4

	PCRLF
	TST R4			;COMPLETED D-RAM PAIR ?
	BNE 2$

	INC R4			;NO, SET FLAG
	INC R5			;SETUP ODD ADDRESS
	BR 1$			;GO DO ODD PRINTOUT

2$:	EXIT

.SBTTL	DEPOSIT C-RAM SUBROUTINE

$DCNCL:	JMP $PARAM

$DC:	DFLEGAL 		;FUNCTION LEGAL ?
	TTICRA
2$:	MOV R0,$ADR		;SAVE ADDRESS
	TTIBRK 			;GET THE COLON
	BCS $DCNCL
	CMPB R0,#':
	BEQ 20$
	CMPB R0,#'/
	BNE $DCNCL		;NO COLON
20$:	MOV #$TTSAV,R5		;CLEAR STORAGE
	CLR (R5)+
	CLR (R5)+
	CLR (R5)+
	CLR (R5)+
	CLR (R5)+
	CLR (R5)
	MOV #5,R4
4$:	TTISDL
	BCS 3$			;USE 0'S AFTER FIRST NON-NUMBER
	TTCOCT
	MOV R0,-(R5)
	DEC R4
	BNE 4$
	TTISDL
	BCS 3$
	TTCOCT
	BIC #177740,R0
	MOV R0,$TTSAV+12
3$:	MOV $ADR,R0
	MOV #$TTSAV,R1
	WCRAM
	JMP @#$KONSL

;C-RAM PRIMARY DECISION TABLE
;
$CRMD0:	.WORD $FJ			;J FIELD
	.BYTE 4,1			;CHARACTERS , POST SPACING

	.WORD $FT			;T FIELD
	.BYTE 1,1

	.WORD $FAR			;AR FIELD
	.BYTE 2,1

	.WORD $FAD			;AD FIELD
	.BYTE 4,1

	.WORD $FBR			;BR FIELD
	.BYTE 1,2

	.WORD $FMQ			;MQ FIELD
	.BYTE 1,2

	.WORD $FFM			;FM FIELD
	.BYTE 1,2

	.WORD $FSCAD			;SCAD FIELD
	.BYTE 3,2

	.WORD $FSC			;SC FIELD
	.BYTE 1,2

	.WORD $FFE			;FE FIELD
	.BYTE 1,2

	.WORD $FSH			;SH FIELD
	.BYTE 1,1

	.WORD $FNUM			;NUM FIELD
	.BYTE 3,2

	.WORD $FVMA			;VMA FIELD
	.BYTE 1,2

	.WORD $FMEM			;MEM FIELD
	.BYTE 2,3

	.WORD $FCOND			;COND FIELD
	.BYTE 2,3

	.WORD 0			;END OF TABLE WORD

;C-RAM SECONDARY DECISION TABLES

$FJ:	.BYTE 74.,73.		;J00(5), J01(6)
	.BYTE 72.,71.		;J02(7), J03(8)
	.BYTE 70.,69.		;J04(9), J05(10)
	.BYTE 68.,67.		;J06(11), J07(12)
	.BYTE 66.,65.		;J08(13), J09(14)
	.BYTE 64.,0		;J10(15)

$FT:	.BYTE 3.,1.		;T00(76), T01(78)
	.BYTE 0,0

$FAR:	.BYTE 43.,11.		;ARXM SEL4(36), ARXM SEL2(68)
	.BYTE 9.,34.		;ARXM SEL1(70), ARM SEL4(45)
	.BYTE 15.,13.		;ARM SEL2(64), ARM SEL1(66)
	.BYTE 0,0

$FAD:	.BYTE 51.,47.		;ADB SEL2(28), ADB SEL1(32)
	.BYTE 54.,53.		;ADA DIS(25), ADA SEL2(26)
	.BYTE 52.,5.		;ADA SEL1(27), AD CRY(74)
	.BYTE 55.,59.		;AD BOOLE(24), AD SEL 8 (20)
	.BYTE 58.,57.		;AD SEL 4 (21), AD SEL 2 (22)
	.BYTE 56.,0		;AD SEL 1 (23)

$FBR:	.BYTE 25.,27.		;BRX LOAD(54), BR LOAD(52)
	.BYTE 0,0

$FMQ:	.BYTE 63.,0		;MQ SEL(16)

$FFM:	.BYTE 23.,22.		;FM ADR SEL4(56), FM ADR SEL2(57)
	.BYTE 21.,0		;FM ADR SEL1(58)

$FSCAD:	.BYTE 37.,19.		;SCADB SEL2(42), SCADB SEL1(60)
	.BYTE 79.,39.		;SCADA DIS(0), SCADA SEL2(40)
	.BYTE 38.,78.		;SCADA SEL1(41), SCAD 4(1)
	.BYTE 77.,76.		;SCAD 2(2), SCAD 1(3)
	.BYTE 0,0

$FSC:	.BYTE 17.,0		;SCM SEL 2(62)

$FFE:	.BYTE 75.,0		;FE LOAD(4)

$FSH:	.BYTE 33.,32.		;SH/ARMM SEL2(46), SH/ARMM SEL1(47)
	.BYTE 0,0

$FNUM:	.BYTE 50.,49.		;#00(29), #01(30)
	.BYTE 48.,46.		;#02(31), #03(33)
	.BYTE 45.,44.		;#04(34), #05(35)
	.BYTE 42.,41.		;#06(37), #07(38)
	.BYTE 40.,0		;#08(39)

$FVMA:	.BYTE 35.,7.		;VMA SEL 2(44), VMA SEL 1(72)
	.BYTE 0,0

$FMEM:	.BYTE 31.,30.		;MEM 00(48), MEM 01(49)
	.BYTE 29.,28.		;MEM 02(50), MEM 03(51)
	.BYTE 0,0

$FCOND:	.BYTE 62.,61.		;COND 00(17), COND 01(18)
	.BYTE 60.,26.		;COND 02(19), COND 03(53)
	.BYTE 24.,20.		;COND 04(55), COND 05(59)
	.BYTE 0,0