at first, sorry for my bad english. As the headline says, I'd like to work with nasm in C/C++ to develop my own os. The reason of this is because I'm a total asm beginner, but I've got some experience in C++, so it would be easier for me to combine C++ with NASM.
Does someone know a C/C++ compiler that supports inline NASM?
The common C++ compilers support their own native version of inline assembler which are different among most compilers. I've not heard of any that supports NASM specific syntax.
I suggest you read the documentation of your chosen compiler in order to find out about inline assembler.
OSwhatever wrote:AT&T syntax should be considered as torture these days.
Very much depends on when and where you learned ASM. I learned on a C64 assembler, the name of which I have long forgotten (we only called it "sys49152" as that was its start address), and I always found AT&T highly intuitive - and Intel syntax as "bass-ackwards".
Another thing where the "Big Corps" have screwed the perception of the masses...
Every good solution is obvious once you've found it.
One, I don't see why you'd want to do that. Two, you can call an extern "C" assembler function from within a C++-mangled or templated function just fine...
Every good solution is obvious once you've found it.
OSwhatever wrote:AT&T syntax should be considered as torture these days. Are we really going to put beginners through that?
Depends what you're used to, I guess. I've never really grown very proficient with either syntax (every assembly snippet in my OS has been a tiny nightmare on its own), but AT&T sounds more familiar to me, closer to natural language. In everyday life, I talk about moving something from a source to a destination, not to a destination from a source. Maybe it's due to me being French, and a native English speaker would rather use the latter, but to me it just sounds weird to put the end of a journey before its beginning in a sentence, except for intellectual masturbation or poetry purposes.
OSwhatever wrote:AT&T syntax should be considered as torture these days. Are we really going to put beginners through that?
Depends what you're used to, I guess. I've never really grown very proficient with either syntax (every assembly snippet in my OS has been a tiny nightmare on its own), but AT&T sounds more familiar to me, closer to natural language. In everyday life, I talk about moving something from a source to a destination, not to a destination from a source. Maybe it's due to me being French, and a native English speaker would rather use the latter, but to me it just sounds weird to put the end of a journey before its beginning in a sentence, except for intellectual masturbation or poetry purposes.
Blah blah blah holy war blah blah.
They're assembler syntaxes. Get over it. It's not like a paradigm shift of C versus Haskell or something.
OSwhatever wrote:AT&T syntax should be considered as torture these days. Are we really going to put beginners through that?
Depends what you're used to, I guess. I've never really grown very proficient with either syntax (every assembly snippet in my OS has been a tiny nightmare on its own), but AT&T sounds more familiar to me, closer to natural language. In everyday life, I talk about moving something from a source to a destination, not to a destination from a source. Maybe it's due to me being French, and a native English speaker would rather use the latter, but to me it just sounds weird to put the end of a journey before its beginning in a sentence, except for intellectual masturbation or poetry purposes.
Natural for some I presume. If you think about it, in C/C++, you do X = Y; X being dest, Y being source. Why does that seem natural in that context, yet backwards in another (asm). It really just depends on the person, nobody is right or wrong, just depends on how you view it.