[futurebasic] Re: How do you access globals in an INIT? (2nd try)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 1998 : Group Archive : Group : All Groups

From: Mark Goodes <wave@...>
Date: Tue, 28 Apr 1998 23:27:44 -0400
>The official FB way to get globals is to run into an ENTERPROC. This can
>also accept parameters. It ends with EXITPROC, which can return a value.

Okay, you talked me into it, I'll try and get ENTERPROC% to work.  But
already I'm confused.  I used Macsbug to step through the entry to my
ENTERPROC% and, contrary to the online help, did not see ENTERPROC% saving
the registers--in fact, it doesn't touch the stack at all.  It just seems
to be setting up its own a4 addressing.   Do I have to save the registers
myself from within the ENTERPROC%?

Also, the FB shell uses a double patch (both a head and a tail).  I'd like
to do a head patch only, and not take any values off the stack, since one
of the values in the routine I'm patching is a boolean, and that does not
translate to FB.  I was hoping to do a test patch like this:

"My Patch"
ENTERPROC%
  ` move.l  ^gOldTrapAddr&,-(sp)
EXITPROC%
RETURN

But even this doesn't work.   I'm starting to miss Fantasm...

>If you have more questions please feel free to ask... I've done entirely
>too much of this kind of work... :-)

I really, really, really appreciate this.  Thanks again.

____________
wave (Toronto, Canada)
Much better at "OOPS!" programming than OOP programming.