What is on the 68000 stack when classic MacOS enters a program?

Posted by John Källén on Stack Overflow See other posts from Stack Overflow or by John Källén
Published on 2010-04-30T12:01:11Z Indexed on 2010/04/30 13:37 UTC
Read the original article Hit count: 174

Filed under:
|
|
|

I'm trying to understand an old classic Mac application's entry point. I've disassembled the first CODE resource (not CODE#0, which is the jump table). The code refers to some variables off the stack: a word at 0004(A7), an array of long words of starting at 000C(A7) whose length is the value at 0004(A7), and a final long word beyond that array that seems to be a pointer to a character string.

The array of long words looks like strings at first glance, so it looks superficially like we're dealing with an (int argc, char ** argv) situation, except the "argv" array is inline in the stack frame.

What should a program be expecting on its stack / registers when it first gets called by the Mac OS?

© Stack Overflow or respective owner

Related posts about mac

Related posts about 68000