10

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

For example:

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

1 Answer 1

15

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 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.