The Cyber-Spy.Com Usenet Archive Feeds Directly
From The Open And Publicly Available Newsgroup
This Group And Thousands Of Others Are Available
On Most IS NNTP News Servers On Port 119.
Cyber-Spy.Com Is NOT Responsible For Any Topic,
Opinions Or Content Posted To This Or Any Other
Newsgroup. This Web Archive Of The Newsgroup And
Posts Are For Informational Purposes Only.
From: "D Poinsett"
Subject: Re: To C or not to C
Date: Sun, 5 Jan 2003 12:16:19 -0500
Organization: Posted via Supernews, http://www.supernews.com
References: <email@example.com> <firstname.lastname@example.org>
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
However, bit twiddling/testing macros vary depending on the target processor
and the way the macro is written. A common method is to read a byte, execute
some AND or OR instruction, and possibly write the result back. For
processors like the HC11/HC12, multiple bits can be set/reset/tested in one
instruction eliminating the possibility that changes may have occurred in
that register/memory location (due to an interrupt or hardware, for
example), changes that could be disturbed if the result of the macro bit
twiddling/testing is written back to that location after the change
I intended the example to support agreement with the idea that some things
might be better done in assembly than C.
"Nico Coesel" wrote in message
> "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.
> >C compilers are much more clumsy at this and, in fact, one must be very
> Most embedded C compilers come with pre-defined (inline assembly)
> macro's for that purpose. I don't see this as a good point.
> Reply to nico@nctdevpuntnl (punt=.)
> Bedrijven en winkels vinden? Adresboekje.nl
Go Back To The Cyber-Spy.Com
Usenet Web Archive Index Of
The sci.electronics.design Newsgroup