Monty is a stack-based interpreter for Monty Bytecode files. It executes Monty bytecodes (.m files) and implements various operations on a stack.
This repository contains the source code for the Monty interpreter. The Monty interpreter is written in C and supports a set of operations on a stack, such as push, pop, add, sub, and more.
To compile and run the Monty interpreter, follow these steps:
-
Clone the repository:
git clone https://github.com/mugambi12/Monty.git
-
Change to the repository directory:
cd Monty
-
Compile the source code using the provided Makefile:
make
-
Run the Monty interpreter with a Monty bytecode file:
./monty path/to/bytecode.m
The Monty interpreter accepts Monty bytecode files (.m) as input. Each line in the bytecode file contains an operation to be performed on the stack.
Example Monty bytecode file (example.m):
push 1
push 2
push 3
pall
To execute the bytecode file, run the Monty interpreter with the file as an argument:
./monty example.m
Contributions to Monty are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.
Monty is released under the MIT License.
- Please make sure to replace
your-username
in the installation instructions with your actual GitHub username. You can customize the README.md file further to meet your specific needs and preferences.