A trinary CPU emulator