Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Titlepage
Copyright
Dedication
About the Author
Credits
Acknowledgments
Introduction
What You'll Need
The Master Plan
A Note on Capitalization Conventions
Why Am I Here Again?
Chapter 1: Another Pleasant Valley Saturday
It's All in the Plan
Had This Been the Real Thing…
Do Not Pass Go
Assembly Language Programming As a Board Game
Chapter 2: Alien Bases
The Return of the New Math Monster
Counting in Martian
Octal: How the Grinch Stole Eight and Nine
Hexadecimal: Solving the Digit Shortage
From Hex to Decimal and from Decimal to Hex
Arithmetic in Hex
Binary
Hexadecimal As Shorthand for Binary
Chapter 3: Lifting the Hood
RAXie, We Hardly Knew Ye…
Switches, Transistors, and Memory
The Shop Foreman and the Assembly Line
The Box That Follows a Plan
What vs. How: Architecture and Microarchitecture
Enter the Plant Manager
Chapter 4: Location, Location, Location
The Joy of Memory Models
The Nature of Segments
16-Bit and 32-Bit Registers
The Three Major Assembly Programming Models
What Protected Mode Won't Let Us Do Anymore
Looking Ahead: 64-Bit “Long Mode”
Chapter 5: The Right to Assemble
Files and What's Inside Them
Text In, Code Out
The Assembly Language Development Process
Taking a Trip Down Assembly Lane
Chapter 6: A Place to Stand, with Access to Tools
The Kate Editor
Linux and Terminals
Using Linux Make
The Insight Debugger
Chapter 7: Following Your Instructions
Build Yourself a Sandbox
Instructions and Their Operands
Rally Round the Flags, Boys!
Signed and Unsigned Values
Implicit Operands and MUL
Reading and Using an Assembly Language Reference
NEG: Negate (Two's Complement; i.e., Multiply by −1)
Chapter 8: Our Object All Sublime
The Bones of an Assembly Language Program
Last In, First Out via the Stack
Using Linux Kernel Services Through INT80
Designing a Non-Trivial Program
Chapter 9: Bits, Flags, Branches, and Tables
Bits Is Bits (and Bytes Is Bits)
Shifting Bits
Bit-Bashing in Action
Flags, Tests, and Branches
Protected Mode Memory Addressing in Detail
Character Table Translation
Tables Instead of Calculations
Chapter 10: Dividing and Conquering
Boxes within Boxes
Calling and Returning
Local Labels and the Lengths of Jumps
Building External Procedure Libraries
The Art of Crafting Procedures
Simple Cursor Control in the Linux Console
Creating and Using Macros
Chapter 11: Strings and Things
The Notion of an Assembly Language String
REP STOSB, the Software Machine Gun
The Semiautomatic Weapon: STOSB without REP
MOVSB: Fast Block Copies
Storing Data to Discontinuous Strings
Command-Line Arguments and Examining the Stack
String Searches with SCASB
Chapter 12: Heading Out to C
What's GNU?
Linking to the Standard C Library
Formatted Text Output with printf()
Data In with fgets() and scanf()
Be a Time Lord
Understanding AT&T Instruction Mnemonics
Generating Random Numbers
How C Sees Command-Line Arguments
Simple File I/O
Conclusion
Where to Now?
Stepping off Square One
Appendix A: Partial x86 Instruction Set Reference
Notes on the Instruction Set Reference
AAA: Adjust AL after BCD Addition
ADC: Arithmetic Addition with Carry
ADD: Arithmetic Addition
AND: Logical AND
BT: Bit Test
CALL: Call Procedure
CLC: Clear Carry Flag (CF)
CLD: Clear Direction Flag (DF)
CMP: Arithmetic Comparison
DEC: Decrement Operand
DIV: Unsigned Integer Division
INC: Increment Operand
INT: Software Interrupt
IRET: Return from Interrupt
J?: Jump on Condition
JCXZ: Jump If CX = 0
JECXZ: Jump If ECX = 0
JMP: Unconditional Jump
LEA: Load Effective Address
LOOP: Loop until CX/ECX = 0
LOOPNZ/LOOPNE: Loop While CX/ECX > 0 and ZF = 0
LOOPZ/LOOPE: Loop While CX/ECX > 0 and ZF = 1
MOV: Move (Copy) Right Operand into Left Operand
MOVS: Move String
MOVSX: Move (Copy) with Sign Extension
MUL: Unsigned Integer Multiplication
NEG: Negate (Two's Complement; i.e., Multiply by −1)
NOP: No Operation
NOT: Logical NOT (One's Complement)
OR: Logical OR
POP: Pop Top of Stack into Operand
POPA/POPAD: Pop All GP Registers
POPF: Pop Top of Stack into 16-Bit Flags
POPFD: Pop Top of Stack into EFlags
PUSH: Push Operand onto Top of Stack
PUSHA: Push All 16-Bit GP Registers
PUSHAD: Push All 32-Bit GP Registers
PUSHF: Push 16-Bit Flags onto Stack
PUSHFD: Push 32-Bit EFlags onto Stack
RET: Return from Procedure
ROL: Rotate Left
ROR: Rotate Right
SBB: Arithmetic Subtraction with Borrow
SHL: Shift Left
SHR: Shift Right
STC: Set Carry Flag (CF)
STD: Set Direction Flag (DF)
STOS: Store String
SUB: Arithmetic Subtraction
XCHG: Exchange Operands
XLAT: Translate Byte via Table
XOR: Exclusive Or
Appendix B: Character Set Charts
Index
← Prev
Back
Next →
← Prev
Back
Next →