This is a collection of my solutions for the x86 assembly language exercises at my college for my Computer Architecture class. I wrote them in the EMU8086 microprocessor emulator, with comments and naming in the Croatian language.
I don't have the exercises with me anymore, so here are the assumed descriptions of the exercises:
-
???
-
???
-
???
-
Decide and print whether 8 is greater than 10
-
Print '3' in a new line 10 times
-
Enter 5 characters into a string variable, then print the string in the next line
-
Enter a sequence of 10 numbers, print it back in a new line with numbers separated by spaces, then in the next line print the minimum and maximum number of the sequence, each in a new line.
-
Enter a sequence of 10 numbers and print it back sorted using any algorithm. I used the Selection Sort O(n^2) algorithm.
-
Same as 8., but Bubble Sort.
-
Enter a sequence of numbers until zero is entered, then print the amount of even numbers entered.
-
Enter a sequence of numbers until zero is entered, then print the amount of odd numbers entered.
-
Convert any byte (ASCII character, in this example 231) and print its hexadecimal representation.
-
Fill a buffer of at most 254 input characters and print them back in hexadecimal representation.
-
Enter a sequence of up to 10 numbers or until '0' is entered, then print back the numbers that have set bits 2, 4 and 5 (bit mask 00110100).
-
Enter a sequence of up to 16 numbers or until '0' is entered, push the odd numbers to the stack and print them in reverse order.
-
DZ5 - Z1: Print 'Hello world!' -
DZ5 - Z2: Selection Sort algorithm -
DZ5 - Z3: Enter 5 characters and print them back each in a new line. -
DZ5 - Z4: Using a macro, input 5 characters. -
DZ6 - Z3: Enter any amount of characters until the Enter character is entered, then print whether any non-zero characters were entered. -
DZ6 - Z4: Store any number in BX and print its hexadecimal representation. -
Z10: Enter a single character and print it in a new line. -
Z11: Print the letters from 'A' to 'E', each in their own line. -
Z12: Enter three single-digit numbers and print out the largest among them.
- Félix Cloutier: "x86 and amd64 instruction reference", https://www.felixcloutier.com/x86/
- "INT 21h - The general function despatcher", http://bbc.nvg.org/doc/Master%20512%20Technical%20Guide/m512techb_int21.htm