The Cyber-Spy.Com Usenet Archive Feeds Directly From The Open And Publicly Available Newsgroup Sci.Electronics.Design
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"
Newsgroups: sci.electronics.design
Subject: Re: To C or not to C
Date: Sun, 5 Jan 2003 14:32:37 -0500
Organization: Posted via Supernews, http://www.supernews.com
Message-ID:
References: <3e162515$0$27994$afc38c87@news.optusnet.com.au> <3e1853bb.20798186@news.planet.nl> <3e187255$0$57466$1b62eedf@news.euronet.nl> <3e1880cf$0$57462$1b62eedf@news.euronet.nl>
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
Hi Frank,
Though some HC11/HC12 compiler somewhere might use the native bit set
instructions in this example, mine does not and I suspect that most
compilers do not since every processor I can think of has native
instructions for logical operations like val |= 0x55. Who knows where val is
and what we are going to do with it. Is it a local variable? Will it only
exist on the stack or in a register to be subsequently used in the next
operation?
The generalized operations of a compiler should not outsmart the source code
to the point of doing something unintended so compiler authors tend to be
conservative about this sort of thing. Compiler authors tend to minimize use
of specialize processor instructions unless there is a compelling reason to
do so. An example of a compelling reason is the use of efficient stack
operations in the HC12 that were specifically put there for use by stack
intensive languages like C. Finally, by allowing inline assemble, the
compiler author ultimately gives the C coder easy access to any special
processor features without needing to second guess all the ways they might
be used.
Dave Poinsett
"Frank Bemelman" wrote in message
news:3e1880cf$0$57462$1b62eedf@news.euronet.nl...
>
> snips...
>
> Thanks, I actually realized shortly after I'd hit the 'send' button. I
also
> wondered if a HC11/12 C compiler wouldn't use that single asm-instruction
> if you coded something like ucValue |= 0x55;
>
> --
> Thanks,
> Frank Bemelman
> (remove 'x' & .invalid when sending email)
>
>
Go Back To The Cyber-Spy.Com Usenet Web Archive Index Of The sci.electronics.design Newsgroup
|