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

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: Martin Str|mberg <ams AT speedy DOT ludd DOT luth DOT se>
Subject: Re: Inline Assembly with DJGPP
Newsgroups: comp.os.msdos.djgpp
References: <aaf8mr$jme$1 AT paris DOT btinternet DOT com>
User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (NetBSD/1.5_BETA (alpha))
Message-ID: <1019950186.652734@queeg.ludd.luth.se>
Cache-Post-Path: queeg.ludd.luth.se!unknown AT speedy DOT ludd DOT luth DOT se
X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/)
Date: 27 Apr 2002 23:29:46 GMT
Lines: 32
NNTP-Posting-Date: 27 Apr 2002 23:29:46 GMT
NNTP-Posting-Host: queeg.ludd.luth.se
X-Trace: 1019950186 news.luth.se 283
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Graham Warren <Moosehead AT tesco DOT net> wrote:
: 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"
:      "rep\n\t"
:      "stosl"
:      : /* 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?

Try "...
  : "c" (count), "D" (dest)
  : "0", "a" (fill_value), "1"
  : /* No clobbers. */ );

Very much untested!



- Raw text -

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