{"id":20671543,"url":"https://github.com/hopson97/hop-virtual-machine","last_synced_at":"2025-07-22T16:02:12.997Z","repository":{"id":145668748,"uuid":"61403779","full_name":"Hopson97/HOP-Virtual-Machine","owner":"Hopson97","description":"A simple virtual machine/ interpretted langauge/ assembler","archived":false,"fork":false,"pushed_at":"2016-09-02T22:15:52.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T13:48:30.103Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/Hopson97.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":"2016-06-17T21:39:19.000Z","updated_at":"2022-06-07T14:04:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"ffdf8c97-94df-49b2-83ec-8994a5aa671f","html_url":"https://github.com/Hopson97/HOP-Virtual-Machine","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/Hopson97%2FHOP-Virtual-Machine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopson97%2FHOP-Virtual-Machine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopson97%2FHOP-Virtual-Machine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopson97%2FHOP-Virtual-Machine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hopson97","download_url":"https://codeload.github.com/Hopson97/HOP-Virtual-Machine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242890688,"owners_count":20202206,"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-11-16T20:27:59.768Z","updated_at":"2025-03-10T17:25:39.821Z","avatar_url":"https://github.com/Hopson97.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HOP-Virtual-Machine\n\nThis is a 2 part program, a \"assembler\" and \"virtual CPU\" to interpret the assembled instructions.\n\nSo far the instructions for it :\n\n| Value | Instruction | Notes                             | DOES                                                             |\n|-------|-------------|-----------------------------------|------------------------------------------------------------------|\n| 0     | PUSH X      | Replace \"X\" with an integer value | Pushes \"X\" onto the top of the stack                             |\n| 1     | POP         |                                   | Removes the value from the top of the stack                      |\n| 2     | ADD         |                                   | Adds top two values of the stack together, adds new value on top |\n| 3     | SUB         |                                   | Adds top two values of the stack together,                       |\n| 4     | PRINT       |                                   | Adds new value on top                                            |\n| 5     | JUMP        | Requires a label to jump to       | Jumps to a \"label\" in the program                                |\n| 6     | JIE         | Requires a label to jump to       | Jumps to a \"label\" in the program, if the top of stack is equal to next num                               |\n| 7     | JIN         | Requires a label to jump to       | Jumps to a \"label\" in the program , if the top of stack is not equal to next num                               |\n| 8     | JIL         | Requires a label to jump to       | Jumps to a \"label\" in the program, if the top of stack is less than  next num                               |\n| 9     | JIG         | Requires a label to jump to       | Jumps to a \"label\" in the program, if the top of stack is greater than next num                               |\n| 10    | EXIT        |                                   | Exits the program                                                |\n\n\nAs seen in the instruction list, you can also add labels. Every .hop needs a \"main:\" label as this marks the entry point of the program.\n\nYou can add labels wherever. However, you can only \"JUMP\" to the ones defined earlier in the program so far.\n\neg:\n\n_____________\n```\nSomeSection:\n  PUSH 8\n  PRINT\n  EXIT\n  \nSomeLabel:\n  PUSH 7\n  PUSH 3\n  ADD\n  PRINT\n  JIE 10 someSection\n  \nmain:\n  PUSH 5\n  PUSH 3\n  SUB\n  JIL 3 SomeLabel\n  PRINT\n  JUMP SomeLabel\n  ```\n  _________________\n  \nPrints out:\n\n  2\n\n  \n  \n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhopson97%2Fhop-virtual-machine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhopson97%2Fhop-virtual-machine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhopson97%2Fhop-virtual-machine/lists"}