[Coco] Solution to switch between 6809 and 6309

Darren A mechacoco at gmail.com
Sun Jun 14 17:04:24 EDT 2015


On Sun, Jun 14, 2015 at 2:30 PM, Arthur Flexser wrote:

> Bill, I agree with you about there being no need to switch back and forth
> between 6809 and 6309, but I'd put compatibility at more like 99.9%.  I
> once did receive a Basic program that turned out not to work right on
> account of my having a 6309 installed.  The author, who was not an assembly
> language programmer, used an EXEC he found listed in some handy guide
> somewhere.  It jumped into the middle of a ROM instruction, and worked okay
> with a 6809 because the first byte executed was an illegal opcode and was
> therefore ignored by the 6809 under which the program was developed.  But
> when I tried the program with a 6309, the 6309 vectored the illegal opcode
> to its error handler address, which hadn't been initialized, and the
> program crashed.  So, no 101% compatibility, or even 100%.   But close.
>


Another situation I have seen is where one of the invalid register
encodings has been intentionally used with the TFR instruction.  This
undocumented "feature" can be used on a 6809 to load the value $FF into the
DP resgister without having to use A or B as an intermediate.  Running the
same code on a 6309 will have different behavior since all of the encodings
are valid on that CPU.

- Darren


More information about the Coco mailing list