comment
This commit is contained in:
parent
cbe5eaca18
commit
423a2cd434
1 changed files with 8 additions and 5 deletions
13
cpu.cpp
13
cpu.cpp
|
@ -806,6 +806,8 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
|
||||||
addToMMR1(g_dst);
|
addToMMR1(g_dst);
|
||||||
uint16_t shift = g_dst.value.value() & 077;
|
uint16_t shift = g_dst.value.value() & 077;
|
||||||
|
|
||||||
|
DOLOG(debug, true, "shift %06o with %d", R, shift);
|
||||||
|
|
||||||
bool sign = SIGN(R, wm_word);
|
bool sign = SIGN(R, wm_word);
|
||||||
|
|
||||||
if (shift == 0) {
|
if (shift == 0) {
|
||||||
|
@ -830,13 +832,14 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int shift_n = 64 - shift;
|
int shift_n = 64 - shift;
|
||||||
uint64_t value = (0xffffffff00000000ll | R) >> shift_n;
|
uint16_t new_value = (uint64_t(0xffffffff0000) | R) >> (shift_n - 1);
|
||||||
|
|
||||||
setPSW_c(R >> (shift_n - 1));
|
setPSW_c(new_value & 1);
|
||||||
|
new_value >>= 1;
|
||||||
|
|
||||||
|
R = new_value;
|
||||||
|
|
||||||
setPSW_v(SIGN(R, wm_word) != SIGN(oldR, wm_word));
|
setPSW_v(SIGN(R, wm_word) != SIGN(oldR, wm_word));
|
||||||
|
|
||||||
R = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
R &= 0xffff;
|
R &= 0xffff;
|
||||||
|
@ -2065,7 +2068,7 @@ std::map<std::string, std::vector<std::string> > cpu::disassemble(const uint16_t
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text.empty() && name.empty() == false)
|
if (text.empty() && name.empty() == false)
|
||||||
text = name + space + src_text + comma + dst_text.operand;
|
text = name + space + src_text + comma + dst_text.operand; // TODO: swap for ASH, ASHC
|
||||||
|
|
||||||
if (text.empty() == false && next_word != -1)
|
if (text.empty() == false && next_word != -1)
|
||||||
instruction_words.push_back(next_word);
|
instruction_words.push_back(next_word);
|
||||||
|
|
Loading…
Add table
Reference in a new issue