.MCALL .MODULE .MODULE ICMAP,VERSION=03,COMMENT=,IDENT=NO,LIB=YES ; 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. .SBTTL Module Declarations .NLIST .ENABL LC .DSABL GBL .NLIST CND .LIST ;+ ; ; Facility: ; ; RT-11 System Subroutine Library ; ; Environment: ; ; These routines can be used from any job running in a single- or ; multiple-job mapped environment. ; ; Entry Points: ; ; ICMAP ; IGCMAP ; MSDS ; ; Include files: ; from SYSMAC.SML: .MCALL .CMAP .MSDS ;Mapping control .MCALL .GCMAP ;Mapping status .LIBRARY "SRC:SYSTEM.MLB" .MCALL .CMPDF .CMPDF ;Define mapping bits ; External references: .GLOBL $SYSLB ;Include system library work area .GLOBL $NXADR $NXVAL ;Argument access .GLOBL $ERRM0 ;Error conversion .GLOBL $ARGER ;Value for missing argument return ; ;- .SBTTL ICMAP - Fortran-callable routine ;+ ; ; Functional description: ; ; The ICMAP function is used to control mapping context for a job ; under a mapped monitor. It optionally returns the prior mapping ; context. ; ; Calling sequence: ; ; i = ICMAP ( ival [,iold] ) ; ; CALL CMAP ( ival [,iold] [,ierr] ) ; ; Input parameters: ; ; R5 address of argument block ; 0(R5) argument count ; 2(R5) address of value to use for mapping context ; 4(R5) address of location to return old mapping context ; [6(R5) address of location to return error information] ; ; Errors: ; ; 0 Function completed successfully ; -257. Required argument missing ; ;- .SBTTL IGCMAP - Fortran-callable routine ;+ ; ; Functional description: ; ; The IGCMAP function is used to return the current mapping context ; for a job under a mapped monitor. ; ; Calling sequence: ; ; i = IGCMAP ( iold ) ; ; CALL GCMAP ( iold [,ierr] ) ; ; Input parameters: ; ; R5 address of argument block ; 0(R5) argument count ; 2(R5) address of location to return old mapping context ; [4(R5) address of location to return error information] ; ; Errors: ; ; 0 Function completed successfully ; -257. Required argument missing ; ;- .SBTTL MSDS - Fortran-callable routine ;+ ; ; Functional description: ; ; The MSDS function is used to control the link between U and S D space ; running under a mapped monitor. ; It optionally returns the prior mapping context. ; ; Calling sequence: ; ; i = MSDS ( ival [,iold] ) ; or ; CALL MSDS ( ival [,iold] [,ierr] ) ; ; Input parameters: ; ; R5 address of argument block ; 0(R5) argument count ; 2(R5) address of value to use for mapping context ; 4(R5) address of location to return old mapping context ; [6(R5) address of location to return error information] ; ; Errors: ; ; 0 Function completed successfully ; -257. Required argument missing ; ;- .PSECT SYS$I .ENABL LSB CMAP:: ICMAP:: CLR R3 ;R3 = bits to force (none) BR 10$ ;Join common code GCMAP:: IGCMAP:: MOV (R5)+,R4 ;R4 = Count of arguments CLR R1 ;R1 = New mapping value MOV R5,R2 ;R2 = Flag to indicate IGCMAP BR 20$ ;Join common code MSDS:: MOV #CM.DUS,R3 ;Force Separate data spaces by PAR 10$: MOV (R5)+,R4 ;R4 = Count of arguments CALL $NXVAL ;Get the next argument value BCS 30$ ;Not available, invalid usage BIS R3,R0 ;Separate data spaces by PAR MOV R0,R1 ;Save mapping argument CLR R2 ;R2 = Flag to indicate old ; context argument is not required 20$: .CMAP ,R1,CODE=STACK ;Perform the call ; EMT area build on stack and dumped ; after request completes MOV R0,R1 ;*C* Save old mapping context CALL $ERRM0 ;Get EMT error info MOV R0,R3 ;Save converted error CALL $NXADR ;Get address to return old context BCC 40$ ;User supplied address for it TST R2 ;Is old context argument required? BEQ 50$ ;No, required only for IGCMAP call 30$: MOV #$ARGER,R3 ;R1 indicates error 'missing argument' BR 50$ 40$: MOV R1,@R0 ;Return old mapping info 50$: CALL $NXADR ;Get address to return error info BCS 60$ ;User doesn't want it... MOV R3,@R0 ;Return error information for user 60$: MOV R3,R0 ; but also return it in R0 RETURN .DSABL LSB .END