{"id":15517302,"url":"https://github.com/skx/z80-examples","last_synced_at":"2025-04-23T04:18:41.148Z","repository":{"id":150430607,"uuid":"197622064","full_name":"skx/z80-examples","owner":"skx","description":"Z80 assembly-language programs.","archived":false,"fork":false,"pushed_at":"2024-12-22T16:20:36.000Z","size":16,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T04:18:36.763Z","etag":null,"topics":["assembly","assembly-language-programming","assembly-z80","z80"],"latest_commit_sha":null,"homepage":"","language":"Makefile","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/skx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":"skx","custom":"https://steve.fi/donate/"}},"created_at":"2019-07-18T16:29:04.000Z","updated_at":"2025-01-30T19:44:30.000Z","dependencies_parsed_at":"2025-04-17T08:14:52.484Z","dependency_job_id":null,"html_url":"https://github.com/skx/z80-examples","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/skx%2Fz80-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skx%2Fz80-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skx%2Fz80-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skx%2Fz80-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skx","download_url":"https://codeload.github.com/skx/z80-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250366715,"owners_count":21418772,"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":["assembly","assembly-language-programming","assembly-z80","z80"],"created_at":"2024-10-02T10:12:25.694Z","updated_at":"2025-04-23T04:18:41.131Z","avatar_url":"https://github.com/skx.png","language":"Makefile","funding_links":["https://github.com/sponsors/skx","https://steve.fi/donate/"],"categories":[],"sub_categories":[],"readme":"# Z80 Examples\n\nThis repository contains example code for the Z80 processor, written in assembly language.  This is where I'll post things as I experiment.\n\nThe code should be standalone, but I assume that there is the ability to output a single byte to the serial-console, or STDOUT via:\n\n    ld a, '3'\n    out (1), a\n\nSimilarly I assume reading a single character from a serial-console, or STDIN, is possible via:\n\n    in a, (1)\n\nThis is true of the [Z80 emulator](https://github.com/skx/z80emulater/) I'm using, as well as the [physical machine I intend to build](https://blog.steve.fi/tags/z80/).\n\n\n## 00.  See Also\n\nIf you'd rather see something _complete_ then you should check out this repository:\n\n* [The lighthouse of doom](https://github.com/skx/lighthouse-of-doom)\n\nThat contains a complete (simple!) text-based adventure-game written in Z80 assembly, which will work on any ZX Spectrum emulator, and can also run on CP/M systems (again under emulation if you don't have any retro-hardware).\n\n\n## 01.  RAM Increment\n\nThe simplest example is the first, which increments a single byte of RAM endlessly.  If you have an emulator that lets you dump RAM after every instruction, or physical hardware upon which you can do the same this should prove your code is working:\n\n* [ram-increment.z80](ram-increment.z80)\n\n\n## 02. String Output\n\nOutputing a string, held inline.  Simple test of loops:\n\n* [string-output.z80](string-output.z80)\n\n\n## 03. Number Output\n\nThis example is similar to the previous one, but instead outputs the contents of the HL register-pair, as a four-digit hexadecimal number.\n\ni.e. If you assume this `ld hl, 0x123F`, then you should see the output \"0x123F\" generated, which proves a number a has been converted to an ASCII-string, and output correctly.\n\n* [number-output.z80](number-output.z80)\n\n\n## 04. Simple Monitor\n\nThis is the most complex/complete program in the repository, and it is a \"monitor program\" which allows you to interactively use your Z80 processor.  There are a couple of builtin commands for dumping ram, inputing data, and calling functions.\n\nEach command is invoked via a letter.  For example to (D)ump the 16 bytes of RAM at 0x1000 run:\n\n```\n\u003e D1000\n0x1000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n\u003e D\n0x1010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n```\n\nTo (I)nput a simple routine:\n\n```\n\u003e I1000 3E 68 D3 01 3E 65 D3 01 3E 6C D3 01 3E 6C D3 01\n\u003e I 3E 6F D3 01 3E 21 D3 01 3E 0A D3 01 C9\n```\n\n(Here you see that the input-address is optional in the second line, bytes are just appended to the value previously set.)\n\nFinally you may (c)all the routine you've just loaded:\n\n```\n\u003e C1000\nhello!\n```\n\nSteve\n--\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskx%2Fz80-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskx%2Fz80-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskx%2Fz80-examples/lists"}