Mail Archives: djgpp/2000/03/06/19:54:28
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 -