Date: Tue, 30 Sep 1997 17:30:48 -0700 (PDT) Message-Id: <199710010030.RAA23255@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: s2174215 AT cse DOT unsw DOT edu DOT au, djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: How to use movedata with a pointer ? Precedence: bulk At 03:57 9/28/1997 +1100, Gavin Sinclair wrote: >This is how I flush an entire buffer to the screen: > > short video = __dpmi_segment_to_descriptor(0xa000); > _movedatal(_my_ds(), (unsigned int)buffer, video, 0, 16000); > >Here, 'buffer' is a pointer to the beginning of the, well, buffer. >Notice however that it is cast to (unsigned int). movedata needs an >address, not a pointer. Also, the 0 (4th argument) is an offset from >the 'video' selector created in the first statement, which I believe you >will be able to use to your advantage. > >The most important thing about this function is the 'l' at the end of >_movedatal. Copying 32-bit long words means it only takes 16000 >transfers to copy the entire screen, instead of 64000 bytes! Actually, movedata will copy longs as much as possible. The only overhead is involved in checking for and perhaps moving the odd bytes left over. > >Unfortunately I can't comment on the relative efficiency of movedata, >farpoke, dosmemput etc. Hopefully someone else will be able to inform >us. dosmemput just calls movedata with _dos_ds as the destination selector. A loop of farpokes is likely to be much slower, since movedata uses a `rep movsl' instruction while farpokes will need at least a move, some increments, and a conditional jump... Nate Eldredge eldredge AT ap DOT net