movedata

copy bytes from one far pointer to another

Synopsis:

#include <string.h>
void movedata( unsigned int src_segment,
               unsigned int src_offset,
               unsigned int tgt_segment,
               unsigned int tgt_offset,
               size_t length );

Description:

The movedata() function copies length bytes from the far pointer calculated as (src_segment:src_offset) to a target location determined as a far pointer (tgt_segment:tgt_offset).

Overlapping data may not be correctly copied. When the source and target areas may overlap, copy the areas one character at a time.

The function is useful to move data when the near address(es) of the source and/or target areas are not known.

See also:

FP_SEG(), FP_OFF(), memcpy(), segread()

Examples:

#include <stdio.h>
#include <string.h>
#include <i86.h>

void main()
  {
    char buffer[14] = {
    '*', 0x17, 'H', 0x17, 'e', 0x17, 'l', 0x17,
    'l', 0x17, 'o', 0x17, '*', 0x17 };

    movedata( FP_SEG( buffer ),
          FP_OFF( buffer ),
          0xB800,
          0x0720,
          14 );
  }

Classification:

WATCOM

Systems:

All (except DOS/PM)