This is a simple CRUD (Create, Read, Update, Delete) program written in Assembly x86-64, designed for Linux with the System V AMD64 ABI calling convention. The program manages a membership database for a fictional organization. Users can perform various operations, including adding new members, viewing existing members, updating member information, and deleting members from the database.
The code is organized into different sections: .rodata
, .data
, and .text
. The .rodata
section contains read-only data, such as strings used for displaying menus, alerts, and user prompts. The .data
section holds the data structure used to store member records, and the .text
section contains the main program logic.
The program utilizes a simple data structure called struct member
to store member records. The structure consists of the following fields:
name[64]
: A character array to store the name of the member (limited to 64 characters).discord_username[32]
: A character array to store the Discord username of the member (limited to 32 characters).gender
: A single character representing the gender of the member, which can be 'm' (male), 'f' (female), or 'h' (hidden).hobby[64]
: A character array to store the hobby of the member (limited to 64 characters).
The program provides a text-based user interface through the terminal. When running the program, users are presented with a menu that includes the following options:
- Add a new member: Allows users to add a new member to the database by providing their name, Discord username, gender, and hobby.
- Show members: Displays the list of existing members in the database, showing their name, Discord username, gender, and hobby.
- Update a member: Allows users to update the information of an existing member. They can modify the member's name, Discord username, gender, or hobby.
- Delete a member: Enables users to remove a member from the database based on their name.
- Exit: Exits the program.
- Ensure that you have GCC and Make installed on your Linux system. If not, you can install them using the following command:
sudo apt-get install gcc make -y
- Download or clone the repository containing the program's source code.
- Open a terminal and navigate to the program's directory.
- Build the program by running the
make
command.make
- Execute the program by running the following command:
./bin/main
- If you don't have GCC and Make installed on your Windows system, you need to install the MinGW-w64 environment, which provides GCC and Make for Windows. You can download the MinGW-w64 installer from here.
- During installation, make sure to select "x86_64" for the architecture to match the code's x86-64 assembly.
- Add the installation path (e.g.,
C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin
) to your system's PATH environment variable.
- Download or clone the repository containing the program's source code.
- Open a Command Prompt or PowerShell window and navigate to the program's directory.
- Build the program by running the following command:
mingw32-make
- Execute the program by running the following command:
bin\main
This program provides a basic framework for managing membership data and can be further expanded to include more features and improvements. It serves as a starting point for a simple CRUD membership database and can be customized as needed for specific use cases. For production use, additional validation and error handling mechanisms should be implemented to ensure data integrity and user experience.