I want to calculate the clock cycles of CPU required to run my program using rdtsc
instruction as it is required in my assignment.
What should be the syntax to use rdtsc
instructions in "AFD"?
I'm using rdtsc
instruction as it is but "AFD" terminates my program as it gets executed...
Asked
Active
Viewed 274 times
-1

Fifoernik
- 9,779
- 1
- 21
- 27
-
1You forgot to show your code and what the actual error is. See [mcve] and learn to use a debugger. – Jester Mar 05 '17 at 17:35
-
I'm using 'rdtsc' instruction in my code ... afd giving no error but but it ends my program instead of fetching the the clock cycles – MUDASSIR NAYYER SHEIKH Mar 05 '17 at 17:41
1 Answers
2
The rdtsc
instruction has no operands at all. So that's certainly not the issue.
But many environments don't allow the use of this instruction by user programs.
e.g. Windows doesn't allow 16-bit DOS programs to use rdtsc
Probably this also holds for "AFD" that you are using.

Fifoernik
- 9,779
- 1
- 21
- 27

Sep Roland
- 33,889
- 7
- 43
- 76