Page 16 - ARM 64 Bit Assembly Language
P. 16
Preface
practices. This textbook puts strong emphasis on using structured programming concepts. The
relative simplicity of the ARM architecture makes this possible.
One of the major reasons to learn and use assembly language is that it allows the programmer
to create very efficient mathematical routines. The concepts introduced in this book will en-
able students to perform efficient non-integral math on any processor. These techniques are
rarely taught because of the time that it takes to cover the x86 instruction set. With the ARM
processor, less time is spent on the instruction set, and more time can be spent teaching how
to optimize the code.
The combination of the ARM processor and the Linux operating system provide the least
costly hardware platform and development environment available. A cluster of ten Raspberry
Pis, or similar hosts, with power supplies and networking, can be assembled for 500 US dol-
lars or less. This cluster can support up to 50 students logging in through secure shell (ssh).
If their client platform supports the X window system, then they can run GUI enabled appli-
cations on the host, and have the GUI display directed to their client. Alternatively, most low-
cost ARM systems can directly drive a display and take input from a keyboard and mouse.
With the addition of an NFS server (which itself could be a low-cost ARM system and a hard
drive), an entire Linux ARM based laboratory of 20 workstations could be built for 250 US
dollars per seat or less. Admittedly, it would not be a high-performance laboratory, but could
be used to teach C, assembly, and other languages. The author would argue that beginning
programmers should learn to program on low-performance machines, because it reinforces a
life-long tendency towards efficiency.
General approach
The ARMv8-A architecture has two architectural modes: AArch32 and AArch64. In moving
from 32-bit machines to 64-bit machines, ARM chose to completely re-design the architec-
ture. As a result, the two processing modes have completely different assembly languages.
The AArch32 mode allows backwards-compatible execution of ARMv7 (and older) code.
This book focuses exclusively on the 64-bit AArch64 execution state and assembly language.
The approach of this book is to present concepts in different ways throughout the book,
slowly building from simple examples towards complex programming on bare-metal embed-
ded systems. Students who don’t understand a concept when it is explained in a certain way
may easily grasp the concept when it is presented later from a different viewpoint.
The main objective of this book is to provide an improved course in assembly language by
replacing the x86 platform with one that is less costly, more ubiquitous, well-designed, pow-
erful, and easier to learn. Since students are able to master the basics of assembly language
xv