- Synopsis
- How Does It Work?
- File & Function Descriptions
- Installation, Compilation, Usage
- Environment
- Authors
This repository contains the source code for a Monty bytecode interpreter, a project developed as part of the Holberton School curriculum. The interpreter is written in C and is designed to execute Monty bytecode files.
The interpreter reads Monty bytecode files line by line, identifies the opcode in each line, and executes the corresponding function.
freedom.c
: Contains the functionfree_stack
which is used to free a doubly linked list.main.c
: The main file of the project. It contains themain
function which opens a Monty bytecode file, reads its instructions line by line, and executes them.monty.h
: The header file for the project. It contains all the function prototypes and the definitions of thestruct
types used in the project.opcodes_alpha.c
: Contains the implementation of various opcode functions such aspall_monty
,push_monty
,pint_monty
,nop_monty
, andpop_monty
.opcodes_bravo.c
: Contains the implementation of various opcode functions such asswap_monty
,add_monty
,sub_monty
,div_monty
, andmul_monty
.opcodes_charlie.c
: Contains the implementation of various opcode functions such asmod_monty
,pchar_monty
,pstr_monty
,rotl_monty
, androtr_monty
.theWay.c
: Contains the functionop_fun_res
which matches the opcode read from the bytecode file to the corresponding function and executes it.
free_stack
: Frees a doubly linked list.main
: Opens a Monty bytecode file, reads its instructions line by line, and executes them.op_fun_res
: Matches the opcode read from the bytecode file to the corresponding function and executes it.- Various opcode functions: Implement the functionality of the corresponding Monty opcodes.
To use the Monty bytecode interpreter, compile all the .c
files in the repository and run the resulting executable with the path to a Monty bytecode file as an argument.
git clone https://github.com/ZeroDayPoke/holbertonschool-monty.git
cd holbertonschool-monty
gcc -Wall -Werror -Wextra -pedantic *.c -o monty
./monty bytecode.m
- Language: C
- OS: Ubuntu 14.04 LTS
- Compiler: gcc 4.8.4
- Style Guidelines: Betty style
- Lindsey Lancaster - linszay
- Chris Stamper - ZeroDayPoke