Monty is an interpreter for a custom stack-based programming language. It reads Monty bytecode files containing commands and executes them.
Monty is a simple stack-based programming language interpreter. It reads Monty bytecode files, which contain a series of commands (opcodes) that dictate how the program should execute.
- Stack-based execution model
- Support for various stack manipulation and arithmetic operations
- Printing characters and strings
- Error handling for common issues like stack underflow, division by zero, etc.
###Opcode Reference
- push: Pushes an element onto the stack
- pop: Removes the top element of the stack
- add, sub, mul, div, mod: Arithmetic operations
- pall, pint, pchar, pstr: Printing operations
- swap, nop: Stack manipulation operations
- Clone the repository:
git clone https://github.com/DevBasem/monty.git
- Compile:
gcc -Wall -Werror -Wextra -pedantic -std=c89 *.c -o monty
- Run the program:
./monty <bytecodes>