.ENABL LC .TITLE KMP2WU Compare two unsigned 32 bit values ; ; Called from FORTRAN by: I = KMP2WU(V1,V2) ; ; Where: V1 & V2 - values to be compared ; I - returned value ; -1 = V1 is smaller than V2 ; 0 = V1 is equal to V2 ; +1 = V1 is greater than V2 ; .GLOBL KMP2WU ;Entry Point .PSECT USER$I RW,I,LCL,REL,CON KMP2WU: TST (R5)+ ;Skip over FORTRAN argument count CLR R0 ;Assume V1 = V2 MOV (R5)+,R1 ;Get address of first argument MOV (R5)+,R2 ; and second argumment CMP (R1)+,(R2)+ ;Compare high order 16 bit values BHI 1$ ;Jump if V1 > V2 BLO 2$ ;Jump if V1 < V2 CMP (R1)+,(R2)+ ;Compare low order 16 bit values BHI 1$ ;Jump if V1 > V2 BLO 2$ ;Jump if V1 < V2 RETURN ;Match found 1$: INC R0 ;V1 > V2 RETURN 2$: DEC R0 ;V1 < V2 RETURN .END