Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

CAO Assignment # 06 Muhammad Fahad Siddiqui 2019-SE-206

Computer Architecture &


Organization
Assignment # 6

Submitted to :
Mrs. Anila Saghir

Name By:
Muhammad Fahad Siddiqui

Roll #:
2019-SE-206

Section:
E

1
CAO Assignment # 06 Muhammad Fahad Siddiqui 2019-SE-206

Task: Explain Instruction Set for MIPs for the following Categories with suitable Program
Examples.

1. Arithmetic and Logical


2. Control
3. Data Transfer

Arithmetic and Logical Instruction :


Addition:
Syntax:
Add $1,$2,$3
Meaning:
$1 = $2 + $3
Example:

Subtraction:
Syntax:
Sub $1,$2,$3
Meaning:
$1 = $2 - $3

2
CAO Assignment # 06 Muhammad Fahad Siddiqui 2019-SE-206

Example:

Multiplication:
Syntax:
Mul $1,$2,$3
Meaning:
$1 = $2 * $3
Example:

3
CAO Assignment # 06 Muhammad Fahad Siddiqui 2019-SE-206

Division:
Syntax:
Div $1,$2,$3
Meaning:
$1 = $2 / $3
Example:

4
CAO Assignment # 06 Muhammad Fahad Siddiqui 2019-SE-206

Control Instruction:
Instructions Syntax Meaning
Branch on not equal to Zero bnez $1,100 If($1!=0)
Branch on equal to Zero blez $1,100 If($1<=0)
Branch on less than bltz $1,$2,100 If($1<$2)
Branch on less than or equal blez $1,$2,100 If($1<=$2)

Example:

5
CAO Assignment # 06 Muhammad Fahad Siddiqui 2019-SE-206

Data Transfer Instruction :

Instructions Syntax Meaning


Load Address la $0,label $0=address of label
Load Word lw $1,100($2) $1=memory [$2+100]
Store Word sw $1,100($2) $1=memory [$2+100]
Move move $1,$3 $1=$3

Example:

You might also like