Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
跳跃如何运作?它是设置IP寄存器还是增加它?
我们执行代码是相对还是绝对的位置变化?
在 Intel 上,有增加 IP 的近跳转和使用绝对地址的远跳转。所以答案是——两者兼而有之。
在其他架构上,通常两种形式的跳转也可用,但不一定是相同的命令。例如,在 ARM 上,对于远跳,您只需将其分配给 PC 寄存器 ( mov pc, rx)。或者从内存中加载它。B另一方面,(分支)命令将增量添加到同一 PC 寄存器。
mov pc, rx
B