复旦大学:《计算机原理 Computer System》课程PPT课件_Machine-Level Representation of Programs Ⅱ

Machine-Level Representation of Programs‖l
1 Machine-Level Representation of Programs Ⅱ

Outline Data movement Data manipulation Control structure Suggested read ing -chφp3.4.3.5,3.6
2 Outline • Data movement • Data manipulation • Control structure • Suggested reading – Chap 3.4, 3.5, 3.6

Indexed Addressing Mode Figure 3.3 P137 Most general form Imm (Eb, Ei, s) M[Imm+ R[Eb]+ riE]s Constant displacement"Imm: 1, 2, or 4 bytes Base register Eb: Any of 8 integer registers Index register E;: Any, except for %esp S: Scale: 1.2 4 or 8
3 Indexed Addressing Mode Figure 3.3 P137 • Most general form – Imm(Eb , Ei , s) – M[Imm+ R[Eb ]+ R[Ei ]*s] – Constant “displacement” Imm: 1, 2, or 4 bytes – Base register Eb : Any of 8 integer registers – Index register Ei : Any, except for %esp – S: Scale: 1, 2, 4, or 8

Data Movement Figure 3.4 P139 Instruction Effect Description movI S D DES Move double word moVw SD DES Move word mob S D DES ove byTe movsbl S,DD<SignedExtend( S) Move sign-extended byte movzbl S,DD< ZeroExtend()Move zero-extended byte push R[%esp]+R[%esp]-4 Push M[R[%esp]]<s popl D< MR[Yoesp] Po R[%esp]←R[%esp]+4
4 Data Movement Figure 3.4 P139 Instruction Effect Description movl S, D D S Move double word movw S, D D S Move word movb S, D D S Move byte movsbl S, D D SignedExtend( S) Move sign-extended byte movzbl S, D D ZeroExtend(S) Move zero-extended byte pushl S R[%esp] R[%esp]-4 M[R[%esp]] S Push popl D D M[R[%esp]] R[%esp] R[%esp]+4 Pop

Move Instructions Format movl src, dest src and dest can only be one of the following Immediate (except dest) Register Memory
5 Move Instructions • Format – movl src, dest – src and dest can only be one of the following • Immediate (except dest) • Register • Memory

Move Instructions Format The only possible combinations of the (src, dest) are (immediate, register (memory, register) oad (register, register (immediate, memory store (register, memory) store
6 Move Instructions • Format – The only possible combinations of the (src, dest) are • (immediate, register) • (memory, register) load • (register, register) • (immediate, memory) store • (register, memory) store

Data Movement Example P139 mov5O×4050,%ea immediate register movl %ebp, esp register register movl (%edx, %ecx), %eax memory register mo$-17,(%esp) mmediate memory movl %eax, -12(%ebp) register memory
7 Data Movement Example P139 movl $0x4050, %eax immediate register movl %ebp, %esp register register movl (%edx, %ecx), %eax memory register movl $-17, (%esp) immediate memory movl %eax, -12(%ebp) register memory

Data Movement Example P139 Initial value dh=8d ‰eax=98765432 mob %dh,%a ‰eax=9876548d 2 most%dh,%eax%ea×=千千ff8d (Move sign-extended byte) 3 movzbl %dh %eax %eax=0000008d ( Move zero-extended byte)
8 Data Movement Example P139 Initial value %dh=8d %eax =98765432 1 movb %dh, %al %eax=9876548d 2 movsbl %dh, %eax %eax=ffffff8d (Move sign-extended byte) 3 movzbl %dh, %eax %eax=0000008d ( Move zero-extended byte)

Stack operations Figure 3.5 P140 %eax 0x123 %edx O esp0x×108 Increasing address 号esp—0x108 Stack“top
9 Stack operations Figure 3.5 P140 %eax 0x123 %edx 0 %esp 0x108 Increasing address 0x108 Stack “top” %esp

Stack operations %eax 0x123 %edx O esp0x×104 push‰%eax 0x108 esp 0x104 ox123 Stack“top
10 Stack operations %eax 0x123 %edx 0 %esp 0x104 0x104 Stack “top” 0x123 0x108 %esp pushl %eax
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Machine-Level Representation of Programs I.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Integer Operations; Floating Points.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Integer Representations.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Introduction to Computer Systems; Information is Bits+Context; Information Storage.ppt
- 复旦大学:《计算机原理 Computer System》课程资源_2006年期中考试题目.doc
- 复旦大学:《计算机原理 Computer System》课程资源_2006年期中考试答案.doc
- 复旦大学:《计算机原理 Computer System》课程资源_教学大纲.pdf
- 复旦大学:《计算机图形学》课后习题答案_7.docx
- 复旦大学:《计算机图形学》课后习题答案_6.docx
- 复旦大学:《计算机图形学》课后习题答案_5.docx
- 复旦大学:《计算机图形学》课后习题答案_4.docx
- 复旦大学:《计算机图形学》课后习题答案_3.docx
- 复旦大学:《计算机图形学》课后习题答案_2.docx
- 复旦大学:《计算机图形学》课后习题答案_1.docx
- 复旦大学:《电子商务》课程PPT课件_第十次课 社会化电子商务——Hold住社会化媒体营销.ppt
- 复旦大学:《电子商务》课程PPT课件_第六次课 电子商务运营与管理 Operating Your E-Business.ppt
- 复旦大学:《电子商务》课程PPT课件_第六次课 电子商务运营与管理 Getting Your E-Business Off The Ground.ppt
- 复旦大学:《电子商务》课程PPT课件_第八次课 电子商务模式与应用课程主题案例分析与展示——电子商务团购.ppt
- 复旦大学:《电子商务》课程PPT课件_第五次课 商业模式的概念与内涵(发现商业模式).ppt
- 复旦大学:《电子商务》课程PPT课件_第九次课 B2B电子商务(B2B行业平台).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Procedure Call and Array.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Heterogeneous Data Structures & Alignment; Putting it Together; Floating Point.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Processor Architecture.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_09、10 Sequential CPU Implementation.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Pipelined Implementation Part I.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Pipelined Implementation Part II.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_12b Code Optimization(• Machine-Independent Optimization – Code motion – Memory optimization • Suggested reading).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_13 Code Optimization(• Optimizing Blockers • Understanding Modern Processor • More Code Optimization techniques • Performance Tuning).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Hardware Organization.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Memory Hierarchy(• Random-Access Memory(RAM)• Nonvolatile Memory • Disk Storage • Locality • Memory hierarchy).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Cache Memory(• General concepts • 3 ways to organize cache memory • Issues with writes • Write cache friendly codes • Cache mountain).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Cache Memory(• Cache mountain • Matrix multiplication).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Virtual Memory(• Virtual Space• Address translation • Accelerating translation• Different points of view).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Virtual Memory(• Multilevel page tables • Different points of view • Pentium/Linux Memory System • Memory Mapping).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Dynamic Memory Allocation(• Implementation of a simple allocator • Explicit Free List • Segregated Free List).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Linking II(• Static linking • Symbols & Symbol Table • Relocation • Executable Object Files • Loading).ppt
- 复旦大学:《计算机原理 Computer System》习题PPT课件_chapter2.pptx
- 复旦大学:《计算机原理 Computer System》习题PPT课件_Chapter 3 Machine-Level Representation of Programs.pptx
- 复旦大学:《计算机原理 Computer System》习题PPT课件_Chapter 3 Machine-Level Representation of Programs.pptx
- 复旦大学:《计算机原理 Computer System》习题PPT课件_Chapter 3 Machine-Level(2)Representation of Programs.ppt