开发者

Assembler and Jump instruction (how does it work)

开发者 https://www.devze.com 2022-12-19 03:38 出处:网络
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?On Intel, there is both near jump that

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消