From: "D Poinsett"
Newsgroups: sci.electronics.design
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
Message-ID:
References: <3e162515$0$27994$afc38c87@news.optusnet.com.au>
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
Hi Jon,
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?
Dave Poinsett
"Jonathan Kirwan" wrote in message
news:evte1v45foaeksa29og6j7lnml8aki93hl@4ax.com...
> On Sat, 4 Jan 2003 18:23:50 -0500, "D Poinsett"
> wrote:
>
> >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.
Most
> >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.
There
> >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.
>
> Jon
>
>
>
> >
> >Dave Poinsett
> >
> >"Jonathan Kirwan" wrote in message
> >news:u0qe1v0k44vhktgoo963te9loi8vdh8uq3@4ax.com...
> >> 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
> >>
> >
>