The question at strlen in assembly
is about strlen in assembly, but that seems to be written in AT&T syntax, which unfortunately isn’t supported by my assembler.
I’m just curious how would you translate the syntax [eax + ebx] to the intel’s syntax?
So
4(%eax) # offset 4
is equivalent to
[eax + 4]
Suppose the offset value is stored in %ebx.
What’s the equivalence of
[eax + ebx]
?
%ebx(%eax) # doesn't work!
Thanks,
[eax+ebx]should be translated to(%eax,%ebx).The full syntax for memory addresses in AT&T syntax is:
which is equivalent to:
offsetandscaleare constant values, andscalemust be 1, 2, 4, or 8. Defaults are 0 for offset and 1 for scale.