x64 Assembly Language Step-by-Step: Programming With Linux (Tech Today), 4th Edition Jeff Duntemann All Chapter Instant Download
x64 Assembly Language Step-by-Step: Programming With Linux (Tech Today), 4th Edition Jeff Duntemann All Chapter Instant Download
com
OR CLICK BUTTON
DOWLOAD NOW
More products digital (pdf, epub, mobi) instant
download maybe you interests ...
https://ebookmeta.com/product/x64-assembly-language-step-by-step-
programming-with-linux-4th-edition-jeff-duntemann/
https://ebookmeta.com/product/php-programming-a-step-by-step-
guide-to-learn-in-an-easy-way-the-fundamentals-of-php-
programming-language-3nd-edition-daniel-robinson/
https://ebookmeta.com/product/beginning-t-sql-a-step-by-step-
approach-4th-edition-kathi-kellenberger/
https://ebookmeta.com/product/guide-to-assembly-language-
programming-in-linux-2005th-edition-sivarama-p-dandamudi/
Learn to Program with Python 3: A Step-by-Step Guide to
Programming - 2nd ed 2nd Edition Irv Kalb
https://ebookmeta.com/product/learn-to-program-with-
python-3-a-step-by-step-guide-to-programming-2nd-ed-2nd-edition-
irv-kalb/
https://ebookmeta.com/product/beginner-s-step-by-step-coding-
course-learn-computer-programming-the-easy-way-dk/
https://ebookmeta.com/product/step-by-step-desserts-all-the-
classics-with-creative-variations-1st-edition-dk/
https://ebookmeta.com/product/the-absolute-beginners-guide-to-
python-programming-a-step-by-step-guide-with-examples-and-lab-
exercises-1st-edition-kevin-wilson/
https://ebookmeta.com/product/easy-german-step-by-step-ed-swick/
Table of Contents
Cover
Table of Contents
Title Page
Introduction
CHAPTER 1: It's All in the Plan
Another Pleasant Valley Saturday
Had This Been the Real Thing …
Assembly Language Programming As a Square Dance
Assembly Language Programming As a Board Game
CHAPTER 2: Alien Bases
The Return of the New Math Monster
Octal: How the Grinch Stole Eight and Nine
Hexadecimal: Solving the Digit Shortage
From Hex to Decimal and from Decimal to Hex
Practice. Practice! PRACTICE!
Arithmetic in Hex
Binary
Hexadecimal as Shorthand for Binary
Prepare to Compute
CHAPTER 3: Lifting the Hood
RAXie, We Hardly Knew Ye
Switches, Transistors, and Memory
The Shop Supervisor 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
Segment Registers
The Four Major Assembly Programming Models
64-Bit Long Mode
CHAPTER 5: The Right to Assemble
The Nine and Sixty Ways to Code
Files and What's Inside Them
Text In, Code Out
The Assembly Language Development Process
Linking the Object Code File
Taking a Trip Down Assembly Lane
CHAPTER 6: A Place to Stand, with Access to Tools
Integrated Development Environments
Introducing SASM
Linux and Terminals
Using Linux Make
Debugging with SASM
CHAPTER 7: Following Your Instructions
Build Yourself a Sandbox
Instructions and Their Operands
Source and Destination 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 Syscall
Designing a Nontrivial Program
Going Further
CHAPTER 9: Bits, Flags, Branches, and Tables
Bits Is Bits (and Bytes Is Bits)
Shifting Bits
Bit-Bashing in Action
Flags, Tests, and Branches
X64 Long 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, String Searches, and the Linux
Stack
The Stack, Its Structure, and How to Use It
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 Linux Time Lord
Understanding AT&T Instruction Mnemonics
Generating Random Numbers
How C Sees Command-Line Arguments
Simple File I/O
Conclusion: Not the End, But Only the Beginning
Where to Now?
The Art of 64-bit Assembly by Randall Hyde (No Starch
Press, 2022)
Modern x86 Assembly Language Programming by David
Kusswurm (Apress, 2018)
Stepping off Square One
APPENDIX A: The Return of the Insight Debugger
Insight's Shortcomings
Opening a Program Under Insight
Setting Command-Line Arguments with Insight
Running and Stepping a Program
The Memory Window
Showing the Stack in Insight's Memory View
Examining the Stack with Insight's Memory View
Learn gdb!
APPENDIX B: Partial x64 Instruction Reference
What's Been Removed from x64
Flag Results
Size Specifiers
Instruction Index
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
J??: Jump If Condition Is Met
JECXZ: Jump if ECX=0
JRCXZ: Jump If RCX=0
JMP: Unconditional Jump
LEA: Load Effective Address
LOOP: Loop Until CX/ECX/RCX=0
LOOPNZ/LOOPNE: Loop Until CX/ECX/RCX=0 and ZF=0
LOOPZ/LOOPE: Loop Until CX/ECX/RCX=0 and ZF=1
MOV: Copy Right Operand into Left Operand
MOVS: Move String
MOVSX: 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: Copy Top of Stack into Operand
POPF/D/Q: Copy Top of Stack into Flags Register
PUSH: Push Operand onto Top of Stack
PUSHF/D/Q: Push Flags Onto the Stack
RET: Return from Procedure
ROL/ROR: Rotate Left/Rotate Right
SBB: Arithmetic Subtraction with Borrow
SHL/SHR: Shift Left/Shift Right
STC: Set Carry Flag (CF)
STD: Set Direction Flag (DF)
STOS/B/W/D/Q: Store String
SUB: Arithmetic Subtraction
SYSCALL: Fast System Call into Linux
XCHG: Exchange Operands
XLAT: Translate Byte Via Table
XOR: Exclusive OR
APPENDIX C: Character Set Charts
Index
Copyright
Dedication
About the Author
About the Technical Editor
Acknowledgments
End User License Agreement
List of Tables
Chapter 2
Table 2.1: Counting in Martian, Base Fooby
Table 2.2: Powers of Fooby
Table 2.3: Counting in Octal, Base 8
Table 2.4: Octal Columns as Powers of Eight
Table 2.5: Counting in Hexadecimal, Base 16
Table 2.6: Hexadecimal Columns as Powers of 16
Table 2.7: Binary Columns as Powers of 2
Chapter 4
Table 4.1: Collective Terms for Memory
Chapter 6
Table 6.1: The Three Standard Unix Files
Chapter 7
Table 7.1: MOV and Its Operands
Table 7.2: The Ranges of Signed Values
Table 7.3: The MOVSX Instruction
Table 7.4: The MUL Instruction
Table 7.5: The DIV Instruction
Chapter 8
Table 8.1: System Call Conventions for the System V ABI
Chapter 9
Table 9.1: The AND Truth Table for Formal Logic
Table 9.2: The AND Truth Table for Assembly Language
Table 9.3: The OR Truth Table for Assembly Language
Table 9.4: The XOR Truth Table for Assembly Language
Table 9.5: The NOT Truth Table for Assembly Language
Table 9.6: Jump Instruction Mnemonics and Their
Synonyms
Table 9.7: Arithmetic Tests Useful After a CMP Instruction
Table 9.8: 64-Bit Long Mode Memory-Addressing Schemes
Chapter 12
Table 12.1: Printf() Formatting Codes
Table 12.2: The Values Contained in the tm Structure
Table 12.3: File Access Codes for Use with fopen()
List of Illustrations
Chapter 1
Figure 1.1: The Game of Assembly Language
Chapter 2
Figure 2.1: The anatomy of ∩≡ ⌠ Θ ≡
Figure 2.2: The anatomy of 76225 octal
Figure 2.3: The anatomy of 3C0A9H
Chapter 3
Figure 3.1: Transistor switches and memory cells
Figure 3.2: A RAM chip
Figure 3.3: A simple 1-megabyte memory system
Figure 3.4: The CPU and memory
Figure 3.5: The idea of multitasking
Figure 3.6: A mature protected-mode operating system
Chapter 4
Figure 4.1: The 8080 memory model
Figure 4.2: The 8080 memory model inside an 8086
memory system
Figure 4.3: Seeing a megabyte through 64 KB blinders
Figure 4.4: Memory addresses versus segment addresses
Figure 4.5: Segments and offsets
Figure 4.6: Registers inside registers
Figure 4.7: 8-bit, 16-bit, 32-bit, and 64-bit registers
Figure 4.8: Real-mode flat model
Figure 4.9: The real-mode segmented model
Figure 4.10: 32-bit protected mode flat model
Chapter 5
Figure 5.1: Displaying a Linux text file with the GHex editor
Figure 5.2: Displaying a Windows text file with the GHex
editor
Figure 5.3: A Linux text file displayed under Windows
Figure 5.4: Differences in display order versus differences in
evaluation or...
Figure 5.5: Big endian versus little endian for a 16-bit value
Figure 5.6: Big endian versus little endian for a 32-bit value
Figure 5.7: What the assembler does
Figure 5.8: The assembler and linker
Figure 5.9: The assembly language development process
Figure 5.10: The Linux Mint Software Manager
Figure 5.11: The anatomy of a NASM command line
Figure 5.12: The anatomy of an ld command line
Chapter 6
Figure 6.1: The SASM Build dialog
Figure 6.2: The full SASM window in debug mode
Figure 6.3: Changing Konsole's character encoding to IBM-
850
Figure 6.4: I/O redirection
Figure 6.5: Adding a key binding to Konsole
Chapter 7
Figure 7.1: Character strings as immediate data
Figure 7.2: The x64 RFlags register
Chapter 8
Figure 8.1: The stack
Figure 8.2: The stack in program memory
Figure 8.3: How the stack works
Figure 8.4: The “off by one” error
Chapter 9
Figure 9.1: Bit numbering
Figure 9.2: The anatomy of an AND instruction
Figure 9.3: Using XOR to zero a register
Figure 9.4: How the rotate instructions work
Figure 9.5: How the rotate through carry instructions work
Figure 9.6: Using a lookup table
Figure 9.7: A table of 16 three-byte entries
Figure 9.8: Multiplying by shifting
Figure 9.9: x64 long mode memory addressing
Figure 9.10: How address scaling works
Chapter 10
Figure 10.1: Calling a procedure and returning
Figure 10.2: Local labels and the globals that own them
Figure 10.3: Connecting globals and externals
Figure 10.4: How macros work
Chapter 11
Figure 11.1: Using MOVSB on overlapping memory blocks
Figure 11.2: How to access parameters from within SASM
Figure 11.3: The Linux stack at program execution
Chapter 12
Figure 12.1: How gcc builds Linux executables
Figure 12.2: The structure of a hybrid C-assembly program
Figure 12.3: A stack frame
Figure 12.4: Accessing command-line arguments from the
x64 main() function
Appendix A
Figure A.1: Insight's memory display of a .data section
Figure A.2: Command-line arguments in Insight's memory
view
x64 Assembly Language Step-
by-Step
4TH Edition
Jeff Duntemann
Introduction
“Why Would You Want to Do That?”
It was 1985, and I was in a chartered bus in New York City, heading
for a press reception with a bunch of other restless media
egomaniacs. I was only beginning my tech journalist career (as
technical editor for PC Tech Journal), and my first book was still
months in the future. I happened to be sitting next to an established
programming writer/guru, with whom I was impressed and to whom
I was babbling about one thing or another. I would like to eliminate
this statement; it adds little to the book, and as annoying as he is,
even though we don’t name him, I now understand why he’s so
annoying: He lives and works in a completely different culture than I
do.
During our chat, I happened to let slip that I was a Turbo Pascal
fanatic, and what I really wanted to do was learn how to write Turbo
Pascal programs that made use of the brand new Microsoft Windows
user interface. He wrinkled his nose and grimaced wryly, before
speaking the Infamous Question:
“Why would you want to do that?”
I had never heard the question before (though I would hear it many
times thereafter), and it took me aback. Why? Because, well,
because…I wanted to know how it worked.
“Heh. That's what C is for.”
Further discussion got me nowhere in a Pascal direction. But some
probing led me to understand that you couldn't write Windows apps
in Turbo Pascal. It was impossible. Or…the programming
writer/guru didn't know how. Maybe both. I never learned the truth
as it stood in 1985. (Delphi answered the question once and for all in
1995.) But I did learn the meaning of the Infamous Question.
Note well: When somebody asks you, “Why would you want to do
that?” what it really means is this: “You've asked me how to do
something that is either impossible using tools that I favor or
Another random document with
no related content on Scribd:
The Project Gutenberg eBook of The Greene
murder case
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.
Language: English
by
S. S. VAN DINE
Contents
I A Double Tragedy
II The Investigation Opens
III At the Greene Mansion
IV The Missing Revolver
V Homicidal Possibilities
VI An Accusation
VII Vance Argues the Case
VIII The Second Tragedy
IX The Three Bullets
X The Closing of a Door
XI A Painful Interview
XII A Motor Ride
XIII The Third Tragedy
XIV Footprints on the Carpet
XV The Murderer in the House
XVI The Lost Poisons
XVII The Two Wills
XVIII In the Locked Library
XIX Sherry and Paralysis
XX The Fourth Tragedy
XXI A Depleted Household
XXII The Shadowy Figure
XXIII The Missing Fact
XXIV A Mysterious Trip
XXV The Capture
XXVI The Astounding Truth
to
NORBERT L. LEDERER
Άγαθὴ δἑ παράφασίς έστιν έταίρου
The Greene mansion, New York, as it appeared at the time
of the notorious Greene murder case.
From an old woodcut by Lowell L. Balcom.
Murder most foul, as in the best it is;
But this most foul, strange and
unnatural.
—Hamlet.
Characters of the Book
Philo Vance
John F.-X. Markham
District Attorney of New York County.
Mrs. Tobias Greene
The mistress of the Greene mansion.
Julia Greene
The eldest daughter.
Sibella Greene
Another daughter.
Ada Greene
The youngest daughter.
Chester Greene
The elder son.
Rex Greene
The younger son.
Dr. Arthur Von Blon
The Greene family physician.
Sproot
The Greene butler.
Gertrude Mannheim
The cook.
Hemming
The senior maid.
Barton
The junior maid.
Miss Craven
Mrs. Greene’s nurse.
Chief Inspector O’Brien
Of the Police Department of New York City.
William M. Moran
Commanding officer of the Detective Bureau.
Ernest Heath
Sergeant of the Homicide Bureau.
Snitkin
Detective of the Homicide Bureau.
Burke
Detective of the Homicide Bureau.
Captain Anthony P. Jerym
Bertillon expert.
Captain Dubois
Finger-print expert.
Dr. Emanuel Doremus
Medical Examiner.
Dr. Drumm
An official police surgeon.
Marie O’Brien
A Police nurse.
Swacker
Secretary to the District Attorney.
Currie
Vance’s valet.
CHAPTER I.
A Double Tragedy
(Tuesday, November 9; 10 a. m.)