ASH carry flag
This commit is contained in:
parent
dd546c34d7
commit
a965b9ce7e
1 changed files with 5 additions and 4 deletions
7
cpu.cpp
7
cpu.cpp
|
@ -832,6 +832,7 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
|
||||||
setPSW_v(false);
|
setPSW_v(false);
|
||||||
}
|
}
|
||||||
else if (shift < 32) {
|
else if (shift < 32) {
|
||||||
|
if (shift > 15)
|
||||||
setPSW_c((R << (shift - 16)) & 1);
|
setPSW_c((R << (shift - 16)) & 1);
|
||||||
setPSW_v(false);
|
setPSW_v(false);
|
||||||
for(int i=0; i<shift; i++) {
|
for(int i=0; i<shift; i++) {
|
||||||
|
@ -839,6 +840,8 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
|
||||||
if (SIGN(R, wm_word) != sign)
|
if (SIGN(R, wm_word) != sign)
|
||||||
setPSW_v(true);
|
setPSW_v(true);
|
||||||
}
|
}
|
||||||
|
if (shift <= 15)
|
||||||
|
setPSW_c(R & 0x10000);
|
||||||
}
|
}
|
||||||
else if (shift == 32) {
|
else if (shift == 32) {
|
||||||
R = -sign;
|
R = -sign;
|
||||||
|
@ -857,10 +860,8 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
R &= 0xffff;
|
|
||||||
|
|
||||||
setPSW_n(SIGN(R, wm_word));
|
setPSW_n(SIGN(R, wm_word));
|
||||||
setPSW_z(R == 0);
|
setPSW_z((R & 0xffff) == 0);
|
||||||
|
|
||||||
set_register(reg, R);
|
set_register(reg, R);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue