Combuster wrote:This is an community of programming experts,
Alas, we're not very literate.
Either way, I have to agree with Combuster. You don't even understand the difference between inline assembly (i.e., using asm blocks introduced in C99) and inline functions (compiler hints which may very well be ignored).
Either way, I usually discourage the use of assembly in programs because it makes them unportable (rarely, certain situations call for performance/size optimizations and then assembly is needed). In OSes this can be avoided even less so here's my take on the situation: if you're going to use assembly, use separate files and link everything together at the end. You will clobber your source less, will make the code tree easier to maintain (e.g., if you wanted to port your OS to a new architecture, you'd see all the .asm files there, you wouldn't need to scan thousands of .c files for their assembly bits) and most importantly, you will be able to use more compilers to compile your code. The usage of the asm keyword varies from implementation to implementation and this is okay, according to the standard. For instance, in MSVC you have asm blocks ( asm { /* ... */ } ), while in GCC you have something similar to functions that take string parameters (a mess, IMHO).
The only advantage to inline assembly is that it abstracts the ABI bits (e.g., in a separate file you will need to know the proper calling convention that your compiler uses). However, I for one would rather want to have a clean C code base and a messy asm one than the other way around as there's a lot more C in a typical project.