1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Implement STR.

This commit is contained in:
Thomas Harte
2025-08-12 16:21:23 -04:00
parent 4cd979e5fb
commit ddd090d581
2 changed files with 21 additions and 1 deletions
@@ -244,4 +244,12 @@ void ltr(
context.registers.set_task_state(source);
}
template <typename ContextT>
void str(
write_t<uint16_t> destination,
ContextT &context
) {
destination = context.registers.task_state();
}
}
@@ -581,8 +581,9 @@ template <
assert(false);
}
break;
case Operation::LTR:
if constexpr (ContextT::model >= Model::i80286) {
if constexpr (ContextT::model >= Model::i80286 && std::is_same_v<IntT, uint16_t>) {
if(is_real(context.cpu_control.mode())) {
throw Exception::exception<Vector::InvalidOpcode>();
return;
@@ -592,6 +593,17 @@ template <
assert(false);
}
break;
case Operation::STR:
if constexpr (ContextT::model >= Model::i80286 && std::is_same_v<IntT, uint16_t>) {
if(is_real(context.cpu_control.mode())) {
throw Exception::exception<Vector::InvalidOpcode>();
return;
}
Primitive::str(destination_w(), context);
} else {
assert(false);
}
break;
// TODO to reach a full 80286:
//