delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/03/16/12:11:32

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-8.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI
X-Spam-Check-By: sourceware.org
From: Stephan Mueller <Stephan DOT Mueller AT microsoft DOT com>
To: Brandon Chase <tapedispenser7 AT hotmail DOT com>,
"cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RE: Assembly language exit() syscall does not return correct value
Date: Tue, 16 Mar 2010 17:08:39 +0000
Deferred-Delivery: Tue, 16 Mar 2010 17:09:00 +0000
Message-ID: <98091D8BAF39E746A7D3E618C948528D279C5141@DF-M14-02.exchange.corp.microsoft.com>
References: <SNT124-W2474B6AD4E766F69DD69EE992D0 AT phx DOT gbl>
In-Reply-To: <SNT124-W2474B6AD4E766F69DD69EE992D0@phx.gbl>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Brandon Chase wrote:
" DaveK wrote:
" " On 15/03/2010 16:56, Christopher Faylor wrote:
" " > # %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
" " >
" " > 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" h=
as just
" " been removed.  What you said.  Also, it should probably define '_main' =
rather
" " 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 lev=
el, in
" " particular Cygwin isn't a real kernel, so it doesn't have a syscall int=
erface;
" " you just call system functions as if they were ordinary functions.
"
" So I cannot compile assembly language with Cygwin? Do I need a linux shel=
l?

No, that's not what anyone said.  You can use the assembler on Cygwin to ge=
nerate
binaries that run on Cygwin (which is I think what you're looking for), but=
 your
assembly source code won't work as is -- you will need to make changes of t=
he
sort that DaveK and cgf state in the paragraphs above.

stephan();

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019