and.s 286 B

1234567891011121314151617181920
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .define .and
  3. ! #bytes in ecx
  4. ! save edi; it might be a register variable
  5. .sect .text
  6. .and:
  7. pop ebx ! return address
  8. mov edx,edi
  9. mov edi,esp
  10. add edi,ecx
  11. sar ecx,2
  12. 1:
  13. pop eax
  14. and eax,(edi)
  15. stos
  16. loop 1b
  17. mov edi,edx
  18. jmp ebx