ASH was incorrectly implemented: 'ss' in the documentation is still the regular addressing mode
This commit is contained in:
parent
3e82a3d17a
commit
949fd5f7f8
1 changed files with 9 additions and 4 deletions
13
cpu.cpp
13
cpu.cpp
|
@ -466,8 +466,9 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
|
|||
}
|
||||
|
||||
case 2: { // ASH
|
||||
int16_t R = getRegister(reg), oldR = R;
|
||||
int8_t shift = dst > 31 ? -(64 - dst) : dst;
|
||||
int16_t R = getRegister(reg), oldR = R;
|
||||
uint16_t a = getGAMAddress(dst_mode, dst_reg, false, false);
|
||||
int16_t shift = b->read(a, false);
|
||||
|
||||
if (shift > 0) {
|
||||
R <<= shift - 1;
|
||||
|
@ -475,7 +476,7 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
|
|||
R <<= 1;
|
||||
}
|
||||
else if (shift < 0) {
|
||||
R >>= -shift - 1;
|
||||
R >>= -(shift - 1);
|
||||
setPSW_c(R & 1);
|
||||
R >>= 1;
|
||||
}
|
||||
|
@ -484,7 +485,11 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
|
|||
setPSW_z(R == 0);
|
||||
setPSW_v(sign(R) != sign(oldR));
|
||||
|
||||
setRegister(reg, R);
|
||||
if (dst_mode == 0)
|
||||
putGAM(dst_mode, dst_reg, false, R, false);
|
||||
else
|
||||
b->write(a, false, R);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue