| |
| |
Preface | |
| |
| |
Statement of Aims | |
| |
| |
What | |
| |
| |
How | |
| |
| |
For Whom | |
| |
| |
Acknowledgments | |
| |
| |
| |
Part the First: Imaginary Computers | |
| |
| |
| |
Computation and Representation | |
| |
| |
| |
Computation | |
| |
| |
| |
Electronic Devices | |
| |
| |
| |
Algorithmic Machines | |
| |
| |
| |
Functional Components | |
| |
| |
| |
Digital and Numeric Representations | |
| |
| |
| |
Digital Representations and Bits | |
| |
| |
| |
Boolean Logic | |
| |
| |
| |
Bytes and Words | |
| |
| |
| |
Representations | |
| |
| |
| |
Virtual Machines | |
| |
| |
| |
What is a "Virtual Machine"? | |
| |
| |
| |
Portability Concerns | |
| |
| |
| |
Transcending Limitations | |
| |
| |
| |
Ease of Updates | |
| |
| |
| |
Security Concerns | |
| |
| |
| |
Disadvantages | |
| |
| |
| |
Programming the JVM | |
| |
| |
| |
Java: What the JVM Isn't | |
| |
| |
| |
Translations of the Sample Program | |
| |
| |
| |
High-and Low-Level Languages | |
| |
| |
| |
The Sample Program as the JVM Sees It | |
| |
| |
| |
Chapter Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Programming Exercises | |
| |
| |
| |
Arithmetic Expressions | |
| |
| |
| |
Notations | |
| |
| |
| |
Instruction Sets | |
| |
| |
| |
Operations, Operands, and Ordering | |
| |
| |
| |
Stack-Based Calculators | |
| |
| |
| |
Stored-Program Computers | |
| |
| |
| |
The fetch-execute Cycle | |
| |
| |
| |
CISC VS. RISC Computers | |
| |
| |
| |
Arithmetic Calculations on the JVM | |
| |
| |
| |
General Comments | |
| |
| |
| |
A Sample Arithmetic Instruction Set | |
| |
| |
| |
Stack Manipulation Operations | |
| |
| |
| |
Assembly Language and Machine Code | |
| |
| |
| |
Illegal Operations | |
| |
| |
| |
An Example Program | |
| |
| |
| |
An Annotated Example | |
| |
| |
| |
The Final JVM Code | |
| |
| |
| |
JVM Calculation Instructions Summarized | |
| |
| |
| |
Chapter Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Programming Exercises | |
| |
| |
| |
Assembly Language Programming in jasmin | |
| |
| |
| |
Java, the Programming System | |
| |
| |
| |
Using the Assembler | |
| |
| |
| |
The Assembler | |
| |
| |
| |
Running a Program | |
| |
| |
| |
Display to the Console vs. a Window | |
| |
| |
| |
Using System.out and System.in | |
| |
| |
| |
Assembly Language Statement Types | |
| |
| |
| |
Instructions and Comments | |
| |
| |
| |
Assembler Directives | |
| |
| |
| |
Resource Directives | |
| |
| |
| |
Example: Random Number Generation | |
| |
| |
| |
Generating Pseudorandom Numbers | |
| |
| |
| |
Implementation on the JVM | |
| |
| |
| |
Another Implementation | |
| |
| |
| |
Interfacing with Java Classes | |
| |
| |
| |
Chapter Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Programming Exercises | |
| |
| |
| |
Control Structures | |
| |
| |
| |
"Everything They've Taught You Is Wrong" | |
| |
| |
| |
Fetch-Execute Revisited | |
| |
| |
| |
Branch Instructions and Labels | |
| |
| |
| |
"Structured Programming" a Red Herring | |
| |
| |
| |
High-Level Control Structures and Their Equivalents | |
| |
| |
| |
Types of Gotos | |
| |
| |
| |
Unconditional Branches | |
| |
| |
| |
Conditional Branches | |
| |
| |
| |
Comparison Operations | |
| |
| |
| |
Combination Operations | |
| |
| |
| |
Building Control Structures | |
| |
| |
| |
If Statements | |
| |
| |
| |
Loops | |
| |
| |
| |
Details of Branch Instructions | |
| |
| |
| |
Example: Syracuse Numbers | |
| |
| |
| |
Problem Definition | |
| |
| |
| |
Design | |
| |
| |
| |
Solution and Implementation | |
| |
| |
| |
Table Jumps | |
| |
| |
| |
Subroutines | |
| |
| |
| |
Basic Instructions | |
| |
| |
| |
Examples of Subroutines | |
| |
| |
| |
Example: Monte Carlo Estimatson of [pi] | |
| |
| |
| |
Problem Definition | |
| |
| |
| |
Design | |
| |
| |
| |
Solution and Implementation | |
| |
| |
| |
Chapter Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Programming Exercises | |
| |
| |
| |
Part the Second: Real Computers | |
| |
| |
| |
General Architecture Issues: Real Computers | |
| |
| |
| |
The Limitations of a Virtual Machine | |
| |
| |
| |
Optimizing the CPU | |
| |
| |
| |
Building a Better Mousetrap | |
| |
| |
| |
Multiprocessing | |
| |
| |
| |
Instruction Set Optimization | |
| |
| |
| |
Pipelining | |
| |
| |
| |
Superscalar Architecture | |
| |
| |
| |
Optimizing Memory | |
| |
| |
| |
Cache Memory | |
| |
| |
| |
Memory Management | |
| |
| |
| |
Direct Address Translation | |
| |
| |
| |
Page Address Translation | |
| |
| |
| |
Optimizing Peripherals | |
| |
| |
| |
The Problem with Busy-Waiting | |
| |
| |
| |
Interrupt Handling | |
| |
| |
| |
Communicating with the Peripherals: Using the Bus | |
| |
| |
| |
Chapter Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
The Intel 8088 | |
| |
| |
| |
Background | |
| |
| |
| |
Organization and Architecture | |
| |
| |
| |
The Central Processing Unit | |
| |
| |
| |
The Fetch-Execute Cycle | |
| |
| |
| |
Memory | |
| |
| |
| |
Devices and Peripherals | |
| |
| |
| |
Assembly Language | |
| |
| |
| |
Operations and Addressing | |
| |
| |
| |
Arithmetic Instruction Set | |
| |
| |
| |
Floating Point Operations | |
| |
| |
| |
Decisions and Control Structures | |
| |
| |
| |
Advanced Operations | |
| |
| |
| |
Memory Organization and Use | |
| |
| |
| |
Addresses and Variables | |
| |
| |
| |
Byte Swapping | |
| |
| |
| |
Arrays and Strings | |
| |
| |
| |
String Primitives | |
| |
| |
| |
Local Variables and Information Hiding | |
| |
| |
| |
System Stack | |
| |
| |
| |
Stack Frames | |
| |
| |
| |
Conical Mountains Revisited | |
| |
| |
| |
Interfacing Issues | |
| |
| |
| |
Chapter Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
The Power Architecture | |
| |
| |
| |
Background | |
| |
| |
| |
Organization and Architecture | |
| |
| |
| |
Central Processing Unit | |
| |
| |
| |
Memory | |
| |
| |
| |
Devices and Peripherals | |
| |
| |
| |
Assembly Language | |
| |
| |
| |
Arithmetic | |
| |
| |
| |
Floating Point Operations | |
| |
| |
| |
Comparisons and Condition Flags | |
| |
| |
| |
Data Movement | |
| |
| |
| |
Branches | |
| |
| |
| |
Conical Mountains Revisited | |
| |
| |
| |
Memory Organization and Use | |
| |
| |
| |
Performance Issues | |
| |
| |
| |
Pipelining | |
| |
| |
| |
Chapter Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
The Intel Pentium | |
| |
| |
| |
Background | |
| |
| |
| |
Organization and Architecture | |
| |
| |
| |
The Central Processing Unit | |
| |
| |
| |
Memory | |
| |
| |
| |
Devices and Peripherals | |
| |
| |
| |
Assembly Language Programming | |
| |
| |
| |
Operations and Addressing | |
| |
| |
| |
Advanced Operations | |
| |
| |
| |
Instruction Formats | |
| |
| |
| |
Memory Organization and Use | |
| |
| |
| |
Memory Management | |
| |
| |
| |
Performance Issues | |
| |
| |
| |
Pipelining | |
| |
| |
| |
Parallel Operations | |
| |
| |
| |
Superscalar Architecture | |
| |
| |
| |
RISC VS. CISC Revisited | |
| |
| |
| |
Chapter Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Microcontrollers: The Atmel AVR | |
| |
| |
| |
Background | |
| |
| |
| |
Organization and Architecture | |
| |
| |
| |
Central Processing Unit | |
| |
| |
| |
Memory | |
| |
| |
| |
Devices and Peripherials | |
| |
| |
| |
Assembly Language | |
| |
| |
| |
Memory Organization and Use | |
| |
| |
| |
Issues of Interfacing | |
| |
| |
| |
Interfacing with External Devices | |
| |
| |
| |
Interfacing with Timers | |
| |
| |
| |
Designing an AVR Program | |
| |
| |
| |
Chapter Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Advanced Programming Topics on the JVM | |
| |
| |
| |
Complex and Derived Types | |
| |
| |
| |
The Need for Derived Types | |
| |
| |
| |
An Example of a Derived Type: Arrays | |
| |
| |
| |
Records: Classes Without Methods | |
| |
| |
| |
Classes and Inheritance | |
| |
| |
| |
Defining Classes | |
| |
| |
| |
A Sample Class: String | |
| |
| |
| |
Implementing a String | |
| |
| |
| |
Class Operations and Methods | |
| |
| |
| |
Introduction to Class Operations | |
| |
| |
| |
Field Operations | |
| |
| |
| |
Methods | |
| |
| |
| |
A Taxonomy of Classes | |
| |
| |
| |
Objects | |
| |
| |
| |
Creating Objects as Instances of Classes | |
| |
| |
| |
Destroying Objects | |
| |
| |
| |
The Type Object | |
| |
| |
| |
Class Files and .class File Structure | |
| |
| |
| |
Class Files | |
| |
| |
| |
Starting Up Classes | |
| |
| |
| |
Class Hierarchy Directives | |
| |
| |
| |
An Annotated Example: Hello, World Revisited | |
| |
| |
| |
Input and Output: An Explanation | |
| |
| |
| |
Problem Statement | |
| |
| |
| |
Two Systems Contrasted | |
| |
| |
| |
Example: Reading from the Keyboard in the JVM | |
| |
| |
| |
Solution | |
| |
| |
| |
Example: Factorials Via Recursion | |
| |
| |
| |
Problem Statement | |
| |
| |
| |
Design | |
| |
| |
| |
Solution | |
| |
| |
| |
Chapter Review | |
| |
| |
| |
Exercises | |
| |
| |
| |
Programming Exercises | |
| |
| |
| |
Digital Logic | |
| |
| |
| |
Gates | |
| |
| |
| |
Combinational Circuits | |
| |
| |
| |
Sequential Circuits | |
| |
| |
| |
Computer Operations | |
| |
| |
| |
JVM Instruction Set | |
| |
| |
| |
Opcode Summary by Number | |
| |
| |
| |
Standard Opcodes | |
| |
| |
| |
Reserved Opcodes | |
| |
| |
| |
"Quick" Pseudo-Opcodes | |
| |
| |
| |
Unused Opcodes | |
| |
| |
| |
Class File Format | |
| |
| |
| |
Overview and Fundamentals | |
| |
| |
| |
Subtable Structures | |
| |
| |
| |
Constant Pool | |
| |
| |
| |
Field Table | |
| |
| |
| |
Methods Table | |
| |
| |
| |
Attributes | |
| |
| |
| |
The ASCII Table | |
| |
| |
| |
The Table | |
| |
| |
| |
History and Overview | |
| |
| |
Glossary | |
| |
| |
Index | |