Path: utzoo!attcan!uunet!snorkelwacker!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.sys.mips Subject: Re: Mips assembler question Message-ID: Date: 6 Jun 90 14:41:00 GMT References: <1380@quintus.UUCP> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 36 In-reply-to: mark@quintus.UUCP's message of 5 Jun 90 20:16:36 GMT In article <1380@quintus.UUCP> mark@quintus.UUCP (Mark Spotswood) writes: | I have a question about memory initialization in Mips assember. I would | like to initialize a memory location to contain a value which is the | difference between the addresses of two other labels, something like this: | | a: | .word b-c | | where b and c are two other labels. If I use the above syntax, the Mips | assembler will signal an error saying that the symbol 'c' must be an | absolute value. | | The mips assembler will allow things like: | | a: | .word b | | or | | a: | .word b-2 | | If the assembler can figure out what b and b-2 will be, why can't it figure | out what b-c will be? Is there a way to do what I want in Mips assember? Not that I know of. I was prototyping OSF/1 shared libraries with the MIPS assembler, and wanted to get the difference of an item in .data from the start of .data (for which I had a pointer). I finally gave up, and had GCC calculate the offset itself. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA Catproof is an oxymoron, Childproof is nearly so