IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using RDTSC in PL/I for Windows (RDz)


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Jun 10, 2010 9:42 pm
Reply with quote

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Excel VBA integration with AS400 Macr... All Other Mainframe Topics 1
No new posts IMS DB / DB2 simulator for ETL testin... IMS DB/DC 1
No new posts Pack to Unpack conversion for sending... COBOL Programming 13
No new posts Rexx command to open an another text ... PC Guides & IT News 7
No new posts Date in where clause - Windows DB2 9
Search our Forums:

Back to Top