[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] Program start up
Hi Lonny,
On 26 Apr 2009 at 4:25, Lonny Pursell wrote:
>
> I spent some time looking through the cvs files as did Pep for some info
> regarding program startup. I know 4(sp) points to the basepage, and a0
> points to a basepage if it's a desk accessory. Pep had some other info:
>
> a6 holds a copy of the stack
> a5 points to the data segment
> a4 points to the bss
>
> However, we could not find anything to verify these. Anyone know where to
> look in the CVS? Or a doc somewhere? Or just don't rely on these? :)
>
AFAIK, the only things you can rely on when you receive control (i.e. at the
first byte of the text segment) are:
1) if a0 is non-zero, you are being called as a DA. a0 points to the program
basepage; otherwise
2) you are being called as a program and 4(sp) points to the basepage.
You can get the address of the bss & data segments from the basepage.
Regards,
Roger