Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!cadence!cadence.com!bammi From: bammi@acae127.cadence.com (Jwahar R. Bammi) Newsgroups: comp.sys.atari.st.tech Subject: Re: Deskaccs with GCC Message-ID: Date: 21 Dec 90 17:22:05 GMT References: <2666@charon.cwi.nl> Sender: usenet@cadence.com (USENET News) Organization: Cadence Design Systems Lines: 44 In-Reply-To: waal@cwi.nl's message of 10 Dec 90 12:12:53 GMT In article <2666@charon.cwi.nl> waal@cwi.nl (Peter de Waal) writes: > compiling: > > gcc -o foo.acc foo.c -lgem > > does not seem to work, since my ST then just reboots when it tries > to load the accessory. I assume that for accessories I need a different > startup module (?). Can anybody tell how to do this (I don't see accessories > mentioned at all in the GCC docs). the gcc startup automatically detects if a program is being run as an ACC, but you have to help it a little bit with its stack+heap area. the convention is that the user has to set two variables: _heapbase to the botom of the stack+heap area _stksize to the size of this area here is an example: define the following global variables in your file, adjusting the size as appropriate. char _stack_heap[1024]; void *_heapbase = (void *)_stack_heap; long _stksize = sizeof(_stack_heap); main() { /* whatever */ } at startup then, the stack will be set at the top of this area, and the heap at the bottom, and the two grow towards each other. You can do malloc()'s from this area in your ACC (notice malloc() and not the tos's Malloc()). cheers, -- -- bang: uunet!cadence!bammi jwahar r. bammi domain: bammi@cadence.com GEnie: J.Bammi CIS: 71515,155