www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/05/19:05:38

From: "John S. Fine" <johnfine AT erols DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: asm problem
Date: Tue, 05 Jan 1999 18:59:25 -0500
Lines: 30
Message-ID: <3692A75D.200C@erols.com>
References: <Pine DOT GSO DOT 3 DOT 96 DOT 990105232407 DOT 1175A-100000 AT delta DOT ds2 DOT pg DOT gda DOT pl>
Mime-Version: 1.0
X-Trace: TeO9YCoGCCEI6nhawQcBgaNC+TU+QjvW5X6fjzEEZl8=
X-Complaints-To: abuse AT rcn DOT com
NNTP-Posting-Date: 6 Jan 1999 00:00:29 GMT
X-Mailer: Mozilla 3.01 (Win95; U)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


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