{"id":15433361,"url":"https://github.com/tarekwiz/smallvm","last_synced_at":"2025-10-05T15:43:44.378Z","repository":{"id":67426207,"uuid":"269143586","full_name":"tarekwiz/smallvm","owner":"tarekwiz","description":"A very small and minimal virtual machine written in rust.","archived":false,"fork":false,"pushed_at":"2020-06-06T07:08:10.000Z","size":14,"stargazers_count":108,"open_issues_count":10,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T21:40:41.589Z","etag":null,"topics":["rust","rust-lang","virtual-machine"],"latest_commit_sha":null,"homepage":null,"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/tarekwiz.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":"2020-06-03T16:49:56.000Z","updated_at":"2025-03-27T04:25:21.000Z","dependencies_parsed_at":"2023-03-09T11:15:50.228Z","dependency_job_id":null,"html_url":"https://github.com/tarekwiz/smallvm","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"8acd667c3deddaab47e98287c9fbd75dee4d0fcd"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tarekwiz/smallvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarekwiz%2Fsmallvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarekwiz%2Fsmallvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarekwiz%2Fsmallvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarekwiz%2Fsmallvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarekwiz","download_url":"https://codeload.github.com/tarekwiz/smallvm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarekwiz%2Fsmallvm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278477818,"owners_count":25993540,"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-10-05T02:00:06.059Z","response_time":54,"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":["rust","rust-lang","virtual-machine"],"created_at":"2024-10-01T18:33:43.474Z","updated_at":"2025-10-05T15:43:44.360Z","avatar_url":"https://github.com/tarekwiz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smallvm\nA very minimal virtual machine written in rust.\n### The virtual machine has:\n-   8 Registers\n-   A stack\n-   A heap\n-   Data types include: u8, i8, u16, i16, u32, i32, u64, i64, f32, f64\n\n## Instruction Set\n\n### Root assembly instructions\n\n| Instruction | Left Input | Right Input | Operation |\n| ----------- | ---------- | ----------- | --------- |\n| NOP         |            |             | No Operation |\n| MOV         | Register   | Variable    | Move variable to register |\n| MOVR        | Register   | Register    | Move register contents to another register |\n| JMP         | Register   |             | Jump to memory location |\n| JE          | Register   |             | Jump if equal |\n| JNE         | Register   |             | Jump not equal |\n| JG          | Register   |             | Jump if greater |\n| JL          | Register   |             | Jump if less |\n| CMP         | Register   | Register    | Compare two registers |\n| ADD         | Register   | Register    | Add 2 registers, push result to stack |\n| SUB         | Register   | Register    | Subtract 2 registers, push result to stack |\n| MUL         | Register   | Register    | Multiply 2 registers, push result to stack |\n| DIV         | Register   | Register    | Divide 2 registers, push result to stack |\n| AND         | Register   | Register    | Bitwise AND on 2 registers, push result to stack |\n| OR          | Register   | Register    | Bitwise OR on 2 registers, push result to stack |\n| XOR         | Register   | Register    | Bitwise Exclusive OR on 2 registers, push result to stack |\n| SHR         | Register   | Variable    | Shift register to the right by Variable |\n| SHL         | Register   | Variable    | Shift register to the left by Variable |\n| VPUSH       | Variable   |             | Push variable contents on to stack |\n| VPUSHR      | Register   |             | Push register contents on to stack |\n| VPOP        | Variable   |             | Pops variable from stack to register |\n| CALL        | Register   |             | Calls function at address in the register |\n| RET         |            |             | Return from routine |\n| HALT        |            |             | Halt CPU/Exit |\n| VSTORE      | Address    | Variable    | Store var into VMHeap at specific address from stack |\n| VLOAD       | Address    |             | Load var from VMHeap and push value to stack |\n| VSTORER     | Address    | Register    | Store var in VMHeap from register contents |\n| VLOADR      | Register   | Address     | Loads a variable from VMHeap to register |\n\n### Debugging assembly instructions\n\n| Instruction | Left Input | Right Input | Operation |\n| ----------- | ---------- | ----------- | --------- |\n| PRINTR      | Register   |             | Print contents of register |\n| PRINTV      | Address    |             | Print contents of variable at address |\n\n## Example Program:\n\n```\n1 0 0 10    MOV(R0, 10)  \n1 1 0 8     MOV(R1, 8)  \n1 2 0 22    MOV(R2, 23) Location to jump to if R0 is greater than R1  \n1 3 0 25    MOV(R3, 25) Location to jump to otherwise  \n6 0 1       CMP(R0, R1)  \n23 2        JG(R2) Jump if R0 is greater than R1  \n3 3         JMP(R3)  \n7 0         PRINTR(R0)  \n22          HALT()  \n7 1         PRINTR(R1)  \n22          HALT()  \n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarekwiz%2Fsmallvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarekwiz%2Fsmallvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarekwiz%2Fsmallvm/lists"}