mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Fix memory handler, STOS.
This commit is contained in:
parent
93e90b09a0
commit
4efc181f07
@ -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<IntT>(destination_segment, eDI) = eAX;
|
||||
|
||||
memory.template access<IntT>(Source::ES, eDI) = eAX;
|
||||
eDI += status.direction<AddressT>() * sizeof(IntT);
|
||||
|
||||
repeat<AddressT>(instruction, eCX, flow_controller);
|
||||
|
@ -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<IntT, uint16_t>) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user