diff --git a/InstructionSets/x86/Implementation/PerformImplementation.hpp b/InstructionSets/x86/Implementation/PerformImplementation.hpp index 57343b294..75342dcc9 100644 --- a/InstructionSets/x86/Implementation/PerformImplementation.hpp +++ b/InstructionSets/x86/Implementation/PerformImplementation.hpp @@ -1440,11 +1440,7 @@ void stos(const InstructionT &instruction, AddressT &eCX, AddressT &eDI, IntT &e return; } - Source destination_segment = instruction.segment_override(); - if(destination_segment == Source::None) destination_segment = Source::DS; - - memory.template access(destination_segment, eDI) = eAX; - + memory.template access(Source::ES, eDI) = eAX; eDI += status.direction() * sizeof(IntT); repeat(instruction, eCX, flow_controller); diff --git a/OSBindings/Mac/Clock SignalTests/8088Tests.mm b/OSBindings/Mac/Clock SignalTests/8088Tests.mm index e63655c66..7176b479b 100644 --- a/OSBindings/Mac/Clock SignalTests/8088Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/8088Tests.mm @@ -156,7 +156,7 @@ struct Memory { // to the start. So the 16-bit value will need to be a local cache. if(address == 0xffff) { write_back_address_ = (segment_base(segment) + address) & 0xf'ffff; - write_back_value_ = memory[write_back_address_] | (memory[write_back_address_ - 65535] << 8); + write_back_value_ = memory[write_back_address_] | (memory[(write_back_address_ - 65535) & 0xf'ffff] << 8); return write_back_value_; } } @@ -168,7 +168,7 @@ struct Memory { if constexpr (std::is_same_v) { if(write_back_address_) { memory[write_back_address_] = write_back_value_ & 0xff; - memory[write_back_address_ - 65535] = write_back_value_ >> 8; + memory[(write_back_address_ - 65535) & 0xf'ffff] = write_back_value_ >> 8; write_back_address_ = 0; } }