X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Date: Tue, 26 Apr 2011 10:52:35 +0800 Message-ID: Subject: The same assembly code but different result on cygwin and Centos From: matthew chao To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com The code below assigns an integer number 20 to %ebx, which can be CORRECTLY assembled on both cygwin and CentOS, ###code begin### .section .data items: .long=A0 20 .section .text .globl _start _start: =A0 movl $0,%edi =A0 movl items(,%edi,4),%eax =A0 movl %eax,%ebx =A0 movl $1,%eax =A0 int $0x80 ###code end### However, when I wanted to get the number(20) by the following way, I found the difference between cygwin and CentOS, cygwin: ------------------------------ Matt AT Matt-PC ~ $ ./max2 Matt AT Matt-PC ~ $ echo $? 127 # The result is WRONG ------------------------------ CentOS: ------------------------------ [Matt AT localhost]# ./max2 [Matt AT localhost]# echo $? 20 # The result is RIGHT ------------------------------ Could someone give me a hand?thanks -- 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