Labels by Inline ASM

Eugene ezeml@oe.ic.km.ua
Fri Mar 19 11:07:00 GMT 2004


Hi !
Please, help me.
I need _quickly_ add two  _unsigned_ 
long and test carry flag.

For Example:
////////////////////////////////////////////////

int AddULong(ulong a, ulong b, ulong *c)
{
   *c = a + b;
    asm volatile("jc  La1");
        return 0;   // carry == 0
La1:  return 1;  //  carry == 1
}
 
///////////////////////////////////////////////////////////////////////////////////////////////////////////
Compile width gcc-3.2.2 ( in Linux Red Hat 9 )

g++ -DHAVE_CONFIG_H -I. -I. -I.. -Wnon-virtual-dtor -Wno-long-long -Wundef 
-Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi 
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -O0 -g3 -Wall 
-fno-exceptions -fno-check-new -c -o Mach.o `test -f 'Mach.cpp' || echo 
'./'`Mach.cpp 

Mach.cpp: warning: label `La1' defined but not used    <------   !!!!
Mach.cpp: undefined reference to `La1'                       <------???

////////////////////////////////////////////////////////////////////////////////////////////////////////////

If know how, please mail me.

Thanks a lot for your time!!

Best regards.   

         Eugene.     MailTo ezeml@oe.ic.km.ua



More information about the Gcc-help mailing list