Google
 

Trailing-Edge - PDP-10 Archives - BB-H311B-RM - swskit-utilities/units.mac
There are 8 other files named units.mac in the archive. Click here to see a list.
	TITLE UNITS  PROGRAM TO TYPE OUT DISK UNIT STATUS INFORMATION
	SUBTTL	MINOR ADDITIONS AND MAJOR CLEANUP BY J. G. ZIMA/JGZ

	SEARCH	MONSYM,MACSYM
	.REQUIRE SYS:MACREL
	.DIRECT	FLBLST
	SALL



;VERSION INFORMATION:

	VWHO==0			;WHO LAST EDITED
	VMAJOR==1		;MAJOR VERSION
	VMINOR==0		;MINOR VERSION
	VEDIT==3		;EDIT LEVEL



;REVISION HISTORY:
;
;   1	JGZ	1-APR-79
;		ADD RP07, RP08, RM03.  HANDLE CONTINUE.  GENERAL CLEANUP
;		INCLUDING COMMENTS, ENTRY VECTOR, VERSION NUMBER.
;
;   2	JGZ	1-APR-79
;		ADD ENABLING AND RESTORING OF CAPABILITIES, USE OF ALIAS.
;
;   3	JGZ	15-JAN-80
;		ADD FEATURES FOR RP20, CONTROLLER FIELD, MORE CLEANUP.
;


;ACCUMULATORS

	F=0			;FLAGS
	T1=1			;TEMP AND JSYS ACS
	T2=2
	T3=3
	T4=4
	Q1=5			;PRESERVED Q ACS
	Q2=6
	Q3=7
	P1=10			;PRESERVED P ACS
	P2=11
	P3=12
	CX=16
	P=17			;PUSHDOWN POINTER
	
;CONSTANTS
	
	PDLEN==10		;PUSH DOWN STACK LENGTH
	F%HDR==1B0		;HEADER TYPED FLAG
	SUBTTL	ENTRY VECTOR AND MAIN ROUTINE


;ENTRY VECTOR

EVEC:	JRST	UNITS		;START ADDRESS
	JRST	UNITS		;REENTER ADDRESS
	BYTE	(3)VWHO(9)VMAJOR(6)VMINOR(18)VEDIT ;VERSION


;AND THE PROGRAM BEGINS HERE

UNITS:	RESET			;TRADITIONAL
	SETZM	F		;CLEAR FLAGS
	MOVE	P,[IOWD PDLEN,PDL] ;INITIALIZE THE STACK
	MOVEI	T1,.FHSLF	;US
	RPCAP			;OUR CAPABILITIES
	PUSH	P,T3		;SAVE FORMER
	PUSH	P,T2		; CAPS AND MASK
	IOR	T3,T2		;ASK FOR OUR WORLD
	EPCAP			; AND TRY TO GET IT
	CALL	CNFINF		;PRINT IT ALL
	MOVEI	T1,.FHSLF	;US AGAIN
	POP	P,T2		;RESTORE OUR FORMER
	POP	P,T3		;CAPABILITIES
	EPCAP			; TO USER
	HALTF			;AND WE ARE DONE
	JRST	UNITS		;DO IT AGAIN ON CONTINUE
	SUBTTL	ROUTINES TO DO THE WORK


;ROUTINE TO SETUP STRING CONTAINING AVAILABLE UNIT INFO AND TYPE IT

CNFINF:	SETOM	RNUBLK+.MSRCH	;INIT FOR FIRST CHANNEL
	SETOM	RNUBLK+.MSRCT	;		CONTROLLER
	SETOM	RNUBLK+.MSRUN	;		UNIT

