Instruction Set Architectures Continued

Slides:



Advertisements
Similar presentations
Instruction Set Design
Advertisements

Goal: Write Programs in Assembly
INSTRUCTION SET ARCHITECTURES
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
1 Today’s lecture  Last lecture we started talking about control flow in MIPS (branches)  Finish up control-flow (branches) in MIPS —if/then —loops —case/switch.
1 Registers and MAL - Part I. Motivation So far there are some details that we have ignored instructions can have different formats most computers have.
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
Assembly & Machine Languages
Module 10 Adapted By and Prepared James Tan © 2001.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
Memory and Addressing How and Where Information is Stored.
Instruction Set Architecture Basics. Our Progress Done with levels 0 and 1 Seen multiple examples of level 2 Ready for ISA general principles.
Lecture 15: 10/24/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Computer Systems – Machine & Assembly code. Objectives Machine Code Assembly Language Op-code Operand Instruction Set.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Instruction Set Architectures. Our Progress Done with levels 0 and 1 Seen multiple examples of level 2 Ready for ISA general principles.
F453 Module 8: Low Level Languages 8.1: Use of Computer Architecture.
Instruction Set Architectures Continued. Expanding Opcodes & Instructions.
1 Contents: 3.1 Instruction format and Addressing Modes 3.2 Instruction Introduction Chapter 3 Instruction system.
EEL 4709C Prof. Watson Herman Group 4 Ali Alshamma, Derek Montgomery, David Ortiz 11/11/2008.
Displacement (Indexed) Stack
A Closer Look at Instruction Set Architectures
William Stallings Computer Organization and Architecture 6th Edition
Computer Architecture Instruction Set Architecture
Immediate Addressing Mode
A Closer Look at Instruction Set Architectures
Chapter 4 The Von Neumann Model
MIPS Coding Continued.
Lecture 4: MIPS Instruction Set
ELEN 468 Advanced Logic Design
COMP2121: Microprocessors and Interfacing
Chapter 4 The Von Neumann Model
Alvaro Mauricio Peña Dariusz Niworowski Frank Rodriguez
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
A Closer Look at Instruction Set Architectures
A Closer Look at Instruction Set Architectures: Expanding Opcodes
William Stallings Computer Organization and Architecture 8th Edition
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Instruction Set Architectures
Computer Science 210 Computer Organization
Lecture 4: MIPS Instruction Set
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Introduction to Computer Engineering
MIPS Instruction Encoding
ECEG-3202 Computer Architecture and Organization
MIPS Instruction Encoding
Computer Architecture and the Fetch-Execute Cycle
Under Address Modes Source: under
Computer Architecture
Classification of instructions
Chapter 4 The Von Neumann Model
Under Address Modes Source: under
Instruction Set Principles
Evolution of ISA’s ISA’s have changed over computer “generations”.
Lecture 4: Instruction Set Design/Pipelining
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats.
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Presentation transcript:

Instruction Set Architectures Continued

Expanding Opcodes & Instructions

Expanding vs Fixed Opcodes Fixed Size Opcode: Every type of instruction uses same opcode size MIPS instruction format:

Fixed Opcodes Expanding Opcode: Different instructions = different length opcodes

Expanding Opcodes Expanding Opcode : Special opcode means : keep reading xxx = any pattern but all 1's X X X X X X X X 1 1 1 1 1 1 1 1 X X X X 1 1 1 1 1 1 1 1 1 1 1 1 X X X X

Expanding Opcode Expanding Opcode : More efficient use of space Intel : 0F = keep reading : http://ref.x86asm.net/coder64.html

Expanding Opcodes ARM Expanding / Split OpCode

Expanding Instructions Every instruction does not have to be the same size:

Expanding Instructions Might decode based on instruction Java bytecode bipush #immediate : +0 bipush +1 immediate +2 next instruction 7 8 9 10 11

Expanding Instructions Might decode based on instruction 3 possibilities:

Expanding Instructions Intel 32 bit code : 1-6 bytes 64 bit code : up to 15 bytes:

Addressing Modes

Addressing Addressing : the ways we are allowed to refer to values and locations

Immediate Addressing Immediate Addressing: Value to load hard coded in instruction Immediate

Direct Addressing Direct Addressing : Instruction contains the memory address that has value to load

Indirect Addressing: Register Register Indirect Addressing: A register contains the address of data to load

Indirect Addressing: Register Register Indirect Addressing Use: Pointers: C++ Assembly int a, c; @assume a = r1 and c = r2 int b*; @assume b = r3 b = &a; @assume loads a's address into r3 c = *b; LDR r2, [r3]

Indirect Addressing: Register & Offset Register Indirect With Offset Addressing: Start with address in register, add immediate offset

Indirect Addressing: PC & Offset PC Relative Addressing: Register Indirect with Offset where register is always PC Immediate

Indirect Addressing: Register & Index Register Indirect With Index (Variable Offset): Start with address in register, add offset amount from another register R2

Addressing Memory Indirect Addressing: Register holds address of memory where address is R

Memory Indirect Uses Jump to nth record of regularly sized structure can be done with: address = base + index * size Register Indirect With Offset

Memory Indirect Addressing Irregular structure needs lookup table to store start addresses of each item: Array of Pointers

Memory Indirect Addressing Memory indirect allows access to list[2] in one instruction:

Other Uses Jump tables used for Efficient switch statements enum operation {LOAD, STORE, ADD}; Switch (operation) { case LOAD: LOAD code; break: case STORE: STORE code; break: case ADD : ADD code; break: }

Other Uses Jump tables used for Efficient switch statements OOP Function Lookup

VTables Vtable : Table of function pointers for virtual functions

VTables Virtual Dispatch: Start with object address Value at that address is address of vtable Each function is that address + known offset

Special Tricks

ARM Addressing Tricks Fun Fact ARM Provides 3 Varients of offset addresses Temporarily add offset Add offset and store changed address Add change after using current value

Atomic Read/Write Fun Fact Multiprocessor systems have to allow for atomic series of actions Special instructions check/set a memory value in one step

Loop Instructions Fun Fact Loops get run a lot Combine Increment, compare and branch into one instruction

Fun Fact ARM Thumb Mode Thumb Mode 16 bit instructions