write_great_code_vo_l2.pdf

(4671 KB) Pobierz
CODE
VOLUME 2:
T H I N K I N G
W R I T E G R E AT
LOW-LEVEL
,
W R I T I N G
HIGH-LEVEL
Randall Hyde
WRITE GREAT
CODE
V o lu m e 2 : T h i n ki n g L o w -
L e ve l , W r i ti n g H i g h - L eve l
b y R an d a l l H y de
San Francisco
WRITE GREAT CODE, Vol. 2: Thinking Low-Level, Writing High-Level.
Copyright © 2006 by Randall Hyde.
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or
mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior
written permission of the copyright owner and the publisher.
Printed on recycled paper in the United States of America
1 2 3 4 5 6 7 8 9 10 – 09 08 07 06
No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other product and
company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark
symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the
benefit of the trademark owner, with no intention of infringement of the trademark.
Publisher: William Pollock
Managing Editor: Elizabeth Campbell
Cover and Interior Design: Octopod Studios
Developmental Editor: Jim Compton
Technical Reviewer: Benjamin David Lunt
Copyeditor: Kathy Grider-Carlyle
Compositor: Riley Hoffman
Proofreader: Stephanie Provines
For information on book distributors or translations, please contact No Starch Press, Inc. directly:
No Starch Press, Inc.
555 De Haro Street, Suite 250, San Francisco, CA 94107
phone: 415.863.9900; fax: 415.863.9950; info@nostarch.com; www.nostarch.com
The information in this book is distributed on an “As Is” basis, without warranty. While every precaution has been
taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have any liability to any
person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the
information contained in it.
Librar y of Congress Cataloging-in-Publication Data (Volume 1)
Hyde, Randall.
Write great code : understanding the machine / Randall Hyde.
p. cm.
ISBN 1-59327-003-8
1. Computer programming. 2. Computer architecture. I. Title.
QA76.6.H94 2004
005.1--dc22
2003017502
No Starch Press, Copyright © 2006 by Randall Hyde
BRIEF CONTENTS
Acknowledgments ..........................................................................................................xv
Introduction .................................................................................................................xvii
Chapter 1: Thinking Low-Level, Writing High-Level ..............................................................1
Chapter 2: Shouldn’t You Learn Assembly Language? .......................................................11
Chapter 3: 80x86 Assembly for the HLL Programmer ........................................................21
Chapter 4: PowerPC Assembly for the HLL Programmer ....................................................47
Chapter 5: Compiler Operation and Code Generation .....................................................61
Chapter 6: Tools for Analyzing Compiler Output ............................................................115
Chapter 7: Constants and High-Level Languages ............................................................165
Chapter 8: Variables in a High-Level Language .............................................................189
Chapter 9: Array Data Types .......................................................................................241
Chapter 10: String Data Types ....................................................................................281
Chapter 11: Pointer Data Types ...................................................................................315
Chapter 12: Record, Union, and Class Data Types ........................................................341
No Starch Press, Copyright © 2006 by Randall Hyde
Zgłoś jeśli naruszono regulamin