Programming with 64-Bit Arm Assembly Language: Single Board Computer Development for Raspberry Pi and Mobile Devices


Price:
Sale price$39.99

Description

Introduction

General preface information in most computer books.

Chapter 1: Getting Started

Provide a bit of background and history of the ARM Processor leading up to the modern 64-bit processors that this book is about. Covers what you need to write programs like those in this book. GNU GCC compiler, GDB, a text editor, etc. Covers hardware you require to run the programs in this book including how to run a Raspberry Pi in 64-bit mode or using another SBC like the NVidia Jetson Nano.

Talk about how programs are represented in memory and then how you use an Assembler to generate them. Cover the linking process and give a very small example. The chapter concludes with a simple "Hello World" program written in ARM 64-bit Assembler.

About the ARM ProcessorWhat You Will LearnWhy Use AssemblyTools You NeedComputers & NumbersARM Assembly InstructionsCPU RegistersARM Instruction FormatMemoryAbout the GCC AssemblerHello WorldAbout the Starting CommentWhere to StartAssembly InstructionsDataCalling LinuxReverse Engineering Our Program

The goal is to always have working sample programs, this is the first, to just ensure the reader can enter, assemble and link.

Chapter 2: Loading, Adding & SubtractingNegative NumbersAbout Two's ComplementAbout Gnome Programmer's CalculatorAbout One's ComplementBig vs. Little EndianAbout Bi-endianPros of Little EndianShifting & RotatingAbout Carry FlagAbout the Barrel ShifterBasics of shifting and rotatingLogical Shift LeftLogical Shift RightArithmetic Shift RightRotate RightRotate Right ExtendMOV/MVNAbout MOVTThe Dreaded Flexible Operand2Register & ShiftSmall Number & RotationMVNMOV ExamplesADD/ADCAdd With CarrySUBChapter 3: Tooling Up

Now that we can start to write some longer code, we need to get into debugging. We also introduce makefiles. Cover the basics and typical workflows for writing/debugging programs.

GNU MakeRebuilding a fileA Rule for Building .s filesDefining VariablesCross CompilingBuilding for ARM on IntelBuilding for AndroidBuilding for iOSGDBPreparing to DebugBeginning GDBSource Control and Build ServersGitJenkinsChapter 4: Controlling Program Flow

Introduce how to do if/else statements and loops. Introduce design patterns. Talk more about making your programs readable and maintainable.

Unconditional BranchAbout the CPSRBranch on ConditionAbout the CMP InstructionLoopsFOR LoopsWhile LoopsIf/Then/ElseLogical OperatorsANDEORORRBICDesign PatternsConverting Integers to AsciiUsing Expressions in Immediate ConstantsStoring a Register to MemoryWhy Not Print in Decimal?Performance of Branch InstructionsMore Comparison InstructionsSummaryChapter 5: Thanks for the Memories

Covers loading from and storing to the Pi's memory. Indexed memory operation, etc.

Defining Memory ContentsLoading a RegisterPC Relative AddressingLoading from MemoryIndexing Through MemoryWrite BackPost-Indexed AddressingConverting to Upper-caseStoring a RegisterDouble RegistersSummaryChapter 6: Functions & the StackStacks on LinuxBranch with LinkNesting Function CallsFunction Parameters & Return ValuesManaging the RegistersSummary of the Function Call AlgorithmUpper-Case RevisitedStack FramesStack Frame ExampleDefining SymbolsOne More OptimizationMacrosInclude DirectiveMacro DefinitionLabelsWhy Macros?SummaryChapter 7: Linux Operating System Services

Cover how Linux system calls work from Assembler. Cover how to do basic file I/O and other useful tasks like timing code.

So Many ServicesCalling ConventionStructuresWrappersConverting a File to Upper CaseOpening a FileError CheckingLoopingSummaryChapter 8: Programming GPIO Pins

Create a simple Assembler program to flash some LEDs attached via a breadboard to the GPIO pins.

GPIO OverviewIn Linux, Everything is a FileFlashing LEDsMoving Closer to the MetalAbout Raspberry Pi 4 RAMIn Devices, Everything is MemoryRegisters in BitsGPIO Function Select RegistersGPIO Output Set and Clear RegistersMore Flashing LEDsRoot Acce

Author: Stephen Smith
Publisher: Apress
Published: 05/02/2020
Pages: 428
Binding Type: Paperback
Weight: 1.40lbs
Size: 9.21h x 6.14w x 0.92d
ISBN13: 9781484258804
ISBN10: 1484258800
BISAC Categories:
- Computers | Hardware | General

About the Author
Stephen Smith 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. Since retiring he has pursued Artificial Intelligence programming, 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.