.MCALL .MODULE .MODULE IPEEK,VERSION=06,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 Post Release Edit History ;+ ; ; (05/01) 20-Oct-93 Megan Gentry ; Fixed bug in IPEEK which returned the address rather ; than the contents of the specified address. ; 06 13-Jan-1998 TDS Bump version to 06 for 5.7 release ;- .SBTTL Module Declarations .NLIST .ENABL LC .DSABL GBL .NLIST CND .LIST ; ++ ; FACILITY: ; ; RT-11 System Subroutine Library ; ; CALLABLE ENTRIES: ; ; IPEEK, IPOKE ; ; ENVIRONMENT: ; ; These routines can be used by any job running in a single-job ; or multi-job environment. It uses "TRAP" to provide error ; processing. ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library. ; ; EXTERNAL REFERENCES: ; .GLOBL $NXVAL ; Entry point to next address routine. .GLOBL $SYSLB ; Include system library work area. .WEAK $MSARG ; Trap code for missing argument .SBTTL IPEEK - Fortran-callable Routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The IPEEK function returns the contents of a word located at a ; specified 16-bit address in the current job's address space. ; ; CALLING SEQUENCE: ; ; i = IPEEK( iaddr ) ; ; INPUT PARAMETERS: ; ; R5 - address of IPEEK's argument block ; ; 0(R5) - argument count of IPEEK call ; 2(R5) - address of word to return contents of ; ; RETURNED FUNCTION VALUE: ; ; i - contents of word specified by passed address ; ; -- .SBTTL IPOKE - Fortran-callable subroutine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The IPOKE routine stores a passed 16-bit value into a word located ; at a specified 16-bit address in the current job's address space. ; ; CALLING SEQUENCE: ; ; CALL IPOKE( iaddr, ivalue ) ; ; INPUT PARAMETERS: ; ; R5 - address of IPOKE's argument block ; ; 0(R5) - argument count of IPOKE call ; 2(R5) - address of word to modify ; 4(R5) - address of value to store in word specified by 'iaddr' ; -- .SBTTL IPEEK - Fortran-callable subroutine .PSECT SYS$I IPEEK:: MOV (R5)+,R4 ; R4(low byte) <-- argument count CALL $NXVAL ; get 'iaddr' BCS ERR ; It wasn't supplied... MOV @R0,R0 ; Get contents of specified address RETURN POKE:: IPOKE:: MOV (R5)+,R4 ; R4(low byte) <- argument count. CALL $NXVAL ; Get -> 'iaddr' argument; BCS ERR ; If CS, error - 'iaddr' wasn't supplied MOV R0,R3 ; R3 <- address of word to modify. CALL $NXVAL ; Get 'ivalue' argument BCS ERR ; If CS, error - 'ivalue' wasn't supplied; MOV R0,@R3 ; Store value in specified word. RETURN ; Return to caller. ERR: TRAP $MSARG ; Handle any missing arguments in call; RETURN .END