6.10 #pragma, General Purpose

Syntax

  1. #pragma warning range byte option

  2. #pragma overlap option

  3. #pragma error instruction

  4. #pragma warning instruction

Description

  1. The assembler evaluates constant integer expressions as 64-bit signed integers internally. When such expressions are used as immediate operands, they must be truncated to the number of bits required by the instructions. For most operands, an out-of-range value will cause an "operand out of range" error message. However, the immediate byte operands for the LDI, CPI, ORI, ANDI, SUBI and SBCI instructions (see also http://ww1.microchip.com/downloads/en/devicedoc/atmel-0856-avr-instruction-set-manual.pdf) have several possible interpretations that are affected by this option.
    • option = integer The immediate operand is evaluated as an integer, and if its value is outside the range [-128 ... 255] a warning is given. The assembler doesn't know if the users intends an integer operand to be signed or unsigned, hence it allows any signed or unsigned value that fits into a byte.
    • option = overflow (default) The immediate operand is basically evaluated as an unsigned byte, and any sign extension bits are ignored. This option is particularly suitable when dealing with bit masks, when the integer interpretation would cause lots of warnings, like ldi r16, ~((1 << 7) | (1 << 3))
    • option = none Disables all out-of-range warnings for byte operands. Not recommended.
  2. If different sections of code are mapped to overlapping memory locations using the ORG directive, an error message is normally issued. This options modifies that behavior as follows:
    • option = ignore Ignores overlap conditions altogether; no errors, no warnings. Not recommended.
    • option = warning Produce warnings when overlaps are detected.
    • option = error Consider overlaps as error condition; this is the default and recommended setting.
    • option = default Revert to default handling -error or whatever is specified with the -O command line option.
    The assembler maintains two settings for overlap handling; The default setting that is set up by the -O command-line option, and the effective setting, that only can be modified with this #pragma. The two settings are equal upon assembler invocation. This #pragma changes the effective setting from the line it is invoked until the line it is changed by another invocation of this #pragma. Hence, this #pragma covers source line ranges and not address ranges. See also: OVERLAP and NOOVERLAP.
  3. Causes use of instructions that are unsupported on the specified device to cause an assembler error (default behavior).
  4. Causes use of instructions that are unsupported on the specified device to cause an assembler warning.