Table of Contents

Cover image

Title page

Copyright

List of Tables

List of Figures

List of Listings

Preface

Choice of Processor Family

General Approach

Companion Website

Acknowledgments

Part I: Assembly as a Language

Chapter 1: Introduction

Abstract

1.1 Reasons to Learn Assembly

1.2 The ARM Processor

1.3 Computer Data

1.4 Memory Layout of an Executing Program

1.5 Chapter Summary

Exercises

Chapter 2: GNU Assembly Syntax

Abstract

2.1 Structure of an Assembly Program

2.2 What the Assembler Does

2.3 GNU Assembly Directives

2.4 Chapter Summary

Exercises

Chapter 3: Load/Store and Branch Instructions

Abstract

3.1 CPU Components and Data Paths

3.2 ARM User Registers

3.3 Instruction Components

3.4 Load/Store Instructions

3.5 Branch Instructions

3.6 Pseudo-Instructions

3.7 Chapter Summary

Exercises

Chapter 4: Data Processing and Other Instructions

Abstract

4.1 Data Processing Instructions

4.2 Special Instructions

4.3 Pseudo-Instructions

4.4 Alphabetized List of ARM Instructions

4.5 Chapter Summary

Exercises

Chapter 5: Structured Programming

Abstract

5.1 Sequencing

5.2 Selection

5.3 Iteration

5.4 Subroutines

5.5 Aggregate Data Types

5.6 Chapter Summary

Exercises

Chapter 6: Abstract Data Types

Abstract

6.1 ADTs in Assembly Language

6.2 Word Frequency Counts

6.3 Ethics Case Study: Therac-25

6.4 Chapter Summary

Exercises

Part II: Performance Mathematics

Chapter 7: Integer Mathematics

Abstract

7.1 Subtraction by Addition

7.2 Binary Multiplication

7.3 Binary Division

7.4 Big Integer ADT

7.5 Chapter Summary

Exercises

Chapter 8: Non-Integral Mathematics

Abstract

8.1 Base Conversion of Fractional Numbers

8.2 Fractions and Bases

8.3 Fixed-Point Numbers

8.4 Fixed-Point Operations

8.5 Floating Point Numbers

8.6 Floating Point Operations

8.7 Computing Sine and Cosine

8.8 Ethics Case Study: Patriot Missile Failure

8.9 Chapter Summary

Exercises

Chapter 9: The ARM Vector Floating Point Coprocessor

Abstract

9.1 Vector Floating Point Overview

9.2 Floating Point Status and Control Register

9.3 Register Usage Rules

9.4 Load/Store Instructions

9.5 Data Processing Instructions

9.6 Data Movement Instructions

9.7 Data Conversion Instructions

9.8 Floating Point Sine Function

9.9 Alphabetized List of VFP Instructions

9.10 Chapter Summary

Exercises

Chapter 10: The ARM NEON Extensions

Abstract

10.1 NEON Intrinsics

10.2 Instruction Syntax

10.3 Load and Store Instructions

10.4 Data Movement Instructions

10.5 Data Conversion

10.6 Comparison Operations

10.7 Bitwise Logical Operations

10.8 Shift Instructions

10.9 Arithmetic Instructions

10.10 Multiplication and Division

10.11 Pseudo-Instructions

10.12 Performance Mathematics: A Final Look at Sine

10.13 Alphabetized List of NEON Instructions

10.14 Chapter Summary

Part III: Accessing Devices

Chapter 11: Devices

Abstract

11.1 Accessing Devices Directly Under Linux

11.2 General Purpose Digital Input/Output

11.3 Chapter Summary

Exercises

Chapter 12: Pulse Modulation

Abstract

12.1 Pulse Density Modulation

12.2 Pulse Width Modulation

12.3 Raspberry Pi PWM Device

12.4 pcDuino PWM Device

12.5 Chapter Summary

Exercises

Chapter 13: Common System Devices

Abstract

13.1 Clock Management Device

13.2 Serial Communications

13.3 Chapter Summary

Exercises

Chapter 14: Running Without an Operating System

Abstract

14.1 ARM CPU Modes

14.2 Exception Processing

14.3 The Boot Process

14.4 Writing a Bare-Metal Program

14.5 Using an Interrupt

14.6 ARM Processor Profiles

14.7 Chapter Summary

Exercises

Index