TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Vitus Jensen
from: Marcel Vandevusse
date: 1996-12-18 23:52:12
subject: pentium counter register

Replying to a message of Vitus Jensen to Marcel Vandevusse:

 VJ> Moin Marcel,

 VJ> 02.12.96 21:09, you wrote a message to All :

 MV>> I am trying to time a piece of assembly code; supposed the Intel
 MV>> Pentium has a register which counts clock ticks. I figured this
 MV>> would be the easiest accessable counter with a high enough
 MV>> resolution for my purpose, but: I don't know how to access this
 MV>> register.

 VJ> You may use the RDTSC opcode (0F 31), which places the current timer
 VJ> value in 
 VJ> EDX:EAX.  This opcode is available at ring 3 if CR4.2 isn't set. 
 VJ> Access to 
 VJ> MSRs is only allowed at ring 0.

I never knew there was a "normal" instruction to do this. I just
kinda assumed you had to play some tricks to read it...

 VJ> Timing your code under OS/2 isn't really possible because of the
 VJ> peemptive 
 VJ> multitasking.

It is when you're timing yout code at priority level 4 (server). Stops the
rest of the system dead in it's tracks.

 MV>> Does anybody know how to do this?

 VJ> There was an article in c't 11/94 (german magazine), it references
 VJ> BYTE 7/94 
 VJ> and DrDobb's Journal 1/94.

Thank you, I will look them up in a library.

--- FleetStreet 1.17 NR
* Origin: The Legacy Continues (private node) (1:2265/601)
SEEN-BY: 270/101 711/401 409 410 413 430 808 809 934 955 712/407 515 624 628
SEEN-BY: 713/317
@PATH: 2265/601 1 2215/12 3615/50 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.