[Simh] PDP-11 GCC cross-assembler... posible bug... or is just me?

Johnny Billquist bqt at softjar.se
Thu Aug 16 16:00:25 EDT 2012


On 2012-08-16 20:49, Jordi Guillaumes i Pons wrote:
> Hi list,
>
> I've jumped into what seems to be a bug in the gnu binutils assembler.
> I've already submited a report:
>
> http://sourceware.org/bugzilla/show_bug.cgi?id=14480
>
> To cut the story short, the assembler does not trigger deferred indirect
> mode unless the index is specifically written in the instruction. So
> this instruction:
>
>      JSR    PC,@(R0)
>
> Assembles exactly equal that this one:
>
>      JSR    PC,(R0).
>
> If the source code is:
>
>      JSR    PC, at 0(R0)
>
> then the assembled code is correct.
>
> The problem with this bug (if it is really a bug) is the gcc compiler
> generates the incorrectly handled instruction if you try to use a
> function pointer table and enable size optimization (-Os option).
>
> The other possibility is I'm not understanding at all the PDP-11
> addressing modes and the assembler is working as it should do... Could
> anyone enlighten me about this?

Well, using the DEC notation for PDP-11 assembler language, @(R0) and 
(R0) are indeed two different things, and you seem to have understood it 
perfectly right.
Not sure if gas might have its own ideas about notation though...

	Johnny




More information about the Simh mailing list