Micro Processors Project
Haidar Al-lami – 202110618
Laith Al-Sbaihat - 202220611
Submitted to:
Dr. Mohammad Klaib
pg. 1
Explanation of the Code:
1. Creating a List for Input Data:
The program initializes an array (array) in the data section to store three
numbers input by the user. These numbers are used for various
operations.
2. Organizing Operations in a Loop:
The code implements a menu system that repeatedly displays a list of
operations (e.g., addition, subtraction, etc.).
The user selects an operation, and the corresponding action is executed.
If the user enters an invalid choice, an error message is displayed, and the
program prompts the user again within a loop (menu_loop).
3. Using Separate Functions (Classes Concept):
Each operation (e.g., addition, subtraction) is implemented as a separate
function, similar to classes in modern programming languages.
These functions are called using the jal instruction.
After performing the operation, the program displays the result.
4. Running the Code:
The program starts by asking the user to input three numbers.
The user selects an operation from the menu, and the program calculates
and displays the result.
pg. 2
Menu Input Testing:
Entering the three numbers:
Let’s choose an operation:
(1) Addition:
The result of addition is 24 as it’s shown above.
(2) Subtraction:
The result of subtraction is -10 as it’s shown above.
pg. 3
(3) Average:
The average is 8 as it’s shown above.
(4) Maximum:
The maximum number is 10 as it's shown above
(5) Minimum:
The minimum number is 7 as it's shown above
pg. 4
(6) Exit:
Not part of the menu options (1–6):
(8) ,Invalid Choice as it’s shown above.
pg. 5
pg. 6