perm filename DEPTST.PAL[KL,SYS] blob sn#211377 filedate 1976-04-19 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	.TITLE DEPTST	TEST DEPOSIT RELATIVE TO THE EPT
C00007 ENDMK
C⊗;
.TITLE DEPTST	TEST DEPOSIT RELATIVE TO THE EPT

R0=%0
R1=%1
R2=%2
R3=%3
R4=%4
R5=%5
SP=%6
PC=%7

RCSR==177560
RDB==177562
TCSR==177564
TDB==177566

;TC11 REGISTERS
TCST=177340
TCCM=177342
TCWC=177344
TCBA=177346
TCDT=177350

;DTE20 REGISTERS
DEXWD1=174406		;BITS 0-3 IN 3-0
DEXWD2=174404		;BITS 4-19
DEXWD3=174402		;BITS 20-35
TENAD1=174410		;15-13=ADR SPACE, 12=DEP, 11=UNPROT, 6-0=ADDR BITS 13-19

; CNT2 PROTECTION OFF (1) is cleared by CNT4 DEX DONE although the corresponding
; bit in the RAM location remains set.

TENAD2=174412		;BITS 20-35
STATUS=174434		;BII 2 IS ON FOR DEX DONE

.MACR TYPEIT STR
	JSR R5,TYPE
.IRPC X,STR
	.BYTE ''X
.ENDM
	.BYTE 0
	.EVEN
.ENDM

.=40000
.=.+200
PDL:

GO:	RESET
	MOV	#PDL,SP
	MOV	#014000,R0	;EPT RELATIVE DEP, UNPROT, MA 13-19 = 0
	CLR	R1		;ADDRESS FOR TENAD2
	MOV	#1000,R3	;NUMBER OF DEPOSITS
DEPLUP:	MOV	R3,DEXWD3
	MOV	R3,DEXWD2
	MOV	R3,R5
	BIC	#177760,R5
	MOV	R5,DEXWD1
	MOV	R0,TENAD1
	MOV	R1,TENAD2
	NOP
	NOP
DEPWAI:	BIT	#4,STATUS
	BEQ	DEPWAI
	INC	R1
	SOB	R3,DEPLUP
	TYPEIT	<DONE>
	HALT	

;TYO, TYO00

;TYPE CHARACTER IN R0.  IGNORE 1S
TYO:	BIC #177600,R0		;FLUSH PARITY BIT
	BEQ TYORET		;TYPE NULLS (PADDING) IF VT05
	CMPB R0,#40
	BHIS TYOTYP		;TYPE BIGGER THAN 40 AS IS
	CMPB R0,#10
	BEQ TYOTYP		;TYPE BACKSPACE
	CMPB R0,#11
	BEQ TYOTYP		;TYPE TABS
	CMPB R0,#33
	BEQ TYOALT		;TYPE $ FOR ALT MODE
	CMP R0,#12
	BEQ TYOTYP
	CMP R0,#15
	BEQ TYOTYP
	MOV R0,-(SP)
	MOV #'↑,R0
	JSR PC,TYOTYP
	MOV (SP)+,R0
	BIS #100,R0
	JSR PC,TYOTYP
	BIC #100,R0
	BR TYORET
TYOTYP:	TSTB TCSR
	BPL .-4
	MOVB R0,TDB
TYORET:	RTS PC

TYOALT:	MOV #'$,R0
	JSR PC,TYOTYP
	MOV #33,R0
	RTS PC

;CALL WITH JSR R5,TYPE FOLLOWED BY BYTES OF ASCII TO BE TYPED FOLLOWED BY ZERO BYTE

TYPE0:	JSR PC,TYO
TYPE:	MOVB (R5)+,R0
	BNE TYPE0
	INC R5			;INCREMENT TO NEXT EVEN ADDRESS
	BIC #1,R5
	RTS R5

BUF:	.BLKW 400
.END	GO