首页
社区
课程
招聘
RDTSC(时间差)-请教
发表于: 2005-2-25 07:13 5441

RDTSC(时间差)-请教

2005-2-25 07:13
5441
收藏
免费 7
支持
分享
最新回复 (4)
雪    币: 398
活跃值: (1078)
能力值: ( LV9,RANK:970 )
在线值:
发帖
回帖
粉丝
2
RDTSC―Read Time-Stamp Counter
Description
Loads the current value of the processor’s time-stamp counter into the EDX:EAX registers. The
time-stamp counter is contained in a 64-bit MSR. The high-order 32 bits of the MSR are loaded
into the EDX register, and the low-order 32 bits are loaded into the EAX register. The processor
increments the time-stamp counter MSR every clock cycle and resets it to 0 whenever the
processor is reset.
The time stamp disable (TSD) flag in register CR4 restricts the use of the RDTSC instruction.
When the TSD flag is clear, the RDTSC instruction can be executed at any privilege level; when
the flag is set, the instruction can only be executed at privilege level 0. The time-stamp counter
can also be read with the RDMSR instruction, when executing at privilege level 0.
The RDTSC instruction is not a serializing instruction. Thus, it does not necessarily wait until
all previous instructions have been executed before reading the counter. Similarly, subsequent
instructions may begin execution before the read operation is performed.
This instruction was introduced into the Intel Architecture in the Pentium processor.
Operation
IF (CR4.TSD = 0) OR ((CR4.TSD = 1) AND (CPL=0))
THEN
EDX:EAX ¬ TimeStampCounter;
ELSE (* CR4 is 1 and CPL is 1, 2, or 3 *)
#GP(0)
FI;
Opcode Instruction Description
0F 31 RDTSC Read time-stamp counter into EDX:EAX
2005-2-25 08:26
0
雪    币: 86
活跃值: (838)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
3
使用的是RDTSC这个指令!
HYING的壳中就大量的用到了这个!
2005-2-25 08:34
0
雪    币: 303
活跃值: (466)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
多谢各位大虾
2005-2-25 09:05
0
雪    币: 161
活跃值: (231)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
5
多谢各位大虾
2005-2-25 09:08
0
游客
登录 | 注册 方可回帖
返回
//