{"id":29861017,"url":"https://github.com/xlatbx59/interpreter-poc","last_synced_at":"2026-04-19T06:48:50.355Z","repository":{"id":306121289,"uuid":"1025082018","full_name":"xlatbx59/Interpreter-Poc","owner":"xlatbx59","description":"Stack based interpreter","archived":false,"fork":false,"pushed_at":"2025-07-23T17:38:29.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-23T20:32:23.742Z","etag":null,"topics":["assembler","interpreter","stack-based"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/xlatbx59.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,"zenodo":null}},"created_at":"2025-07-23T17:34:31.000Z","updated_at":"2025-07-23T18:02:59.000Z","dependencies_parsed_at":"2025-07-23T20:56:09.470Z","dependency_job_id":null,"html_url":"https://github.com/xlatbx59/Interpreter-Poc","commit_stats":null,"previous_names":["xlatbx59/interpreter-poc"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/xlatbx59/Interpreter-Poc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlatbx59%2FInterpreter-Poc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlatbx59%2FInterpreter-Poc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlatbx59%2FInterpreter-Poc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlatbx59%2FInterpreter-Poc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xlatbx59","download_url":"https://codeload.github.com/xlatbx59/Interpreter-Poc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlatbx59%2FInterpreter-Poc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267808215,"owners_count":24147388,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"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":["assembler","interpreter","stack-based"],"created_at":"2025-07-30T04:10:08.244Z","updated_at":"2026-04-19T06:48:50.330Z","avatar_url":"https://github.com/xlatbx59.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Interpreter POC\n\nThis is a poc of an stack based interpreter a bit like java with a custom. The assembler can take source files as input and will output a byc file as it's output.\n\n## Description\n\nThis is a 64bit stack machine, still figuring out if it'll be Risc or Cisc.\n\n## Assembler\n\nThe syntax to write for this assembler is fairly simple(lazy), whitespaces are ignore, comments too:\n\n```\n;Don't try executing this code, I'm just showing off the syntax\nstart: \t\t;Labels on single lines like this have to finish with a colon\n\n\tpush 0x59\t;supports hexadecimal\n    push 932\t;supports decimal\n    add\n    bz end\t\t\n    dup\n    bnz start\nend ret\t\t;Labels preceding an instruction this don't need a colon\n```\n\n## Virtual Machine\n\n### Usage\n- \"-ra\" switch is to define the size of the return address stack(as to be decimal)\n- \"-stk\" switch is to define the size of the general stack(as to be decimal)\nExample: \"./vm -ra 38 -stk 40 \u003cpath to bytecode\u003e\"\n\n### Code\n\nSelf explanatory, executable bytecode resides there\n\n### Stacks\n\n- Data stack: this stack is used for data manipulation\n- Return address stack: this stack saves the return addresses\n\n### Instructions\n\n9 bytes instructions. Only 23 supported for the moment ('i' means there's an immediate):\n\n#### Other\n- Syscall: currently unimplemented\n- Vmentry: exits the vm\n\n#### Stack operations\n- Push: push an immediate on the stack\n- Pop: pops a value off the stack\n- Ldi: loads i variable on the top of the stack\n- Sti: stores value on the top of the stack to i variable\n- Dup: duplicates the value on top of the stack\n\n#### Arithmetic\n- Add: adds two values on top of the stack\n- Sub: subs two values on top of the stack\n- Addi: adds the value on top of the stack with the operand\n- Subi: subs the value on top of the stack with the operand\n- Mul: mul two values on top of the stack\n- Muli: multiply the value on top of the stack with the operand\n\n#### Logical\n- Xor: xors two values on top of the stack\n- Or: ors two values on top of the stack\n- And: ands two values on top of the stack\n- Not: nots the value on top of the stack\n- Shl: shifts the value on top of the stack by the second value on top of the stack to the left\n- Shr: shifts the value on top of the stack by the second value on top of the stack to the right\n\n#### Branch\n- Ret: return to the return address\n- BL: branch and links\n- Bz: subs the two values on top of the stack and branch if zero branch, the offset as to be specified\n- Bnz: subs the two values on top of the stack and branch if not zero, the offset as to be specified\n\n### Registers\n\nThere are a few registers, they're not general purpose they can not be used for calculation or whatever\n\n- Sp: the stack pointer that keeps track of the top of the stack\n- Bp: the base register that keeps track of the base of a stack frame for each functions\n- Pc: program counter, it points to the executed instruction\n- Ra: just like the Sp but for the stack for the return addresses\n\n\u003e ## Issues\n\u003e No proper error handling, if you write bad written code the vm might segfault or whatever, except all kind of exceptions\n\n## Advantages\n- :3\n\n## Disadvantages\n- Size: please do not talk to me about the size of the bytecode","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxlatbx59%2Finterpreter-poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxlatbx59%2Finterpreter-poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxlatbx59%2Finterpreter-poc/lists"}