[A89] Re: aaaaaarrrrrrrgggghhh


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

[A89] Re: aaaaaarrrrrrrgggghhh




I did look thru userlib once to figure out that parameter, but I didn't look
very hard, so I'll do it again and figure it out this time I guess.

Thanks for checking out my code :) I haven't had a chance to work on it for a
couple of days, but the problem lies in the pointer to the next event to call I
think.
gpOldHandler contains a pointer to a pointer... so it points to another pointer
that points to the actual executable code for the next event hook in the chain.
The input constraints: g basically means anything goes data, pointer whatever
(with some limits i think) p means pointer... it is possible to get away with
using g most of the time, but p is much much cooler...

if the pointer that gpOldHandler points to is zero, there is nothing to do.

on a clean (vti) calc it works if I remember right; with an event hook installed
before, it flashes a dialog that says memory or something to that effect... it
doesn't exactly crash the calc, but it is sure unusable! The dialog flashes
every time an event happens in the latter case.

hopefully tomorrow I can go at it again :)
oh! wait... it is tomorrow! (12:21am)!!
Goodnight!
Thanks,
Greg

----- Original Message -----
From: "Scott Noveck" <noveck@pluto.njcc.com>
To: <assembly-89@lists.ticalc.org>
Sent: Friday, June 15, 2001 4:33 PM
Subject: [A89] Re: aaaaaarrrrrrrgggghhh


>
> > p.s. what is the nbitem parameter stored in d2.b in the function
> > userlib::smallmenu?
>
> Judging by the name, it would sound like the total number of items or the
> number of the selected item. . . go find a userlib source and trace it
> through =)
>
> > Also, is it just me or is userlib buggy depending upon ams
> > kernel etc...?
>
> That seems very likely to me, considering how many times userlib has been
> re-written from the ground up by different shell developers.
>
> > asm("
> >  move.l %1,%%a0      /*get the pointer to the next event hook in a0*/
> >  tst.l (%%a0)        /*is it zero ?*/
> >  jbeq FinishUp       /*it was zero so goto FinishUp*/
> >  move.l %0,%%a2      /*Pass the pointer to the event in a2 for TEOS*/
> >  move.l %%a2,-(%%sp) /*Pass the pointer to the event on the stack...*/
> >  jsr (%%a0)          /*Run the event hook*/
> >  addq.l #4,%%sp      /*Restore the stack*/
> > FinishUp:            /*The exit point when there is no event hook to
> call*/
> > "::"p"(ev),"g"(gpOldHandler):"a0","a2");
>
> I hate to say it, but this looks right to me.  Let me transcribe it as I see
> it, and double-check if this is what you intended:
>
> If there is another event hook to go in the "chain," copy a pointer to the
> event to a2 and push it, then call that handler, which reads its input from
> either a2 (TEOS) or the stack (other).  Afterwards, fix the stack and it's
> done.
>
> I'm slightly confused with the input constraints, but I think they're
> correct.  gpOldHandler is a pointer to a function, or a pointer to a memory
> address, and must be dereferenced.  ev is a pointer to data, or the memory
> address itself, and does not need to be dereferenced.  Yeah, that seems
> right to me, although it's confusing.
>
> What exactly happens when you try this?  On top of nothing?  On top of TEOS?
> On top of a "correct" event handler?
>
>     -Scott
>
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




Follow-Ups: References: