delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/06/19:54:28

Date: Tue, 7 Mar 2000 05:35:33 +0600 (LKT)
From: Kalum Somaratna aka Grendel <kalum AT crosswinds DOT net>
X-Sender: root AT darkstar DOT grendel DOT net
To: "Martin F. Johansen" <mfag AT online DOT no>
cc: djgpp AT delorie DOT com
Subject: Re: Inline asm
In-Reply-To: <ZYQw4.7893$6b1.126890@news1.online.no>
Message-ID: <Pine.LNX.4.10.10003070526520.915-100000@darkstar.grendel.net>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 6 Mar 2000, Martin F. Johansen wrote:

> Does Inline asm work in djgpp? I tried:
> 
> asm MOV AX,0013h
> asm INT 10h
> 
> asm{
>     MOV AX,0003h
>     INT 10h
> }
> 
> The only thing i got was an error message:
> 
> Error: parse error before `MOV'

This is because gcc accepts a different syntax rather than the Intel
syntax you are used to, which is called the AT/T syntax.

There is a very good tutorial about inline assembly written by Brennan
Underwood on DJ's server <http://www.delorie.com>. I forget the URL but
you can easily get it by visiting <http://www.delorie.com> and then using
the search facility to search for "Brenan Underwood".

IMHO this tutorial is really good and helps to make the transition from
intel assembly to AT/T much more easier than the pain in the rear end that
it sometimes could be.

Another good way of learning is to have a look at already written code
that implements inline assembly, the allegro library
<http://www.talula.demon.co.uk/allegro> has a lot of C source with inline
assembly.


HTH,
Grendel 

Hi, I'm a signature virus. plz set me as your signature and help me spread
:)

- Raw text -


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