πΏ 6502
MOS 6502 CPU emulator made for fun.
Current status
The Virtual Machine
A CPU on its own is pretty useless. Because of that, the project comes with a basic virtual machine to play around with. It works at 1MHz and connects the CPU to 64K of RAM and memory-mapped stdout area that can be used to print something to the terminal.
The overall memory layout looks like this:
+---------------------+
| 0x0000 - 0x00FF |
| Zero Page |
+---------------------+
| 0x0100 - 0x01FF |
| Stack | <- Stack Pointer
+---------------------+
| 0x0200 - 0x02FF |
| Stdout |
+---------------------+
| | <- Reset Vector
| | (your program starts here)
| |
| 0x0300 - 0xFFFF |
| ROM memory |
| |
| |
| |
+---------------------+
There are several examples of programs in the programs directory
that can be compiled using xa65
assembler and then executed as mos6502 hello_world
.
Unfortunateley, there are no debugging tools at the moment, so println!
is
your friend.