From: Spehro Pefhany
Subject: Re: To C or not to C
References: <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com>
X-Newsreader: Forte Agent 1.92/32.572
Date: Sun, 05 Jan 2003 19:39:00 GMT
NNTP-Posting-Date: Sun, 05 Jan 2003 14:39:00 EST
On Sun, 5 Jan 2003 20:33:17 +0100, the renowned "Frank Bemelman"
>"Nico Coesel" schreef in bericht
>> "Frank Bemelman" wrote:
>> >Thanks, I actually realized shortly after I'd hit the 'send' button. I
>> >wondered if a HC11/12 C compiler wouldn't use that single asm-instruction
>> >if you coded something like ucValue |= 0x55;
>> Only one way to find out; flip one bit this way and look what the
>> compiler produces. Many compilers, for examples, replace a division or
>> multiplycation by 2^n with a shift instruction.
>Yes, or even follow it with an add or sub, when multipying by 9 or 7 etc.
Are any compilers for micros that smart? This is another case where a
bit of inline assembly can make things fly- hard wiring multiplication
by constants. Compared to naive division by a constant, it might be
"it's the network..." "The Journey is the reward"
firstname.lastname@example.org Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com