Go to the first, previous, next, last section, table of contents.


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) functions (section _my_ds, 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

not ANSI, not POSIX

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);


Go to the first, previous, next, last section, table of contents.