HomePage
THE MIPS PROGRAMMER'S HANDBOOK

THE MIPS PROGRAMMER'S HANDBOOK

TITLE: The MIPS Programmer's Handbook
AUTHOR: Erin Farquhar and Philip Bunce
PUBLISHER: Morgan Kaufmann
PAGES: 408
ISBN: 1-55860-297-6
PRICE: $34.95

A note from the authors: "As computer consultants providing software support for developers of MIPS-based embedded systems, we discovered that although there were a number of documents describing the hardware architecture, there was almost nothing available that described how the chip was programmed. It was to meet this need that we decided to write our book."

This book offers a hands-on view of the highly successful MIPS family of microprocessors, written especially for programmers developing system applications. It includes a full description of the MIPS architecture from the perspective of the assembly and C language, with special emphasis on issues releated to embedded applications. Engineers writing system-level programs for MIPS-based systems will find the topics presented especially useful including the sections on software conventions, initializing the processor in a bare machine environment, and writing exception handlers.

The authors focus on the instructions available to assembly-language programmers, rather than on the hardware-level instruction set documented in data books released by the vendors of the MIPS processor. For convenient use, the instruction set reference is presented with only one instruction per page. Also included are 10 complete program examples, with line-by-line explanations. The handbook is an essential guide for anyone doing serious system-level programming.

Table of Contents

Preface
1. Introduction
2. Software Conventions
2.1 Introduction
2.2 Register-Usage Conventions
2.3 Stack Usage Conventions
2.4 Procedure Format
2.5 Program Listings
2.5.1 Example 1 - A Simple Leaf Function
2.5.2 Example 2 - Leaf Function With Local Array
2.5.3 Example 3 - Simple Non-Leaf Function
2.5.4 Example 4 - Non-Leaf Function That Saves Three Registers
2.5.5 Example 5 - Non-Leaf Function That Uses Four Save Registers
2.5.6 Example 6 - Simple Floating-Point Leaf Function
3. Initialization
3.1 Introduction
3.2 Example Programs
3.2.1 Example 1 - A Simple Initialization
3.2.2 Example 2 - Initialization That Flushes the Caches
3.3. Flushing the Cache
3.3.1 Flushing the R3000 Cache
3.3.2 Flushing the LR33000 Cache
3.4 Program Listings
4. Exceptions
4.1 Introduction
4.2 External Interrupts
4.2.1 Hardware Interrupt Examples
4.2.1.1 Example 1 - A Single Interrupt Source
4.2.1.2 Example 2 - Two Interrupt Sources
4.2.1.3 Example 3 - Nested Interrupts
4.2.1.4 Example 4 - Interrupt Handler in C
4.2.1.5 Example 5 - UNIX Unix Time Function Support
4.2.1.6 Example 6 - Prioritizing Interrupts
4.2.2 Software Interrupts Example
4.3 Exceptions In a Branch Delay Slot
4.4 Interrupt Latency
4.5 Program Listings
5. Instruction Set Reference
5.1 Introduction
5.2 Syntax Descriptions
5.3 Instruction Descriptions
A. Overview of the MIPS1 Architecture
B. Instruction Summary
C. Prologue and Epilogue Templates
D. Include files
E. Libraries
F. Vendors of MIPS Products
Index
Errata

The examples from the book are available as a .tar.Z file for UNIX systems, and as an .exe (self-extracting archive) file for MSDOS systems.

Related Publications