Introduction to Computer Organization and Architecture Machine Language

  • Slides: 46
Download presentation
Introduction to Computer Organization and Architecture ����� Machine Language

Introduction to Computer Organization and Architecture ����� Machine Language

������ n �������� Introduction to Computer Organizations SUM Systems Co. , ���� 93 -

������ n �������� Introduction to Computer Organizations SUM Systems Co. , ���� 93 - 125, 145 - 168. Ltd. , 2543. n Hamacher, V. Carl and others Computer Organization 4 th ed. New York : Mc. Graw-Hill, 1996. P. 111 - 151, 302 -338. 4

������ n Hayes, John P. Computer Architecture and Organization 3 rd ed. Malaysia :

������ n Hayes, John P. Computer Architecture and Organization 3 rd ed. Malaysia : Mc. Graw-Hill, 1998. P. 178 - 222, 303 - 399. u Stallings, William Computer Organization and Architecture : designing for performance 7 th ed. New. Jersey : Prentice-Hall, 2006. P. 319 - 370, 371 -399. 5

Introduction to Computer Organization and Architecture ������� Address Structure ������

Introduction to Computer Organization and Architecture ������� Address Structure ������

���� • Low-leveled Languages (as Assembly, G etc(. • High-leveled Languages (as COBOL, C,

���� • Low-leveled Languages (as Assembly, G etc(. • High-leveled Languages (as COBOL, C, FORTRAN, PASCAL, PL/I, etc(. • Language Generators (COBOL Generator, Database Language Generator, etc(. • Natural-to-Language, Languages (Language Text-to-Speech, etc(. 7

������� Character Set a. Data Types a Data Structures a. Naming and Language Rules

������� Character Set a. Data Types a Data Structures a. Naming and Language Rules a. Operators and Internal Functions a. Structure of Statements a. Module of Programs a 8

Computer Languages Natural Language 4 GL 3 GL Assembly Machine 1950 1960 1970 1980

Computer Languages Natural Language 4 GL 3 GL Assembly Machine 1950 1960 1970 1980 19909

Computer Languages . 1 Machine Language 00011001001. 2 Assembly Language AR 6, 15. 3

Computer Languages . 1 Machine Language 00011001001. 2 Assembly Language AR 6, 15. 3 High-Level Language ) Procedural-Oriented language( ALGOL, FORTRAN, COBOL, PASCAL , C, PL/I. 4 Very-high Level Language ) Non-Procedural-Oriented Language( Object-oriented ==> C++, Java. 5 Natural Language 10

Languages Translation Source Program Interpretter Executable Command Diagnostic Message 11

Languages Translation Source Program Interpretter Executable Command Diagnostic Message 11

Languages Translation Diagnostic Message Source Program Compiler Listing File Object Module Library Routines Linkage

Languages Translation Diagnostic Message Source Program Compiler Listing File Object Module Library Routines Linkage Editor Load Module 12

High-leveled Languages Source Program Translator Program (Text Files( Data Structures (Machine Table, Symbol Table,

High-leveled Languages Source Program Translator Program (Text Files( Data Structures (Machine Table, Symbol Table, Literal Table, etc(. Object Program 13

High-leveled Languages Source Program Translator Program (Text Files( Data Structures (Reduction Rules, Intermediate Form,

High-leveled Languages Source Program Translator Program (Text Files( Data Structures (Reduction Rules, Intermediate Form, Code Production, Identifier Table, etc(. Object Program 14

Languages Generators Source Program (Symbolic Files( Data Structures (Symbol Mapping, Code Generation, etc(. Data

Languages Generators Source Program (Symbolic Files( Data Structures (Symbol Mapping, Code Generation, etc(. Data Structures (Reduction Rules, Intermediate Form, etc(. Generator Program Compiler Object Program 15

������ (Machine Instruction( ������� : Operation Code ���� ] ������� : Operand Reference �������

������ (Machine Instruction( ������� : Operation Code ���� ] ������� : Operand Reference ������� a bits b bits ���� ] Op-Code Operand Instruction format 16

Number of Addresses ������ Arithmetic or logic Operations are either unary (One Operand) or

Number of Addresses ������ Arithmetic or logic Operations are either unary (One Operand) or Binary (Two Operands). The result of an operation must be stored (Third’s Operand). Finally the next instruction must be fetched (Fourth’s Operand) 17

18

18

19

19

Machine Instruction Sample of Machine Instruction : Operation Code : Source Operand Reference :

Machine Instruction Sample of Machine Instruction : Operation Code : Source Operand Reference : Result Operand Reference : Next Instruction Reference Op-Code S_Operand R_Operand Next 20

Machine Instruction Operands Referencing : Main Memory or virtual memory Byte Ordering (Little, Big,

Machine Instruction Operands Referencing : Main Memory or virtual memory Byte Ordering (Little, Big, Bi-Endian( Address Value ] Bit Ordering 184 12 184 78 ] : CPU Register : I/O Device : Immediate Value 185 34 186 56 187 78 185 56 186 34 187 12 21

Instruction Set Fundamental Design Issues : Operation Repertoire : Data Types : Instruction Formats

Instruction Set Fundamental Design Issues : Operation Repertoire : Data Types : Instruction Formats : Registers : Addressing 22

Addressing Modes : Immediate Addressing : Direct Addressing : Indirect Addressing : Register Indirect

Addressing Modes : Immediate Addressing : Direct Addressing : Indirect Addressing : Register Indirect Addressing : Displacement Addressing Fig 11. 1 : Stack Addressing 23

Addressing Modes A : content of an address field in instruction R : Content

Addressing Modes A : content of an address field in instruction R : Content of an address field in instruction that refers to a register EA : actual (Effective) address of the location containing the referenced operand )X) : content of location X 24

25

25

Immediate Addressing OPERAND = A ����� Op-Code Operand ��� 0111 0110 1101 0000 0011

Immediate Addressing OPERAND = A ����� Op-Code Operand ��� 0111 0110 1101 0000 0011 ������� ������ 0011 0000 1101 0110 ����� 26

Direct Addressing Effective Address = A ����� Op-Code Operand ��� 0111 0110 1101 0000

Direct Addressing Effective Address = A ����� Op-Code Operand ��� 0111 0110 1101 0000 0011 �������� � ������� 0011 0000 1101 0110 �������� Operand ������� 27

Indirect Addressing Effective Address = (A( ����� Op-Code Operand ��� 0111 0110 1101 0000

Indirect Addressing Effective Address = (A( ����� Op-Code Operand ��� 0111 0110 1101 0000 0011 ������� � ������� 0011 0000 1101 0110 ������������������� Operand ���������������� 28

Register Addressing Effective Address = Register ����� Op-Code Operand ��� 0111 01100011 ���������� 0011

Register Addressing Effective Address = Register ����� Op-Code Operand ��� 0111 01100011 ���������� 0011 (310) ������ Operand ����� 29

30

30

Register Indirect Addressing Effective Address = (R( ����� Op-Code Operand ��� 0111 01100011 ���������

Register Indirect Addressing Effective Address = (R( ����� Op-Code Operand ��� 0111 01100011 ��������� 0011 (310) ���������� ������ Operand ����� 31

Displacement Addressing Effective Address = (R) + A ����� Op-Code Operand ��� 0111 01100011

Displacement Addressing Effective Address = (R) + A ����� Op-Code Operand ��� 0111 01100011 0001 1000 01 ������������������ 0011 (310) ������ 0101 1000 0001 �������������������� Operand ������� 32

Displacement Indirect Addressing Effective Address = (A + (R(( ������� : Relative Addressing �����

Displacement Indirect Addressing Effective Address = (A + (R(( ������� : Relative Addressing ����� : Base-register : Indexing Addressing 33

Stack Addressing Effective Address = T ����� Op-Code 0111 0110 ��� Operand �������� Top

Stack Addressing Effective Address = T ����� Op-Code 0111 0110 ��� Operand �������� Top of Stack ������������������ 34

Basic Addressing Mode 35

Basic Addressing Mode 35

IBM Addressing Modes : Immediate Addressing : Register Addressing : Displacement Addressing 36

IBM Addressing Modes : Immediate Addressing : Register Addressing : Displacement Addressing 36

IBM Addressing Modes 37

IBM Addressing Modes 37

Power. PC Addressing Modes ����� 38

Power. PC Addressing Modes ����� 38

Power. PC Addressing Modes 39

Power. PC Addressing Modes 39

Power. PC Addressing Modes : Immediate Addressing : Register Addressing : Indirect Indexed Addressing

Power. PC Addressing Modes : Immediate Addressing : Register Addressing : Indirect Indexed Addressing : Absolute Addressing : Relative Addressing 40

Power. PC Addressing Modes 41

Power. PC Addressing Modes 41

Pentium Addressing Modes : Immediate : Register : Displacement : Base with Displacement :

Pentium Addressing Modes : Immediate : Register : Displacement : Base with Displacement : Scaled Index with Displacement : Base with Index and Displacement : Base with Scaled Index and Displacement : Relative 42

Pentium Addressing Modes ����� 43

Pentium Addressing Modes ����� 43

Pentium Addressing Modes 44

Pentium Addressing Modes 44

45

45

Introduction to Computer Organization and Architecture ������ Instruction Formats ��

Introduction to Computer Organization and Architecture ������ Instruction Formats ��