.TITLE MNTDEV.MAC 87c25a 13-APR-81/25-Mar-87. .ENABL LC ; Author: N. A. Bourgeois, Jr. ; NAB Software Services, Inc. ; PO Box 20009 ; Albuquerque, NM 87154 ; The code and information in this software is subject to ; change without notice and should not be construed as a ; commitment by NAB Software Services, Inc. NAB Software ; Services,Inc. assumes no responsibility for any errors ; that may appear in this software. ; ; ; NOTICE ; ; This software is sponsored by NAB Software Services, Inc. ; Neither NAB Software Services, Inc., nor any of their ; employees, nor any of their contractors, subcontractors, ; or their employees makes any warranty, express or implied, ; or assumes any legal liability or responsibility for the ; accuracy, completeness or usefulness of any information, ; apparatus, product or process disclosed, or represents ; that its use would not infringe privately owned rights. ; THIS SOFTWARE WAS ORIGINALLY ISSUED BY SANDIA NATIONAL ; LABORATORIES, OPERATED FOR THE UNITED STATES DEPARTMENT ; OF ENERGY BY SANDIA CORPORATION. ; ; NOTICE ; ; THIS SOFTWARE WAS ORIGINALLY SPONSORED BY THE UNITED ; STATES GOVERNMENT. NEITHER THE UNITED STATES GOVERNMENT ; NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF ; THEIR EMPLOYEES, NOR ANY OF THEIR CONTRACTORS, ; SUBCONTRACTORS, OR THEIR EMPLOYEES MAKES ANY WARRANTY, ; EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR ; RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS OR ; USEFULNESS OF ANY INFORMATION, APPARATUS, PRODUCT OR ; PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT ; INFRINGE PRIVATELY OWNED RIGHTS. ; ; THIS WORK WAS ORIGINALLY FUNDED BY: ; ; HEADQUARTERS, ESD / OCB / STOP 36 ; HANSCOM AIR FORCE BASE, MA 01731 .SBTTL EDIT RECORD 13-APR-81/25-Mar-87. ;13-APR-81 ORIGINAL CREATION. ;14-APR-81 "ERRBYT" WAS 53. ;16-JUN-81 ADDED NULL WORD AT END OF EMT BLOCK. ;27-JUL-81 CORRECTED ADDRESSING ERROR IN THE "DOIT" SUBROUTINE. ;26-FEB-82 ADDED IDENTIFICATION CODE. ;06-Jan-84 Maintenance assumed by NAB Software Services, Inc. ;03-Oct-84 Minor revision for V5.1. ;13-Feb-86 Removed unnecessary error return description from ; the DISMNT routine. ;25-Mar-87 Revised for V6.2. Added NAB Software disclaimer. ; Revised the MOUNT and DISMNT routines and the DOIT ; subroutine. Added the DSMNTA, IDMLD, ISTLD, and ; MNTLD routines. Added the DOIT1 DOIT2, and DOIT3 ; subroutines. .PAGE .SBTTL DESCRIPTION 13-APR-81/25-Mar-87. ;THESE TWO MOUNT/DISMOUNT SUPPORT ROUTINES ARE CALLABLE AS SUBROUTINES. ;ONE OF THEM IS ALSO CALLABLE AS A FUNCTION. THIS MODULE IS A PART OF ;THE LIBRARY OF FORTRAN CALLABLE TSX/TSX-PLUS EMT ROUTINES. ;MOUNT A FILE STRUCTURED DEVICE. ; ;CALLING SEQUENCES: ; ; CALL MOUNT ( IDVNAM [ , IERR ] ) ; OR ; IERR = MOUNT ( IDVNAM ) ; ; WHERE: IDVNAM IS THE RAD50 VALUE OF THE DEVICE NAME. ; ; IERR IS ONE OF THE FOLLOWING: ; ; 0 NO ERROR. ; 1 NO ROOM LEFT IN THE TABLE OF MOUNTED ; DEVICES. ;DISMOUNT A FILE STRUCTURED DEVICE. ; ;CALLING SEQUENCE: ; ; CALL DISMNT ( IDVNAM ) ; ; WHERE: IDVNAM IS THE RAD50 VALUE OF THE DEVICE NAME. ;Dismount all mounted file structured devices. ; ;Calling sequence: ; ; CALL DSMNTA ;Dismount a logical device. ; ;Calling sequences ; ; CALL IDMLD ( LDNUM [ , IERR ] ) ; or ; IERR = IDMLD ( LDNUM ) ; ; where: LDNUM is the logical disk unit number in the ; range of 0 through 7. ; ; IERR is negative or one of the following: ; ; 0 specified LD unit is not ; associated with a file. ; ; 1 invalid LD unit number. ; ; 3 some channel is open to a file ; on the LD. ;Check the status of a logical device. ; ;Calling sequence: ; ; CALL ISTLD ( LDNUM , ISTBF ) ; ; where: LDNUM is the logical disk unit number in the ; range of 0 through 7. ; ; ISTBF is a five element buffer that is to receive ; the information about the logical disk. If ; the LD is associated with a file, the first ; four words of the buffer will receive the ; RAD50 dev:filnam.ext. The fifth word is a ; flag word. If the LD is mounted for read-only ; access, bit zero of the flag word is set. If ; the LD is not currently accessable, bit 1 is ; set. ;Mount a logical device. ; ;Calling sequences: ; ; CALL MNTLD ( ICHAN , LDNUM , IROFLG , FILPTR [ , IERR ] ) ; ; or ; ; IERR = MNTLD ( ICHAN , LDNUM , IROFLG , FILPTR ) ; ; where: ICHAN is the number of an I/O channel which must be ; closed at the time this routine is called. ; ; LDNUM is the logical device number in the range of ; 0 through 7. ; ; IROFLG is 0 to allow both reads and writes or 1 to ; allow reads only. ; ; FILPTR is a 4 word buffer that contains the RAD50 ; value for the dev:filnam.ext of the file that ; is to be associated with the LD. ; ; IERR is negative or one of the following: ; ; 0 channel provided is already open. ; ; 1 invalid LD unit number. ; ; 2 ld support not generated into system. ; ; 3 ld unit is already associated with a ; file. ; ; 4 invalid file specification. ; ; 5 invalid logical unit number nesting. ; ; 6 unable to open specified file. .PAGE .SBTTL DIRECTIVES 13-APR-81/25-Mar-87. .IDENT \87c25a\ ;TELL LINKER OUR VERSION .PSECT TSXLIB .GLOBL TSLBID .WORD TSLBID .DSABL GBL .SBTTL ASSIGNMENTS 13-APR-81/25-Mar-87. ERRBYT = 52 ;ERROR CODE LOCATION NOERR = -1 ;code for no error .PAGE .SBTTL ENTRY POINTS 13-APR-81/25-Mar-87. ;MOUNT A FILE STRUCTURED DEVICE. ; MOUNT:: MOV #134 ,R1 ;EMT CODE CLR R2 ;function code JSR PC ,DOIT ;MOUNT THE DEVICE RTS PC ;DISMOUNT A FILE STRUCTURED DEVICE. ; DISMNT::MOV #135 ,R1 ;EMT CODE CLR R2 ;function code JSR PC ,DOIT ;DISMOUNT THE DEVICE RTS PC ;Dismount all file structured devices. ; DSMNTA::MOV #135 ,R1 ;EMT code MOV @2 ,R2 ;function code CALL DOIT ;dismount the devices RTS PC ;Dismount a logical device. ; IDMLD:: MOV #135 ,R1 ;EMT code MOV #3 ,R2 ;function code CALL DOIT1 ;dismount the LD RETURN ;Check the status of a logical device. ; ISTLD:: MOV #135 ,R1 ;EMT code MOV #4 ,R2 ;function code CALL DOIT2 ;check the LD status RETURN ;Mount a logical device. ; MNTLD:: MOV #163 ,R1 ;EMT code CALL DOIT3 ;mount the LD RETURN .PAGE .SBTTL SUPPORTING SUBROUTINES 13-APR-81/25-Mar-87. DOIT: CLR -(SP) ;REQUIRES A NULL WORD MOV 2(R5) ,-(SP) ;PASS ARGUMENT 1 MOV R2 ,-(SP) ;LO BYTE = function code MOV SP ,R0 ;EMT POINTER MOVB R1 ,1(R0) ;HI BYTE = EMT CODE EMT 375 ;LET TSX DO IT CLR R0 ;GET THE MOVB @#ERRBYT,R0 ; ERROR CODE CMPB #2 ,(R5) ;SUBROUTINE ERROR RETURN? BNE 1$ ; NO MOV R0 ,@4(R5) ; YES 1$: ADD #6 ,SP ;FIX THE STACK POINTER RTS PC DOIT1: CLR R0 ;pass MOVB 2(R5) ,R0 ; the MOV R0 ,-(SP) ; argument MOV R2 ,-(SP) ;lo byte = function code MOV SP ,R0 ;EMT pointer MOVB R1 ,1(R0) ;hi byte = EMT code MOV #NOERR ,R1 ;no error code EMT 375 ;let TSX do it BCC 1$ ; if no error CLR R0 ; if error, then MOVB @#ERRBYT,R1 ; get the code 1$: CMPB #2 ,(R5) ;subroutine error return? BNE 2$ ; no MOV R1 ,@4(R5) ; yes 2$: MOV R1 ,R0 ;function error return CMP (SP)+ ,(SP)+ ;fix the stack pointer RETURN DOIT2: MOV 4(R5) ,-(SP) ;pass argument 2 CLR R0 ;pass MOVB 2(R5) ,R0 ; argument MOV R0 ,-(SP) ; 1 MOV R2 ,-(SP) ;lo byte = EMT code MOV SP ,R0 ;EMT pointer MOVB R1 ,1(R0) ;hi byte = function code EMT 375 ;let TSX do it ADD #6 ,SP ;fix the stack pointer RETURN DOIT3: MOV 10(R5) ,-(SP) ;pass argument 4 MOV @4(R5) ,-(SP) ;lo byte = argument 2 MOV SP ,R0 ;hi byte = MOVB @6(R5) ,1(R0) ; argument 3 MOV R2 ,-(SP) ;lo byte = EMT code MOV SP ,R0 ;EMT pointer MOVB @2(R5) ,1(R0) ;hi byte = argument 1 MOV #NOERR ,R1 ;no error code EMT 375 ;let TSX do it BCC 1$ ; if no error CLR R1 ; if error, then MOVB @#ERRBYT,R1 ; get the code 1$: CMPB #5 ,(R5) ;subroutine error return? BNE 2$ ; no MOV R1 ,@12(R5) ; yes 2$: MOV R1 ,R0 ;function error return ADD #6 ,SP ;fix the stack pointer RETURN .SBTTL END 13-APR-81/. .END