Click here to Skip to main content
12,253,908 members (59,392 online)
Click here to Skip to main content

Stats

396K views
2.2K downloads
64 bookmarked
Posted

Using Inline Assembly in C/C++

, 14 Oct 2006 CPOL
This article describes using inline assembly code in your C/C++ program... was it ever difficult for you, it will never be any more!
#include <stdio.h>

int main() {

	__asm__ ( "movl $10, %eax;"
				"movl $20, %ebx;"
				"addl %ebx, %eax;"
	);

	__asm__ ( "movl $10, %eax;"
					"movl $20, %ebx;"
					"subl %ebx, %eax;"
	);

	__asm__ ( "movl $10, %eax;"
					"movl $20, %ebx;"
					"imull %ebx, %eax;"
	);

	return 0 ;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

jain.pk
India India
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160426.1 | Last Updated 15 Oct 2006
Article Copyright 2006 by jain.pk
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid