{"id":15060233,"url":"https://github.com/s-mv/smvm","last_synced_at":"2025-08-18T16:32:03.152Z","repository":{"id":239315626,"uuid":"799130648","full_name":"s-mv/smvm","owner":"s-mv","description":"Register-based bytecode VM implementation.","archived":false,"fork":false,"pushed_at":"2025-06-26T18:38:05.000Z","size":102,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-26T19:36:53.216Z","etag":null,"topics":["assembler","bytecode-virtual-machine","c"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s-mv.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-11T09:05:04.000Z","updated_at":"2025-06-26T18:38:09.000Z","dependencies_parsed_at":"2024-05-11T13:44:31.750Z","dependency_job_id":"312ba8ce-93f7-4c67-bd4b-bc141acb7b24","html_url":"https://github.com/s-mv/smvm","commit_stats":null,"previous_names":["s-mv/smvm"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/s-mv/smvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-mv%2Fsmvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-mv%2Fsmvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-mv%2Fsmvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-mv%2Fsmvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s-mv","download_url":"https://codeload.github.com/s-mv/smvm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-mv%2Fsmvm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271026404,"owners_count":24687073,"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-08-18T02:00:08.743Z","response_time":89,"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","bytecode-virtual-machine","c"],"created_at":"2024-09-24T22:54:51.145Z","updated_at":"2025-08-18T16:32:03.127Z","avatar_url":"https://github.com/s-mv.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smvm - the smv virtual machine\n~A register based bytecode virtual machine implementation by smv.\n\n![(this is a screenshot)](./screenshots/examples-star.png)\n\nLightweight and fast, written under 1400 lines of code.\n\nCurrently the docs are in making (or being \"transported\" from past\nprojects) so for now there's only [BYTECODE](docs/BYTECODE.md) and\n[INSTRUCTIONSET](docs/INSTRUCTIONSET.md). Updates are major TODO.\n\nThis VM is primarily meant to be embedded into C. Practically nobody should be\nusing it barebones without something like a JIT compiler built on top of it.\nBut there's nothing stopping you from doing that. (evil laughter?)\n\nThis is mostly a personal project, something that can be embedded into\nlarger systems.\n\n---\n\n## Contents:\n- [smvm - the smv virtual machine](#smvm---the-smv-virtual-machine)\n  - [Contents:](#contents)\n  - [Usage](#usage)\n    - [Basic Usage](#basic-usage)\n    - [C Interoperability](#c-interoperability)\n  - [Build and Install](#build-and-install)\n\n---\n\nKnow more:\n1. [Instruction set](./INSTRUCTIONSET.md)\n2. [Bytecode](./BYTECODE.md)\n3. List of examples: [examples/](/examples/)\n\n---\n\n## Usage\nThe VM is meant to be embedded into C but it can be used as a standalone, to\nrun assembly as well as smvm bytecode.\n\n### Basic Usage\n\nTo use SMVM as a standalone VM:\n\n1. Build the VM:\n```bash\nmake dev\n```\n\n2. Run an assembly file:\n```bash\nmake run_asmv FILE=examples/test.asmv\n# or directly:\n./out/smvm examples/test.asmv\n```\n\n3. Run tests:\n```bash\nmake test\n```\n\n### C Interoperability\n\nTo embed SMVM in your C program:\n\n1. Install the library:\n```bash\nmake install\n```\n\n2. Include the headers in your C file:\n```c\n#include \u003csmvm/smvm.h\u003e\n```\n\n3. Basic usage example:\n```c\n#include \u003csmvm/smvm.h\u003e\n\nint main() {\n  smvm vm;\n\n  smvm_init(\u0026vm);\n\n  char *code =\n      \"puts \\\"hello, word! here's my lucky number: \\\"\"\n      \"mov ra 42\\n\"\n      \"puti ra\\n\"\n      \"halt\";\n\n  smvm_assemble(\u0026vm, code);\n  smvm_execute(\u0026vm);\n  smvm_free(\u0026vm);\n\n  return 0;\n}\n```\n\n4. Compile your program with:\n```bash\ncc your_program.c -lsmvm\n```\n\n## Build and Install\n\n1. Build the development version:\n```bash\nmake dev\n```\n\n2. Install the library system-wide:\n```bash\nmake install\n```\n\n3. Build libraries only:\n```bash\nmake out/libsmvm.a    # Static library\nmake out/libsmvm.so   # Shared library\n```\n\nFor more build options:\n```bash\nmake help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs-mv%2Fsmvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs-mv%2Fsmvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs-mv%2Fsmvm/lists"}