Mail Archives: djgpp/1997/10/31/15:58:16
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 b3ู,a2ู;
a0ู=atol(argv1ู);
a1ู=atol(argv2ู);
square(a,b);
printf("%.8x %.8x %.8x\n\n", b0ู, b1ู, b2ู);
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 -