peekWord -> peek_word

This commit is contained in:
Folkert van Heusden 2024-06-19 14:49:37 +02:00
parent 5f102348b6
commit 2e76dbc975
Signed by untrusted user who does not match committer: folkert
GPG key ID: 30190E8C1F28D8AE
3 changed files with 14 additions and 14 deletions

View file

@ -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);
}
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);
}

2
bus.h
View file

@ -126,7 +126,7 @@ public:
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) 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);
uint16_t readPhysical(const uint32_t a);

24
cpu.cpp
View file

@ -1900,7 +1900,7 @@ cpu::operand_parameters cpu::addressing_to_string(const uint8_t mode_register, c
{
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;
@ -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) };
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:
if (reg == 7)
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:
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:
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:
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:
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:
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 };
@ -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
{
uint16_t instruction = b->peekWord(addr);
uint16_t instruction = b->peek_word(addr);
word_mode_t word_mode = instruction & 0x8000 ? wm_byte : wm_word;
std::string word_mode_str = word_mode == wm_byte ? "B" : "";