From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9434 invoked by alias); 9 Jun 2011 14:37:35 -0000 Received: (qmail 9297 invoked by uid 22791); 9 Jun 2011 14:37:34 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from eta-ori.net (HELO orion.eta-ori.net) (46.4.55.213) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Jun 2011 14:37:18 +0000 Received: from [10.0.0.158] (p5B06F6BA.dip.t-dialin.net [91.6.246.186]) by orion.eta-ori.net (Postfix) with ESMTPSA id 9EDAC3C2B for ; Thu, 9 Jun 2011 16:37:16 +0200 (CEST) Message-ID: <4DF0F706.5050803@impulze.org> Date: Thu, 09 Jun 2011 15:22:00 -0000 From: Daniel Mierswa User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110603 Thunderbird/3.1.10 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Inline ASM and stack/base pointer Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00208.txt.bz2 Hi list, I was wondering how to overcome the issue that evolves when parameters (inputs) to the inline assembly are passed relative to ebp/esp and modifying those pointers in the inline assembly. Basically __asm__("push %ecx\nmov %0, %edx\n"::"m"(variable)); could set '%0' to 4(%esp) or similar which would no longer represent the same location once I use push/pop in my asm. Is it possible to explicitly state that GCC passes those relative to esp _or_ ebp so I can safely modify at least one pointer (i.e. reserve stack space)? Or are there any other ways to overcome this issue? Thanks in advance. -- Mierswa, Daniel If you still don't like it, that's ok: that's why I'm boss. I simply know better than you do. --- Linus Torvalds, comp.os.linux.advocacy, 1996/07/22