home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / asmutil / stdlib.zip / STRLEN.ASM < prev    next >
Assembly Source File  |  1990-07-11  |  511b  |  42 lines

  1. stdlib        segment    para public 'slcode'
  2.         assume    cs:stdlib
  3. ;
  4. ;
  5. ; strlen- Computes the length of the string which ES:DI points at.
  6. ;
  7. ; inputs:
  8. ;
  9. ;    ES:DI- Points at string to compute the length of.
  10. ;
  11. ; output:
  12. ;
  13. ;    CX- Length of string.
  14. ;
  15. ;
  16.         public    sl_strlen
  17. ;
  18. sl_strlen    proc    far
  19.         push    ax
  20.         pushf
  21.         push    si
  22.         push    di
  23. ;
  24.         cld
  25.         mov    al, 0
  26.         mov    cx, 0ffffh
  27.     repne    scasb
  28.         neg    cx
  29.         dec    cx
  30.         dec    cx
  31. ;
  32.         pop    di
  33.         pop    si
  34.         popf
  35.         pop    ax
  36.         ret
  37. sl_strlen    endp
  38. ;
  39. ;
  40. stdlib        ends
  41.         end
  42.