another ASH/ASHC fix
This commit is contained in:
parent
6951e1b520
commit
1095e4823b
1 changed files with 4 additions and 5 deletions
9
cpu.cpp
9
cpu.cpp
|
@ -521,9 +521,9 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
|
|||
else {
|
||||
// extend sign-bit
|
||||
if (R & 0x8000) // convert to unsigned 32b int & extend sign
|
||||
R = (uint32_t(R) | 0xffff0000) >> (64 - shift - 1);
|
||||
R = (uint32_t(R) | 0xffff0000) >> (64 - (shift - 1));
|
||||
else
|
||||
R >>= 64 - shift - 1;
|
||||
R >>= 64 - (shift - 1);
|
||||
|
||||
setPSW_c(R & 1);
|
||||
R >>= 1;
|
||||
|
@ -556,10 +556,9 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
|
|||
else {
|
||||
// extend sign-bit
|
||||
if (R0R1 & 0x80000000) // convert to unsigned 64b int & extend sign
|
||||
R0R1 = (uint64_t(R0R1) | 0xffffffff0000) >> (64 - shift - 1);
|
||||
R0R1 = (uint64_t(R0R1) | 0xffffffff00000000ll) >> (64 - (shift - 1));
|
||||
else
|
||||
R0R1 >>= 64 - shift - 1;
|
||||
|
||||
R0R1 >>= 64 - (shift - 1);
|
||||
|
||||
setPSW_c(R0R1 & 1);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue