1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Add page 8.

This commit is contained in:
Thomas Harte 2022-04-11 16:32:57 -04:00
parent 8e3cccf4d6
commit 21ac9363e9
2 changed files with 25 additions and 1 deletions

View File

@ -113,8 +113,9 @@ template <Operation operation> Preinstruction Predecoder::decode(uint16_t instru
}
//
// MARK: MULU, MULS.
// MARK: MULU, MULS, DIVU, DIVS.
//
case Operation::DIVU: case Operation::DIVS:
case Operation::MULU: case Operation::MULS:
return Preinstruction(operation,
ea_combined_mode, ea_register,
@ -125,6 +126,27 @@ template <Operation operation> Preinstruction Predecoder::decode(uint16_t instru
// MARK: - Page decoders.
Preinstruction Predecoder::decode8(uint16_t instruction) {
// 4-171 (p275)
if((instruction & 0x1f0) == 0x100) return decode<Operation::SBCD>(instruction);
// 4-150 (p254)
switch(instruction & 0x0c0) {
case 0x00: return decode<Operation::ORb>(instruction);
case 0x40: return decode<Operation::ORw>(instruction);
case 0x80: return decode<Operation::ORl>(instruction);
default: break;
}
switch(instruction & 0x1c0) {
case 0x0c0: return decode<Operation::DIVU>(instruction); // 4-97 (p201)
case 0x1c0: return decode<Operation::DIVS>(instruction); // 4-93 (p197)
default: break;
}
return Preinstruction();
}
Preinstruction Predecoder::decodeC(uint16_t instruction) {
// 4-3 (p107)
if((instruction & 0x1f0) == 0x100) return decode<Operation::ABCD>(instruction);
@ -157,6 +179,7 @@ Preinstruction Predecoder::decodeC(uint16_t instruction) {
Preinstruction Predecoder::decode(uint16_t instruction) {
// Divide first based on line.
switch(instruction & 0xf000) {
case 0x8000: return decode8(instruction);
case 0xc000: return decodeC(instruction);
default: break;

View File

@ -26,6 +26,7 @@ class Predecoder {
private:
// Page by page decoders; each gets a bit ad hoc so
// it is neater to separate them.
Preinstruction decode8(uint16_t instruction);
Preinstruction decodeC(uint16_t instruction);
// Specific instruction decoders.