A comprehensive collection of x86 assembly language programming exercises from a university-level computer architecture course. These exercises cover fundamental concepts in low-level programming, including loops, conditionals, array operations, string handling, and mathematical computations.
- Project Overview
- File Descriptions
- Prerequisites
- How to Run
- Topics Covered
- File Structure
- Contributing
This repository contains practical assembly language exercises designed to deepen understanding of computer architecture fundamentals. Each .asm file demonstrates specific programming concepts and CPU operations, ranging from basic I/O operations to complex algorithms.
Leggere e stampare un intero.asm- Reading and printing integersLeggere e stampare una stringa.asm- Reading and printing stringsstampaStr.asm- String output operations
Char_in_substring.asm- Finding characters in substringsconta_sottostringa_in_stringa.asm- Counting substring occurrencesdelete_spaces.asm- String space removalnum_of_schars.asm- Character countingoccorrenze.asm- Occurrence detectionPalindromo.asm- Palindrome checkingstampa_contrario.asm/StampaContr.asm- Reverse string printingvocali_upper.asm- Vowel uppercase conversion
factorial.asm- Factorial calculationprodotto.asm- Multiplication operationsSommaNum.asm- Number summationgiven_array_find_sum.asm- Array summationfind_min_max_media.asm- Finding minimum, maximum, and average valuesmax e media float.asm- Floating-point max and average operationsMathTest.asm- Mathematical operation testing27_maggio_2022.asm- Exam exercise (May 27, 2022)
bit_mask.asm- Bit masking techniquesmask.asm- Mask operationsmaschere_divisibili.asm- Divisibility mask operationsoverflow.asm- Integer overflow handling
Bubblesort.asm- Bubble sort implementationsumArray.asm- Array summing algorithm
To run these assembly programs, you'll need:
- MASM (Microsoft Macro Assembler) or NASM (Netwide Assembler)
- Windows or Linux environment (MASM primarily Windows, NASM cross-platform)
- Debugger (e.g., WinDbg, GDB for debugging)
- Basic understanding of x86 assembly language and CPU registers
- A text editor or IDE supporting assembly syntax (VS Code, Visual Studio, etc.)
sudo apt-get install nasmDownload and install the Microsoft Visual Studio Build Tools or Visual Studio Community with C++ support.
-
Assemble the
.asmfile:nasm -f elf64 filename.asm -o filename.o
-
Link the object file:
ld -o filename filename.o
-
Run the program:
./filename
-
Assemble:
ml64.exe /c filename.asm
-
Link:
link filename.obj
-
Run:
filename.exe
For NASM/Linux with GDB:
gdb ./filenameFor MASM/Windows with WinDbg:
windbg filename.exe- Input/Output Operations - Reading from and writing to console
- Data Types - Integers, floats, characters, and strings
- Control Flow - Conditionals and loops (CMP, JMP, JNE, JE, etc.)
- Array Operations - Indexing, traversal, and processing
- String Manipulation - Concatenation, reversal, searching
- Mathematical Operations - Arithmetic, floating-point calculations
- Bit Operations - Masking, shifting, logical operations
- Algorithms - Sorting, searching, and other classic algorithms
Computer-Architecture-Course-Assembly-main/
├── README.md
├── Foundational exercises
│ ├── Leggere e stampare un intero.asm
│ └── Leggere e stampare una stringa.asm
├── String operations
│ ├── Palindromo.asm
│ ├── delete_spaces.asm
│ └── ...
├── Mathematical operations
│ ├── factorial.asm
│ ├── find_min_max_media.asm
│ └── ...
├── Bit and mask operations
│ ├── bit_mask.asm
│ └── overflow.asm
└── Algorithms
├── Bubblesort.asm
└── sumArray.asm
These exercises are designed to:
- Strengthen understanding of CPU architecture and instruction sets
- Practice low-level programming and memory management
- Develop debugging and problem-solving skills
- Prepare students for systems programming and reverse engineering
- Provide hands-on experience with assembly language concepts
This repository is educational material from a university course. Please check with your institution for usage rights and licensing information.
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement) - Commit your changes (
git commit -am 'Add improvement') - Push to the branch (
git push origin feature/improvement) - Submit a pull request
For bug reports or suggestions, please open an issue.
- x86 Assembly Language Reference
- NASM Documentation
- Intel x86 Instructions Reference
- Assembly Language Tutorials
Course Level: Intermediate
Language: x86 Assembly