Ad
Code
Diff
  • int multiply_and_add_one(int a, int b)
    {
      return (a*b)+1;
    }
    • int multiply_and_add_one(int a, int b)
    • {
    • int res;
    • __asm__
    • (
    • "imul %1, %2;"
    • "add $1, %2;"
    • "mov %2, %0;"
    • : "=r" (res)
    • : "r" (a), "r" (b)
    • :
    • );
    • return res;
    • return (a*b)+1;
    • }