Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!apple!portal!atari!apratt From: apratt@atari.UUCP (Allan Pratt) Newsgroups: comp.sys.atari.st.tech Subject: Re: Location of variables in executable files. Message-ID: <2737@atari.UUCP> Date: 12 Nov 90 20:03:26 GMT References: <1990Nov11.013428.4566@cs.utk.edu> Organization: Atari Corp., Sunnyvale CA Lines: 24 andrew@.cs.utk.edu (Andrew Krzywdzinski) writes: >I want to be able to write setup information directly to a program file. >[...] I figure that I will have to mess with the Getmpb procedure, Oh, boy! Getmpb has NOTHING to do with locations of things on disk. No wonder you got confused! Getmpb is a BIOS call which is used by GEMDOS to find out the lay of the land at the beginning of the world: it is the BIOS's way of telling GEMDOS what memory it found and where. It should not be used by user programs. (Gulam used this for the "mem" command and that's one reason the "mem" command doesn't work in Rainbow TOS.) In the Hitchhiker's Guide to the BIOS there is a discussion of the format of an executable file on disk. It starts with a header, then the image of the text segment, then the data segment, then the symbol table, then the "fixups" which tell GEMDOS how to relocate your program. (Programs are linked as if they start at zero, and the actual starting address of the program is added to all absolute references by Pexec(). The fixup information tells Pexec what places need fixing up.) ============================================ Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp. reflect those of Atari Corp. or anyone else. ...ames!atari!apratt