X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 	tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <SNT124-W2474B6AD4E766F69DD69EE992D0@phx.gbl>
From: Brandon Chase <tapedispenser7@hotmail.com>
To: <cygwin@cygwin.com>
Subject: Re: Assembly language exit() syscall does not return correct value
Date: Tue, 16 Mar 2010 16:45:03 +0000
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com


On 15/03/2010 16:56, Christopher Faylor wrote:
> On Mon, Mar 15, 2010 at 04:23:39PM +0000, Brandon Chase wrote:
>> The following program is supposed to return a value of 222 when echo $?=
=20
>> run, but I get 127 every time, no matter what I change. I have looked=20
>> around but cannot seem to find out if this is an error or a=20
>> cygwin-specific value.

> # %ebx is the status code for the exit system call
> # and it already has the maximum number
> 	movl $1, %eax			#1 is the exit() syscall
>=20
> If, in theory, I got this right then, on linux it SEGVs.  I would
> not expect anything different on Cygwin.  It seems like you need
> to actually call exit() if you want this to exit.

  Yeah, this looks like it was Linux assembly code and the "int 0x80" has j=
ust
been removed.  What you said.  Also, it should probably define '_main' rath=
er
than '_start'.  And use the gcc driver to assemble and link it so as to get
the necessary startup code.

  Brandon, Cygwin isn't compatible with Linux at the assembler-code level, =
in
particular Cygwin isn't a real kernel, so it doesn't have a syscall interfa=
ce;
you just call system functions as if they were ordinary functions.

    cheers,
      DaveK



So I cannot compile assembly language with Cygwin? Do I need a linux shell?





=20=09=09=20=09=20=20=20=09=09=20=20
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your =
inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID27925::T:WLMTAGL:O=
N:WL:en-US:WM_HMP:032010_2

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

