This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Behaviour of i386 add instruction changes based on operand
- From: Ian Lance Taylor <iant at google dot com>
- To: binutils at sourceware dot org
- Date: 07 Dec 2006 13:44:23 -0800
- Subject: Behaviour of i386 add instruction changes based on operand
Assemble this i386 source:
add $1, 0(%edx)
add $128, 0(%edx)
I get this:
foo.s: Assembler messages:
foo.s:2: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
The instructions do generate different opcodes (0x80 vs. 0x83). When
adding a constant to memory, if the operand is a sign extended 8-bit
value, we default to addl. If the operand is something else, we have
no default. That seems inconsistent. Is this a bug or a feature?
Ian