Save some clocks ?
From: Andrew Kennedy (andrewkennedy2_at_LOGev1.net)
Date: 02/26/04
- Previous message: Evenbit: "Re: Dos Assembly"
- Next in thread: Matt Taylor: "Re: Save some clocks ?"
- Reply: Matt Taylor: "Re: Save some clocks ?"
- Reply: Daniel Pfeffer: "Re: Save some clocks ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 26 Feb 2004 08:02:54 +0000 (UTC)
Any comment on the comment near the bottom that someone gave me about the
jmp + 2.
xor eax, eax
cpuid
rdtsc
mov edi, eax ; save lower 32 bits in edi
xor eax, eax
cpuid
; Insert timed code here
xor eax, eax
cpuid
rdtsc
sub edi, eax
xor eax, eax
sub eax, edi ; eax = result
Joined: 19 May 2003
Posts: 372
Location: 8003F000
PostPosted: 02-25-2004 07:44 PM Post subject: Reply with quote
You don't have to use "cpuid" instruction.
"jmp $+2" puts the CPU back into order too, and
doesn't run 200 clocks, like "cpuid".
- Previous message: Evenbit: "Re: Dos Assembly"
- Next in thread: Matt Taylor: "Re: Save some clocks ?"
- Reply: Matt Taylor: "Re: Save some clocks ?"
- Reply: Daniel Pfeffer: "Re: Save some clocks ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|