.MCALL .MODULE .MODULE IPEEK,VERSION=0501,COMMENT=,IDENT=NO,LIB=YES ; COPYRIGHT 1989, 1990, 1991, 1992 BY ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. ; ALL RIGHTS RESERVED ; ;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED ;ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND 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. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY ;TRANSFERRED. ; ;THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE ;AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT ;CORPORATION. ; ;DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS ;SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY DIGITAL. .SBTTL 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. ;- .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