Download presentation
Presentation is loading. Please wait.
Published byHalie Chesser Modified over 9 years ago
1
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 1 COE 308 MIPS Instructions
2
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 2 COE 308 MIPS Microprocessor without Interlocked Pipeline Stages RISC microprocessor architecture developed by MIPS Computer Systems Inc. MIPS designs are used in SGI's computer product line, and have found broad application in embedded systems, Windows CE devices, and Cisco routers. The Nintendo 64 console, Sony Playstation console, Sony Playstation 2 console, and Sony Playstation Portable handheld system use MIPS processors. By the late 1990s it was estimated that one in three RISC chips produced were MIPS-based designs.
3
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 3 COE 308 Instructions in MIPS Reduced Instruction Set 3 Operands per operation: 2 sources and 1 destination Most instructions are of the form: Operation dst, src1, src2 Where it means: dst src1 Operation src2 Example: addition add dst, src1, src2 means: dst src1 + src2
4
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 4 COE 308 Operands 32 General-purpose registers: R0 – R31 –R0 is “wired” to the value “0” –Writing to R0 does not change its value Special-purpose registers LO and HI –Hold results of integer multiply and divide Special-purpose program counter PC 32 Floating Point Registers (FPRs) –Floating Point Unit (FPU) can be either 32-bit or 64-bit –FPRs are 32 bits on a 32-bit FPU, and 64 bits on a 64-bit FPU Almost all instructions operate on registers All destination operands are registers One of the source operands is a signed/unsigned 16-bits immediate value
5
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 5 COE 308 Instruction Format Fixed Format 3 Format Types –Register: R-type –Immediate: I-type –PC-relative:J-type 6 bits 5 bits All MIPS Instructions Format
6
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 6 COE 308 R-Type opfunctrsrtrdshamt Used by –Arithmetic Instructions –Logic Instructions –Except when Immediate Addressing mode used 6 bits 5 bits
7
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 7 COE 308 I-Type Used by –Instructions using Immediate addressing mode –Instructions using Displacement addressing mode –Branch instructions oprsrtaddress/immediate 6 bits5 bits 16 bits
8
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 8 COE 308 J-Type Used by –Jump Instructions optarget address 6 bits26 bits
9
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 9 COE 308 Instructions Arithmetic and Logic Instructions Comparison Instructions Load/Store and Data Movement Instructions Branch and Jump Instructions
10
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 10 COE 308 Arithmetic & Logic Instructions small circle in front of the instruction means that it is a pseudo-instruction
11
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 11 COE 308 Addressing Modes The second operand of all of the load and store instructions must be an address. The MIPS architecture supports the following addressing modes:
12
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 12 COE 308 Load Instructions
13
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 13 COE 308 Store Instructions
14
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 14 COE 308 Data Movements Instructions The data movement instructions move data among registers. Special instructions are provided to move data in and out of special registers such as hi and lo.
15
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 15 COE 308 Exceptions
16
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 16 COE 308 Assembly Conventions
17
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 17 COE 308 Comments, Labels, Registers and Directives Comment: –“#”: Label: – Registers –$ or $ Directives –.data: for defining the constant segment –.text: for defining the code –.ascii: for defining strings –.asciiz: for defining zero-terminated strings –.byte: for defining constants
18
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 18 COE 308 Registers Even though any of the registers can theoretically be used for any purpose, MIPS programmers have agreed upon a set of guidelines that specify how each of the registers should be used. Programmers (and compilers) know that as long as they follow these guidelines, their code will work properly with other MIPS code.
19
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department College of Computer Science And Engineering College of Computer Science And Engineering MIPS Architecture 19 COE 308 SPIM Simulator Source code: text file saved as with “.asm” extension.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.