Assembler and Jump instruction (how does it work)
-
24-09-2019 - |
Question
How does jump works ? Does it set the IP register or does it increase it ??
Is it relative or absolute change of place were we execute the code?
Solution
On Intel, there is both near jump that increments the IP, and far jump that uses an absolute address. So the answer is - both.
On other architectures, typically, both forms of jump are available as well, but not necessarily as the same command. On ARM, for example, for far jump you just assign to the PC register (mov pc, rx
). Or load it from memory. The B
(branch) command, on the other hand, adds an increment to the same PC register.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow