; int _CompareUnsArr(src1,src2,n) ; ; ARGUMENT ; src1, src2 point to unsigned arrays of length 'n' ; ; DESCRIPTION ; ; Compares src1 to scr2. Src1 and Src2 remain unchanged. ; ; SIDE EFFECTS ; None. ; ; RETURNS ; Returns zero if src1=src2, 1 if src1>src2, -1 if src2>src1. ; ; AUTHOR ; Andy Anderson 14-JAN-1987 14:45 ; Copyright (C) 1987-90 Greenleaf Software Inc. All Rights Reserved. ; ; MODIFICATIONS ; ; ; include model.h include prologue.h include gm.equ pseg gmath ; ; if large memory model then: ; ; parm1_ = ptr to source 1 ; parm3_ = ptr to source 2; ; parm5_ = number of unsigned's to compare ; ; for if small model then ; parm1_ = ptr to source1 ; parm2_ = ptr to source2 ; parm3_ = number of unsigned's to compare ; cproc _CompareUnsArr,,_gcmp if _LDATA push ds push es lds si,parm1_ ; ptr to a les di,parm3_ ; ptr to b mov cx,parm5_ ; number of ints to compare else mov si,parm1_ mov di,parm2_ mov cx,parm3_ endif ; ; then do the compare, starting at the most significant bits ; which are considered signed, others are unsigned ; mov bx,cx ; make number of unsigned's an sal bx,1 ; offset into array sub bx,2 ; now yy+bx pts to last int mov ax,[bx+si] ; src1 msb if _LDATA cmp ax,Word Ptr es:[bx+di] else cmp ax,Word Ptr [bx+di] endif ja g1 ; src1>src2 unsigned! jb l1 ; src1src2 unsigned jb l1 ; src1src2 unsigned jb l1 ; src1