top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is inline assembly language programs?

0 votes
409 views
What is inline assembly language programs?
posted Dec 8, 2015 by Rajat Dubey

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

When a program written in C language and contains few assembly language statements , is known "using inline assembly in C" .
Following C Program may help you out.

#include <stdio.h>

int main() {


   /* Add 10 and 20 and store result into register %eax */
   __asm__ ( "movl $10, %eax;"
         "movl $20, %ebx;"
         "addl %ebx, %eax;"
         );

   register int sum asm("eax");

   printf("%d", sum);

   return 0 ;
}
answer Dec 8, 2015 by Harshita
...