delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/25/08:16:16

From: qball1723 AT aol DOT com (QBall1723)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 32bit memcpy function?
Date: 24 Nov 1997 20:52:07 GMT
Lines: 43
Message-ID: <19971124205200.PAA11381@ladder02.news.aol.com>
NNTP-Posting-Host: ladder02.news.aol.com
Organization: AOL http://www.aol.com
References: <b167cd$c221f DOT 2af AT news DOT alberni DOT net>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

>Subject: 32bit memcpy function?
>From: wolfman AT cedar DOT alberni DOT net
>Date: Sat, Nov 22, 1997 15:34 EST
>Message-id: <b167cd$c221f DOT 2af AT news DOT alberni DOT net>
>
>
>I was wondering if DJGPP has a 32bit memcpy function (memcpy uses 8bit
>right?)  If so, 
>please tell me what it is.  And if not please tell me that there isn't.
>
>

    The following are 32-bit macros I found in a DJGPP assembly tutorial
somewhere:

// MACRO FOR 32 BIT MEMORY MOVE (used to copy double_buffer to
// video_buffer

#define rep_movsl(src, dest, numwords) \
__asm__ __volatile__ ( \
  "cld\n\t" \
  "rep\n\t" \
  "movsl" \
  : : "S" (src), "D" (dest), "c" (numwords) \
  : "%ecx", "%esi", "%edi" )

// MACRO TO SET BITS (32-bits at a time), used in filling the double
// buffer using LONG WORDS ; ]

#define rep_stosl(value, dest, numwords) \
__asm__ __volatile__ ( \
  "cld\n\t" \
  "rep\n\t" \
  "stosl" \
  : : "a" (value), "D" (dest), "c" (numwords) \
  : "%ecx", "%edi" )

    Enjoy! & I hope these help.


Jim the loiterer
http://members.aol.com/qball1723/index.htm
(wannabe PC game/graphics developer)

- Raw text -


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