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

  1. stdlib        segment    para public 'slcode'
  2.         assume    cs:stdlib
  3. ;
  4. ;
  5. ; AddStr-    Unions into a set the characters in a string.
  6. ;
  7. ; inputs:
  8. ;
  9. ;    ES:DI-  Points at the set (at its mask byte).
  10. ;    DX:SI-    Points at the string.
  11. ;
  12. ;
  13. ;
  14.         public    sl_AddStr
  15. ;
  16. sl_AddStr    proc    far
  17.         push    ds
  18.         push    ax
  19.         push    bx
  20.         push    si
  21.                 push    di
  22. ;
  23.         mov    ds, dx
  24.         mov    al, es:[di]        ;Get mask byte
  25.         add    di, 8            ;Skip to start of set
  26.         mov    bh, 0
  27.                 jmp    IntoLp
  28. BldLp:        or    es:[di][bx], al        ;Add to set
  29.         inc    si            ;Move on to next char.
  30. IntoLp:        mov    bl, [si]
  31.         cmp    bl, 0
  32.         jnz    BldLp
  33. ;
  34.         pop    di
  35.         pop    si
  36.         pop    bx
  37.         pop    ax
  38.         pop    ds
  39.         ret
  40. sl_AddStr    endp
  41. ;
  42. ;
  43. stdlib        ends
  44.         end
  45.