cii.s 469 B

12345678910111213141516171819202122232425262728293031
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .define .cii
  3. .sect .text
  4. .cii:
  5. pop ebx ! return address
  6. ! pop ecx, dest. size
  7. ! pop edx, src. size
  8. ! eax is source
  9. cmp edx,1
  10. jne 2f
  11. movsxb eax,al
  12. mov edx,4
  13. jmp 1f
  14. 2:
  15. cmp edx,2
  16. jne 1f
  17. cwde ! convert from 2 to 4 bytes
  18. mov edx,4
  19. 1:
  20. cmp edx,ecx
  21. jne 9f
  22. cmp edx,4
  23. jne 9f
  24. jmp ebx
  25. 9:
  26. .extern EILLINS
  27. .extern .fat
  28. mov eax,EILLINS
  29. push eax
  30. jmp .fat