{"id":23980517,"url":"https://github.com/polymathuniversata/monty","last_synced_at":"2026-07-02T03:31:54.175Z","repository":{"id":190627434,"uuid":"683036316","full_name":"polymathuniversata/monty","owner":"polymathuniversata","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-25T12:58:40.000Z","size":9,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-20T15:41:44.084Z","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/polymathuniversata.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}},"created_at":"2023-08-25T12:52:56.000Z","updated_at":"2023-08-25T12:58:36.000Z","dependencies_parsed_at":"2023-08-25T17:14:26.150Z","dependency_job_id":null,"html_url":"https://github.com/polymathuniversata/monty","commit_stats":null,"previous_names":["polymathuniversata/monty"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/polymathuniversata/monty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polymathuniversata%2Fmonty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polymathuniversata%2Fmonty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polymathuniversata%2Fmonty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polymathuniversata%2Fmonty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polymathuniversata","download_url":"https://codeload.github.com/polymathuniversata/monty/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polymathuniversata%2Fmonty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35032145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-01-07T10:15:33.147Z","updated_at":"2026-07-02T03:31:54.152Z","avatar_url":"https://github.com/polymathuniversata.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monty\n\n`monty` is an interpreter of Monty ByteCodes files, which is a scripting language just like Python.\n\n## 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 14.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## Author\n* Polymath Universata: [Twitter](https://twitter.com/PolymathUnivers) - [GitHub](https://github.com/polymathuniversata)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymathuniversata%2Fmonty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolymathuniversata%2Fmonty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymathuniversata%2Fmonty/lists"}