28.9.3.1.1. GNU GAS assembler ARM unified syntax
There are two types of ARMv7 assemblies:
-
.syntax divided
-
.syntax unified
They are very similar, but unified is the new and better one, which we use in this tutorial.
Unfortunately, for backwards compatibility, GNU AS 2.31.1 and GCC 8.2.0 still use .syntax divided
by default.
The concept of unified assembly is mentioned in ARM’s official assembler documentation: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/BABJIHGJ.html and is often called Unified Assembly Language (UAL).
Some of the differences include:
-
#
is optional in unified syntax int literals, see GNU GAS assembler immediates -
many mnemonics changed:
-
most of them are condition code position changes, e.g. ANDSEQ vs ANDEQS: https://stackoverflow.com/questions/51184921/wierd-gcc-behaviour-with-arm-assembler-andseq-instruction
-
but there are some more drastic ones, e.g. SWI vs SVC: https://stackoverflow.com/questions/8459279/are-arm-instructuons-swi-and-svc-exactly-same-thing/54078731#54078731
-
-
cannot have implicit destination with shift, see: Section 30.4.4.1, “ARM shift suffixes”