1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00

Default segment is ::DS if there was no base.

This commit is contained in:
Thomas Harte 2023-09-22 17:03:40 -04:00
parent 5a5f71e703
commit c8c0c3ca6d
2 changed files with 5 additions and 4 deletions

View File

@ -629,10 +629,11 @@ class DataPointer {
/// @returns The default segment to use for this access.
constexpr Source default_segment() const {
switch(source_) {
default: return Source::None;
default:
case Source::IndirectNoBase:
return Source::None;
case Source::Indirect:
case Source::IndirectNoBase:
switch(base()) {
default: return Source::DS;
case Source::eBP:

View File

@ -153,10 +153,10 @@ constexpr char TestSuiteHome[] = "/Users/tharte/Projects/ProcessorTests/8088/v1"
stream << InstructionSet::x86::to_string(pointer.base(), data_size(instruction.address_size()));
stream << '+' << InstructionSet::x86::to_string(pointer.index(), data_size(instruction.address_size()));
if(instruction.offset()) {
stream << '+' << std::setfill('0') << std::setw(4) << std::uppercase << std::hex << instruction.offset() << 'h';
stream << '+' << to_hex(instruction.offset(), 4);
}
} else {
stream << to_hex(instruction.operand(), 4);
stream << to_hex(instruction.offset(), 4);
}
stream << ']';
return stream.str();