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

  1. stdlib        segment    para public 'slcode'
  2.         assume    cs:stdlib
  3. ;
  4. ;
  5. ; difference-    Computes the difference of 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_difference
  15. ;
  16. sl_difference    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. DifLp:        test    ah, [si]
  31.         jz    Next
  32.         and    es:[di], al
  33. Next:        inc    si
  34.         inc    di
  35.         loop    DifLp
  36. ;
  37.         pop    di
  38.         pop    si
  39.         pop    cx
  40.         pop    ax
  41.         pop    ds
  42.         ret
  43. sl_difference    endp
  44. ;
  45. ;
  46. stdlib        ends
  47.         end
  48.