Mail Archives: djgpp/2001/04/04/04:18:00
On Wed, 4 Apr 2001, Mathias K wrote:
> if video_buffer is a global pointer and data is a local pointer, could =
> you translate these 7 lines for me?
>
> push ds
> les di, video_buffer
> lds si, data
> mov cx, 32000
> cld
> rep movsw
> pop ds
Untested:
#include <sys/movedata.h>
dosmemput (data, 32000*2, video_buffer_seg*16 + video_buffer_offs);
where video_buffer_seg and video_buffer_offs are the segment and the
offset of the video buffer. dosmemput is a library function which
expands into the same assembly code that you were trying to use, except
that it does that correctly for protected-mode programming, which
disallows loading arbitrary values into segment registers such as DS and
ES.
In other words, don't use assembly unless you really need to: it
introduces a level of complexity into DJGPP programming that a new user
doesn't need.
See chapter 18 in the DJGPP FAQ list for more about low-level programming
with DJGPP.
- Raw text -