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

  1. ;[]-----------------------------------------------------------------[]
  2. ;|      N_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, sets the condition codes
  19. ;
  20. ;       ax,dx   left hand pointer
  21. ;       bx,cx   right hand pointer
  22.  
  23.         public  N_PCMP@
  24.  
  25. N_PCMP@        PROC    NEAR
  26.                 push    cx
  27.                 mov     ch,al
  28.                 mov     cl,4
  29.                 shr     ax,cl
  30.                 add     dx,ax
  31.                 mov     al,ch
  32.                 mov     ah,bl
  33.                 shr     bx,cl
  34.                 pop     cx
  35.                 add     cx,bx           ; right hand pointer segment
  36.                 mov     bl,ah
  37.                 and     ax,0fh
  38.                 and     bx,0fh
  39.                 cmp     dx,cx           ; compare segments
  40.                 jne     PCMPend
  41.                 cmp     ax,bx           ; compare offsets
  42. PCMPend:
  43.                 ret
  44. N_PCMP@        ENDP
  45. _TEXT   ENDS
  46.         END
  47.