CNFIN1:	CALL	GTUSTS		;GET STATUS OF NEXT UNIT
	 JRST	CNFIN3		;NO MORE - DONE
	HRROI	T1,HHDR		;POINT TO HEADER
	TXON	F,F%HDR		;TYPED HEADER YET?
	PSOUT			;NO, OUTPUT IT
	MOVE	Q2,RNUBLK+.MSRST	;GET STATUS WORD
	HRROI	T1,[ASCIZ "  No "]	;ASSUME NOT MOUNTED
	TXNE	Q2,MS%MNT		;MOUNTED?
	HRROI	T1,[ASCIZ "  Yes"]	;CHANGE OUR MIND
	PSOUT			;AND PRINT
	MOVEI	T3,5		;6 SPACES
	CALL	SPACN		;SPACE OVER
	LOAD	T3,MS%TYP,Q2	;FETCH THE UNIT TYPE CODE
	HRROI	T1,[ASCIZ "UNK "] ;ASSUME UNKNOWN FOR OUT OF RANGE
	CAIG	T3,MXUTYP	;VALID TYPE?
	MOVE	T1,UNTYTB(T3)	;GET NAME OF UNIT TYPE
	PSOUT			;TYPE IT
	MOVE	T2,RNUBLK+.MSRCH ;GET CHANNEL NUMBER
	MOVX	T3,NO%MAG+NO%LFL+FLD(^D9,NO%COL)+^D8
	MOVEI	T1,.PRIOU
	NOUT			;CONVERT TO OCTAL NUMBER
	 JFCL
	MOVE	T2,RNUBLK+.MSRUN ;GET UNIT NUMBER
	MOVX	T3,NO%MAG+NO%LFL+FLD(^D7,NO%COL)+^D8
	MOVEI	T1,.PRIOU
	NOUT			;TYPE IT IN OCTAL
	 JFCL
	MOVE	T2,RNUBLK+.MSRCT ;GET CONTROLLER NUMBER
	JUMPL	T2,[	TMSG	<      --    >	;NEGATIVE MEANS NO CONTROLLER
			JRST	CNFINC]	;TYPE AND CONTINUE IN-LINE
	MOVX	T3,NO%MAG+NO%LFL+FLD(^D8,NO%COL)+^D8
	MOVEI	T1,.PRIOU
	NOUT			;TYPE NON-NEGATIVE CONTROLLER IN OCTAL
	 JFCL
	TMSG	<    >		;SPACE OVER
CNFINC:	MOVEI	T3,2		;SPACE OVER
	CALL	SPACN
	MOVEI	T3,":"		;A COLON FOR CLASS
	MOVE	T2,RNUBLK+.MSRSA ;POINT FIRST TO ALIAS
	TXNN	Q2,MS%MNT	;MOUNTED?
	MOVE	T2,RNUBLK+.MSRSN ;NO--USE VOLUME NAME
	IDPB	T3,T2		;STICK A COLON AFTER NAME
	SETZ	T3,		;AND A NULL TO TIE OFF
	IDPB	T3,T2		;TIED
	HRROI	T2,ALIBUF	;ASSUME STR NAME
	TXNN	Q2,MS%MNT	;MOUNTED?
	HRROI	T2,NAMBUF	; NO--TYPE VOLUME NAME
	TXNE	Q2,MS%HBB	;VALID HOME BLOCKS?
	HRROI	T2,[ASCIZ "Bad home blocks"]
	TXNE	Q2,MS%DIA	;MAINT MODE?
	HRROI	T2,[ASCIZ "Maintenance mode"]
	TXNE	Q2,MS%OFL	;OFF-LINE?
	HRROI	T2,[ASCIZ "Off-line"]
	MOVEI	T3,^D17		;MAX CHARACTERS
	MOVEI	T4,0		;TERMINATOR
	MOVEI	T1,.PRIOU
	SOUT			;DUMP STRING SO FAR
	AOS	T3		;ACCOUNT FOR IT
	CALL	SPACN		;T3 HAS CHARS REMAINING
	TXNE	Q2,MS%DIA!MS%OFL!MS%HBB
	JRST CNFIN2		;NO MORE INFO

	HLRZ	T2,RNUBLK+.MSRNS ;GET LOGICAL UNIT #
	MOVEI	T3,^D10		;DECIMAL
	MOVEI	T1,.PRIOU
	NOUT
	 JFCL
	TMSG	< (>		;SPACE AND OPEN PAREN
	HLRZ	T2,RNUBLK+.MSRNS ;GET UNIT # AGAIN
	AOS	T2		;CHANGE TO ORDINAL
	MOVEI	T1,.PRIOU
	NOUT			;DUMP IT
	 JFCL
	TMSG	< of >
	HRRZ	T2,RNUBLK+.MSRNS ;GET # OF UNITS IN STR
	MOVEI	T3,^D10
	MOVEI	T1,.PRIOU
	NOUT			;DUMP IT
	 JFCL
	TMSG	<)>		;CLOSE PAREN

