Welcome to the lab exercises for the "Introduction to Computers" course in the Computer Science degree program. This lab focuses on MIPS assembly language programming, specifically on addition operations.
- Course Name: Introduction to Computers
- Course Code: CS221
- Instructor: Dimitriou Georgios
- Semester: 2020
- Prerequisites: None
Write a MIPS assembly program that reads and displays a number on the screen. The program should provide a prompt message before reading the number from the keyboard to guide the user.
Write a MIPS assembly program that reads and displays three numbers on the screen. The program should use prompt messages for reading and displaying the numbers.
Create an assembly program that adds two numbers initially loaded into registers t1 and t2. The result should go to t3 and be displayed on the screen.
Implement an assembly program that adds two numbers given each time from the keyboard. The result should go to t3 and be displayed on the screen.
Create an assembly program that calculates the difference between two numbers given each time from the keyboard. The result should go to t3 and be printed on the screen.
Implement an assembly program that displays your name 10 times on the screen, using line breaks for readability.
Write an assembly program that reads two numbers from the keyboard, a and b. It checks if a < b, a > b, or a = b, and displays the corresponding message on the screen.
Write an assembly program to find the integer values of x that zero the function f(x) = ax^2 + bx in the interval [X1, X2]. The values of a, b, X1, and X2 should be entered from the keyboard. If the function does not zero in the interval [X1, X2], display the message "end of program."
Write an assembly program that reads integer numbers from the keyboard and stores them in memory, creating an array of 10 positions. It finds the number of positive, negative, and zero numbers in the array and displays them.
Write an assembly program that creates an array of 10 positions and finds the largest number in the array.
Write an assembly program that creates two arrays of 10 elements each. Then, create a third array with the sum of the corresponding elements of the two arrays and display the elements of the third array.
Write a program that creates an array of 6 elements, calculates the smallest number, adds it to each element of the array, and then displays the elements in reverse order from input.
Write a program that fills two one-dimensional arrays A and B with ten positions each, swaps the elements of the arrays, and then displays the contents of the arrays to verify the process.
Write an assembly program to calculate the sum of products 12 + 23 + 34 + 45 + ... where the user specifies how many products to add each time.
Write a program that continuously reads numbers from the keyboard until the number zero is given. When zero is entered, print the number of even and odd numbers given up to that point.
Write a program to calculate the sum:
To run a MIPS assembly program with SPIM on the terminal in Linux, follow these steps:
-
Install SPIM: If not already installed, you can install SPIM using your package manager.
-
Write your MIPS assembly program: Save your MIPS assembly program with a
.s
extension. -
Open a terminal.
-
Navigate to the directory containing your assembly file.
-
Run the program using SPIM: spim -file your_program.s
Paschalis Moschogiannis (Contact: pmoschogiannis@uth.gr)
This project is licensed under the GNU General Public License Version 3 (GPLv3).