Blitz (104/119)

From:David McMinn
Date:23 Jun 2001 at 17:16:43
Subject:Re: cia timing

On 23 Jun 2001, at 15:08, Thilo Köhler wrote:

> 2. To make Blitz commands & variables work, you have to fill the registers
> a4, a5, a6 & d7 with blitz-specific data as the blitz

I don't think you need d7, and you only need a4 if you are working inside
a function. I think it is also a good idea to preserve a3 which Blitz
uses as a string buffer of some kind.

> That means you have to save their contents anywhere in RAM and
> when the interrupt is called you have to write this data back to
> the registers before you use any blitz stuff.

> I have never tried this, but it should work. There is also
> an example in Aminet how to use Blitz Commands
> within hooks, this must be the same thing.

Yes, it works if you do something like this:

; Start of main prog
move.l a5,globbase

...

> > .Interrupt
> > MOVEM.l a0-a6/d0-d7,-(a7) ; save register
> > MOVE.l globbase(pc),a5 ; Global variable base
> > test=test+1
> >
> > MOVEM.l (a7)+,a0-a6/d0-d7 ; restore register
> > RTS
> > globbase: ds.l 1

|) /\ \/ ][ |) |\/| c |\/| ][ |\| |\| | dave@blitz-2000.co.uk
http://members.nbci.com/david_mcminn | ICQ=16827694

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie