[A89] Re: aaaaaarrrrrrrgggghhh
[Prev][Next][Index][Thread]
[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
Follow-Ups: