A basic game developed using x86 assembly for MacOS. This project is intended as a learning exercise for understanding assembly language.
You'll need to have the following installed to run Opcode Odyssey:
-
NASM: The Netwide Assembler, a portable 80x86 and x86-64 assembler.
-
SDL2: A cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.
-
SDL2_image: An SDL2 extension library which provides the loading of images in various formats.
-
First, clone this repository to your local machine using
git clone. -
Compile the code using the provided Makefile. Open your terminal, navigate to the project directory and run:
make allThis will generate the object files and the executable main.
Run the executable main in your terminal:
./mainThe player controls are quite simple and are based on the keyboard keys:
A: Move player to the left.D: Move player to the right.S: Move player down.W: Move player up.Space: Throw a ball.
The code is structured in assembly with the following sections:
-
.data: This section contains the initialized data such as window variables, player image path, and debug messages. -
.bss: This section includes variables which are not initialized yet. It includes window settings and player variables. -
.text: This is the code section.
-
NASM - The Netwide Assembler, NASM, is an 80x86 and x86-64 assembler designed for portability and modularity.
-
SDL2 - A cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.
-
SDL2_image - An SDL2 extension library which enables the loading of images in various formats.
- Lukas Bergström
The System V AMD64 calling convention is used in this game (find more details here)
To remove the object and executable files, run:
make cleanThis will remove the object files and the executable main.
Any suggestions for improvements are welcome.
