.MCALL .MODULE .MODULE IPEEKB,VERSION=05,COMMENT=,IDENT=NO,LIB=YES,GLOBAL=.IPEKB ; 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 ; ; CALLABLE ENTRIES: ; ; IPEEKB, IPOKEB ; ; 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 IPEEKB - Fortran-callable Routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The IPEEKB function returns the contents of a byte located at a ; specified 16-bit address in the current job's address space. The ; value is returned zero-extended, that is, the high byte is zeroed. ; ; CALLING SEQUENCE: ; ; i = IPEEKB( iaddr ) ; ; INPUT PARAMETERS: ; ; R5 - address of IPEEKB's argument block ; ; 0(R5) - argument count of IPEEKB call ; 2(R5) - address of byte whose contents are returned ; ; RETURNED FUNCTION VALUE: ; ; contents of byte (zero-extended) specified by passed address ; ; -- .SBTTL IPOKEB - Fortran-callable routne ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The IPOKEB routine stores a passed 8-bit value into a byte located ; at a specified address in the current job's address space. ; ; CALLING SEQUENCE: ; ; CALL IPOKEB( iaddr, ivalue ) ; ; INPUT PARAMETERS: ; ; R5 - address of IPOKEB's argument block ; ; 0(R5) - argument count of IPOKEB call ; 2(R5) - address of byte to modify ; 4(R5) - address of value to store ;-- ; .PSECT SYS$I IPEEKB:: MOV (R5)+,R4 ; R4(low byte) <- argument count. CALL $NXVAL ; Get -> 'iaddr' argument; BCS ERR ; If CS, error - 'iaddr' wasn't supplied MOVB @R0,R0 ; Return value of specified byte BIC #^C<377>,R0 ; with zero-extended in high byte. RETURN ; Return to caller with value in R0. POKEB:: IPOKEB:: 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 byte to modify. CALL $NXVAL ; Get 'ivalue' argument BCS ERR ; If CS, error - 'ivalue' wasn't supplied MOVB R0,@R3 ; Store value in specified byte. RETURN ; Return to caller. ERR: TRAP $MSARG ; Handle any missing arguments in call; RETURN .END