What does a comma in a parenthesis mean in the AT&T syntax for x86 assembly?

大兔子大兔子 提交于 2019-11-26 22:07:19

问题


What does (register1, register2, 4) mean in AT&T assembly?

For example:

cmp %eax, (%esi, %ebx, 4)

回答1:


The complete AT&T base/index register syntax is:

offset(base, index, multiplier)

Your offset field is 0, so you just have the (base, index, multiplier) part. In your case, you're comparing the contents of the eax register to the 32-bit value located at esi + (ebx * 4).

In the Intel syntax you might be more familiar with, this would be written as:

cmp [ebx*4 + esi], eax


来源:https://stackoverflow.com/questions/18650093/what-does-a-comma-in-a-parenthesis-mean-in-the-att-syntax-for-x86-assembly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!