Mirror of CollapseOS
Go to file
Clanmaster21 cca3157c66 addHL and subHL affect flags, and are smaller (#30)
* addHL and subHL affect flags, and are smaller

Most importantly, addHL and subHL now affect the flags as you would expect from a 16 bit addition/subtraction. This seems like it'd be preferred behaviour, however I realise any code relying on it not affecting flags would break. One byte saved in addHL, and two bytes saved in subHL. Due to the branching nature of the original code, it's difficult to compare speeds, subHL is either 1 or 6 cycles faster depending on branching, and addHL is between -1 and 3 cycles faster. If the chance of a carry is 50%, addHL is expected to be a cycle faster, but for a chance of carry below 25% (so a < 0x40) this will be up to a cycle slower.

* Update core.asm

* Reworked one use of addHL

By essentially inlining both addHL and cpHLDE, 100 cycles are saved, but due to the registers not needing preserving, a byte is saved too.

* Corrected spelling error in comment

* Reworked second use of addHL

43 cycles saved, and no more addHL in critical loops. No bytes saved or used.

* Fixed tabs and spacing, and made a comment clearer.

* Clearer comments

* Adopted push/pop notation
2019-10-17 16:45:27 -04:00
apps addHL and subHL affect flags, and are smaller (#30) 2019-10-17 16:45:27 -04:00
doc Fix mis-documentation 2019-10-04 13:52:14 -04:00
kernel addHL and subHL affect flags, and are smaller (#30) 2019-10-17 16:45:27 -04:00
recipes Fix misc. source comment typos 2019-10-09 11:12:08 -04:00
tools Update bootstrap binaries 2019-10-17 15:47:39 -04:00
.gitignore zasm emul: bring back kernel/user distinction 2019-05-19 12:57:59 -04:00
.gitmodules Add tools/emul 2019-05-09 12:58:41 -04:00
COPYING Re-license to GPLv3 2019-05-08 20:18:05 -04:00
README.md recipes/sms/kbd: PS/2 keyboard adapter for the SMS! 2019-07-20 12:42:55 -04:00

README.md

Collapse OS

Bootstrap post-collapse technology

Collapse OS is a z80 kernel and a collection of programs, tools and documentation that allows you to assemble an OS that, when completed, will be able to:

  1. Run on minimal and improvised machines.
  2. Interface through improvised means (serial, keyboard, display).
  3. Edit text files.
  4. Compile assembler source files for a wide range of MCUs and CPUs.
  5. Read and write from a wide range of storage devices.
  6. Replicate itself.

Additionally, the goal of this project is to be as self-contained as possible. With a copy of this project, a capable and creative person should be able to manage to build and install Collapse OS without external resources (i.e. internet) on a machine of her design, built from scavenged parts with low-tech tools.

Organisation of this repository

  • kernel: Pieces of code to be assembled by the user into a kernel.
  • apps: Pieces of code to be assembled into "userspace" application.
  • recipes: collection of recipes that assemble parts together on a specific machine.
  • doc: User guide for when you've successfully installed Collapse OS.
  • tools: Tools for working with Collapse OS from "modern" environments. Mostly development tools, but also contains emulated zasm, which is necessary to build Collapse OS from a non-Collapse OS machine.

Each folder has a README with more details.

Status

The project unfinished but is progressing well! See Collapse OS' website for more information.