[A83] Re: A couple of questions


[Prev][Next][Index][Thread]

[A83] Re: A couple of questions




> 
> 1) I haven't looked into this, but I would imagine that bcall probably
> works
> something like this:
> BCALL = #define bcall(xxxx) rst 28h \ .dw xxxx
> 
> The RST 28h tells the calculator to call memory address 28h.  I imagine
> that
> the calculator would pop off a word from the stack to find where the RST
> was
> called, get the word directly after the RST (the .dw xxxx) and push the
> return address back onto the stack.  I know the calculator has a "jump
> table", if you will, of 2 byte offsets and 1 byte rompages (each set being
> 3
> bytes, then)  The word would point to one such pair, find out what rompage
> the routine is on, swap it, call the offset, swap the rompage back and
> return.  At least I'm guessing thats something like how it works =P  If
> anyone knows better, feel free to illuminate me.
> - - Joe
> 
> joe@joepnet.com
> 
> 

That is indeed the general idea. It also has to take care of swapping
rompages,
preserving registers, and some other house keeping stuff, making the routine
in
fact quite large (and slow, I believe somebody once said 500+ cycles).
The purpose of the B_CALL routine is to allow code in page 1 ($4000-$7FFF)
to
call routines which get swapped in at page 1, using an "index" which is
swapped
into, you guessed it, page 1.
And their was light :)

Rob van Wijk

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net




References: