Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 To: cygwin AT cygwin DOT com From: "Krzysztof Duleba" Subject: Re: Assembler Date: Tue, 17 Feb 2004 22:11:29 +0100 Lines: 58 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit X-Complaints-To: usenet AT sea DOT gmane DOT org X-Gmane-NNTP-Posting-Host: fw-gw-atm.mimuw.edu.pl X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 Williams, Gerald S (Jerry) wrote: >> What about Linux syscalls? Will Cygwin emulation layer match >> it? > I just Googled "int 0x80". So THAT'S what you're > trying to do. :-) :-) > No, I think your experiment shows that Cygwin is > not emulating Linux syscalls at that level. Really? > Nor would I have expected it to. Why not? c code, translated to asm with -c -S on linux box, can be later compiled and linked with Cygwin's gcc and works fine. As you see, I have a good reason to believe that nasm's int 0x80 will work too. So maybe I should simply look for a nasm -> gcc's assembler translator? > On the other hand, you can get at DOS functions, > at least if you build your executable correctly. > For example, the following: > > ; hello.asm > [ORG 0x100] > > section .text > global _start > > _start: mov ah,9 > mov dx, hello > int 0x21 > > mov ax,0x4c00 > int 0x21 > > section .data > hello db 'Hello, World', 13, 10, '$' That was an easy example. But what if I want to fork? :-) >> Is there a way I could force Cygwin's ld to work the way >> Linux ld used to? > > I don't know about that, but you can specify the > entry point explicitly: > > ld -e _start hello.o Thanks! Now my hello.asm compiles well, is linked correctly, but still gives an empty output. Regards Krzysztof Duleba -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/