dvu.s 327 B

123456789101112131415161718192021
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .define .dvu
  3. ! #bytes in eax
  4. .sect .text
  5. .dvu:
  6. pop ebx ! return address
  7. cmp eax,4
  8. jne 1f
  9. pop eax
  10. xor edx,edx
  11. pop ecx
  12. div ecx
  13. push eax
  14. jmp ebx
  15. 1:
  16. .extern EODDZ
  17. .extern .trp
  18. mov eax,EODDZ
  19. push ebx
  20. jmp .trp