ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/03/03:05:29

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Lines: 41
X-Admin: news AT aol DOT com
From: sterten AT aol DOT com (Sterten)
Newsgroups: comp.os.msdos.djgpp
Date: 03 Apr 2002 07:58:37 GMT
References: <3CAA99CA DOT 33B1298D AT is DOT elta DOT co DOT il>
Organization: AOL http://www.aol.com
Subject: Re: help with inline AT&T assembly
Message-ID: <20020403025837.19509.00001308@mb-cm.aol.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

sorry, I forgot to specify the variables:

char* A;
unsigned int* D;
unsigned int x,min;
register unsigned int j,row,q;
j is ebx , row is esi , q is edi

and then I had several errors , I don't like the AT&T-syntax. 
Here is , what finally worked but gave only a speed improvement
of about 30% on my K6/2 :




//j=0;label1:j+=A[q+row];row=D[row];if(j<min && row!=x) goto label1;

m12:__asm__ __volatile__ ("
        pushl %%ecx
        pushl %%edx
        pushl %%eax
        movl %1,%%ecx
        movl %2,%%edx
        addl %%edi,%%ecx
        xorl %%ebx,%%ebx
        jmp label1
        .p2align 4,,7
label1: movzbl (%%ecx,%%esi),%%eax
        movl (%%edx,%%esi,4),%%esi
        addl %%eax,%%ebx
        cmpl _x,%%esi
        je label2
        cmpl _min,%%ebx
        jb label1
label2: popl %%eax
        popl %%edx
        popl %%ecx
        "
        :"=g"(j)
        :"g"(A),"g"(D)
         );

- Raw text -


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