.TITLE DVALOC.MAC 86b19a 03-Oct-84/19-Feb-86. .ENABL LC ; Author: N. A. Bourgeois, Jr. ; NAB Software Services, Inc. ; PO Box 20009 ; Albuquerque, NM 87154 .SBTTL EDIT RECORD 03-Oct-84/19-Feb-86. ; 03-Oct-84 Original creation. ; 19-Feb-86 Revised for V6.0. Changed description for IALOC, ; IDALOC, and ICALOC routines. .PAGE .SBTTL DESCRIPTION 03-Oct-84/19-Feb-86. ; This module contains the device allocation and deallocation support ; routines. This module is a part of the FORTRAN callable TSX-Plus ; EMT support routines. ; The IALOC routine allocates a device. ; ; Calling sequence: ; ; CALL IALOC (DVPTR,JBNUM,IERR) ; ; where: DVPTR is the name of a four word array which contains ; the device name in RAD50 in the first word and ; zeros in the others. ; ; JBNUM is undefined or if IERR = 1 or 4, the number of ; the job to which the device is already allocated. ; ; IERR is negative or one of the following: ; ; 1 device is already allocated to another ; user. ; ; 2 invalid device specified. ; ; 3 device allocation table is full. ; ; 4 device is currently being used by ; another user. ; ; 5 job does not have ALLOCATE privilege. ; The IDALOC routine deallocates a device. ; ; Calling sequence: ; ; CALL IDALOC (DVPTR,JBNUM,IERR) ; ; where: DVPTR is the name of a four word array which contains ; the device name in RAD50 in the first word and ; zeros in the others. ; ; JBNUM is undefined or if IERR = 1 or 4, the number of ; the job to which the device is allocated. ; ; IERR is negative or one of the following: ; ; 1 device is allocated to another user. ; ; 2 invalid device specified. ; ; 4 device is currently in use by another ; job. ; ; 5 job does not have ALLOCATE privilege. ; The ICALOC routine checks the allocation status of a device. ; ; Calling sequence: ; ; CALL ICALOC (DVPTR,JBNUM,IERR) ; ; where: DVPTR is the name of a four word array which contains ; the device name in RAD50 in the first word and ; zeros in the others. ; ; JBNUM is undefined or if IERR = 1 or 4, the number of ; the job to which the device is allocated. ; ; IERR is negative or one of the following: ; ; 1 device is allocated to another user. ; ; 2 invalid device specified. ; ; 4 device is currently being used by ; another user. .PAGE .SBTTL DIRECTIVES 03-Oct-84/19-Feb-86. .IDENT \86b19a\ ;tell linker our version .PSECT TSXLIB,I .GLOBL TSLBID .WORD TSLBID .DSABL GBL .SBTTL ASSIGNMENTS 03-Oct-84/. ERRBYT = 52 ;EMT error code locationn NOERR = -1 ;code for no error condition .PAGE .SBTTL ENTRY POINTS 03-Oct-84/. ; Allocate a device. ; IALOC:: MOV #156 ,R1 ;EMT code CLR R2 ;function code CALL DOIT ;allocate the device RETURN ; Deallocate a device. ; IDALOC::MOV #156 ,R1 ;EMT code MOV #1 ,R2 ;function code CALL DOIT ;deallocate the device RETURN ; Check the allocation status of a device. ; ICALOC::MOV #156 ,R1 ;EMT code MOV #2 ,R2 ;function code CALL DOIT ;check the allocation status RETURN .PAGE .SBTTL SUPPORTING SUBROUTINES 03-Oct-84/. DOIT: MOV 2(R5) ,-(SP) ;pass argument 1 MOV R2 ,-(SP) ;lo byte = function code MOV SP ,R0 ;set up the pointer MOVb R1 ,1(R0) ;hi byte = EMT code MOV #NOERR ,R1 ;for no error return EMT 375 ;let TSX do it BCC 1$ ; if no error CLR R1 ; if error, then MOVB @#ERRBYT,R1 ; get the code CMPB #1 ,@#ERRBYT ;allocated to another user? BNE 1$ ; no MOV R0 ,@4(R5) ; yes, so tell who 1$: MOV R1 ,@6(R5) ;return "error" code CMP (SP)+ ,(SP)+ ;adjust the stack pointer RETURN .SBTTL END 03-Oct-84/. .END