mmx_main.as 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #
  2. # x86 format converters for HERMES
  3. # Some routines Copyright (c) 1998 Christian Nentwich ([email protected])
  4. # This source code is licensed under the GNU LGPL
  5. #
  6. # Please refer to the file COPYING.LIB contained in the distribution for
  7. # licensing conditions
  8. #
  9. # Most routines are (c) Glenn Fiedler ([email protected]), used with permission
  10. #
  11. #BITS 32
  12. .globl _ConvertMMX
  13. .globl _mmxreturn
  14. .text
  15. ## _ConvertMMX:
  16. ## [ESP+8] ConverterInfo*
  17. ## --------------------------------------------------------------------------
  18. ## ConverterInfo (ebp+..)
  19. ## 0: void *s_pixels
  20. ## 4: int s_width
  21. ## 8: int s_height
  22. ## 12: int s_add
  23. ## 16: void *d_pixels
  24. ## 20: int d_width
  25. ## 24: int d_height
  26. ## 28: int d_add
  27. ## 32: void (*converter_function)()
  28. ## 36: int32 *lookup
  29. _ConvertMMX:
  30. pushl %ebp
  31. movl %esp,%ebp
  32. movl 8(%ebp),%eax
  33. cmpl $0,4(%eax)
  34. je endconvert
  35. movl %eax,%ebp
  36. movl (%ebp),%esi
  37. movl 16(%ebp),%edi
  38. y_loop:
  39. movl 4(%ebp),%ecx
  40. jmp *32(%ebp)
  41. _mmxreturn:
  42. addl 12(%ebp),%esi
  43. addl 28(%ebp),%edi
  44. decl 8(%ebp)
  45. jnz y_loop
  46. popl %ebp
  47. endconvert:
  48. emms
  49. ret