Lec 03
Lec 03
Dr. A. Sahu
Dept of Comp. Sc. & Engg.
Indian Institute of Technology Guwahati
1
Outline
• Introduction to MIPS Instruction Set
• MIPS Arithmetic's
• Register Vs Memory, Registers Name
• Byte Ordering
Instructions
• Language
g g of the Machine
• Primitive compared to HLLs
• Easily
l interpreted
d by
b hardware
h d
Instruction set design goals
• Maximize performance
• Minimize cost,
• Reduce
Red e design
desi n time
Type of Instructions
MIPS: Microprocessor
p without Interlocked
Pipeline Stages : ISA
MIPS: Millions Instructions Per Sec:
Measure
MIPS Arithmetic
• All instructions have 3 operands
• Operand order is fixed (destination first)
Example:
C code: A=B+C
MIPS code: add $s0, $s1, $s2
C t l
Control I
Input
t
Memory
Datapath Output
Processor I/O
/
Memory Organization
0 8 bits of data
1 8 bits of data
• Viewed as a large, single‐
dimension array,y, with an 2 8 bits of data
byte of memory
memory. ...
Register Names and Purpose
Register
Name Usage
number
$zero 0 the constant value 0
$v0-$v1
$ $ 2-3 values for results
$a0-$a3 4-7 arguments
$t0-$t7 8-15 temporaries
$s0-$s7 16-23 saved
$t8-$t9 24-25 more temporaries
$
$gp 28 global
l b l pointer
i t
$sp 29 stack pointer
$fp 30 frame pointer
$ra 31 return address
Words and Bytes
3 2 1 0
Non aligned word
Non‐aligned ord 7 6 5 4
Instructions to access memory
• Load and store instructions
• Example: