[comp.sys.mac.programmer] Assembly and instance variables

puklich@plains.UUCP (Blayne Puklich) (03/26/90)

Does anyone have an idea how to access instance variables of objects from
assembly language?  Here's my full story.

I'm currently doing some programming using THINK C and TCL for a graphics
class.  I have implemented Bresenham's line drawing algorithm as an object
that knows how to draw itself, and has as instance variables its endpoints.
All fine and dandy, but I have one problem: Quickdraw stomps the p*ss out of
me, and it should.  I get line speeds of about 20 inches per second, while
Quickdraw comes in anywhere between a conservative (!) 800 ips and several
thousand.

So, being as shifty as I could, I thought I'd reimplement it in assembly
language.  But, while I was playing with it, I found that for some reason,
the THINK C assembler wouldn't let me access the endpoint instance variables.
I tried the normal methods (this->x1, just x1, etc.), but no go.  I can't
seem to find it in the manual, either.  Maybe I'm blind.

My question then is, how can I get at these?  Right now I have worked around
it by having the draw method, which can access the instance variables, set
up a call to the assembly function, but this isn't really how I want to do
it.

Many thanks in advance to anyone who helps.

||+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++||
|| Blayne Puklich       puklich@Plains.NoDak.EDU     "I think I'm going    ||
|| NDSU ACM Vice-Chair  nopuklic@Vaxosaur.NoDak.EDU     bald..."           ||
|| NDSU, Fargo, ND                                    -- Rush, from Caress ||
|| (701) 237-4408               Hi mom!                  of Steel, 1975    ||
||-------------------------------------------------------------------------||