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

  1. stdlib        segment    para public 'slcode'
  2.         assume    cs:stdlib
  3. ;
  4. ;
  5. ; union-    Unions one set with another.
  6. ;
  7. ; inputs:
  8. ;
  9. ;    ES:DI-  Points at the destination set (at its mask byte).
  10. ;    DX:SI-    Points at the mask byte of the source set.
  11. ;
  12. ;
  13. ;
  14.         public    sl_union
  15. ;
  16. sl_union    proc    far
  17.         push    ds
  18.         push    ax
  19.         push    cx
  20.         push    si
  21.         push    di
  22.         mov    ds, dx
  23. ;
  24.         mov    al, es:[di]        ;Get mask bytes
  25.         mov    ah, [si]
  26.         add    si, 8            ;Skip to start of set
  27.                 add    di, 8
  28.         mov    cx, 256
  29. unionLp:    test    ah, [si]
  30.         jz    Next
  31.         or    es:[di], al
  32. Next:        inc    si
  33.         inc    di
  34.         loop    unionLp
  35. ;
  36.         pop    di
  37.         pop    si
  38.         pop    cx
  39.         pop    ax
  40.         pop    ds
  41.         ret
  42. sl_union    endp
  43. ;
  44. ;
  45. stdlib        ends
  46.         end
  47.