Assembler and C++

So, when we realy should use assembler "insertions" instead of C or C++ code..?
Never. You won't get around some assembly when writing e.g. an operating system, but you should keep functions where it is absolutely unavoidable out of C or C++ code and compile the assembler code separately.
ok, thx you )

Did you use assembler "insertions" in your projects?
Using inline assembly is generally frowned upon because in doing so, you make two assumptions:
1. That anyone reading your source understands assembly code
2. That anyone compiling your program is using the same processor as you are (since different processors have different instruction sets and therefore different assembly languages).

It is better to (as Athar said) write your assembly functions in files separate from the C source files and then declare them extern in your C sources so you can call them.
The meaning of the inline assembly ( asm("whatever") ) is implementation-defined

Topic archived. No new replies allowed.