Re: 6809 assembly knowledge needed

From: Josef Angstenberger <ml_at_jtxa.de>
Date: Thu, 07 Jan 2010 01:47:23 +0100
Message-ID: <4B452F1B.7090005@jtxa.de>
ruud.baltissen@apg.nl wrote:
> How can I use the Program Counter as index if its content is only known
> after compilation? The only thing I can think of is that you can program
> a piece of code that loads something from a table and both code and
> table have to be relocatable on the fly.

The 6502 has also PC relative addresses. But only for its branch
instructions.

This form of LDA can be used to create relocatable code. Just like the
branch instructions are used instead of JMP in some 6502 programs.

According to http://en.wikipedia.org/wiki/6809 this was one of their
design intention:
Since a CPU designer could hardly guarantee where this code would be
located in a future system, the 6809 design focused heavily on support
of position-independent, reentrant code that could be freely located
anywhere in the memory map.

Josef

       Message was sent through the cbm-hackers mailing list
Received on 2010-01-07 01:00:19

Archive generated by hypermail 2.2.0.