CNFIN2:	TMSG	<
>				;DO A CRLF TO END LINE
	JRST CNFIN1		;GET NEXT

CNFIN3:	TMSG	<
>				;EXTRA CRLF TO END DISPLAY
	RET			;RETURN

;GTUSTS - ROUTINE TO READ NEXT UNIT STATUS
;RETURNS RETSKP WITH STATUS OR RET ON NO MORE UNITS

GTUSTS:	HRROI	T1,NAMBUF	;PLACE FOR STRUCTURE NAME
	MOVEM	T1,RNUBLK+.MSRSN
	HRROI	T1,ALIBUF	;PLACE FOR ALIAS
	MOVEM	T1,RNUBLK+.MSRSA
	MOVE	T1,[.MSRLN,,.MSRNU] ; LEN,,FCN
	MOVEI	T2,RNUBLK	;ADDRS OF ARGS
	MSTR			;GET STATUS
	 ERJMP [MOVEI	T1,.FHSLF	;OURSELVES
		GETER			;GET OUR LAST ERROR
		HRRZ	T1,T2		;ISOLATE THE CODE
		CAIE	T1,MSTX18	;NO MORE UNITS?
		JSERR			;SOME OTHER ERROR
		RET]			;NO MORE - RETURN
	RETSKP			;GOOD RETURN



;SPACN - ROUTINE TO OUTPUT # SPACES IN T3

SPACN:	TMSG	< >		;SPACE TO THE TTY
	SOJG	T3,SPACN	;LOOP FOR ENOUGH
	RET
	SUBTTL	DATA AREA

;UNIT TYPE NAME TABLE

UNTYTB:	-1,,[ASCIZ "UNK "]	;0 - UNKNOWN
	-1,,[ASCIZ "RP04"]	;1 - RP04
	-1,,[ASCIZ "UNK "]	;2 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;3 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;4 - UNKNOWN
	-1,,[ASCIZ "RP05"]	;5 - RP05
	-1,,[ASCIZ "RP06"]	;6 - RP06
	-1,,[ASCIZ "RP07"]	;7 - RP07
	-1,,[ASCIZ "RP08"]	;10 - RP08 (IF EVER)
	-1,,[ASCIZ "RM03"]	;11 - RM03
	-1,,[ASCIZ "UNK "]	;12 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;13 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;14 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;15 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;16 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;17 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;20 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;21 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;22 - UNKNOWN
	-1,,[ASCIZ "UNK "]	;23 - UNKNOWN
	-1,,[ASCIZ "RP20"]	;24 - RP20

	MXUTYP==.-UNTYTB-1	;MAX UNIT TYPE



;HEADER LINE

HHDR:	ASCIZ "
Status of Disk Units:

Mounted?  Type  Channel  Drive  Controller  Structure name  Logical unit
--------  ----  -------  -----  ----------  --------------  ------------
"



PDL:	BLOCK	PDLEN		;THE PUSH DOWN STACK
NAMBUF:	BLOCK	10		;BUFFER FOR STR NAME
ALIBUF:	BLOCK	10		;THE ALIAS
RNUBLK:	BLOCK	.MSRLN		;BLOCK FOR .MSRNU FUNC

	END	<3,,EVEC>