0

Can a direct branch instruction with a lower target address than the address of the branch instruction itself be considered as the beginning of a loop? Is this condition sufficient, or are there are other situations (compiler optimizations, etc) in which similar behaviour is shown on the instruction level.

What other approach would you recommend? The obvious one is storing a list of target addresses encountered and if a target address is taken by the same instruction more than once, it means it's the beginning of a loop. The downside of that is that it takes up memory of storing all the addresses and time for checks.

lekroif
  • 992
  • 3
  • 12
  • 24

0 Answers0