{"id":35045767,"url":"https://github.com/nicmr/rustis100","last_synced_at":"2026-04-27T10:31:56.645Z","repository":{"id":41288773,"uuid":"195410637","full_name":"nicmr/rustis100","owner":"nicmr","description":"A TIS-100 emulator in Rust. TIS-100 is a fictive highly parallel computer architecture and instruciton set by Zachtronics.","archived":false,"fork":false,"pushed_at":"2019-07-29T20:30:58.000Z","size":62,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-10T19:18:40.827Z","etag":null,"topics":["assembly","emulator","pure-functional","rust","tis100","zachtronics"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/nicmr.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}},"created_at":"2019-07-05T13:04:39.000Z","updated_at":"2022-06-30T10:54:09.000Z","dependencies_parsed_at":"2022-09-07T10:22:21.749Z","dependency_job_id":null,"html_url":"https://github.com/nicmr/rustis100","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/nicmr/rustis100","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicmr%2Frustis100","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicmr%2Frustis100/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicmr%2Frustis100/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicmr%2Frustis100/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicmr","download_url":"https://codeload.github.com/nicmr/rustis100/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicmr%2Frustis100/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32333196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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":["assembly","emulator","pure-functional","rust","tis100","zachtronics"],"created_at":"2025-12-27T08:53:23.179Z","updated_at":"2026-04-27T10:31:56.611Z","avatar_url":"https://github.com/nicmr.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rustis-100\n\nA TIS-100 parser and emulator written in rust.\n\nTIS-100 is a fictive highly parallel computer architecture and instruction set by Zachtronics, LLC, featured in their identically titled game.\nIf this project sparks your interest, please [consider buying the game](https://www.gog.com/game/tis100).\n\n## Architecture and instruction set\n\nThe official architecture and instruction set are property of Zachtronics LLC.\n\nPlease have a look at the manual on their website:\n[TIS-100 Manual](http://www.zachtronics.com/images/TIS-100P%20Reference%20Manual.pdf)\n\n## Usage\n```zsh\ngit clone https://github.com/nicmr/rustis100\ncargo run\n```\n\n## Concept\n\nGenerally, the work rustis-100 does under the hood can be split into three different tasks\n\n1. Parse all instructions\n1. Emulating a TIS-100 and running the instructions\n\nLet's take a closer look at how we can perform these tasks more efficiently by parallelizing our code.\n\n\n## Parsing\n\nParsing TIS-100 instructions is pretty staightforward.\nThere's only 12 operators with a fixed number of parameters each.\n\n - Code of different nodes can be parsed in parellel without any issues, as instructions of one node never care about the context of other nodes.\n - Parsing all instructions in a single node parallel is a bit more difficult, as jump instructions `JEZ`, `JLZ`, `JGZ` need to know about the position of jumpmarks. \n We're adressing this by replacing them with `JRO` (jump by offset) instructions in an initial parsing step.\n\n\n## Emulator\n\nThe most simple way to emulate the TIS-100 is sequentially running the current instruction of all nodes.\nParallelizing the emulator is more difficult to achieve as the nodes all have to run at a single, synchronous clock rate.\n\nThere are however some tricks we can use to process at least some parts of the system in parallel.\n\n### 1.  Vector clock / Lamport timestamp\n**Description:**\nParallelize nodes that take no or minimal input at the beginning of their run but produce a lot of outputs.\nInstead of blocking and waiting for their generated output to be consumed, the result is stored together with a timestamp of their current tick.\nThree possible cases can occur when the consumer attempts to consume the oldest input from the channel:\n 1. tick in channel == tick of consumer: In this rare case the program can keep running without any adjustments\n 2. tick in channel \u003c tick of consumer: If the interval between the consumers internal time and the tick at which the message was stored is greater than the interval between the messages tick and the next messages tick, all following messages will need to have their timestamps adjusted to simulate a write-block on the unbuffered channel we're emulating.\n 3. tick in channel \u003e tick of consumer: The consumer will have to update its internal time sto the tick stored in the channel to simulate blocking.\n If the interval until the next entry in the channel is. Then the same interval check as in (2) will have to be performed.\n\n**`ANY:`** This feature has some complicated interactions with the `ANY` instrcution:\nA channel that can be read from with `ANY` may not have any information in it yet because the writing node has yet to produce said information.\nThe following algorithm can resolve the issue:\n\n```\nWHILE (not all channels have at least one available message)\n    DO (check channels)\nread the oldest message\nupdate own tick timestamp to emulate blocking\n```\nThis might, however, result in a deadlock - input on one of the inputs for `ANY` may depend on an output the node at hand still has to create.\nFurther research is required.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicmr%2Frustis100","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicmr%2Frustis100","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicmr%2Frustis100/lists"}