{"id":22310837,"url":"https://github.com/azarattum/simplecomputer","last_synced_at":"2025-07-11T16:17:14.067Z","repository":{"id":116104078,"uuid":"361179924","full_name":"Azarattum/SimpleComputer","owner":"Azarattum","description":"A simple computer emulator.","archived":false,"fork":false,"pushed_at":"2021-04-24T14:20:34.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T06:03:39.138Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Azarattum.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":"2021-04-24T14:14:55.000Z","updated_at":"2023-08-22T14:56:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"135df203-fc25-4388-a60d-8a5b9496d7eb","html_url":"https://github.com/Azarattum/SimpleComputer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Azarattum/SimpleComputer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azarattum%2FSimpleComputer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azarattum%2FSimpleComputer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azarattum%2FSimpleComputer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azarattum%2FSimpleComputer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azarattum","download_url":"https://codeload.github.com/Azarattum/SimpleComputer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azarattum%2FSimpleComputer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264851356,"owners_count":23673235,"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-12-03T21:16:17.109Z","updated_at":"2025-07-11T16:17:14.049Z","avatar_url":"https://github.com/Azarattum.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Computer\nA simple computer emulator.\n\n## Features\n  - TUI with memory and CPU view\n  - Interactive memory editing\n  - Step by step evaluation\n  - Simple assembly support\n  - Compilation from simple basic to simple assembly\n\n## Installation\nTo compile the program\n```sh\ngit clone https://github.com/Azarattum/SimpleComputer\ncd SimpleComputer\nmake release\n```\nTo compile all the example programs\n```sh\nmake programs\n```\n\n## Usage\nRun the emulator\n```sh\nsc\n```\n\nRun a compiled binary\n```sh\nsc program.bin\n```\n\nRun an assembly file\n```sh\nsc -a program.asm\n```\n\nCompile a simple basic to an assembly file\n```sh\nsc -b program.bas program.asm\n```\n\n## TUI\nWhen running in terminal the program looks like:\n```\n╔══════════════════════════════════Memory═════════════════════════════════╗ ╔══════════════CPU═════════════╗\n║ +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 ║ ║ Accumulator: 0000            ║\n║ +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 ║ ╠══════════════════════════════╣\n║ +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 ║ ║ Program Counter: 00          ║\n║ +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 ║ ╠══════════════════════════════╣\n║ +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 ║ ║ Executed: NOOP on 00         ║\n║ +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 ║ ╠══════════════════════════════╣\n║ +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 ║ ║ Flags:                       ║\n╚═════════════════════════════════════════════════════════════════════════╝ ╚══════════════════════════════╝\n╔═════════════════════════════════════╗╔═══════════I/O═══════════╗╔══════════════════Help══════════════════╗\n║                                     ║║                         ║║ q/quit                 s/save \u003cname\u003e   ║\n║         ▒▒▒▒▒  ▒▒▒▒▒  ▒▒▒▒▒  ▒▒▒▒▒  ║║                         ║║ i/counter \u003cval\u003e        l/load \u003cname\u003e   ║\n║    ▒    ▒   ▒  ▒   ▒  ▒   ▒  ▒   ▒  ║║                         ║║ n/next                 e/execute       ║\n║  ▒▒▒▒▒  ▒   ▒  ▒   ▒  ▒   ▒  ▒   ▒  ║║                         ║║ p/prev                 t/step          ║\n║    ▒    ▒   ▒  ▒   ▒  ▒   ▒  ▒   ▒  ║║                         ║║ c/opcode \u003cval\u003e         r/reset         ║\n║         ▒▒▒▒▒  ▒▒▒▒▒  ▒▒▒▒▒  ▒▒▒▒▒  ║║                         ║║ o/operand \u003cval\u003e        d/data \u003cval\u003e    ║\n║                                     ║║                         ║║ a/accumulator \u003cval\u003e    k/kill          ║\n╚═════════════════════════════════════╝╚═════════════════════════╝╚════════════════════════════════════════╝\n\u003e \n```\n\n## Supported Opcodes\n*The code numbers are given in hexadecimal.*\n\n| Operation | Code | Descrition                                                  |\n| --------- | ---- | ----------------------------------------------------------- |\n| READ      | 10   | Save input value to an address                              |\n| WRITE     | 11   | Print from an address                                       |\n| LOAD      | 20   | Load to the accumulator from an address                     |\n| STORE     | 21   | Save accumulator value to an address                        |\n| ADD       | 30   | Add to the accumulator from an address                      |\n| SUB       | 31   | Subtract from the accumulator an address value              |\n| DIVIDE    | 32   | Devide the accumulator by an address value                  |\n| MUL       | 33   | Multiply the accumulator by an address value                |\n| JUMP      | 40   | Move execution to an address                                |\n| JNEG      | 41   | Move execution to an address (when accumulator is negative) |\n| JZ        | 42   | Move execution to an address (when accumulator is zero)     |\n| HALT      | 43   | Stop the program execution                                  |\n| NEG       | 64   | Load to the accumulator inverted value from an address      |\n\n## Simple Basic\nThe compiler supports simple basic syntax. The supported operators are: REM, INPUT, PRINT, GOTO, IF, LET, END.\n\nAn example code:\n```bas\n10 REM I am a comment\n20 INPUT A\n30 INPUT B\n40 LET C = (A - B) * 2\n50 IF C \u003c 0 GOTO 20\n60 PRINT C\n70 END\n```\n\nFor more examples check out [*programs* directory](https://github.com/Azarattum/SimpleComputer/tree/main/programs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazarattum%2Fsimplecomputer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazarattum%2Fsimplecomputer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazarattum%2Fsimplecomputer/lists"}