Inline assembly is more portable because you use #ifdef __POCC__ to select assembly or C code depending on the compiler and platform.
Most modern assemblers support a similiar directive for changing based on symbols (so portability between various platforms can be achieved in much the same way). As for switching between C and Assembly, that's what I don't like. I personally prefer to keep such code seperated into different files. By doing that, you get to choose your prefered assembler and syntax. You can also use the various extentions, libraries, toolkits, etc. that have been developed for that assembler. For example, you mentioned MASM, an assembly programmer could make use of OA32 which comes with many modules for graphics, UI development, COM/OOP, etc. which could simplify a lot of work. Or for example Paul's GeneSys Library which has many procedures to simplify development on Win32 platforms built into linkable libraries for your development and include files for use with MASM. Notably I personally don't use any of these being a NASM/PoASM/GoASM user.. but they are examples as to what I was talking about as far as why a person should work their assembly code seperately from their C code.
Inline assembly is smarter because you get to use some C like constructs rather than writing pure TASM or MASM. Anything that makes assembly look more like C makes it better. Anything that makes assembly look less like C makes me less likely to use it, which may be your intent.
True, my source isn't normally in a very "high level format" compared to many people. But I just see it as, if you are going to use C, use C, if you are going to use assembly, use assembly. If you want something in between, go look at some of the psuedo-assemblers like HLA or EASM.
Perhaps you don't like the limited functionality of Pelles inline assembly when compared with Borland or GCC implementations.
Never used anything from Borland other than TASM and never really liked it all that much. As for GCC, I don't particularly care for AT&T syntax assembly, I'll use it if I have to but that's about as far as it goes. Even when I get stuck coding with GAS I normally switch over using .intel_syntax first chance I get.
I agree with Severach in that I'm for inlined asm. Although I mainly code in C, to have the possibility of using inlined asm when needed is a great plus.
John
Emphasis on "a great plus". I can agree with that. There are a few circumstances where inline assembly can be "a great plus" like when the compiler doesn't want to generate the opcodes you are expecting and you can't seem to figure out a way to make it do it. Just use __asm() and insert the opcodes yourself. Or when you want to use the compiler's optimizer, but you want to make sure that a certain set of opcodes are produced at a certain point (I've had that happen two or three times). And another good one is __asm(int 3) to generate a breakpoint; I actually have a macro which displays a message with fprintf to stderr and is followed by an int3 hardware breakpoint. The macro only inserts that code whereever the DPRINTF(...); lines are if __DEBUG__ is defined. So yea, there are some circumstances where it can be "a great plus" but for overall code design I don't suggest people become reliant on it and I personally consider it to be a bad programming practice.
Regards,
Bryant Keller