Mail Archives: djgpp/1999/01/05/19:05:38
Wojciech Piechowski wrote:
> > void Flip(unsigned char far *source,unsigned char far *dest, unsigned int
> > num_bytes)
> > {
> > _asm {
> > push ds
> > les di, [dest]
> > lds si, [source]
> > mov cx, [num_bytes]
> > rep movsw
> > pop ds
> > }
> > }
>
> Since this function does not contain any C code (pure assembler), you
> should consider writing it as separate asm module. Then you could use NASM
> (quite pleasant assembler with the well-known Intel syntax) and wouldn't
> have to learn the AT&T convention.
That is a great suggestion in general, but in this case there is
a more serious problem. The entire operation being performed by
the subroutine is based on real mode addressing. When you run
this with DJGPP you will need to change the routine (and almost
certainly the caller as well) to fit DJGPP addressing. (Time
to read the FAQ). When doing that, this whole routine should
probably be replaced by a call to a library routine anyway.
--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/
- Raw text -