[comp.sys.atari.st] Sozobon Compiler and Accessories - Help!

dkhusema@immd4.informatik.uni-erlangen.de (Dirk Husemann) (07/06/89)

	Hi!

	I'm having a little (;-) problem with the Sozobon compiler and
accessories. I didn't get all the stuff distributed with Sozobon compiler
sometime in the past - namely, none of the sources but all of the rest - I
think ;-). Thus, it might be due to the missing parts that I have the following
problem:

	When compiling a GEM program which is supposed to run as an accessory
and starting it as MY.PRG it'll start and run correctly. When installed as
MY.ACC my system will crash when booting. I am aware of the fact that the
event handling of a .PRG and a .ACC have to be different and have taken care
of that. By using printf's I found out that the program when run as an accessory
won't even enter main().

	My suspicion is that the dstart.o module frees memory prior to calling
_main() which shouldn't be done for an accessory (according to the docs I have
access to ...).

	Now - is there a different module available for compiling accessories?

	Would a construction like
	
		lea	#stackend, sp
		jsr	_main
		jmp	_exit

		stack:	.DS.w	2000
		stackend:

make it work?

	If there is a module available for compiling accessories could a kind
soul *please* mail it to me????

	Also, if I'm missing something could anyone tell me?

	Thanks,
		Dirk Husemann

------------------ Smile, tomorrow will be worse! --------------
Email:	dkhusema@immd4.informatik.uni-erlangen.de
Or:	{pyramid,unido}!fauern!faui49!dkhusema
Mail:	Dirk Husemann, Aufsess-Str. 19, D-8520 Erlangen,
(Home)	West Germany
(Busi-	University of Erlangen-Nuremberg, Computer Science Dep.,
ness)	IMMD IV, Martensstr. 1, D-8520 Erlangen, West Germany
Phone:	(Home) +49 9131 302036,	(Business) +49 9131 857908
-- Beam me up, Scotty, there's no intelligent life down here! --
--------------- My opinions are mine, mine, mine ---------------

uace0@uhnix2.uh.edu (Michael B. Vederman) (07/08/89)

Here is a little known secret, which you are apparently 'starving' for.

A 'program' can be run as an accessory or a program, but of course, you must
be able to tell whether or not you are a DA.  And once you find out you are a
DA, you must menu_register and evnt_mesg or evnt_multi to catch AC_OPEN calls.

Now the 'trick.'

To determine if you are a DA, simply look at your basepage.  SPecifically,
look to see if you have a parent process.  If the pointer to your parent's
BP is zero, then you are a DA.  If your parent pointer is not NULL, you are
a program.

I expect that now everyone on the net will make their programs run either way.

- mike


-- 
for (;;)                              : Use ATARINET, send an interactive
        do_it(c_programmers);         : message such as:
                                      : Tell UH-INFO at UHUPVM1 ATARINET HELP
University Atari Computer Enthusiasts : University of Houston UACE