delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/03/01:15:30

From: Nat Saiger <lunchbox AT stayfree DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Simple Assembly Question
Date: Sat, 03 Jan 1998 05:36:25 +0000
Organization: Stayfree Internet Limited.
Lines: 46
Message-ID: <34ADCE54.8AE42E7A@stayfree.co.uk>
NNTP-Posting-Host: lunchbox.stayfree.co.uk
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,

    Being new to both DJGPP and AT&T syntax asm, i'm having difficulties
implementing both inline and external assembly.

    This is what i'm trying to convert  (in BCC and inline Intel):

                void Blit(char *source, char *dest)
                {
                    asm{
                            push ds
                            les di,dest
                            lds si,source
                            mov cx,32768
                            rep movsw
                            pop ds
                            }
                    }

This is how I converted it...

void (char *source, char *dest)
{
        short global_selector = _dos_ds;
        asm("
                 pushl %eds
                 movw _global_selector, %es
                 movl _dest, %edi
                 movw _global_selector, %ds
                 movl _source,%esi                  // my intel syntax
book says %esi exists, the assembler
                 movl $32768, %ecx                // disagrees
                 rep  movsw
                 popl %eds
             ")
}

When I compile it I get "Opcodes match no known 386 instruction" but it
doesn't tell me which line is causing the error.
I've read the FAQ's and also a document on AT&T syntax and it ain't much
help
If someone could do a working conversion for me, (and possibly an
external version), I would be very grateful.

Nat Saiger.

- Raw text -


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