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

  1. stdlib        segment    para public 'slcode'
  2.         assume    cs:stdlib
  3. ;
  4. ;
  5. ; RmvItem-    Locates and removes the first (next) character in the set.
  6. ;
  7. ; inputs:
  8. ;
  9. ;    ES:DI-  Points at the set to search through.
  10. ;
  11. ; outputs:
  12. ;
  13. ;    AL-    Next available character in set (zero if set is empty).
  14. ;
  15. ;
  16.         public    sl_RmvItem
  17. ;
  18. sl_RmvItem    proc    far
  19.         push    cx
  20.         push    di
  21. ;
  22.         mov    al, es:[di]
  23.         mov    cx, 256
  24.         add    di, 7
  25. NextLp:        inc    di
  26.         test    al, es:[di]
  27.         loopz    NextLp
  28.         jz    NoMask
  29.         not    al
  30.         and    es:[di], al
  31.         inc    cx
  32. ;
  33. NoMask:        neg    cx
  34.         mov    al, cl
  35.         pop    di
  36.         pop    cx
  37.         ret
  38. sl_RmvItem    endp
  39. ;
  40. ;
  41. stdlib        ends
  42.         end
  43.