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

  1. stdlib        segment    para public 'slcode'
  2.         assume    cs:stdlib
  3. ;
  4. ;
  5. ; RmvStr-    Subtracts the characters in a string from a set.
  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_RmvStr
  15. ;
  16. sl_RmvStr    proc    far
  17.         push    ds
  18.         push    ax
  19.         push    bx
  20.         push    si
  21.         push    di
  22.         mov    ds, dx
  23. ;
  24.         mov    al, es:[di]        ;Get mask byte
  25.         not    al
  26.         add    di, 8            ;Skip to start of set
  27.         mov    bh, 0
  28.                 jmp    IntoLp
  29. RmvLp:        and    es:[di][bx], al        ;Add to set
  30.         inc    si            ;Move on to next char.
  31. IntoLp:        mov    bl, [si]
  32.         cmp    bl, 0
  33.         jnz    RmvLp
  34. ;
  35.         pop    di
  36.         pop    si
  37.         pop    bx
  38.         pop    ax
  39.         pop    ds
  40.         ret
  41. sl_RmvStr    endp
  42. ;
  43. ;
  44. stdlib        ends
  45.         end
  46.