Sie sind auf Seite 1von 1

KT14203 COMPUTER ARCHITECTURE AND ORGANIZATION

Lab 2 Exercise

1. Modify the Lab 2 Tutorial 1 to allow users to enter the parameter and display the final result.
Assume the values of n is 5, your console should display the following:

Please enter n value: 5


The sum of 0 to n is 15
Thank you.

You are also required to store the results in the memory.

2. The below code were developed using JAVA.

int x = 5;
int y = 10;
int z = 30;

int a = x + y;
x = z - a;

* use register $s0 for operand x, $s1 for operand y, $s2 for operand z and $a0 for a.

Das könnte Ihnen auch gefallen