Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.2 KiB

  1. title "NtGetTickCount"
  2. ;++
  3. ;
  4. ; Copyright (c) 1989 Microsoft Corporation
  5. ;
  6. ; Module Name:
  7. ;
  8. ; tickcnt.asm
  9. ;
  10. ; Abstract:
  11. ;
  12. ;
  13. ; This module contains the implementation for the fast NtGetTickCount service
  14. ;
  15. ;
  16. ; Author:
  17. ;
  18. ; Mark Lucovsky (markl) 19-Oct-1996
  19. ;
  20. ; Environment:
  21. ;
  22. ; Kernel mode.
  23. ;
  24. ; Revision History:
  25. ;
  26. ;
  27. ;--
  28. .386p
  29. ; .xlist
  30. include ks386.inc
  31. include callconv.inc ; calling convention macros
  32. ; .list
  33. extrn _KeTickCount:DWORD
  34. extrn _ExpTickCountMultiplier:DWORD
  35. _TEXT SEGMENT DWORD PUBLIC 'CODE'
  36. ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
  37. page ,132
  38. ;++
  39. ;
  40. ; Routine Description:
  41. ;
  42. ; This function returns number of milliseconds since the system
  43. ; booted. This function is designed to support the Win32 GetTicKCount
  44. ; API.
  45. ;
  46. ; Arguments:
  47. ;
  48. ; NONE
  49. ;
  50. ; Return Value:
  51. ;
  52. ; Returns the number of milliseconds that have transpired since boot
  53. ;
  54. ;--
  55. cPublicProc _NtGetTickCount, 0
  56. cPublicFpo 0, 0
  57. mov eax,dword ptr [_KeTickCount]
  58. mul dword ptr [_ExpTickCountMultiplier]
  59. shrd eax,edx,24 ; compute resultant tick count
  60. stdRET _NtGetTickCount
  61. stdENDP _NtGetTickCount
  62. _TEXT ends
  63. end