lea assembly instruction

前端 未结 2 1054
半阙折子戏
半阙折子戏 2020-12-18 02:30

I Just want to make sure I am reading this right:

movl 12(%ebp), %edx
leal (%edx, %edx, 4), %eax

I read the first line as: edx = [epb

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-18 02:56

    You're right. The LEA instruction is used to Load (the) Effective Address, and can be used for address arithmetic and sometimes also ordinary arithmetic, if you don't need the flags.

提交回复
热议问题