On 1/6/10, Josef Angstenberger <email@example.com> wrote: > firstname.lastname@example.org wrote: >> How can I use the Program Counter as index if its content is only known >> after compilation? > > The 6502 has also PC relative addresses. But only for its branch > instructions. > > This form of LDA can be used to create relocatable code.... > > 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. The first machine I used that had a full suite of position-independent instructions was the PDP-11. I'd been programming the 6502 for about 5 years at that point and I was amazed at what you could get away with when your code wasn't nailed down to the address map (like multiprocessing/multiuser - MMUs are handy, but they just make things pretty and safe - PIC instructions make it possible in the first place if you can't make each process think it owns 0000000 and up). -ethan Message was sent through the cbm-hackers mailing listReceived on 2010-01-07 01:00:24
Archive generated by hypermail 2.2.0.