VerifyXMMReg.asm 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. ;//==========================================================================
  2. ;//
  3. ;// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. ;// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. ;// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. ;// PURPOSE.
  7. ;//
  8. ;// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
  9. ;//
  10. ;//--------------------------------------------------------------------------
  11. ;
  12. ; **-VerifyXMMReg
  13. ;
  14. ; This function is meant to be run on a Windows NT system to
  15. ; try and determine if the OS supports the XMM registers or
  16. ; not.
  17. ;
  18. ; This function is number 3 in a set of three. The other
  19. ; functions are...
  20. ;
  21. ; InitXMMReg
  22. ; TrashXMMReg
  23. ;
  24. ; Assumptions:
  25. ; Assumes that InitXMMReg was called to initilize the XMM registers.
  26. ; Assumes that TrashXMMReg was called from a different thread to clear
  27. ; the values in the XMM registers.
  28. ;
  29. ; Input:
  30. ; None
  31. ;
  32. ; Output:
  33. ; Return 1 (True) if the XMM registers are at the correct values.
  34. ; (os supports XMM registers)
  35. ;
  36. ; Return 0 (False) if the XMM registers are not at the correct values.
  37. ; (os does not support the XMM registers)
  38. ;
  39. .686P
  40. .XMM
  41. .MODEL flat, SYSCALL, os_dos
  42. .DATA
  43. TORQ_CX_DATA SEGMENT PAGE PUBLIC USE32 'DATA'
  44. ALIGN 32
  45. NAME VerifyXMMReg
  46. PUBLIC VerifyXMMReg_
  47. PUBLIC _VerifyXMMReg
  48. EXTERN XMM0Init:REAL4
  49. EXTERN XMM1Init:REAL4
  50. EXTERN XMM2Init:REAL4
  51. .CODE
  52. ; int VerifyXMMReg( void )
  53. VerifyXMMReg_:
  54. _VerifyXMMReg:
  55. push esi ;safety sh*&
  56. push edi
  57. push ebp
  58. push ebx
  59. push ecx
  60. push edx
  61. mov eax,0 ; assume will fail
  62. comiss xmm0,XMM0Init ; check XMM0
  63. jne Exit
  64. comiss xmm1,XMM1Init
  65. jne Exit
  66. comiss xmm2,XMM2Init
  67. jne Exit
  68. mov eax,1 ; OS supports XMM registers
  69. Exit:
  70. pop edx ;safety sh*&
  71. pop ecx
  72. pop ebx
  73. pop ebp
  74. pop edi
  75. pop esi
  76. ret
  77. ;************************************************
  78. END