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

  1. stdlib        segment    para public 'slcode'
  2.         assume    cs:stdlib
  3. ;
  4. ;
  5. ; RangeSet-    Unions into a set the characters in a specified range.
  6. ;
  7. ; inputs:
  8. ;
  9. ;    ES:DI-  Points at the set (at its mask byte).
  10. ;    AL-    Lower bound for range.
  11. ;    AH-    Upper bound for range (note: al must be less than ah).
  12. ;
  13. ;
  14. ;
  15.         public    sl_RangeSet
  16. ;
  17. sl_RangeSet    proc    far
  18.         push    ax
  19.         push    bx
  20.         push    cx
  21.         pushf
  22.         push    di
  23. ;
  24.         mov    ch, 0
  25.         mov    cl, ah
  26.         sub    cl, al
  27.         inc    cx
  28.         mov    bh, 0
  29.         mov    bl, al
  30.         mov    al, es:[di]
  31.         lea    di, 8[di][bx]
  32. SetRange:    or    es:[di], al
  33.         inc    di
  34.         loop    SetRange
  35. ;
  36.         pop    di
  37.         popf
  38.         pop    cx
  39.         pop    bx
  40.         pop    ax
  41.         ret
  42. sl_RangeSet    endp
  43. ;
  44. ;
  45. stdlib        ends
  46.         end
  47.