.TITLE RUNTIM.MAC 89e11a 13-APR-81/11-May-89. .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/11-May-89. ;13-APR-81 ORIGINAL CREATION. ;14-APR-81 "ERRBYT" WAS 53. ;16-JUN-81 ADDED TO DESCRIPTION OF THE "IASRNT" ROUTINE. ;03-AUG-81 CORRECTED AN ADDRESSING ERROR IN THE "DOIT" SUPPORTING ; 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. ;26-Mar-87 Revised for V6.2. Added NAB Software disclaimer. ;30-May-88 Revised for V6.31. Added CLRGNS, IDFRGN, ITRAP, ; DIOT2, DOIT3, and DOIT4 routines. ;11-May-89 Revised for V6.40a. Added notes in Entry Point ; section for 4,143, 5,143, and 6,143. .PAGE .SBTTL DESCRIPTION 13-APR-81/30-May-88. ;THESE SHARED RUN-TIME SYSTEM SUPPORT ROUTINES ARE CALLABLE BOTH AS ;FUNCTIONS AND SUBROUTINES. THIS MODULE IS A PART OF THE LIBRARY OF ;FORTRAN CALLABLE TSX/TSX-PLUS EMT ROUTINES. ;ASSOCIATE/DISASSOCIATE A RUN-TIME SYSTEM WITH A JOB. ; ;CALLING SEQUENCES: ; ; CALL IASRNT ( IRNTIM [ , IERR ] ) ; OR ; IERR = IASRNT ( IRNTIM ) ; ; WHERE: IRNTIM IS THE SIX CHARACTER RAD50 VALUE OF THE NAME ; OF THE SHARED RUN-TIME SYSTEM. WHEN EQUAL TO ; ZERO, CAUSES DISASSOCIATION FROM ALL SHARED ; RUN TIME SYSTEMS. ; ; IERR IS ONE OF THE FOLLOWING: ; ; 0 NO ERROR. ; 1 RUN-TIME SYSTEM NAME NOT RECOGNIZED. ;MAP A RUN-TIME SYSTEM INTO A JOB'S REGION. ; ;CALLING SEQUENCES: ; ; CALL MAPRNT ( IPAR , IOFFST , MAPSIZ [ , IERR ] ) ; OR ; IERR = MAPRNT ( IPAR, IOFFST , MAPSIZ ) ; ; WHERE: IPAR IS THE PAGE ADDRESS REGISTER (PAR) NUMBER ; TO BE USED TO ACCESS THE RUN-TIME SYSTEM. ; ; IOFFST IDENTIFIES WHICH PORTION OF THE RUN-TIME ; SYSTEM IS TO BE MAPPED INTO THE PAR REGION. ; ; MAPSIZ IS THE NUMBER OF 64-BYTE BLOCKS TO BE MAPPED. ; ; IERR IS ONE OF THE FOLLOWING: ; ; 0 NO ERROR. ; 1 THERE IS NO RUN-TIME SYSTEM ASSOCIATED ; WITH THIS JOB. ; Define a region for fast mapping. ; ; Calling sequences: ; ; CALL IDFRGN ( IPAR,IOFSET,ISIZ,IRGN [ ,IERR ] ) ; or ; IERR = IDFRGN ( IPAR,IOFSET,ISIZ,IRGN ) ; ; where: IPAR is the page address register (PAR) number through ; which the region is to be mapped. ; ; IOFSET is the offset in 64-byte blocks from the beginning ; of the runtime system where the mapping is to start. ; ; ISIZ is the size in 64-byte blocks of the region to be ; mapped. ; ; IRGN is the index number of the region in the range of ; 0 to 39. ; ; IERR is negative or one of the following: ; ; 1 no shared runtime system has been associated ; with the job. ; ; 2 region number is invalid. ; ; 3 specified size is greater than 128 units of ; 64-bytes (8 kb). ; ; 5 specified offset is beyond the end of the ; runtime system. ; Perform a fast map to a region. ; ; Calling sequences: ; ; CALL ITRAP ( IRGN [ ,IERR ] ) ; or ; IERR = ITRAP ( IRGN ) ; ; where: IRGN is the index number in the range of 0 to 39 for the ; region to be mapped. ; ; IERR is negative or the following: ; ; 0 the region number was invalid. ; Clear all runtime region definitions. ; ; Calling sequence: ; ; CALL CLRGNS .PAGE .SBTTL DIRECTIVES 13-APR-81/11-May-89. .IDENT \89e11a\ ;TELL LINKER OUR VERSION .PSECT TSXLIB .GLOBL TSLBID .WORD TSLBID .DSABL GBL .SBTTL ASSIGNMENTS 13-APR-81/30-May-88. ERRBYT = 52 ;ERROR CODE LOCATION NOERR = -1 ;code for no error .PAGE .SBTTL ENTRY POINTS 13-APR-81/11-May-89. ;ASSOCIATE A RUN-TIME SYSTEM WITH A JOB. ; IASRNT::MOV #143 ,R1 ;EMT CODE CLR R2 ;EMT ID JSR PC ,DOIT ;ASSOCIATE THE SYSTEM RTS PC ;MAP A RUN-TIME SYSTEM INTO A JOB'S REGION. ; MAPRNT::MOV #143 ,R1 ;EMT CODE MOV #1 ,R2 ;EMT ID JSR PC ,DOIT1 ;MAP THE SYSTEM RTS PC ; Define a runtime region to be fast mapped. ; IDFRGN::MOV #143 ,R1 ;EMT code MOV #2 ,R2 ;function code CALL DOIT2 ;define the region RETURN ; Fast map a defined runtime region. ; ITRAP:: CALL DOIT3 ;do the fast map RETURN ; Clear all defined runtime regions. ; CLRGNS::MOV #143 ,R1 ;EMT code MOV #3 ,R2 ;function code CALL DOIT4 ;clear the regions RETURN ; 4,143 and 5,143 not implemented as RT-11's linker and FORTRAN ; compilers do not support separate I and D space. ; 6,143 not implemented as the required arguments are not available ; to the FORTRAN program. .PAGE .SBTTL SUPPORTING SUBROUTINES 13-APR-81/30-May-88. DOIT: MOV 2(R5) ,-(SP) ;PASS ARGUMENT 1 MOV R2 ,-(SP) ;LO BYTE = EMT ID 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$: CMP (SP)+ ,(SP)+ ;FIX THE STACK POINTER RTS PC DOIT1: MOV @6(R5) ,-(SP) ;PASS ARGUMENT 3 MOV @4(R5) ,-(SP) ;PASS ARGUMENT 2 MOV @2(R5) ,-(SP) ;PASS ARGUMENT 1 MOV R2 ,-(SP) ;LO BYTE = EMT ID 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 #4 ,(R5) ;SUBROUTINE ERROR RETURN? BNE 1$ ; NO MOV R0 ,@10(R5) ; YES 1$: ADD #10 ,SP ;FIX THE STACK POINTER RTS PC DOIT2: MOV @10(R5) ,-(SP) ;pass argument 4 MOV @6(R5) ,-(SP) ;pass argument 3 MOV @4(R5) ,-(SP) ;pass argument 2 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 MOV #NOERR ,R1 ;code for no error 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 #12 ,SP ;adjust the stack pointer RETURN DOIT3: MOV 2(R5) ,R0 ;pass argument 1 MOV #NOERR ,R1 ;code for no error TRAP 1 ;let TSX do it BCC 1$ ; if no error CLR R1 ; if error 1$: CMPB #2 ,(R5) ;subroutine error return? BNE 2$ ; no MOV R1 ,@4(R5) ; yes 2$: MOV R1 ,R0 ;function error return RETURN DOIT4: 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 RETURN .SBTTL END 13-APR-81/. .END