GNU Compatible Syntax Option

You can enable GNU compatible assembler syntax either through the ARM Assembler target settings panel in the CodeWarrior IDE, or by specifying -gnu on the mwarmasm.exe command line.

The GNU Compatible Syntax options are effective only when GNU assembler format conflicts with the CodeWarrior assembler format. The following table lists the specific cases.

Table 1. GNU Compatible Syntax Option
Case Comment
Defining Equates Whether defined using .equ or .set, all equates can be re-defined.
Ignored directives The .type directive is ignored.
Undefined Symbols Undefined symbols are automatically treated as imported
Arithmetic Operators
  • < and > mean left-shift and right-shift instead of less than and greater than.
  • < ! > means bitwise-or-not instead of logical not.
Precedence Rules Precedence rules for operators are changed to be compatible with GNU rather than with C.
Local Labels Local labels with multi-number characters are supported (example: "1000:"). There is no limit on the number of digits in the label name. Multiple instances of the label are allowed. When referenced, you get the nearest one - forwards or backwards depending on whether you append 'f' or 'b' to the number.
Numeric Constants Numeric constants beginning with 0 are treated as octal.
Semicolon Use Semicolons can be used as a statement separator.
Unbalanced Quotes A single unbalanced quote can be used for character constants. For example, .byte 'a