MMIXware

by Donald E. Knuth
MMIX is a computer intended to illustrate machine-level aspects of programming. MMIX's so called RISC (Reduced Instruction Set Computer") architecture is much better able to represent the computers being built at the turn of the millennium.
This book is a collection of programs that make MMIX a virtual reality. One of the programs is an assembler, MMIXAL, which converts MMIX symbolic les to MMIX object fi les. There also are two simulators, which execute the programs in given object files.
The first simulator, called MMIX-SIM or simply MMIX, executes a program one instruction at a time and allows convenient debugging. The second simulator, MMMIX, simulates a high-performance pipeline in which many aspects of the computation are overlapped in time. MMMIX is in fact a highly con figurable meta-simulator," capable of simulating an enormous variety of di erent kinds of pipelines with any number of functional units and with many possible strategies for caching, virtual address translation, branch prediction, super-scalar instruction issue, etc., etc.
The programs in this book are somewhat primitive, because they all are based on a simple terminal interface: Users type commands and the computer types out a reply. Still, these programs are adequate to provide a basis for future developments. I'm hoping that at least one reader of this book will discover how much fun MMIX programming can be and will be motivated to create a nice graphical interface, so that other people will more easily be able to join in the fun. I don't have the time or talent to construct a good GUI myself, but I've tried to write the programs in such a way that modi cations and enhancements will be easy to make.
Read More/Download

Assemblers and Loaders

This book differs from the typical assembler text in that it is not a programming manual, and it is not concerned with any specific assembler language.Instead it concentrates on the design and implementation of assemblers and loaders. It assumes that the reader has some knowledge of computers and programming, and it aims to explain how assemblers and loaders work. Most of the discussion is general, and most of the examples are in a hypothetical, simple, assembler language. Certain examples are in the assembler languages of actual machines, and those are always specified.
This is mostly a professional book, intended for computer professionals in general, and especially for systems programmers.Ho wever, it can be used as a supplementary text in a systems programming or computer organization class at any level.
Chapter 1 introduces the one-pass and two-pass assemblers, discusses other important concepts—such as absolute- and relocatable object files—and describes assembler features such as local labels and multiple location counters. Data structures for implementing the symbol table are discussed in chapter 2.
Chapter 3 presents many directives and discusses their formats, meaning, and implementation.These directives are supported by many actual assemblers and, while not complete, this collection of directives is quite extensive.
The two important topics of macros and conditional assembly are introduced in chapter 4. The treatment of macros is as complete as practically possible. Features of the listing file are outlined, with examples, in chapter 5, while
chapter 6 is a general description of the properties of disassembler, and of three special types of assemblers.Those topics, especially meta-assemblers and high-level assemblers, are of special interest to the advanced reader.They are not new, but even experienced programmers are not always familiar with them.
Chapter 7 covers loaders.There is a very detailed example of the basic operation of a one pass linking loader, followed by features and concepts such as dynamic loading, bootstrap loader, overlays, and others.
Finally, chapter 8 contains a survey of four modern, state of the art, assemblers. Their main characteristics are described, as well as features that distinguish them from their older counterparts.
Read More/Download

The Art of Assembly Language

Why would anyone learn this stuff?
  • Your major requires a course in assembly language; i.e., you’re here against your will.
  • A programmer where you work quit. Most of the source code left behind was written in assembly language and you were elected to maintain it.
  • Your boss has the audacity to insist that you write your code in assembly against your strongest wishes.
  • Your programs run just a little too slow, or are a little too large and you think assembly language might help you get your project under control.
  • You want to understand how computers actually work.
  • You’re interested in learning how to write efficient code.
  • You want to try something new.
This is a book which teaches assembly language programming, written for college level students, written by someone who appears to know what he’s talking about, your natural tendency is to believe something if it appears in print. Having just read the above, you’re starting to assume that assembly must be pretty bad. And that, dear friend, is eighty percent of what’s wrong with assembly language. That is, people develop some very strong misconceptions about assembly language based on what they’ve heard from friends, instructors, articles, and books. Oh, assembly language is certainly not perfect. It does have many real faults. Those faults, however, are blown completely out of proportion by those unfamiliar with assembly language. The next time someone starts preaching about the evils of assembly language, ask, “how many years of assembly language programming experience do you have?” Of course assembly is hard to understand if you don’t know it.
It is surprising how many people are willing to speak out against assembly language based only on conversations they’ve had or articles they’ve read. Assembly language users also use high level languages (HLLs); assembly’s most outspoken opponents rarely use anything but HLLs. Who would you believe, an expert well versed in both types of programming languages or someone who has never taken the time to learn assembly language and develop an honest opinion of its capabilities?
Read More/Download

Popular Posts