This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
SH: PC-relative addressing
- From: "Clarke, Stephen" <stephen dot clarke at superh dot com>
- To: <binutils at sources dot redhat dot com>
- Date: Tue, 27 Aug 2002 17:17:05 -0700
- Subject: SH: PC-relative addressing
We've recently had a problem reported when porting some
SH assembly language from the Hitachi assembler to gas.
Consider the following assembly language:
MOVA @(0x7f*4,PC),R0
the Hitachi assembler assembles this into c77f, whereas
gas assembles it to c77e.
I think the difference comes down to whether you interpret
the "PC" in the addressing mode as meaning the contents of
the register called "PC" (which is what the Hitachi assembler
does), or as the current location counter (which is what
gas does).
I suspect that gas used to follow the Hitachi assembler
behaviour, until it was changed as a result of the
discussion beginning at:
http://sources.redhat.com/ml/binutils/2002-01/msg00678.html
Although I'm reluctant to disinter that decision, we do need
to provide our users with a good reason why gas behaves
differently to Hitachi's assembler, and I'm struggling to
find one.
So ... if I were to submit a patch that restores the
original gas behaviour (and thus makes it compatible with
Hitachi's assembler), would the maintainers consider that an
acceptable change? Or is the current behaviour preferable?
Steve.
--
Stephen Clarke, Principal Engineer, SuperH Inc.
Phone:1-408-273-3146, Fax:1-408-273-3199, mailto:Stephen.Clarke@superh.com
Mail: SuperH Inc., 405 River Oaks Pkwy, San Jose, CA 95134, USA.