www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/03/23:46:36

Message-ID: <334484D8.384@epix.net>
Date: Thu, 03 Apr 1997 23:34:32 -0500
From: oghma <oghma AT epix DOT net>
Reply-To: oghma AT epix DOT net
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com
Subject: Writing to video buffer - the fastest way.

I would really appreciate if someone could tell me, or even better, give
me an example, of the fastest way of moving data to the video_buffer.  I
would be really happy if there is a way to move it all at once, all 64K.
I know there is d_word method, but I've heard that using inline
assembler it could be a least two times faster.  Here is the code of
that function, however it does not work (probably because it is not
compatible with protected mode).  I don't know the way it should be
written.

char *video_buffer;
char *data;

__djgpp_nearptr_enable();

video_buffer = (char *) 0xa0000 + __djgpp_conventional_base;

asm{

   push ds
   les di, video_buffer
   lds si, data
   mov cx, 320*200/2
   cld
   rep movsw
   pop ds
}


Thank you in advance,


Oghma.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019