SBCB v-flag fix

This commit is contained in:
folkert van heusden 2024-04-04 21:55:54 +02:00
parent c771973943
commit 49e77cfdcb
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -916,7 +916,7 @@ bool cpu::single_operand_instructions(const uint16_t instr)
else {
auto a = getGAM(dst_mode, dst_reg, word_mode, rm_cur);
int32_t vl = (a.value.value() + 1) & (word_mode == wm_byte ? 0xff : 0xffff);
bool set_flags = a.addr.value() != ADDR_PSW;
bool set_flags = a.addr.value() != ADDR_PSW; // FIXME
if (set_flags) {
setPSW_n(SIGN(vl, word_mode));
@ -1047,7 +1047,7 @@ bool cpu::single_operand_instructions(const uint16_t instr)
setPSW_n(SIGN(v, word_mode));
setPSW_z(IS_0(v, word_mode));
setPSW_v(word_mode == wm_byte ? (vo & 0xff) == 0x80 : vo == 0x8000);
setPSW_v((word_mode == wm_byte ? (vo & 0xff) == 0x80 : vo == 0x8000) && org_c);
if (IS_0(vo, word_mode) && org_c)
setPSW_c(true);
@ -1071,10 +1071,7 @@ bool cpu::single_operand_instructions(const uint16_t instr)
setPSW_z(IS_0(v, word_mode));
setPSW_v(word_mode == wm_byte ? (vo & 0xff) == 0x80 : vo == 0x8000);
if (IS_0(vo, word_mode) && org_c)
setPSW_c(true);
else
setPSW_c(false);
setPSW_c(IS_0(vo, word_mode) && org_c);
}
}
break;