开发者

How'll the offset in these two cases be applied?

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 re开发者_StackOverflowgister 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?


-4 will be added to the value of the register, decreasing it by 4. Offsets are always added.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