Syntax
- #pragma AVRPART ADMIN PART_NAME
string
- #pragma AVRPART CORE
CORE_VERSION version-string
- #pragma AVRPART CORE
INSTRUCTIONS_NOT_SUPPORTED mnemonic[ operand[,operand] ][:...]
- #pragma AVRPART CORE
NEW_INSTRUCTIONS mnemonic[ operand[,operand]][:...]
- #pragma AVRPART MEMORY
PROG_FLASH size
- #pragma AVRPART MEMORY EEPROM
size
- #pragma AVRPART MEMORY INT_SRAM
SIZE size
- #pragma AVRPART MEMORY INT_SRAM
START_ADDR address
- #pragma partinclude
num
Description
These directives are used to specify various part-specific properties, and are
normally used in the part definition include files (partdef.inc). Normally, there is no
reason to use these pragmas directly in user programs.
Preprocessor macros are not allowed in pragmas. Expressions are not allowed
for the numeric arguments, must be pure numbers in decimal, hex, octal, or binary format.
String arguments must not be quoted. The pragmas specify the following part-specific
properties:
- The part name, e.g., ATmega8.
- The AVR Core version. This defines the
basic instruction set supported. Allowed core versions are currently V0, V0E, V1, V2,
and V2E.
- Colon-separated list of instructions not
supported by this part, relative to the core version.
- Colon-separated list of additional
instructions supported by this part, relative to the core version.
- FLASH program memory size, in
bytes.
- EEPROM memory size, in bytes.
- SRAM memory size, in bytes.
- SRAM memory start address. 0x60 for
basic AVR parts, 0x100 or more for parts with extended I/O.
- For AVRASM1 compatibility. Default
value: 0. If set to 1, it will cause the DEVICE directive to include a
file called device.h that is expected to contain the #pragmas described
above. This enables partdef.inc files designed for AVRASM1 (containing a
DEVICE directive but no part-describing #pragmas)
to be used with AVRASM2. This property can also be set using the AVR Assembler Command Line Options command line option.
Examples
Note that the combination of these examples does not describe a real AVR
part!
- #pragma AVRPART ADMIN PART_NAME
ATmega32
- #pragma AVRPART CORE
CORE_VERSION V2
- #pragma AVRPART CORE
INSTRUCTIONS_NOT_SUPPORTED movw:break:lpm rd,z
- #pragma AVRPART CORE
NEW_INSTRUCTIONS lpm rd,z+
- #pragma AVRPART MEMORY
PROG_FLASH 131072
- #pragma AVRPART MEMORY EEPROM
4096
- #pragma AVRPART MEMORY INT_SRAM
SIZE 4096
- #pragma AVRPART MEMORY INT_SRAM
START_ADDR 0x60