From owner-freebsd-hackers Wed Dec 13 13:30:28 2000 From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 13 13:30:25 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from Gloria.CAM.ORG (Gloria.CAM.ORG [205.151.116.34]) by hub.freebsd.org (Postfix) with ESMTP id 2C68F37B699 for ; Wed, 13 Dec 2000 13:30:20 -0800 (PST) Received: from localhost (intmktg@localhost) by Gloria.CAM.ORG (8.9.3/8.9.3) with ESMTP id QAA12440 for ; Wed, 13 Dec 2000 16:25:46 -0500 Date: Wed, 13 Dec 2000 16:25:46 -0500 (EST) From: Marc Tardif To: freebsd-hackers@freebsd.org Subject: syscall assembly Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Considering the following C code: #include int main() { open("file", O_RDONLY); return 0; } compiled with gcc -S -O2, the following assembly code is generated: main: pushl %ebp movl %esp,%ebp subl $8,%esp addl $-8,%esp pushl $0 pushl $.LC0 call open xorl %eax,%eax leave What is the purpose of the subl and addl instructions? On Linux, they are simply unexistent.. Notes: FreeBSD fbsd.b0x.com 4.2-RELEASE gcc version 2.95.2 19991024 (release) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message