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

  1. stdlib        segment    para public 'slcode'
  2.         assume    cs:stdlib
  3. ;
  4. ;
  5. ; RmvStrl-    Removes a set of characters (given by the string following
  6. ;        the call) from a set.
  7. ;
  8. ; inputs:
  9. ;
  10. ;    ES:DI-  Points at the set (at its mask byte).
  11. ;    CS:RET- Points at the string.
  12. ;
  13. ;
  14.         public    sl_RmvStrl
  15. ;
  16. sl_RmvStrl    proc    far
  17.         push    bp
  18.         mov    bp, sp
  19.         push    ds
  20.         push    es
  21.         push    ax
  22.         push    bx
  23.         push    cx
  24.         push    si
  25.                 push    di
  26. ;
  27.         mov    si, di
  28.         mov    ax, es
  29.         mov    ds, ax
  30.         les    di, 2[bp]
  31.         mov    al, 0
  32.         mov    cx, 0ffffh
  33.     repne    scasb
  34.         xchg    2[bp], di
  35. ;
  36. ;
  37.         mov    al, [si]        ;Get mask byte
  38.                 not    al
  39.         add    si, 8            ;Skip to start of set
  40.         mov    bh, 0
  41.                 jmp    IntoLp
  42. RmvLp:        and    [si][bx], al        ;Add to set
  43.         inc    di            ;Move on to next char.
  44. IntoLp:        mov    bl, es:[di]
  45.         cmp    bl, 0
  46.         jnz    RmvLp
  47. ;
  48.         pop    di
  49.         pop    si
  50.         pop    cx
  51.         pop    bx
  52.         pop    ax
  53.         pop    es
  54.         pop    ds
  55.         pop    bp
  56.         ret
  57. sl_RmvStrl    endp
  58. ;
  59. ;
  60. stdlib        ends
  61.         end
  62.