Re: A86: Re: rom calls


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

Re: A86: Re: rom calls




I just did some disassembly and found that $496F (basically) pops a number off the
stack, then it grabs 3 bytes from the address, pushes back the same number it
popped, but with the lower byte changed to the rom page that was active when it
was called, then it pushes $28F0, and then it switches to the page given by the
3rd byte it grabs and jumps to the address given by the 1st two bytes it grabbed.
Anyone have any idea why this is useful?

When the rom calls it (directly from page 3-call $28CB, which is the same thing
that $406F does from D), The number it grabs off the stack is $3108, and at that
location is $598F, and then $0D for the rom page.  At this location, it pushes OP1
and then runs sqrtPARSE...

Stephen Hicks wrote:

> that's where i got them in the first place,,,  actually, the first one calls
> the 3rd...  and i don't think that the 2nd one rets normally.  they're called
> in between the normal parser and when (sqrt)PARSE is called.  $496F screws
> around with the SP a lot.  I've found where you need (i think) to jr or ret to
> after (sqrt)PARSE to get back to normal parsing, but i've tried it and it
> always screws up.  This is how it works: (on page 3) at $5845, it checks if
> the flag for sqrtPARSE is set.  If it doesn't, then it jumps aherad to $5851
> and continues as normal.  Otherwise, it calls $3105, which calls $28CB (which
> is also called from $496F on rom page $D).  I don't think it returns as
> normal, as it screws all around with SP, and it ends up retting to $598F on
> page $D, which pushes OP1 and then checks if (sqrt)PARSE exists.  If it
> doesn't, it jumps to $59AC, otherwise, it calls execasm (i think).  Also, by
> the time all of this is started, the command line has already been tokenized
> into '#'.
> I've tried jumping back to different locations (suck as $59AC and $5851 (on
> the proper pages) but it never works correctly)  Anyone have any ideas?
>
> Trey Jazz wrote:
>
> > the first loads (de) into a and rst $38s, the others branch off into a lot
> > of calls (didnt look through them all). use the emu to look at it
> >
> > >Does anyone know what any of the following rom calls do?
> > >
> > >$4813
> > >$496F
> > >$4787
>
> --
> Stephen Hicks
> mailto:shicks@mindspring.com
> ICQ:5453914
> IRC/AIM:Kupopo
> Hopemage:http://www.mindspring.com/~shicks/



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



Follow-Ups: References: