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

  1. stdlib        segment    para public 'slcode'
  2.         assume    cs:stdlib
  3. ;
  4. ;
  5. ; intersect-    Intersects 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_intersect
  15. ;
  16. sl_intersect    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.         not    al
  26.         mov    ah, [si]
  27.         add    si, 8            ;Skip to start of set
  28.                 add    di, 8
  29.         mov    cx, 256
  30. IsectLp:    test    ah, [si]
  31.         jnz    Next
  32.         and    es:[di], al
  33. Next:        inc    si
  34.         inc    di
  35.         loop    IsectLp
  36. ;
  37.         pop    di
  38.         pop    si
  39.         pop    dx
  40.         pop    cx
  41.         pop    ax 
  42.         pop    ds
  43.         ret
  44. sl_intersect    endp
  45. ;
  46. ;
  47. stdlib        ends
  48.         end
  49.