|
From: Daniel K. O. <dan...@ya...> - 2004-06-14 21:53:36
|
Brian Wallace wrote:
> Couple questions about C++ compilers. Do they all have the ability to
> plugin assembly?
> IE: With VC++ 6.0
>
> __asm{
> -insert assembly here-
> }
IIRC, a C++ compiler doesn't have to support inline assembly. But almost
all C++ compilers support some way to write inline assembly.
> Will this work with all compilers.
Each compiler can have its own syntax for inlining assembly in the code;
and each one can have its own assembly syntax; and each different
architecture will have its own assembly syntax. So no, it won't work
with all compilers.
> I mainly want this for Linux programming. If anyone knows of a C++
> compiler for Linux that has easy assembly plugin context, please tell.
Ever heard of GCC? http://gcc.gnu.org :)
Also, a useful document about assembly in GCC:
http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html
(this doc is a little outdated; GCC now supports both AT&T and Intel
syntax, you just have to use the directive ".intel_syntax" or
".att_syntax", or compile with "-masm=att" or "-masm=intel")
> I want to do this to have complete control over video.
You mean you want to control your video hardware directly? The operating
system is in charge of the hardware handling, you can only use the
provided API. Inside an OS, you'll have as much control over your video
hardware with assembly as with C++ or almost every other language. If
you want to access the hardware directly you can't have an OS in your way.
> Thanks for time, please respond soon.
Quoting a popular writting from 'someone known by the "ESR" acronym':
http://www.catb.org/~esr/faqs/smart-questions.html#urgent
Danmiel K. O.
|