- 3
- 0
- 约5.55千字
- 约 9页
- 2017-08-16 发布于河南
- 举报
printList((p)next)课件
The MIPS stack: recap
The stack grows downward in terms of memory addresses.
The address of the top element of the stack is stored (by convention) in the “stack pointer” register, $sp.
0($sp), 1($sp), … are “used” locations
-1($sp), -2($sp), … are “free”
MIPS does not provide “push” and “pop” instructions. Instead, they must be done explicitly by the programmer.
“push” $t0 simulated with:
sub $sp, $sp, 4 # $t0 needs 4 bytes
sw $t0, 0($sp) # write to stack
“pop” $t0 simulated with:
lw $t0, 0($sp) # read stack top
addi $sp, $sp, 4 # free 4 bytes
0x7FFFFFFF
0$sp
stack
堤惟猪盾妮矮蝗良花邪
您可能关注的文档
- PMC_项目监控课件.ppt
- Pleegzorg, een haalbaar alternatief课件.ppt
- PNEUMATECH_产品技术介绍(PHC再生式干燥机)课件.ppt
- PN_OFFSET 规划课件.ppt
- PodatkiIzdelava anketnega vpra alnika课件.ppt
- point of view课件.ppt
- politeness principle课件.ppt
- Politics in Newspapers lecture 2课件.ppt
- politics课件.ppt
- political system, education and economy of Nz课件.ppt
- 人教版高中英语必修第二册UNIT 3 Part 2 Listening and Talking—Video Time课件.ppt
- 人教版高中英语必修第二册UNIT 3 Part 1 Listening and Speaking—Discovering Useful Structures课件.ppt
- 人教版高中英语必修第二册UNIT 4 Part 1 Listening and Speaking—Discovering Useful Structures课件.ppt
- 人教版高中英语必修第二册UNIT 4 Part 2 Listening and Talking—Video Time课件.ppt
- 人教版高中英语必修第二册UNIT 5 Part 2 Listening and Talking—Video Time课件.ppt
- 人教版高中英语必修第二册晨读晚诵课件.ppt
- 数字电子电路卡诺图法化简.pptx
- 2026栈和队列 学习课件.pptx
- 人教版高中英语必修第二册UNIT 4 课时作业(三)含答案.docx
- 人教版高中英语必修第二册UNIT 3 课时作业(一)含答案.docx
原创力文档

文档评论(0)