From 55c5f4a31d4180a38608136927bf3cd305b94ba4 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Mon, 8 Apr 2019 12:38:17 +0200 Subject: [PATCH] Fix O-flag computation --- MicroEmu.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MicroEmu.kt b/MicroEmu.kt index 352ddb7..fd3a5b5 100644 --- a/MicroEmu.kt +++ b/MicroEmu.kt @@ -119,7 +119,7 @@ class MachineState { flag_Z = result == 0.toShort() flag_N = result < 0 flag_C = result <= registers.ar - flag_O = result.getBitAt(6) != registers.ar.getBitAt(6) + flag_O = (result.getBitAt(7) == bus_to.getBitAt(7)) && (registers.ar.getBitAt(7) != result.getBitAt(7)) result } 5 ->{