Re: Asm programming capability?
- From: "cr88192" <cr88192@xxxxxxxxxxx>
- Date: Wed, 10 Jun 2009 10:47:03 -0700
"Chris M. Thomasson" <no@xxxxxxxxxxxx> wrote in message
news:_xCXl.17$mX2.6@xxxxxxxxxxxxxxx
"cr88192" <cr88192@xxxxxxxxxxx> wrote in message
news:h0kvvj$2c0$1@xxxxxxxxxxxxxxxxxxxx
"deostroll" <deostroll@xxxxxxxxx> wrote in message
news:f016ec41-74ad-4e09-ab8a-a040ae4a641f@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Is the c language designed to execute assembly language instructions?
I would have to say no...
Is it in the standard?
yes and no...
the standard reserves a keyword ('asm') for use for this purpose, but
says little more on the subject.
the actual syntax of asm blocks, as well as any behavior/... they may
exhibit, is a matter left up to the implementation.
so, as a general rule, I don't use inline assembler...
going OT:
[...]
FWIW, I use inline asm and/or externally assembled libraries to create
sensitive synchronization algorithms:
http://groups.google.com/group/alt.lang.asm/msg/bec9d5ebda9441da
inline and external ASM work, just typically one has to modify their ASM
between Windows and Linux, use different Makefile for different CPUs, ...
(as well as make sure ones' preferred assembler is installed, ...).
inline asm is less of a hassle than external ASM, but then it is compiler
specific (and, in the GCC case, forces use of GAS syntax, ...). so, code
which targets both GCC and MSVC would essentially need multiple copies of
all the inline ASM...
these issues are actually what makes run-time ASM preferable in my case...
granted, there is a downside to run-time ASM:
it can't be statically linked with C code (one has to use function pointers,
....);
well, that, and needing to have a run-time assembler linked into the app,
....
between external assembler and inline assembler, I prefer external
assembler...
now, if gcc's inline assembler was like Borland's or Microsoft's inline ASM
(AKA: much nicer looking, and Intel syntax), I would probably use inline
ASM...
or such...
.
- Follow-Ups:
- Re: Asm programming capability?
- From: Antoninus Twink
- Re: Asm programming capability?
- References:
- Asm programming capability?
- From: deostroll
- Re: Asm programming capability?
- From: cr88192
- Re: Asm programming capability?
- From: Chris M. Thomasson
- Asm programming capability?
- Prev by Date: Re: beginner with programming, how to learn to debug and few C general questions
- Next by Date: Re: C SQL DB Library
- Previous by thread: Re: Asm programming capability?
- Next by thread: Re: Asm programming capability?
- Index(es):
Relevant Pages
|