没有合适的资源?快使用搜索试试~ 我知道了~
Computer Systems - A Programmers Perspective 2ed
需积分: 0 0 下载量 111 浏览量
2018-10-03
23:02:28
上传
评论
收藏 4.9MB PDF 举报
温馨提示
试读
1071页
《深入理解计算机系统 第二部》 英文原版 Computer Systems - A Programmers Perspective 2ed
资源推荐
资源详情
资源评论
Computer Systems
A Programmer’s Perspective
Randal E. Bryant
Carnegie Mellon University
David R. O’Hallaron
Carnegie Mellon University and Intel Labs
Prentice Hall
Boston Columbus Indianapolis New York San Francisco Upper Saddle River
Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto
Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
Editorial Director: Marcia Horton
Editor-in-Chief: Michael Hirsch
Acquisitions Editor: Matt Goldstein
Editorial Assistant: Chelsea Bell
Director of Marketing: Margaret Waples
Marketing Coordinator: Kathryn Ferranti
Managing Editor: Jeff Holcomb
Senior Manufacturing Buyer: Carol Melville
Art Director: Linda Knowles
Cover Designer: Elena Sidorova
Image Interior Permission Coordinator: Richard Rodrigues
Cover Art: © Randal E. Bryant and David R. O’Hallaron
Media Producer: Katelyn Boller
Project Management and Interior Design: Paul C. Anagnostopoulos, Windfall Software
Composition: Joe Snowden, Coventry Composition
Printer/Binder: Edwards Brothers
Cover Printer: Lehigh-Phoenix Color/Hagerstown
Copyright © 2011, 2003 by Randal E. Bryant and David R. O’Hallaron. All rights reserved.
Manufactured in the United States of America. This publication is protected by Copyright,
and permission should 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. To obtain permission(s) to use material
from this work, please submit a written request to Pearson Education, Inc., Permissions
Department, 501 Boylston Street, Suite 900, Boston, Massachusetts 02116.
Many of the designations by manufacturers and seller to distinguish their products are
claimed as trademarks. Where those designations appear in this book, and the publisher
was aware of a trademark claim, the designations have been printed in initial caps or all
caps.
Library of Congress Cataloging-in-Publication Data
Bryant, Randal.
Computer systems : a programmer’s perspective / Randal E. Bryant, David R.
O’Hallaron.—2nd ed.
p. cm.
Includes bibliographical references and index.
ISBN-13: 978-0-13-610804-7 (alk. paper)
ISBN-10: 0-13-610804-0 (alk. paper)
1. Computer systems. 2. Computers. 3. Telecommunication. 4. User interfaces
(Computer systems) I. O’Hallaron, David Richard. II. Title.
QA76.5.B795 2010
004—dc22
2009053083
10987654321—EB—14 13 12 11 10
ISBN 10: 0-13-610804-0
ISBN 13: 978-0-13-610804-7
Contents
Preface xix
About the Authors xxxiii
1
A Tour of Computer Systems 1
1.1 Information Is Bits + Context 3
1.2 Programs Are Translated by Other Programs into Different Forms 4
1.3 It Pays to Understand How Compilation Systems Work 6
1.4 Processors Read and Interpret Instructions Stored in Memory 7
1.4.1 Hardware Organization of a System 7
1.4.2 Running the
hello Program 10
1.5 Caches Matter 12
1.6 Storage Devices Form a Hierarchy 13
1.7 The Operating System Manages the Hardware 14
1.7.1 Processes 16
1.7.2 Threads 17
1.7.3 Virtual Memory 17
1.7.4 Files 19
1.8 Systems Communicate with Other Systems Using Networks 20
1.9 Important Themes 21
1.9.1 Concurrency and Parallelism 21
1.9.2 The Importance of Abstractions in Computer Systems 24
1.10 Summary 25
Bibliographic Notes 26
Part I Program Structure and Execution
2
Representing and Manipulating Information 29
2.1 Information Storage 33
2.1.1 Hexadecimal Notation 34
2.1.2 Words 38
2.1.3 Data Sizes 38
vii
viii Contents
2.1.4 Addressing and Byte Ordering 39
2.1.5 Representing Strings 46
2.1.6 Representing Code 47
2.1.7 Introduction to Boolean Algebra 48
2.1.8 Bit-Level Operations in C 51
2.1.9 Logical Operations in C 54
2.1.10 Shift Operations in C 54
2.2 Integer Representations 56
2.2.1 Integral Data Types 57
2.2.2 Unsigned Encodings 58
2.2.3 Two’s-Complement Encodings 60
2.2.4 Conversions Between Signed and Unsigned 65
2.2.5 Signed vs. Unsigned in C 69
2.2.6 Expanding the Bit Representation of a Number 71
2.2.7 Truncating Numbers 75
2.2.8 Advice on Signed vs. Unsigned 76
2.3 Integer Arithmetic 79
2.3.1 Unsigned Addition 79
2.3.2 Two’s-Complement Addition 83
2.3.3 Two’s-Complement Negation 87
2.3.4 Unsigned Multiplication 88
2.3.5 Two’s-Complement Multiplication 89
2.3.6 Multiplying by Constants 92
2.3.7 Dividing by Powers of Two 95
2.3.8 Final Thoughts on Integer Arithmetic 98
2.4 Floating Point 99
2.4.1 Fractional Binary Numbers 100
2.4.2 IEEE Floating-Point Representation 103
2.4.3 Example Numbers 105
2.4.4 Rounding 110
2.4.5 Floating-Point Operations 113
2.4.6 Floating Point in C 114
2.5 Summary 118
Bibliographic Notes 119
Homework Problems 119
Solutions to Practice Problems 134
3
Machine-Level Representation of Programs 153
3.1 A Historical Perspective 156
3.2 Program Encodings 159
Contents ix
3.2.1 Machine-Level Code 160
3.2.2 Code Examples 162
3.2.3 Notes on Formatting 165
3.3 Data Formats 167
3.4 Accessing Information 168
3.4.1 Operand Specifiers 169
3.4.2 Data Movement Instructions 171
3.4.3 Data Movement Example 174
3.5 Arithmetic and Logical Operations 177
3.5.1 Load Effective Address 177
3.5.2 Unary and Binary Operations 178
3.5.3 Shift Operations 179
3.5.4 Discussion 180
3.5.5 Special Arithmetic Operations 182
3.6 Control 185
3.6.1 Condition Codes 185
3.6.2 Accessing the Condition Codes 187
3.6.3 Jump Instructions and Their Encodings 189
3.6.4 Translating Conditional Branches 193
3.6.5 Loops 197
3.6.6 Conditional Move Instructions 206
3.6.7 Switch Statements 213
3.7 Procedures 219
3.7.1 Stack Frame Structure 219
3.7.2 Transferring Control 221
3.7.3 Register Usage Conventions 223
3.7.4 Procedure Example 224
3.7.5 Recursive Procedures 229
3.8 Array Allocation and Access 232
3.8.1 Basic Principles 232
3.8.2 Pointer Arithmetic 233
3.8.3 Nested Arrays 235
3.8.4 Fixed-Size Arrays 237
3.8.5 Variable-Size Arrays 238
3.9 Heterogeneous Data Structures 241
3.9.1 Structures 241
3.9.2 Unions 244
3.9.3 Data Alignment 248
3.10 Putting It Together: Understanding Pointers 252
3.11 Life in the Real World: Using the gdb Debugger 254
3.12 Out-of-Bounds Memory References and Buffer Overflow 256
3.12.1 Thwarting Buffer Overflow Attacks 261
剩余1070页未读,继续阅读
资源评论
Skuld_yi
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功