{"id":21142104,"url":"https://github.com/limitedeternity/yanes","last_synced_at":"2026-05-12T16:04:02.807Z","repository":{"id":115597005,"uuid":"330452603","full_name":"limitedeternity/yanes","owner":"limitedeternity","description":"The most hardcore calculator you’ve ever seen","archived":false,"fork":false,"pushed_at":"2022-03-01T11:22:03.000Z","size":158,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T07:09:30.919Z","etag":null,"topics":["6502-processor","assembly","rust","simulator"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/limitedeternity.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}},"created_at":"2021-01-17T17:55:56.000Z","updated_at":"2024-05-28T17:06:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"deb51b2b-9011-458a-ae54-01c84cc334a6","html_url":"https://github.com/limitedeternity/yanes","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limitedeternity%2Fyanes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limitedeternity%2Fyanes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limitedeternity%2Fyanes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limitedeternity%2Fyanes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/limitedeternity","download_url":"https://codeload.github.com/limitedeternity/yanes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243581058,"owners_count":20314167,"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":["6502-processor","assembly","rust","simulator"],"created_at":"2024-11-20T07:42:18.161Z","updated_at":"2026-05-12T16:03:57.775Z","avatar_url":"https://github.com/limitedeternity.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yanes\n\n\u003e The most hardcore calculator you’ve ever seen\n\nYanes is a software-based device model (simulator), which implements 6502-like CPU instructions, memory address space, a screen and a keyboard.\n\n## Spec\n\n**OpCodes**: http://www.6502.org/tutorials/6502opcodes.html\n\n**Address Space Layout**:\n\n- CPU Data: **0x0000 – 0x00FF**\n  \n  - The latest keypress in form of ASCII code is stored at **0x00FF**.\n\n- Stack: **0x0100 – 0x01FF**\n\n- VGA Buffer: **0x0200 – 0x05FF**\n  \n  * Layout:\n    \n    ![image](https://user-images.githubusercontent.com/24318966/104934963-b4158e00-59bb-11eb-8add-fcc913b8bc83.png)\n  \n  * Color Codes:\n    \n    ![yanes](https://user-images.githubusercontent.com/24318966/104935109-e2936900-59bb-11eb-8bb3-b2754d017906.png)\n\n- Program Space: **0x8000 – 0xFFF0**\n  \n  - Therefore, max size is **0x7FF0** bytes.\n  - Programs are executable machine code sequences for this simulator. You can either write one manually using a hex editor of your choice or use an assembler to produce it.\n\n- Reset Vector: **0xFFFC**\n\n- IRQ Vector: **0xFFFE**\n  \n  - If you want to override `BRK` behavior, you can write an address of your custom procedure there. \n    In case you want to revert its default behavior (program termination), you just need to null the IRQ Vector.\n\n## Example\n\nLet’s look into the `example/` directory:\n\n![1](https://user-images.githubusercontent.com/24318966/105477350-cbea5c00-5cb2-11eb-82f3-553d049148be.png)\n\nThis program draws 0 or 1 depending on whether `0` or `1` was pressed on the keyboard. \nLet’s compile our example assembly script using my fork of [@jenra-uwu's asm6502](https://github.com/jenra-uwu/asm6502): `asm6502/target/release/asm6502 -o examples/draw_0_or_1.bin -d examples/draw_0_or_1.s`.\nAfter that we can run the compiled program using yanes: `target/release/yanes examples/draw_0_or_1.bin`.\n\n![loop](https://user-images.githubusercontent.com/24318966/105478172-e6710500-5cb3-11eb-9900-e1a466a9469f.png)\n\nWe see, that infinite loop works correctly. Now, if we press `0`:\n\n![0](https://user-images.githubusercontent.com/24318966/105478252-06082d80-5cb4-11eb-803c-dd8bcb281ffa.png)\n\nWe'll see a drawn zero. And if we press `1`:\n\n![1](https://user-images.githubusercontent.com/24318966/105478325-1a4c2a80-5cb4-11eb-9779-d2f64e723221.png)\n\nThe screen will be cleared and a drawn 1 will appear. To exit Yanes, press `ESC`. \n\n`ESC` key injects `BRK` instruction at the `PC` register position and, therefore, terminates the program. After that, a CPU dump will be printed into the `STDOUT` in form of state of all registers at the moment of program termination:\n\n![dump](https://user-images.githubusercontent.com/24318966/105478702-90e92800-5cb4-11eb-971f-8cbdb549c684.png)\n\n## Building\n\n1. Install the Rust toolchain using [rustup.rs](https://rustup.rs/).\n2. `git clone --recurse-submodules` this repo.\n3. Pull your favourite C/C++ compiler ([Windows](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019), [Linux](https://en.wikipedia.org/wiki/You_Know_What_to_Do), [MacOS](https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/macxcodecommandlinetools.html)).\n4. Run `cargo build --release` there and in `asm6502/` directory.\n\n## Meta\n\nVyacheslav Bespalov  – [Other projects](https://github.com/limitedeternity?tab=repositories)\n\nDistributed under the MIT license. See `LICENSE` for more information.\n\n[@limitedeternity](https://github.com/limitedeternity)\n\n## Contributing\n\n1. [Fork it](https://github.com/limitedeternity/yanes/fork)\n2. Commit your changes\n3. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimitedeternity%2Fyanes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimitedeternity%2Fyanes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimitedeternity%2Fyanes/lists"}