delorie.com/djgpp/doc/libc/libc_583.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

movedata

Syntax

 
#include <sys/movedata.h>

void movedata(unsigned source_selector, unsigned source_offset,
              unsigned dest_selector, unsigned dest_offset,
              size_t length);

Description

This function allows the caller to directly transfer information between conventional and linear memory, and among each as well. The selectors passed are not segment values like in DOS. They are protected mode selectors that can be obtained by the _my_ds and _go32_info_block.selector_for_linear_memory (or just _dos_ds, which is defined in the include file go32.h) functions (_my_ds, see section _go32_info_block). The offsets are linear offsets. If the selector is for the program's data area, this offset corresponds to the address of a buffer (like (unsigned)&something). If the selector is for the conventional memory area, the offset is the physical address of the memory, which can be computed from a traditional segment/offset pair as segment*16+offset. For example, the color text screen buffer is at offset 0xb8000.

Return Value

None.

Portability

ANSI/ISO C No
POSIX No

Example

 
short blank_row_buf[ScreenCols()];
/* scroll screen */
movedata(_dos_ds, 0xb8000 + ScreenCols()*2,
         _dos_ds, 0xb8000,
         ScreenCols() * (ScreenRows()-1) * 2);
/* fill last row */
movedata(_my_ds(), (unsigned)blank_row_buf,
         _dos_ds, 0xb8000 + ScreenCols()*(ScreenRows()-1)*2,
          ScreenCols() * 2);

  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004