Re: A86: (sqrt) KEY questions


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

Re: A86: (sqrt) KEY questions




Dux Gregis wrote:

> $4c3f increments ahl twice.  We need to do this because when we get bde
> and switch it to ahl, we are pointing to the token ($8e28) and we want
> to point instead to the start of the code.  It beats me why we have to
> define the token at the beginning of our code and also skip over it (it
> seems like you would have the token twice), but it crashes if you don't.

Aren't you skipping past the size bytes or checksum or something, rather than the
token?  have you ever looked at (AHL) with the emulator?

> > Now when you in the code: itself, why do you pop OP1 and is that all that
> > $479f does?
>
> Yeah, when [sqrt]KEY is called from page $0d with _exec_assembly.  It
> pushes op1 and never pops it again.  So, if we don't pop it, the prog
> will crash.

Could someone that understands the FPS really well please post a good description
of it, rather than just the call addresses?  Things such as:when is it used?
what do all the FPS calls do (in detail)?
how does it work?
etc.....

> > Plus, what was it that put the a in $d625 which you seem to get the keypress
> > from.
>
> _exec_assembly.  It saves the registers in RAM around there so that they
> can be read from the module (see Ram86.inc).  We can just return the key
> press in a though, without having to put it back: the calling routine
> will automaticly inherit our registers/flags.

Is that how all of the sqrt programs are run?  Is it the same method that pat
described in the asm modules docs?

> > Weirdness
>
> You should see where it's called from.  It looks like TI used that pop
> hl idea and put three pop hl instructions in a row ... it's impossible
> for me to trace the program counter like that.   Zut.

A good idea for the emulator would be to include a log of PC.  Even just a window
that you can pop up that shows what the PC was before it was what is was when you
broke (i.e. if at rom location $0123 there is a jp $D748, you have no idea where
it was called from because it was a jp - this would tell you that the PC was
previously at $0123.)

--
Stephen Hicks
mailto:shicks@mindspring.com
ICQ:5453914
IRC/AIM:Kupopo
Hopemage:http://www.mindspring.com/~shicks/



References: