From daa940986fadadd27a55d9c88fcecc938f2d78e6 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Sun, 20 Mar 2022 18:17:50 +0100 Subject: [PATCH] clarified BGE/BLE/BGT (in conditional_branch_instructions) --- cpu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu.cpp b/cpu.cpp index 8ed9916..82cd630 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -896,7 +896,7 @@ bool cpu::conditional_branch_instructions(const uint16_t instr) break; case 0b00000100: // BGE - take = (getPSW_n() ^ getPSW_v()) == false; + take = getPSW_n() == getPSW_v(); break; case 0b00000101: // BLT @@ -904,11 +904,11 @@ bool cpu::conditional_branch_instructions(const uint16_t instr) break; case 0b00000110: // BGT - take = ((getPSW_n() ^ getPSW_v()) | getPSW_z()) == false; + take = getPSW_n() == getPSW_v() && getPSW_z() == false; break; case 0b00000111: // BLE - take = (getPSW_n() ^ getPSW_v()) | getPSW_z(); + take = getPSW_n() != getPSW_v() | getPSW_z(); break; case 0b10000000: // BPL