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

  1. stdlib        segment    para public 'slcode'
  2.         assume    cs:stdlib
  3. ;
  4. ;
  5. ; NextItem-    Locates 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_NextItem
  17. ;
  18. sl_NextItem    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. ;
  29.         neg    cx
  30.         mov    al, cl
  31.         pop    si
  32.         pop    cx
  33.         ret
  34. sl_NextItem    endp
  35. ;
  36. ;
  37. stdlib        ends
  38.         end
  39.