简体   繁体   中英

Assembler and Jump instruction (how does it work)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM