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

Moin Marcel,

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.

You may use the RDTSC opcode (0F 31), which places the current timer value in 
EDX:EAX.  This opcode is available at ring 3 if CR4.2 isn't set.  Access to 
MSRs is only allowed at ring 0.
Timing your code under OS/2 isn't really possible because of the peemptive 
multitasking.

 MV> Does anybody know how to do this?

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

 MV> And do any other CPUs (80486, PPRO, Cyrix, AMD, etc) have a
 MV> register like this?

At 11/94 no other cpu had that timer.

C-x C-s
    Vitus [Team OS/2 Germany]

---
* Origin: Milky Way, Earth, Germany, Isernhagen (2:2474/400.8)
SEEN-BY: 50/99 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1
@PATH: 2474/400 0 24/999 888 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™.