From owner-freebsd-hackers Thu Apr 25 9:23:46 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mailhub.yumyumyum.org (dsl092-171-091.wdc1.dsl.speakeasy.net [66.92.171.91]) by hub.freebsd.org (Postfix) with SMTP id 38E7A37B426 for ; Thu, 25 Apr 2002 09:23:27 -0700 (PDT) Received: (qmail 44826 invoked from network); 25 Apr 2002 16:22:55 -0000 Received: from dsl092-171-091.wdc1.dsl.speakeasy.net (66.92.171.91) by dsl092-171-091.wdc1.dsl.speakeasy.net with SMTP; 25 Apr 2002 16:22:55 -0000 Date: Thu, 25 Apr 2002 12:22:55 -0400 (EDT) From: Kenneth Culver To: Andrew Gallatin Cc: Peter Wemm , John Baldwin , Subject: Re: pushal & ebp In-Reply-To: <15560.4334.821343.177003@grasshopper.cs.duke.edu> Message-ID: <20020425115941.C44727-100000@alpha.yumyumyum.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > I just looked at the NetBSD code & like linux, they use a macro which > individually pushes the registers onto the stack rather than using > pushal (which I assume is the same as what intel calls PUSHAD in their > x86 instruction set ref. manual). > > NetBSD stopped using pushal in 1994 in rev 1.85 of their > arch/i386/i386/locore.s in a commit helpfully documented > "Don't use pusha and popa." > > Does anybody know why the other OSes push the registers individually, > rather than using pushal? Could our using pushal be causing Kenneth's > ebp to get lost, or is this just a red herring? > > Thanks, > > Drew > > > according to the intel docs, pushad (or what I'm assuming is pushal in our case) pushes eax, ecx, edx, ebx then pushes some temporary value (the original esp I think) then pushes ebp, esi, and edi: this is from the documentation for pushad IF OperandSize = 32 (* PUSHAD instruction *) THEN Temp (ESP); Push(EAX); Push(ECX); Push(EDX); Push(EBX); Push(Temp); Push(EBP); Push(ESI); Push(EDI); so could this be the problem? Ken To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message