- 1、本文档共30页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Compilers Autumn 2002 Compilers Autumn 2002 * Machine-Level Representation of Programs III * Outline Jump instructions Translate Control constructs in C to assembly goto branch loop Suggested reading Chap 3.6 * Control Two of the most important parts of program execution Data flow (Accessing and operating data) Control flow (control the sequence of operations) * Control Sequential execution is default the instructions are executed in the order they appear in the program Chang the control flow Jump instructions * Jump Instructions 1 xorl %eax, %eax Set %eax to 0 2 jmp .L1 Goto .L1 3 movl (%eax), %edx Null pointer dereference 4 .L1: 5 popl %edx * Unconditional jump Jumps unconditionally Direct jump: jmp label jmp .L Indirect jump: jmp *Operand jmp *%eax jmp *(%eax) * Conditional jump Either jump or continue executing at the next instruction in the code sequence Depending on some combination of the condition codes All direct jump * Jump Instructions jle .L2 .L5: movl %edx, %eax sarl $1, %eax subl %eax, %edx Leal (%edx, %edx, 2), %edx testl %edx, %edx jg .L5 9 .L2: 10 movl %edx, %eax * 8: 7e 0d jle 17silly+0x17 a: 89 d0 mov %edx, %eax dest1: 3 c: c1 f8 sar %eax e: 29 c2 sub %eax, %edx 10: 8d 14 52 lea (%edx, %edx, 2), %edx 6 13: 85 d2 test %edx, %edx 15: 7f f3 jg asilly+0x10 17: 89 d0 movl %edx, %eax dest2: d+a = 17 17+f3(-d) =a Example for Jump * 804839c: 7e 0d jle 17silly+0x17 804839e: 89 d0 mov %edx, %eax dest1: 3 80483a0: c1 f8 sar %eax 80483a2: 29 c2 sub %eax, %edx 80483a4: 8d 14 52 lea (%edx, %edx, 2), %edx 6 80483a7: 85 d2 test %edx, %edx 80483a9: 7f f3 jg asilly+0x10 80483ab: 89 d0 movl %edx, %eax dest2: d+804849e = 80483ab 80483ab+f3(-d) = 804839e Example for Jump * Jump Instructions PC-relative Jump target is an offset relative to the address of the i
您可能关注的文档
- 福建师范大学文学院中国古代文学课件 明代诗词概述.ppt
- 福建师范大学文学院中国古代文学课件 明代文学概况.ppt
- 福建师范大学文学院中国古代文学课件 明代中后期诗文.ppt
- 福建师范大学文学院中国古代文学课件 明前期诗文.ppt
- 福建师范大学文学院中国古代文学课件 南洪北孔.ppt
- 福建师范大学文学院中国古代文学课件 秦汉文章.ppt
- 福建师范大学文学院中国古代文学课件 清代诗词文.ppt
- 福建师范大学文学院中国古代文学课件 清代文学概述.ppt
- 福建师范大学文学院中国古代文学课件 清代戏曲.ppt
- 福建师范大学文学院中国古代文学课件 神话.ppt
- 自动压力流量调节器项目可行性研究报告申请报告.docx
- 某仪表厂维修施工作业风险评价报告书( 11)_图文.docx
- 年产10万吨超宽幅铝合金中厚板项目节能评估报告(节能专).docx
- 请示报告(11)_原创文档.docx
- 高中政治学视角下的体育活动对健康的影响分析教学研究课题报告.docx
- 县委党校整体异地新建工程项目可行性研究报告(编制大纲).docx
- XXXX开闭所改造项目_调试报告_交直流一体化电源.docx
- 人教版(2012)音乐二年级上册理发师(课件).pptx
- 2025年建筑玻璃生产建设项目节能评估报告(节能专).docx
- 高中政治与历史政治历史中几何体积与表面积的联系教学研究课题报告.docx
文档评论(0)