Google
 

Trailing-Edge - PDP-10 Archives - klad_sources - klad.sources/m.mac
There are no other files named m.mac in the archive.
; This file is m.mac
;INITIALIZE TAPE DRIVE DATA TABLE. GET DATA FOR ALL TAPE KDBS ON SYSTEM
TDINI:	MOVEI	A,TAPTAB		;MAKE AOBJN PTR TO DATA TABLE
	HRLI	A,-MAXKDB
	MOVEI	AC1,'MTA'		;START WITH MTA
TDINI1:	MOVEI	AC2,.DIOKI		;GET KDB STATUS FUNCTION
	MOVEM	AC2,DIOKIB		;STORE IN UUO BLOCK
	HRLZM	AC1,DIOKIB+1		;STORE KDB NAME IN BLOCK TOO
	MOVE	AC2,[XWD -DIOKIL,DIOKIB]	;SETUP DIAG UUO AC
	DIAG.	AC2,			;ASK MONITOR FOR KDB STATUS
	  JRST	TDINI3			;GO CHECK ERROR
	HRLM	AC1,(A)			;KDB EXISTS, STORE IN TABLE
	HRRZ	AC3,(A)			;GET ADDRESS OF DATA SUB-TABLE
	DMOVE	AC4,DIOKIB+2		;GET 1ST TWO STATUS WORDS
	DMOVEM	AC4,(AC3)		;STORE IN KDB SUB-TABLE
	MOVE	AC4,DIOKIB+4		;GET LAST STATUS WORD
	MOVEM	AC4,2(AC3)		;STORE IT ALSO
	ADDI	AC3,OKIL		;POINT TO NEXT PART OF SUB-TABLE
	MOVEI	AC2,.DILKU		;GET LIST UNITS FUNCTION
	MOVEM	AC2,DILKUB		;STORE IN UUO BLOCK
	HRLZM	AC1,DILKUB+1		;KDB NAME
	MOVE	AC2,[XWD -DILKUL,DILKUB]	;SETUP DIAG UUO AC
	DIAG.	AC2,			;ASK MONITOR FOR UNITS LIST
	  JRST	TDINI3			;GO CHECK ERROR
	JUMPE	AC2,TDINI2		;IF NO UNITS, ON TO NEXT KDB
	ADDI	AC2,-1(AC3)		;COMPUTE ENDING BLT ADDRESS
	HRLI	AC4,DILKUB+2		;SETUP BLT AC
	HRR	AC4,AC3
	BLT	AC4,(AC2)		;COPY UNIT NAMES TO SUB-TABLE
	MOVEI	AC2,.DIOUI		;GET LIST UNIT'S KDBS FUNCTION
	MOVEM	AC2,DIOUIB		;STORE IN DIAG UUO BLOCK
	MOVE	AC2,(AC3)		;GET 1ST UNIT NAME
	MOVEM	AC2,DIOUIB+1		;STORE IT ALSO
	ADDI	AC3,MAXUNI		;POINT TO NEXT PART OF SUB-TABLE
	HRLI	AC3,-OUIL		;BUILD AOBJN PTR FOR UUO
	MOVEM	AC3,DIOUIB+2		;STORE IN DIAG UUO BLOCK
	MOVE	AC2,[XWD -<DIOUIL+4>,DIOUIB]	;SETUP DIAG UUO AC
	DIAG.	AC2,			;ASK MONITOR FOR UNIT'S KDB NAMES
	  JRST	TDINI3			;GO CHECK ERROR
TDINI2:	ADDI	AC1,1			;NEXT KDB NAME
	AOBJN	A,TDINI1		;LOOP FOR NEXT KDB
	RTN

TDINI3:	TLNE	AC2,-1			;IF AC UNCHANGED, FUNC NOT SUP
	JRST	TDINI4			;DIAG. NOT SUPPORTED
	CAIN	AC2,3			;ILLEGAL KONTROLLER?
	JRST	TDINI2			;YES, LOOP FOR NEXT ONE
	PMSGF	<DIAG. UUO FAILURE - ERROR CODE: >
	MOVE	AC2
	PNTOCF
	TRNA
TDINI4:	PMSGF	<^DIAG. UUO NOT IMPLEMENTED>
	PCRLF
	FATAL

;FIND A DX10 IN TAPE DRIVE DATA TABLE
;RETURNS ADDRESS OF SUB-TABLE IN AC

FNDDX:	MOVEI	A,TAPTAB		;MAKE AOBJN PTR INTO TAPTAB
	HRLI	A,MAXKDB
FNDDX1:	MOVE	AC,(A)			;GET TABLE ENTRY
	TLZN	AC,-1			;IF LH ZERO, NO KONTROLLER
	JRST	FNDDX2
	HRLI	AC,(KT0KTY)		;MAKE PTR TO KONTROLLER TYPE
	LDB	AC
	CAIE	.TFKTX			;DX10?
	JRST	FNDDX2			;NOPE
	TLZ	AC,-1			;JUST KEEP ADDRESS OF SUB-TABLE
	RTN
FNDDX2:	AOBJN	A,FNDDX1		;LOOP FOR NEXT KDB
	SETZ	AC,			;NONE FOUND
	RTN