Ed Jorgensen, 2020. — 357 p.
Version 1.1.40.
PrerequisitesWhat is Assembly Language.
Why Learn Assembly Language.
Gain a Better Understanding of Architecture Issues.
Understanding the Tool Chain.
Improve Algorithm Development Skills.
Improve Understanding of Functions/Procedures.
Gain an Understanding of I/O Buffering.
Understand Compiler Scope.
Introduction Multi-processing Concepts.
Introduction Interrupt Processing Concepts.
Additional References.
Ubuntu References.
BASH Command Line References.
Architecture References.
Tool Chain References.
YASM References.
DDD Debugger References.
Architecture Overview.
Architecture Overview.
Data Storage Sizes.
Central Processing Unit.
CPU Registers.
General-Purpose Registers (GPRS).
Stack Pointer Register (RSP).
Base Pointer Register (RBP).
Instruction Pointer Register (RIP).
Flag Register (rFlags).
XMM Registers.
Cache Memory.
Main Memory.
Memory Layout.
Memory Hierarchy.
Exercises.
Quiz Questions.
Data Representation.
Integer Representation.
Two's Complement.
Byte Example.
Word Example.
Unsigned and Signed Addition.
Floating-point Representation.
IEEE -bit Representation.
IEEE -bit Representation Examples.
Example → -.
Example → -.
Example →.
IEEE -bit Representation.
Not a Number (NaN).
Characters and Strings.
Character Representation.
American Standard Code for Information Interchange.
Unicode.
String Representation.
Exercises.
Quiz Questions.
Program Format.
Comments.
Numeric Values.
Defining Constants.
Data Section.
BSS Section.
Text Section.
Example Program.
Exercises.
Quiz Questions.
Tool Chain.
Assemble/Link/Load Overview.
Assembler.
Assemble Commands.
List File.
Two-Pass Assembler.
First Pass.
Second Pass.
Assembler Directives.
Linker.
Linking Multiple Files.
Linking Process.
Dynamic Linking.
Assemble/Link Script.
Loader.
Debugger.
Exercises.
Quiz Questions.
DDD Debugger.
Starting DDD.
DDD Configuration Settings.
Program Execution with DDD.
Setting Breakpoints.
Executing Programs.
Run / Continue.
Next / Step.
Displaying Register Contents.
DDD/GDB Commands Summary.
DDD/GDB Commands, Examples.
Displaying Stack Contents.
Debugger Commands File (interactive).
Debugger Commands File (non-interactive).
Debugger Commands File (non-interactive).
Exercises.
Quiz Questions.
Suggested Projects.
Instruction Set Overview.
Notational Conventions.
Operand Notation.
Data Movement.
Addresses and Values.
Conversion Instructions.
Narrowing Conversions.
Widening Conversions.
Unsigned Conversions.
Signed Conversions.
Integer Arithmetic Instructions.
Addition.
Addition with Carry.
Subtraction.
Integer Multiplication.
Unsigned Multiplication.
Signed Multiplication.
Integer Division.
Logical Instructions.
Logical Operations.
Shift Operations.
Logical Shift.
Arithmetic Shift.
Rotate Operations.
Control Instructions.
Labels.
Unconditional Control Instructions.
Conditional Control Instructions.
Jump Out of Range.
Iteration.
Example Program, Sum of Squares.
Exercises.
Quiz Questions.
Suggested Projects.
Addressing Modes.
Addresses and Values.
Register Mode Addressing.
Immediate Mode Addressing.
Memory Mode Addressing.
Example Program, List Summation.
Example Program, Pyramid Areas and Volumes.
Exercises.
Quiz Questions.
Suggested Projects.
Process Stack.
Stack Example.
Stack Instructions.
Stack Implementation.
Stack Layout.
Stack Operations.
Stack Example.
Exercises.
Quiz Questions.
Suggested Projects.
Program Development.
Understand the Problem.
Create the Algorithm.
Implement the Program.
Test/Debug the Program.
Error Terminology.
Assembler Error.
Run-time Error.
Logic Error.
Exercises.
Quiz Questions.
Suggested Projects.
Macros.
Single-Line Macros.
Multi-Line Macros.
Macro Definition.
Using a Macro.
Macro Example.
Debugging Macros.
Exercises.
Quiz Questions.
Suggested Projects.
Functions.
Updated Linking Instructions.
Debugger Commands.
Debugger Command, next.
Debugger Command, step.
Stack Dynamic Local Variables.
Function Declaration.
Standard Calling Convention.
Linkage.
Argument Transmission.
Calling Convention.
Parameter Passing.
Register Usage.
Call Frame.
Red Zone.
Example, Statistical Function (leaf).
Caller.
Callee.
Example, Statistical Function (non-leaf).
Caller.
Callee.
Stack-Based Local Variables.
Exercises.
Quiz Questions.
Suggested Projects.
System Services.
Calling System Services.
Newline Character.
Console Output.
Example, Console Output.
Console Input.
Example, Console Input.
File Open Operations.
File Open.
File Open/Create.
File Read.
File Write.
File Operations Examples.
Example, File Write.
Example, File Read.
Exercises.
Quiz Questions.
Suggested Projects.
Multiple Source Files.
Extern Statement.
Example, Sum and Average.
Assembly Main.
Function Source.
Assemble and Link.
Interfacing with a High-Level Language.
Example, C++ Main / Assembly Function.
Compile, Assemble, and Link.
Exercises.
Quiz Questions.
Suggested Projects.
Stack Buffer Overflow.
Understanding a Stack Buffer Overflow.
Code to Inject.
Code Injection.
Code Injection Protections.
Data Stack Smashing Protector (or Canaries).
Data Execution Prevention.
Data Address Space Layout Randomization.
Exercises.
Quiz Questions.
Suggested Projects.
Command Line Arguments.
Parsing Command Line Arguments.
High-Level Language Example.
Argument Count and Argument Vector Table.
Assembly Language Example.
Exercises.
Quiz Questions.
Suggested Projects.
Input/Output Buffering.
Why Buffer?
Buffering Algorithm.
Exercises.
Quiz Questions.
Suggested Projects.
Floating-Point Instructions.
Floating-Point Values.
Floating-Point Registers.
Data Movement.
Integer / Floating-Point Conversion Instructions.
Floating-Point Arithmetic Instructions.
Floating-Point Addition.
Floating-Point Subtraction.
Floating-Point Multiplication.
Floating-Point Division.
Floating-Point Square Root.
Floating-Point Control Instructions.
Floating-Point Comparison.
Floating-Point Calling Conventions.
Example Program, Sum and Average.
Example Program, Absolute Value.
Exercises.
Quiz Questions.
Suggested Projects.
Parallel Processing.
Distributed Computing.
Multiprocessing.
POSIX Threads.
Race Conditions.
Exercises.
Quiz Questions.
Suggested Projects.
Interrupts.
Multi-user Operating System.
Interrupt Classification.
Interrupt Timing.
Asynchronous Interrupts.
Synchronous Interrupts.
Interrupt Categories.
Hardware Interrupt.
Exceptions.
Software Interrupts.
Interrupt Types and Levels.
Interrupt Types.
Privilege Levels.
Interrupt Processing.
Interrupt Service Routine (ISR).
Processing Steps.
Suspension.
Obtaining ISR Address.
Jump to ISR.
Suspension Execute ISR.
Resumption.
Suspension Interrupt Processing Summary.
Exercises.
Quiz Questions.
Suggested Projects.
Appendix A – ASCII Table.
Appendix B – Instruction Set Summary.
Data Movement Instructions.
Data Conversion instructions.
Integer Arithmetic Instructions.
Logical, Shift, and Rotate Instructions.
Control Instructions.
Stack Instructions.
Function Instructions.
Floating-Point Data Movement Instructions.
Floating-Point Data Conversion Instructions.
Floating-Point Arithmetic Instructions.
Floating-Point Control Instructions.
Appendix C – System Services.
Return Codes.
Basic System Services.
File Modes.
Error Codes.
Appendix D – Quiz Question Answers.