It has been a fruitful day of hacking.
The emulator has implemented enough instructions so that MBASIC can run this program:
Code: Select all
100 print "Hello "+"world."
110 gosub 200
120 end
200 for i=10 to 1 step -1 : print i : next i : print "Liftoff...we have liftoff!"
210 return
A bit of history...
Three weeks ago, I set out to start implementing an emulator to run FLEX programs written for the 6800 on the 6502. Immediately, there were significant issues which required organized thought instead of merely hacking through them.
So the next day, I pivoted to an emulator to allow running 8080 programs written for the CP/M operating system.
* the 8080 is an easier processor to simulate. Many instructions do not change the status flags.
* the 8080 has input and output instructions. It is not necessary to emulate memory-mapped I/O so an emulator is simpler and likely faster.
* The CP/M operating system has a simpler API than FLEX.
The initial version runs in the 6800 FLEX environment. After a week of good process, work began on a version for the 6502.
The 6502 version has caught up with its 6800 sibling and now both progress together in lockstep.
Current efforts run completely in a bare emulator environment so that I do not have to boot FLEX to test and I do not have to continually move files onto a virtual disk. For faster turnaround, the 8080 program is built into the emulator image. There is no disk access provided to the simulated program at this time.
The test programs used so far include:
* The Space Voyage game paraphrased from the original 6800 code to the 8080 instruction set.
* DDT, the CP/M debugger.
* MBASIC, the CP/M version of Microsoft BASIC