What does a hexadecimal number, with a register in parenthesis mean in Assembly?

后端 未结 1 1592
陌清茗
陌清茗 2020-12-22 12:11

lea 0x1c(%ebp),%eax

So, I understand vaguely what the lea instruction does, and I know those are registers, but what is this structure: 0x1c(%e

1条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-22 12:47

    It is one of the many x86 addressing modes. Specifically, this is referred to as "displacement" addressing.

    Since you said you used objdump and didn't specify that you used the -M flag, I'm going to assume this in the GAS syntax (as opposed to Intel syntax). This means that the first operand is the source, and the second operand is the destination.

    The lea 0x1C(%ebp),%eax instruction means, "Take the value in %ebp, add 0x1C (28 in decimal), then store that value in %eax".

    0 讨论(0)
提交回复
热议问题