Skip to content

This project is a user management application developed in assembly language for 32-bit architecture. It allows users to create, display, and manage user profiles efficiently. Implemented using NASM, the project demonstrates proficiency in low-level programming and computer architecture principles.

Notifications You must be signed in to change notification settings

Zaid-MAHSOUNE/Assmebly_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assmebly_Project

Getting Started

This program manages user data using NASM for 32-bit architecture. Follow the steps below to compile and link the assembly code (project.asm):

Compiling and Linking:

  • Open a command prompt or terminal and navigate to the directory containing project.asm.
  • Run the following commands:
    nasm -f elf32 -g -F dwarf project.asm -o project.o
    ld -m elf_i386 project.o -o executable
    
  • Explanation:
    • nasm: NASM assembler command.
    • -f elf32: Specifies 32-bit ELF architecture.
    • -g: Includes debugging symbols in the object file.
    • -F dwarf: Specifies DWARF debugging information format.
    • project.asm: Input assembly code file.
    • -o project.o: Output filename for the object file.
    • ld: Linker command.
    • -m elf_i386: Specifies 32-bit Intel x86 architecture.
    • project.o: Object file created by NASM.
    • -o executable: Output filename for the final executable file.

Debugging (Optional):

  1. Initial Setup:

    • layout asm: Sets the GDB display layout to show assembly code alongside other information.
    • layout regs: Displays the register values in the layout.
    • set disassembly-flavor intel: Specifies that you want to disassemble the code in Intel syntax (common for x86 architecture).
  2. Loading the Program:

    • file executable: Loads the executable file (generated by NASM) into GDB for debugging.
  3. Debugging Commands:

    • step: Executes the next instruction in the program, stepping through line by line.
    • break [line]: Sets a breakpoint at the specified line number in the assembly code. Execution will pause when it reaches that line.
    • delete [breakpoint_number]: Removes the breakpoint with the given number.
    • info breakpoint: Lists all currently set breakpoints and their information.
    • print (casting)[variable-name]: Prints the value of a variable after potentially casting it to a specific data type. Casting ensures GDB interprets the value correctly.
    • display (casting)[variable-name]: Continuously displays the value of a variable and updates it as the program executes. Casting is again helpful for proper interpretation.

Program Usage

Upon running project.asm, you'll encounter a menu with the following options:

  1. Create User
  2. Display All Users
  3. Display User by ID
  4. Display Youngest User
  5. Quit

Input Requirements:

  • Enter a number between 1 and 5 corresponding to your desired action.
  • Any other input will trigger an "Invalid Input" message.

Specific Actions:

  • Create User: Enter the user's name and age separated by a space.
  • Display All Users: View all created users.
  • Display User by ID: Enter the user's ID to display their details.
  • Display Youngest User: View the youngest user's details.
  • Quit: Exit the program.

Exceptions:

  • The program handles invalid input and user data scenarios with appropriate error messages.

Memory Management

  • User data is stored in two string arrays: name_array and age_array.
  • User IDs are implicit and determined by the position within the arrays.
  • Main loop manages user actions and displays the menu.
  • User actions include creating users, displaying user information, and quitting.

About

This project is a user management application developed in assembly language for 32-bit architecture. It allows users to create, display, and manage user profiles efficiently. Implemented using NASM, the project demonstrates proficiency in low-level programming and computer architecture principles.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published