I'm using intel syntax with GNU AS as I'm used to X86 assembler from back in the day and I make less mistakes than I would with the AT&T syntax. Back in the 16 bit days, an instruction like:
mov ax, [bx]
would move the byte pointer at bx into ax. Some assemblers had overrides on this asssumption, normally with a directive. Now that I'm using 32 bit assembly, almost every line is:
mov eax, dword ptr [bx]
Is there any way to make that the default or do I live with "dword ptr" all over the place? I do realise that I could go AT&T and have movl and movq etc...
nasm
instead? AFAIK it can produce object files that are compatible with gcc/ld. – Michaelmov eax, [ebx]
will usedword ptr
automatically. – Jesterdword ptr
in your example is redundant. The target register already defines the size. In MASM the size directive is only required when the size cannot be inferred, as in e.g.push dword ptr []
. – 500 - Internal Server Error