Download Chapter 3 Instruction Set Architectures

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Chapter 3
Instruction Set Architectures
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Chapter Outline
•
•
•
•
•
Programming Languages
Assembly Languages
Instruction Set Architecture Design
A Relatively Simple ISA
ISA of the 8085 microprocessor
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Programming Languages
• High level languages
• Assembly languages
• Machine languages
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Compilation Process
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Assembly Process
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Java Applets
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Assembly Language Attributes
•
•
•
•
Instruction types
Data types
Addressing modes
Instruction formats
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction Types
• Data transfer
• Data operation
• Program control
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Data Types
• Numeric (integer, floating point)
• Boolean (true, false)
• Character (ASCII, Unicode)
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Addressing modes - Direct
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Addressing modes - Indirect
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Addressing modes - Register
Direct
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Addressing modes - Register
Indirect
@R
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Addressing modes Immediate
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Addressing modes - Implicit
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Addressing modes - Relative
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Addressing modes - Indexed
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction Formats
• More operands = less instructions
• More operands = larger words
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
3-operand Instructions
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
2-operand Instructions
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
1-operand Instructions
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
0-operand Instructions
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Instruction Set Architecture
• Instruction set
• Register set
• Memory access information
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
ISA Attributes
• Completeness
• Orthogonality
• Register set design
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
ISA Requirements
•
•
•
•
Backward compatibility?
Data types/sizes
Interrupts?
Conditional instructions?
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
A Relatively Simple ISA Registers
• Accumulator AC
• General purpose register R
• Flag Z
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
A Relatively Simple ISA Instruction Set
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
A Relatively Simple ISA Instruction Set (continued)
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
A Relatively Simple ISA Instruction Formats
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Example Relatively Simple
Program
1  2  ...  n, or
n
i
i 1
This could be written as a high-level language
code snippet as follows.
total=0;
FOR i=1 to n DO {total = total + i};
1. total = 0, i = 0
2. i = i + 1
3. total = total + i
4. IF i  n THEN GOTO 2
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Example Relatively Simple
Program Code
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Example Relatively Simple
Program Trace
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
A Relatively Simple ISA Analysis
• Completeness
• Orthogonality
• Register set design
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
The 8085 ISA - Registers
• Accumulator A
• General purpose registers B, C, D, E, H,
L
• Stack pointer SP
• Flags S, Z, P, CY, AC
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
The 8085 ISA - Instruction Set
• Data movement instructions
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
The 8085 ISA - Instruction Set
• Data operation instructions
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
The 8085 ISA - Instruction Set
• Program control instructions
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
The 8085 ISA - Instruction
Formats
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Example 8085 Program
n
1  2  ...  n, or  i
i 1
1. i = n, sum = 0
2. sum = sum + i, i = i - 1
3. IF i  0 THEN GOTO 2
4. total = sum
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Example 8085 Program Code
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Example 8085 Program Trace
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
The 8085 ISA - Analysis
• Completeness
• Orthogonality
• Register set design
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Summary
• Programming Languages
• ISA Design
Images courtesy of Addison Wesley Longman, Inc. Copyright © 2001
Related documents