prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
I posted the following to comp.lang.pl1. It might be useful if you want to get more accurate timings than can be obtained by using the TIME() or DATETIME() builtins:
Quote: |
OK, so I downloaded FASM and assembled this, rdtsc.asm
Code: |
format coff
public _rdtsc@0
_rdtsc@0:
rdtsc
ret |
into this rdtsc.obj (in HEX), if anyone else needs it:
Code: |
000000 4C 01 01 00 C8 0C 11 4C 3F 00 00 00 02 00 00 00
000010 00 00 04 01 2E 66 6C 61 74 00 00 00 00 00 00 00
000020 00 00 00 00 03 00 00 00 3C 00 00 00 00 00 00 00
000030 00 00 00 00 00 00 00 00 60 00 00 00 0F 31 C3 2E
000040 66 6C 61 74 00 00 00 00 00 00 00 01 00 00 00 03
000050 00 5F 72 64 74 73 63 40 30 00 00 00 00 01 00 00
000060 00 02 00 04 00 00 00 |
and using this declare
Code: |
dcl rdtsc entry() ext('rdtsc')
returns(fixed bin(63) byvalue) options(linkage(stdcall)); |
and this compile directive
Code: |
limits(fixedbin(31,63) |
I got myself cycle-accurate (Oh yeah... - No, you can forget that! ) timings.
|
|
|