New Headers to Allow the Use of I/O Register Assignment Mode

February 2002
By Don Carveth - don@botgoodies.com
and Chris Morse - crmorse@yahoo.com

Use PORTA = x  or  x = PORTA instead of inp(PORTA, x).

See NewHdrs.txt for a discussion on the advantages of this method.  The
headers are based on the Dec. 2001 GCC release and do not include the
latest C++ features in the ATMEGA128 version by Marc Wetzel.

* How to Install

Copy all the files in the archive to your avrgcc\avr\include directory,
overwriting the existing files.  You must copy at lease the io-avr.h, iomacros.h and
one machine specific file to get it operational.

* How to Use

Operation defaults to Assignment mode, which includes compatible macros.
To use legacy Macro mode, insert the following line of code before the call
to io.h in your c program file:

#define _IO_REG_MACRO_MODE_  1

To force Assignment mode insert this line instead:

#define _IO_REG_ASSIGN_MODE_  1


*  Assignment method

The following are all valid statements:

int y;
unsigned char x;

PORTA = x;
x = PORTA;
TCNT1 = y;      /* 16 bit write  */
y = TCNT1;      /* 16 bit read  */

*  Macros

All macros listed in the AVR-libc reference work in assignment mode.

