Trailing-Edge
-
PDP-10 Archives
-
tops20_version7_0_tools_tape_clock_tape
-
tools/units/units.mac
There are 8 other files named units.mac in the archive. Click here to see a list.
; UPD ID= 16, SNARK:<6.1.TOOLS-TAPE>UNITS.MAC.4, 28-Feb-85 14:31:43 by GRANT
;Remove previous edit
; UPD ID= 15, SNARK:<6.1.TOOLS-TAPE>UNITS.MAC.3, 25-Feb-85 12:36:32 by GRANT
;Add "served" to display
;<GRANT.MISC>UNITS.MAC.19, 23-Jan-85 16:15:39, EDIT BY GRANT
;Change display to be "Channel Controller Unit"
;<GRANT.MAC>UNITS.MAC.5, 1-Dec-84 08:03:58, EDIT BY GRANT
;Add drive serial number to display
;<V-SOURCES>UNITS.MAC.5, 27-Jun-84 12:30:21, Edit by PURRETTA
;Fix comments
;<V-SOURCES>UNITS.MAC.4, 26-Jun-84 14:35:32, EDIT BY GRANT
;Decimal output for channel, controller, unit
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==11 ;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.
;
; 4 JGZ 28-APR-80
; CENTER THE CHANNEL NUMBER COLUMN. WE'LL NEVER HAVE MORE
; THAN ONE DIGIT FOR THIS INCARNATION OF THE DISK SYSTEMS.
;
; 5 JGZ 28-APR-80
; MOVE THE UNIT COLUMN RIGHTMOST POSTION ONE TO THE LEFT.
;
; 6 JGZ 28-APR-80
; ADD A TIMESTAMP TO THE HEADER LINES.
;
; 7 JGZ 30-APR-80
; PRETTY THE LISTING A BIT AND REMOVE A FEW UNNEEDED
; INSTRUCTIONS.
;
; 10 CEG 1-DEC-84
; Add drive serial number to display
;
; 11 CEG 23-JAN-85
; Change display to be "Channel Controller Unit" instead of
; "Channel Drive Controller"
;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,HHDR1 ;POINT TO HEADER
TXNN F,F%HDR ;TYPED HEADER YET?
PSOUT ;NO, OUTPUT IT
MOVX T1,.PRIOU ;TO TERMINAL
SETOM T2 ;NOW
SETZM T3 ;AND DEFAULT DATE-TIME FORMAT
TXNN F,F%HDR ;CHECK FLAG
ODTIM ;GIVE TIMESTAMP
HRROI T1,HHDR2 ;REST OF HEADER
TXON F,F%HDR ;CHECK/SET FLAG TO SAY ALREADY DONE
PSOUT ;PRINT LAST PART OF HEADER
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(^D6,NO%COL)+^D10
MOVEI T1,.PRIOU
NOUT ;TYPE IT IN DECIMAL
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(^D11,NO%COL)+^D10
MOVEI T1,.PRIOU
NOUT ;TYPE NON-NEGATIVE CONTROLLER IN DECIMAL
JFCL
CNFINC: TMSG < > ;SPACE OVER
MOVE T2,RNUBLK+.MSRUN ;GET UNIT NUMBER
MOVX T3,NO%MAG+NO%LFL+FLD(^D4,NO%COL)+^D10
MOVEI T1,.PRIOU
NOUT ;TYPE IT IN DECIMAL
JFCL
MOVEI T3,7 ;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%ERR ;ERROR READING HOME BLOCKS?
HRROI T2,[ASCIZ "Error reading home blocks"]
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,^D13 ;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!MS%ERR
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 T1,.PRIOU ;STILL DECIMAL, BUT RELOAD .PRIOU
NOUT ;DUMP IT
JFCL
TMSG <) > ;CLOSE PAREN
MOVE T2,RNUBLK+.MSDSN ;GET DRIVE SERIAL NUMBER
MOVEI T1,.PRIOU
MOVX T3,NO%MAG+NO%LFL+FLD(^D7,NO%COL)+^D10
NOUT
JFCL
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 ; THEN RETURN
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
-1,,[ASCIZ "CI "] ;25 CI OR KLIPA NODE
-1,,[ASCIZ "HSC "] ;26 HSC50
-1,,[ASCIZ "RA80"] ;27 - RA80
-1,,[ASCIZ "RA81"] ;30 - RA81
-1,,[ASCIZ "RA60"] ;31 - RA60
-1,,[ASCIZ "RA82"] ;32 - RA82
-1,,[ASCIZ "RA62"] ;33 - RA62
MXUTYP==.-UNTYTB-1 ;MAX UNIT TYPE
;HEADER LINES
HHDR1: ASCIZ "
Status of Disk Units at "
HHDR2: ASCIZ "
Mounted? Type Channel Controller Unit Structure name Logical unit DSN
-------- ---- ------- ---------- ---- -------------- ------------ ---
"
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>