Parasoft C ++ test - compile the build code in

I want to compile and test a sample of the built-in build code in a parasoft C ++ test software.

source:

#include <stdio.h>
void example()   { int arg1, arg2, add, sub, mul, quo, rem ;

 printf( "Enter two integer numbers : " );
 scanf( "%d%d", &arg1, &arg2 );


 __asm__ ( "addl %%ebx, %%eax;" : "=a" (add) : "a" (arg1) , "b" (arg2) );
 __asm__ ( "subl %%ebx, %%eax;" : "=a" (sub) : "a" (arg1) , "b" (arg2) );
 __asm__ ( "imull %%ebx, %%eax;" : "=a" (mul) : "a" (arg1) , "b" (arg2) );

 __asm__ ( "movl $0x0, %%edx;"
           "movl %2, %%eax;"
           "movl %3, %%ebx;"
            "idivl %%ebx;" : "=a" (quo), "=d" (rem) : "g" (arg1), "g" (arg2) );

 printf( "%d + %d = %d\n", arg1, arg2, add );
 printf( "%d - %d = %d\n", arg1, arg2, sub );
 printf( "%d * %d = %d\n", arg1, arg2, mul );
 printf( "%d / %d = %d\n", arg1, arg2, quo );
 printf( "%d %% %d = %d\n", arg1, arg2, rem );


 }

The code has an error. Error for each word:

The word 'ebx' is not correctly spelled.

what should I do?

+4
source share
1 answer

Most likely, this is not an error detected by Parasoft C ++ test as itself, but rather a hint that you get from the Eclipse CDT IDE (code editor). You are probably using Parasoft C ++ test as an Eclipse plugin.

0
source

All Articles