SlideShare a Scribd company logo
Chapter 2 Instructions: Language of the Computer
Instruction Set ,[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.1 Introduction
The MIPS Instruction Set ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Arithmetic Operations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.2 Operations of the Computer Hardware
Arithmetic Example ,[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Register Operands ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.3 Operands of the Computer Hardware
Register Operand Example ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Memory Operands ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Memory Operand Example 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  offset base register
Memory Operand Example 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Registers vs. Memory ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Immediate Operands ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
The Constant Zero ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Unsigned Binary Integers ,[object Object],Chapter 2 — Instructions: Language of the Computer —  ,[object Object],[object Object],[object Object],[object Object],[object Object],§2.4 Signed and Unsigned Numbers
2s-Complement Signed Integers ,[object Object],Chapter 2 — Instructions: Language of the Computer —  ,[object Object],[object Object],[object Object],[object Object],[object Object]
2s-Complement Signed Integers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Signed Negation ,[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  ,[object Object],[object Object],[object Object]
Sign Extension ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Representing Instructions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.5 Representing Instructions in the Computer
MIPS R-format Instructions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  op rs rt rd shamt funct 6 bits 6 bits 5 bits 5 bits 5 bits 5 bits
R-format Example ,[object Object],Chapter 2 — Instructions: Language of the Computer —  special $s1 $s2 $t0 0 add 0 17 18 8 0 32 000000 10001 10010 01000 00000 100000 00000010001100100100000000100000 2  = 02324020 16 op rs rt rd shamt funct 6 bits 6 bits 5 bits 5 bits 5 bits 5 bits
Hexadecimal ,[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  ,[object Object],[object Object],0 0000 4 0100 8 1000 c 1100 1 0001 5 0101 9 1001 d 1101 2 0010 6 0110 a 1010 e 1110 3 0011 7 0111 b 1011 f 1111
MIPS I-format Instructions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  op rs rt constant or address 6 bits 5 bits 5 bits 16 bits
Stored Program Computers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  The BIG Picture
Logical Operations ,[object Object],Chapter 2 — Instructions: Language of the Computer —  ,[object Object],§2.6 Logical Operations Operation C Java MIPS Shift left << << sll Shift right >> >>> srl Bitwise AND & & and, andi Bitwise OR | | or, ori Bitwise NOT ~ ~ nor
Shift Operations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  op rs rt rd shamt funct 6 bits 6 bits 5 bits 5 bits 5 bits 5 bits
AND Operations ,[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  0000 0000 0000 0000 0000 1101 1100 0000 0000 0000 0000 0000 0011 1100 0000 0000 $t2 $t1 0000 0000 0000 0000 0000 1100 0000 0000 $t0
OR Operations ,[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  0000 0000 0000 0000 0000 1101 1100 0000 0000 0000 0000 0000 0011 1100 0000 0000 $t2 $t1 0000 0000 0000 0000 0011 1101 1100 0000 $t0
NOT Operations ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  0000 0000 0000 0000 0011 1100 0000 0000 $t1 1111 1111 1111 1111 1100 0011 1111 1111 $t0 Register 0: always read as zero
Conditional Operations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.7 Instructions for Making Decisions
Compiling If Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  Assembler calculates addresses
Compiling Loop Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Basic Blocks ,[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  ,[object Object],[object Object]
More Conditional Operations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Branch Instruction Design ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Signed vs. Unsigned ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Procedure - функц  Calling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.8 Supporting Procedures in Computer Hardware
Register Usage ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Procedure Call Instructions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Leaf Procedure Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Leaf Procedure Example ,[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  Save $s0 on stack Procedure body Restore $s0 Result Return
Non-Leaf Procedures ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Non-Leaf Procedure Example ,[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Non-Leaf Procedure Example ,[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Local Data on the Stack ,[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Memory Layout ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Character Data ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.9 Communicating with People
Byte/Halfword Operations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
String Copy Example ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
String Copy Example ,[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
32-bit Constants ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  0000 0000 0111 1101 0000 0000 0000 0000 lhi $s0, 61 0000 0000 0111 1101 0000 1001 0000 0000 ori $s0, $s0, 2304 §2.10 MIPS Addressing for 32-Bit Immediates and Addresses
Branch Addressing ,[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  ,[object Object],[object Object],[object Object],op rs rt constant or address 6 bits 5 bits 5 bits 16 bits
Jump Addressing ,[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  ,[object Object],[object Object],op address 6 bits 26 bits
Target Addressing Example ,[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  Loop: sll  $t1, $s3, 2 80000 0 0 19 9 4 0 add  $t1, $t1, $s6 80004 0 9 22 9 0 32 lw  $t0, 0($t1) 80008 35 9 8 0 bne  $t0, $s5, Exit 80012 5 8 21 2 addi $s3, $s3, 1 80016 8 19 19 1 j  Loop 80020 2 20000 Exit: … 80024
Branching Far Away ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Addressing Mode Summary Chapter 2 — Instructions: Language of the Computer —
Synchronization ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.11 Parallelism and Instructions: Synchronization
Synchronization in MIPS  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Translation and Startup Chapter 2 — Instructions: Language of the Computer —  Many compilers produce object modules directly Static linking §2.12 Translating and Starting a Program
Assembler Pseudoinstructions ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Producing an Object Module ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Linking Object Modules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Loading a Program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Dynamic Linking ,[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Lazy Linkage Chapter 2 — Instructions: Language of the Computer —  Indirection table Stub: Loads routine ID, Jump to linker/loader Linker/loader code Dynamically mapped code
Starting Java Applications Chapter 2 — Instructions: Language of the Computer —  Simple portable instruction set for the JVM Interprets bytecodes Compiles bytecodes of “hot” methods into native code for host machine
C Sort Example ,[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.13 A C Sort Example to Put It All Together
The Procedure Swap ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
The Sort Procedure in C ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
The Procedure Body ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  Pass params & call Move params Inner loop Outer loop Inner loop Outer loop
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],The Full Procedure Chapter 2 — Instructions: Language of the Computer —
Effect of Compiler Optimization Chapter 2 — Instructions: Language of the Computer —  Compiled with gcc for Pentium 4 under Linux
Effect of Language and Algorithm Chapter 2 — Instructions: Language of the Computer —
Lessons Learnt ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Arrays vs. Pointers ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.14 Arrays versus Pointers
Example: Clearing and Array Chapter 2 — Instructions: Language of the Computer —  clear1(int array[], int size) { int i; for (i = 0; i < size; i += 1) array[i] = 0; } clear2(int *array, int size) { int *p; for (p = &array[0]; p < &array[size]; p = p + 1) *p = 0; } move $t0,$zero  # i = 0 loop1: sll $t1,$t0,2  # $t1 = i * 4 add $t2,$a0,$t1  # $t2 = #  &array[i] sw $zero, 0($t2) # array[i] = 0 addi $t0,$t0,1  # i = i + 1 slt $t3,$t0,$a1  # $t3 = #  (i < size) bne $t3,$zero,loop1 # if (…)   # goto loop1 move $t0, $a0   # p = & array[0] sll $t1, $a1 ,2  # $t1 =  size  * 4 add $t2,$a0,$t1 # $t2 = #  &array[ size ] loop2:  sw $zero,0( $t0 ) #  Memory[p]  = 0 addi $t0,$t0, 4   #  p = p + 4 slt $t3,$t0, $t2  # $t3 = #( p<&array[size] ) bne $t3,$zero,loop2 # if (…) # goto loop2
Comparison of Array vs. Ptr ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
ARM & MIPS Similarities ,[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.16 Real Stuff: ARM Instructions ARM MIPS Date announced 1985 1985 Instruction size 32 bits 32 bits Address space 32-bit flat 32-bit flat Data alignment Aligned Aligned Data addressing modes 9 3 Registers 15  × 32-bit 31  × 32-bit Input/output Memory mapped Memory mapped
Compare and Branch in ARM ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Instruction Encoding Chapter 2 — Instructions: Language of the Computer —
The Intel x86 ISA ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.17 Real Stuff: x86 Instructions
The Intel x86 ISA ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
The Intel x86 ISA ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Basic x86 Registers Chapter 2 — Instructions: Language of the Computer —
Basic x86 Addressing Modes ,[object Object],Chapter 2 — Instructions: Language of the Computer —  ,[object Object],[object Object],[object Object],[object Object],[object Object],Source/dest operand Second source operand Register Register Register Immediate Register Memory Memory Register Memory Immediate
x86 Instruction Encoding ,[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Implementing IA-32 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Fallacies ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.18 Fallacies and Pitfalls
Fallacies ,[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  x86 instruction set
Pitfalls ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —
Concluding Remarks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  §2.19 Concluding Remarks
Concluding Remarks ,[object Object],[object Object],[object Object],Chapter 2 — Instructions: Language of the Computer —  Instruction class MIPS examples SPEC2006 Int SPEC2006 FP Arithmetic add, sub, addi 16% 48% Data transfer lw, sw, lb, lbu, lh, lhu, sb, lui 35% 36% Logical and, or, nor, andi, ori, sll, srl 12% 4% Cond. Branch beq, bne, slt, slti, sltiu 34% 8% Jump j, jr, jal 2% 0%

More Related Content

What's hot

Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computersBảo Hoang
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)Mahesh Kumar Attri
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
Dilum Bandara
 
EE5440 – Computer Architecture - Lecture 2
EE5440 – Computer Architecture - Lecture 2EE5440 – Computer Architecture - Lecture 2
EE5440 – Computer Architecture - Lecture 2
Dilawar Khan
 
Mips architecture
Mips architectureMips architecture
Mips architecture
Rashid Ahmad
 
Lecture6 memory hierarchy
Lecture6 memory hierarchyLecture6 memory hierarchy
Lecture6 memory hierarchyli12x
 
Register Transfer Language,Bus and Memory Transfer
Register Transfer Language,Bus and Memory TransferRegister Transfer Language,Bus and Memory Transfer
Register Transfer Language,Bus and Memory Transfer
lavanya marichamy
 
Lec 12-15 mips instruction set processor
Lec 12-15 mips instruction set processorLec 12-15 mips instruction set processor
Lec 12-15 mips instruction set processor
Mayank Roy
 
Cs6303 unit2
Cs6303 unit2 Cs6303 unit2
Instruction Set Architecture: MIPS
Instruction Set Architecture: MIPSInstruction Set Architecture: MIPS
Instruction Set Architecture: MIPS
Prasenjit Dey
 
Pipelining
PipeliningPipelining
Pipelining
Shubham Bammi
 
Introduction to computer architecture and organization
Introduction to computer architecture and organizationIntroduction to computer architecture and organization
Introduction to computer architecture and organizationMuhammad Ishaq
 
Assembly language programming
Assembly language programmingAssembly language programming
Assembly language programminghimhk
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
Nikhil Pandit
 
Computer Organization and Design
Computer Organization and DesignComputer Organization and Design
Computer Organization and Design
Ra'Fat Al-Msie'deen
 
Pipeline hazards | Structural Hazard, Data Hazard & Control Hazard
Pipeline hazards | Structural Hazard, Data Hazard & Control HazardPipeline hazards | Structural Hazard, Data Hazard & Control Hazard
Pipeline hazards | Structural Hazard, Data Hazard & Control Hazard
babuece
 
Processor Organization
Processor OrganizationProcessor Organization
Processor Organization
Dominik Salvet
 
RISC and CISC Processors
RISC and CISC ProcessorsRISC and CISC Processors
RISC and CISC Processors
Adeel Rasheed
 
Chapt 01 Assembly Language
Chapt 01 Assembly LanguageChapt 01 Assembly Language
Chapt 01 Assembly Language
Hamza Akram
 

What's hot (20)

Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computers
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
 
EE5440 – Computer Architecture - Lecture 2
EE5440 – Computer Architecture - Lecture 2EE5440 – Computer Architecture - Lecture 2
EE5440 – Computer Architecture - Lecture 2
 
Mips architecture
Mips architectureMips architecture
Mips architecture
 
Lecture6 memory hierarchy
Lecture6 memory hierarchyLecture6 memory hierarchy
Lecture6 memory hierarchy
 
Register Transfer Language,Bus and Memory Transfer
Register Transfer Language,Bus and Memory TransferRegister Transfer Language,Bus and Memory Transfer
Register Transfer Language,Bus and Memory Transfer
 
Lec 12-15 mips instruction set processor
Lec 12-15 mips instruction set processorLec 12-15 mips instruction set processor
Lec 12-15 mips instruction set processor
 
Cs6303 unit2
Cs6303 unit2 Cs6303 unit2
Cs6303 unit2
 
Instruction Set Architecture: MIPS
Instruction Set Architecture: MIPSInstruction Set Architecture: MIPS
Instruction Set Architecture: MIPS
 
Pipelining
PipeliningPipelining
Pipelining
 
Introduction to computer architecture and organization
Introduction to computer architecture and organizationIntroduction to computer architecture and organization
Introduction to computer architecture and organization
 
Chapter 5 b
Chapter 5  bChapter 5  b
Chapter 5 b
 
Assembly language programming
Assembly language programmingAssembly language programming
Assembly language programming
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
 
Computer Organization and Design
Computer Organization and DesignComputer Organization and Design
Computer Organization and Design
 
Pipeline hazards | Structural Hazard, Data Hazard & Control Hazard
Pipeline hazards | Structural Hazard, Data Hazard & Control HazardPipeline hazards | Structural Hazard, Data Hazard & Control Hazard
Pipeline hazards | Structural Hazard, Data Hazard & Control Hazard
 
Processor Organization
Processor OrganizationProcessor Organization
Processor Organization
 
RISC and CISC Processors
RISC and CISC ProcessorsRISC and CISC Processors
RISC and CISC Processors
 
Chapt 01 Assembly Language
Chapt 01 Assembly LanguageChapt 01 Assembly Language
Chapt 01 Assembly Language
 

Similar to Chapter 2 instructions language of the computer

Chapter 2 Part2 A
Chapter 2 Part2 AChapter 2 Part2 A
Chapter 2 Part2 Aececourse
 
Cmps290 classnoteschap02
Cmps290 classnoteschap02Cmps290 classnoteschap02
Cmps290 classnoteschap02
HussnainSarmad
 
Chapter 2 Part1
Chapter 2 Part1Chapter 2 Part1
Chapter 2 Part1ececourse
 
C:\Fakepath\Chapter 2 Part2 B
C:\Fakepath\Chapter 2 Part2 BC:\Fakepath\Chapter 2 Part2 B
C:\Fakepath\Chapter 2 Part2 Bececourse
 
ISA.pptx
ISA.pptxISA.pptx
ISA.pptx
FarrukhMuneer2
 
CODch3Slides.ppt
CODch3Slides.pptCODch3Slides.ppt
CODch3Slides.ppt
Anonymous9etQKwW
 
Tema2_ArchitectureMIPS.pptx
Tema2_ArchitectureMIPS.pptxTema2_ArchitectureMIPS.pptx
Tema2_ArchitectureMIPS.pptx
gopikahari7
 
C programming part2
C programming part2C programming part2
C programming part2
Keroles karam khalil
 
C programming part2
C programming part2C programming part2
C programming part2
Keroles karam khalil
 
C programming part2
C programming part2C programming part2
C programming part2
Keroles karam khalil
 
Assembly.ppt
Assembly.pptAssembly.ppt
Assembly.ppt
suzanawinat3
 
Chapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuChapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structu
EstelaJeffery653
 
Chapter 2 Part2 C
Chapter 2 Part2 CChapter 2 Part2 C
Chapter 2 Part2 Cececourse
 
MIPS_Programming.pdf
MIPS_Programming.pdfMIPS_Programming.pdf
MIPS_Programming.pdf
XxUnnathxX
 
Intro to assembly language
Intro to assembly languageIntro to assembly language
Intro to assembly language
United International University
 
Lecture 2 coal sping12
Lecture 2 coal sping12Lecture 2 coal sping12
Lecture 2 coal sping12Rabia Khalid
 

Similar to Chapter 2 instructions language of the computer (20)

Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Chapter 2 Part2 A
Chapter 2 Part2 AChapter 2 Part2 A
Chapter 2 Part2 A
 
Cmps290 classnoteschap02
Cmps290 classnoteschap02Cmps290 classnoteschap02
Cmps290 classnoteschap02
 
Chapter 2 Part1
Chapter 2 Part1Chapter 2 Part1
Chapter 2 Part1
 
C:\Fakepath\Chapter 2 Part2 B
C:\Fakepath\Chapter 2 Part2 BC:\Fakepath\Chapter 2 Part2 B
C:\Fakepath\Chapter 2 Part2 B
 
ISA.pptx
ISA.pptxISA.pptx
ISA.pptx
 
CODch3Slides.ppt
CODch3Slides.pptCODch3Slides.ppt
CODch3Slides.ppt
 
Highlevel assemly
Highlevel assemlyHighlevel assemly
Highlevel assemly
 
Tema2_ArchitectureMIPS.pptx
Tema2_ArchitectureMIPS.pptxTema2_ArchitectureMIPS.pptx
Tema2_ArchitectureMIPS.pptx
 
Mips
MipsMips
Mips
 
C programming part2
C programming part2C programming part2
C programming part2
 
C programming part2
C programming part2C programming part2
C programming part2
 
C programming part2
C programming part2C programming part2
C programming part2
 
Assembly.ppt
Assembly.pptAssembly.ppt
Assembly.ppt
 
Chapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuChapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structu
 
Chapter 2 Part2 C
Chapter 2 Part2 CChapter 2 Part2 C
Chapter 2 Part2 C
 
MIPS_Programming.pdf
MIPS_Programming.pdfMIPS_Programming.pdf
MIPS_Programming.pdf
 
Intro to assembly language
Intro to assembly languageIntro to assembly language
Intro to assembly language
 
Class2
Class2Class2
Class2
 
Lecture 2 coal sping12
Lecture 2 coal sping12Lecture 2 coal sping12
Lecture 2 coal sping12
 

Recently uploaded

Ethical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptx
Ethical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptxEthical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptx
Ethical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptx
TANMAYJAIN511570
 
UNIVERSAL HUMAN VALUES- Harmony in the Nature
UNIVERSAL HUMAN VALUES- Harmony in the NatureUNIVERSAL HUMAN VALUES- Harmony in the Nature
UNIVERSAL HUMAN VALUES- Harmony in the Nature
Chandrakant Divate
 
What Is The Psychology Behind Reborn Dolls_.pptx
What Is The Psychology Behind Reborn Dolls_.pptxWhat Is The Psychology Behind Reborn Dolls_.pptx
What Is The Psychology Behind Reborn Dolls_.pptx
Lloyd Dobson Artist
 
Program Your Destiny eBook - Destiny University.pdf
Program Your Destiny eBook - Destiny University.pdfProgram Your Destiny eBook - Destiny University.pdf
Program Your Destiny eBook - Destiny University.pdf
Michael Herlache, MBA
 
SOCIOLOGY PPT. SOCIAL SECURITY POWER POINT
SOCIOLOGY PPT. SOCIAL SECURITY POWER POINTSOCIOLOGY PPT. SOCIAL SECURITY POWER POINT
SOCIOLOGY PPT. SOCIAL SECURITY POWER POINT
ssuser8d5e2d1
 
Collocation thường gặp trong đề thi THPT Quốc gia.pdf
Collocation thường gặp trong đề thi THPT Quốc gia.pdfCollocation thường gặp trong đề thi THPT Quốc gia.pdf
Collocation thường gặp trong đề thi THPT Quốc gia.pdf
ngochaavk33a
 

Recently uploaded (6)

Ethical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptx
Ethical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptxEthical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptx
Ethical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptx
 
UNIVERSAL HUMAN VALUES- Harmony in the Nature
UNIVERSAL HUMAN VALUES- Harmony in the NatureUNIVERSAL HUMAN VALUES- Harmony in the Nature
UNIVERSAL HUMAN VALUES- Harmony in the Nature
 
What Is The Psychology Behind Reborn Dolls_.pptx
What Is The Psychology Behind Reborn Dolls_.pptxWhat Is The Psychology Behind Reborn Dolls_.pptx
What Is The Psychology Behind Reborn Dolls_.pptx
 
Program Your Destiny eBook - Destiny University.pdf
Program Your Destiny eBook - Destiny University.pdfProgram Your Destiny eBook - Destiny University.pdf
Program Your Destiny eBook - Destiny University.pdf
 
SOCIOLOGY PPT. SOCIAL SECURITY POWER POINT
SOCIOLOGY PPT. SOCIAL SECURITY POWER POINTSOCIOLOGY PPT. SOCIAL SECURITY POWER POINT
SOCIOLOGY PPT. SOCIAL SECURITY POWER POINT
 
Collocation thường gặp trong đề thi THPT Quốc gia.pdf
Collocation thường gặp trong đề thi THPT Quốc gia.pdfCollocation thường gặp trong đề thi THPT Quốc gia.pdf
Collocation thường gặp trong đề thi THPT Quốc gia.pdf
 

Chapter 2 instructions language of the computer

  • 1. Chapter 2 Instructions: Language of the Computer
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56. Addressing Mode Summary Chapter 2 — Instructions: Language of the Computer —
  • 57.
  • 58.
  • 59. Translation and Startup Chapter 2 — Instructions: Language of the Computer — Many compilers produce object modules directly Static linking §2.12 Translating and Starting a Program
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65. Lazy Linkage Chapter 2 — Instructions: Language of the Computer — Indirection table Stub: Loads routine ID, Jump to linker/loader Linker/loader code Dynamically mapped code
  • 66. Starting Java Applications Chapter 2 — Instructions: Language of the Computer — Simple portable instruction set for the JVM Interprets bytecodes Compiles bytecodes of “hot” methods into native code for host machine
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72. Effect of Compiler Optimization Chapter 2 — Instructions: Language of the Computer — Compiled with gcc for Pentium 4 under Linux
  • 73. Effect of Language and Algorithm Chapter 2 — Instructions: Language of the Computer —
  • 74.
  • 75.
  • 76. Example: Clearing and Array Chapter 2 — Instructions: Language of the Computer — clear1(int array[], int size) { int i; for (i = 0; i < size; i += 1) array[i] = 0; } clear2(int *array, int size) { int *p; for (p = &array[0]; p < &array[size]; p = p + 1) *p = 0; } move $t0,$zero # i = 0 loop1: sll $t1,$t0,2 # $t1 = i * 4 add $t2,$a0,$t1 # $t2 = # &array[i] sw $zero, 0($t2) # array[i] = 0 addi $t0,$t0,1 # i = i + 1 slt $t3,$t0,$a1 # $t3 = # (i < size) bne $t3,$zero,loop1 # if (…) # goto loop1 move $t0, $a0 # p = & array[0] sll $t1, $a1 ,2 # $t1 = size * 4 add $t2,$a0,$t1 # $t2 = # &array[ size ] loop2: sw $zero,0( $t0 ) # Memory[p] = 0 addi $t0,$t0, 4 # p = p + 4 slt $t3,$t0, $t2 # $t3 = #( p<&array[size] ) bne $t3,$zero,loop2 # if (…) # goto loop2
  • 77.
  • 78.
  • 79.
  • 80. Instruction Encoding Chapter 2 — Instructions: Language of the Computer —
  • 81.
  • 82.
  • 83.
  • 84. Basic x86 Registers Chapter 2 — Instructions: Language of the Computer —
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.

Editor's Notes

  1. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  2. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  3. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  4. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  5. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  6. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  7. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  8. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  9. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  10. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  11. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  12. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  13. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  14. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  15. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  16. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  17. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  18. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  19. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  20. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  21. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  22. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  23. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  24. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  25. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  26. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  27. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  28. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  29. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  30. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  31. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  32. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  33. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  34. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  35. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  36. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  37. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  38. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  39. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  40. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  41. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  42. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  43. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  44. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  45. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  46. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  47. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  48. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  49. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  50. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  51. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  52. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  53. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  54. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  55. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  56. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  57. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  58. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  59. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  60. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  61. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  62. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  63. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  64. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  65. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  66. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  67. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  68. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  69. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  70. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  71. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  72. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  73. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  74. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  75. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  76. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  77. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  78. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  79. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  80. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  81. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  82. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  83. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  84. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  85. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  86. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  87. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  88. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  89. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  90. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  91. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer
  92. The University of Adelaide, School of Computer Science December 14, 2011 Chapter 2 — Instructions: Language of the Computer