dup.s 247 B

1234567891011121314151617
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .define .dup
  3. ! #bytes in ecx
  4. .sect .text
  5. .dup:
  6. pop ebx ! return address
  7. mov eax,esi
  8. mov edx,edi
  9. mov esi,esp
  10. sub esp,ecx
  11. mov edi,esp
  12. sar ecx,2
  13. rep movs
  14. mov esi,eax
  15. mov edi,edx
  16. jmp ebx