1

I have a piece of (assembly) code, in which i want to count the number of dynamic instructions

a1=99

Loop:
a1=a1-1
branch a1>0, Loop
halt

I think the instructions in loop are executing for 100 times. So I guess the number of dynamic instructions in the code are 102. But I am not sure, whether or not we also consider branch instructions as dynamic? In that case, shouldn't I have double instruction count? Thanks in advance to anybody who is willing to help.

4

1 に答える 1

3

dynamic instructionsは一般的に使われる用語ではないため、何を意味するのかは不明です。分岐命令は、実行に少なくとも 1 クロック サイクルかかるため、常に命令カウントに含まれます。

したがって、答えは 200 命令が実行されるはずです。

于 2013-05-01T20:20:09.537 に答える