- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Assembly Language for Intel-Based Computers, 5th Edition Chapter 8: Advanced Procedures Chapter Overview Stack Frames Recursion .MODEL Directive INVOKE, ADDR, PROC, and PROTO Creating Multimodule Programs Stack Frames Stack Parameters Local Variables ENTER and LEAVE Instructions LOCAL Directive WriteStackFrame Procedure Stack Parameters More convenient than register parameters Two possible ways of calling DumpMem. Which is easier? Stack Frame Also known as an activation record Area of the stack set aside for a procedures return address, passed parameters, saved registers, and local variables Created by the following steps: Calling program pushes arguments on the stack and calls the procedure. The called procedure pushes EBP on the stack, and sets EBP to ESP. If local variables are needed, a constant is subtracted from ESP to make room on the stack. Explicit Access to Stack Parameters A procedure can explicitly access stack parameters using constant offsets from EBP1. Example: [ebp + 8] EBP is often called the base pointer or frame pointer because it holds the base address of the stack frame. EBP does not change value during the procedure. EBP must be restored to its original value when a procedure returns. RET Instruction Return from subroutine Pops stack into the instruction pointer (EIP or IP). Control transfers to the target address. Syntax: RET RET n Optional operand n causes n bytes to be added to the stack pointer after EIP (or IP) is assigned a value. Stack Frame Example (1 of 2) AddTwo Procedure (1 of 2) AddTwo Procedure (2 of 2) Passing Arguments by Reference (1 of 2) The ArrayFill procedure fills an array with 16-bit random integers The calling program passes the address of the array, along with a count of the number of array elements: Passing Arguments by Reference (2 of 2) Local Variables To explicitly create local variables, subtract their total size from ESP. The following example creates and initializes two 32-bit local variables (well call them
您可能关注的文档
- 数电实验报告范文-实验五 加法器37.doc
- 穗澳两地初中生早餐行为调查.pdf
- 数电实验报告范文-实验五 加法器38.doc
- 谭浩强《C程序设计》chapter1.ppt
- 谭浩强《C程序设计》chapter2.ppt
- 谭浩强《C程序设计》chapter6.ppt
- 谭浩强《C程序设计》chapter9.ppt
- 谭浩强《C程序设计》chapter8.ppt
- 谭浩强《C程序设计》第1章 c语言概述.ppt
- 谭浩强《C程序设计》第7章 数组.ppt
- 西安理工大学《微机原理及应用A 》CH5 Interace.ppt
- 西安理工大学《微机原理及应用A 》Computational Thinking.pdf
- 西安理工大学《微机原理及应用A 》Computational Thinking for EveryoneWing08.ppt
- 西安理工大学《微机原理及应用A 》Computational-Thinking-KCEA.ppt
- 西安理工大学《微机原理及应用A 》DataDefine chapt_03.ppt
- 西安理工大学《微机原理及应用A 》ct_pat_phillips.ppt
- 西安理工大学《微机原理及应用A 》Mem.ppt
- 西安理工大学《微机原理及应用A 》ProcedureDos.ppt
- 西安理工大学《微机原理及应用A 》MC0.ppt
- 西安理工大学《微机原理及应用A 》xutcs_微机原理及应用课设指导书12版.pdf
最近下载
- 2025年抖音本地生活服务业务深度分析报告 .pdf VIP
- 广西壮族自治区资源县农业局公务员招录事业单位招聘考试录用96人大全(含答案).docx VIP
- 清水河储能电站施工方案.doc VIP
- 2025至2030年中国美甲产业竞争现状及发展前景预测报告.docx
- 《新媒体营销》教学大纲.docx VIP
- 幼儿园小学生姓名卡片姓名贴纸.docx VIP
- 郑州市第四十七中学新初一分班(摸底)语文模拟试题(5套带答案).doc VIP
- 《边城》ppt.ppt VIP
- 2024凉山州专业技术人员继续教育公需科目-提升常态化监管水平,大力发展数字经济,支持平台经济发展试题及满分答案.docx VIP
- 口腔根尖周炎病例分析.pptx VIP
文档评论(0)