SBCB v-flag fix
This commit is contained in:
parent
c771973943
commit
49e77cfdcb
1 changed files with 3 additions and 6 deletions
9
cpu.cpp
9
cpu.cpp
|
@ -916,7 +916,7 @@ bool cpu::single_operand_instructions(const uint16_t instr)
|
||||||
else {
|
else {
|
||||||
auto a = getGAM(dst_mode, dst_reg, word_mode, rm_cur);
|
auto a = getGAM(dst_mode, dst_reg, word_mode, rm_cur);
|
||||||
int32_t vl = (a.value.value() + 1) & (word_mode == wm_byte ? 0xff : 0xffff);
|
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) {
|
if (set_flags) {
|
||||||
setPSW_n(SIGN(vl, word_mode));
|
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_n(SIGN(v, word_mode));
|
||||||
setPSW_z(IS_0(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)
|
if (IS_0(vo, word_mode) && org_c)
|
||||||
setPSW_c(true);
|
setPSW_c(true);
|
||||||
|
@ -1071,10 +1071,7 @@ bool cpu::single_operand_instructions(const uint16_t instr)
|
||||||
setPSW_z(IS_0(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);
|
||||||
|
|
||||||
if (IS_0(vo, word_mode) && org_c)
|
setPSW_c(IS_0(vo, word_mode) && org_c);
|
||||||
setPSW_c(true);
|
|
||||||
else
|
|
||||||
setPSW_c(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue