[comp.sys.mac.programmer] jGNEfilter question

mikeoro@hubcap.clemson.edu (Michael K O'Rourke) (10/30/89)

I am trying to create a init which will patch getnextevent using the jGNEfilter
documented in the tech notes.  It mentions that a pointer to the event
record is in register A1.  I tried some assembly in LSC to move the
address to a local variable, but am having problems.


The code i tried was :

Eventrecord *theEvent;

	asm {
		move.l theEvent,A1
	}

When i check theEvent, there is NEVER a mouseDown or mouseUp.  (I had a sysbeep
in).  I don't really know assembly, so could someone tell me what is wrong
with what i am trying to do?  How can i properly get to the eventrecord
so that i may change or modify its contents?

Michael O'Rourke

chewy@apple.com (Paul Snively) (10/31/89)

In article <6901@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K 
O'Rourke) writes:
> It mentions that a pointer to the event
> record is in register A1.  I tried some assembly in LSC to move the
> address to a local variable, but am having problems.
> 
> 
> The code i tried was :
> 
> Eventrecord *theEvent;
> 
>         asm {
>                 move.l theEvent,A1
>         }
> 
> When i check theEvent, there is NEVER a mouseDown or mouseUp.  (I had a 
sysbeep
> in).  I don't really know assembly, so could someone tell me what is 
wrong
> with what i am trying to do?  How can i properly get to the eventrecord
> so that i may change or modify its contents?

Oops.  Try "move.l A1,theEvent".  In other words, you got the parameters 
to the move instruction reversed.

Don't feel badly; this was a big stumbling block on the 680x0 to me for a 
long time, since I moved to this family from the Z-80!  (Anyone else here 
remember the mighty Z-80)?

__________________________________________________________________________
Just because I work for Apple Computer, Inc. doesn't mean that they 
believe what I believe or vice-versa.
__________________________________________________________________________
C++ -- The language in which only friends can access your private members.
__________________________________________________________________________

allbery@NCoast.ORG (Brandon S. Allbery) (11/01/89)

As quoted from <4952@internal.Apple.COM> by chewy@apple.com (Paul Snively):
+---------------
| long time, since I moved to this family from the Z-80!  (Anyone else here 
| remember the mighty Z-80)?
+---------------

Yup; it was the first processor I worked with (the second being a 6502 on an
OSI Superboard II, the third being the 68000 on "ncoast" revisions 1-4).

++Brandon
-- 
Brandon S. Allbery:  allbery@NCoast.ORG, BALLBERY (MCI Mail), ALLBERY (Delphi)
uunet!hal.cwru.edu!ncoast!allbery ncoast!allbery@hal.cwru.edu bsa@telotech.uucp
*(comp.sources.misc mail to comp-sources-misc[-request]@backbone.site, please)*
*Third party vote-collection service: send mail to allbery@uunet.uu.net (ONLY)*
>>>	 Shall we try for comp.protocols.tcp-ip.eniac next, Richard?	    <<<