This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ia32 suffix inconsistency


Hello,

Just a small detail I think I have to report, with:
GNU assembler (GNU Binutils for Debian) 2.20.1-system.20100303
This assembler was configured for a target of `i486-linux-gnu'
It is not a regression, i.e. same behaviour for years.

We have to postfix 'l' (or 'w' or 'b') when using a simple 'mov' or 'test':
$ echo 'mov $1,(%ebx)' | as 
{standard input}: Assembler messages:
{standard input}:1: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
$ echo 'movl $1,(%ebx)' | as
$ echo 'test $1,(%ebx)' | as
{standard input}: Assembler messages:
{standard input}:1: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
$

but other instructions like and/cmp/xor/or should also need such suffix, isn't it?
$ echo 'and $1,(%ebx)' | as 
$ echo 'cmp $1,(%ebx)' | as 
$ echo 'xor $1,(%ebx)' | as 
$ echo 'or $1,(%ebx)' | as 

I am not sure for 'or' because the access length may be optimised by the
size of the constant, but then the 'test' should be the same.
Note that optimising 'orl $0,(%ebx)' to 'orb $0,(%ebx)' is incorrect
because the zero flag is not set in the same conditions, same for
an 'xor' with any constant value.

Regards,
Etienne.





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]