
IntroductionThis webpage contains files which allows the user to use Register and Bit names from the databook when writing assembly programs. To use the files,
simply include them in the top of the source code. The files are named according to the following convention:
<Part Number> def.inc
As an example, AT90S8515 programs should include the following assembler directive:
.include "8515def.inc"
In addition, the pointer registers R26 - R31 have been assigned names according to the following table:
Table 1. Pointer Name Definitions
| Register | Name |
| R26 |
XL |
| R27 |
XH |
| R28 |
YL |
| R29 |
YH |
| R30 |
ZL |
| R31 |
ZH |
Note: For the AT90S1200 or similar, the
only defined pointer is R30 - ZL.
For controllers with SRAM, the constant "RAMEND" is defined. For all devices, the constants "FLASHEND" and "EEPROMEND" are defined. This number is useful when initializing the Stack pointer to point at the highest internal SRAM address. Finally, the interrupt addresses have been defined, and can be used together with the ".org" directive in the assembler to position an interrupt vector at the correct memory location. See the file listing for details on this.
To prohibit use of non-implemented instructions, all files contain a ".device" directive for the target MCU. As new AVR products are released, new
files will be made available. Usage Bit names in the files are defined as numbers 0-7. The user should be aware of the difference between using bit names with instructions that take bit masks as operands, and instructions that take bit numbers as operands.
Instructions that take bit masks are:
CBR- Clear Bit in Register
SBR - Set Bit in Register
Instruction that take bit numbers are:
CBI - Clear Bit in I/O register
SBI - Set Bit in I/O register
SBIC- Skip if Bit in I/O Register Cleared
SBIS- Skip if Bit in I/O Register Set
SBRC- Skip if Bit in Register Cleared
SBRS- Skip if Bit in Register Set
BLD- Bit LoaD from T-flag
BST- Bit STore to T-flag
To convert a bit number to a bit mask, use the shift left-operator ("<<") in the assembler. Observe that the "+" operator has precedence over "<<".
See the following program example:
sbr r16,(1<<SE)+(1<<SM) ;set SE and SM
out MCUCR,r16 ;in MCUCR

Click HERE to download all the AVR definition files. (inc = include)
The contents of the AVR000.zip file consists of the following AVR types:
1200def.inc - AT90S1200
2313def.inc - AT90S2313
2323def.inc - AT90S2323
2343def.inc - AT90S2343
4414def.inc - AT90S4414
4433def.inc - AT90S4433
4434def.inc - AT90S4434
8515def.inc - AT90S8515
8535def.inc - AT90S8535
m103def.inc - ATMEGA103
m128def.inc - ATMEGA128
m161def.inc - ATMEGA161
m162def.inc - ATMEGA162
m163def.inc - ATMEGA163
m165def.inc - ATMEGA165
m168def.inc - ATMEGA168
m169def.inc - ATMEGA169
m16def.inc - ATMEGA16
m2560def.inc - ATMEGA2560
m2561def.inc - ATMEGA2561
m323def.inc - ATMEGA323
m3250def.inc - ATMEGA3250
m325def.inc - ATMEGA325
m3290def.inc - ATMEGA3290
m329def.inc - ATMEGA329
m32def.inc - ATMEGA32
m406def.inc - ATMEGA406
m48def.inc - ATMEGA48
m469def.inc - ATMEGA469
m64def.inc - ATMEGA64
m8515def.inc - ATMEGA8515
m8535def.inc - ATMEGA8535
m88def.inc - ATMEGA88
m8def.inc - ATMEGA8
pwm2def.inc - PWM2
pwm3def.inc - PWM3
tn11def.inc - ATTINY11
tn12def.inc - ATTINY12
tn13def.inc - ATTINY13
tn15def.inc - ATTINY15
tn22def.inc - ATTINY22
tn2313def.inc - ATTINY2313
tn26def.inc - ATTINY26
tn28def.inc - ATTINY28
tn45def.inc - ATTINY45