2015 Martin Ruckert - The MMIX Supplement.pdf

(1942 KB) Pobierz
THE
MMIX
SUPPLEMENT
Supplement to
The Art of Computer Programming
Volumes 1, 2, 3
by Donald E. Knuth
MARTIN RUCKERT
Munich University of Applied Sciences
ADDISON–WESLEY
Upper Saddle River, NJ
•
Boston
•
Indianapolis
•
San Francisco
New York
•
Toronto
•
Montr´al
•
London
•
Munich
•
Paris
•
Madrid
e
Capetown
•
Sydney
•
Tokyo
•
Singapore
•
Mexico City
The author and publisher have taken care in the preparation of this book,
but make no expressed or implied warranty of any kind and assume no
responsibility for errors or omissions. No liability is assumed for incidental
or consequential damages in connection with or arising out of the use of
the information or programs contained herein.
For information about buying this title in bulk quantities, or for special
sales opportunities (which may include electronic versions; custom cover
designs; and content particular to your business, training goals, marketing
focus, or branding interests), please contact our corporate sales department
at
corpsales@pearsoned.com
or (800) 382-3419.
For government sales inquiries,
please contact
governmentsales@pearsoned.com.
For questions about sales outside the United States,
please contact
intlcs@pearsoned.com.
Visit us on the Web:
informit.com/aw
Library of Congress Cataloging-in-Publication Data
Ruckert, Martin.
The MMIX supplement : supplement to The art of computer programming,
volumes 1, 2, 3 by Donald E. Knuth / Martin Ruckert, Munich University
of Applied Sciences.
pages
cm
Includes index.
ISBN 978-0-13-399231-1 (pbk. : alk. paper) -- ISBN 0-13-399231-4 (pbk.
: alk. paper)
1. MMIX (Computer architecture) 2. Assembly languages (Electronic
computers) 3. Microcomputers--Programming. I. Knuth, Donald Ervin,
1938-. Art of computer programming. II. Title.
QA76.6 .K64 2005 Suppl. 1
005.1--dc23
2014045485
Internet page
http://mmix.cs.hm.edu/supplement.html
contains current informa-
tion about this book, downloadable software, and general news about
MMIX.
See also
http://www-cs-faculty.stanford.edu/~knuth/taocp.html
for information
about
The Art of Computer Programming
by Donald E. Knuth.
Copyright c 2015 by Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is
protected by copyright, and permission must be obtained from the publisher prior
to any prohibited reproduction, storage in a retrieval system, or transmission in any
form or by any means, electronic, mechanical, photocopying, recording, or likewise.
For information regarding permissions, request forms and the apprpriate contacts
within the Pearson Education Global Rights & Permissions Department, please visit
www.pearsoned.com/permissions/.
ISBN-13: 978-0-13-399231-1
ISBN-10: 0-13-399231-4
First printing, February 2015
FOREWORD
Why are some
programmers so much better than others? What is the magical
ingredient that makes it possible for some people to resonate with computers
so well, and to reach new heights of performance? Many different skills are
clearly involved. But after decades of observation I’ve come to believe that one
particular talent stands out among the world-class programmers I’ve known —
namely, an ability to move effortlessly between different levels of abstraction.
That may sound like a scary and complex thing, inherently abstract in itself,
but I think it’s not really too hard to explain. A programmer must deal with
high-level concepts related to a problem area, with low-level concepts related to
basic steps of computation, and with numerous levels in between. We represent
reality by creating structures that are composed of progressively simpler and
simpler parts. We don’t only need to understand how those parts fit together; we
also need to be able somehow to envision the whole show — to see everything in
the large while seeing it simultaneously in the small and in the middle. Without
blinking an eye, we need to understand why a major goal can be accomplished
if we begin by increasing the contents of a lowly computer register by 1.
The best way to enhance our level-jumping skills is to exercise them fre-
quently. And I believe the most effective strategy for that is to repeatedly
examine the details of what goes on at the hardware level when a sophisticated
algorithm is being implemented at a conceptual level. In the preface to Volume 1
of
The Art of Computer Programming,
I listed six reasons for choosing to discuss
machine-oriented details together with high-level abstractions, integrating both
aspects as I was presenting fundamental paradigms and algorithms of computer
science. I still like those six reasons. But in retrospect I see now that I was
actually blind to the most important reason — that is, the pedagogical reason: I
know of no better way to teach a student to think like a top computer scientist
than to ground everything in a firm knowledge of how a computing machine
actually works. This bottom-up approach seems to be the best way to help
nurture an ability to navigate fluently between levels. Indeed, Tony Hoare once
told me that I should never even think of condensing these books by removing
the machine-language parts, because of their educational value.
I am thrilled to see the present book by Martin Ruckert: It is jam-packed
with goodies from which an extraordinary amount can be learned. Martin has
not merely transcribed my early programs for
MIX
and recast them in a modern
idiom. He has penetrated to their essence and rendered them anew with elegance
and good taste. His carefully checked codes represent a significant contribution
to the art of pedagogy as well as to the art of programming. Although I myself
rarely write machine-level instructions nowadays, my experiences of doing so
iii
iv
FOREWORD
in the past have provided an indispensable boost to the quality of everything
that I now am undertaking. So I encourage serious programmers everywhere to
sharpen their skills by devouring this book.
Stanford, California
December 2014
D. E. K.
Zgłoś jeśli naruszono regulamin