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

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

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


From: Pertti Kellomäki
Subject: Re: [avr-gcc-list] What Happened to the sbi() and cbi() Macros????
Date: Fri, 4 Feb 2005 10:17:54 +0200

4. helmi 2005 kello 01:00, Richard Urwin <address@hidden> wrote:
It seems to me that there are two arguments here:

1. The removal of cbi and sbi breaks existing code.

2. The removal of cbi and sbi make code more obscure.

You are missing the third argument, which has been
thrown about to support removing them:

3. The removal of cbi and sbi makes code cleaner

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".
--
Pertti


reply via email to

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