[Coco] 6309's FSWI
Luis Antoniosi (CoCoDemus)
retrocanada76 at gmail.com
Fri May 3 21:15:08 EDT 2013
Since V is not an immediate value you can run two different codes
concurrently doing the switch from time to time.
On Fri, May 3, 2013 at 6:35 PM, Darren A <mechacoco at gmail.com> wrote:
> What is the benefit of using this over JSR/PULS? In native mode, two
> EXG instructions along with the PSHS and PULS in the subroutine would
> take 18+ cycles. An extended JSR along with a PSHS and a PULS
> (including PC) would take 17+ cycles.
>
> If there are no registers to preserve then the EXG method would save 1
> cycle over a JSR/RTS in native mode, but would be 3 cycles slower in
> emulation mode.
>
> Darren
>
>
> On Fri, May 3, 2013 at 11:16 AM, tim lindner <tlindner at macmess.org> wrote:
> > I was thinking today about the 6309's V register. I decided you could use
> > it to make a "Fast Software Interrupt" instruction.
> >
> > So the idea is you have a subroutine that will be called often, but you
> > don't want to inline. You would put the address of the subroutine in V
> and
> > EXG V,PC to call it.
> >
> > The routine would stack any registers it uses, perform the function, the
> > unstack the registers and then EXG V,PC to return to the main program.
> You
> > would save one additional register stacking because you wouldn't use V
> for
> > any other purpose.
> >
> > You could also achieve something like self-modifying code by changing
> the V
> > register to point to alternative subroutines.
> >
> > --
> > tim lindner
> >
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > http://five.pairlist.net/mailman/listinfo/coco
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>
--
Long live the CoCo
More information about the Coco
mailing list