Unsure how to work with mov (a,b,c),d

后端 未结 1 1077
轻奢々
轻奢々 2021-01-24 04:02

What is mov doing here?

mov(%ebx,%eax,4),%eax

I\'ve seen mov used to transfer a value from one function to another, but I\'m not sure how to ha

相关标签:
1条回答
  • 2021-01-24 04:37

    segment:displacement(base register, offset register, scalar multiplier) [in AT&T syntax is equivalent to] segment:[base register + displacement + offset register * scalar multiplier] in Intel syntax. (source)

    So mov(%ebx,%eax,4),%eax is equivalent to mov eax, [ebx + eax*4]. That is, form an address by ebx + eax*4 and load a doubleword from that address into eax.

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