On Wed, 6 Jan 2010, ruud.baltissen@apg.nl wrote: > Hallo allemaal, > > > In between other projects I try to improve my "MP-ASM", Multi Processor > Assembler. Momentary it supports the 6502 and various variants, the Z80 > and the 6800. I'm busy with the 6809 (used in the SuperPET so 'on > topic') and ran into an addressing mode I don't understand: xx,PCR or > [xx,PCR]. It's called "Constant Offset from PC". It is equivalent to > xx,X / [xx,X], which is more or less equivalent to xx,X / (xx,X) for the > 6502 (because xx can be 16 bits as well). > > What I don't understand is how it can be used. I mean, if I want to load > something I would use: > > LDA Label1 > .... > LDA [Label2] > > 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 SuperPet 6809 Assembler manual does not say much about this addressing mode other than it is a form of indexed adressing. The only thing I can think of is a jump table located inline in the code. Potentially, for an error jump after a subroutine call, using xx as an index into the jump table. wlevak@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org Message was sent through the cbm-hackers mailing listReceived on 2010-01-07 00:00:03
Archive generated by hypermail 2.2.0.