{"id":16665393,"url":"https://github.com/larsbrinkhoff/nybbleforth","last_synced_at":"2025-06-17T08:35:14.743Z","repository":{"id":147602292,"uuid":"90944413","full_name":"larsbrinkhoff/nybbleForth","owner":"larsbrinkhoff","description":"Stack machine with 4-bit instructions","archived":false,"fork":false,"pushed_at":"2017-12-14T09:32:51.000Z","size":33,"stargazers_count":74,"open_issues_count":5,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-03T22:51:12.155Z","etag":null,"topics":["assembler","cross-compiler","forth","fpga","simulator","stack-machine","verilog","virtual-machine"],"latest_commit_sha":null,"homepage":"","language":"Forth","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/larsbrinkhoff.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":"2017-05-11T06:17:20.000Z","updated_at":"2025-02-17T20:45:46.000Z","dependencies_parsed_at":"2023-05-31T18:16:05.534Z","dependency_job_id":null,"html_url":"https://github.com/larsbrinkhoff/nybbleForth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/larsbrinkhoff/nybbleForth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsbrinkhoff%2FnybbleForth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsbrinkhoff%2FnybbleForth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsbrinkhoff%2FnybbleForth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsbrinkhoff%2FnybbleForth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/larsbrinkhoff","download_url":"https://codeload.github.com/larsbrinkhoff/nybbleForth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsbrinkhoff%2FnybbleForth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260322970,"owners_count":22991922,"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":["assembler","cross-compiler","forth","fpga","simulator","stack-machine","verilog","virtual-machine"],"created_at":"2024-10-12T11:06:56.778Z","updated_at":"2025-06-17T08:35:14.716Z","avatar_url":"https://github.com/larsbrinkhoff.png","language":"Forth","readme":"[![Build Status](https://travis-ci.org/larsbrinkhoff/nybbleForth.svg?branch=master)](https://travis-ci.org/larsbrinkhoff/nybbleForth)\n\nStack machine with 4-bit instructions.\n\nThere's a simulator, an assembler, a cross compiler, and a Forth\nkernel, all written in Forth.  There's a hardware design written in\nVerilog.\n\nInternal registers\n\n| Name | Size | Function\n| ---- | ---- | ---\n| P    |  16  | Program pointer\n| I    |   8  | Instruction\n| S    |   4  | Data stack pointer\n| R    |   4  | Return stack pointer\n\nThe machine has 11 instructions, encoded two per byte.  Some have an 8\nor 16-bit operand.  The encoding is carefully arranged to reduce logic\nin a hardware implementation.\n\n| Code | Name | Size | Operation\n| ---- | ---- | ---- | ---------\n|  0   | noop |    4 | No operation\n|  1   | @    |    4 | Load word from memory\n|  2   | call | 4+16 | Push P to return stack, fetch a word and jump\n|  3   | exit |    4 | Pop P from return stack\n|  4   | (literal) | 4+16 | Fetch a word and push to stack\n|  7   | r\u003e   |    4 | Pop return stack and push to data stack\n|  8   | +    |    4 | Add top two items on data stack\n|  9   | nand |    4 | Inverted conjunction of the two top items on data stack\n| 10   | \u003er   |    4 | Pop data stack and push to return stack\n| 11   | 0branch | 4+8 | Fetch a byte and add to P if popped data stack is zero\n| 12   | !    |    4 | Store word into memory\n\nThe word size is 16 bits, but this is easy to reconfigure.\n\nJump targets are always byte aligned, which makes it necessary to\nsometimes pad instructions with noop.  The table lists unpadded sizes.\n\nInstructions are always fetched 8 bits at a time.  Operands are\nfetched after this.  If a jump instruction is executed first in an\n8-bit word, it's undefined whether the second instruction is executed\nor not.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarsbrinkhoff%2Fnybbleforth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flarsbrinkhoff%2Fnybbleforth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarsbrinkhoff%2Fnybbleforth/lists"}