Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>movedata</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
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 (_my_ds:, _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 `(int)&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.

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(), (int)blank_row_buf,
              _dos_ds, 0xb8000 + ScreenCols()*(ScreenRows()-1)*2,
               ScreenCols() * 2);


See Also: _my_ds _go32_info_block

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