6502 attempt number 2, this time with memory safety
By default, the kernel is loaded from code/bin/kernel
, and the file code/bin/example2
is executed.
To compile the kernel and executable, you need to have cc65
installed. Running make all
in the code folder will
generate the two files.
The kernel really does not do much, it has some test subroutines, and a subroutine that handles reading of characters from the keyboard. Hopefully I will be able to turn that into an interrupt in the future.
Example2 shows you what letter you last typed or released, so holding z, then pressing x and then releasing z will make z appear, then get replaced by x, which gets replaced by z again.
By running make bin/example
you can make the other example, which is a very flashy
"Hello, World!" line.
There is very little documentation on how the program works, but I'll add that in the future, maybe, probably?
The processor "microcode", which in the real deal would just be on the chip itself, is generated by the codegen
subproject. The way it works is essentially a rust version of
floooh's chips code generator,
which itself is written in rust as well.
- Thanks kbd-project for the koi8-14.psf file!
- Thanks Masswerk for very good documentation on all instructions: https://www.masswerk.at/6502/6502_instruction_set.html (I've used that site quite a lot)