What is the concept of inline assembly in C language
This article introduces the relevant knowledge of "what is the concept of inline assembly in c language". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Inline assembler the assembly code embedded in CCompact + code is equivalent to an inline function written in assembly statements. The advantage is high efficiency.
2. Use asm keywords to implement.
Inline assembly is so useful mainly because it can manipulate C variables, such as getting values from C variables and outputting values to C variables. Because of this capability, asm acts as an interface between the assembly instruction and the C program that contains it.
Example
# include # include int main (void) {/ * basic command demo * / _ asm__ ("movl% eax,% ecx"); / * set b = 10 * / int a = 10, b = 0 ("movl% 1,% eax;"movl% eax, 0" ":" = r "(b) / * output * /:" r "(a) / * input * /:"% eax "/ * clobbered register * /); printf ("% s: B =% d\ n ", _ _ func__, b); return 0;}" what is the concept of inline assembly in c language ". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!