From: "D Poinsett"
Subject: Re: To C or not to C
Date: Sat, 4 Jan 2003 22:31:42 -0500
Organization: Posted via Supernews, http://www.supernews.com
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
I'm not sure what you mean by <> that are impossible to realize
with a high level language like C but are possible with assembly language. I
have never designed anything that would fall into this category and, other
than something very exotic, I cannot imagine what it might be. Is this
something that applies to the kind of ordinary applications that most of us
are familiar with? Do you have a simple example?
"Jonathan Kirwan" wrote in message
> On Sat, 4 Jan 2003 18:23:50 -0500, "D Poinsett"
> >Right you are.
> >I frequently use inline assembler just to take advantage of the HC11/HC12
> >instructions for setting/resetting individual bits. It's an elegant
> >instruction that fulfills a commonly used function in embedded designs.
> >C compilers are much more clumsy at this and, in fact, one must be very
> >careful that the bits are managed correctly when doing it in C only.
> >are probably other and better examples but this came to mind.
> (I won't take the time to put this discussion in order. Folks
> will just have to cope...)
> I wasn't thinking about that. C can simulate "rotate left" and
> "rotate right," for example, or bit set and bit clear, as you
> mention. I'm talking about <> which simply cannot be
> reached. I'm not talking 'just clumsily', but *impossible* no
> matter how much or little code is written. Quite another story.
> >Dave Poinsett
> >"Jonathan Kirwan" wrote in message
> >> On Sat, 4 Jan 2003 12:45:36 -0500, "D Poinsett"
> >> wrote:
> >> >
> >> >Often only a few, if any, sections of code need blazing speed.
> >> >
> >> That isn't the only reason for assembler coding. There are
> >> semantics available in assembler that aren't just "difficult" in
> >> C, but impossible to code in C. Just wanted to point out that
> >> speed isn't the sole driver for choosing asm, at times.
> >> Jon