copy bytes from one far pointer to another
#include <string.h>
void movedata( unsigned int src_segment,
unsigned int src_offset,
unsigned int tgt_segment,
unsigned int tgt_offset,
size_t length );
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).
The function is useful to move data when the near address(es) of the source and/or target areas are not known.
FP_SEG(), FP_OFF(), memcpy(), segread()
#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 );
}
WATCOM
All (except DOS/PM)