I need to count the number of instructions that will be generated for an simple assembly language code . So that even if there is any loop I can count the number of instructions in that loop also.I just need it so that i can determine how many times i can use -p option for each instruction’s in he code. I am using masm on widows xp computer .
Share
This is actually much more difficult than you would think. (Some would say impossible–see http://en.wikipedia.org/wiki/Halting_problem)
If the code relies on any sort of data (e.g. loading values from RAM), its behavior could change drastically based on what the data contains, and this will affect the number of instructions executed. e.g. if it’s a loop, it will probably load its iteration count from memory somewhere. So it could be 100 instructions executed, or 100000000 instructions.