top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What is inline assembly language programs?

0 votes
49 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
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...