Assembly and C/C++

Started by
9 comments, last by Daishim 22 years, 9 months ago
Are there any two compilers that work really good with each other? An asm and C/C++ compiler all in one maybe? I have Borlands Turbo C++ that supposedly can have inline assembly but I''m not sure how well that works, any suggestions or comments?

I know only that which I know, but I do not know what I know.
Advertisement
If you want to use assembly code in your program you can either use the inline assembler or use MASM or TASM to generate an .obj file which you can link to the rest of your code using the right compiler directive (read the help file).

BTW: There is no such thing as an "assembly compiler"
Any assembler + any C/C++ compiler pretty much + any linker.

For example NASM and GCC do a good work for me. GCC use GAS for inline assembly and thus AT&T syntax which is IMO rather painful to code with. Besides, I''m almost sure GAS doesn''t support all fancy MMX/SSE/etc intructions.

"This album was written, recorded and edited at Gröndal, Stockholm in the year of 2000. At this point in time money still ruled the world. Capitalistic thoughts were wide spread. From the sky filled with the fumes of a billionarie''s cigar to the deepest abyss drenched in nuclear waste. A rich kid was a happy kid, oh..dirty, filthy times. Let this be a reminder."
- Fireside, taken from back of the Elite album
Where can I get the MASM 5.1. It seems to be regarded as one of the better assembly programs? I''ve tryed MASM32 but it won''t take a lot of the dos assembly coding.

I know only that which I know, but I do not know what I know.
IF you''re just trying to throw in a bit of ASM, a C comiler alone will work.

__asm {
...
}
Moving this to General Programming....

-Chris Bennett of Dwarfsoft - The future of RPGs Thanks to all the goblins in the GDCorner niche
__ asm {
...
}

Doesn''t work for all compilers. it isnt standard C/C++. I don''t know why it wouldn''t be standardized. It really should be. How exactly tho, can someone answer, do you link them? How can you call the assembly code?

(http://www.ironfroggy.com/)(http://www.ironfroggy.com/pinch)
ok, but how do I link the Assembly .obj with the C .obj ... I''m assuming one must use command prompt access... anyone know what the prompts are for any specific compiler? I''m working with Borland Turbo C++ and MSVC++ , but I can figure out how to actually do the linking of the two objs.

I know only that which I know, but I do not know what I know.
Well I haven''t tried it yet but there are 2 ways that I would try

project->add to project->files select Object Files (.obj) or project->settings->link->object/library modules.

Seeya
Krippy
Forgot to mention that is for MSVC not Borland. Haven''t used Borland C++ compiler in a very long time (first version of Turbo C++).

Seeya
Krippy

This topic is closed to new replies.

Advertisement