delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/31/15:58:16

From: VANGEL AT vmredipn DOT ipn DOT mx
Message-Id: <199710312055.PAA21182@delorie.com>
Date: Fri, 31 Oct 97 14:54:32 EST
To: djgpp AT delorie DOT com
Subject: Errors in once program

Hi ...
I run the fellow program:

/*******************************************************************/

#include <stdio.h>
#include <stdlib.h>

void square( unsigned long *a, unsigned long *b )
{
   /* This function squares a 48-bit number "a" into a
      96 bit number "b", stored in binary and in little-
      endian order. */

    __asm__ ("
       movl (%0), %%eax       \n
       mull %%eax             \n
       movl %%eax, (%1)       \n
       movl 4(%0), %%eax      \n
       mull %%eax             \n
       movl %%eax, 8(%1)      \n
       movl %%edx, 4(%1)      \n
       movl 4(%0), %%eax      \n
       mull (%0)              \n
       addl %%eax, %%eax      \n
       adcl %%edx, %%edx      \n
       addl %%eax, 4(%1)      \n
       adcl %%edx, (%1)       \n"
    :
    : "g"(a), "g"(b)
    : "%eax", "%edx", "memory");
}

/*---------------------------------------------------------------------*/

int main(int argc,char *argvู){
   unsigned long b3ู,a2ู;

   a0ู=atol(argv1ู);
   a1ู=atol(argv2ู);

   square(a,b);

   printf("%.8x %.8x %.8x\n\n", b0ู, b1ู, b2ู);
   return 0;
}
----------------------------------------------------------------------------

And I get the fellow errors :

C:\TC\ASMG>gcc -Wall pp1.c -o pp11.exe
pp1.c: In function `main':
pp1.c:42: warning: unsigned int format, long unsigned int arg (arg 2)
pp1.c:42: warning: unsigned int format, long unsigned int arg (arg 3)
pp1.c:42: warning: unsigned int format, long unsigned int arg (arg 4)
C:\djgpp\tmp\cccaaaaa: Assembler messages:
C:\djgpp\tmp\cccaaaaa:12: Error: Missing ')' assumed
C:\djgpp\tmp\cccaaaaa:12: Error: Ignoring junk '(%ebp))' after expression
C:\djgpp\tmp\cccaaaaa:16: Error: Missing ')' assumed
C:\djgpp\tmp\cccaaaaa:16: Error: Ignoring junk '(%ebp))' after expression
C:\djgpp\tmp\cccaaaaa:18: Error: Ignoring junk '(8(%ebp))' after expression
C:\djgpp\tmp\cccaaaaa:22: Error: Ignoring junk '(12(%ebp))' after expression
C:\djgpp\tmp\cccaaaaa:24: Error: Ignoring junk '(12(%ebp))' after expression
C:\djgpp\tmp\cccaaaaa:26: Error: Ignoring junk '(8(%ebp))' after expression
C:\djgpp\tmp\cccaaaaa:28: Error: Missing ')' assumed
C:\djgpp\tmp\cccaaaaa:28: Error: Ignoring junk '(%ebp))' after expression
C:\djgpp\tmp\cccaaaaa:34: Error: Ignoring junk '(12(%ebp))' after expression
C:\djgpp\tmp\cccaaaaa:36: Error: Missing ')' assumed
C:\djgpp\tmp\cccaaaaa:36: Error: Ignoring junk '(%ebp))' after expression

C:\TC\ASMG>tc <-----Editor Turbo C 2.0 (for easy edit of programs )

Sorry I forget the autor....  :) ...

Well, I hope any explain about it ...

Thanks in advange  ...


บบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบ
บบบ   Victor Angel Huerta          บบบ
บบบ   vangel AT vmredipn DOT ipn DOT mx       บบบ
บบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบบ

- Raw text -


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