Martin_H wrote:
What is your processor?
It is a 32 bit risc-like processor (could also be 16 bit, but I prefer 32 bit because of the larger address space) and looks like a mixture of 6502 and 68000. For example, it has processor flags like the 6502, but branch instructions like the 68000. However, it was actually inspired by the 65org16 and, like it, has a 16 bit data bus with 16 bit memory word width. The instruction length is 16 bits with the option of storing constants in a further 16 or 32 bits. There are 16 registers with r15 as a stack pointer. Register 14 acts as a kind of pointer to the zero page for fast loading and saving (but without R-M-W instructions). As r14 is often used for handling objects, it is called the object pointer.
The processor is designed for a) high code density (there are special short forms for many instructions when using an 8-bit constant) and b) simple organisation of the instruction set. This not only facilitates emulation, but also makes it possible to squeeze the processor together with some program code into very small FPGAs.
The instruction set has a special instruction EXT (coded as $00xx). Here, the lower 8 bits can specify 256 new, extended instructions, e.g. all instructions of the 65c02. After adding a separate S register, in emulation the processor behaves exactly like a 65c02, and it is possible to mix 65c02 code and the processor's own instructions as desired. Since my Apple II emulator emulates this processor, I can patch programs such as "Elite" at will, and because of the 32-bit address width, the additional code can lie outside the 64 kb address space (or 128 kb for the Apple //e). Furthermore, an FPGA implementation (without the additional 65c02 core) was also successfully tested. As far as speed is concerned, 1 Mhz is roughly equivalent to a 4 Mhz 68000.
Personally, I like the easy handling of the processor (somewhere between 6502 and 68000) despite some oddities. For example, in contrast to the 68000 or 6502, there are no instructions such as "ADD <ea>, dx" due to the risc nature, and there is no absolute addressing because all programs are designed for relocation. Instead, r13 is usually used as a pointer to global data. If you want to access absolute addresses, e.g. I/O registers, you first load the base address into a register (preferably r14) and then use the addressing mode "<d8>(r14)" or "d32(rx)".
In short, as someone wrote above about the 68000, it's actually fun to program the processor in assembly language.