[Coco] 6309's FSWI

tim lindner tlindner at macmess.org
Fri May 3 13:16:08 EDT 2013


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



More information about the Coco mailing list