delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/02/18/13:57:33

From: Silver <SilverBanana AT gmx DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Newbie Question
Date: Sun, 18 Feb 2001 19:37:12 +0100
Organization: Private
Lines: 41
Message-ID: <3A901658.CC9D8760@gmx.de>
References: <3A8FEFB7 DOT C2603B36 AT prodigy DOT net>
Mime-Version: 1.0
X-Trace: news.t-online.com 982521370 07 13768 OssxrHbSkH6Zs 010218 18:36:10
X-Complaints-To: abuse AT t-online DOT com
X-Sender: 320061326503-0001 AT t-dialin DOT net
X-Mailer: Mozilla 4.76 [en] (Win98; U)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com


Sopola wrote:
> 
> Hello Group,
> I hope you can help me. I have a question about inline assembly. I
> usually use VC++, where you use it like this:
> __asm {
>     /* your code here*/
> }
> but I need it compiled under DJGPP.
> 
> When I do this
> 
> __asm {
> mov ah, 00h
> mov al, 02h
> int 10h
> }
> 
> I get     "parse error before {"    and     "nondigits in number and not
> hexadecimal".
> If I do it like this:
> __asm ("mov ah, 00h");
> __asm ("mov al, 02h");
> __asm ("int 10h");
> 
> I get "error: too many memory references for mov".
> Can someone help me? How do I use inline assembly? What I need is real
> simple, a couple of instructions at most.
> Thanks a lot,
> George
DJGPP doesn't support intel assembler syntax. You will need to use AT&T
Syntax.
There are a couple of good tutorials online which can teach you that.
Besides: You really shouldn't use assembler to call interrupts that way
in DJGPP. Use the builtin functions instead. 

I hope this is useful

Silver

- Raw text -


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