Ngôn ngữ hội MIPS ProgrammingRobert
Số trang: 108
Loại file: pdf
Dung lượng: 524.72 KB
Lượt xem: 14
Lượt tải: 0
Xem trước 10 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Cuốn sách này cung cấp một kỹ thuật mà sẽ làm cho ngôn ngữ lập trình lắp ráp MIPS một nhiệm vụ tương đối dễ dàng so với văn bản phức tạp Intel 80x86 mã ngôn ngữ lắp ráp
Nội dung trích xuất từ tài liệu:
Ngôn ngữ hội MIPS ProgrammingRobert MIPS Assembly Language ProgrammingRobert BrittonComputer Science DepartmentCalifornia State University, ChicoChico, CaliforniaInstructors are granted permission to make copies of this beta version textbook for use bystudents in their courses. Title to and ownership of all intellectual property rights in thisbook are the exclusive property of Robert Britton, Chico, California.iiPrefaceThis book is targeted for use in an introductory lower-division assembly languageprogramming or computer organization course. After students are introduced to the MIPSarchitecture using this book, they will be well prepared to go on to an upper-divisioncomputer organization course using a textbook such as “Computer Organization andDesign” by Patterson and Hennessy. This book provides a technique that will make MIPSassembly language programming a relatively easy task as compared to writing complexIntel 80x86 assembly language code. Students using this book will acquire anunderstanding of how the functional components of computers are put together, and howa computer works at the machine language level. We assume students have experience indeveloping algorithms, and running programs in a high-level language.Chapter 1 provides an introduction to the basic MIPS architecture, which is a modernReduced Instruction Set Computer (RISC). Chapter 2 shows how to develop codetargeted to run on a MIPS processor using an intermediate pseudocode notation similar tothe high-level language “C”, and how easy it is to translate this notation to MIPSassembly language.Chapter 3 is an introduction to the binary number system, and the rules for performingarithmetic, as well as detecting overflow. Chapter 4 explains the features of the PCSpimsimulator for the MIPS architecture, which by the way is available for free. Within theremaining chapters, a wealth of programming exercises are provided, which everystudent needs to become an accomplished assembly language programmer. Instructorsare provided with a set of PowerPoint slides. After students have had an opportunity todevelop their pseudocode and their MIPS assembly language code for each of theexercises, they can be provided with example solutions via the PowerPoint slides.In Chapter 5 students are presented with the classical I/O algorithms for decimal andhexadecimal representation. The utility of logical operators and shift operators arestressed. In Chapter 6, a specific argument passing protocol is defined. Most significantprogramming projects are a teamwork effort. Emphasis is placed on the importance thateveryone involved in a teamwork project must adopt the same convention for parameterpassing. In the case of nested function calls, a specific convention is defined for savingand restoring values in the temporary registers. In Chapter 7 the necessity for reentrantcode is explained, as well as the rules one must follow to write such functions. Chapter 8introduces exceptions and exception processing. In Chapter 9 a pipelined implementationof the MIPS architecture is presented, and the special programming considerationsdealing with delayed loads and delayed branches are discussed. The final chapter brieflydescribes the expanding opportunities in the field of embedded processors forprogrammers who have a solid understanding of the underlying processor functionality. Robert Britton May 2002 iiiContentsCHAPTER 1: The MIPS Architecture............................................................................... 1 1.1 Introduction.......................................................................................................... 1 1.2 The Datapath Diagram......................................................................................... 1 1.3 Instruction Fetch and Execute.............................................................................. 2 1.4 The MIPS Register File ....................................................................................... 3 1.5 The Arithmetic and Logic Unit (ALU)................................................................ 3 1.6 The Program Counter (PC) .................................................................................. 4 1.7 Memory................................................................................................................ 5 1.8 The Instruction Register (IR) ............................................................................... 5 1.9 The Control Unit .................................................................................................. 5 1.10 Instruction Set ...................................................................................................... 6 1.11 Addressing Modes ............................................................................................... 7 1.12 Summary.............................................................................................................. 8 Exercises ......................................................................................................................... 8CHAPTER 2: Pseudocode ................................................................................................. 9 2.1 Introduction.......................................................................................................... 9 2.2 Develop the Algorithm in Pseudocode ................................................................ 9 2.3 Register Usage Convention................................................................................ 12 2.4 The MIPS Instruction Set.............................................................. ...
Nội dung trích xuất từ tài liệu:
Ngôn ngữ hội MIPS ProgrammingRobert MIPS Assembly Language ProgrammingRobert BrittonComputer Science DepartmentCalifornia State University, ChicoChico, CaliforniaInstructors are granted permission to make copies of this beta version textbook for use bystudents in their courses. Title to and ownership of all intellectual property rights in thisbook are the exclusive property of Robert Britton, Chico, California.iiPrefaceThis book is targeted for use in an introductory lower-division assembly languageprogramming or computer organization course. After students are introduced to the MIPSarchitecture using this book, they will be well prepared to go on to an upper-divisioncomputer organization course using a textbook such as “Computer Organization andDesign” by Patterson and Hennessy. This book provides a technique that will make MIPSassembly language programming a relatively easy task as compared to writing complexIntel 80x86 assembly language code. Students using this book will acquire anunderstanding of how the functional components of computers are put together, and howa computer works at the machine language level. We assume students have experience indeveloping algorithms, and running programs in a high-level language.Chapter 1 provides an introduction to the basic MIPS architecture, which is a modernReduced Instruction Set Computer (RISC). Chapter 2 shows how to develop codetargeted to run on a MIPS processor using an intermediate pseudocode notation similar tothe high-level language “C”, and how easy it is to translate this notation to MIPSassembly language.Chapter 3 is an introduction to the binary number system, and the rules for performingarithmetic, as well as detecting overflow. Chapter 4 explains the features of the PCSpimsimulator for the MIPS architecture, which by the way is available for free. Within theremaining chapters, a wealth of programming exercises are provided, which everystudent needs to become an accomplished assembly language programmer. Instructorsare provided with a set of PowerPoint slides. After students have had an opportunity todevelop their pseudocode and their MIPS assembly language code for each of theexercises, they can be provided with example solutions via the PowerPoint slides.In Chapter 5 students are presented with the classical I/O algorithms for decimal andhexadecimal representation. The utility of logical operators and shift operators arestressed. In Chapter 6, a specific argument passing protocol is defined. Most significantprogramming projects are a teamwork effort. Emphasis is placed on the importance thateveryone involved in a teamwork project must adopt the same convention for parameterpassing. In the case of nested function calls, a specific convention is defined for savingand restoring values in the temporary registers. In Chapter 7 the necessity for reentrantcode is explained, as well as the rules one must follow to write such functions. Chapter 8introduces exceptions and exception processing. In Chapter 9 a pipelined implementationof the MIPS architecture is presented, and the special programming considerationsdealing with delayed loads and delayed branches are discussed. The final chapter brieflydescribes the expanding opportunities in the field of embedded processors forprogrammers who have a solid understanding of the underlying processor functionality. Robert Britton May 2002 iiiContentsCHAPTER 1: The MIPS Architecture............................................................................... 1 1.1 Introduction.......................................................................................................... 1 1.2 The Datapath Diagram......................................................................................... 1 1.3 Instruction Fetch and Execute.............................................................................. 2 1.4 The MIPS Register File ....................................................................................... 3 1.5 The Arithmetic and Logic Unit (ALU)................................................................ 3 1.6 The Program Counter (PC) .................................................................................. 4 1.7 Memory................................................................................................................ 5 1.8 The Instruction Register (IR) ............................................................................... 5 1.9 The Control Unit .................................................................................................. 5 1.10 Instruction Set ...................................................................................................... 6 1.11 Addressing Modes ............................................................................................... 7 1.12 Summary.............................................................................................................. 8 Exercises ......................................................................................................................... 8CHAPTER 2: Pseudocode ................................................................................................. 9 2.1 Introduction.......................................................................................................... 9 2.2 Develop the Algorithm in Pseudocode ................................................................ 9 2.3 Register Usage Convention................................................................................ 12 2.4 The MIPS Instruction Set.............................................................. ...
Tìm kiếm theo từ khóa liên quan:
sơ đồ đường dữ chương trình cập đơn vị kiểm tập lệnh xây dựng thuật toánTài liệu liên quan:
-
38 trang 70 0 0
-
BÀI TẬP TIN HỌC ĐẠI CƯƠNG - PHẦN I
8 trang 27 0 0 -
BÀI TẬP TIN HỌC ĐẠI CƯƠNG - PHẦN VI
12 trang 25 0 0 -
Chương 1: BỘ ĐIỀU KHIỂN LẬP TRÌNH
91 trang 24 0 0 -
Ứng dụng Matlab trong điều khiển tự động - Chương 4
0 trang 24 0 0 -
Bài giảng Nhập môn Công nghệ thông tin 1: Chương 8 - Ngô Chánh Đức
29 trang 23 0 0 -
6 trang 23 0 0
-
CHƯƠNG 2: KIẾN TRÚC CPU VÀ TẬP LỆNH
39 trang 23 0 0 -
Bài giảng Nhập môn Công nghệ thông tin 1: Xây dựng, phát triển và đánh giá thuật toán
29 trang 23 0 0 -
Giáo án Tin học lớp 10: Bài toán - Thuật toán (tiết 2)
3 trang 22 0 0