peekWord -> peek_word
This commit is contained in:
parent
5f102348b6
commit
2e76dbc975
3 changed files with 14 additions and 14 deletions
2
bus.cpp
2
bus.cpp
|
@ -861,7 +861,7 @@ uint16_t bus::read_word(const uint16_t a, const d_i_space_t s)
|
||||||
return read(a, wm_word, rm_cur, false, s);
|
return read(a, wm_word, rm_cur, false, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t bus::peekWord(const uint16_t a)
|
uint16_t bus::peek_word(const uint16_t a)
|
||||||
{
|
{
|
||||||
return read(a, wm_word, rm_cur, true);
|
return read(a, wm_word, rm_cur, true);
|
||||||
}
|
}
|
||||||
|
|
2
bus.h
2
bus.h
|
@ -126,7 +126,7 @@ public:
|
||||||
uint8_t read_byte(const uint16_t a) override { return read(a, wm_byte, rm_cur); }
|
uint8_t read_byte(const uint16_t a) override { return read(a, wm_byte, rm_cur); }
|
||||||
uint16_t read_word(const uint16_t a, const d_i_space_t s);
|
uint16_t read_word(const uint16_t a, const d_i_space_t s);
|
||||||
uint16_t read_word(const uint16_t a) override { return read_word(a, i_space); }
|
uint16_t read_word(const uint16_t a) override { return read_word(a, i_space); }
|
||||||
uint16_t peekWord(const uint16_t a);
|
uint16_t peek_word(const uint16_t a);
|
||||||
uint8_t readUnibusByte(const uint32_t a);
|
uint8_t readUnibusByte(const uint32_t a);
|
||||||
uint16_t readPhysical(const uint32_t a);
|
uint16_t readPhysical(const uint32_t a);
|
||||||
|
|
||||||
|
|
24
cpu.cpp
24
cpu.cpp
|
@ -1900,7 +1900,7 @@ cpu::operand_parameters cpu::addressing_to_string(const uint8_t mode_register, c
|
||||||
{
|
{
|
||||||
assert(mode_register < 64);
|
assert(mode_register < 64);
|
||||||
|
|
||||||
uint16_t next_word = b->peekWord(pc & 65535);
|
uint16_t next_word = b->peek_word(pc & 65535);
|
||||||
|
|
||||||
int reg = mode_register & 7;
|
int reg = mode_register & 7;
|
||||||
|
|
||||||
|
@ -1919,37 +1919,37 @@ cpu::operand_parameters cpu::addressing_to_string(const uint8_t mode_register, c
|
||||||
return { reg_name, 2, -1, uint16_t(getRegister(reg) & mask) };
|
return { reg_name, 2, -1, uint16_t(getRegister(reg) & mask) };
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
return { format("(%s)", reg_name.c_str()), 2, -1, uint16_t(b->peekWord(getRegister(reg)) & mask) };
|
return { format("(%s)", reg_name.c_str()), 2, -1, uint16_t(b->peek_word(getRegister(reg)) & mask) };
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
if (reg == 7)
|
if (reg == 7)
|
||||||
return { format("#%06o", next_word), 4, int(next_word), uint16_t(next_word & mask) };
|
return { format("#%06o", next_word), 4, int(next_word), uint16_t(next_word & mask) };
|
||||||
|
|
||||||
return { format("(%s)+", reg_name.c_str()), 2, -1, uint16_t(b->peekWord(getRegister(reg)) & mask) };
|
return { format("(%s)+", reg_name.c_str()), 2, -1, uint16_t(b->peek_word(getRegister(reg)) & mask) };
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
if (reg == 7)
|
if (reg == 7)
|
||||||
return { format("@#%06o", next_word), 4, int(next_word), uint16_t(b->peekWord(next_word) & mask) };
|
return { format("@#%06o", next_word), 4, int(next_word), uint16_t(b->peek_word(next_word) & mask) };
|
||||||
|
|
||||||
return { format("@(%s)+", reg_name.c_str()), 2, -1, uint16_t(b->peekWord(b->peekWord(getRegister(reg))) & mask) };
|
return { format("@(%s)+", reg_name.c_str()), 2, -1, uint16_t(b->peek_word(b->peek_word(getRegister(reg))) & mask) };
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
return { format("-(%s)", reg_name.c_str()), 2, -1, uint16_t(b->peekWord(getRegister(reg) - (word_mode == wm_word || reg >= 6 ? 2 : 1)) & mask) };
|
return { format("-(%s)", reg_name.c_str()), 2, -1, uint16_t(b->peek_word(getRegister(reg) - (word_mode == wm_word || reg >= 6 ? 2 : 1)) & mask) };
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
return { format("@-(%s)", reg_name.c_str()), 2, -1, uint16_t(b->peekWord(b->peekWord(getRegister(reg) - 2)) & mask) };
|
return { format("@-(%s)", reg_name.c_str()), 2, -1, uint16_t(b->peek_word(b->peek_word(getRegister(reg) - 2)) & mask) };
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
if (reg == 7)
|
if (reg == 7)
|
||||||
return { format("%06o", (pc + next_word + 2) & 65535), 4, int(next_word), uint16_t(b->peekWord(getRegister(reg) + next_word) & mask) };
|
return { format("%06o", (pc + next_word + 2) & 65535), 4, int(next_word), uint16_t(b->peek_word(getRegister(reg) + next_word) & mask) };
|
||||||
|
|
||||||
return { format("%o(%s)", next_word, reg_name.c_str()), 4, int(next_word), uint16_t(b->peekWord(getRegister(reg) + next_word) & mask) };
|
return { format("%o(%s)", next_word, reg_name.c_str()), 4, int(next_word), uint16_t(b->peek_word(getRegister(reg) + next_word) & mask) };
|
||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
if (reg == 7)
|
if (reg == 7)
|
||||||
return { format("@%06o", next_word), 4, int(next_word), uint16_t(b->peekWord(b->peekWord(getRegister(reg) + next_word)) & mask) };
|
return { format("@%06o", next_word), 4, int(next_word), uint16_t(b->peek_word(b->peek_word(getRegister(reg) + next_word)) & mask) };
|
||||||
|
|
||||||
return { format("@%o(%s)", next_word, reg_name.c_str()), 4, int(next_word), uint16_t(b->peekWord(b->peekWord(getRegister(reg) + next_word)) & mask) };
|
return { format("@%o(%s)", next_word, reg_name.c_str()), 4, int(next_word), uint16_t(b->peek_word(b->peek_word(getRegister(reg) + next_word)) & mask) };
|
||||||
}
|
}
|
||||||
|
|
||||||
return { "??", 0, -1, 0123456 };
|
return { "??", 0, -1, 0123456 };
|
||||||
|
@ -1957,7 +1957,7 @@ cpu::operand_parameters cpu::addressing_to_string(const uint8_t mode_register, c
|
||||||
|
|
||||||
std::map<std::string, std::vector<std::string> > cpu::disassemble(const uint16_t addr) const
|
std::map<std::string, std::vector<std::string> > cpu::disassemble(const uint16_t addr) const
|
||||||
{
|
{
|
||||||
uint16_t instruction = b->peekWord(addr);
|
uint16_t instruction = b->peek_word(addr);
|
||||||
|
|
||||||
word_mode_t word_mode = instruction & 0x8000 ? wm_byte : wm_word;
|
word_mode_t word_mode = instruction & 0x8000 ? wm_byte : wm_word;
|
||||||
std::string word_mode_str = word_mode == wm_byte ? "B" : "";
|
std::string word_mode_str = word_mode == wm_byte ? "B" : "";
|
||||||
|
|
Loading…
Add table
Reference in a new issue