This is a test of PCx80, a new 8080-based machine emulator recently added to the PCjs Project.
The test machine below loads a copy of the 8080 Exerciser (specifically, 8080EX1) and intercepts the exerciser’s CP/M console calls so that you can see its progress in the PCjs Debugger window. This is a “headless” test machine (no keyboard or display), so that’s all you get.
The good news: PCx80 passes all the 8080 Exerciser tests. And it doesn’t do it by using all sorts of weird “flags tables” that most other 8080 emulators seem to fall back on.
Like all the other CPU emulations in the PCjs Project, PCx80 never “calculates” the flags unless/until they are actually required, which considerably speeds up all arithmetic operations.
Of particular note are the 8080’s subtract, compare, and decrement operations, which actually perform addition, not subtraction, by using two’s complement arithmetic in “stages”: the first stage (inverting the source operand) occurs before the addition, and the second stage (incrementing the inverted operand) occurs after the addition. And it appears to be the result of the first stage, not the second, that determines the state of the Auxiliary Carry flag (AF).
At 2Mhz, the 8080 Exerciser tests take quite a while, but you can click the speed button while the machine is running to increase the simulated speed; it will revert to 2Mhz when you exceed the maximum speed that your system supports.
[PCjs Machine "test8080"]
Waiting for machine "test8080" to load....