difference between movl and leal instruction

This question already has an answer here:

  • What's the purpose of the LEA instruction? 14 answers
  • assembly leal and movl difference [duplicate] 1 answer

  • movl %esi, 0x8(%esi) is a register to memory move. The first operand is a register, it does not reference memory.

    On the other hand, leal %esi, 0x8(%esi) doesn't even exist, since you can't take the address of a register, and also lea can't write to memory.

    If you want to copy memory you normally need to go through a register, such as:

    movl (%esi), %eax
    movl %eax, 0x8(%esi)
    
    链接地址: http://www.djcxy.com/p/72378.html

    上一篇: LEA或LOAD整数?

    下一篇: movl和leal指令之间的区别