{"id":23509093,"url":"https://github.com/major0001/monty","last_synced_at":"2025-05-13T15:36:27.057Z","repository":{"id":129550662,"uuid":"533512126","full_name":"major0001/monty","owner":"major0001","description":"`Monty 0.98` is a scripting language that is first compiled into monty byte codes (Just like python). It relies on a unique stack, with specific instructions to manipulate it. **`monty`** is an interpreter built specially for the said Monty Bytecodes files.  ## More About the Monty language This is a language that contains specific instructions to manipulate data information (stacks or queues), where each instruction (*called opcode*) is sended per line. Files which contains Monty byte codes usually have the `.m` extension.","archived":false,"fork":false,"pushed_at":"2022-09-11T21:10:17.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-25T11:37:55.696Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/major0001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-06T21:46:27.000Z","updated_at":"2022-09-11T21:10:22.000Z","dependencies_parsed_at":"2023-05-26T17:15:31.686Z","dependency_job_id":null,"html_url":"https://github.com/major0001/monty","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major0001%2Fmonty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major0001%2Fmonty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major0001%2Fmonty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major0001%2Fmonty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/major0001","download_url":"https://codeload.github.com/major0001/monty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239188701,"owners_count":19597032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-25T11:37:39.703Z","updated_at":"2025-02-16T19:45:27.543Z","avatar_url":"https://github.com/major0001.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monty\n\n`Monty 0.98` is a scripting language that is first compiled into monty byte codes (Just like python). It relies on a unique stack, with specific instructions to manipulate it. **`monty`** is an interpreter built specially for the said Monty Bytecodes files.\n\n## More About the Monty language\nThis is a language that contains specific instructions to manipulate data information (stacks or queues), where each instruction (*called opcode*) is sended per line. Files which contains Monty byte codes usually have the `.m` extension.\n\nExample (`file.m`):\n```bash\n$ cat file.m\n# Pushing element to the stack\npush 0\npush 1\npush 2\n# Printing all elements\npall\npush 3\npush 4\npop\n# Rotating the stack to the bottom\nrotr\npall\nrotl\n# Setting FIFO\nqueue\npush 5\n# Setting LIFO\nstack\npush 5\n$\n```\n\n## Technologies\n* Interpreter was written with C language\n* C files are compiled using `gcc 4.8.4`\n* C files are written according to the C90 standard\n* Tested on Ubuntu 20.04 LTS\n\n## Usage\nTo compile all files:\n\n```bash\n$ gcc -Wall -Werror -Wextra -pedantic *.c -o monty\n$\n```\n\nThe **synopsis** of the interpreter is the following:\n\n```bash\n$ ./monty [filename]\n$\n```\n\nTo run the interpreter:\n\n```bash\n$ ./monty file.m\n2\n1\n0\n0\n3\n2\n1\n$\n```\n\n## Features\n### Opcodes\n`monty` executes the following opcodes:\n\n| Opcode | Description |\n| -------- | ----------- |\n| `push` | Pushes an element to the stack |\n| `pall` | Prints all the values on the stack |\n| `pint` | Prints the value at the top of the stack |\n| `pop` | Removes the top element of the stack |\n| `swap` | Swaps the top two elements of the stack |\n| `queue` | Sets the format of the data to a queue (FIFO) |\n| `stack` | Sets the format of the data to a stack (LIFO) |\n| `nop` | Doesn't do anything |\n| `add` | Adds the top two elements of the stack |\n| `sub` | Subtracts the top element of the stack from the second top element of the stack |\n| `mul` | Multiplies the second top element of the stack with the top element of the stack |\n| `div` | Divides the second top element of the stack by the top element of the stack |\n| `mod` | Computes the rest of the division of the second top element of the stack by the top element of the stack |\n| `pchar` | Prints the char at the top of the stack |\n| `pstr` | Prints the string starting at the top of the stack |\n| `rotl` | Rotates the stack to the top |\n| `rotr` | Rotates the stack to the bottom |\n\nComments, indicated with `#`, are not executed by the interpreter.\n\nWhen a **nonextistent opcode** is passed, the interpreter prints an error message and stops:\n\n```bash\n$ cat errorfile.m\npush 1\npint\npcx\n$ ./monty errorfile.m\n1\nL3: unknown instruction pcx\n```\n\n### Return value\nWhen there is no errors, `monty` returns `0`. Otherwise, returns `1`\n\n## Authors\n\u003cdetails\u003e\n    \u003csummary\u003eSuara Ayomide\u003c/summary\u003e\n    \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"https://www.github.com/aysuarex\"\u003eGithub\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"https://www.twitter.com/Aysuarex\"\u003eTwitter\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"mailto:aysuarex@gmail.com\"\u003ee-mail\u003c/a\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/details\u003e\n\u003cdetails\u003e\n    \u003csummary\u003eChukwuoma Chizoba\u003c/summary\u003e\n    \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"https://www.github.com/classychizzy\"\u003eGithub\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"https://www.twitter.com/Classy_chizzy\"\u003eTwitter\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"mailto:chizobachukwuoma@gmail.com\"\u003ee-mail\u003c/a\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmajor0001%2Fmonty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmajor0001%2Fmonty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmajor0001%2Fmonty/lists"}