Path: utzoo!attcan!uunet!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: <6V0oP2w163w@bluemoon.UUCP> Date: 18 Sep 90 15:22:28 GMT References: <18420004@hpsad.HP.COM> Sender: bbs@bluemoon.UUCP Organization: Blue Moon BBS (614) 868-9982 & 9984 Lines: 21 randyh@hpsad.HP.COM (Randy Hosler) writes: > change I had to make was to the variable "program". It was originally > declared a register char *program. When I compiled the code with the -S > option and then looked at the source file I couldn't find _program > anywhere accept in the asm fragment. After declaring program as a global > above main() the code would compile because it now had a reference for > _program. I don't know if everyone followed that, but I had a great time > figuring it out. This is what the fragment now looks like. > The reason you couldn't get a reference of _program was just what you wrote: it was not a global variable. When I first looked at a simple dissassembled *.O file, I was surprised to see that main() does a LINK instruction in assembly. In other words, all variables declared in main() are simply going to be temporary as they exist only on stack, and not in real GEMDOS data area. I think in object files you can only get references to procedures and global variables (although I MAY be wrong), since local variables are just offsets on a stack... I don't know if all of this made sense... Archbold