.MCALL .MODULE .MODULE $NXADR,VERSION=04,COMMENT=<$NX(ADR,VAL)/SYSLIB>,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 $NXVAL, $NXADR - SYSLIB service routine ; ;+ ; $NXVAL ; ; $NXVAL returns the next argument's value in R0. It ; expects the updated argument count in the low byte of ; R4, and the updated argument pointer in R5. If there ; are no more arguments, or the current argument address ; is "-1" (omitted), it returns carry set and R0 is unaltered ; ; Inputs: ; R5 pointing to current argument list element ; R4 (low byte) containing current argument count ; ; Outputs: ; R5 pointing to next argument list element ; R4 (low byte) reduced by 1 ; R0 argument value, if Carry is clear ; same as entry, if Carry set ; Carry clear if argument is found ; Carry set if argument is not found ; ; ; $NXADR ; ; $NXADR returns the next argument's address in R0. It ; expects the updated argument count in the low byte of ; R4, and the updated argument pointer in R5. If there ; are no more arguments, or the current argument address ; is "-1" (omitted), it returns carry set and R0 unaltered ; ; Inputs: ; R5 pointing to current argument list element ; R4 (low byte) containing current argument count ; ; Outputs: ; R5 pointing to next argument list element ; R4 (low byte) reduced by 1 ; R0 argument address, if Carry is clear ; same as entry, if Carry set ; Carry clear if argument is found ; Carry set if argument is not found ; ;JFW 27-Dec-84 ;- .PSECT SYS$I .GLOBL $NOARG ;missing argument code .ENABLE LSB $NXVAL:: CALL $NXADR ;Get address of the argument BCS 10$ ;No address, return error MOV @R0,R0 ;Get WORD value 10$: RETURN .ENABLE LSB $NXADR:: DECB R4 ;Reduce arg count BMI 20$ ;No more args MOV (R5)+,-(SP) ;Move addr to stack, point R5 to next CMP #$NOARG,@SP ;Omitted addr value? BEQ 10$ ;Yes, then no address MOV (SP)+,R0 ;No, return addr in R0 CLC ;Return carry cleared RETURN ;Done 10$: TST (SP)+ ;Align stack 20$: SEC ;Return carry set RETURN .END