[Coco] 6309 Weirdness ??

Darren A. darccml at hotmail.com
Wed May 16 22:01:22 EDT 2007


>From: Robert Gault
>
>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.

Not quite sure what you mean by code that modifies itself. Changing the 
value of PC does not modify any code. If your'e referring to jumping into 
the middle of an instruction, then I agree that you would usually want avoid 
that (unless you have a specific reason otherwise).

>
>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.

My purpose is not for writing any specific code, but to try and figure out 
the exact details of how these instructions actually work.

>
>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.
>

That's not realy a bug in the 6809; it's about different assembler 
implementations. There seems to be a difference of opiniion on how to 
interpret non-label offsets in PCR indexed operands (as an offset value or 
as an address).

Anyway, I'm just having fun learning about the workings of the 6309.

Cheers,
Darren

_________________________________________________________________
Like the way Microsoft Office Outlook works? You’ll love Windows Live 
Hotmail. 
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_outlook_0507




More information about the Coco mailing list