[Top][All Lists]

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

[avr-gcc-list] GCC can now use cbi, sbi, sbic, sbis

From: Marek Michalkiewicz
Subject: [avr-gcc-list] GCC can now use cbi, sbi, sbic, sbis
Date: Fri, 10 May 2002 18:06:46 +0200 (CEST)


just to let you know - I'm very busy, but not completely dead yet ;)

In the CVS tree (which will be released as GCC 3.2 in the future - 3.1
is too late before the release now, so no new features, bug fixes only)
there is now support for directly using the cbi, sbi, sbic, sbis
instructions to clear/set/test bits in the lower half of the I/O space.
Now you can do things like this:

#define PINA (*(volatile unsigned char *)0x39)
#define PORTA (*(volatile unsigned char *)0x3b)

  PORTA &= ~0x10;
  PORTA |= 0x20;
  if (PINA & 0x40) { ... }

and (if optimization is enabled) generated code will be optimized to
use these instructions, without loading the value from the I/O port
to a register.  Thanks to Alexey Boyko <address@hidden> for the idea
how to do this, and for alpha-testing my patch before I applied it.

This also means that I/O support in avr-libc will be simpler, no more
need to use all these ugly macros...

BTW, Atmel has just released a datasheet for ATmega162 - a new device
(basically an improved ATmega161, much like ATmega128 is an improved
ATmega103) with data space starting at 0x100 instead of 0x60.  So the
trouble I expected with the growing number of ld emulations is real...

Just wondering, what will be next (Atmel won't tell you without an NDA),
there is no "improved AT90S2313 with 4K flash, self-programming and
enhanced core" yet - I guess it might be called ATmega4 ;)


avr-gcc-list at http://avr1.org

reply via email to

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