[Coco] 6309 Weirdness ??

Darren A. darccml at hotmail.com
Wed May 16 12:30:16 EDT 2007


>From: Robert Gault
>Subject: Re: [Coco] 6309 Weirdness ??
><snip>
>
>To remove any effects from EDTASM the following code was assembled
>  ORG $7000
>START LDX #-3
>  ORCC #$50
>  ADDR X,PC
>  RTS START
>This when executed, immediately came back to the Basic prompt OK. Same 
>thing happened with LDX #-4. This opcode ADDR X,PC seems to have been 
>ignored. Change the RTS to SWI with the code run from Basic caused a system 
>crash. This seems to comfirm that ADDR X,PC was skipped as Basic does not 
>like SWI in this context.
>
-
Robert,

On a real 6309, if I use -3 as in your example above, the PC register is set 
to point back at the second byte of the ADDR instruction which is $30 
(LEAX). The third byte ($15) means it executes an LEAX -11,X and then 
proceeds to the RTS instruction.

In my experience, when -4 is used, the loop runs forever if interrupts are 
masked. If interrupts are enabled then the first IRQ, upon RTI, resumes 
execution at the address preceding the ADDR instruction.

Darren

_________________________________________________________________
PC Magazine’s 2007 editors’ choice for best Web mail—award-winning Windows 
Live Hotmail. 
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_pcmag_0507




More information about the Coco mailing list