3 ms·
> They are using a classic dollar sign for assignment They're using a dollar sign for immediates. As if you can't notice that it's a number. addl $4, %ea
by masklinn 4y ago
> They are using a classic dollar sign for assignment
They're using a dollar sign for immediates.
As if you can't notice that it's a number.
addl $4, %eax
that's 3 different completely unnecessary symbols for things which are not ambiguous in the first place:
- the operation width is provided by the registry
- a number is an immediate
- a register is named
Hence the much less noisy Intel syntax:
add eax, 4
- matja 4y agoaddl is not necessary if it is not ambiguous add $4, %eax - is fine Compare with add 4, %eax The "less noisy" Intel syntax becomes: add eax, DWORD PTR [4]
- __init 4y agoMost assemblers for Intel syntax will let you write: add eax, [4] if you desire. Indeed, many disassemblers will follow suit in unambiguous cases. IDA, for example, does this.
- colejohnson66 4y agoThe only time “DWORD PTR” is required is when (1) you're working with old assemblers, or (2) you're using a memory operand with an immediate: add eax, [4] ; inferred add [eax], 4 ; ambiguous add DWORD [eax], 4 ; explicit A disassembler may output it when not necessary, however.
- docandrew 4y agoThe comma is unnecessary too, so that’s 4 unneeded symbols.