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,@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
_______________________________________________
Simh mailing list
[email protected]
http://mailman.trailing-edge.com/mailman/listinfo/simh