在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 4505|回复: 11

MIPS Assembly Language Programming

[复制链接]
发表于 2007-9-15 23:22:03 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
最近在学mips,共享mips资料

MIPS Assembly Language Programming
Robert Britton
Computer Science Department
California State University, Chico
Chico, California

Contents
CHAPTER 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 ......................................................................................................................... 8
CHAPTER 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................................................................................... 12
2.5 Translation of an “IF THEN ELSE” Control Structure..................................... 13
2.6 Translation of a “WHILE” Control Structure.................................................... 14
2.7 Translation of a “FOR LOOP” Control Structure.............................................. 14
2.8 Translation of Arithmetic Expressions .............................................................. 15
2.9 Translation of a “SWITCH” Control Structure ................................................. 16
2.10 Assembler Directives......................................................................................... 17
2.11 Input and Output ................................................................................................ 18
Exercises ....................................................................................................................... 18
CHAPTER 3: Number Systems....................................................................................... 21
3.1 Introduction........................................................................................................ 21
3.2 Positional Notation............................................................................................. 21
3.3 Converting Binary Numbers to Decimal Numbers............................................ 22
3.4 Detecting if a Binary Number is Odd or Even................................................... 22
3.5 Multiplication by Constants that are a Power of Two ....................................... 23
3.6 The Double and Add Method ............................................................................ 23
3.7 Converting Decimal Numbers to Binary Numbers............................................ 24
3.8 The Two’s Complement Number System.......................................................... 24
3.9 The Two’s Complement Operation ................................................................... 25
3.10 A Shortcut for Finding the Two’s Complement of any Number....................... 25
3.11 Sign Extension ................................................................................................... 26
3.12 Binary Addition ................................................................................................. 26
3.13 Binary Subtraction ............................................................................................. 26
3.14 Overflow Detection............................................................................................ 27
3.15 Hexadecimal Numbers....................................................................................... 27
Exercises ....................................................................................................................... 28
CHAPTER 4: PCSpim The MIPS Simulator................................................................... 31
4.1 Introduction........................................................................................................ 31
4.2 Advantages of a Simulator................................................................................. 31
4.3 The Big Picture .................................................................................................. 32
4.4 Analyzing the Text Segment.............................................................................. 34
4.5 Analyzing the Data Segment ............................................................................. 35
4.6 System I/O ......................................................................................................... 36
4.7 Deficiencies of the System I/O Services............................................................ 36
Exercises ....................................................................................................................... 38
CHAPTER 5: Algorithm Development........................................................................... 39
5.1 Introduction........................................................................................................ 39
5.2 Instructions that Perform Logical Operations.................................................... 39
5.3 Instructions that Perform Shift Operations ........................................................ 41
5.4 Modular Program Design and Documentation .................................................. 42
5.5 A Function to Print Values in Hexadecimal Representation ............................. 47
5.6 A Function to Read Values in Hexadecimal Representation............................. 48
5.7 A Function to Print Decimal Values Right Justified ......................................... 49
5.8 A Function to Read Decimal Values and Detect Errors .................................... 49
Exercises ....................................................................................................................... 50
CHAPTER 6: Function Calls Using the Stack ................................................................ 53
6.1 Introduction........................................................................................................ 53
6.2 The Stack Segment in Memory.......................................................................... 53
6.3 Argument Passing Convention .......................................................................... 53
6.4 Nested Function Calls and Leaf Functions ........................................................ 54
6.5 Local Variables are Allocated Space on the Stack ............................................ 55
6.6 Frame Pointer..................................................................................................... 55
Exercises ....................................................................................................................... 56
CHAPTER 7: Reentrant Functions.................................................................................. 59
7.1 Introduction........................................................................................................ 59
7.2 Rules for Writing Reentrant Code ..................................................................... 59
7.3 Reentrant I/O Functions..................................................................................... 60
7.4 Personal Computers ........................................................................................... 60
7.5 Recursive Functions........................................................................................... 60
Exercises ....................................................................................................................... 61
CHAPTER 8: Exception Processing................................................................................ 63
8.1 Introduction........................................................................................................ 63
8.2 The Trap Handler............................................................................................... 63
Exercises ....................................................................................................................... 65
CHAPTER 9: A Pipelined Implementation..................................................................... 67
9.1 Introduction........................................................................................................ 67
9.2 A Pipelined Datapath ......................................................................................... 68
9.3 PCSpim Option to Simulate a Pipelined Implementation.................................. 69
Exercises ....................................................................................................................... 69
CHAPTER 10: Embedded Processors............................................................................. 71
10.1 Introduction........................................................................................................ 71
10.2 Code Development for Embedded Processors................................................... 71
10.3 Memory Mapped I/O ......................................................................................... 72
10.4 References.......................................................................................................... 72
APPENDIX A: Quick Reference..................................................................................... 73
APPENDIX B: ASCII Codes........................................................................................... 77
APPENDIX C: Integer Instruction Set ............................................................................ 79
APPENDIX D: Macro Instructions ................................................................................. 95
APPENDIX E: A Trap Handler..................................................................................... 100

MIPS Assembly Language Programming.rar

440.03 KB, 下载次数: 66 , 下载积分: 资产 -2 信元, 下载支出 2 信元

发表于 2007-9-19 01:00:54 | 显示全部楼层
谢谢,mpis的汇编语言
发表于 2007-10-1 04:26:19 | 显示全部楼层
xie xie fenxiang hehe
发表于 2008-1-17 11:03:38 | 显示全部楼层

谢谢了

找了N久没找到。。。原来你也在这里啊
发表于 2008-1-17 11:06:58 | 显示全部楼层

mips 指令集

dfsdf

MIPS32指令集.pdf

2.4 MB, 下载次数: 2 , 下载积分: 资产 -2 信元, 下载支出 2 信元

发表于 2009-9-29 17:29:23 | 显示全部楼层
thanks
发表于 2009-9-29 21:01:34 | 显示全部楼层
Oh,thanks a lot!
发表于 2009-10-2 08:43:00 | 显示全部楼层
感謝大大無私的分享
发表于 2010-3-24 12:21:55 | 显示全部楼层
谢谢!!!!
发表于 2010-3-31 09:07:20 | 显示全部楼层
回帖 回帖 回帖 回帖
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-11-23 15:32 , Processed in 0.030205 second(s), 11 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表