Introduction to Computer Organization and Architecture Instruction Formats

  • Slides: 35
Download presentation
Introduction to Computer Organization and Architecture ������� Instruction Formats ����������

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

����� Type of Operations • Data Transfer • Arithmetic • Logical • I/O •

����� Type of Operations • Data Transfer • Arithmetic • Logical • I/O • System Control • Transfer of Control 2

����� : Data Instruction Types Storage (Memory Instructions( : Data Processing (Arithmetic & Logic

����� : Data Instruction Types Storage (Memory Instructions( : Data Processing (Arithmetic & Logic Instructions( : Data Movement (I/O Instructions( : Control (Test & Branch Instructions( 3

Data Transfer If one or both operands are in memory, CPU must perform some

Data Transfer If one or both operands are in memory, CPU must perform some or all of the following actions : . 1 Calculate memory address (Address Mode(. 2 If refer to virtual memory, translate from virtual to actual memory address. 3 Determine whether addressed item is in cache. 4 If not, issue a command to memory module 4

Data Transfer Common Instruction Set Operations : : : : : Move (transfer) Transfer

Data Transfer Common Instruction Set Operations : : : : : Move (transfer) Transfer word or block from source to destination Store Transfer word from processor to memory Load (fetch) Transfer word from memory to processor Exchange Swap contents of source and destination Clear (reset) Transfer word of 0 s to destination Set Transfer word of 1 s to destination Push Transfer word from source to top of stack Pop Transfer word from top of stack to destination 5

6

6

Arithmetic and Logical : May involve data transfer, before and/or after : Perform function

Arithmetic and Logical : May involve data transfer, before and/or after : Perform function in ALU : Set condition codes and flags 7

Arithmetic Common Instruction Set Operations : Add Computer sum of two operands : Subtract

Arithmetic Common Instruction Set Operations : Add Computer sum of two operands : Subtract Compute difference of two operands : Multiply Compute product of two operands : Divide Compute quotient of two operands : Absolute Replace operand by its absolute value : Negate Change sign of operand : Increment Add 1 to operand : Decrement Subtract 1 from operand 8

AND : OR : NOT : ) Complement) Logical Perform the specified logical operation

AND : OR : NOT : ) Complement) Logical Perform the specified logical operation bitwise Exclusive-OR Test specified condition; set flag(s) based on outcome : Compare Make logical or arithmetic comparison of two or more operands; set flag(s) based on outcome : Set Control Variables Class of instructions to set controls for protection purposes, interrupt handling, timer control, etc. : Shift Left (right) shift operand, introducing constants at end : Rotate Left (right) shift operand, with wraparound end : : 9

Conversion : Similar to arithmetic and logical. May involve special logic to : perform

Conversion : Similar to arithmetic and logical. May involve special logic to : perform conversion between data types and formats 10

Conversion : Packed Decimal <==> Unpacked : Short ==> Long Form of Binary :

Conversion : Packed Decimal <==> Unpacked : Short ==> Long Form of Binary : Decimal <==> Binary : EBCDIC ==> ASCII 11

Conversion : Translate values in a section of memory based on a table of

Conversion : Translate values in a section of memory based on a table of correspondences : Convert the contents of a word from one form to another (e. g. , packed decimal to binary( 12

I/O : Issue command to I/O module If memory-mapped I/O, determine memorymapped address 13

I/O : Issue command to I/O module If memory-mapped I/O, determine memorymapped address 13

I/O : Input (read) Transfer data from specified I/O port or device to destination

I/O : Input (read) Transfer data from specified I/O port or device to destination (e. g. , main memory or processor register( : Output (write) Transfer data from specified source to I/O port or device : Start I/O Transfer instructions to I/O 14

System Control Execute in the privileged state or privileged area of memory and reserve

System Control Execute in the privileged state or privileged area of memory and reserve for use of O. S. : Read or Alter a Control Registers : Read or Modify a storage protection key : Access to process control blocks in a multiprogramming system 15

Transfer of Control : Update program counter. For subroutine call/return, manage parameter passing and

Transfer of Control : Update program counter. For subroutine call/return, manage parameter passing and linkage 16

Transfer of Control : Jump (branch) Unconditional transfer; load PC with specified address :

Transfer of Control : Jump (branch) Unconditional transfer; load PC with specified address : Jump Conditional Test specified condition; either load PC with specified address or do nothing, based on condition : Jump to Subroutine Place current program control information in known location; jump to specified address : Return Replace contents of PC and other register from known location : Execute Fetch operand from specified location and execute as instruction; do not modify PC 17

Transfer of Control : Skip Increment PC to skip next instruction : Skip Conditional

Transfer of Control : Skip Increment PC to skip next instruction : Skip Conditional Test specified condition; either skip or do nothing based on condition : Halt Stop program execution : Wait (hold) Stop program execution; test specified condition repeatedly; resume execution when condition is satisfied : No operation is performed, but program execution is continued 18

Transfer of Control : Branch (Conditional, Unconditional( 19

Transfer of Control : Branch (Conditional, Unconditional( 19

Transfer of Control : Procedure Call 20

Transfer of Control : Procedure Call 20

Transfer of Control : Procedure CALL and RETURN 21

Transfer of Control : Procedure CALL and RETURN 21

Transfer of Control 22

Transfer of Control 22

Types of Operands • Addresses • Numbers • Characters • Logical Data 23

Types of Operands • Addresses • Numbers • Characters • Logical Data 23

Types of Operands Intel Data Types 24

Types of Operands Intel Data Types 24

Types of Operands Pentium Numeric Data Formats 25

Types of Operands Pentium Numeric Data Formats 25

Types of Operands Pentium Numeric Data Formats 26

Types of Operands Pentium Numeric Data Formats 26

Instruction Format ������� : Number of Addressing Modes ������ : Number of Operands :

Instruction Format ������� : Number of Addressing Modes ������ : Number of Operands : Register versus Memory : Number of Register Sets Etc. 27

DEC : Digital Equipment Corporation 28

DEC : Digital Equipment Corporation 28

29

29

DEC : Digital Equipment Corporation : VAX Fig 11. 7 Micro. VAXes VAX stations

DEC : Digital Equipment Corporation : VAX Fig 11. 7 Micro. VAXes VAX stations VAX servers VAX 700 series VAX 8000 series VAX 4000 series VAX 6000 series VAX 7000 series More Information at http: //www. netbsd. org/Documentation/Hardware/Machines/DEC/vax/sections. html 30

Pentium • Instruction Prefixes • Segment Override • Address Size • Operand Size •

Pentium • Instruction Prefixes • Segment Override • Address Size • Operand Size • Op-code • Mode R/m • SIB Scale factor + Index + Base • Displacement • Immediate 31

Pentium Instruction Formats 32

Pentium Instruction Formats 32

IBM System 360/370 Series : Instruction Length ] 16 bits, 32 bits, 48 bits

IBM System 360/370 Series : Instruction Length ] 16 bits, 32 bits, 48 bits : Op-Code = 8 bits IBM Reference 33

Introduction to Computer Organization and Architecture ������ Flow of Control �� ��������

Introduction to Computer Organization and Architecture ������ Flow of Control �� ��������