This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

Re: m68k - Dropping the Motorola syntax


Jamie Lokier <jamie@shareable.org> writes:

> No, it also appears in C extended asm statements.  I'm not quite sure
> whether this can ever happen with the m68k syntaxes, but consider this
> C source:
> 
> 	int global_magic_pointer __asm__("a0");
> 
> 	// Later...
> 	__asm__ ("move.l (a0)+,%0" : "=rm" (tmp) : : "a0");
> 
> If the %0 is emitted with the wrong syntax, the asm statement would no
> longer compile and assemble even if GAS supports both syntaxes --
> unless GAS supports mixing syntaxes within a single statement.

gas does support mixing the two syntaxes within a single statement.
The syntaxes are only different in the various fancy addressing forms.
They are uambiguous, because MIT syntax always includes an '@'
character, and Motorola syntax never does.  (I ignore the case of the
'@' in special reloc markers like @PLTPC, because they can only occur
on symbol names, not on extended addressing forms, and thus are the
same for both syntaxes.)

(Your example, of course, uses Motorola syntax, which I guess is the
one which people think should be retained.  I suppose if one is going
to be retained, it should be that one, since that is the one which is
usually documented.)

Ian


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