flat assembler
Message board for the users of flat assembler.
Index
> Main > how to test algorithm execution speed? |
Author |
|
viki 11 Jul 2006, 13:53
With rdtsc instruction. Plase look for cpu_speed thread on this forum
|
|||
11 Jul 2006, 13:53 |
|
tom tobias 11 Jul 2006, 15:04
zhak wrote: How can I measure the speed of program execution (in real mode)? http://www.byte.com/abrash/ http://www.azillionmonkeys.com/qed/optimize.html |
|||
11 Jul 2006, 15:04 |
|
viki 12 Jul 2006, 06:29
zhak if you wont the same code in c for real mode, give me a sign.
|
|||
12 Jul 2006, 06:29 |
|
ChrisLeslie 13 Jul 2006, 03:50
zhak
Timing is not very accurate in real mode as DOS "tick" counts are about 55ms in duration. However, you could try using int 1Ah to get the number of ticks since midnight before and after you run your procedures, so long as you loop your procedures a large number of times. This piece of code before and after the looped procedure should do it. Code: mov ah,00h int 1ah mov ax,cx shl eax,16 mov ax,dx The "ticks" since, I think, midnight ends up in EAX. Then of course subtract the difference to find the actual duration for the looped procedure. Chris |
|||
13 Jul 2006, 03:50 |
|
zhak 13 Jul 2006, 06:56
Oh, thanks men, that helps a lot...
2 viki: IA-32 SDM says Quote: The RDTSC instruction is not a serializing instruction. Thus, it does not necessarily wait until So it means that I need to clear the command queue before executing rdtsc, isnt'it? How can I do this? With far jump... are there any other methods to do this? |
|||
13 Jul 2006, 06:56 |
|
revolution 13 Jul 2006, 08:29
zhak wrote: clear the command queue before executing rdtsc Code: xor eax,eax
cpuid |
|||
13 Jul 2006, 08:29 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.