Path: utzoo!attcan!uunet!ns-mx!iowasp.physics.uiowa.edu!maverick.ksu.ksu.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker!tut.cis.ohio-state.edu!n8emr!bluemoon!archbold From: archbold (Archie Jaszcz) Newsgroups: comp.sys.atari.st.tech Subject: Re: Sozobon asm Message-ID: Date: 25 Sep 90 23:25:45 GMT References: <1990Sep21.142623.12807@raid5.uucp> Sender: bbs@bluemoon.UUCP Organization: Blue Moon BBS (614) 868-9980 & 9982 & 9984 Lines: 27 tony@raid5.uucp (Tony Andrews) writes: > There's nothing special about the function "main" in C except that it is > the first function called, and it receives the command line arguments. > Variables declared in main() go on the stack just as in any other function. > Accessing local variables via embedded assembly is a bit of a pain in > general because they are referenced via offsets from the frame pointer > (in a6). > > At the request of some of our users we added a feature in version 1.2 to > make this a little easier. The output of hcc now includes a comment block > at the start of each function that shows all local variables and their > offsets. > > --tony Tony! I know that about the main() function now... It is just that I wasn't too much into C, I'd rather do stuff in assembly. Anyways, I stumbled across the finding when I looked at dissassembled *.O file which of course had main() and main would do a link a6,#0 (or -something if it had any arguments). It was surprising to me, because I never thought of main() as being just an ordinary function... Archbold osu-cis!n8emr!bluemoon!archbold Disclaimer: I haven't seen Veronica lately!