Operand Addressing –No instruction for reg-to-reg transfer –Cannot do memory-memory transfers with single instruction –sw instruction violates (dest, source)

Slides:



Advertisements
Similar presentations
1 Lecture 3: MIPS Instruction Set Today’s topic:  More MIPS instructions  Procedure call/return Reminder: Assignment 1 is on the class web-page (due.
Advertisements

Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
Lecture 5: MIPS Instruction Set
CS/COE0447 Computer Organization & Assembly Language
The University of Adelaide, School of Computer Science
1 Procedure Calls, Linking & Launching Applications Lecture 15 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Chapter 2 — Instructions: Language of the Computer — 1 Branching Far Away If branch target is too far to encode with 16-bit offset, assembler rewrites.
Assembly Code Example Selection Sort.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 5 MIPS ISA & Assembly Language Programming.
ELEN 468 Advanced Logic Design
Systems Architecture Lecture 5: MIPS Instruction Set
Chapter 2 Instructions: Language of the Computer
The University of Adelaide, School of Computer Science
Informationsteknologi Saturday, September 29, 2007 Computer Architecture I - Class 41 Today’s class More assembly language programming.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
9/29: Lecture Topics Memory –Addressing (naming) –Address space sizing Data transfer instructions –load/store on arrays on arrays with variable indices.
Lecture 7: MIPS Instruction Set Today’s topic –Procedure call/return –Large constants Reminders –Homework #2 posted, due 9/17/
CDA 3101 Fall 2012 Introduction to Computer Organization Instruction Set Architecture MIPS Instruction Format 04 Sept 2013.
83 Assembly Language Readings: Chapter 2 ( , 2.8, 2.9, 2.13, 2.15), Appendix A.10 Assembly language Simple, regular instructions – building blocks.
IT253: Computer Organization Lecture 5: Assembly Language and an Introduction to MIPS Tonga Institute of Higher Education.
Computer Organization and Design Instruction Sets Montek Singh Wed, Sep 12, 2012 Lecture 5.
Registers and MAL Lecture 12. The MAL Architecture MAL is a load/store architecture. MAL supports only those addressing modes supported by the MIPS RISC.
1. 2 Instructions: Words of the language understood by CPU Instruction set: CPU’s vocabulary Instruction Set Architecture (ISA): CPU’s vocabulary together.
1 Branches and Procedure Calls Lecture 14 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Lecture 4: MIPS Instruction Set
MIPS coding. Review Shifting – Shift Left Logical (sll) – Shift Right Logical (srl) – Moves all of the bits to the left/right and fills in gap with 0’s.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 2 Part 2.
RISC Processor Design RISC Instruction Set Virendra Singh Indian Institute of Science Bangalore Lecture 8 SE-273: Processor Design.
Carnegie Mellon 1 Machine-Level Programming I: Basics Lecture, Feb. 21, 2013 These slides are from website which accompanies the.
MIPS Assembly Language Chapter 13 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer,
EEL5708/Bölöni Lec 3.1 Fall 2006 Sept 1, 2006 Lotzi Bölöni EEL 5708 High Performance Computer Architecture Lecture 3 Review: Instruction Sets.
MIPS Architecture Topics –What resources MIPS assembly manipulates –CPU (Central Processing Unit) –ALU (Arithmetic & Logical Unit), Registers –Memory –I/O.
MIPS Functions and the Runtime Stack
MIPS Architecture Topics –What resources MIPS assembly manipulates –CPU (Central Processing Unit) –ALU (Arithmetic & Logical Unit), Registers –Memory –I/O.
Instructor: Prof. Hany H Ammar, LCSEE, WVU
Digital Logic Design Alex Bronstein
COMPUTER ARCHITECTURE & OPERATIONS I
Computer Organization and Design Instruction Sets - 2
ENGR xD52 Eric VanWyk Fall 2013
Lecture 4: MIPS Instruction Set
ELEN 468 Advanced Logic Design
Computer Organization and Design Instruction Sets - 2
ENGR 3410 – Computer Architecture Mark L. Chang Fall 2006
Concocting an Instruction Set
Concocting an Instruction Set
Computer Organization and Design Instruction Sets
ECE/CS 552: Instruction Sets – MIPS
Appendix A Classifying Instruction Set Architecture
MPIS Instructions Functionalities of instructions Instruction format
MISP Assembly.
Systems Architecture Lecture 5: MIPS Instruction Set
Logical and Decision Operations
Computer Architecture & Operations I
ECE232: Hardware Organization and Design
Lecture 5: Procedure Calls
MIPS Assembly.
Flow of Control -- Conditional branch instructions
UCSD ECE 111 Prof. Farinaz Koushanfar Fall 2018
Logical instructions And rd rs rt Nor rd rs rt Or rd rs rt
MIPS Assembly.
Flow of Control -- Conditional branch instructions
MIPS assembly.
CS352H Computer Systems Architecture
Reduced Instruction Set Computer (RISC)
Logical Instructions And rd rs rt Nor rd rs rt Or rd rs rt
CS501 Advanced Computer Architecture
7/6/
9/13/
MIPS instructions.
Presentation transcript:

Operand Addressing –No instruction for reg-to-reg transfer –Cannot do memory-memory transfers with single instruction –sw instruction violates (dest, source) spec of operands Imm Reg Mem Reg Mem Reg SourceDestination li $t1, 0x4 la $t1, A sw $t1,A($t2) lw $t1,A($t2) C Analog temp = 0x4; temp2 = &A; A[n] = temp; temp = A[n]; Addr

Addressing Modes Indirect(R) Mem[Reg[R]] – Register R specifies memory address lw $t1, ($t2) IndexedD(R) Mem[Reg[R]+D] – Register R specifies start of memory block – Constant displacement D specifies offset lw $t1, 8($t2)

.data array:.word0x37, 0x55, 0xF.text la $s0, array la$s1, array+4 la$s2, 8($s0) li$a0, 4 lw$t0, 0($s0) lw$t3, array($a0) lw$t1, 8($s0) lb$t2, ($s0) Example

void swap(int *xp, int *yp) { int t0 = *xp; int t1 = *yp; *xp = t1; *yp = t0; } # xp in $a0, yp in $a1 swap: lw $t0,($a0) # t0=*xp lw $t1,($a1) # t1=*yp sw $t1,($a0) # *xp=t1 sw $t0,($a1) # *yp=t0 jr $ra

Understanding Swap void swap(int *xp, int *yp) { int t0 = *xp; int t1 = *yp; *xp = t1; *yp = t0; } RegisterVariable Value $a0xp 120 $a1yp 124 $t0 $t1 # xp in $a0, yp in $a1 swap: lw$t0, ($a0) lw$t1, ($a1) sw$t1, ($a0) sw$t0, ($a1) jr$ra x124 0x120

RegisterVariable Value $a0xp 120 $a1yp 124 $t0 456 $t1 # xp in $a0, yp in $a1 swap: lw$t0, ($a0) lw$t1, ($a1) sw$t1, ($a0) sw$t0, ($a1) jr$ra x124 0x120

RegisterVariable Value $a0xp 120 $a1yp 124 $t0 456 $t1 123 # xp in $a0, yp in $a1 swap: lw$t0, ($a0) lw$t1, ($a1) sw$t1, ($a0) sw$t0, ($a1) jr$ra x124 0x120

RegisterVariable Value $a0xp 120 $a1yp 124 $t0 456 $t1 123 # xp in $a0, yp in $a1 swap: lw$t0, ($a0) lw$t1, ($a1) sw$t1, ($a0) sw$t0, ($a1) jr$ra 123 0x124 0x120

RegisterVariable Value $a0xp 120 $a1yp 124 $t0 456 $t1 123 # xp in $a0, yp in $a1 swap: lw$t0, ($a0) lw$t1, ($a1) sw$t1, ($a0) sw$t0, ($a1) jr$ra x124 0x120

Arithmetic Operations add $t1, $t2, $t2 (addi $t1, $t2, 0x32) sub $t1, $t2, $t2 mul $t1, $t2, $t2 div $t1, $t2, $t2 and (andi), or (ori), xor (xori) sll $t1, $t2, 2 (shift left logical) sllv (sll variable) sra (shift right arithematic) srl

Directives (Establish initial data structure).ascii (store string in memory with no null-termination).asciiz (store string in memory with null termination).byte b1,..,bn.word w1,..,wn.word w:n (store w into n successive words).space n.datadata segment.textassembly instructions Directives