home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / ASM / ALIB30B / COMPAR1.ASM < prev    next >
Assembly Source File  |  1994-10-27  |  1KB  |  40 lines

  1.     page    66,132
  2. ;******************************* COMPAR1.ASM ********************************
  3.  
  4. LIBSEG           segment byte public "LIB"
  5.         assume cs:LIBSEG , ds:nothing
  6.  
  7. ;----------------------------------------------------------------------------
  8. .xlist
  9.     include  mac.inc
  10.     include  common.inc
  11.  
  12.     extrn    strlen1:far
  13. .list
  14. comment 
  15. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -( COMPARE )
  16. ;COMPARE1 - compare asciiz strings, use case, update registers
  17. ;
  18. ; inputs:   DS:[SI] = address of string1, must end with a zero char.
  19. ;           ES:[DI] = address of string2
  20. ; output:   if match  - si & di point at end of strings
  21. ;                     - flags are in "je" state
  22. ;           if different - si & di point one byte past the mismatch.
  23. ;                        - flags are in "jne" state
  24. ;* * * * * * * * * * * * * *
  25. 
  26.     PUBLIC    COMPARE1
  27. COMPARE1    PROC    FAR
  28.     cld
  29.     push    cx
  30.     call    strlen1            ;find length of string1
  31.     repe    cmpsb
  32.     pop    cx
  33.     retf
  34. COMPARE1    ENDP
  35. ;------------------------------------------------------------------------
  36.  
  37. LIBSEG    ENDS
  38.     end
  39.