1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-12-19 14:18:05 +00:00

Propagate mode change.

This commit is contained in:
Thomas Harte
2025-03-22 23:00:51 -04:00
parent d10164be26
commit 2768b66d10
6 changed files with 49 additions and 3 deletions

View File

@@ -10,6 +10,7 @@
#include "InstructionSets/x86/AccessType.hpp"
#include "InstructionSets/x86/Descriptors.hpp"
#include "InstructionSets/x86/Mode.hpp"
#include <utility>
@@ -91,7 +92,14 @@ void lmsw(
read_t<uint16_t> source,
ContextT &context
) {
assert(false);
context.registers.set_msw(source);
if(source & 1) {
context.memory.set_mode(Mode::Protected286);
context.segments.set_mode(Mode::Protected286);
}
// TODO: all other bits. Anything?
assert(!(source & ~1));
}
template <DescriptorTable table, typename AddressT, typename InstructionT, typename ContextT>