内容简介
Ⅰ Part the First:Imaginary Computers
1 Computation and Representation
1.1 Computation
1.1.1 Electronic Devices
1.1.2 Algorithmic Machines
1.1.3 Functional Components
1.2 Digital and Numeric Representations
1.2.1 Digital Representations and Bits
1.2.2 Boolean Logic
1.2.3 Bytes and Words
1.2.4 Representations
1.3 Virtual Machines
1.3.1 What is a“Virtual Machine”?
1.3.2 Portability Concerns
1.3.3 Transcending Limitations
1.3.4 Ease of Updates
1.3.5 Security Concerns
1.3.6 Disadvantages
1.4 Programming the JVM
1.4.1 Java:What the JVM Isn't
1.4.2 Translations of the Sample Program
1.4.3 High-and Low-Level Languages
1.4.4 The Sample Program as the JVM Sees It
1.5 Chapter Review
1.6 Exercises
1.7 Programming Exercises
2 Arith metic ExpressionsArith
2.1 Notations
2.1.1 Instruction Sets
2.1.2 Operations,Operands,and Ordering
2.1.3 Stack-Based Calculators
2.2 Stored-Program Computers
2.2.1 The fetch-execute Cycle
2.2.2 CISC vs.RISC Computers
2.3 Arithmetic Calculations on the JVM
2.3.1 General Comments
2.3.2 A Sample Arithmetic Instruction Set
2.3.3 Stack Manipulation Operations
2.3.4 Assembly Language and Machine Code
2.3.5 Illegal Operations
2.4 An Example Program
2.4.1 An Annotated Example
2.4.2 The Final JVM Code
2.5 JVM Calculation Instructions Summarized
2.6 Chapter Review
2.7 Exercises
2.8 Programming Exercises
3 Assembly Language Programming in jasmin
3.1 Java,the Programming System
3.2 Using the Assembler
3.2.1 The Assembler
3.2.2 Running a Program
3.2.3 Display to the Console vs.a Window
3.2.4 Using System.out and System.in
3.3 Assembly Language Statement Types
3.3.1 Instructions and Comments
3.3.2 Assembler Directives
3.3.3 Resource Directives
3.4 Example:Random Number Generation
3.4.1 Generating Pseudorandom Numbers
3.4.2 Implementation on the JVM
3.4.3 Another Implementation
3.4.4 Interfacing with Java Classes
3.5 Chapter Review
3.6 Exercises
3.7 Programming Exercises
4 Control Structures
4.1 “Everything They've Taught You Is Wrong”
4.1.1 Fetch-Execute Revisited
4.1.2 Branch Instructions and Labels
4.1.3 “Structured Programming”a Red Herring
4.1.4 High-Level Control Structures and Their Equivalents
4.2 Types of Gotos
4.2.1 Unconditional Branches
4.2.2 Conditional Branches
4.2.3 Comparison Operations
4.2.4 Combination Operations
4.3 Building Control Structures
4.3.1 If Statements
4.3.2 Loops
4.3.3 Details of Branch Instructions
4.4 Example:Syracuse Numbers
4.4.1 Problem Definition
4.4.2 Design
4.4.3 Solution and Implementation
4.5 Table Jumps
4.6 Subroutines
4.6.1 Basic Instructions
4.6.2 Examples of Subroutines
4.7 Example:Monte Carlo Estimation of π
4.7.1 Problem Definition
4.7.2 Design
4.7.3 Solution and Implementation
4.8 Chapter Review
4.9 Exercises
4.10 Programming Exercises
Ⅱ Part the Second:Real Computers
5 General Architecture Issues:Real Computers
5.1 The Limitations of a Virtual Machine
5.2 Optimizing the CPU
5.2.1 Building a Better Mousetrap
5.2.2 Multiprocessing
5.2.3 Instruction Set Optimization
5.2.4 Pipelining
5.2.5 Superscalar Architecture
5.3 Optimizing Memory
5.3.1 Cache Memory
5.3.2 Memory Management
5.3.3 Direct Address Translation
5.3.4 Page Address Translation
5.4 Optimizing Peripherals
5.4.1 The Problem with Busy-Waiting
5.4.2 Interrupt Handling
5.4.3 Communicating with the Peripherals:Using the Bus
5.5 Chapter Review
5.6 Exercises
6 The Intel 8088
6.1 Background
6.2 Organization and Architecture
6.2.1 The Central Processing Unit
6.2.2 The Fetch-Execute Cycle
6.2.3 Memory
6.2.4 Devices and Peripherals
6.3 Assembly Language
6.3.1 Operations and Addressing
6.3.2 Arithmetic Instruction Set
6.3.3 Floating Point Operations
6.3.4 Decisions and Control Structures
6.3.5 Advanced Operations
6.4 Memory Organization and Use
6.4.1 Addresses and Variables
6.4.2 Byte Swapping
6.4.3 Arrays and Strings
6.4.4 String Primitives
6.4.5 Local Variables and Information Hiding
6.4.6 System Stack
6.4.7 Stack Frames
6.5 Conical Mountains Revisited
6.6 Interfacing Issues
6.7 Chapter Review
6.8 Exercises
7 The Power Architecture
7.1 Background
7.2 Organization and Architecture
7.2.1 Central Processing Unit
7.2.2 Memory
7.2.3 Devices and Peripherals
7.3 Assembly Language
7.3.1 Arithmetic
7.3.2 Floating Point Operations
7.3.3 Comparisons and Condition Flags
7.3.4 Data Movement
7.3.5 Branches
7.4 Conical Mountains Revisited
7.5 Memory Organization and Use
7.6 Performance Issues
7.6.1 Pipelining
7.7 Chapter Review
7.8 Exercises
8 The Intel Pentium
8.1 Background
8.2 Organization and Architecture
8.2.1 The Central Processing Unit
8.2.2 Memory
8.2.3 Devices and Peripherals
8.3 Assembly Language Programming
8.3.1 Operations and Addressing
8.3.2 Advanced Operations
8.3.3 Instruction Formats
8.4 Memory Organization and Use
8.4.1 Memory Management
8.5 Performance Issues
8.5.1 Pipelining
8.5.2 Parallel Operations
8.5.3 Superscalar Architecture
8.6 RISC vS.CISC Revisited
8.7 Chapter Review
8.8 Exercises
9 Microcontrollers:The Atmel AVR
9.1 Background
9.2 Organization and Architecture
9.2.1 Central Processing Unit
9.2.2 Memory
9.2.3 Devices and Peripherials
9.3 Assembly Language
9.4 Memory Organization and Use
9.5 Issues of Interfacing
9.5.1 Interfacing with External Devices
9.5.2 Interfacing with Timers
9.6 Designing an AVR Program
9.7 Chapter Review
9.8 Exercises
10 Advanced Programming Topics on the JVM
10.1 Complex and Derived Types
10.1.1 The Need for Derived Types
10.1.2 An Example ofa Derived Type:Arrays
10.1.3 Records:Classes Without Methods
10.2 Classes and Inheritance
10.2.1 Defining Classes
10.2.2 A Sample Class:String
10.2.3 Implementing a String
10.3 Class Operations and Methods
10.3.1 Introduction to Class Operations
10.3.2 Field Operations
10.3.3 Methods
10.3.4 A Taxonomy of Classes
10.4 Objects
10.4.1 Creating Objects as Instances of Classes
10.4.2 Destroying Objects
10.4.3 The Type Object
10.5 Class Files and.class File Structure
10.5.1 Class Files
10.5.2 Starting Up Classes
10.6 Class Hierarchy Directives
10.7 An Annotated Example:Hello,World Revisited
10.8 Input and Output:An Explanation
10.8.1 Problem Statement
10.8.2 Two Systems Contrasted
10.8.3 Example:Reading from the Keyboard in the JVM
10.8.4 Solution
10.9 Example:Factorials Via Recursion
10.9.1 Problem Statement
10.9.2 Design
10.9.3 Solution
10.10 Chapter Review
10.11 Exercises
10.12 Programming Exercises
A Digital Logic
A.1 Gates
A.2 Combinational Circuits
A.3 Sequential Circuits
A.4 Computer Operations
B JVM Instruction Set
C Opcode Summary by Number
C.1 Standard Opcodes
C.2 Reserved Opcodes
C.3 “Quick”Pseudo-Opcodes
C.4 Unused Opcodes
D Class File Format
D.1 Overview and Fundamentals
D.2 Subtable Structures
D.2.1 Constant Pool
D.2.2 Field Table
D.2.3 Methods Table
D.2.4 Attributes
E The ASCII Table
E.1 The Table
E.2 History and Overview
Glossary
Index