From owner-freebsd-questions@FreeBSD.ORG Thu Mar 4 08:57:57 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F39616A4CE for ; Thu, 4 Mar 2004 08:57:57 -0800 (PST) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id DDE3143D2D for ; Thu, 4 Mar 2004 08:57:54 -0800 (PST) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (localhost [127.0.0.1]) by fw.farid-hajji.net (Postfix) with ESMTP id 6FD9740822; Thu, 4 Mar 2004 17:57:18 +0100 (CET) From: Cordula's Web To: skuma17@yahoo.com In-reply-to: <20040304130821.96170.qmail@web9907.mail.yahoo.com> (message from bear on Thu, 4 Mar 2004 05:08:21 -0800 (PST)) X-Mailer: Emacs-21.3.1/FreeBSD-4.9-STABLE References: <20040304130821.96170.qmail@web9907.mail.yahoo.com> Message-Id: <20040304165718.6FD9740822@fw.farid-hajji.net> Date: Thu, 4 Mar 2004 17:57:18 +0100 (CET) cc: freebsd-questions@freebsd.org Subject: Re: one simple question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: cpghost@cordula.ws List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2004 16:57:57 -0000 > > > I compile a test C file. I notice there are a few lines at the > > > beginning of the assembly code. I want to know what it means, but > > > can't figure out one of them. Can anyone tell me what the > > > following line does please? > > > > > > and $0xfffffff0,%esp > > > > gcc2_compiled.: > > .text > > .p2align 2,0x90 > > .globl main > > .type main,@function > > main: > > pushl %ebp > > movl %esp,%ebp > > xorl %eax,%eax > > jmp .L2 > > .p2align 2,0x90 > > .L2: > > thank you very much for the reply > yes and I am using gcc 3.2.2 > if you "gdb" the executable and "disassemble main" > you will see the line like that > but if you use gcc -S something.s something.c > it won't appear in the assembly code Ah, so it's being introduced by the assembler, not the compiler. That is perhaps the effect of alignement instructions like > > .text > > .p2align 2,0x90 this and similar defaults. > and I google around, I think it does the alignment for optimization > purpose, in that case the memory access will be faster according to the > article. That may very well be the case. Considering that a cache line is also a few words worth, it may be sensible to start with an aligned stack frame too. > best regards, > Chungwei -- Cordula's Web. http://www.cordula.ws/