ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/27/18:30:10

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: "Graham Warren" <Moosehead AT tesco DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Inline Assembly with DJGPP
Date: Sat, 27 Apr 2002 22:28:44 +0000 (UTC)
Organization: BT Openworld
Lines: 25
Message-ID: <aaf8mr$jme$1@paris.btinternet.com>
NNTP-Posting-Host: dialup.62-172-21-102.tesco.net
X-Trace: paris.btinternet.com 1019946524 20174 (27 Apr 2002 22:28:44 GMT)
X-Complaints-To: news-complaints AT lists DOT btinternet DOT com
NNTP-Posting-Date: Sat, 27 Apr 2002 22:28:44 +0000 (UTC)
X-Newsreader: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I have been attempting to use some inline assembly language in a plain C
program. The following code (taken straight from 'Brennan's Guide to Inline
Assembly'), will not compile as part of a program.

asm ("cld\n\t"
     : /* no output registers */
     : "c" (count), "a" (fill_value), "D" (dest)
     : "%ecx", "%edi" );

I get the following error messages:
"Error: Invalid asm statement"
"Error: fixed or forbidden register 2 (cx) was spilled for class CREG"

Can anyone explain what is wrong with my syntax or give me a hint to what
the problem is here?

Thanks very much.

- Raw text -

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