1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Add STC, STD, STI.

This commit is contained in:
Thomas Harte 2023-10-09 22:16:37 -04:00
parent 5e830781cc
commit 0412890923
3 changed files with 10 additions and 1 deletions

View File

@ -610,6 +610,9 @@ void cwd(IntT &dx, IntT ax) {
inline void clc(Status &status) { status.carry = 0; }
inline void cld(Status &status) { status.direction = 0; }
inline void cli(Status &status) { status.interrupt = 0; } // TODO: quite a bit more in protected mode.
inline void stc(Status &status) { status.carry = 1; }
inline void std(Status &status) { status.direction = 1; }
inline void sti(Status &status) { status.interrupt = 1; } // TODO: quite a bit more in protected mode.
inline void cmc(Status &status) { status.carry = !status.carry; }
}
@ -731,6 +734,9 @@ template <
case Operation::CLC: Primitive::clc(status); return;
case Operation::CLD: Primitive::cld(status); return;
case Operation::CLI: Primitive::cli(status); return;
case Operation::STC: Primitive::stc(status); return;
case Operation::STD: Primitive::std(status); return;
case Operation::STI: Primitive::sti(status); return;
case Operation::CMC: Primitive::cmc(status); return;
}

View File

@ -195,7 +195,7 @@ enum class Operation: uint8_t {
CLI,
/// Set carry flag.
STC,
/// Set decimal flag.
/// Set direction flag.
STD,
/// Set interrupt flag.
STI,

View File

@ -330,6 +330,9 @@ struct FailedExecution {
@"F8.json.gz", // CLC
@"FC.json.gz", // CLD
@"FA.json.gz", // CLI
@"F9.json.gz", // STC
@"FD.json.gz", // STD
@"FB.json.gz", // STI
@"F5.json.gz", // CMC
]];