Here's a good paper from ARM TechCon about mixing assembler with High-Level Languages (HLLs) such as C and C++
very dangerous in the hands of a novice."
It seems to me that the vast majority of questions about inline assembler on this (and other) forums are from novices - and, thus, are generally bad ideas.
The article outlines 3 ways to access assembler functionality, in order of preference:
1. First, use Compiler Intrinsics wherever possible;
2. Use separate assembler source files, with functions to be called from the HLL;
3. As a last resort, and only for experienced developers, use inline assembler.
These principles would equally apply to C51 - and any other compiler...
Yes, it does specifically refer to GCC.
But I think the warning applies generally: in principle at least, inline assembler gives you direct, unfettered access to the entire CPU; so this is inherently a dangerous thing, only to be used with extreme care by those who really understand the issues - certainly not something for novices to play with!
As noted in my original post, my main concern about the vast majority of inline assembler questions that appear on this (and other) forums is that they are obviously not based on any clear understand - if any understanding at all - of the issues!
Hence anything that promotes a more excellent way must be a Good Thing...