Table of Contents

MARIE - MinMax swap - A study about assembly

Objectives

This is a different kind of assignment for students which are interested in using a CPU rather than building its architecture. The main objective of this project is to get familiar with the assembly language using a dedicated ISA, by accommodating the given examples and improving their functionality. You will:

Description and requirements

Implement an assembly program which reads N elements from the keyboard and swaps the minimum value with the maximum value. The program shall have and use at least one subroutine - you can have the swap function here. The implementation shall be done in 2 steps:

  1. Build and run a C program which implements the desired functionality - better if you use pointers instead of fixed uni-dimensional arrays
  2. Based on the C implementation, build the MARIE assembly program.

Beside the C program and the MAR program, you must upload a README file which contains a short comparison between the two solutions and a short description of the algorithm you've chosen.

Notes

There are several examples provided to figure out how to execute diverse operations with the MARIE CPU. You can use them to understand the procedures. Assembly programming implies managing the hardware recourses properly; the closest higher-level programming that you already know is C programming with pointer use and dynamic allocation.

Additional details

This assignment is an individual assignment; using any code from external sources can be considered plagiarism and can lead to voiding the accumulated points!

Grading

Even if you do not finish the assignment, you can receive up to 25% of the grade if you properly explain your idea in the README file. Your code must pass the compilation and run.

Recourses

Appendix