.MCALL .MODULE .MODULE JCMP,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. ;++ ; ; Edit Who Date Description of modification ; ---- --- ---- --------------------------- ; 001 WLD 05-OCT-90 Use standard introductory ; comments so that calling ; sequence can be documented. ; Use $NXADR routine. ;-- ;+ ;COND ; EIS$I (0) use SOB macro ; 1 use SOB instruction ; ; SLIB$M (0) Generate standard SYSLIB routine ; SLIB$M 1 Generate U mode part of Supervisor library ; SLIB$M 2 Generate S mode part of Supervisor library ; ; SLIB$M values are referenced using symbols of the form *PART ; in conditional statements. ; ; If SLIB$M <> 0, EIS$I is forced to 1 ;- .IIF NDF EIS$I EIS$I=0 .IIF NDF SLIB$M SLIB$M=0 .IIF NE SLIB$M EIS$I=1 OPART = SLIB$M ;0 = generate if building old library UPART = SLIB$M-1 ;0 = generate if building User part SPART = SLIB$M-2 ;0 = generate if building Supy part OSPART = OPART*SPART ;0 = generate ... old or Supy OUPART = OPART*UPART ;0 = generate ... old or User ;+ ; RT-11 SYSTEM LIBRARY (SYSLIB) SUBROUTINE ; ; CALLABLE ENTRIES: JCMP ; ; FUNCTIONAL DESCRIPTION: ; Perform a signed comparison of two INTEGER*4 values and return an INTEGER*2 ; value indicating the result. ; ; CALLING SEQUENCE: ; ; I = JCMP(X,Y) ; ; PASSED ARGUMENTS: ; ; X - INTEGER*4 ; Y - INTEGER*4 ; ; RETURNED ARGUMENT VALUES: ; ; ; ; FUNCTION RETURN VALUE: ; ; I = -1 if X < Y ; I = 0 if X = Y ; I = 1 if X > Y ; ; ; EXTERNAL REFERENCES: ; ; $NXADR ; ; ; MACRO REFERENCES: ; ; .SBTTL JCMP - FORTRAN-callable system subroutine .GLOBL $SYSLB, $NXADR .WEAK $MSARG .IIF EQ EIS$I .MCALL SOB .MCALL .ASSUME, .CKXX .PSECT SYS$I,I JCMP:: MOV (R5)+,R4 ;Get pointers to arguments. CALL $NXADR ;arg1 BCS 22$ ;BR if arg1 missing. MOV R0,R2 ;R2 points to arg1. CALL $NXADR ;arg2 BCS 22$ ;BR if arg2 missing. MOV R0,R1 ;R1 points to arg2. CLR R0 CMP 2(R2),2(R1) ;COMPARE HIGH PARTS BGT 1$ ;BRANCH IF >0 BLT 2$ ;BRANCH IF <0 CMP @R2,@R1 ;COMPARE LOW PARTS BEQ 3$ ;RESULT IS 0, LEAVE R0 ALONE BLO 2$ ;UNSIGNED ARG 1 IS LESS 1$: TST (R0)+ ;ADD 2 TO R0 2$: DEC R0 ;SUBTRACT 1 FROM R0 BR 3$ ;BR to return. 22$: TRAP $MSARG ;Handle missing arg. 3$: RETURN .END