mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-02-22 05:29:01 +00:00
Correct a couple of small disassembly issues in the 8080 implementation
Signed-off-by: Adrian.Conlon <adrian.conlon@arup.com>
This commit is contained in:
parent
2ae4e8331e
commit
ff21263b97
@ -14,7 +14,7 @@ namespace EightBit {
|
||||
static std::string state(Intel8080& cpu);
|
||||
std::string disassemble(Intel8080& cpu);
|
||||
|
||||
static std::string flag(uint8_t value, int flag, const std::string& represents);
|
||||
static std::string flag(uint8_t value, int flag, std::string represents, std::string off = "-");
|
||||
static std::string flags(uint8_t value);
|
||||
static std::string hex(uint8_t value);
|
||||
static std::string hex(uint16_t value);
|
||||
|
@ -339,7 +339,7 @@ void EightBit::Disassembler::disassemble(
|
||||
}
|
||||
break;
|
||||
case 2: // Operate on accumulator and register/memory location
|
||||
specification = alu(y) + " A," + R(z);
|
||||
specification = alu(y) + " " + R(z);
|
||||
break;
|
||||
case 3:
|
||||
switch (z) {
|
||||
@ -437,9 +437,9 @@ void EightBit::Disassembler::disassemble(
|
||||
}
|
||||
}
|
||||
|
||||
std::string EightBit::Disassembler::flag(uint8_t value, int flag, const std::string& represents) {
|
||||
std::string EightBit::Disassembler::flag(uint8_t value, int flag, std::string represents, std::string off) {
|
||||
std::ostringstream output;
|
||||
output << (value & flag ? represents : "-");
|
||||
output << (value & flag ? represents : off);
|
||||
return output.str();
|
||||
}
|
||||
|
||||
@ -448,11 +448,11 @@ std::string EightBit::Disassembler::flags(uint8_t value) {
|
||||
output
|
||||
<< flag(value, Intel8080::SF, "S")
|
||||
<< flag(value, Intel8080::ZF, "Z")
|
||||
<< flag(value, Processor::Bit5, "5")
|
||||
<< flag(value, Processor::Bit5, "1", "0")
|
||||
<< flag(value, Intel8080::AC, "A")
|
||||
<< flag(value, Processor::Bit3, "3")
|
||||
<< flag(value, Processor::Bit3, "1", "0")
|
||||
<< flag(value, Intel8080::PF, "P")
|
||||
<< flag(value, Processor::Bit1, "1")
|
||||
<< flag(value, Processor::Bit1, "1", "0")
|
||||
<< flag(value, Intel8080::CF, "C");
|
||||
return output.str();
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ EightBit::Intel8080::Intel8080(Memory& memory, InputOutput& ports)
|
||||
void EightBit::Intel8080::initialise() {
|
||||
IntelProcessor::initialise();
|
||||
AF().word = BC().word = DE().word = HL().word = 0;
|
||||
adjustReservedFlags();
|
||||
}
|
||||
|
||||
#pragma region Interrupt routines
|
||||
|
Loading…
x
Reference in New Issue
Block a user