2

I'm wondering what would be the program behavior if a jump is out of range. What factors affect the program behavior (compiler, processor, ISA, or factors I don't know).

Also how may I find it out (in ISA manual?) for a specific hardware?

minglotus
  • 83
  • 6
  • 3
    Usually it won't assemble or link. The jump is out of range because it can not be encoded. – Jester Mar 02 '22 at 19:55
  • > The jump is out of range because it can not be encoded What if the jump is written in inline assembly in C++? I wonder if linker processes it differently? And wonder if there is a piece of code or doc I could dig around and learn more. – minglotus Mar 02 '22 at 21:40
  • 1
    Doesn't matter. Since it's not encodable, the CPU will never encounter such a jump so there is nothing to document about how it would handle it. Note that your assembler/linker may recognize and replace your out-of-range jump with a construct that can reach the given distance. – Jester Mar 02 '22 at 21:45
  • 2
    > Note that your assembler/linker may recognize and replace your out-of-range jump with a construct that can reach the given distance I see. a term called `veneer ` is mentioned, and supposed to be small sections of code inserted by linker (https://www.keil.com/support/man/docs/armlink/armlink_pge1406301797482.htm ) – minglotus Mar 02 '22 at 21:57

0 Answers0