home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 1.ddi / CLIBSRC.ZIP / F_PCMP.ASM < prev    next >
Encoding:
Assembly Source File  |  1992-06-10  |  1.4 KB  |  51 lines

  1. ;[]-----------------------------------------------------------------[]
  2. ;|      F_PCMP.ASM -- long pointer comparison                        |
  3. ;[]-----------------------------------------------------------------[]
  4.  
  5. ;
  6. ;       C/C++ Run Time Library - Version 5.0
  7. ;       Copyright (c) 1987, 1992 by Borland International
  8. ;       All Rights Reserved.
  9.  
  10.         INCLUDE RULES.ASI
  11.  
  12. ; calls to this routine are generated by the compiler to compare
  13. ; long pointers.
  14.  
  15. _TEXT   SEGMENT BYTE PUBLIC 'CODE'
  16.         ASSUME  CS:_TEXT
  17. ;
  18. ;       PCMP@ - compares two pointers on the stack, sets the condition codes
  19. ;
  20. ;       ax,dx   left hand pointer
  21. ;       bx,cx   right hand pointer
  22.  
  23.         public  PCMP@
  24.         public  F_PCMP@
  25.  
  26. PCMP@           PROC    FAR
  27. F_PCMP@:
  28.                 push    cx
  29.                 mov     ch,al
  30.                 mov     cl,4
  31.                 shr     ax,cl
  32.                 add     dx,ax
  33.                 mov     al,ch
  34.                 mov     ah,bl
  35.                 shr     bx,cl
  36.                 pop     cx
  37.                 add     cx,bx           ; right hand pointer segment
  38.                 mov     bl,ah
  39.                 and     ax,0fh
  40.                 and     bx,0fh
  41.                 cmp     dx,cx           ; compare segments
  42.                 jne     PCMPend
  43.                 cmp     ax,bx           ; compare offsets
  44. PCMPend:
  45.                 ret
  46. PCMP@           ENDP
  47. _TEXT   ENDS
  48.         END
  49.