Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - movedata http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   movedata

   Usage
   #include <string.h>
   void  movedata(unsigned  srcseg,  unsigned  srcoff,  unsigned  dstseg,
   unsigned dstoff, unsigned numbytes);

   Description
   Copies  numbytes  bytes from the source address specified  by  segment
   srcseg  and  offset  srcoff to the destination  address  specified  by
   segment dstseg and offset dstoff.

   This  function is used to move far data in the small or medium  memory
   models.  In the compact or large memory models, memcpy or memmove  may
   be used instead.

   movedata does not handle overlapping moves correctly.

   Example
   #include <string.h>
   #include <dos.h>

   /* move data from a static far buffer to
   a dynamically allocated far buffer */

   char far buffer[256];

   main()
   {
   char far *src;
   char far *dst;

        src = buffer;
        dst = farmalloc(256);
        movedata(FP_SEG(src),FP_OFF(src),FP_SEG(dst),FP_OFF(dst),256);
   }


See Also: memcpy memmove getDS segread

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson