Reputation: 10994
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?
Upvotes: 2
Views: 1992
Reputation: 61378
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.
Upvotes: 14