My CP/M Simulator
8080 Emulator Code
Downloaded a public domain 8080 emu from https://www.reddit.com/r/C_Programming/comments/8loz4p/heres_a_cycleaccurate_intel_8080_emulator_i_wrote/
The arrangement of the code suits what I need. It counts cycles so I can make the emulator run in real time.
I have to add the code for TRAP/RST7.5/RST65./RST5.5, SIM/RIM and SID/SOD.
Next I found some code for getch() and getche() which will work under linux (conin.h is a windows only library).
I have coded the Serial Input but Serial Output need a bit of thought.
Just finished write an I8HEX import routine.
New 8080 Emulator
I has swapped the 8080 emulator to https://github.com/superzazu/8080.
The reason is that is emulator has a test suite to demonstrate the "correctness" of the emulator. The previous emulator code does have some minor coding errors.
I have made some cosmetic changes to the new emulator to remove the compiler warnings, and started coded the missing 8085 hardware and instructions.
Not that it is really important, I note that the "superzazu" interrupt code, only allows for a single byte interrupt opcode. A real 8080 can handle one, two and three byte interrupt opcodes.
I also simplified the function in a structure method.
Uploaded the initial test code to my file area.
Tested the i8080 part of the emulator with "myBoot.HEX" and it works fine. One error in myBoot.asm (I incorrectly swapped the source and destination registers).
Just the serial out code to do.
As pointed out by Ken Yap the multi-OpCode Interrupt issue is an 8085 "undocumented" feature.
Got the echo code working this morning. Many assembler coding errors (I don't know 8085 assemble code very well yet), and a baud timing calculation error. I did not allow for some overheads.
I really need to upgrade"superzazu"'s debug code. Otherwise the 8085 instruction I have added (i.e. SIM, RIM and interrupts TRAP, RST7.5, RST6.5 and RST5.5 seem to work, at least SIM, RIM and RST6.5 which I use.
I think the way forward is to write assembler for a boot disk with only the boot sector and bios (i.e. less ccp and fdos), and test my bios functions. The jump to ccp will be my test program.
In any case my "sight" understanding of the 8085 OpCodes is getting better.