www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/26/15:16:18

From: flupke <schawat AT club-internet DOT fr>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Again: I need help (inline assembly)
Date: Wed, 25 Aug 1999 12:38:54 +0200
Organization: Club-Internet (France)
Lines: 28
Message-ID: <37C3C7BE.9EC46476@club-internet.fr>
References: <37c1e222 DOT 1224982 AT news DOT telepac DOT pt>
NNTP-Posting-Host: toulon-3-74.club-internet.fr
Mime-Version: 1.0
X-Trace: front3.grolier.fr 935679335 28874 195.36.187.74 (26 Aug 1999 14:55:34 GMT)
NNTP-Posting-Date: 26 Aug 1999 14:55:34 GMT
X-Mailer: Mozilla 4.06 [en] (Win98; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Guess you want it in x86 (not the fastest method, just to show you an
example):

asm volatile
(
 "cld
  movl        $10,%%ecx
  rep
  stosb"
:
: "S"(source), "D"(dest)
: "esi", "edi", "ecx"
);

BTW I had to change the declaration of the arrays from:
    int source[10], dest[10];
to:
    int *source = new int[10], *dest = new int[10];

to avoid an "inconsistent operand constraints in an `asm'" error at
compile time... if someone knows why, i'm interested.

You can find pointers on AT&T syntax and DJGPP inline assembly in the
DJGPP FAQ, section 18.13

Bye.


- Raw text -


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