[A89] Re: aaaaaarrrrrrrgggghhh


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

[A89] Re: aaaaaarrrrrrrgggghhh




wahooooo!!!!!! I got it to work!!!
I never did get the other code to work, but then I tried this... BINGO! In hind
site, I think that the other code was not calling the correct event hook... I
noticed that it just seemed to call itsself over and over... but with a few
twists when i traced it to see exactly what was happening.
Would someone please tell me if this new code looks correct? The first time I
tried it, I forgot to push and pop the event off of the stack and it worked just
fine... but that was probably because the event just happened to be on the stack
in the correct place?

Thanks,
Greg



//get the address of the next TSR in line to be executed NULL if there is none
  (unsigned long*)OldHook=*((unsigned long*)gpOldHandler);

//Call the old hook if there is one to be called
  if(OldHook)
   asm("        /*This inline asm takes the place of OldHook(ev);
              the difference is that a2 will also contain ev
              as a parameter to support TEOS. Without this code,
              you would need to use the switch -ffixed a2 when
              compiling this example.*/
   move.l %0,%%a2   /*TEOS expects the parameter to be in a2*/
   move.l %%a2,-(%%sp) /*other event hooks expect it on the stack*/
   move.l %1,%%a0   /*Get the address to call*/
   jsr (%%a0)     /*Call the next event hook*/
   addq.l #4,%%sp   /*restore the stack*/
   "::"p"(ev),"g"(OldHook):"a0","a2");


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




Follow-Ups: References: