New Jersey Machine-Code Toolkit Architecture Specifications

Preface The New Jersey Machine-Code Toolkit helps programmers write applications that process machine code|assemblers, disassemblers, code generators, trac-ers, proolers, debuggers, and more. The toolkit lets programmers encode and decode machine instructions symbolically. It transforms symbolic manipulations into bit manipulations, guided by a speciication that deenes mappings between symbolic and binary representations of instructions. This document presents our annotated speciications for the MIPS R3000, SPARC, Pentium, and Alpha instruction sets. Ramsey and Fernn andez (1995) present an overview of the toolkit; read it rst. Ramsey and Fernn andez (1997) presents the toolkit's spec-iication lanugage in depth, and the reference manual for the toolkit (Ramsey and Fernn andez 1994) gives a complete description. This document does not just describe the speciications; it contains them. The noweb system (Ramsey 1994) for \literate programming" (Knuth 1992) makes it possible to write a single source containing both document and spec-iications. This source contains prose interleaved with deenitions of named code \chunks." Code chunks contain speciication code and references to other code chunks. The code chunks appear in an order suited to explanation, not necessarily in the order required by the toolkit language. Chunk names appear italicized within angle brackets, e.g., hpattern and constructor speciications 19ai. The \19a" is the number of the chunk's rst deenition. Chunk deenitions are numbered according to the pages on which they appear; When two or more chunks appear on the same page, a letter is appended to the page number, e.g. 18a and 18b. We present the speciications mostly in order of increasing complexity: the MIPS, followed by the SPARC, the Alpha, and then the Pentium. The annotations in the MIPS speciication describe basic use of the toolkit language. More sophisticated techniques appear in the SPARC, Alpha, and Pentium speciica-tions. Annotations include descriptions of how each architecture's instruction set is factored in its speciication and highlight useful speciication techniques, 1 2 CONTENTS e.g., those that protect against errors. References to the associated architecture manual also appear in the annotations. We encourage the reader to get the manuals so he can compare the information presented in the manuals to the equivalent information in the speciications.