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

  1. stdlib        segment    para public 'slcode'
  2.         assume    cs:stdlib
  3. ;
  4. ;
  5. ; strset- Copies the character in al over the top of each character in the
  6. ;      string the es:si points at.  Does not affect the trailing zero
  7. ;      byte in the string.
  8. ;
  9. ; inputs:
  10. ;
  11. ;    AL-    Character to copy.
  12. ;    ES:DI-  Points at string to overwrite.
  13. ;
  14. ;
  15. ;
  16. ;
  17.         public    sl_strset
  18. ;
  19. sl_strset    proc    far
  20.         pushf
  21.         push    di
  22.         push    ax
  23. ;
  24.         cld
  25.         mov    ah, 0            ;Zero terminating byte
  26.         jmp    short StartLp
  27. ;
  28. SetLp:        stosb                ;Store next char
  29. StartLp:    cmp    ah, es:[di]        ;End of string?
  30.         jnz    SetLp
  31. ;
  32.         pop    ax
  33.         pop    di
  34.         popf
  35.         ret
  36. sl_strset    endp
  37. ;
  38. ;
  39. ;
  40. ;
  41. stdlib        ends
  42.         end
  43.