惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LINUX DO - 热门话题
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Project Zero
Project Zero
V
Vulnerabilities – Threatpost
Cisco Talos Blog
Cisco Talos Blog
P
Palo Alto Networks Blog
C
Cisco Blogs
A
Arctic Wolf
月光博客
月光博客
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
量子位
小众软件
小众软件
Latest news
Latest news
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
N
Netflix TechBlog - Medium
K
Kaspersky official blog
人人都是产品经理
人人都是产品经理
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
Y
Y Combinator Blog
P
Proofpoint News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
S
Schneier on Security
D
Docker
Scott Helme
Scott Helme
MyScale Blog
MyScale Blog
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
GbyAI
GbyAI
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
H
Help Net Security
Simon Willison's Weblog
Simon Willison's Weblog
J
Java Code Geeks
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tenable Blog
B
Blog
Know Your Adversary
Know Your Adversary
IT之家
IT之家

博客园 - embed

TCP IP for embed system [zt]模拟视频 入门 UDP and TCP difference reference book list linux device driver study(chapter2) 2004年的最后一帖 yuv2rgb 优化与优化工具 arm assembly note dsp编程学习 图象传感器厂家 一些电路的FAQ 算法的书 TCP的写 rtos's schedule algorithm c++ 学习 关于密码学方面的书 编译原理方面的书 算法的书
mips的函数调用与堆栈
embed · 2004-12-22 · via 博客园 - embed

mips的函数调用与堆栈

mips共有32个register.其中的29为$sp,arm为r13
堆栈向内存地址低的方向增长。<=这个应该与汇编器有关。除了规定堆栈增加
方向外,还有堆栈是满还是空。如ARM的APCS

SGI定义的函数调用参数传递规则与arm有点象
一.传入
前4个传入的参数通过$a0到$a3传递,但堆栈的分配有些怪异,即使堆栈上没有
这4个参数,也要空出空间来。剩下的参数全部通过堆栈传递。
二返回
使用$v0,arm分返回是32位或是64位,使用r0/r1.
三我还搞不清楚参数是按什么方向入栈的,谁负责恢复堆栈。
四函数返回地址
保存在$ra也就是$31(第32个积存器)中
要注意的是,在嵌套的函数调用中,页函数只需保存恢复$ra就可以了。
而nested function需要把$ra保存在堆栈中,返回时并从堆栈中恢复。
因为编译器每次调用函数只是自动把函数返回地址保存在$ra中。
五frame指针
$30 ,$fp这个指针是为了能够脱离sp的变化而固定的对函数参数,local变量进行
寻址。有些高层的编译器使用或者也可以不使用fp

Saturday, February 28, 2009

http://logos.cs.uic.edu/366/notes/MIPS%20Quick%20Tutorial.htm


未完...

posted on 2004-12-22 09:57  embed  阅读(5479)  评论()    收藏  举报