home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 2.ddi / CLIB2.ZIP / F_PCMP.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-06-07  |  1.6 KB  |  49 lines

  1. ;[]-----------------------------------------------------------------[]
  2. ;|      F_PCMP.ASM -- long pointer comparison                        |
  3. ;|                                                                   |
  4. ;|      Turbo-C Run Time Library        Version 3.0                  |
  5. ;|                                                                   |
  6. ;|      Copyright (c) 1987,1988,1990 by Borland International Inc.   |
  7. ;|      All Rights Reserved.                                         |
  8. ;[]-----------------------------------------------------------------[]
  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.