ASL: do not extend sign
This commit is contained in:
parent
1b155473d2
commit
dd437e65db
1 changed files with 1 additions and 2 deletions
3
cpu.cpp
3
cpu.cpp
|
@ -1045,14 +1045,13 @@ bool cpu::single_operand_instructions(const uint16_t instr)
|
||||||
uint16_t a = getGAMAddress(dst_mode, dst_reg, word_mode, false);
|
uint16_t a = getGAMAddress(dst_mode, dst_reg, word_mode, false);
|
||||||
int32_t vl = b -> read(a, word_mode);
|
int32_t vl = b -> read(a, word_mode);
|
||||||
uint16_t v = (vl << 1) & (word_mode ? 0xff : 0xffff);
|
uint16_t v = (vl << 1) & (word_mode ? 0xff : 0xffff);
|
||||||
uint16_t add = word_mode ? v & 0xff00 : 0;
|
|
||||||
|
|
||||||
setPSW_n(word_mode ? v & 0x80 : v & 0x8000);
|
setPSW_n(word_mode ? v & 0x80 : v & 0x8000);
|
||||||
setPSW_z(v == 0);
|
setPSW_z(v == 0);
|
||||||
setPSW_c(word_mode ? vl & 0x80 : vl & 0x8000);
|
setPSW_c(word_mode ? vl & 0x80 : vl & 0x8000);
|
||||||
setPSW_v(getPSW_n() ^ getPSW_c());
|
setPSW_v(getPSW_n() ^ getPSW_c());
|
||||||
|
|
||||||
put_result(a, dst_mode, dst_reg, word_mode, v | add);
|
put_result(a, dst_mode, dst_reg, word_mode, v);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue