{"id":15634754,"url":"https://github.com/parrt/simple-virtual-machine-c","last_synced_at":"2025-04-15T11:53:44.158Z","repository":{"id":30411693,"uuid":"33964548","full_name":"parrt/simple-virtual-machine-C","owner":"parrt","description":"Same as simple-virtual-machine but in C","archived":false,"fork":false,"pushed_at":"2016-03-31T17:52:44.000Z","size":11,"stargazers_count":148,"open_issues_count":0,"forks_count":40,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-28T19:45:11.919Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parrt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-15T00:41:55.000Z","updated_at":"2025-03-18T18:09:14.000Z","dependencies_parsed_at":"2022-09-08T10:40:36.663Z","dependency_job_id":null,"html_url":"https://github.com/parrt/simple-virtual-machine-C","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/parrt%2Fsimple-virtual-machine-C","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parrt%2Fsimple-virtual-machine-C/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parrt%2Fsimple-virtual-machine-C/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parrt%2Fsimple-virtual-machine-C/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parrt","download_url":"https://codeload.github.com/parrt/simple-virtual-machine-C/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249067759,"owners_count":21207395,"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-10-03T10:56:22.774Z","updated_at":"2025-04-15T11:53:44.123Z","avatar_url":"https://github.com/parrt.png","language":"C","readme":"An extension of the [(split-stack branch) simple VM](https://github.com/parrt/simple-virtual-machine/tree/split-stack) I did that [codyebberson converted to C](https://github.com/codyebberson/vm). I added CALL/RET and make VM a `struct`.  Added more tests.\n\nBranches:\n\n* [master](https://github.com/parrt/simple-virtual-machine-C/tree/master). This is a straight C port of the [split-stack branch from Java](https://github.com/parrt/simple-virtual-machine/tree/split-stack).\n* [computed-goto](https://github.com/parrt/simple-virtual-machine-C/tree/computed-goto). A version of the `exec()` method that uses computed `goto`s to directly jump from instruction to instruction like a threaded interpreter, thus, avoiding a `while` loop and `switch` for the *decode* part of the *fetch-decode-execute* cycle. Instead of:\n```C\nwhile ( more opcodes ) {\n  switch ( code[ip] ) {\n  ...\n```\nwe use `goto *dispatch[code[ip]]` to instantly jump to the code that interprets the next opcode via an appropriate label within the `exec` method.\n\nBuild and run:\n\n```bash\n$ cc -o vm src/*.c\n$ vm\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparrt%2Fsimple-virtual-machine-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparrt%2Fsimple-virtual-machine-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparrt%2Fsimple-virtual-machine-c/lists"}