This book is dedicated to my beloved wife and editor Cathalynn Labonté-Smith.
Everyone seems to carry a smartphone and/or a tablet. Nearly all of these devices have one thing in common; they use an ARM central processing unit (CPU). All of these devices are computers just like your laptop or business desktop. The difference is that they need to use less power, in order to function for at least a day on one battery charge, therefore the popularity of the ARM CPU.
At the basic level, how are these computers programmed? What provides the magical foundation for all the great applications (apps) that run on them, yet use far less power than a laptop computer? This book delves into how these are programmed at the bare metal level and provides insight into their architecture.
Assembly Language is the native lowest level way to program a computer. Each processing chip has its own Assembly Language. This book covers programming the ARM 64-bit processor. If you really want to learn how a computer works, learning Assembly Language is a great way to get into the nitty-gritty details. The popularity and low cost of single board computers (SBCs) like the Raspberry Pi and NVidia Jetson Nano provide ideal platforms to learn advanced concepts in computing.
Even though all these devices are low powered and compact, they’re still sophisticated computers with a multicore processor, floating-point coprocessor, and a NEON parallel processing unit. What you learn about any one of these is directly relevant to any device with an ARM processor, which by volume is the number one processor on the market today.
In this book, we cover how to program all these devices at the lowest level, operating as close to the hardware as possible. You will learn the following:
The format of the instructions and how to put them together into programs, as well as details on the binary data formats they operate on
How to program the floating-point processor, as well as the NEON parallel processor
About devices running Google’s Android, Apple’s iOS, and Linux
How to program the hardware directly using the Raspberry Pi’s GPIO ports
The simplest way to learn this is with a Raspberry Pi running a 64-bit flavor of Linux such as Kali Linux. This provides all the tools you need to learn Assembly programming. There’s optional material that requires an Apple Mac and iPhone or iPad, as well as optional material that requires an Intel-based computer and an Android device.
This book contains many working programs that you can play with, use as a starting point, or study. The only way to learn programming is by doing, so don’t be afraid to experiment, as it is the only way you will learn.
Even if you don’t use Assembly programming in your day-to-day life, knowing how the processor works at the Assembly level and knowing the low-level binary data structures will make you a better programmer in all other areas. Knowing how the processor works will let you write more efficient C code and can even help you with your Python programming.
The book is designed to be followed in sequence, but there are chapters that can be skipped or skimmed, for example, if you aren’t interested in interfacing to hardware, you can skip Chapter 8 , “Programming GPIO Pins,” or Chapter 12 , “Floating-Point Operations,” if you will never do numerical computing.
I hope you enjoy your introduction to Assembly Language. Learning it for one processor family will help you with any other processor architectures you encounter through your career.
The source code for the example code in the book is located on the Apress GitHub site at the following URL:
https://github.com/Apress/Programming-with-64-Bit-ARM-Assembly-Language
The code is organized by chapter and includes some answers to the programming exercises.
No book is ever written in isolation. I want to especially thank my wife, Cathalynn Labonté-Smith, for her support, encouragement, and expert editing.
I want to thank all the good folk at Apress who made the whole process easy and enjoyable. A special shout-out to Jessica Vakili, my coordinating editor, who kept the whole project moving quickly and smoothly. Thanks to Aaron Black, senior editor, who recruited me and got the project started. Thanks to Stewart Watkiss, my technical reviewer, who helped make this a far better book.
is also the author of the Apress titleRaspberry Pi Assembly Language Programming . He is a retired Software Architect, located in Gibsons, BC, Canada. He’s been developing software since high school, or way too many years to record. He was the Chief Architect for the Sage 300 line of accounting products for 23 years. Since retiring, he has pursued artificial intelligence, earned his Advanced HAM Radio License, and enjoys mountain biking, hiking, and nature photography. He continues to write his popular technology blog at smist08.wordpress.com and has written two science fiction novels in theInfluence series available on Amazon.com.
He has over 20 years of experience in the IT industry, working in computer networking, Linux system administration, technical support, and cyber security. While working toward Linux certification, he created the web site www.penguintutor.com . The web site originally provided information for those studying toward certification but has since added information on electronics, projects, and learning computer programming.
Stewart often gives talks and runs workshops at local Raspberry Pi events. He is also a STEM Ambassador and Code Club volunteer helping to support teachers and children learning programming.
3.12.36.30