.MCALL .MODULE .MODULE RESASN,VERSION=1,COMMENT=,IDENT=NO ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. ; Edit History: ; 001 George Stevens Overlaid version of RESORC. Created from RESORC ; Version 97 .NLIST .INCLUDE /SRC:RESPFX.MAC/ .LIST .SBTTL ASSIGN - Handle the SHOW command ORIGIN RESASN .ENABL LSB ASSIGN:: CALL INIPTR ; Get address & size of device tables CLR FRECNT ;+ ; Move to the next entry, repeat until all entries done. ;- 10$: MOV #-1,OWNFLG ; Default the ownership flag. ADD #2,$ENTRY ; Bump the counter. CMP @$ENTRY,#-1 ; Are we done? JEQ 170$ ; Yes, then go return. ;+ ; Determine if the slot has a device in it and if not, count it a free. ;- 20$: MOV R4,PNAMPT ; Save it. MOV (R4)+,R1 ; R1 = permanent device name. MOV R1,PHYNAM ; Save it. BNE 30$ ; Branch if we got one. INC FRECNT ; Bump the free count. BR 10$ ; Try again. ;+ ; A populated slot has been found, so set up physical device data. ;- 30$: FORMAT #BUFFER,<[R] >,<#PHYNAM,#1> ;Print the permanent name. MOV @$ENTRY,R2 ; Get the handler entry point. BEQ 70$ ; Branch if unloaded. CLR OWNFLG ; Reset the ownership flag. ;+ ; Determine if it is loaded or resident. ;- CMP R2,R5 ; Is it resident or just loaded. BLO 40$ ; Branch if not. FORMAT ,<(Resident)> ; Else say so. BR 50$ 40$: FORMAT ,<(Loaded)> ; Say that it's loaded. ;+ ; Determine the device ownership. ;- 50$: TST MONOWN ; Is ownership table present? BNE 60$ ; Branch if it is DEC OWNFLG ; Say no ownership. BR 70$ ; Merge below. 60$: MOV PNAMPT,R2 ; Index. SUB $PNAM,R2 ; As index. ASL R2 ; 2 word entry. ADD $OWNER,R2 ; +Start of owner table. MOV R2,OWNPT ; Save it. CMP (R2)+,@R2 ; All the same? BNE 70$ ; No, then it is owned. DEC OWNFLG ; Yes, then select no ownership. TST @R2 ; Public? BEQ 70$ ; No, then it is owned. MOV @R2,R3 ; Get contents. BIC #177761,R3 ; Fix it. CLRB -(R0) ; Back up. FORMAT ,<=> ; Insert. CALL INSERT ; Put in the name 70$: FORMAT ,< = > ; Prepad an equal sign. MOV PNAMPT,-(SP) ; Push pointer to entry in $PNAME SUB $PNAM,@SP ; Calculate byte index into table ADD $PNAM2,@SP ; Point to entry in $PNAM2 table MOV @SP,PNM2PT ; Save pointer to $PNAM2 entry MOV @(SP)+,R1 ; Get 1-char name; else 2-char name ;+ ; Add logical assignments to the pure device (ie, no unit numbers). ;- CALL GETNAM ; Go get any logical names. CLRB -2(R0) ; Get rid of the trailing "," or "=". .PRINT #BUFFER ; Print the line. ;+ ; Add logical assignments to the device with unit numbers. ;- MOV #8.,UNITMX ; Assume non-extended-unit handler CMP @PNAMPT,R1 ; Does $PNAME entry = $PNAM2 entry? BEQ 80$ ; Branch if so - not 64-unit handler MOV #64.,UNITMX ; Extended unit handler 80$: CLR UNIT ; Start with unit 0 90$: CMP UNIT,UNITMX ; Any more units to try? BHIS 10$ ; Branch if not CALL GENPHY ; Setup 1-char and 2-char dev names FORMAT #BUFFER,< [R] = >,<#PHYNAM,#1> ; Format the physical name MOV R0,-(SP) ; Save the buffer pointer MOV PHYNM1,R1 ; Get $UNAM1 compatible dev name in R1 CALL GETNAM ; Find any logical names TST OWNFLG ; Owner here? BMI 140$ ; If EQ No MOV UNIT,R3 ; Get unit # MOV OWNPT,R2 ; Get owner entry CMP @R2,#2 ; Is owner table in extended unit ; handler? BNE 100$ ; Branch if not MOV 2(R2),R2 ; Get pointer to real owner table 100$: CLC ; Setup - clear carry ROR R3 ; Odd unit #? BCS 110$ ; If carry cleared, No ADD R3,R2 ; Pointing to byte MOVB @R2,R3 ; Get contents BR 120$ ; Merge 110$: ADD R3,R2 ; Point to byte MOVB @R2,R3 ; Get contents ASR R3 ; Get high nibble ASR R3 ; " ASR R3 ; " ASR R3 ; " 120$: BIC #177760,R3 ; Clear high bits BEQ 140$ ; If EQ public DEC R3 ; Clear out odd bit CMP R0,(SP)+ ; Comma there? BEQ 130$ ; If EQ No CMPB -(R0),-(R0) ; Get rid of it 130$: FORMAT ,<(> CALL INSERT ; Put the name in BR 150$ ; Merge 140$: CMP R0,(SP)+ ; Did we find any? BEQ 160$ ; Branch if not CLRB -2(R0) ; Clear out the "," 150$: .PRINT #BUFFER ; Print the line 160$: INC UNIT ; Bump the unit number BR 90$ ; Loop 170$: TST FRECNT ; Any free slots? BEQ 180$ ; Branch if not FORMAT #BUFFER,<[D] free slots>, .PRINT #BUFFER 180$: RETURN .DSABL LSB .SBTTL Insert owner routine ;+ ; Scott Davis ;SD3 ; This routine will insert the owner for SHOW . ; INPUT: R0-> OUTPUT BUFFER ; R3= JOB NUMBER OF OWNER ; R5-> RMON ; OUTPUT: R2 IS DESTROYED ; R0 IS UPDATED ;- .ENABL LSB INSERT: BIT #SY.SJB,$SYSGN(R5) ;System jobbing? BNE 2$ ;If ne yes MOV #FORE,R2 ;Say FOREground TST R3 ;FOREGROUND? BNE 3$ ;If NE YES 1$: MOV #RESRC,R2 ;Say foreground BR 3$ ;Merge 2$: TST R3 ;BACKGROUND? BEQ 1$ ;DEFAULT TO RESORC MOV R0,-(SP) ;PRESERVE R0 ACROSS CALL .GTJB #AREA,#BUFF,R3 ;Get info on owner BCS 6$ ;IF CS JOB HAS ABORTED MOV (SP)+,R0 ;RESTORE POINTER TO OUTPUT STRING MOV #,R2 ;Point to name 3$: FORMAT ,<[S]>, 4$: TSTB -(R0) ;NULL BYTE? BEQ 4$ ;IF NE NO CMPB #BLANK,@R0 ;MAKE IT A BLANK BEQ 4$ ;CONTINUE TSTB (R0)+ ;UPDATE 5$: FORMAT ,<)> RETURN 6$: MOV (SP)+,R0 ;RESTORE R0 TSTB -(R0) ;BACK UP OVER = BR 5$ ;MERGE .DSABL LSB .END