Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: asm statements & the stack Message-ID: <1339@haddock.ISC.COM> Date: Wed, 7-Oct-87 19:28:34 EDT Article-I.D.: haddock.1339 Posted: Wed Oct 7 19:28:34 1987 Date-Received: Sat, 10-Oct-87 16:36:42 EDT References: <110@teletron.UUCP> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 17 In article <110@teletron.UUCP> andrew@teletron.UUCP (Andrew Scott) writes: >[Tried to use the stack from an asm() instruction, and got bitten] Well, in my opinion, the compiler is free to do whatever is easiest or most efficient as long as it has the appropriate semantics. If an asm() escape is provided, it's the user's responsibility to know enough about the compiler to avoid colliding with the generated code. >The compiler I use ... allocates one more longword than necessary when >creating foo's stack frame. If this is a consistent feature, you could save %sr in that slot, and then decrement the stack to make a new slot for the function to use. Or, you could avoid the stack entirely and store %sr in a static location, if you don't need to nest the disable/enable calls. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint