|Non-Confidential||PDF version||ARM DUI0530M|
|Home > Migrating from RVCT v4.0 to ARM Compiler v4.1 > Assembler changes between RVCT v4.0 and ARM Compiler v4.1|
Various changes have been made to armasm in ARM Compiler toolchain v4.1.
The following changes to the assembler have been made:
Older assemblers sometimes permitted the source file being assembled to introduce
new lines of code between the two passes of the assembler. In the following example,
num is defined in the second pass because the symbol
foo is not defined in the first pass when :DEF: foo is
AREA x,CODE [ :DEF: foo num EQU 42 ] foo DCD num END
The way the assembler reads and processes the file has now changed, and is stricter. You must rewrite code such as this to ensure that the path through the file is the same in both passes. The introduction of new lines in the second pass of the assembler is considered an error, and results in the following error:
Error: A1903E : Line not seen in first pass; cannot be assembled.
The following code shows another example where the assembler faults:
AREA FOO, CODE IF :DEF: VAR ELSE VAR EQU 0 ENDIF END
To avoid this error, you must rewrite this code as:
AREA FOO, CODE IF :LNOT: :DEF: VAR VAR EQU 0 ENDIF END
This works correctly because new lines are not seen in the second pass of the assembler. Instead the lines that were in the first pass are ignored in the second pass.
Generally, any messages referring to a position on the source line now has a caret character pointing to the offending part of the source line, for example:
"foo.s", line 3 (column 19): Warning: A1865W: '#' not seen before constant expression 3 00000000 ADD r0,r1,1 ^
In the ARM instruction set, various instructions using SP (r13) were deprecated
when Thumb-2 technology was introduced. These instructions are no longer diagnosed as
deprecated unless assembling for a CPU that supports Thumb-2 technology. To enable the
warnings on earlier CPUs, you can use the option
--diag_warning=1745,1786,1788,1789,1892. This change was introduced
in the RVCT v4.0 patch 5 (build 697).
-O command-line option is obsolete. Use