EmbeddedRelated.com
Books

ARM Assembly Language Programming with Raspberry Pi using GCC

Naimi, Sepehr, Naimi, Sarmad, Yaghini, Azalia, M 2018

About the Raspberry Pi: Raspberry Pi boards are low cost yet powerful boards using Arm processors. They can be used for both educational and industrial purposes. About this book: This book covers Arm Assembly programing for Raspberry Pi boards. Although the Arm instructions are standard, the assembler directives vary in GCC and non-GCC assemblers. In this book, you learn how to write Arm assembly programs in Linux and the GCC based compilers. This book also gives you a general view of the Arm and Raspberry Pi architecture. If you are using this book for a university course, the source code, tutorials, Power Points and other support materials are available on our websites: www.MicroDigitalEd.com and www.NicerLand.com Here is the table of contents: Chapter 1: The History of ARM, Raspberry Pi, and Microprocessors Chapter 2: ARM Architecture and Assembly Language Programming Chapter 3: Arithmetic and Logic Instructions and Programs Chapter 4: Branch, Call, and Looping in ARM Chapter 5: Signed Integer Numbers Arithmetic Chapter 6: ARM Memory Map, Memory Access, and Stack Chapter 7: ARM Pipeline and CPU Evolution Chapter 8: ARM and Thumb Instructions Chapter 9: ARM Floating-point Arithmetic Chapter 10: Interrupts and Exceptions Chapter 11: Cache in ARM Appendix A: ARM Cortex-A Instruction Description Appendix B: ARM Assembler Directives Appendix C: Macros Appendix D: Flowcharts and Pseudocode Appendix E: Passing Arguments into Functions We also have a book on writing Arm Assembly Programs for non-GCC compilers entitled "ARM Assembly Language Programming & Architecture" which covers Arm assembly language programming for Keil and other non-GNU IDEs.


Why Read This Book

You will learn how ARM assembly really works on a Raspberry Pi using the widely available GCC toolchain and Linux environment, with practical examples you can assemble, link, run, and debug. The book emphasizes real-world workflows—GNU assembler directives, calling conventions, and mixed C/assembly—so you can move from experiments to embedded projects or university labs quickly.

Who Will Benefit

Embedded engineers, university students, and hobbyists with basic programming experience who want to write and optimize ARM assembly on Raspberry Pi boards and integrate it with C/Linux toolchains.

Level: Intermediate — Prerequisites: Basic programming experience (C recommended), familiarity with the Linux command line, and elementary understanding of binary/hex and CPU concepts (registers, memory).

Get This Book

Key Takeaways

  • Write and assemble ARM (AArch32/AArch32/ARMv6–v7 family) programs using the GNU assembler and GCC toolchain on Raspberry Pi
  • Use calling conventions and link assembly with C code to build mixed-language programs
  • Debug and profile assembly programs with GDB, objdump, and related GNU utilities
  • Access memory-mapped peripherals and perform low-level I/O on Raspberry Pi under Linux and in bare-metal examples
  • Understand ARM instruction categories, addressing modes, and the differences between ARM and Thumb encodings
  • Optimize small routines for size and speed and reason about performance on Raspberry Pi processors

Topics Covered

  1. 1. The History of ARM and Raspberry Pi
  2. 2. Overview of Raspberry Pi Hardware and SoCs (BCM283x series)
  3. 3. ARM Architecture Basics: Registers, Modes, and Execution States
  4. 4. ARM Instruction Set: Data Processing, Branching, and Load/Store
  5. 5. Addressing Modes, Condition Codes, and Thumb/Thumb-2
  6. 6. GNU Assembler (gas) and GCC Toolchain: Syntax, Directives, and Differences
  7. 7. Building, Linking, and Running Assembly Programs on Linux
  8. 8. Calling Conventions and Interfacing with C (inline asm, ABI details)
  9. 9. System Calls, I/O, and Memory-Mapped Peripheral Access on Raspberry Pi
  10. 10. Debugging and Profiling Assembly with GDB, objdump, and strace
  11. 11. Bare-Metal vs Linux Userland Assembly: Bootstraps and Examples
  12. 12. Performance Tips, Code Size Reduction, and Common Pitfalls
  13. 13. Worked Projects and Example Programs
  14. Appendices: Toolchain Setup, Cross-compilation, Reference Tables

Languages, Platforms & Tools

ARM assembly (AArch32/ARM)CRaspberry Pi (BCM283x: Pi 1/2/3 families using ARM cores)ARM (ARMv6/ARMv7 family – AArch32)GCC (arm-linux-gnueabihf / gcc on Raspberry Pi)GNU assembler (gas/as)ld / gold linkerobjdump, readelfGDBmakeQEMU (optional for emulation)

How It Compares

Covers ARM assembly on Raspberry Pi in a GNU/Linux context similar to William Hohl's ARM assembly texts, but focuses specifically on GCC/gas workflows and Raspberry Pi hardware rather than broader ARM architecture theory; complements the ARM System Developer's Guide by providing hands-on assembly examples tied to Pi boards.

Related Books

Bryant, Randal, O'Hallaron,...