[Coco] 6309 Weirdness ??
Robert Gault
robert.gault at worldnet.att.net
Wed May 16 18:25:22 EDT 2007
Darren A. wrote:
><SNIP>
> Probably best to avoid using the PC register with these instructions
> unless interrupts are masked.
>
It is probably best to avoid using code that modifies itself in the
middle of an instruction regardless of interrupts. The glitches you have
found with PC probably should constitute illegal instructions but the
6309 is not doing that.
If your examples were desirable code, there are other ways to get
correct results using opcodes that are known to work. For addr x,pc use
something like leax x,pcr tfr x,pc
I believe you don't have any intentions of using instructions like addr
x,pc but rather won't to be sure that assemblers/disassemblers function
correctly. That being the case, you are doing a great job of finding
6309 bugs.
Here is an equivalent "bug" in the 6809. Experiment with leax 0,pc(r)
with different assemblers and see what the 6809 actually does. The
expected result would be that regX gets the address of the next instruction.
More information about the Coco
mailing list