CS 350 INTRODUCTION TO MIPS ASSEMBLY LANGUAGE


Types of MIPS | Memory Instructions | Arithmetic Instructions | Branch/Jump Instructions

In-Lab Exercise


 MIPS IN-LAB EXERCISE SOLUTIONS

 

1)

lw $t0, 1200($t1)

add $t0, $s2, $t0

sw $t0, 1200($t1)

 

2)

Loop:

add $t1, $s3, $s3

add $t1, $t1, $t1

add $t1, $t1, $s6

lw $t0, 0($t1)

 

bne $t0, $s5, Exit

add $s3, $s3, $s4

j Loop

 

Exit:

 

3)

Loop:

add $t1, $s3, $s3

add $t1, $t1, $t1

add $t1, $t1, $s5

lw $t0, 0($t1)

 

add $s1, $s1, $t0

add $s3, $s3, $s4

 

bne $s3, $s2, Loop

 

 


Types of MIPS | Memory Instructions | Arithmetic Instructions | Branch/Jump Instructions

In-Lab Exercise