4 ms·
> EAX is not available in addresses. Is this a relevant correction? If there is a point, ignore the following. You seem to like the ATT syntax, which I avoid
by xscott 4y ago
> EAX is not available in addresses.
Is this a relevant correction? If there is a point, ignore the following.
You seem to like the ATT syntax, which I avoid whenever I can. However, if there isn't a specific point, and we're just being pedantic or having a pissing match, copy the following:
mov rbx, [rax + 4*rax]
mov rbx, [eax + 4*eax]
movss xmm0, [rax + 4*rax]
movss xmm0, [eax + 4*eax]
into https://defuse.ca/online-x86-assembler.htm https://defuse.ca/online-x86-assembler.htm with the x64 option enabled. Your original example had float, so I included that as well. They all assemble, and the difference is in the REX prefix.
I haven't looked at it in a few years, and I've forgotten a lot of details, but I wrote my own x86-64 assembler for fun. And of course, like most assemblers, I improvised my own syntax and naming convention. In particular, I didn't make a distinction between EAX and RAX (or AX or ALO). To me, it's just register A, and I gave the opcodes more descriptive names to indicate the bit width.
I figure if gas can do something like ATT syntax, I can do my own my way.