From: | Olaf Barthel |
Date: | 11 Aug 2000 at 22:12:56 |
Subject: | Re: OM_NEW (was: Re: BOOPSI again & again) |
On Aug 07 Allan (Allan Odgaard) wrote:
> On 07-Aug-00, Ilkka Lehtoranta wrote:
>
> > By the way... when programming MUI custom class in
> > assembler I found out that I can't trash a register A2
> > before calling DoSuperMethod(). I'm wondering why it
> > is required to save A2 if there is no even instance
> > data? Or is there something else?
>
> A2 is the object pointer, but during OM_NEW it's AFAIK used to hold a
> pointer to the class structure.
> So if you trash this, the boopsi rootclass won't be able to create the
> object (even though it could just use A0) -- I don't know why it's like
> this, maybe Olaf could give us some background info?
It made it easier to implement the whole thing. For example, the
stub code that implements DoMethod(), DoSuperMethod(), etc. is specially
tuned to make optimal use of registers and stack. A little weird, but
the registers and how they are used helped to make that stub code
simpler.