[Coco] 6309's FSWI
William Astle
lost at l-w.ca
Fri May 3 13:37:25 EDT 2013
On 13-05-03 11:16 AM, tim lindner 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.
This seems like one of the more useful things that have been proposed
for using V. Since V is only accessible through the inter-register
operations (tfr, exg, subr, etc.), it's not terribly useful. It can't
even be stacked directly and is not saved by regular interrupts either.
More information about the Coco
mailing list