How do you know how many Clock Cycles an instruction takes? Im just kinda curious, and so i can write faster programs.... Also is using the .if key word in Masm faster or using something like cmp eax; je lable ? -brad
Posted on 2001-04-17 21:30:00 by Rage9
The number of clocks depends on the type of CPU. See Agner Fog's Pentium optimization help file for instruction timing info on the various Pentium CPUs. Several other factors alter the timing, like various types of stalls, and how well instructions pair in the pipelines. Agner does a good job of explaining all of this. You can also add instruction timings to the .LST file that ML produces, by using the /Sc command line switch. It depends on the .386 .486 or .586 directive. Use /Fl to create the .LST file. IF, ELSEIF and so on usually do a good job at generating optimum code. They also make a program much easier to read. You can see the generated code by using the /Sg switch, or the .LISTALL directive. :)
Posted on 2001-04-17 23:03:00 by S/390