This is a simple interpreter for Monty ByteCodes files written in C.
Monty 0.98 is a scripting language that is first compiled into Monty byte codes, similar to Python. This project aims to create an interpreter for Monty ByteCodes files.
- GCC (GNU Compiler Collection)
Clone the repository:
git clone https://github.com/JosephChinonso/monty.git
cd monty
Compile the code:
gcc main.c check_arguments.c malloc_failed.c initialize_arguments.c get_stream.c -o monty
Run the Monty interpreter by providing the Monty ByteCode file as an argument:
./monty path/to/your/file.m
- push: Pushes an element onto the stack.
- pall: Prints all the values on the stack.
- pint: Prints the value at the top of the stack.
- pop: Removes the top element of the stack.
- swap: Swaps the top two elements of the stack.
- add: Adds the top two elements of the stack.
- nop: No operation; does nothing.
- main.c: Main entry point for the Monty interpreter.
- check_arguments.c: Functions for checking command-line arguments.
- malloc_failed.c: Error handling for malloc failures.
- initialize_arguments.c: Functions for initializing arguments.
- get_stream.c: Functions for getting the stream from the Monty ByteCode file.
- monty.h: Header file containing structures and function prototypes.
Feel free to contribute by opening issues or submitting pull requests.