cms.s 349 B

1234567891011121314151617181920212223
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .define .cms
  3. ! #bytes in ecx
  4. .sect .text
  5. .cms:
  6. pop ebx ! return address
  7. mov edx,esp
  8. push esi
  9. push edi
  10. mov esi,edx
  11. add edx,ecx
  12. mov edi,edx
  13. add edx,ecx
  14. sar ecx,2
  15. repe cmps
  16. je 1f
  17. inc ecx
  18. 1:
  19. pop edi
  20. pop esi
  21. mov esp,edx
  22. jmp ebx