Ktl-icon-tai-lieu

MIps

Được đăng lên bởi Lê Văn Luân
Số trang: 97 trang   |   Lượt xem: 4183 lần   |   Lượt tải: 0 lần
MIPS Assembly Language Programming
CS50 Discussion and Project Book
Daniel J. Ellard
September, 1994

Contents
1 Data Representation
1.1 Representing Integers . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.1 Unsigned Binary Numbers . . . . . . . . . . . . . . . . . . . .
1.1.1.1 Conversion of Binary to Decimal . . . . . . . . . . .
1.1.1.2 Conversion of Decimal to Binary . . . . . . . . . . .
1.1.1.3 Addition of Unsigned Binary Numbers . . . . . . . .
1.1.2 Signed Binary Numbers . . . . . . . . . . . . . . . . . . . . .
1.1.2.1 Addition and Subtraction of Signed Binary Numbers
1.1.2.2 Shifting Signed Binary Numbers . . . . . . . . . . .
1.1.2.3 Hexadecimal Notation . . . . . . . . . . . . . . . . .
1.2 Representing Characters . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Representing Programs . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4 Memory Organization . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.1 Units of Memory . . . . . . . . . . . . . . . . . . . . . . . . .
1.4.1.1 Historical Perspective . . . . . . . . . . . . . . . . .
1.4.2 Addresses and Pointers . . . . . . . . . . . . . . . . . . . . . .
1.4.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.5.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.5.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1
1
1
2
4
4
6
8
9
9
10
11
12
13
13
13
14
15
15
15
15

2 MIPS Tutorial
2.1 What is Assembly Language? . . . .
2.2 Getting Started: add.asm . . . . . .
2.2.1 Commenting . . . . . . . . . .
2.2.2 Finding the Right Instructions

17
17
18
18
19

i

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

ii

CONTENTS
2.2.3

Completing the Program . . . . . . .
2.2.3.1 Labels and main . . . . . .
2.2.3.2 Syscalls . . . . . . . . . . .
2.3 Using SPIM . . . . . . . . . . . . . . . . . .
2.4 Using syscall: add2.asm . . . . . . . . . .
2.4.1 Reading and Printing Integers . . . .
2.5 Strings: the hello Program . . . . . . . . .
2.6 Conditional Execution: the larger Program
2.7 Looping: the multiples Program . . . . . .
2.8 Loads: the palindrome.asm Program . . . .
2.9 The atoi Program . . . . . . . . . . . . . .
2.9.1 atoi-1 . . . . . . . . . . . ....
MIPS Assembly Language Programming
CS50 Discussion and Project Book
Daniel J. Ellard
September, 1994
MIps - Trang 2
Để xem tài liệu đầy đủ. Xin vui lòng
MIps - Người đăng: Lê Văn Luân
5 Tài liệu rất hay! Được đăng lên bởi - 1 giờ trước Đúng là cái mình đang tìm. Rất hay và bổ ích. Cảm ơn bạn!
97 Vietnamese
MIps 9 10 892