avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fw: [avr-gcc-list] What Happened to the sbi() and cbi() Macros????


From: bethell
Subject: Fw: [avr-gcc-list] What Happened to the sbi() and cbi() Macros????
Date: Fri, 04 Feb 2005 15:57:37 +0500

Hello,
>
> This is what has been objected to in many posts. I am still
> mystified what metric makes
>
>    SFR &=~mask;
>
> simpler and cleaner than
>
>    cbi(SFR, bit_num);
>
> It is not that I cannot decode the first form. I can still after
> twenty years write RCA 1802 assembly in hex from my head.
> I just prefer "clear this bit in SFR for me" to "negate this bitfield,
> do a bitwise and, and assign the result to SFR".
> --------------------------------------------

I agree with you, and I'm sure everyone else will too.
But the point is not that.
The point is whether it should be supported at an 'official' level, when
they really serve no purpose.
No one is prevented from creating any number of customised macros to improve
readability- in fact thats what they're there for.
I too have created (AT89c51 & SDCC) since C does not have
'rotate'instruction :-

/* rotate right byte*/
#define RRB(var)     ((var >> 1) |(var << 7))

This was for convenience and readability, but I cannot demand that the
developers include it in their package.
However, if any one has any 'cool' macros or header files,, they can post it
(or links) on this list :)

Regards,
--Royce.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]