这两种情况下的偏移量将如何应用?
首先,我熟悉负数如何通过二进制补码系统表示的概念,并且我知道当存在跳转指令(短或近)时,它包含的偏移量将始终添加到 EIP 寄存器中,并且没有从 EIP 寄存器中减去偏移量的情况(如果我是对的!)。但我想知道在以下两种具有负呈现偏移量的寻址的情况下,它是否与跳转指令中的偏移量的使用方式相同,该偏移量总是被添加到基址上,并且不会在任何指令中被减去案件?
(GASM 格式):
“base_address(offset,index register,scale)”如:
%eax(-4,%ebx,1)
“offset(base register)”如:
-4(%eax)
二进制数将与 eax 寄存器相加还是相减?
First of all I'm familiar with the concept of how negative numbers are presented by two's complement system and I know that when there's a jump instruction(short or near) the offset it contains will always be added to EIP register and there isn't a case where the offset is subtracted from EIP register(if I'm right!). but I wonder if in case of two following kinds of addressing with a negative presented offset, it'll be the same as the case of how the offset in a jump instruction is used that is always being added to the base and not subtracted in any case?
(in GASM format):
"base_address(offset,index register,scale)" like:
%eax(-4,%ebx,1)
"offset(base register)" like:
-4(%eax)
will a binary number be added to eax register or subtracted?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
-4 将被添加到寄存器的值中,并将其减 4。偏移量始终会被添加。
-4 will be added to the value of the register, decreasing it by 4. Offsets are always added.